|
|
|
@ -2,10 +2,17 @@
|
|
|
|
|
package com.logpm.distribution.receiver; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
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.DistributionReservationEntity; |
|
|
|
|
import com.logpm.distribution.mapper.DistributionParcelListMapper; |
|
|
|
|
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 lombok.extern.slf4j.Slf4j; |
|
|
|
|
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.RabbitListener; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
@ -24,39 +32,49 @@ public class OrderPackageStatusDataHandler {
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private DistributionParcelListMapper baseMapper; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseUpdownTypeClient warehouseUpdownTypeClient; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionStockArticleMapper distributionStockArticleMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionStockArticleService distributionStockArticleService; |
|
|
|
|
|
|
|
|
|
@RabbitHandler |
|
|
|
|
public void orderPackageStatusChange(Map map, Message message, Channel channel){ |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionReservationService distributionReservationService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionDeliveryListService distributionDeliveryListService; |
|
|
|
|
|
|
|
|
|
Object orderPackageCode1 = map.get("orderPackageCode"); |
|
|
|
|
String orderPackageCode= (String) orderPackageCode1; |
|
|
|
|
String groundingStatus=(String)map.get("groundingStatus"); |
|
|
|
|
Long warehouseId = (Long)map.get("warehouseId"); |
|
|
|
|
@RabbitHandler |
|
|
|
|
public void orderPackageStatusChange(Map map, Message message, Channel channel){ |
|
|
|
|
|
|
|
|
|
// 处理包件状态
|
|
|
|
|
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{ |
|
|
|
|
// 更新状态
|
|
|
|
|
baseMapper.updateOrderPackageCodeById(parcelListEntity.getId(),groundingStatus); |
|
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>处理状态>>>>>>>>>>>>>>>>>>>>>>>>>>"); |
|
|
|
|
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){ |
|
|
|
|
|
|
|
|
|
// 更新状态报错
|
|
|
|
|
log.error(">>>>>> updateGroundingStatus 异常信息",e); |
|
|
|
|
log.error(">>>>>> 维护包件信息 报错",e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|