Browse Source

Merge branch 'dev' into pre-production

master
zhaoqiaobo 8 months ago
parent
commit
107ead0291
  1. 18
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java
  2. 7
      blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/service/impl/DeliveryNoteServiceImpl.java

18
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)) { if (CollUtil.isNotEmpty(content)) {
Map<String, List<PushData>> sendMap = content.stream() Map<String, List<PushData>> sendMap = content.stream()
.collect(Collectors.groupingBy(data -> data.getOrderCode() + data.getWaybillNumber())); .collect(Collectors.groupingBy(data -> data.getOrderCode() + data.getWaybillNumber()));
JSONArray jsons = new JSONArray(sendMap.size());
for (Map.Entry<String, List<PushData>> entry : sendMap.entrySet()) { for (Map.Entry<String, List<PushData>> entry : sendMap.entrySet()) {
List<PushData> pushDatas = entry.getValue(); List<PushData> pushDatas = entry.getValue();
PushData pushData = pushDatas.get(0); PushData pushData = pushDatas.get(0);
@ -89,15 +90,18 @@ public class NodeDataPushListener {
snArray.add(jsonObject); snArray.add(jsonObject);
} }
js.set("snList", snArray); js.set("snList", snArray);
log.info("推送节点数据:{}", js.toString()); jsons.add(js);
if (StrUtil.isNotEmpty(oldProperties.getPushNodeUrl())) { }
try { if (StrUtil.isNotEmpty(oldProperties.getPushNodeUrl())) {
String post = HttpUtil.post(oldProperties.getPushNodeUrl(), js.toString()); try {
if (CollUtil.isNotEmpty(jsons)) {
log.info("推送节点数据:{}", JSONUtil.toJsonStr(jsons));
String post = HttpUtil.post(oldProperties.getPushNodeUrl(), JSONUtil.toJsonStr(jsons));
log.info("推送结果:{}", post); log.info("推送结果:{}", post);
} catch (Exception e) {
e.printStackTrace();
log.error("推送节点数据错误:{}", e);
} }
} catch (Exception e) {
e.printStackTrace();
log.error("推送节点数据错误:{}", e);
} }
} }
} }

7
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.DeliveryNoteService;
import com.logpm.factorydata.olo.service.FactoryOrderLogService; import com.logpm.factorydata.olo.service.FactoryOrderLogService;
import com.logpm.factorydata.olo.vo.DeliveryNoteVO; import com.logpm.factorydata.olo.vo.DeliveryNoteVO;
import com.logpm.factorydata.vo.PushData;
import com.logpm.factorydata.vo.SendMsg; import com.logpm.factorydata.vo.SendMsg;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineAdvanceEntity; 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.common.utils.FileLogsUtil;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.oss.model.BladeFile; import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.resource.feign.IOssClient; import org.springblade.resource.feign.IOssClient;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
@ -237,6 +235,9 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
@Override @Override
public void customPushNodeData() { public void customPushNodeData() {
JSONObject js = this.baseMapper.customPushNodeData(); JSONObject js = this.baseMapper.customPushNodeData();
if(ObjectUtil.isEmpty(js)){
return;
}
String sns = js.getStr("sns"); String sns = js.getStr("sns");
List<String> pushDatas = StrUtil.split(sns, ","); List<String> pushDatas = StrUtil.split(sns, ",");
js.set("siteLevel", 3); js.set("siteLevel", 3);
@ -255,7 +256,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl<DeliveryNoteMapper,
if (StrUtil.isNotEmpty(oldProperties.getPushNodeUrl())) { if (StrUtil.isNotEmpty(oldProperties.getPushNodeUrl())) {
try { try {
log.info("自定义推送节点数据:{}", js.toString()); log.info("自定义推送节点数据:{}", js.toString());
String post = HttpUtil.post(oldProperties.getPushNodeUrl(), js.toString()); String post = HttpUtil.post(oldProperties.getPushNodeUrl(), JSONUtil.toJsonStr(CollUtil.newArrayList(js)));
log.info("推送结果:{}", post); log.info("推送结果:{}", post);
// 修改推送状态 // 修改推送状态
this.baseMapper.updateSustomPushNodeDataStatus(js.getStr("status"), js.getStr("orderNo"), js.getStr("deliveryNo")); this.baseMapper.updateSustomPushNodeDataStatus(js.getStr("status"), js.getStr("orderNo"), js.getStr("deliveryNo"));

Loading…
Cancel
Save