From 41fc4c8666a27266c0bec3b18b6aaf2d825f10c0 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 29 May 2024 09:55:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?1.=E7=BB=93=E7=AE=97bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../statistics/dto/MerchantStatisticsDTO.java | 2 ++ .../controller/MerchantBalanceController.java | 25 +++++++++++++++++++ .../IStatisticsBalanceOrderInfoService.java | 3 +++ ...StatisticsBalanceOrderInfoServiceImpl.java | 8 ++++++ 4 files changed, 38 insertions(+) diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java index d1ad2df46..2b84490e0 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/dto/MerchantStatisticsDTO.java @@ -23,4 +23,6 @@ public class MerchantStatisticsDTO implements Serializable { private List orderInfoIds; + private Long balanceOrderId; + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java index a40475a47..5d67944a7 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/MerchantBalanceController.java @@ -155,5 +155,30 @@ public class MerchantBalanceController { } } + @ResponseBody + @PostMapping("/findBalanceDetail") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查询异常列表", notes = "传入merchantStatisticsDTO") + public R findBalanceDetail(@RequestBody MerchantStatisticsDTO merchantStatisticsDTO) { + String method = "############findBalanceDetail: "; + log.info(method+"请求参数{}",merchantStatisticsDTO); + try{ + + Long balanceOrderId = merchantStatisticsDTO.getBalanceOrderId(); + if(Objects.isNull(balanceOrderId)){ + log.warn(method+"请选择正确的结算单 balanceOrderId={}",balanceOrderId); + return R.fail(405,"请选择正确的结算单"); + } + + return balanceOrderInfoService.findBalanceDetail(balanceOrderId); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + } + } diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java index 15bd8f331..46d550728 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/IStatisticsBalanceOrderInfoService.java @@ -19,4 +19,7 @@ public interface IStatisticsBalanceOrderInfoService extends BaseService Date: Wed, 29 May 2024 10:14:09 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat(all):=20=E5=A2=9E=E5=8A=A0=E6=88=91?= =?UTF-8?q?=E4=B9=90=E9=85=8D=E9=80=81=E8=8A=82=E7=82=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../olo/mq/NodeDataPushListener.java | 13 ++++++++++++- .../factorydata/olo/pros/OldProperties.java | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/pros/OldProperties.java diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java index 7495af8ed..7ac2392fd 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java @@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.EnumUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; @@ -12,6 +13,7 @@ import com.logpm.factorydata.feign.IFactoryDataClient; import com.logpm.factorydata.olo.enums.FactoryNodeEnums; import com.logpm.factorydata.olo.enums.NodeMappingEnums; import com.logpm.factorydata.olo.enums.NodeNeedEnums; +import com.logpm.factorydata.olo.pros.OldProperties; import com.logpm.factorydata.vo.PushData; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -40,6 +42,7 @@ import java.util.stream.Collectors; public class NodeDataPushListener { private final IFactoryDataClient factoryDataClient; + private final OldProperties oldProperties; @RabbitListener(bindings = @QueueBinding( value = @Queue(name = FactoryDataConstants.Mq.Queues.OLO_NODE_DATA_PUSH, durable = "true"), @@ -87,7 +90,15 @@ public class NodeDataPushListener { } js.set("snList", snArray); log.info("推送节点数据:{}", js.toString()); -// HttpUtil.post("", js.toString()); + if (StrUtil.isNotEmpty(oldProperties.getPushNodeUrl())) { + try { + String post = HttpUtil.post(oldProperties.getPushNodeUrl(), js.toString()); + log.info("推送结果:{}", post); + } catch (Exception e) { + e.printStackTrace(); + log.error("推送节点数据错误:{}", e); + } + } } } } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/pros/OldProperties.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/pros/OldProperties.java new file mode 100644 index 000000000..9d414cf8b --- /dev/null +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/pros/OldProperties.java @@ -0,0 +1,19 @@ +package com.logpm.factorydata.olo.pros; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 老系统配置 + * @author zhaoqiaobo + * @Date 2024/5/29 + **/ +@Data +@ConfigurationProperties(prefix = "old") +public class OldProperties { + /** + * 推送节点数据到来系统的 url + */ + private String pushNodeUrl; + +} From 8dc3e52ba1565335fba83b4fba24fad6ebea8e64 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo Date: Wed, 29 May 2024 14:01:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(all):=20=E4=BF=AE=E6=94=B9=E5=BF=97?= =?UTF-8?q?=E9=82=A6=E6=8E=A8=E9=80=81=E6=95=B0=E6=8D=AE=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zbom/mq/ZbomFactoryOrderListener.java | 2 +- .../zbom/mq/ZbomNodeDataPushListener.java | 9 ++++----- .../factorydata/zbom/pros/ZbFactoryProperties.java | 14 ++++++++++++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java index 73e879cd1..a51563664 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomFactoryOrderListener.java @@ -188,7 +188,7 @@ public class ZbomFactoryOrderListener { packageInfoService.saveBatch(packageInfoEntities); } // 处理暂存单 - if(zbFactoryProperties.isAdvance()){ + if(zbFactoryProperties.getIsAdvance()){ receiptService.buildAdvance(zbReceiptDTO, packageCode); } } diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java index 1bdd1e641..8b8f58d25 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/mq/ZbomNodeDataPushListener.java @@ -139,7 +139,7 @@ public class ZbomNodeDataPushListener { String key = nodeConfirmParam.getDepartCode() + nodeConfirmParam.getPlatformOrderCode(); String body = JSONUtil.toJsonStr(nodeConfirmParam); String result = null; - if (zbProperties.isEnable()) { + if (zbProperties.getEnable()) { result = ZbomUtil.pushZbomSystem(zbProperties, body, ZbomConstants.Method.ROUTE_NODE_CONFIRM); } else { JSONObject jsonObject = new JSONObject(); @@ -214,6 +214,7 @@ public class ZbomNodeDataPushListener { Map noSignNumberMap, Map nodeOrderMap, List nodeConfirmLsit, Map sendMsgMap) { if (CollUtil.isNotEmpty(orders)) { + Integer nodeDelay = zbProperties.getDelayedTime() * 60 * 1000; for (NodeDataDTO nodeData : orders) { ZbomNodeEnums zbNode = ZbomNodeMappingEnums.getZbomByNodeAndStatus(workNodeEnums); String departCode = nodeData.getDepartCode(); @@ -242,7 +243,6 @@ public class ZbomNodeDataPushListener { if (ObjectUtil.isNotEmpty(nodeOrderEntity.getPushNode()) && !StrUtil.contains(nodeOrderEntity.getPushNode(), ZbomNodeEnums.DELIVERY_ARRIVAL.getIndex().toString())) { // 第一次签收,节点改为送货抵达 currentNode = ZbomNodeEnums.DELIVERY_ARRIVAL; - Integer nodeDelay = 30 * 60 * 1000; buildSendMag(sendMsgMap, nodeData, key, paramDTO, node, nodeDelay); } else { // 查询当前未签收的数量与当前签收数量比较,如果未签收数较大,则是部分签收 @@ -267,20 +267,19 @@ public class ZbomNodeDataPushListener { } } Integer index = currentNode.getIndex(); - Integer startNodeDelay = 15 * 60 * 1000; // 历史必须节点需要补发 if (ObjectUtil.isEmpty(nodeOrderEntity.getPushNode())) { // 历史不存在,当前节点不是第一个节点,则需要补发第一个节点 if (!ObjectUtil.equal(index, ZbomNodeEnums.STATION_DEPART.getIndex())) { currentNode = ZbomNodeEnums.STATION_DEPART; - buildSendMag(sendMsgMap, nodeData, key, paramDTO, node, startNodeDelay); + buildSendMag(sendMsgMap, nodeData, key, paramDTO, node, nodeDelay); } } else { // 历史节点存在,但是历史节点中不包含第一个节点,且当前节点不是第一个节点,则需要补发第一个节点 if (!ObjectUtil.equal(index, ZbomNodeEnums.STATION_DEPART.getIndex()) && !StrUtil.contains(nodeOrderEntity.getPushNode(), ZbomNodeEnums.STATION_DEPART.getIndex().toString())) { currentNode = ZbomNodeEnums.STATION_DEPART; - buildSendMag(sendMsgMap, nodeData, key, paramDTO, node, startNodeDelay); + buildSendMag(sendMsgMap, nodeData, key, paramDTO, node, nodeDelay); } } // 组装历史节点数据 diff --git a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/pros/ZbFactoryProperties.java b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/pros/ZbFactoryProperties.java index 4692f73cf..a45760756 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/pros/ZbFactoryProperties.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-zbom/src/main/java/com/logpm/factorydata/zbom/pros/ZbFactoryProperties.java @@ -19,7 +19,17 @@ public class ZbFactoryProperties { private String customerid; private String secretkey; private String url; - private boolean isAdvance = false; - private boolean enable = true; + /** + * 签收延迟推送时间(分钟) + */ + private Integer delayedTime = 30; + /** + * 是否推送暂存单到新系统 + */ + private Boolean isAdvance = false; + /** + * 是否推送数据到志邦 + */ + private Boolean enable = true; }