Browse Source

Merge pull request 'fix(service):处理全部签收重复提交问题' (#12) from dev into pre-production

Reviewed-on: #12
master
zhaoqiaobo 10 months ago
parent
commit
fb5a5de63d
  1. 6
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java

6
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java

@ -137,6 +137,7 @@ public class ZbomNodeDataPushListener {
List<NodeConfirmParamDTO> orders = orderPackageService.findOrderCodebypackageCodes(packageCodeList);
// 根据运单号和自编码分组查询出未签收的数量
List<NoSignNumberDTO> noSignNumberDTOS = orderPackageService.findNoSignNumber(packageCodeList);
log.info("未签收数据:{}", JSONUtil.toJsonStr(noSignNumberDTOS));
Map<String, Integer> noSignNumberMap = new HashMap<>();
if (CollUtil.isNotEmpty(noSignNumberDTOS)) {
for (NoSignNumberDTO noSignNumberDTO : noSignNumberDTOS) {
@ -150,17 +151,20 @@ public class ZbomNodeDataPushListener {
order.setAddress(entries.getStr("address"));
// 如果是签收节点,需要判断是否为全部签收和部分签收
if (EnumUtil.equals(NodeEnums.CLERK_REVIEW, node)) {
log.info("key:{},签收数量:{}", order.getDepartCode() + "_" + order.getPlatformOrderCode(), order.getSignQty());
Integer signNumber = Convert.toInt(order.getSignQty());
// 查询当前未签收的数量与当前签收数量比较,如果未签收数较大,则是部分签收
String key = order.getDepartCode() + order.getPlatformOrderCode();
// 部分签收
order.setNode(ZbomNodeMappingEnums.getZbomByNodeAndStatus(nodeEnums, ZbomConstants.Status.SIGN_FOR_SECTION_STATUS).getCode());
if (noSignNumberMap.containsKey(key)) {
if (ObjectUtil.isNotEmpty(noSignNumberMap) && noSignNumberMap.containsKey(key)) {
Integer noSignNum = noSignNumberMap.get(key);
if (noSignNum <= signNumber) {
// 全部签收
order.setNode(ZbomNodeMappingEnums.getZbomByNodeAndStatus(nodeEnums, ZbomConstants.Status.SIGN_FOR_ALL_STATUS).getCode());
}
} else {
continue;
}
} else {
order.setRejectQty("");

Loading…
Cancel
Save