Commit 6bc63691 sunke

西门子普通料架

1 个父辈 fe95fc30
......@@ -152,7 +152,7 @@ public class SmfApi {
}
}
return null;
return barcode;
}
public LiteOrder fetchOrder(String orderNumber, String username){
......
......@@ -132,12 +132,16 @@ public class MaterialController {
Sort.Order partNumberOrder = pageable.getSort().getOrderFor("partNumber");
if(partNumberOrder != null){
comparator = Comparator.comparing(InventoryItemDto::getPartNumber,Comparator.nullsFirst(String::compareTo));
if(stockCountOrder.isDescending()){
if(partNumberOrder.isDescending()){
comparator = comparator.reversed();
}
}
resultList = resultList.stream().sorted(comparator).collect(Collectors.toList());
// System.out.println("================");
// for (InventoryItemDto dto : resultList) {
// System.out.println(dto.getPartNumber() + "---" + dto.getStockCount() + " --- " + dto.getStockReel());
// }
return resultList;
}
......
......@@ -176,12 +176,14 @@ public class TaskService {
for (DataLog task : tasks) {
String barcode = taskToExecute.getBarcode();
String posName = taskToExecute.getPosName();
if (!Strings.isNullOrEmpty(barcode) && task.getBarcode().equals(barcode)) {
log.info("二维码:[" + barcode + "]已在操作队列中,操作失败");
throw new ValidateException("smfcore.error.barcode.inQueue", "二维码[{0}]已在操作队列中,操作失败", new String[]{barcode});
} else if (task.getPosName().equals(posName)&& ObjectUtil.isNotEmpty(posName)) {
log.info("位置:[" + posName + "]已在操作队列中,操作失败");
throw new ValidateException("smfcore.error.pos.inQueue", "位置:[{0}}]已在操作队列中,操作失败", new String[]{posName});
if(task.getType() == taskToExecute.getType()){
if (!Strings.isNullOrEmpty(barcode) && task.getBarcode().equals(barcode)) {
log.info("二维码:[" + barcode + "]已在操作队列中,操作失败");
throw new ValidateException("smfcore.error.barcode.inQueue", "二维码[{0}]已在操作队列中,操作失败", new String[]{barcode});
} else if (task.getPosName().equals(posName)&& ObjectUtil.isNotEmpty(posName)) {
log.info("位置:[" + posName + "]已在操作队列中,操作失败");
throw new ValidateException("smfcore.error.pos.inQueue", "位置:[{0}}]已在操作队列中,操作失败", new String[]{posName});
}
}
}
updateQueueTask(taskToExecute);
......
......@@ -21,13 +21,11 @@ import java.util.HashMap;
import java.util.Map;
/**
* Siemens
* #host: "140.231.193.101"
* port:
* #url: "http://cnctu04053:8014/api/JsonC"
* #url_checkIn: "http://cnctu04053:8014/api/JsonC"
* #url: "http://cnctu041p059:8014/api/JsonC"
* #url: "http://cnctu04053:8014/api/JsonC"
* api:
* name: Siemens
* inCheckUrl: http://cnctu04053:8014/api/JsonC
* outNotifyUrl: http://cnctu04053:8014/api/JsonC
* inNotifyUrl: http://cnctu04053:8014/api/JsonC
*
* action:
* GetMaterialLot: "http://siplace.com/facts/materiallot/2010/01/MaterialLot/GetMaterialLot"
......@@ -72,7 +70,6 @@ public class SiemensApi extends BaseSmfApiListener {
private static boolean lotInOut(String url, String lot,int inoutType) {
//String url=config.url;
if (ObjectUtil.isEmpty(url)) {
log.info("没有配置Siemens,无需通知");
......@@ -129,13 +126,15 @@ public class SiemensApi extends BaseSmfApiListener {
@Override
public Barcode canPutInBeforeResolve(String inCheckUrl, String codeStr) throws ValidateException {
if (ObjectUtil.isEmpty(inCheckUrl)) {
log.info("没有配置Siemens,无需验证");
return null;
}
try {
Collection<CodeBean> codeBeans = codeResolve.resolveCodeStr(codeStr, COMPONENT_TYPE.COMPONENT);
boolean ok = false;
for (CodeBean codebean : codeBeans) {
if (codebean.hasReelSizeInfo()) {
LotCheckInfo info = lotCheckIn(codebean.getCodeStr());
LotCheckInfo info = lotCheckIn(codebean.getCodeStr(),inCheckUrl);
if (info != null && info.isStatus() && ObjectUtil.isNotEmpty(info.getPartnum()) && ObjectUtil.isNotEmpty(info.getQuantity())) {
//查找元器件是否存在
com.neotel.smfcore.core.barcode.service.po.Component component = componentManager.findOneByPN(info.getPartnum());
......@@ -155,7 +154,7 @@ public class SiemensApi extends BaseSmfApiListener {
}
//判断条码是否存在
Barcode barcode = barcodeManager.get(codebean.getCodeStr());
Barcode barcode = barcodeManager.findByBarcode(codebean.getCodeStr());
if (barcode == null) {
barcode = new Barcode();
barcode.setPlateSize(component.getPlateSize());
......@@ -179,15 +178,14 @@ public class SiemensApi extends BaseSmfApiListener {
}
}
throw new ValidateException("siemens.barcode.failed","SIEMENS条码验证失败");
} catch (Exception ex) {
log.info("siemensCheckCode 验证条码 [" + codeStr + "] 出错:", ex);
throw new ValidateException("siemens.barcode.error","SIEMENS条码验证出错:" + ex.getMessage());
}
return null;
}
public static LotCheckInfo lotCheckIn(String lot) {
//String url = config.url_checkIn;
String url = "";
public static LotCheckInfo lotCheckIn(String lot, String url) {
if (ObjectUtil.isEmpty(url)) {
log.info("没有配置Siemens,无需验证");
return null;
......
......@@ -40,10 +40,16 @@ public class LotCheckInfo implements Serializable {
lotCheckInfo.setCode(map.get("Code").toString());
}
if (map.containsKey("partnum")) {
lotCheckInfo.setPartnum(map.get("partnum").toString());
Object partnum = map.get("partnum");
if(partnum != null){
lotCheckInfo.setPartnum(partnum.toString());
}
}
if (map.containsKey("quantity")) {
lotCheckInfo.setQuantity(Integer.parseInt(map.get("quantity").toString()));
Object quantity = map.get("quantity");
if(quantity != null){
lotCheckInfo.setQuantity(Integer.parseInt(quantity.toString()));
}
}
return lotCheckInfo;
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!