Browse Source

wcs回调调整

dev
常熟吴彦祖 4 days ago
parent
commit
728a1ded43
  1. 18
      src/main/java/com/gaotao/modules/autoWareHourceHaian/service/impl/HaiAnIssueNotifyPushTransactionServiceImpl.java
  2. 48
      src/main/java/com/gaotao/modules/autoWareHourceHaian/service/impl/HaiAnSearchIssureNotifyServiceImpl.java
  3. 2
      src/main/resources/application.yml

18
src/main/java/com/gaotao/modules/autoWareHourceHaian/service/impl/HaiAnIssueNotifyPushTransactionServiceImpl.java

@ -70,11 +70,11 @@ public class HaiAnIssueNotifyPushTransactionServiceImpl implements HaiAnIssueNot
throw new RuntimeException("订单没有服务端匹配明细,无法推送"); throw new RuntimeException("订单没有服务端匹配明细,无法推送");
} }
// 重新读取主单确认site申请单和ISSUE状态仍然有效避免预览到确认期间状态发生变化 - rqrq
// 重新读取主单确认site申请单类型白名单和ISSUE状态仍然有效避免预览到确认期间状态发生变化 - rqrq
com.gaotao.modules.autoWareHourceHaian.entity.HaiAnSOIssueNotifyHeaderData header = com.gaotao.modules.autoWareHourceHaian.entity.HaiAnSOIssueNotifyHeaderData header =
haiAnSearchIssureNotifyMapper.haiAnGetNotifyHeader(site, notifyNo); haiAnSearchIssureNotifyMapper.haiAnGetNotifyHeader(site, notifyNo);
if (header == null || !"noorder".equalsIgnoreCase(StringUtils.defaultString(header.getOrderType()).trim())) {
throw new RuntimeException("申请单不存在或不是海安无订单申请单");
if (header == null || !isIssueWcsPushOrderType(header.getOrderType())) {
throw new RuntimeException("申请单不存在或该海安申请类型暂未开放推送WCS");
} }
if (!"ISSUE".equalsIgnoreCase(StringUtils.defaultString(header.getStatus()).trim())) { if (!"ISSUE".equalsIgnoreCase(StringUtils.defaultString(header.getStatus()).trim())) {
throw new RuntimeException("申请单不是ISSUE状态,不能推送WCS"); throw new RuntimeException("申请单不是ISSUE状态,不能推送WCS");
@ -276,6 +276,18 @@ public class HaiAnIssueNotifyPushTransactionServiceImpl implements HaiAnIssueNot
return result; return result;
} }
/**
* @author rqrq
* @Description 事务层再次限制可真实推送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 按托盘和位置层构造稳定的WCS物料列表同时确保一个标签只出现在一次报文中 - rqrq * @Description 按托盘和位置层构造稳定的WCS物料列表同时确保一个标签只出现在一次报文中 - rqrq

48
src/main/java/com/gaotao/modules/autoWareHourceHaian/service/impl/HaiAnSearchIssureNotifyServiceImpl.java

@ -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

2
src/main/resources/application.yml

@ -157,7 +157,7 @@ scheduler:
ifsPalletMoveQueue: ifsPalletMoveQueue:
processing-timeout-minutes: 10 # 自动化托运IFS移库队列P状态超时回收分钟数 - rqrq processing-timeout-minutes: 10 # 自动化托运IFS移库队列P状态超时回收分钟数 - rqrq
haianAutoTask: haianAutoTask:
enabled: true # 海安非归档自动任务总开关:控制HaianAutoTaskScheduler与HaianWcsSchedule全部定时任务;归档仍走haianDataArchive.enabled - rqrq
enabled: false # 海安非归档自动任务总开关:控制HaianAutoTaskScheduler与HaianWcsSchedule全部定时任务;归档仍走haianDataArchive.enabled - rqrq
kit-transport-fixed-delay-ms: 10000 # 海安齐套transport_flag回写任务间隔(毫秒),默认10秒 - rqrq kit-transport-fixed-delay-ms: 10000 # 海安齐套transport_flag回写任务间隔(毫秒),默认10秒 - rqrq
ifsPalletMoveQueue: ifsPalletMoveQueue:
processing-timeout-minutes: 10 # 海安IFS移库队列P状态超时回收分钟数 - rqrq processing-timeout-minutes: 10 # 海安IFS移库队列P状态超时回收分钟数 - rqrq

Loading…
Cancel
Save