|
|
|
@ -17,6 +17,7 @@
|
|
|
|
|
package com.logpm.distribution.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
@ -58,6 +59,7 @@ import org.jetbrains.annotations.NotNull;
|
|
|
|
|
import org.springblade.common.constant.DictBizConstant; |
|
|
|
|
import org.springblade.common.constant.DistributionTypeConstant; |
|
|
|
|
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.RabbitConstant; |
|
|
|
|
import org.springblade.common.constant.common.IsOrNoConstant; |
|
|
|
|
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant; |
|
|
|
|
import org.springblade.common.constant.delivery.DeliveryStatusConstant; |
|
|
|
@ -90,6 +92,7 @@ import org.springblade.core.tool.utils.Func;
|
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
|
import org.springblade.system.feign.IDictBizClient; |
|
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
@ -223,6 +226,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
@Lazy |
|
|
|
|
private IDistributionDeliveryListService distributionDeliveryListService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private RabbitTemplate rabbitTemplate; |
|
|
|
|
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
|
|
|
|
|
|
|
|
|
|
// @Lazy
|
|
|
|
@ -540,9 +545,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class) |
|
|
|
|
|
|
|
|
|
// synchronized
|
|
|
|
|
public R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { |
|
|
|
|
//查询该包件是否能够从库存品包件表中查到
|
|
|
|
|
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
@ -553,7 +560,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
// 属于该配送任务需要进行是否属于该客户进行判断
|
|
|
|
|
// 如果属于该客户则进行装车扫描
|
|
|
|
|
//
|
|
|
|
|
String now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); |
|
|
|
|
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda() |
|
|
|
|
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) |
|
|
|
@ -572,8 +578,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//异步确认包条扫描信息
|
|
|
|
|
// distributionAsyncService.changeOrderSignforStatus(distrilbutionloadingscanDTO.getBarcode());
|
|
|
|
|
|
|
|
|
|
AtomicInteger loadingNum = new AtomicInteger(); |
|
|
|
|
AtomicInteger abnormalLoadingNum = new AtomicInteger(); |
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity(); |
|
|
|
|
if (distributionDeliveryListEntity.getKind().equals("1")) { |
|
|
|
|
if (!Objects.isNull(distrilbutionloadingscanDTO.getLoadingId())) { |
|
|
|
@ -646,17 +650,33 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
//更新装车时间
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
|
|
|
|
|
//更新签收表的装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//包件配送下架
|
|
|
|
|
warehouseUpdownTypeClient.downDeliveryPackage(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId()); |
|
|
|
|
//维护订单的信息
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId()); |
|
|
|
|
//维护预约的信息
|
|
|
|
|
distributionReservationService.maintenanceReservationInfo(reservationEntity.getId()); |
|
|
|
|
//维护配送任务信息
|
|
|
|
|
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
} else if (parcelListEntityList.size() == 0) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap(); |
|
|
|
|
String distrilbutionloadingscanDTOJson = JSONObject.toJSONString(distrilbutionloadingscanDTO); |
|
|
|
|
map.put("distrilbutionloadingscanDTO",distrilbutionloadingscanDTOJson); |
|
|
|
|
String parcelListEntityJson = JSONObject.toJSONString(parcelListEntity); |
|
|
|
|
map.put("parcelListEntity",parcelListEntityJson); |
|
|
|
|
map.put("myCurrentWarehouseId",myCurrentWarehouse.getId()); |
|
|
|
|
String reservationEntityJson = JSONObject.toJSONString(reservationEntity); |
|
|
|
|
map.put("reservationEntity",reservationEntityJson); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info(">>>>>>>>>>>>> 进入延迟队列处理包件相关信息状态"); |
|
|
|
|
rabbitTemplate.convertAndSend(RabbitConstant.ORDER_PACKAGE_STATUS_INFO_EXCHANGE, RabbitConstant.ORDER_PACKAGE_STATUS_INFO_ROUTING, map, message -> { |
|
|
|
|
message.getMessageProperties() |
|
|
|
|
.setHeader("x-delay", 3000); |
|
|
|
|
return message; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extracteOrderPackageStatus(distrilbutionloadingscanDTO, parcelListEntity, myCurrentWarehouse, reservationEntity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (parcelListEntityList.isEmpty()) { |
|
|
|
|
//查找出该包件信息
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())); |
|
|
|
|
List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
@ -842,6 +862,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return Resp.scanSuccessWithData("装车成功", str.toString(), carLaodNum); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void extracteOrderPackageStatus(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO, DistributionParcelListEntity parcelListEntity, BasicdataWarehouseEntity myCurrentWarehouse, DistributionReservationEntity reservationEntity) { |
|
|
|
|
//包件配送下架
|
|
|
|
|
warehouseUpdownTypeClient.downDeliveryPackage(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); |
|
|
|
|
//维护订单的信息
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
//维护预约的信息
|
|
|
|
|
distributionReservationService.maintenanceReservationInfo(reservationEntity.getId()); |
|
|
|
|
//维护配送任务信息
|
|
|
|
|
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// List<Long> trayGoodIds = voGoodsLsit.stream().filter(v -> v.getAssociationType().equals("3")).map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
|
|
|
|
|
//此时经过过滤后的包件ID和托盘上的所有包件ID数量一致,视为该托盘上的均为包件
|
|
|
|
@ -994,8 +1025,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Integer getCarLaodNum(Long deliveryId) { |
|
|
|
|
AtomicInteger loadingNum = new AtomicInteger(); |
|
|
|
|
Integer contNum_a = distributionLoadscanMapper.getLoadCountNum(deliveryId); |
|
|
|
@ -1804,8 +1833,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class) |
|
|
|
|
@Override |
|
|
|
|
public R oneack(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { |
|
|
|
@ -4203,8 +4230,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) {
|
|
|
|
|
// if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) {
|
|
|
|
|
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.getReservationPackage(reservationStockarticleEntity.getReservationId(), reservationStockarticleEntity.getStockArticleId(),distributionDeliveryInfoDTO);
|
|
|
|
@ -4311,8 +4336,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionStockArticleVO> selectDiscussStockArticleInfoList(Map<String, Object> params, Query query, Long deliveryListId) { |
|
|
|
|
IPage<DistributionStockArticleVO> page = Condition.getPage(query); |
|
|
|
@ -6529,7 +6552,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String bianMa() { |
|
|
|
|
// String code ="BH";
|
|
|
|
|
StringBuilder sb = new StringBuilder(); |
|
|
|
@ -6597,8 +6619,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* 工单查询配送数据 |
|
|
|
|
* |
|
|
|
|
* @param page |
|
|
|
|
* @param distributionDeliveryInfoDTO |
|
|
|
|
* @return |
|
|
|
|