|
|
@ -253,7 +253,7 @@ public class HaiAnSearchIssureNotifyServiceImpl implements HaiAnSearchIssureNoti |
|
|
if (header == null) { |
|
|
if (header == null) { |
|
|
throw new RuntimeException("海安申请单不存在或不属于当前site"); |
|
|
throw new RuntimeException("海安申请单不存在或不属于当前site"); |
|
|
} |
|
|
} |
|
|
if (!"noorder".equalsIgnoreCase(StringUtils.defaultString(header.getOrderType()).trim())) { |
|
|
|
|
|
|
|
|
if (!isIssueWcsPushOrderType(header.getOrderType())) { |
|
|
return buildPlaceholderMatchResponse(data.getSite(), data.getNotifyNo(), "该海安页面暂不执行真实库存匹配"); |
|
|
return buildPlaceholderMatchResponse(data.getSite(), data.getNotifyNo(), "该海安页面暂不执行真实库存匹配"); |
|
|
} |
|
|
} |
|
|
if (!"ISSUE".equalsIgnoreCase(StringUtils.defaultString(header.getStatus()).trim())) { |
|
|
if (!"ISSUE".equalsIgnoreCase(StringUtils.defaultString(header.getStatus()).trim())) { |
|
|
@ -288,12 +288,12 @@ public class HaiAnSearchIssureNotifyServiceImpl implements HaiAnSearchIssureNoti |
|
|
String site = data.getSite().trim(); |
|
|
String site = data.getSite().trim(); |
|
|
String notifyNo = data.getNotifyNo().trim(); |
|
|
String notifyNo = data.getNotifyNo().trim(); |
|
|
|
|
|
|
|
|
// 查询主单并再次校验海安无订单类型和ISSUE状态,禁止从其他页面误触发真实推送 - rqrq |
|
|
|
|
|
|
|
|
// 查询主单并再次校验海安可推送申请类型和ISSUE状态,禁止未开放类型误触发真实推送 - rqrq |
|
|
HaiAnSOIssueNotifyHeaderData header = haiAnSearchIssureNotifyMapper.haiAnGetNotifyHeader(site, notifyNo); |
|
|
HaiAnSOIssueNotifyHeaderData header = haiAnSearchIssureNotifyMapper.haiAnGetNotifyHeader(site, notifyNo); |
|
|
if (header == null) { |
|
|
if (header == null) { |
|
|
throw new RuntimeException("海安申请单不存在或不属于当前site"); |
|
|
throw new RuntimeException("海安申请单不存在或不属于当前site"); |
|
|
} |
|
|
} |
|
|
if (!"noorder".equalsIgnoreCase(StringUtils.defaultString(header.getOrderType()).trim())) { |
|
|
|
|
|
|
|
|
if (!isIssueWcsPushOrderType(header.getOrderType())) { |
|
|
HaiAnWcsPushResult placeholder = new HaiAnWcsPushResult(); |
|
|
HaiAnWcsPushResult placeholder = new HaiAnWcsPushResult(); |
|
|
placeholder.setPlaceholder(true); |
|
|
placeholder.setPlaceholder(true); |
|
|
placeholder.setNotifyPushWcsFlag(header.getPushWcsFlag()); |
|
|
placeholder.setNotifyPushWcsFlag(header.getPushWcsFlag()); |
|
|
@ -551,6 +551,9 @@ public class HaiAnSearchIssureNotifyServiceImpl implements HaiAnSearchIssureNoti |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 将目标区域、已推送、共享托盘等订单级失败挂回物料汇总行,否则页面只看到数量满足但看不到按钮禁用原因 - rqrq |
|
|
|
|
|
applyOrderFailureToMaterialRow(materialRow, summary.getItemNo(), sourceRows); |
|
|
|
|
|
|
|
|
materialRow.setMatchedSerialNos(joinSerialNos(materialSerialNos)); |
|
|
materialRow.setMatchedSerialNos(joinSerialNos(materialSerialNos)); |
|
|
compactRows.add(materialRow); |
|
|
compactRows.add(materialRow); |
|
|
for (Map.Entry<Integer, HaiAnInventoryMatchResult> entry : specifiedRows.entrySet()) { |
|
|
for (Map.Entry<Integer, HaiAnInventoryMatchResult> entry : specifiedRows.entrySet()) { |
|
|
@ -561,6 +564,31 @@ public class HaiAnSearchIssureNotifyServiceImpl implements HaiAnSearchIssureNoti |
|
|
return compactRows; |
|
|
return compactRows; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @author rqrq |
|
|
|
|
|
* @Description 从同一订单序号的失败事件中提取首个阻断原因,回填到物料汇总行供前端解释不可推送状态 - rqrq |
|
|
|
|
|
*/ |
|
|
|
|
|
private void applyOrderFailureToMaterialRow(HaiAnInventoryMatchResult materialRow, BigDecimal itemNo, |
|
|
|
|
|
List<HaiAnInventoryMatchResult> sourceRows) { |
|
|
|
|
|
if (materialRow == null || itemNo == null || sourceRows == null || StringUtils.isNotBlank(materialRow.getFailureCode())) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
for (HaiAnInventoryMatchResult event : sourceRows) { |
|
|
|
|
|
if (event == null || event.getItemNo() == null || itemNo.compareTo(event.getItemNo()) != 0) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
if (!"FAILED".equalsIgnoreCase(StringUtils.defaultString(event.getMatchStatus()).trim()) |
|
|
|
|
|
|| StringUtils.isBlank(event.getFailureCode())) { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
materialRow.setMatchStatus("FAILED"); |
|
|
|
|
|
materialRow.setFailureCode(event.getFailureCode()); |
|
|
|
|
|
materialRow.setFailureMessage(event.getFailureMessage()); |
|
|
|
|
|
materialRow.setOrderSatisfactionStatus("INCOMPLETE"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author rqrq |
|
|
* @author rqrq |
|
|
* @Description 复制前端预览需要的物料字段,明确排除托盘、位置、批次日期等推送内部字段 - rqrq |
|
|
* @Description 复制前端预览需要的物料字段,明确排除托盘、位置、批次日期等推送内部字段 - rqrq |
|
|
@ -751,7 +779,7 @@ public class HaiAnSearchIssureNotifyServiceImpl implements HaiAnSearchIssureNoti |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author rqrq |
|
|
* @author rqrq |
|
|
* @Description 生成非无订单海安页面的兼容占位返回,不触发通用匹配过程 - rqrq |
|
|
|
|
|
|
|
|
* @Description 生成未开放类型的兼容占位返回,不触发通用匹配过程和WCS副作用 - rqrq |
|
|
*/ |
|
|
*/ |
|
|
private HaiAnInventoryMatchResponse buildPlaceholderMatchResponse(String site, String notifyNo, String message) { |
|
|
private HaiAnInventoryMatchResponse buildPlaceholderMatchResponse(String site, String notifyNo, String message) { |
|
|
HaiAnInventoryMatchResponse response = new HaiAnInventoryMatchResponse(); |
|
|
HaiAnInventoryMatchResponse response = new HaiAnInventoryMatchResponse(); |
|
|
@ -762,6 +790,18 @@ public class HaiAnSearchIssureNotifyServiceImpl implements HaiAnSearchIssureNoti |
|
|
return response; |
|
|
return response; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @author rqrq |
|
|
|
|
|
* @Description 判断海安查看页申请类型是否已开放真实WCS库存匹配和确认推送;未开放类型保持占位返回,避免报废等未知链路误下发WCS - rqrq |
|
|
|
|
|
*/ |
|
|
|
|
|
private boolean isIssueWcsPushOrderType(String orderType) { |
|
|
|
|
|
String normalizedOrderType = StringUtils.defaultString(orderType).trim().toLowerCase(); |
|
|
|
|
|
return "noorder".equals(normalizedOrderType) |
|
|
|
|
|
|| "shoporder".equals(normalizedOrderType) |
|
|
|
|
|
|| "poorder".equals(normalizedOrderType) |
|
|
|
|
|
|| "shipment".equals(normalizedOrderType); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author rqrq |
|
|
* @author rqrq |
|
|
* @Description 生成订单级推送结果摘要,明确本次成功和跳过数量 - rqrq |
|
|
* @Description 生成订单级推送结果摘要,明确本次成功和跳过数量 - rqrq |
|
|
|