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 8a14ceb58..b2360d2ff 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 @@ -65,6 +65,7 @@ public class NodeDataPushListener { if (CollUtil.isNotEmpty(content)) { Map> sendMap = content.stream() .collect(Collectors.groupingBy(data -> data.getOrderCode() + data.getWaybillNumber())); + JSONArray jsons = new JSONArray(sendMap.size()); for (Map.Entry> entry : sendMap.entrySet()) { List pushDatas = entry.getValue(); PushData pushData = pushDatas.get(0); @@ -89,15 +90,18 @@ public class NodeDataPushListener { snArray.add(jsonObject); } js.set("snList", snArray); - log.info("推送节点数据:{}", js.toString()); - if (StrUtil.isNotEmpty(oldProperties.getPushNodeUrl())) { - try { - String post = HttpUtil.post(oldProperties.getPushNodeUrl(), js.toString()); + jsons.add(js); + } + if (StrUtil.isNotEmpty(oldProperties.getPushNodeUrl())) { + try { + if (CollUtil.isNotEmpty(jsons)) { + log.info("推送节点数据:{}", JSONUtil.toJsonStr(jsons)); + String post = HttpUtil.post(oldProperties.getPushNodeUrl(), JSONUtil.toJsonStr(jsons)); log.info("推送结果:{}", post); - } catch (Exception e) { - e.printStackTrace(); - log.error("推送节点数据错误:{}", e); } + } 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/service/impl/DeliveryNoteServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java index eb1f98f72..f8087418c 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java @@ -23,7 +23,6 @@ import com.logpm.factorydata.olo.pros.OldProperties; import com.logpm.factorydata.olo.service.DeliveryNoteService; import com.logpm.factorydata.olo.service.FactoryOrderLogService; import com.logpm.factorydata.olo.vo.DeliveryNoteVO; -import com.logpm.factorydata.vo.PushData; import com.logpm.factorydata.vo.SendMsg; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; @@ -39,7 +38,6 @@ import org.springblade.common.constant.factorydata.FactoryDataConstants; import org.springblade.common.utils.FileLogsUtil; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.oss.model.BladeFile; -import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.tool.api.R; import org.springblade.resource.feign.IOssClient; import org.springframework.amqp.rabbit.core.RabbitTemplate; @@ -237,6 +235,9 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl pushDatas = StrUtil.split(sns, ","); js.set("siteLevel", 3); @@ -255,7 +256,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl