Commit 76483319 LN

需要点料时如果CI在线,返回需要点料。点料完成更新状态=XrayEnd,再次获取库位号时不需要验证。

1 个父辈 032cf221
...@@ -21,6 +21,7 @@ import com.neotel.smfcore.core.device.enums.OP; ...@@ -21,6 +21,7 @@ import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.enums.OP_STATUS; import com.neotel.smfcore.core.device.enums.OP_STATUS;
import com.neotel.smfcore.core.inList.enums.INITEM.INITEM_STATUS; import com.neotel.smfcore.core.inList.enums.INITEM.INITEM_STATUS;
import com.neotel.smfcore.core.inList.service.po.InList; import com.neotel.smfcore.core.inList.service.po.InList;
import com.neotel.smfcore.core.inList.service.po.InListItem;
import com.neotel.smfcore.core.language.util.MessageUtils; import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.materialLog.service.manager.IMaterialLogManager; import com.neotel.smfcore.core.materialLog.service.manager.IMaterialLogManager;
import com.neotel.smfcore.core.materialLog.service.po.MaterialLog; import com.neotel.smfcore.core.materialLog.service.po.MaterialLog;
...@@ -562,6 +563,15 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -562,6 +563,15 @@ public class RobotBoxHandler extends BaseDeviceHandler {
barcode= ApiCheck(rfid,barcode ); barcode= ApiCheck(rfid,barcode );
if(barcode.isToXray()){
log.info("物料["+barcode.getBarcode()+"]需要先去点料" );
resultMap.put("result", "110");
errorMsg= MessageUtils.getText("smfcore.api.toXray",new String[]{barcode.getBarcode()},new Locale("en","US"),"{0}需要去点料");
resultMap.put("msg", errorMsg);
}
else{
StoragePos pos = taskService.findEmptyPosForPutIn(storages, barcode, "", lastPosId); StoragePos pos = taskService.findEmptyPosForPutIn(storages, barcode, "", lastPosId);
if (pos != null) { if (pos != null) {
...@@ -610,6 +620,7 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -610,6 +620,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
resultMap.put("msg", errorMsg); resultMap.put("msg", errorMsg);
} }
}
} catch (ValidateException ve) { } catch (ValidateException ve) {
errorMsg = ve.getMessage(); errorMsg = ve.getMessage();
log.info("Failed to find empty storage space:" + errorMsg); log.info("Failed to find empty storage space:" + errorMsg);
...@@ -663,6 +674,17 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -663,6 +674,17 @@ public class RobotBoxHandler extends BaseDeviceHandler {
if (!MicronApi.isEnable()) { if (!MicronApi.isEnable()) {
return barcode; return barcode;
} }
InListItem item=loadingUtil.GetInlistItem(barcode.getBarcode());
if(item!=null ){
log.info("条码[" + barcode.getBarcode() + "]获取库位号,已存在inListItem, 状态="+item.getState());
if(item.getState()==INITEM_STATUS.XRayEnd){
//更改状态为入库中
loadingUtil.updateItemState(barcode.getBarcode(),"",INITEM_STATUS.PutIn);
return barcode;
}
}
barcode.setToXray(false); barcode.setToXray(false);
barcode.setInListName(""); barcode.setInListName("");
String operationId = ""; String operationId = "";
...@@ -673,6 +695,8 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -673,6 +695,8 @@ public class RobotBoxHandler extends BaseDeviceHandler {
if (!inList.isValidRfid(rfid)) { if (!inList.isValidRfid(rfid)) {
return barcode; return barcode;
} }
operationId = inList.getOperationId(); operationId = inList.getOperationId();
if (ObjectUtil.isEmpty(operationId)) { if (ObjectUtil.isEmpty(operationId)) {
log.info("条码[" + barcode.getBarcode() + "]获取库位号,operationId 为空,不需要接口验证"); log.info("条码[" + barcode.getBarcode() + "]获取库位号,operationId 为空,不需要接口验证");
...@@ -694,13 +718,20 @@ public class RobotBoxHandler extends BaseDeviceHandler { ...@@ -694,13 +718,20 @@ public class RobotBoxHandler extends BaseDeviceHandler {
log.info("条码[" + barcode.getBarcode() + "]获取库位号,需要去点料, 勾选了 Xray Bypass,继续入库 "); log.info("条码[" + barcode.getBarcode() + "]获取库位号,需要去点料, 勾选了 Xray Bypass,继续入库 ");
barcode.setInListName(inList.getName()); barcode.setInListName(inList.getName());
loadingUtil.AddInListItem(rfid, barcode, "", INITEM_STATUS.PutIn); loadingUtil.AddInListItem(rfid, barcode, "", INITEM_STATUS.PutIn);
}else{ }else {
//判断点料机是否在线
if (MicronDataCache.DeviceOnLine("CI")) {
barcode.setToXray(true);
barcode.setInListName(inList.getName());
barcodeManager.saveBarcode(barcode);
loadingUtil.AddInListItem(rfid, barcode, "", INITEM_STATUS.XRay);
log.info("条码[" + barcode.getBarcode() + "]获取库位号,需要去点料,点料机CI当前在线,返回需要点料");
} else {
log.info("条码[" + barcode.getBarcode() + "]获取库位号,需要去点料,点料机未连接,直接异常"); log.error("条码[" + barcode.getBarcode() + "]获取库位号,需要去点料,点料机CI未连接,直接异常");
throw new ApiException("smfcore.micron.xray.offline", "{0}需要点料,点料机不在线", new String[]{barcode.getBarcode()}); throw new ApiException("smfcore.micron.xray.offline", "{0}需要点料,点料机不在线", new String[]{barcode.getBarcode()});
// barcode.setToXray(true); }
// barcode.setInListName(inList.getName());
// loadingUtil.AddInListItem(rfid,barcode,"", INITEM_STATUS.XRay);
} }
} else { } else {
barcode.setInListName(inList.getName()); barcode.setInListName(inList.getName());
......
...@@ -23,5 +23,7 @@ public class INITEM_STATUS { ...@@ -23,5 +23,7 @@ public class INITEM_STATUS {
public static int Success=6; public static int Success=6;
/**入库通知失败*/ /**入库通知失败*/
public static int Fail=7; public static int Fail=7;
/**已点料完成,等待获取库位号*/
public static int XRayEnd=8;
} }
...@@ -376,8 +376,8 @@ public class MicronDeviceController { ...@@ -376,8 +376,8 @@ public class MicronDeviceController {
//上传数量 //上传数量
boolean result = MicronApi.Api008(barcode.getBarcode(), qty, oldQty); boolean result = MicronApi.Api008(barcode.getBarcode(), qty, oldQty);
if (result) { if (result) {
//TODO 重新获取库位号 //点料已完成,等待获取库位号
loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.PutIn); loadingUtil.xRayEndUpdateItem(barcode.getBarcode(), qty, INITEM_STATUS.XRayEnd);
return ResultBean.newOkResult("ok"); return ResultBean.newOkResult("ok");
} else { } else {
......
...@@ -32,10 +32,10 @@ import java.util.stream.Collectors; ...@@ -32,10 +32,10 @@ import java.util.stream.Collectors;
public class LoadingUtil { public class LoadingUtil {
@Autowired @Autowired
private DataCache dataCache; private DataCache dataCache;
@Autowired @Autowired
private InListCache inListCache; private InListCache inListCache;
@Autowired @Autowired
private IInListManager inListManager; private IInListManager inListManager;
...@@ -51,14 +51,14 @@ public class LoadingUtil { ...@@ -51,14 +51,14 @@ public class LoadingUtil {
if (loadingInfo == null || ObjectUtil.isEmpty(loadingInfo.operationId)) { if (loadingInfo == null || ObjectUtil.isEmpty(loadingInfo.operationId)) {
} else { } else {
InList inlist=inListCache.getInList(loadingInfo.getInlistName()); InList inlist = inListCache.getInList(loadingInfo.getInlistName());
return inlist; return inlist;
} }
return null; return null;
} }
//获取库位号成功,增加一个正在入库的 //获取库位号成功,增加一个正在入库的
public void AddInListItem(String rfid, Barcode barcode,String posName, int s) { public void AddInListItem(String rfid, Barcode barcode, String posName, int s) {
InList inList = getInlist(); InList inList = getInlist();
if (inList == null) { if (inList == null) {
...@@ -67,12 +67,12 @@ public class LoadingUtil { ...@@ -67,12 +67,12 @@ public class LoadingUtil {
inList.addRfid(rfid); inList.addRfid(rfid);
inList.setStatus(INLIST_STATUS.ABNORMAL); inList.setStatus(INLIST_STATUS.ABNORMAL);
String mtype= MicronDataCache.GetReelType(barcode.getPlateSize(),barcode.getHeight()); String mtype = MicronDataCache.GetReelType(barcode.getPlateSize(), barcode.getHeight());
log.info("为入库单["+inList.getName()+"]增加一条入库信息:barcode["+barcode.getBarcode()+"],mtype["+mtype+"],pn["+barcode.getPartNumber()+"],rfid["+rfid+"],posName["+posName+"],s["+s+"]"); log.info("为入库单[" + inList.getName() + "]增加一条入库信息:barcode[" + barcode.getBarcode() + "],mtype[" + mtype + "],pn[" + barcode.getPartNumber() + "],rfid[" + rfid + "],posName[" + posName + "],s[" + s + "]");
InListItem item = InListItem.newMItem(inList.getName(), barcode, rfid, posName, s,mtype); InListItem item = InListItem.newMItem(inList.getName(), barcode, rfid, posName, s, mtype);
if(inList.getEndRfidList()!=null&& inList.getEndRfidList().contains(rfid)){ if (inList.getEndRfidList() != null && inList.getEndRfidList().contains(rfid)) {
item.setRfidEnd(true); item.setRfidEnd(true);
} }
item = inListItemManager.save(item); item = inListItemManager.save(item);
...@@ -83,9 +83,26 @@ public class LoadingUtil { ...@@ -83,9 +83,26 @@ public class LoadingUtil {
inListCache.addInListToMap(inList); inListCache.addInListToMap(inList);
} }
public InListItem GetInlistItem(String barcode) {
InList inList = getInlist();
if (inList == null) {
return null;
}
for (InListItem item :
inList.getInListItems()) {
if (item.getRi().equals(barcode)) {
return item;
}
}
return null;
}
public void xRayEndUpdateItem(String barcode,int count,int s) { public void xRayEndUpdateItem(String barcode,int count,int s) {
updateItemState( barcode,"", INITEM_STATUS.XRayFail); updateItemState(barcode, "", INITEM_STATUS.XRayFail);
} }
public InListItem updateItemState( String barcode,String posName,int s) { public InListItem updateItemState( String barcode,String posName,int s) {
......
...@@ -81,7 +81,18 @@ public class MicronDataCache { ...@@ -81,7 +81,18 @@ public class MicronDataCache {
} }
return new MicronEquipStatus(); return new MicronEquipStatus();
} }
public static boolean DeviceOnLine(String name) {
if (ObjectUtil.isEmpty(name)) {
name = "CI";
}
MicronEquipStatus s = MicronDataCache.getStatus(name);
if (!s.timeOut()) {
if (s.getStatus() >= 1) {
return true;
}
}
return false;
}
public static String GetReelType( int w,int h) { public static String GetReelType( int w,int h) {
// 310*80 = pcb 330*120= tray 386*86 =shoe box 400X70 Pizza box 其他的都是料盘 // 310*80 = pcb 330*120= tray 386*86 =shoe box 400X70 Pizza box 其他的都是料盘
// PizzaBOX料格 62 400 // PizzaBOX料格 62 400
......
...@@ -354,6 +354,7 @@ smfcore.micron.nodata=\u672A\u627E\u5230\u4FE1\u606F ...@@ -354,6 +354,7 @@ smfcore.micron.nodata=\u672A\u627E\u5230\u4FE1\u606F
smfcore.api.fail={0} Failed to get data smfcore.api.fail={0} Failed to get data
smfcore.micron.apiClose=Not yet open smfcore.micron.apiClose=Not yet open
smfcore.api.error=api.error: error={0},message={1},detial={2} smfcore.api.error=api.error: error={0},message={1},detial={2}
smfcore.api.toXray={0}\u9700\u8981\u53BB\u70B9\u6599
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0} #smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1} #smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
#smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F #smfclient.nlp.inputOk={0}\u5165\u5E93\u5230{1}\u6210\u529F
......
...@@ -352,4 +352,5 @@ smfcore.expiration.notExist=expiration date config[{0}]does not exist ...@@ -352,4 +352,5 @@ smfcore.expiration.notExist=expiration date config[{0}]does not exist
smfcore.micron.xray.offline={0}Need to go to the count\uFF0CThe ordering machine is not online. smfcore.micron.xray.offline={0}Need to go to the count\uFF0CThe ordering machine is not online.
smfcore.micron.nodata=No information found smfcore.micron.nodata=No information found
smfcore.api.fail={0} Failed to get data smfcore.api.fail={0} Failed to get data
smfcore.micron.apiClose=Not yet open
\ No newline at end of file \ No newline at end of file
smfcore.micron.apiClose=Not yet open
smfcore.api.toXray={0}Need to Xray
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!