Browse Source

1.修改欧派数据推送

single_db
pref_mail@163.com 1 year ago
parent
commit
37acaf8bef
  1. 51
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  3. 8
      blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java
  4. 27
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/feign/OuPaiFactoryClinet.java
  5. 31
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/NewSystemReceiveInfoHandler.java

51
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -15,10 +15,12 @@ import com.logpm.distribution.entity.*;
import com.logpm.distribution.mapper.*;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.mt.dto.MtReceiveContentDTO;
import com.logpm.factory.mt.dto.MtReceiveDTO;
import com.logpm.factory.mt.dto.MtReceiveImagesDTO;
import com.logpm.factory.mt.feign.IMtOrderMainClinet;
import com.logpm.factory.oupai.feign.IOuPaiFactoryClinet;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.sun.xml.bind.v2.TODO;
import lombok.AllArgsConstructor;
@ -93,6 +95,8 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
private final IDistributionParcelNumberService distributionParcelNumberService;
// private final IDistributionParcelNumberService distributionParcelNumberService;
private final IMtOrderMainClinet orderMainClinet;
private final IOuPaiFactoryClinet ouPaiFactoryClinet;
private final IDistrilbutionBillPackageService billPackageService;
private final IDistributionReservationZeroPackageService zeroPackageService;
@ -1460,7 +1464,7 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
@Transactional
@Async
public void sendReviewFactory(Long signingId, String warehouseName, Long warehouseId) {
String brands = "梦天";//可追加
String brands = "梦天,欧派";//可追加
//查询签收信息
DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(signingId);
@ -1525,6 +1529,39 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO);
}
if (Func.isNotEmpty(brand.get("欧派"))) {
// 重新筛选出欧派的包件
for (DistributionReservationStockarticleEntity distributionReservationStockarticleEntity : distributionReservationStockarticleEntities) {
// 查询预约单下面的包间信息
List<DistributionParcelListEntity> distributionParcelListEntities = buildOpByReservationId(distributionReservationStockarticleEntity);
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
OrderStatusDTO orderStatusDTO = new OrderStatusDTO();
orderStatusDTO.setUnitNo(distributionParcelListEntity.getOrderPackageCode());
// todo 查询签收信息
orderStatusDTO.setUsername("111");
orderStatusDTO.setStatus("7");
// orderStatusDTO.setOperationTime();
ouPaiFactoryClinet.newSystemHandleStatusData(orderStatusDTO);
}
}
// orderMainClinet.sendReceiveInfoByNewSystem(mtReceiveDTO);
}
//....工厂
} catch (Exception e) {
throw new RuntimeException(e);
@ -1534,6 +1571,18 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
/**
* 根据预约单查询预约单下面的订单下面的包件
* 并且状态为已签收的包件
* @param distributionReservationStockarticleEntity
* @return
*/
private List<DistributionParcelListEntity> buildOpByReservationId(DistributionReservationStockarticleEntity distributionReservationStockarticleEntity) {
//
return null;
}
@Override
@Async
@Transactional

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -1076,7 +1076,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Map<String, Object> mapState = new HashMap<>();
mapState.put("orderStatusDTO", orderStatusDTO);
mapState.put("brand", brand);
rabbitTemplate.convertAndSend(RabbitConstant.NEW_SYSTEM_RECEIVE_INFO_QUEUE, mapState);
// rabbitTemplate.convertAndSend(RabbitConstant.NEW_SYSTEM_RECEIVE_INFO_QUEUE, mapState);
return Resp.scanSuccess("签收成功", str);
}

8
blade-service/logpm-factory/src/main/java/com/logpm/factory/config/RabbitMqConfiguration.java

