Commit 185d7428 LN

ControlledDispatch 功能完善

1 个父辈 6c0bbe52
......@@ -1078,7 +1078,7 @@ public class LiteOrderCache {
outNum += pos.getBarcode().getAmount();
outReelCount += 1;
} else {
reelItem.setExecutFailReason(s.getDescription());
reelItem.setStatus(OrderItemStatus.CheckFail);
log.info("工单【" + orderNo + "】PN [" + item.getPn() + "] RI [" + item.getRi() + "] API009 验证失败,更改状态为 CheckFail");
}
......
......@@ -33,7 +33,7 @@ import java.util.Map;
@Slf4j
public class MicronApi {
public static boolean Debug=false;
public static boolean Debug=true;
private static MicronConfig config;
@Autowired
......@@ -689,10 +689,6 @@ public class MicronApi {
log.info("调用MES接口 API009: url=" + url + ",body=" + paramStr + "");
MicronResult micronResult = HttpHelper.postMicronJson(url, paramMap);
// API-009 In Body: add operationId and linePrepOrderId
// Out Body: Change linePrepOrderId to reservedLinePrepOrderId (added 13-6-2024)
// if (micronResult.isOk() && micronResult.statusIsSuccess()) {
String errMsg = getDErrorMsg(micronResult);
if (micronResult.isOk()) {
......@@ -714,14 +710,23 @@ public class MicronApi {
// ]
// }
List<Object> resultList = micronResult.getResult("results");
for (Object Obj :
resultList) {
MaterialStatus s = JsonUtil.toObj(JsonUtil.toJsonStr(Obj), MaterialStatus.class);
if (ObjectUtil.isEmpty(s.getDescription())) {
s.setDescription(errMsg);
}
resultMap.put(s.getSerialNum(), s);
}
} else if (ObjectUtil.isNotEmpty(errMsg)) {
log.info("API009 ,接口通信失败:"+errMsg);
throw new ApiException(errMsg);
log.info("API009 ,接口通信失败:" + errMsg);
for (Barcode barcode : barcodeList) {
resultMap.put(barcode.getBarcode(), new MaterialStatus(barcode.getBarcode(), barcode.getPartNumber(), "", errMsg, true));
}
} else {
......
......@@ -256,7 +256,7 @@ private IStoragePosManager storagePosManager;
dto.setLineId(lineId);
//调用API201
String result = MicronApi.Api201(lineId, dto.getOperationId());
if (ObjectUtil.isNotEmpty(result)) {
if (ObjectUtil.isEmpty( result)) {
//成功
dto.setLineId(lineId);
dataCache.updateCache(Constants.CACHE_DISPATCH + mode, dto);
......@@ -387,7 +387,7 @@ private IStoragePosManager storagePosManager;
for (LiteOrderItem item : selItem.getSelectItems()
) {
ItemDetialDto dto = new ItemDetialDto(item.getRi(), item.getNeedNum(), item.getStatus());
ItemDetialDto dto = new ItemDetialDto(item.getRi(), item.getNeedNum(), item.getStatus(),item.getExecutFailReason());
detialDtos.add(dto);
}
......@@ -403,11 +403,25 @@ private IStoragePosManager storagePosManager;
for (StoragePos pos :
otherPosList) {
ItemDetialDto dto = new ItemDetialDto(pos.getBarcode().getBarcode(), pos.getBarcode().getAmount(), "");
ItemDetialDto dto = new ItemDetialDto(pos.getBarcode().getBarcode(), pos.getBarcode().getAmount(), "","");
detialDtos.add(dto);
}
}
if(MicronApi.Debug){
if(detialDtos.size()<=0){
for (int i=0;i<5;i++) {
String ok = (i <= 1) ? "CheckOk" : "CheckFail";
ItemDetialDto dto = new ItemDetialDto("barcode" + i, i * 100, ok, "msg" + i);
detialDtos.add(dto);
}
for (int i=6;i<9;i++) {
ItemDetialDto dto = new ItemDetialDto("barcode" + i, i * 100, "", "");
detialDtos.add(dto);
}
}
}
//判断是否需要勾选
return ResultBean.newOkResult(detialDtos);
......@@ -473,13 +487,11 @@ private IStoragePosManager storagePosManager;
pos.getBarcode().setLockId(order.getOrderNo());
pos.getBarcode().setLockName(item.getPn());
storagePosManager.save(pos);
item.setOutNum(item.getOutNum() + pos.getBarcode().getAmount());
item.setOutNum(item.getOutNum() + pos.getBarcode().getAmount());
} else {
reelItem.setExecutFailReason(s.getDescription());
reelItem.setStatus(OrderItemStatus.CheckFail);
log.info("工单【" + order.getOrderNo() + "】PN [" + item.getPn() + "] RI [" + item.getRi() + "] API009 验证失败,更改状态为 CheckFail");
}
......
......@@ -25,4 +25,6 @@ public class ItemDetialDto implements Serializable {
* CheckFail 表示验证失败
*/
private String status="";
private String executFailReason="";
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!