|
|
@ -149,7 +149,7 @@ public class CrossAreaTransferServiceImpl extends ServiceImpl<CrossAreaTransferM |
|
|
throw new RuntimeException("该库位已停用,请检查"); |
|
|
throw new RuntimeException("该库位已停用,请检查"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 2. 调用出库存储过程 GetSaveLabelVerification(跨区调拨-出库) |
|
|
|
|
|
|
|
|
// 2. 调用出库存储过程 GetSaveLabelVerification(调拨出库) |
|
|
logger.info("开始调用出库存储过程,site: {}, buNo: {}, sourceLocation: {}", site, buNo, sourceLocation); |
|
|
logger.info("开始调用出库存储过程,site: {}, buNo: {}, sourceLocation: {}", site, buNo, sourceLocation); |
|
|
List<Object> outboundParams = new ArrayList<>(); |
|
|
List<Object> outboundParams = new ArrayList<>(); |
|
|
outboundParams.add(site); // 参数1: site |
|
|
outboundParams.add(site); // 参数1: site |
|
|
@ -160,7 +160,7 @@ public class CrossAreaTransferServiceImpl extends ServiceImpl<CrossAreaTransferM |
|
|
outboundParams.add("label".equals(transferMode) ? "标签" : "库位"); // 参数6: 扫描的类型 "标签/库位" |
|
|
outboundParams.add("label".equals(transferMode) ? "标签" : "库位"); // 参数6: 扫描的类型 "标签/库位" |
|
|
outboundParams.add(sourceLocation); // 参数7: 扫描的标签条码/库位号 |
|
|
outboundParams.add(sourceLocation); // 参数7: 扫描的标签条码/库位号 |
|
|
outboundParams.add(targetLocation != null ? targetLocation : ""); // 参数8: 保存时的库位 |
|
|
outboundParams.add(targetLocation != null ? targetLocation : ""); // 参数8: 保存时的库位 |
|
|
outboundParams.add("跨区调拨-出库"); // 参数9: 跨区调拨-出库 |
|
|
|
|
|
|
|
|
outboundParams.add("调拨出库"); // 参数9: 调拨出库 |
|
|
outboundParams.add(operator); // 参数10: 当前登陆人 |
|
|
outboundParams.add(operator); // 参数10: 当前登陆人 |
|
|
|
|
|
|
|
|
List<Map<String, Object>> outboundResultList = procedureMapper.getProcedureData("GetSaveLabelVerification", outboundParams); |
|
|
List<Map<String, Object>> outboundResultList = procedureMapper.getProcedureData("GetSaveLabelVerification", outboundParams); |
|
|
@ -178,34 +178,41 @@ public class CrossAreaTransferServiceImpl extends ServiceImpl<CrossAreaTransferM |
|
|
throw new RuntimeException("跨区调拨出库失败: " + msg); |
|
|
throw new RuntimeException("跨区调拨出库失败: " + msg); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 如果出库返回的transNo有值且不为"*",则异步调用ERP接口 |
|
|
|
|
|
try { |
|
|
|
|
|
|
|
|
// 获取出库返回的transNo,用于入库时传递 |
|
|
String outboundTransNo = String.valueOf(outboundResult.get("transNo")); |
|
|
String outboundTransNo = String.valueOf(outboundResult.get("transNo")); |
|
|
|
|
|
|
|
|
|
|
|
// 如果出库返回的synced_flag为'Y',则异步调用ERP接口 |
|
|
|
|
|
try { |
|
|
|
|
|
String syncedFlag = String.valueOf(outboundResult.get("syncedFlag")); |
|
|
|
|
|
if ("Y".equalsIgnoreCase(syncedFlag)) { |
|
|
if (outboundTransNo != null && !outboundTransNo.isEmpty() && !"*".equals(outboundTransNo) && !"null".equals(outboundTransNo)) { |
|
|
if (outboundTransNo != null && !outboundTransNo.isEmpty() && !"*".equals(outboundTransNo) && !"null".equals(outboundTransNo)) { |
|
|
String returnSite = String.valueOf(outboundResult.get("Site")); |
|
|
String returnSite = String.valueOf(outboundResult.get("Site")); |
|
|
String returnBuNo = String.valueOf(outboundResult.get("buNo")); |
|
|
String returnBuNo = String.valueOf(outboundResult.get("buNo")); |
|
|
logger.info("跨区调拨出库存储过程执行成功,准备异步调用ERP接口,site={}, buNo={}, transNo={}", |
|
|
|
|
|
|
|
|
logger.info("跨区调拨出库存储过程执行成功,synced_flag=Y,准备异步调用ERP接口,site={}, buNo={}, transNo={}", |
|
|
returnSite, returnBuNo, outboundTransNo); |
|
|
returnSite, returnBuNo, outboundTransNo); |
|
|
erpInterfaceService.asyncCallErpInterface(returnSite, returnBuNo, outboundTransNo); |
|
|
erpInterfaceService.asyncCallErpInterface(returnSite, returnBuNo, outboundTransNo); |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
logger.info("跨区调拨出库transNo为空或'*',不调用ERP接口"); |
|
|
|
|
|
|
|
|
logger.info("跨区调拨出库synced_flag不为'Y',不调用ERP接口,synced_flag={}", syncedFlag); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
logger.error("跨区调拨出库异步调用ERP接口触发失败(不影响主流程),错误: {}", e.getMessage(), e); |
|
|
logger.error("跨区调拨出库异步调用ERP接口触发失败(不影响主流程),错误: {}", e.getMessage(), e); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 3. 调用入库存储过程 GetSaveLabelVerification(跨区调拨-入库) |
|
|
|
|
|
logger.info("开始调用入库存储过程,site: {}, buNo: {}, targetLocation: {}", site, buNo, targetLocation); |
|
|
|
|
|
|
|
|
// 3. 调用入库存储过程 GetSaveLabelVerification(调拨入库) |
|
|
|
|
|
// 入库时需要传递出库返回的transNo作为第三个参数 |
|
|
|
|
|
logger.info("开始调用入库存储过程,site: {}, buNo: {}, targetLocation: {}, outboundTransNo: {}", site, buNo, targetLocation, outboundTransNo); |
|
|
List<Object> inboundParams = new ArrayList<>(); |
|
|
List<Object> inboundParams = new ArrayList<>(); |
|
|
inboundParams.add(site); // 参数1: site |
|
|
inboundParams.add(site); // 参数1: site |
|
|
inboundParams.add(buNo); // 参数2: buNo |
|
|
inboundParams.add(buNo); // 参数2: buNo |
|
|
inboundParams.add(""); // 参数3: 空字符串 |
|
|
|
|
|
|
|
|
// 参数3: 传递出库返回的transNo |
|
|
|
|
|
inboundParams.add(outboundTransNo != null && !"null".equals(outboundTransNo) && !"*".equals(outboundTransNo) ? outboundTransNo : ""); |
|
|
inboundParams.add(""); // 参数4: 空字符串 |
|
|
inboundParams.add(""); // 参数4: 空字符串 |
|
|
inboundParams.add(""); // 参数5: 空字符串 |
|
|
inboundParams.add(""); // 参数5: 空字符串 |
|
|
inboundParams.add("label".equals(transferMode) ? "标签" : "库位"); // 参数6: 扫描的类型 "标签/库位" |
|
|
inboundParams.add("label".equals(transferMode) ? "标签" : "库位"); // 参数6: 扫描的类型 "标签/库位" |
|
|
inboundParams.add(sourceLocation); // 参数7: 扫描的标签条码/库位号 |
|
|
inboundParams.add(sourceLocation); // 参数7: 扫描的标签条码/库位号 |
|
|
inboundParams.add(targetLocation != null ? targetLocation : ""); // 参数8: 保存时的库位(目标库位) |
|
|
inboundParams.add(targetLocation != null ? targetLocation : ""); // 参数8: 保存时的库位(目标库位) |
|
|
inboundParams.add("跨区调拨-入库"); // 参数9: 跨区调拨-入库 |
|
|
|
|
|
|
|
|
inboundParams.add("调拨入库"); // 参数9: 调拨入库 |
|
|
inboundParams.add(operator); // 参数10: 当前登陆人 |
|
|
inboundParams.add(operator); // 参数10: 当前登陆人 |
|
|
|
|
|
|
|
|
List<Map<String, Object>> inboundResultList = procedureMapper.getProcedureData("GetSaveLabelVerification", inboundParams); |
|
|
List<Map<String, Object>> inboundResultList = procedureMapper.getProcedureData("GetSaveLabelVerification", inboundParams); |
|
|
@ -223,17 +230,20 @@ public class CrossAreaTransferServiceImpl extends ServiceImpl<CrossAreaTransferM |
|
|
throw new RuntimeException("跨区调拨入库失败: " + msg); |
|
|
throw new RuntimeException("跨区调拨入库失败: " + msg); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 如果入库返回的transNo有值且不为"*",则异步调用ERP接口 |
|
|
|
|
|
|
|
|
// 如果入库返回的synced_flag为'Y',则异步调用ERP接口 |
|
|
try { |
|
|
try { |
|
|
|
|
|
String inboundSyncedFlag = String.valueOf(inboundResult.get("syncedFlag")); |
|
|
|
|
|
if ("Y".equalsIgnoreCase(inboundSyncedFlag)) { |
|
|
String inboundTransNo = String.valueOf(inboundResult.get("transNo")); |
|
|
String inboundTransNo = String.valueOf(inboundResult.get("transNo")); |
|
|
if (inboundTransNo != null && !inboundTransNo.isEmpty() && !"*".equals(inboundTransNo) && !"null".equals(inboundTransNo)) { |
|
|
if (inboundTransNo != null && !inboundTransNo.isEmpty() && !"*".equals(inboundTransNo) && !"null".equals(inboundTransNo)) { |
|
|
String returnSite = String.valueOf(inboundResult.get("Site")); |
|
|
String returnSite = String.valueOf(inboundResult.get("Site")); |
|
|
String returnBuNo = String.valueOf(inboundResult.get("buNo")); |
|
|
String returnBuNo = String.valueOf(inboundResult.get("buNo")); |
|
|
logger.info("跨区调拨入库存储过程执行成功,准备异步调用ERP接口,site={}, buNo={}, transNo={}", |
|
|
|
|
|
|
|
|
logger.info("跨区调拨入库存储过程执行成功,synced_flag=Y,准备异步调用ERP接口,site={}, buNo={}, transNo={}", |
|
|
returnSite, returnBuNo, inboundTransNo); |
|
|
returnSite, returnBuNo, inboundTransNo); |
|
|
erpInterfaceService.asyncCallErpInterface(returnSite, returnBuNo, inboundTransNo); |
|
|
erpInterfaceService.asyncCallErpInterface(returnSite, returnBuNo, inboundTransNo); |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
logger.info("跨区调拨入库transNo为空或'*',不调用ERP接口"); |
|
|
|
|
|
|
|
|
logger.info("跨区调拨入库synced_flag不为'Y',不调用ERP接口,synced_flag={}", inboundSyncedFlag); |
|
|
} |
|
|
} |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
logger.error("跨区调拨入库异步调用ERP接口触发失败(不影响主流程),错误: {}", e.getMessage(), e); |
|
|
logger.error("跨区调拨入库异步调用ERP接口触发失败(不影响主流程),错误: {}", e.getMessage(), e); |
|
|
|