Browse Source

1.维护信息异步处理

single_db
pref_mail@163.com 1 year ago
parent
commit
a49bd9c7ac
  1. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java
  2. 60
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderPackageStatusDataHandler.java
  3. 556
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java

@ -135,6 +135,7 @@ public class DistributionDeliveryAppController {
@ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO") @ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO")
public R loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { public R loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO); R msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
return msg; return msg;
} }

60
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderPackageStatusDataHandler.java

@ -2,10 +2,17 @@
package com.logpm.distribution.receiver; package com.logpm.distribution.receiver;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionReservationEntity;
import com.logpm.distribution.mapper.DistributionParcelListMapper; import com.logpm.distribution.mapper.DistributionParcelListMapper;
import com.logpm.distribution.mapper.DistributionStockArticleMapper; import com.logpm.distribution.mapper.DistributionStockArticleMapper;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.RabbitConstant; import org.springblade.common.constant.RabbitConstant;
@ -13,6 +20,7 @@ import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler; import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener; import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Map; import java.util.Map;
@ -24,39 +32,49 @@ public class OrderPackageStatusDataHandler {
@Autowired @Autowired
private DistributionParcelListMapper baseMapper; private DistributionParcelListMapper baseMapper;
@Autowired
private IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@Autowired @Autowired
private DistributionStockArticleMapper distributionStockArticleMapper; private DistributionStockArticleMapper distributionStockArticleMapper;
@Autowired
private IDistributionStockArticleService distributionStockArticleService;
@RabbitHandler @Autowired
public void orderPackageStatusChange(Map map, Message message, Channel channel){ private IDistributionReservationService distributionReservationService;
@Autowired
private IDistributionDeliveryListService distributionDeliveryListService;
Object orderPackageCode1 = map.get("orderPackageCode"); @RabbitHandler
String orderPackageCode= (String) orderPackageCode1; public void orderPackageStatusChange(Map map, Message message, Channel channel){
String groundingStatus=(String)map.get("groundingStatus");
Long warehouseId = (Long)map.get("warehouseId");
// 处理包件状态
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("order_package_code",orderPackageCode)
.eq("warehouse_id",warehouseId)
.eq("is_deleted",0);
DistributionParcelListEntity parcelListEntity = baseMapper.selectOne(queryWrapper);
parcelListEntity.setOrderPackageGroundingStatus(groundingStatus);
int i = baseMapper.updateById(parcelListEntity);
try{ try{
// 更新状态 log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>处理状态>>>>>>>>>>>>>>>>>>>>>>>>>>");
baseMapper.updateOrderPackageCodeById(parcelListEntity.getId(),groundingStatus); Long myCurrentWarehouseId = Long.parseLong(map.get("myCurrentWarehouseId").toString());
String distrilbutionloadingscanDTOJson = (String)map.get("distrilbutionloadingscanDTO");
DistrilbutionloadingscanDTO distrilbutionloadingscanDTO = JSONObject.parseObject(distrilbutionloadingscanDTOJson,DistrilbutionloadingscanDTO.class);
String parcelListEntityJSon = (String)map.get("parcelListEntity");
DistributionParcelListEntity parcelListEntity = JSONObject.parseObject(parcelListEntityJSon,DistributionParcelListEntity.class);
String reservationEntityJson = (String)map.get("reservationEntity");
DistributionReservationEntity reservationEntity = JSONObject.parseObject(reservationEntityJson,DistributionReservationEntity.class);
//包件配送下架
warehouseUpdownTypeClient.downDeliveryPackage(parcelListEntity.getOrderPackageCode(), myCurrentWarehouseId);
//维护订单的信息
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouseId);
//维护预约的信息
distributionReservationService.maintenanceReservationInfo(reservationEntity.getId());
//维护配送任务信息
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId());
}catch (Exception e){ }catch (Exception e){
log.error(">>>>>> 维护包件信息 报错",e);
// 更新状态报错
log.error(">>>>>> updateGroundingStatus 异常信息",e);
} }
} }
} }

556
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save