Commit 5e38dd67 LN

loading没有执行的入库任务才能abort,abort后先把入库完成的料调用API002发送给镁光

1 个父辈 1934b25b
...@@ -13,7 +13,7 @@ public class TacticsOutDto implements Serializable { ...@@ -13,7 +13,7 @@ public class TacticsOutDto implements Serializable {
private String partNumber; private String partNumber;
@ApiModelProperty("出库盘数") @ApiModelProperty("出库盘数")
private Integer plateNumber; private Integer plateNumber=0;
@ApiModelProperty("数量") @ApiModelProperty("数量")
private int needNum=0; private int needNum=0;
......
...@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.utils.SecurityUtils; ...@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager; import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve; import com.neotel.smfcore.core.barcode.utils.CodeResolve;
import com.neotel.smfcore.core.device.enums.OP;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
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.enums.INLIST_STATUS; import com.neotel.smfcore.core.inList.enums.INLIST_STATUS;
...@@ -17,6 +18,8 @@ import com.neotel.smfcore.core.inList.service.manager.IInListManager; ...@@ -17,6 +18,8 @@ import com.neotel.smfcore.core.inList.service.manager.IInListManager;
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.inList.service.po.InListItem;
import com.neotel.smfcore.core.inList.util.InListCache; import com.neotel.smfcore.core.inList.util.InListCache;
import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.micron1053.api.APIMODE; import com.neotel.smfcore.custom.micron1053.api.APIMODE;
import com.neotel.smfcore.custom.micron1053.api.MicronApi; import com.neotel.smfcore.custom.micron1053.api.MicronApi;
import com.neotel.smfcore.custom.micron1053.loading.Bean.LoadingInfo; import com.neotel.smfcore.custom.micron1053.loading.Bean.LoadingInfo;
...@@ -56,6 +59,8 @@ public class LoadingController { ...@@ -56,6 +59,8 @@ public class LoadingController {
private IBarcodeManager barcodeManager; private IBarcodeManager barcodeManager;
@Autowired @Autowired
protected CodeResolve codeResolve; protected CodeResolve codeResolve;
@Autowired
private TaskService taskService;
@ApiOperation("lOADING页面获取列表数据") @ApiOperation("lOADING页面获取列表数据")
@GetMapping("/list") @GetMapping("/list")
...@@ -262,10 +267,26 @@ public class LoadingController { ...@@ -262,10 +267,26 @@ public class LoadingController {
return ResultBean.newErrorResult(-1,"smfcore.micron.operationFailure","操作失败"); return ResultBean.newErrorResult(-1,"smfcore.micron.operationFailure","操作失败");
} else { } else {
//结束入库 //结束入库
for (InListItem item : inList.getInListItems()) {
if (item.getState() == INITEM_STATUS.PutIn) {
List<DataLog> allTask = taskService.getAllTasks();
for (DataLog task : allTask ) {
if (task.isEnd() || task.isFinished() || task.isCancel()) {
continue;
}
if (OP.PUT_IN == task.getType() && task.getPosName().equals(item.getPosName())) {
log.info("入库单 " + inList.getName() + ", 物料" + item.getPosName() + "还在入库中,无法Abort");
return ResultBean.newErrorResult(-1, "smfcore.micron.inlistCannotAbort", "操作失败:还有入库任务未完成");
}
}
}
}
log.info("终止 入库:"+inList.getMode()+","+inList.getOperationId()+" " +inList.getName()+",更改action=ABORT"); log.info("终止 入库:"+inList.getMode()+","+inList.getOperationId()+" " +inList.getName()+",更改action=ABORT");
MicronApi.ActionUpdate(inList.getOperationId(),MicronApi.ABORT ); MicronApi.ActionUpdate(inList.getOperationId(),MicronApi.ABORT );
loadingUtil.AbortSendAPI002();
inList.setStatus(INLIST_STATUS.END); inList.setStatus(INLIST_STATUS.END);
inListManager.save(inList); inListManager.save(inList);
inListCache.addInListToMap(inList); inListCache.addInListToMap(inList);
......
...@@ -518,6 +518,41 @@ public class LoadingUtil { ...@@ -518,6 +518,41 @@ public class LoadingUtil {
return true; return true;
} }
/**
* abort前将已入库成功的通知MES
* @return
*/
public boolean AbortSendAPI002() {
//TODO rfid入库完成
InList inList = getInlist();
if (inList == null) {
return false;
}
for (String rfid :
inList.getRfidList()) {
List<StoragePos> posList = new ArrayList<>();
//查找所有失败的重新推送
for (InListItem item : inList.getInListItems()) {
if (ObjectUtil.isEmpty(item.getPosName())) {
continue;
}
if (item.getRfid().equals(rfid) && item.getState() == INITEM_STATUS.Fail) {
StoragePos pos = storagePosManager.getByPosName(item.getPosName());
posList.add(pos);
}else if(item.getState()==INITEM_STATUS.PutEnd){
StoragePos pos = storagePosManager.getByPosName(item.getPosName());
posList.add(pos);
}
}
if (posList.size() > 0) {
PushToMes(rfid, inList, posList);
}
}
return true;
}
public String getRfidByBarcode(String barcode) { public String getRfidByBarcode(String barcode) {
InList inList = getInlist(); InList inList = getInlist();
......
...@@ -225,7 +225,7 @@ public class MicronDispatchController { ...@@ -225,7 +225,7 @@ public class MicronDispatchController {
} }
//判断是否需要勾选其他物料 //判断是否需要勾选其他物料
else if (item.getOutNum() < item.getNeedNum()|| item.getNeedReelCount()<item.getSelectItems().size()) { else if (item.getOutNum() < item.getNeedNum()|| item.getNeedReelCount()>item.getSelectItems().size()) {
//需要勾选 //需要勾选
CHECKOUT_TYPE checkoutType = dataCache.getCheckOutType(); CHECKOUT_TYPE checkoutType = dataCache.getCheckOutType();
...@@ -630,16 +630,21 @@ public class MicronDispatchController { ...@@ -630,16 +630,21 @@ public class MicronDispatchController {
.filter(obj -> (obj.getRi().equals(barcode.getBarcode()))).collect(Collectors.toList()); .filter(obj -> (obj.getRi().equals(barcode.getBarcode()))).collect(Collectors.toList());
if (findes.size() > 0) { if (findes.size() > 0) {
reelItem = findes.get(0); reelItem = findes.get(0);
if (reelItem.isSuccess() && (!reelItem.getStatus().equalsIgnoreCase(OrderItemStatus.wait))) {
//已验证成功,直接下一个
continue;
}
selectReelItems.remove(reelItem); selectReelItems.remove(reelItem);
} }
//如果是之前验证成功的,直接跳过 //如果是之前验证成功的,直接跳过
if (reelItem == null) { if (reelItem == null) {
reelItem = liteOrderCache.NewSelItem(pos); reelItem = liteOrderCache.NewSelItem(pos);
} else if (reelItem.isSuccess() && (!reelItem.getStatus().equalsIgnoreCase(OrderItemStatus.wait))) {
selectReelItems.add(reelItem);
continue;
} }
// else if (reelItem.isSuccess() && (!reelItem.getStatus().equalsIgnoreCase(OrderItemStatus.wait))) {
// selectReelItems.add(reelItem);
// continue;
// }
MaterialStatus s = apiResultMap.get(barcode.getBarcode()); MaterialStatus s = apiResultMap.get(barcode.getBarcode());
...@@ -858,7 +863,7 @@ public class MicronDispatchController { ...@@ -858,7 +863,7 @@ public class MicronDispatchController {
} }
//有任务的工单不能关闭 //有任务的工单不能关闭
allTask = taskService.getAllTasks(); allTask = taskService.getAllTasks();
for (DataLog task : allTask for (DataLog task : allTask
) { ) {
if (OP.CHECKOUT == task.getType() && (!task.isEnd())) { if (OP.CHECKOUT == task.getType() && (!task.isEnd())) {
......
...@@ -3,7 +3,7 @@ package com.neotel.smfcore.custom.micron1053.task.enums; ...@@ -3,7 +3,7 @@ package com.neotel.smfcore.custom.micron1053.task.enums;
public class OrderItemStatus { public class OrderItemStatus {
//缺料 //等待
public static final String wait = "WAIT"; public static final String wait = "WAIT";
//缺料 //缺料
public static final String shortage = "SHORTAGE"; public static final String shortage = "SHORTAGE";
......
...@@ -361,6 +361,7 @@ smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52 ...@@ -361,6 +361,7 @@ smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52
smfcore.error.barcode.hastask=\u6761\u7801[0]\u5DF2\u6709\u5165\u5E93\u4EFB\u52A1 smfcore.error.barcode.hastask=\u6761\u7801[0]\u5DF2\u6709\u5165\u5E93\u4EFB\u52A1
smfcore.error.barcode.hasOutTask=\u5E8F\u5217\u53F7[0] \u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1\uFF0C\u51FA\u5E93\u524D\u4E0D\u5F97\u5165\u5E93\u76F8\u540C\u5E8F\u5217\u53F7\u7269\u6599 smfcore.error.barcode.hasOutTask=\u5E8F\u5217\u53F7[0] \u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1\uFF0C\u51FA\u5E93\u524D\u4E0D\u5F97\u5165\u5E93\u76F8\u540C\u5E8F\u5217\u53F7\u7269\u6599
smfcore.error.noRetryReel=No material found to retry smfcore.error.noRetryReel=No material found to retry
smfcore.micron.inlistCannotAbort=\u64CD\u4F5C\u5931\u8D25\uFF1A\u8FD8\u6709\u5165\u5E93\u4EFB\u52A1\u672A\u5B8C\u6210
#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
......
...@@ -359,4 +359,5 @@ smfcore.paretoChart=Pareto chart ...@@ -359,4 +359,5 @@ smfcore.paretoChart=Pareto chart
smfcore.selfAudit.hasOutTask=The location [{0}] already has a release task smfcore.selfAudit.hasOutTask=The location [{0}] already has a release task
smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task
smfcore.error.barcode.hasOutTask=Serial No.(S)[0] already have retrieval task, cannot store same Serial No. material before retrieval finish smfcore.error.barcode.hasOutTask=Serial No.(S)[0] already have retrieval task, cannot store same Serial No. material before retrieval finish
smfcore.error.noRetryReel=No material found to retry
\ No newline at end of file \ No newline at end of file
smfcore.error.noRetryReel=No material found to retry
smfcore.micron.inlistCannotAbort=Operation failed: there are still inbound tasks to be completed
\ No newline at end of file \ No newline at end of file
...@@ -354,4 +354,5 @@ smfcore.paretoChart=\u30D1\u30EC\u30FC\u30C8\u56F3 ...@@ -354,4 +354,5 @@ smfcore.paretoChart=\u30D1\u30EC\u30FC\u30C8\u56F3
smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1 smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1
smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task
smfcore.error.barcode.hasOutTask=Serial No.(S)[0] already have retrieval task, cannot store same Serial No. material before retrieval finish smfcore.error.barcode.hasOutTask=Serial No.(S)[0] already have retrieval task, cannot store same Serial No. material before retrieval finish
smfcore.error.noRetryReel=No material found to retry
\ No newline at end of file \ No newline at end of file
smfcore.error.noRetryReel=No material found to retry
smfcore.micron.inlistCannotAbort=\u64CD\u4F5C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF1A\u5B8C\u4E86\u3059\u3079\u304D\u53D7\u4FE1\u30BF\u30B9\u30AF\u304C\u6B8B\u3063\u3066\u3044\u307E\u3059
\ No newline at end of file \ No newline at end of file
...@@ -354,4 +354,5 @@ smfcore.paretoChart=\u5E15\u7D2F\u6258\u56FE ...@@ -354,4 +354,5 @@ smfcore.paretoChart=\u5E15\u7D2F\u6258\u56FE
smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1 smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1
smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task smfcore.error.barcode.hastask=Serial No.(S)[0] already have storage task
smfcore.error.barcode.hasOutTask=\u5E8F\u5217\u53F7[0] \u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1\uFF0C\u51FA\u5E93\u524D\u4E0D\u5F97\u5165\u5E93\u76F8\u540C\u5E8F\u5217\u53F7\u7269\u6599 smfcore.error.barcode.hasOutTask=\u5E8F\u5217\u53F7[0] \u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1\uFF0C\u51FA\u5E93\u524D\u4E0D\u5F97\u5165\u5E93\u76F8\u540C\u5E8F\u5217\u53F7\u7269\u6599
smfcore.error.noRetryReel=\u6CA1\u6709\u53EF\u4EE5\u91CD\u8BD5\u7684\u7269\u6599
\ No newline at end of file \ No newline at end of file
smfcore.error.noRetryReel=\u6CA1\u6709\u53EF\u4EE5\u91CD\u8BD5\u7684\u7269\u6599
smfcore.micron.inlistCannotAbort=\u64CD\u4F5C\u5931\u8D25\uFF1A\u8FD8\u6709\u5165\u5E93\u4EFB\u52A1\u672A\u5B8C\u6210
\ No newline at end of file \ No newline at end of file
...@@ -355,4 +355,5 @@ smfcore.micron.apiClose=API\u529F\u80FD\u672A\u5F00\u653E ...@@ -355,4 +355,5 @@ smfcore.micron.apiClose=API\u529F\u80FD\u672A\u5F00\u653E
smfcore.paretoChart=\u5E15\u7D2F\u6258\u5716 smfcore.paretoChart=\u5E15\u7D2F\u6258\u5716
smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1 smfcore.selfAudit.hasOutTask=\u5E93\u4F4D[{0}]\u5DF2\u6709\u51FA\u5E93\u4EFB\u52A1
smfcore.error.barcode.hasOutTask=\u5E8F\u5217\u865F[0] \u5DF2\u6709\u51FA\u5EAB\u4EFB\u52D9\uFF0C\u51FA\u5EAB\u524D\u4E0D\u5F97\u5165\u5EAB\u76F8\u540C\u5E8F\u5217\u865F\u7269\u6599 smfcore.error.barcode.hasOutTask=\u5E8F\u5217\u865F[0] \u5DF2\u6709\u51FA\u5EAB\u4EFB\u52D9\uFF0C\u51FA\u5EAB\u524D\u4E0D\u5F97\u5165\u5EAB\u76F8\u540C\u5E8F\u5217\u865F\u7269\u6599
smfcore.error.noRetryReel=\u6C92\u6709\u53EF\u4EE5\u91CD\u8A66\u7684\u7269\u6599
\ No newline at end of file \ No newline at end of file
smfcore.error.noRetryReel=\u6C92\u6709\u53EF\u4EE5\u91CD\u8A66\u7684\u7269\u6599
smfcore.micron.inlistCannotAbort=\u64CD\u4F5C\u5931\u8D25\uFF1A\u8FD8\u6709\u5165\u5E93\u4EFB\u52A1\u672A\u5B8C\u6210
\ No newline at end of file \ No newline at end of file
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!