Browse Source

1.修复线上欧派|梦天车次问题

training
pref_mail@163.com 2 years ago
parent
commit
0ba0ff47d0
  1. 47
      blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java
  2. 2
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java
  3. 15
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpSignDataHandler.java
  4. 17
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java
  5. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/props/OuPaiProperties.java
  6. 12
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml
  7. 4
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java

47
blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/AsyncDataServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.factory.comfac.service.impl;
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -96,6 +97,11 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
private final IFactoryPackageDetailService factoryPackageDetailService;
/**
* 目前推送的基地
*/
private String [] jidiCanshu ={"双流基地","无锡基地"};
/**
* 处理皮阿诺数据推送到汇通老库
*/
@ -147,7 +153,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity.setSenderMobile(StringUtil.isBlank(panFactoryOrder.getSenderMobile()) ? "" : panFactoryOrder.getSenderMobile());//发货人电话 可以为空
advanceEntity.setSenderAddress(StringUtil.isBlank(panFactoryOrder.getSenderAddress()) ? "" : panFactoryOrder.getSenderAddress()); //发货地址 可以为空
advanceEntity.setSenderName(StringUtil.isBlank(panFactoryOrder.getSendFactory()) ? "" : panFactoryOrder.getSendFactory()); //发货工厂名称 可以为空
advanceEntity.setAdministratorsId(1078);// 导入人
advanceEntity.setAdministratorsId(1093);// 导入人
advanceEntity.setCreateTime(initTimestamp()); //添加时间
advanceEntity.setCarsNum(""); //派车单--snm 可以为空
advanceEntity.setDeleteTime(0); // 删除时间
@ -221,7 +227,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setDeleteTime(0);//删除时间
advanceDetailEntity.setServiceNum(StringUtil.isBlank(panFactoryOrder.getServiceNum()) ? "" : panFactoryOrder.getServiceNum());//服务号
advanceDetailEntity.setAdmin("");//
advanceDetailEntity.setAdministratorsId(0);//导入人
advanceDetailEntity.setAdministratorsId(1126);//导入人
// advanceDetailEntity.setDueDate(0);//交期
advanceDetailEntity.setRemark("");//备注
advanceDetailEntity.setOldId(0);//
@ -250,7 +256,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
detailProductEntity.setDelivernum(Objects.isNull(panPackageList.getQuantity()) ? 0 : panPackageList.getQuantity());
detailProductEntity.setProducttype("");
detailProductEntity.setBuyTime("");
detailProductEntity.setAdministratorsId(0);
detailProductEntity.setAdministratorsId(1126);
detailProductEntity.setDeleteTime(0);
detailProductEntity.setCreateTime(LocalDate.now());
saveList.add(detailProductEntity);
@ -401,9 +407,18 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
// 需要从老系统进行订单数据查询
AdvanceEntity advanceEntity = findAdvanceEntityUseCacheByOrderSelfNum(factoryOrderEntity.getSelfCode(),carNumber);
if (ObjectUtils.isNull(advanceEntity)) {
//todo 先阶段值推送老系统的双流和无锡
if(!ArrayUtil.contains(jidiCanshu,receivingOrderEntity.getCurrentWarehouseName())){
log.info("推送老系统失败,当前仓库不是双流和无锡,推送失败 {}",receivingOrderEntity.getCurrentWarehouseName());
continue;
}
advanceEntity = new AdvanceEntity();
advanceEntity.setOrderSelfNum(StringUtil.isBlank(factoryOrderEntity.getSelfCode()) ? "" : factoryOrderEntity.getSelfCode()); //订单自编号
advanceEntity.setSiteName(""); // 基地 TODO 需要映射
advanceEntity.setSiteName(receivingOrderEntity.getCurrentWarehouseName()); // 基地 TODO 需要映射
advanceEntity.setArea(""); // 区域
advanceEntity.setOrderTypeName(""); //订单类型名称 可以为空
advanceEntity.setOrderClassName("工厂"); //订单类型 可以为空
@ -434,13 +449,19 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity.setSenderMobile("");//发货人电话 可以为空
advanceEntity.setSenderAddress(""); //发货地址 可以为空
advanceEntity.setSenderName(""); //发货工厂名称 可以为空
advanceEntity.setAdministratorsId(1078);// 导入人
advanceEntity.setAdministratorsId(1126);// 导入人
advanceEntity.setCreateTime(initTimestamp()); //添加时间
advanceEntity.setCarsNum(receivingOrderEntity.getCarNumber());
advanceEntity.setDeleteTime(0); // 删除时间
advanceEntity.setWaybillNo("");//运单号 可以为空
// Integer id = PanFactoryEnum.getId(panFactoryOrder.getPlantId());
advanceEntity.setWarehouseId(141); //导入人仓库id TODO 需要提供映射
advanceEntity.setWaybillStatus(Byte.parseByte("1"));//开单状态:1=未开单,2=已开单
advanceEntity.setOldId(0);//
advanceEntity.setFreeze(Byte.parseByte("1"));//冻结状态:1=正常,2=冻结
@ -538,7 +559,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setDeleteTime(0);//删除时间
advanceDetailEntity.setServiceNum(StringUtil.isBlank(advanceEntity.getServiceNum()) ? "" : advanceEntity.getServiceNum());//服务号
advanceDetailEntity.setAdmin("");//
advanceDetailEntity.setAdministratorsId(0);//导入人
advanceDetailEntity.setAdministratorsId(1126);//导入人
advanceDetailEntity.setRemark("");//备注
advanceDetailEntity.setOldId(0);//
Integer detailId = advanceDetailClient.addAdvanceDetail(advanceDetailEntity);
@ -657,7 +678,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
detailProductEntity.setDelivernum(Objects.isNull(zbPackageInfoEntity.getPlanQty()) ? 0 : zbPackageInfoEntity.getPlanQty());
detailProductEntity.setProducttype("");
detailProductEntity.setBuyTime("");
detailProductEntity.setAdministratorsId(0);
detailProductEntity.setAdministratorsId(1126);
detailProductEntity.setDeleteTime(0);
detailProductEntity.setCreateTime(LocalDate.now());
saveList.add(detailProductEntity);
@ -697,7 +718,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
detailProductEntity.setDelivernum(1);
detailProductEntity.setProducttype("");
detailProductEntity.setBuyTime("");
detailProductEntity.setAdministratorsId(0);
detailProductEntity.setAdministratorsId(1126);
detailProductEntity.setDeleteTime(0);
detailProductEntity.setCreateTime(LocalDate.now());
saveList.add(detailProductEntity);
@ -781,7 +802,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setDeleteTime(0);//删除时间
advanceDetailEntity.setServiceNum(StringUtil.isBlank(advanceEntity.getServiceNum()) ? "" : advanceEntity.getServiceNum());//服务号
advanceDetailEntity.setAdmin("");//
advanceDetailEntity.setAdministratorsId(0);//导入人
advanceDetailEntity.setAdministratorsId(1126);//导入人
// advanceDetailEntity.setDueDate(0);//交期
advanceDetailEntity.setRemark("");//备注
advanceDetailEntity.setOldId(0);//
@ -881,8 +902,8 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity.setSenderMobile(StringUtil.isBlank(zbReceiptEntity.getSenderMobile()) ? "" : zbReceiptEntity.getSenderMobile());//发货人电话 可以为空
advanceEntity.setSenderAddress(StringUtil.isBlank(zbReceiptEntity.getSenderAddress()) ? "" : zbReceiptEntity.getSenderAddress()); //发货地址 可以为空
advanceEntity.setSenderName(StringUtil.isBlank(zbReceiptEntity.getSenderName()) ? "" : zbReceiptEntity.getSenderName()); //发货工厂名称 可以为空
// todo 需要运营提供 1080为线上测试环境
advanceEntity.setAdministratorsId(1080);// 导入人
// todo 需要运营提供 1080为线上测试环境 1126为正式
advanceEntity.setAdministratorsId(1126);// 导入人
advanceEntity.setCreateTime(initTimestamp()); //添加时间
advanceEntity.setCarsNum(""); //派车单--snm 可以为空
advanceEntity.setDeleteTime(0); // 删除时间
@ -1033,7 +1054,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceEntity.setSenderMobile("");//发货人电话 可以为空
advanceEntity.setSenderAddress(""); //发货地址 可以为空
advanceEntity.setSenderName(""); //发货工厂名称 可以为空
advanceEntity.setAdministratorsId(1078);// 导入人
advanceEntity.setAdministratorsId(1094);// 导入人
advanceEntity.setCreateTime(initTimestamp()); //添加时间
advanceEntity.setCarsNum(StringUtil.isBlank(mtFactoryOrderMain.getInvoiceOrderCode()) ? "" : mtFactoryOrderMain.getInvoiceOrderCode()); //派车单--snm 可以为空
advanceEntity.setDeleteTime(0); // 删除时间
@ -1071,7 +1092,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
advanceDetailEntity.setDeleteTime(0);//删除时间
advanceDetailEntity.setServiceNum(StringUtil.isBlank(mtFactoryOrder.getMainOrderCode()) ? "" : mtFactoryOrder.getMainOrderCode());//服务号
advanceDetailEntity.setAdmin("");//
advanceDetailEntity.setAdministratorsId(0);//导入人
advanceDetailEntity.setAdministratorsId(1094);//导入人
// advanceDetailEntity.setDueDate(0);//交期
advanceDetailEntity.setRemark("");//备注
advanceDetailEntity.setOldId(0);//

2
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryOrderMainServiceImpl.java

@ -63,7 +63,7 @@ public class MtFactoryOrderMainServiceImpl extends BaseServiceImpl<MtFactoryOrde
@Override
public Boolean beachPush(List<Long> longs, String data) {
if(StringUtils.isNotEmpty(data)){
if(StringUtils.isEmpty(data)){
data = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
}

15
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpSignDataHandler.java

@ -47,6 +47,16 @@ public class OpSignDataHandler {
public void opSignDataHandler(Map map, Message message, Channel channel) throws IOException {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
log.info("##################opSignDataHandler: 处理欧派收货数据到新系统");
try {
if (Objects.isNull(map)) {
log.error("##################opSignDataHandler: 处理欧派收货数据到新系统,map为空");
return;
}
// 获取消息id
String messageId = message.getMessageProperties().getMessageId();
// 获取消息id
String messageData = new String(message.getBody());
OpOrderStatusLogEntity opOrderStatusLogEntity = (OpOrderStatusLogEntity) map.get("messageData");
String args = opOrderStatusLogEntity.getArgs();
JSONObject jsonObject = JSONObject.parseObject(args);
@ -273,5 +283,10 @@ public class OpSignDataHandler {
}
}
}
} catch (Exception e) {
log.error("opSignDataHandler error {}", e.getMessage());
}
}
}

17
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -58,10 +58,10 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
// 对返回i的数据进行处理 按照 发车单-->订单-->包件 完成保存
handleData(code);
if (ObjectUtils.isNotNull(code)) {
asyncDataService.handlerOuPaiDataToHt(code);
}
// todo 暂时关闭对老系统的数据推送 需要确认数据的仓库归属后在进行
// if (ObjectUtils.isNotNull(code)) {
// asyncDataService.handlerOuPaiDataToHt(code);
// }
return code;
}
@ -189,7 +189,6 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
map.put("messageData", opOrderStatusLogEntity);
map.put("createTime", new Date().getTime());
try {
rabbitTemplate.convertAndSend(RabbitConstant.OUPAI_RECEIVING_EXCHANGE, RabbitConstant.OUPAI_RECEIVING_ROUTING, map);
} catch (Exception e) {
log.error("############handlePackageData: {}", e.getMessage());
@ -200,7 +199,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
}
private OpOrderStatusLogEntity sendRequestData(String url, Integer event) {
log.info("#################sendRequestData: 请求地址 url={}", url);
// log.info("#################sendRequestData: 请求地址 url={}", url);
String token = buildToken();
// log.info(">>> Authorization token {}",token);
@ -208,7 +207,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
HttpResponse httpResponse = HttpRequest.get(url).header("Authorization", token).execute();
String result = httpResponse.body();
log.info("#################sendRequestData: 返回数据 result={}", result);
// log.info("#################sendRequestData: 返回数据 result={}", result);
OpOrderStatusLogEntity orderStatusLog = new OpOrderStatusLogEntity();
orderStatusLog.setArgs(result);
@ -567,7 +566,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
"&$expand=SendWarehouse($select=Name,Code)" +
")&$expand=FromWarehouse($select=Name,Code)&$expand=CurrentWarehouse($select=Name,Code)&$expand=EndWarehouse($select=Name,Code)";
log.info(">>> findOurPaiDataByCarNumber url {}", url);
// log.info(">>> findOurPaiDataByCarNumber url {}", url);
String token = buildToken();
// log.info(">>> Authorization token {}",token);
@ -575,7 +574,7 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
HttpResponse httpResponse = HttpRequest.get(url).header("Authorization", token).execute();
String result = httpResponse.body();
log.info(">>> findOurPaiDataByCarNumber result {}", result);
// log.info(">>> findOurPaiDataByCarNumber result {}", result);
OpOrderStatusLogEntity orderStatusLog = new OpOrderStatusLogEntity();
orderStatusLog.setArgs(result);

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/props/OuPaiProperties.java

@ -17,4 +17,5 @@ public class OuPaiProperties {
private String uri;
}

12
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceDetailMapper.xml

@ -121,8 +121,16 @@
<select id="getByCarNum" resultType="string" >
SELECT cls.unitNo FROM ht_cars_load_scan cls LEFT JOIN ht_advance_detail ad on ad.unitNo=cls.unitNo WHERE cls.start_cars_no=#{unloadCarNum} and cls.type=0 and ad.type="梦天"
SELECT
cls.unitNo
FROM
ht_cars_load_scan cls
LEFT JOIN ht_advance_detail ad ON ad.unitNo = cls.unitNo
LEFT JOIN ht_cars_load hcl on hcl.id=cls.cars_load_id
WHERE
hcl.start_cars_no=#{unloadCarNum}
AND cls.type = 0
AND ad.type = "梦天"
</select>
<select id="findAdvanceDetailEntityByPackageCode" resultMap="advanceDetailResultMap" >

4
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceDetailServiceImpl.java

@ -81,9 +81,7 @@ public class AdvanceDetailServiceImpl implements IAdvanceDetailService {
@Override
public List<String> getByCarNum(String unloadCarNum) {
List<String> ls = advanceDetailMapper.getByCarNum(unloadCarNum);
return ls;
return advanceDetailMapper.getByCarNum(unloadCarNum);
}
@Override

Loading…
Cancel
Save