Browse Source

Merge pull request 'dev' (#24) from dev into pre-production

Reviewed-on: #24
master
zhaoqiaobo 10 months ago
parent
commit
9ecd5defb8
  1. 14
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/ZbomNodeEnums.java
  2. 10
      blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java

14
blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/enums/ZbomNodeEnums.java

@ -29,4 +29,18 @@ public enum ZbomNodeEnums {
this.value = value;
}
/**
* 根据code查询枚举
* @param code
* @return
*/
public static ZbomNodeEnums getByCode(String code) {
for (ZbomNodeEnums item : ZbomNodeEnums.values()) {
if (item.getCode().equals(code)) {
return item;
}
}
return null;
}
}

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

@ -257,18 +257,24 @@ public class ZbomNodeDataPushListener {
} else {
// 查询当前未签收的数量与当前签收数量比较,如果未签收数较大,则是部分签收
paramDTO.setNode(ZbomNodeMappingEnums.getZbomByNodeAndStatus(nodeEnums, ZbomConstants.Status.SIGN_FOR_SECTION_STATUS).getCode());
currentNode = ZbomNodeMappingEnums.getZbomByNodeAndStatus(nodeEnums, ZbomConstants.Status.SIGN_FOR_SECTION_STATUS);
paramDTO.setSignQty(nodeData.getSignQty());
if (ObjectUtil.isNotEmpty(noSignNumberMap) && noSignNumberMap.containsKey(key)) {
Integer noSignNum = noSignNumberMap.get(key);
if (noSignNum <= signNumber) {
// 全部签收
log.info("{} 全部签收", platformOrderCode);
paramDTO.setNode(ZbomNodeMappingEnums.getZbomByNodeAndStatus(nodeEnums, ZbomConstants.Status.SIGN_FOR_ALL_STATUS).getCode());
currentNode = ZbomNodeMappingEnums.getZbomByNodeAndStatus(nodeEnums, ZbomConstants.Status.SIGN_FOR_ALL_STATUS);
}
} else {
continue;
}
String pushNode = nodeOrderEntity.getPushNode();
// 如果之前发送的是部分签收,则之后的所有签收节点都发部分签收
if (StrUtil.isNotEmpty(pushNode) && pushNode.contains(ZbomNodeEnums.PARTIAL_RECEIPT.getIndex().toString())) {
log.info("{} 部分签收", platformOrderCode);
paramDTO.setNode(ZbomNodeMappingEnums.getZbomByNodeAndStatus(nodeEnums, ZbomConstants.Status.SIGN_FOR_SECTION_STATUS).getCode());
}
currentNode = ZbomNodeEnums.getByCode(paramDTO.getNode());
}
}
Integer index = currentNode.getIndex();

Loading…
Cancel
Save