Browse Source

修复Pan 开单会推的时候 报错问题

training
pref_mail@163.com 1 year ago
parent
commit
b4c4c01128
  1. 10
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java
  2. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  3. 45
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java
  4. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java
  5. 1
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java
  6. 4
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
  7. 7
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java
  8. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java

10
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IAdvanceClient.java

@ -85,6 +85,16 @@ public interface IAdvanceClient {
AdvanceEntity fingById(@RequestParam Integer advanceId);
/**
* 根据运单号和订单号查询老系统的开单对应的订单
* @param logiBillNo
* @param orderCode
* @return
*/
@GetMapping(API_PREFIX + "/findAdvanceEntityByLogiBillNoAndOrderCode")
List<AdvanceEntity> findAdvanceEntityByLogiBillNoAndOrderCode(@RequestParam String logiBillNo,@RequestParam String orderCode);

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -148,6 +148,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
//根据客户订单号去查询WMS装车清单号
QueryWrapper<PanFactoryOrder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_no", orderNo);
queryWrapper.eq("delivery_number", orderInfoDTO.getDeliveryNumber());
PanFactoryOrder panFactoryOrder = factoryOrderService.getOne(queryWrapper);
if (Objects.isNull(panFactoryOrder)) {
logger.info("#############handleData: 未找到订单数据 合同自编码orderNo={}", orderNo);

45
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/OpenOrderHandler.java

@ -18,6 +18,7 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -57,34 +58,40 @@ public class OpenOrderHandler {
}
//通过订单自编号去查询该条订单是属于哪个工厂
String orderSelfNum =orderNo;
AdvanceEntity advanceEntity = advanceClient.getQueryDataOne(orderSelfNum);
if(Objects.isNull(advanceEntity)){
// 汇通运单号
String logiBillNo = orderInfoDTO.getLogiBillNo();
List<AdvanceEntity> advanceEntitys = advanceClient.findAdvanceEntityByLogiBillNoAndOrderCode(logiBillNo,orderSelfNum);
if(Objects.isNull(advanceEntitys)){
log.info("##################openOrderStatusHandler: 未找到对应订单 orderNo={}",orderNo);
// channel.basicAck(deliveryTag,true);
return;
}
String type = advanceEntity.getType();//品牌
for (AdvanceEntity advanceEntity : advanceEntitys) {
String type = advanceEntity.getType();//品牌
orderInfoDTO.setOrderNo(orderNo);
R r = null;
switch (type){
case FactoryConstant.PIANO:
r = panFactoryDataService.handleData(orderInfoDTO);
int code = r.getCode();
if(code == 400 || code == 200){
log.info("##################openOrderStatusHandler: 该条数据不用处理 orderNo={}",orderNo);
// channel.basicAck(deliveryTag,true);
}else{
throw new CustomerException(code,r.getMsg());
}
break;
orderInfoDTO.setOrderNo(orderNo);
orderInfoDTO.setDeliveryNumber(advanceEntity.getMctsTruckNo());
R r = null;
switch (type){
case FactoryConstant.PIANO:
r = panFactoryDataService.handleData(orderInfoDTO);
int code = r.getCode();
if(code == 400 || code == 200){
log.info("##################openOrderStatusHandler: 该条数据不用处理 orderNo={}",orderNo);
}else{
throw new CustomerException(code,r.getMsg());
}
break;
// case FactoryConstant.MENGT:
// r = mtFactoryDataService.handleData(orderInfoDTO);
// break;
default:
log.info("##################openOrderStatusHandler: 未知品牌 type={}",type);
default:
log.info("##################openOrderStatusHandler: 未知品牌 type={}",type);
// channel.basicAck(deliveryTag,true);
}
}
}

6
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/AdvanceClient.java

@ -85,5 +85,9 @@ public class AdvanceClient implements IAdvanceClient {
public AdvanceEntity fingById(Integer advanceId) {
return service.fingById(advanceId);
}
@GetMapping(API_PREFIX + "/findAdvanceEntityByLogiBillNoAndOrderCode")
@Override
public List<AdvanceEntity> findAdvanceEntityByLogiBillNoAndOrderCode(String logiBillNo, String orderCode) {
return service.findAdvanceEntityByLogiBillNoAndOrderCode(logiBillNo,orderCode);
}
}

1
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.java

@ -49,4 +49,5 @@ public interface AdvanceMapper {
List<AdvanceEntity> getEntityByMctsTruck(@Param("orderSelfNum") String orderSelfNum, @Param("mctsTruck") String mctsTruck);
List<AdvanceEntity> findAdvanceEntityByLogiBillNoAndOrderCode(@Param("logiBillNo") String logiBillNo, @Param("orderCode")String orderCode);
}

4
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml

@ -57,5 +57,9 @@
and delete_time = 0
</select>
<select id="findAdvanceEntityByLogiBillNoAndOrderCode" resultMap="advanceResultMap">
SELECT adv.* from ht_advance adv LEFT JOIN ht_waybill_order wo on wo.advance_id=adv.id where wo.waybill_no =#{logiBillNo} and wo.orderSelfNum=#{orderCode} and wo.status !=-1
</select>
</mapper>

7
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IAdvanceService.java

@ -43,4 +43,11 @@ public interface IAdvanceService {
List<AdvanceEntity> getEntityByMctsTruck(String orderSelfNum, String mctsTruck);
/**
* 根据订单编号和运单号查询老信息的订单信息
* @param logiBillNo
* @param orderCode
* @return
*/
List<AdvanceEntity> findAdvanceEntityByLogiBillNoAndOrderCode(String logiBillNo, String orderCode);
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/AdvanceServiceImpl.java

@ -69,4 +69,9 @@ public class AdvanceServiceImpl implements IAdvanceService {
public List<AdvanceEntity> getEntityByMctsTruck(String orderSelfNum, String mctsTruck) {
return advanceMapper.getEntityByMctsTruck(orderSelfNum,mctsTruck);
}
@Override
public List<AdvanceEntity> findAdvanceEntityByLogiBillNoAndOrderCode(String logiBillNo, String orderCode) {
return advanceMapper.findAdvanceEntityByLogiBillNoAndOrderCode(logiBillNo,orderCode);
}
}

Loading…
Cancel
Save