@ -184,7 +184,7 @@ public class RabbitMqConfiguration {
}
@Bean
public Queue newSystemReceiveInfoHandler() {
public Queue newSystemReceiveInfoQuery() {
return new Queue(RabbitConstant.NEW_SYSTEM_RECEIVE_INFO_QUEUE, true);
}
@Bean
@ -194,10 +194,8 @@ public class RabbitMqConfiguration {
return new CustomExchange(RabbitConstant.NEW_SYSTEM_RECEIVE_INFO_EXCHANGE, "x-delayed-message", true, false, args);
}
@Bean
public Binding newSystemReceiveInfoBinding(Queue newSystemReceiveInfoHandler, CustomExchange newSystemReceiveInfoExchange) {
return BindingBuilder.bind(newSystemReceiveInfoHandler)
.to(newSystemReceiveInfoExchange)
.with(RabbitConstant.NEW_SYSTEM_RECEIVE_INFO_ROUTING)
public Binding newSystemReceiveInfoBinding(Queue newSystemReceiveInfoQuery, CustomExchange newSystemReceiveInfoExchange) {
return BindingBuilder.bind(newSystemReceiveInfoQuery).to(newSystemReceiveInfoExchange).with(RabbitConstant.NEW_SYSTEM_RECEIVE_INFO_ROUTING)
.noargs();
}

27
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/feign/OuPaiFactoryClinet.java

@ -1,14 +1,21 @@
package com.logpm.factory.oupai.feign;
import com.alibaba.fastjson.JSONObject;
import com.logpm.factory.comfac.dto.OrderStatusDTO;
import com.logpm.factory.oupai.service.IOuPaiFactoryService;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.core.tenant.annotation.NonDS;
import org.springblade.core.tool.api.R;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
import java.util.Map;
/*
* logisticsplatform-service
* @Author Diss
@ -20,13 +27,29 @@ import springfox.documentation.annotations.ApiIgnore;
@AllArgsConstructor
public class OuPaiFactoryClinet implements IOuPaiFactoryClinet{
@Autowired
private IOuPaiFactoryService ouPaiFactoryService;
@Autowired
private RabbitTemplate rabbitTemplate;
@Override
@PostMapping(TOP)
public R newSystemHandleStatusData(OrderStatusDTO orderStatusDTO) {
return ouPaiFactoryService.newSystemHandleStatusData(orderStatusDTO);
Map<String,Object> map = new HashMap();
String json = JSONObject.toJSONString(orderStatusDTO);
map.put("messageData",json);
rabbitTemplate.convertAndSend(RabbitConstant.NEW_SYSTEM_RECEIVE_INFO_EXCHANGE, RabbitConstant.NEW_SYSTEM_RECEIVE_INFO_ROUTING, map,message -> {
message.getMessageProperties()
.setHeader("x-delay", 5000);
return message;
});
return R.success("");
// return ouPaiFactoryService.newSystemHandleStatusData(orderStatusDTO);
}

31
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/NewSystemReceiveInfoHandler.java

@ -35,34 +35,9 @@ public class NewSystemReceiveInfoHandler {
@RabbitHandler
public void newSystemReceiveInfoHandler(Map map, Message message, Channel channel) throws IOException, NoSuchAlgorithmException {
System.out.println(map);
OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("orderStatusDTO");
log.info("##################receiveInfoHandler:处理签收信息数据");
String brand = (String) map.get("brand"); //品牌
//根据品牌进行处理
if (Objects.isNull(brand)) {
log.info("##################receiveInfoHandler: 未找到对应订单 orderSelfNum={}", orderStatusDTO.getOrderNo());
return;
}
R r = null;
switch (brand) {
case FactoryConstant.OUPAI:
try {
r = ouPaiFactoryService.newSystemHandleStatusData(orderStatusDTO);
log.info("################出库接口返回结果+{}" + r.getMsg());
} catch (Exception e) {
log.error(">>> 欧派异常报错 ", e);
}
int code = r.getCode();
if (code == 400 || code == 200) {
log.info("##################receiveInfoHandler: 该条数据不用处理 orderNo={}", orderStatusDTO.getUnitNo());
} else {
throw new CustomerException(code, r.getMsg());
}
break;
default:
log.info("##################receiveInfoHandler: 未知品牌 type={}", brand);
}
String json = (String) map.get("messageData");
log.info(">>>>>>>>>>>>> {}",json);
}
}

Loading…
Cancel
Save