|
|
|
@ -4,7 +4,6 @@ package com.logpm.distribution.receiver;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.logpm.distribution.entity.DistributionParcelListEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockArticleEntity; |
|
|
|
|
import com.logpm.distribution.mapper.DistributionParcelListMapper; |
|
|
|
|
import com.logpm.distribution.mapper.DistributionStockArticleMapper; |
|
|
|
|
import com.rabbitmq.client.Channel; |
|
|
|
@ -16,7 +15,6 @@ 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; |
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@ -46,7 +44,7 @@ public class OrderPackageStatusDataHandler {
|
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
DistributionParcelListEntity parcelListEntity = baseMapper.selectOne(queryWrapper); |
|
|
|
|
parcelListEntity.setOrderPackageGroundingStatus(groundingStatus); |
|
|
|
|
// int i = baseMapper.updateById(parcelListEntity);
|
|
|
|
|
int i = baseMapper.updateById(parcelListEntity); |
|
|
|
|
|
|
|
|
|
try{ |
|
|
|
|
// 更新状态
|
|
|
|
@ -55,31 +53,31 @@ public class OrderPackageStatusDataHandler {
|
|
|
|
|
// log.info(">>>> 更新包间状态 >> 包件ID {} 状态 {}",parcelListEntity.getId(),groundingStatus);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String orderCode = parcelListEntity.getOrderCode(); |
|
|
|
|
|
|
|
|
|
QueryWrapper<DistributionStockArticleEntity> stockArticleEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
stockArticleEntityQueryWrapper.eq("order_code",orderCode) |
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
DistributionStockArticleEntity one = distributionStockArticleMapper.selectOne(stockArticleEntityQueryWrapper); |
|
|
|
|
Integer totalNumber = one.getTotalNumber(); |
|
|
|
|
|
|
|
|
|
QueryWrapper<DistributionParcelListEntity> queryWrapperList = new QueryWrapper<>(); |
|
|
|
|
queryWrapperList.eq("order_code",orderCode) |
|
|
|
|
.eq("order_package_grounding_status","20") |
|
|
|
|
.eq("warehouse_id",warehouseId) |
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
List<DistributionParcelListEntity> listEntityList = baseMapper.selectList(queryWrapperList); |
|
|
|
|
int size = listEntityList.size(); |
|
|
|
|
if(size == 0){ |
|
|
|
|
//更新订单上架状态
|
|
|
|
|
baseMapper.updateOrderGroundingStatus(orderCode,"10",warehouseId); |
|
|
|
|
}else if(size >= totalNumber){ |
|
|
|
|
//更新订单上架状态
|
|
|
|
|
baseMapper.updateOrderGroundingStatus(orderCode,"30",warehouseId); |
|
|
|
|
}else{ |
|
|
|
|
//更新订单上架状态
|
|
|
|
|
baseMapper.updateOrderGroundingStatus(orderCode,"20",warehouseId); |
|
|
|
|
} |
|
|
|
|
// String orderCode = parcelListEntity.getOrderCode();
|
|
|
|
|
//
|
|
|
|
|
// QueryWrapper<DistributionStockArticleEntity> stockArticleEntityQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
// stockArticleEntityQueryWrapper.eq("order_code",orderCode)
|
|
|
|
|
// .eq("is_deleted",0);
|
|
|
|
|
// DistributionStockArticleEntity one = distributionStockArticleMapper.selectOne(stockArticleEntityQueryWrapper);
|
|
|
|
|
// Integer totalNumber = one.getTotalNumber();
|
|
|
|
|
//
|
|
|
|
|
// QueryWrapper<DistributionParcelListEntity> queryWrapperList = new QueryWrapper<>();
|
|
|
|
|
// queryWrapperList.eq("order_code",orderCode)
|
|
|
|
|
// .eq("order_package_grounding_status","20")
|
|
|
|
|
// .eq("warehouse_id",warehouseId)
|
|
|
|
|
// .eq("is_deleted",0);
|
|
|
|
|
// List<DistributionParcelListEntity> listEntityList = baseMapper.selectList(queryWrapperList);
|
|
|
|
|
// int size = listEntityList.size();
|
|
|
|
|
// if(size == 0){
|
|
|
|
|
// //更新订单上架状态
|
|
|
|
|
// baseMapper.updateOrderGroundingStatus(orderCode,"10",warehouseId);
|
|
|
|
|
// }else if(size >= totalNumber){
|
|
|
|
|
// //更新订单上架状态
|
|
|
|
|
// baseMapper.updateOrderGroundingStatus(orderCode,"30",warehouseId);
|
|
|
|
|
// }else{
|
|
|
|
|
// //更新订单上架状态
|
|
|
|
|
// baseMapper.updateOrderGroundingStatus(orderCode,"20",warehouseId);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
|
|
|
|