Commit 6bc63691 sunke

西门子普通料架

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