Browse Source

扫描增加包件状态检测

single_db
汤建军 1 year ago
parent
commit
1d9550c753
  1. 31
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

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

@ -573,6 +573,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
return Resp.scanFail("此码不是订制品", "此码不是订制品");
}
//查询当前扫描的包件是否进行了装车
DistributionParcelListEntity parcelList = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
if (!Objects.isNull(parcelList)){
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelList.getOrderPackageLoadingStatus())){
return Resp.scanFail("操作失败", "包件已装车");
}
}
//获取当前用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
//异步确认包条扫描信息
@ -5081,6 +5088,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()));
if (Func.isNotEmpty(parcelListEntities) && parcelListEntities.size() == 1) {
DistributionParcelListEntity parcelListEntity = parcelListEntities.get(0);
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())){
//包件已装车
log.error("重复异常装车,:{}", parcelListEntity.getOrderPackageCode());
return Resp.scanFail("操作失败", "包件已装车");
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
if (Func.isEmpty(stockArticleEntity)) {
log.error("###############订单异常:{}", stockArticleEntity);
@ -5154,10 +5166,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscanAbnormalEntity.setPackageCode(parcelListEntity.getOrderPackageCode());
distributionLoadscanAbnormalEntity.setPackageId(parcelListEntity.getId());
distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity);
//修改包件状态 维护订单状态
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
distributionParcelListService.updateById(parcelListEntity);
//添加包件数据至扫描表中
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) {
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
@ -5190,8 +5198,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
loadscanEntity.setIsAbnormalLoading(2);
distributionLoadscanService.save(loadscanEntity);
//修改包件装车状态
//修改包件状态 维护订单状态
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
distributionParcelListService.updateById(parcelListEntity);
//出库
warehouseUpdownTypeClient.downPackage(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
warehouseUpdownTypeClient.downDeliveryPackage(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
@ -5199,11 +5212,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//维护订单信息
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId());
//扣减订单在库数量
// distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
//异步维护此异常装车包件的订单状态
// distributionAsyncService.maintenanceOrderStatus(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId());
DistributionSignforEntity signforEntity = distributionSignforService.getOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getReservationId, reservationEntity.getId()).eq(DistributionSignforEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()));
if (Func.isNotEmpty(signforEntity)) {
//标识该客户存在异常装车包件,为了后续的异常装车审核
@ -5230,12 +5238,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public R getPackageListByDeliveryIdAndOrderId(IPage<Object> page, Long deliveryId, Long orderId) {
List<DistributionParcelListVO> allPackageList = new ArrayList<>();
List<DistributionParcelListEntity> reservationPackageList = baseMapper.getPackageListByDeliveryId(deliveryId, orderId);
DistributionReservationOrderPackageVO reservationOrderPackageVO = new DistributionReservationOrderPackageVO();
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, orderId).eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()).notIn(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue(), OrderPackageStatusConstant.yichuku.getValue()));
if (Func.isNotEmpty(reservationPackageList)) {
List<DistributionParcelListVO> parcelListVOS = DistributionParcelListWrapper.build().listVO(reservationPackageList);

Loading…
Cancel
Save