Browse Source

1.修复三方商城录入商城ID

dev-warehouse
pref_mail@163.com 1 year ago
parent
commit
6ff4c033d3
  1. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTripartiteMallEntity.java
  2. 2
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java
  3. 32
      blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java

2
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataTripartiteMallEntity.java

@ -65,7 +65,7 @@ public class BasicdataTripartiteMallEntity extends TenantEntity {
* 客户ID
*/
@ApiModelProperty(value = "客户ID")
private String client;
private Long clientId;
/**
* 三方商城
*/

2
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java

@ -182,7 +182,7 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl<BasicdataClientM
if (StringUtils.isNotBlank(basicdataClient.getTripartiteMall())) {
BasicdataTripartiteMallEntity basicdataTripartiteMall = new BasicdataTripartiteMallEntity();
basicdataTripartiteMall.setTripartiteMall(basicdataClient.getTripartiteMall());
basicdataTripartiteMall.setClient(basicdataClient.getId().toString());
basicdataTripartiteMall.setClientId(basicdataClient.getId());
basicdataTripartiteMallService.save(basicdataTripartiteMall);
}

32
blade-service/logpm-factory/src/main/java/com/logpm/factory/receiver/DealWithDataHandler.java

@ -37,39 +37,37 @@ public class DealWithDataHandler {
@RabbitHandler
public void dealWithDataHandler(Map map, Message message, Channel channel) throws IOException {
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
// 如果手动ACK,消息会被监听消费,但是消息在队列中依旧存在,如果 未配置 acknowledge-mode 默认是会在消费完毕后自动ACK掉
final long deliveryTag = message.getMessageProperties().getDeliveryTag();
log.info("##################dealWithDataHandler: 处理在库订单数据到新系统");
OrderStatusDTO orderStatusDTO = (OrderStatusDTO) map.get("messageData");
String status = orderStatusDTO.getStatus();
String unitNo = orderStatusDTO.getUnitNo();
String operationTime = orderStatusDTO.getOperationTime();
if("4".equals(status)){
if ("4".equals(status)) {
//继续判断是否到达目的仓
String currentWarehouseId = orderStatusDTO.getCurrentWarehouse();//当前仓Id
//查询destinationWarehouse logiBillNo plantId数据
Map<String,String> supplyData = advanceDetailClient.getSupplyData(unitNo);
Map<String, String> supplyData = advanceDetailClient.getSupplyData(unitNo);
String destinationWarehouseId = supplyData.get("destinationWarehouseId");//目的仓id
if(StringUtil.isBlank(currentWarehouseId)||StringUtil.isBlank(destinationWarehouseId)){
log.warn("##############dealWithDataHandler: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}",currentWarehouseId,destinationWarehouseId);
throw new CustomerException(405,"仓库数据有误");
}else{
if(!currentWarehouseId.equals(destinationWarehouseId)){
log.info("##############dealWithDataHandler: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}",currentWarehouseId,destinationWarehouseId);
if (StringUtil.isBlank(currentWarehouseId) || StringUtil.isBlank(destinationWarehouseId)) {
log.warn("##############dealWithDataHandler: 仓库数据有问题currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId);
throw new CustomerException(405, "仓库数据有误");
} else {
if (!currentWarehouseId.equals(destinationWarehouseId)) {
log.info("##############dealWithDataHandler: 不用处理的状态 currentWarehouseId={} destinationWarehouseId={}", currentWarehouseId, destinationWarehouseId);
// channel.basicAck(deliveryTag,false);
}else{
} else {
//真正的处理需要的数据
try{
panFactoryDataService.handleDataToPlatform(unitNo,operationTime);
}catch (Exception e){
try {
panFactoryDataService.handleDataToPlatform(unitNo, operationTime);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}else{
log.info("##############dealWithDataHandler: 不用处理的状态 status={}",status);
// channel.basicAck(deliveryTag,false);
} else {
log.info("##############dealWithDataHandler: 不用处理的状态 status={}", status);
}
}
}

Loading…
Cancel
Save