|
|
|
@ -96,6 +96,8 @@ import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
|
|
import org.springblade.system.cache.DictBizCache; |
|
|
|
|
import org.springblade.system.feign.IDictBizClient; |
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Isolation; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@ -115,65 +117,115 @@ import java.util.stream.Collectors;
|
|
|
|
|
* @since 2023-06-16 |
|
|
|
|
*/ |
|
|
|
|
@Service |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@Log4j2 |
|
|
|
|
public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<DistributionDeliveryListMapper, DistributionDeliveryListEntity> implements IDistributionDeliveryListService { |
|
|
|
|
private final DistributionDeliveryInfoMapper distributionDeliveryInfoMapper; |
|
|
|
|
private final DistributionReservationMapper distributionReservationMapper; |
|
|
|
|
private final IDistributionReservationStockarticleService distributionReservationStockarticleService; |
|
|
|
|
private final IDistributionReservationStocklistService distributionReservationStocklistService; |
|
|
|
|
private final IDistributionReservationPackageService distributionReservationPackageService; |
|
|
|
|
private final DistributionReservationPackageMapper distributionReservationPackageMapper; |
|
|
|
|
private final IDistributionParcelListService distributionParcelListService; |
|
|
|
|
private final DistributionLoadscanMapper distributionLoadscanMapper; |
|
|
|
|
private final DistributionLoadscanServiceImpl distributionLoadscanService; |
|
|
|
|
private final DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService; |
|
|
|
|
private final DistributionDeliveryListMapper distributionDeliveryListMapper; |
|
|
|
|
private final DistributionSignforServiceImpl distributionSignforService; |
|
|
|
|
private final DistributionSignforMapper distributionSignforMapper; |
|
|
|
|
private final IDistributionSignforService distributionSignforServicer; |
|
|
|
|
private final DistributionStockArticleMapper distributionStockArticleMapper; |
|
|
|
|
private final IDistributionStockArticleService distributionStockArticleService; |
|
|
|
|
private final DistributionSigndetailServiceImpl distributionSigndetailService; |
|
|
|
|
private final DistributionPackadeliServiceImpl distributionPackadeliService; |
|
|
|
|
private final DistributionDeliverySelfMapper distributionDeliverySelfMapper; |
|
|
|
|
private final IDistributionDeliverySelfService distributionDeliverySelfService; |
|
|
|
|
private final DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper; |
|
|
|
|
private final IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService; |
|
|
|
|
private final DistributionReservationStockarticleMapper distributionReservationStockarticleMapper; |
|
|
|
|
private final DistributionStockupMapper distributionStockupMapper; |
|
|
|
|
private final IDistributionStockupInfoService distributionStockupInfoService; |
|
|
|
|
private final DistributionStockMapper distributionStockMapper; |
|
|
|
|
private final DistributionLoadscaninvnMapper distributionLoadscaninvnMapper; |
|
|
|
|
private final IDistributionAsyncService distributionAsyncService; |
|
|
|
|
private final IDictBizClient dictBizClient; |
|
|
|
|
private final IBasicdataDriverArteryClient iBasicdataDriverArteryClient; |
|
|
|
|
private final IBasicdataWarehouseClient warehouseClient; |
|
|
|
|
private final IDisStockListDetailService disStockListDetailService; |
|
|
|
|
private final DistributionStockListMapper distributionStockListMapper; |
|
|
|
|
private final IDistributionStockListService distributionStockListService; |
|
|
|
|
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient; |
|
|
|
|
private final IBasicPrintTemplateClient basicPrintTemplateClient; |
|
|
|
|
private final IWarehouseTrayTypeClient warehouseTrayTypeClient; |
|
|
|
|
private final IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService; |
|
|
|
|
private final IDistributionReservationZeroPackageService distributionReservationZeroPackageService; |
|
|
|
|
private final IDistributionParcelNumberService distributionParcelNumberService; |
|
|
|
|
private final IWarehouseTrayGoodsClient warehouseTrayGoodsClient; |
|
|
|
|
private final IWarehouseWaybillClient warehouseWaybillClient; |
|
|
|
|
private final BladeRedis bladeRedis; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private DistributionDeliveryInfoMapper distributionDeliveryInfoMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionReservationMapper distributionReservationMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionReservationStockarticleService distributionReservationStockarticleService; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionReservationStocklistService distributionReservationStocklistService; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionReservationPackageService distributionReservationPackageService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionReservationPackageMapper distributionReservationPackageMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionParcelListService distributionParcelListService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionLoadscanMapper distributionLoadscanMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionLoadscanServiceImpl distributionLoadscanService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionLoadscaninvnServiceImpl distributionLoadscaninvnService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionDeliveryListMapper distributionDeliveryListMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionSignforServiceImpl distributionSignforService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionSignforMapper distributionSignforMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionSignforService distributionSignforServicer; |
|
|
|
|
private DistributionStockArticleMapper distributionStockArticleMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionStockArticleService distributionStockArticleService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionSigndetailServiceImpl distributionSigndetailService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionPackadeliServiceImpl distributionPackadeliService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionDeliverySelfMapper distributionDeliverySelfMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionDeliverySelfService distributionDeliverySelfService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionDeliveryTripartiteMapper distributionDeliveryTripartiteMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionDeliveryTripartiteService distributionDeliveryTripartiteService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionReservationStockarticleMapper distributionReservationStockarticleMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionStockupMapper distributionStockupMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionStockupInfoService distributionStockupInfoService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionStockMapper distributionStockMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionLoadscaninvnMapper distributionLoadscaninvnMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionAsyncService distributionAsyncService; |
|
|
|
|
@Autowired |
|
|
|
|
private IDictBizClient dictBizClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IBasicdataDriverArteryClient iBasicdataDriverArteryClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IBasicdataWarehouseClient warehouseClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IDisStockListDetailService disStockListDetailService; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionStockListMapper distributionStockListMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionStockListService distributionStockListService; |
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseUpdownTypeClient warehouseUpdownTypeClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IBasicPrintTemplateClient basicPrintTemplateClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseTrayTypeClient warehouseTrayTypeClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionLoadscanAbnormalService distributionLoadscanAbnormalService; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionReservationZeroPackageService distributionReservationZeroPackageService; |
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionParcelNumberService distributionParcelNumberService; |
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseTrayGoodsClient warehouseTrayGoodsClient; |
|
|
|
|
@Autowired |
|
|
|
|
private IWarehouseWaybillClient warehouseWaybillClient; |
|
|
|
|
@Autowired |
|
|
|
|
private BladeRedis bladeRedis; |
|
|
|
|
@Autowired |
|
|
|
|
// 自提mapper
|
|
|
|
|
private final DistrilbutionBillLadingMapper distrilbutionBillLadingMapper; |
|
|
|
|
|
|
|
|
|
private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper; |
|
|
|
|
@Autowired |
|
|
|
|
// 自提关联订单
|
|
|
|
|
private final DistrilbutionBillStockMapper distrilbutionBillStockMapper; |
|
|
|
|
private DistrilbutionBillStockMapper distrilbutionBillStockMapper; |
|
|
|
|
|
|
|
|
|
// 自提关联包件
|
|
|
|
|
private final DistrilbutionBillPackageMapper distrilbutionBillPackageMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private DistrilbutionBillPackageMapper distrilbutionBillPackageMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionParcelListMapper distributionParcelListMapper; |
|
|
|
|
@Autowired |
|
|
|
|
private DistributionDeliveryChargeMapper distributionDeliveryChargeMapper; |
|
|
|
|
|
|
|
|
|
private final DistributionParcelListMapper distributionParcelListMapper; |
|
|
|
|
@Autowired |
|
|
|
|
@Lazy |
|
|
|
|
private IDistributionReservationService distributionReservationService; |
|
|
|
|
|
|
|
|
|
private final DistributionDeliveryChargeMapper distributionDeliveryChargeMapper; |
|
|
|
|
@Autowired |
|
|
|
|
@Lazy |
|
|
|
|
private IDistributionDeliveryListService distributionDeliveryListService; |
|
|
|
|
|
|
|
|
|
// private final IWarehouseRetentionScanClient warehouseRetentionScanClient;
|
|
|
|
|
|
|
|
|
@ -544,7 +596,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
//在配送任务中存在该包件的计划
|
|
|
|
|
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()).eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntitiesflag) && distributionLoadscanEntitiesflag.size() == 1) { |
|
|
|
|
return Resp.scanSuccess("重复扫码", "重复扫码"); |
|
|
|
|
return Resp.scanFail("重复扫码", "重复扫码"); |
|
|
|
|
} |
|
|
|
|
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) { |
|
|
|
@ -585,23 +637,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
loadscanEntity.setIsAbnormalLoading(1); |
|
|
|
|
loadscanEntity.setLoadedNub(parcelListEntity.getQuantity()); |
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
//出库
|
|
|
|
|
// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId());
|
|
|
|
|
//订单扣减在库数量
|
|
|
|
|
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
|
|
|
|
|
// stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() - parcelListEntity.getQuantity());
|
|
|
|
|
// distributionStockArticleService.updateById(stockArticleEntity);
|
|
|
|
|
//查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
//更新包件装车状态
|
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
//更新装车时间
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新签收表的装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//扣减订单的在库数量
|
|
|
|
|
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); |
|
|
|
|
//这里还需要一个维护状态的方法
|
|
|
|
|
//异步维护状态
|
|
|
|
|
// str.append("包件装车");
|
|
|
|
|
// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
|
|
|
|
|
distributionAsyncService.checkLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId()); |
|
|
|
|
//维护订单的信息
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId()); |
|
|
|
|
//维护预约的信息
|
|
|
|
|
distributionReservationService.maintenanceReservationInfo(reservationEntity.getId()); |
|
|
|
|
//维护配送任务信息
|
|
|
|
|
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//包件下架
|
|
|
|
|
warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId()); |
|
|
|
|
} else if (parcelListEntityList.size() == 0) { |
|
|
|
|
//查找出该包件信息
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())); |
|
|
|
@ -695,6 +745,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
// return Resp.scanFail("装车失败", "装车失败");
|
|
|
|
|
} |
|
|
|
|
List<DistributionLoadscanEntity> reservationLoadscanEntities = new ArrayList<>(); |
|
|
|
|
List<String> orderCodes = new ArrayList<>(); |
|
|
|
|
List<String> orderPackageCodes = new ArrayList<>(); |
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { |
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 88888888888 parcelListEntities={}", parcelListEntities); |
|
|
|
|
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) { |
|
|
|
@ -718,6 +770,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
loadscanEntity.setScanTime(now); |
|
|
|
|
loadscanEntity.setOrderId(parcelListEntity.getStockArticleId()); |
|
|
|
|
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode()); |
|
|
|
|
loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
@ -725,7 +778,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); |
|
|
|
|
loadscanEntity.setPackageNub(parcelListEntity.getQuantity()); |
|
|
|
|
loadscanEntity.setPackageId(parcelListEntity.getId()); |
|
|
|
|
loadscanEntity.setScanTime(now); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
// loadscanEntity.setScanUser(user.getUserName());
|
|
|
|
|
loadscanEntity.setScanUser(user.getNickName()); |
|
|
|
@ -734,21 +786,35 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
loadscanEntity.setScanType("2"); |
|
|
|
|
loadscanEntity.setScanStatus("2"); |
|
|
|
|
loadscanEntity.setIsInsert(1); |
|
|
|
|
loadscanEntity.setMsg("司机按照预约整托装车"); |
|
|
|
|
loadscanEntity.setMsg("司机整托装车"); |
|
|
|
|
loadscanEntity.setTrayNo(trayTypeDataVO.getTrayCode()); |
|
|
|
|
reservationLoadscanEntities.add(loadscanEntity); |
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新签收表的装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//扣减订单的在库数量
|
|
|
|
|
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); |
|
|
|
|
// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
|
|
|
|
|
distributionAsyncService.checkLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId()); |
|
|
|
|
orderCodes.add(parcelListEntity.getOrderCode()); |
|
|
|
|
//修改包件为装车状态
|
|
|
|
|
orderPackageCodes.add(parcelListEntity.getOrderPackageCode()); |
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// str.append("预约客户整托装车");
|
|
|
|
|
distributionLoadscanService.saveBatch(reservationLoadscanEntities); |
|
|
|
|
//这里则进行整托装车的数据构建
|
|
|
|
|
//维护订单的信息
|
|
|
|
|
if (Func.isNotEmpty(orderCodes)){ |
|
|
|
|
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(",")); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(orderCode,myCurrentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(orderPackageCodes)){ |
|
|
|
|
String orderPackages = orderPackageCodes.stream().distinct().collect(Collectors.joining(",")); |
|
|
|
|
warehouseUpdownTypeClient.downPackage(orderPackages,myCurrentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
|
//维护预约的信息
|
|
|
|
|
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
//维护配送任务信息
|
|
|
|
|
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
} else { |
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 101010101010 存在其他客户货物"); |
|
|
|
|
return Resp.scanFail("整托装车失败", "存在其他客户货物"); |
|
|
|
@ -1449,6 +1515,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
Map<String, List<DistributionReservationStockarticleEntity>> allStockArticle = reservationStockarticleEntityList.stream().filter(f -> Func.isNotEmpty(f.getIsZero())).collect(Collectors.groupingBy(DistributionReservationStockarticleEntity::getIsZero)); |
|
|
|
|
DistributionDeliverySelfEntity finalDistributionDeliverySelfEntity = distributionDeliverySelfEntity; |
|
|
|
|
List<DistributionParcelListEntity> updatePackageList = new ArrayList<>(); |
|
|
|
|
List<String> orderCodes = new ArrayList<>(); |
|
|
|
|
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) { |
|
|
|
|
switch (reservationStockarticleEntity.getIsZero()) { |
|
|
|
|
case "0": |
|
|
|
@ -1457,6 +1524,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(distrilbutionloadingscanDTO.getReservationId(), reservationStockarticleEntity.getStockArticleId()); |
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { |
|
|
|
|
DistributionLoadscanEntity packageLoadingScan = distributionLoadscanService.getOne(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()).eq(DistributionLoadscanEntity::getOrderId, reservationStockarticleEntity.getStockArticleId()).eq(DistributionLoadscanEntity::getPackageId, parcelListEntity.getId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); |
|
|
|
|
//无装车数据包件进行装车
|
|
|
|
|
if (Func.isEmpty(packageLoadingScan)) { |
|
|
|
|
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
@ -1503,26 +1571,23 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) { |
|
|
|
|
loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
} |
|
|
|
|
// parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
|
|
|
|
|
// distributionParcelListService.updateById(parcelListEntity);
|
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
//更新装车时间
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新装车件数
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
|
//扣减在库订单的在库数量
|
|
|
|
|
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); |
|
|
|
|
distributionAsyncService.checkOrderLoadingStatus(parcelListEntity.getStockArticleId()); |
|
|
|
|
// Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
|
|
|
|
|
updatePackageList.add(parcelListEntity); |
|
|
|
|
orderCodes.add(parcelListEntity.getOrderCode()); |
|
|
|
|
//拼接包条码
|
|
|
|
|
orderPackages.append(parcelListEntity.getOrderPackageCode()).append(","); |
|
|
|
|
// orderPackages.append(parcelListEntity.getOrderPackageCode()).append(",")
|
|
|
|
|
} |
|
|
|
|
//异步修改包件状态
|
|
|
|
|
// distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId());
|
|
|
|
|
} |
|
|
|
|
// });
|
|
|
|
|
break; |
|
|
|
|
case "1": |
|
|
|
|
//零担订单
|
|
|
|
|
// v.forEach(zord -> {
|
|
|
|
|
List<DistributionParcelNumberVO> parcelNumberVOS = distributionReservationMapper.selectReservationZeroOrderDetail(reservationStockarticleEntity.getStockArticleId(), distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
for (DistributionParcelNumberVO parcelNumberVO : parcelNumberVOS) { |
|
|
|
|
//这里需要查询是否已经存在有装车数据,如果有那么这里应该进行修改
|
|
|
|
@ -1533,7 +1598,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
loadscanEntity = loadscanServiceOne; |
|
|
|
|
} |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
// loadscanEntity.setScanUser(user.getUserName());
|
|
|
|
|
loadscanEntity.setScanUser(user.getNickName()); |
|
|
|
|
loadscanEntity.setDriverName(finalDistributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
loadscanEntity.setVehicleName(finalDistributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
@ -1633,36 +1697,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber()); |
|
|
|
|
signforEntity.setLoadedNumber(loadedNumber.subtract(packageLoadingNub).add(reservationNum).intValue()); |
|
|
|
|
distributionSignforService.updateById(signforEntity); |
|
|
|
|
//异步修改包件状态
|
|
|
|
|
// distributionAsyncService.checkZeroStockArticleLoadingStatus(parcelNumberEntity);
|
|
|
|
|
// JsonObject jsonObject = new JsonObject();
|
|
|
|
|
// jsonObject.addProperty("");
|
|
|
|
|
// warehouseUpdownTypeClient.downZeroOrder()
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
log.error("####################reservationStockarticleEntity的isZero字段错误:{}", reservationStockarticleEntity); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// allStockArticle.forEach((k, v) -> {
|
|
|
|
|
//
|
|
|
|
|
// });
|
|
|
|
|
// List<DisStockListDetailEntity> stockListDetailEntityList = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
|
|
|
|
|
// .eq(DisStockListDetailEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
|
|
|
|
|
// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationInventoryStatusConstant.quxiao.getValue()));
|
|
|
|
|
// boolean inventoryLoadingFlag = stockListDetailEntityList.stream().allMatch(i -> i.getStockPackageStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue()));
|
|
|
|
|
// boolean inventoryStockUpFlag = stockListDetailEntityList.stream().anyMatch(l -> Func.isEmpty(l.getStockPackageCode()));
|
|
|
|
|
// if (inventoryStockUpFlag) {
|
|
|
|
|
// log.error("##################库存品未备货");
|
|
|
|
|
// return Resp.scanFail("操作失败","存在库存品未备货");
|
|
|
|
|
//// return R.fail("该客户存在库存品暂未备货 一键装车失败!!!");
|
|
|
|
|
// }
|
|
|
|
|
if (!inventoryLoadingFlag) { |
|
|
|
|
//存在库存品海为进行装车
|
|
|
|
|
for (DisStockListDetailEntity disStockListDetailEntity : stockListDetailEntityList) { |
|
|
|
@ -1712,279 +1757,40 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
loadscaninvnEntity.setLoadedNub(disStockListDetailEntity.getNum()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscaninvnService.save(loadscaninvnEntity); |
|
|
|
|
//更新装车时间
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新库存品装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); |
|
|
|
|
// warehouseUpdownTypeClient.downStock()
|
|
|
|
|
//异步修改包件状态 //对于存在库存品的这里还需要将库存品从对应的信息中进行扣除
|
|
|
|
|
// distributionAsyncService.changeMarketDeliveryListStatus(loadscaninvnEntity.getOrderPackageCode(), loadscaninvnEntity.getDeliveryId());
|
|
|
|
|
// DistributionStockListEntity stockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, loadscaninvnEntity.getInventoryId()));
|
|
|
|
|
// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub());
|
|
|
|
|
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub());
|
|
|
|
|
// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub());
|
|
|
|
|
// distributionStockListMapper.updateById(stockListEntity);
|
|
|
|
|
//扣减对应库存品在库数量
|
|
|
|
|
distributionStockListMapper.deductionQuantityStock(loadscaninvnEntity.getInventoryId(),loadscaninvnEntity.getLoadedNub()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//包件维护下架和装车状态
|
|
|
|
|
distributionAsyncService.updatepackageListLoadingStatus(updatePackageList,myCurrentWarehouse.getId()); |
|
|
|
|
|
|
|
|
|
//维护配送任务装车状态
|
|
|
|
|
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//维护预约单装车状态
|
|
|
|
|
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
//维护包件状态
|
|
|
|
|
if (Func.isNotEmpty(orderCodes)){ |
|
|
|
|
String orderCode = orderCodes.stream().distinct().collect(Collectors.joining(",")); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(orderCode,myCurrentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
|
//包件维护下架和装车状态
|
|
|
|
|
// distributionAsyncService.updatepackageListLoadingStatus(updatePackageList,myCurrentWarehouse.getId());
|
|
|
|
|
if (Func.isNotEmpty(updatePackageList)){ |
|
|
|
|
String updownrOderPackages = updatePackageList.stream().map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(",")); |
|
|
|
|
if (Func.isNotEmpty(orderPackages)){ |
|
|
|
|
warehouseUpdownTypeClient.downPackage(updownrOderPackages,myCurrentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
|
List<Long> packageIds = updatePackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); |
|
|
|
|
if (Func.isNotEmpty(packageIds)){ |
|
|
|
|
distributionParcelListMapper.updatePackageListByIds(packageIds); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Resp.scanSuccess("操作成功", "装车成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //查询该客户下还未进行装车的包件
|
|
|
|
|
// List<DistributionReservationPackageEntity> reservationPackageEntityList = distributionReservationPackageMapper.selectList(Wrappers.<DistributionReservationPackageEntity>query().lambda()
|
|
|
|
|
// .eq(DistributionReservationPackageEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
|
|
|
|
|
// .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()));
|
|
|
|
|
// List<Long> list = reservationPackageEntityList.stream().map(DistributionReservationPackageEntity::getParceListId).collect(Collectors.toList());
|
|
|
|
|
// List<DistributionParcelListEntity> distributionParcelListEntityList = distributionParcelListService.list(new QueryWrapper<DistributionParcelListEntity>().lambda().in(DistributionParcelListEntity::getId, list));
|
|
|
|
|
|
|
|
|
|
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
|
|
|
|
|
// boolean packageLoadingFlag = parcelListEntityList.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
|
|
|
|
|
|
|
|
|
|
//判断库存品是否进行了备货任务,如果未进行备货任务无法进行一件装车
|
|
|
|
|
// if (inventoryStockUpFlag) {
|
|
|
|
|
// return R.fail("该客户存在库存品暂未备货 一键装车失败!!!");
|
|
|
|
|
// }
|
|
|
|
|
// if (packageLoadingFlag && inventoryLoadingFlag) {
|
|
|
|
|
// return Resp.scanFail("重复操作","重复操作");
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// if (!packageLoadingFlag) {
|
|
|
|
|
// //存在包件还未进行装车
|
|
|
|
|
// for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {
|
|
|
|
|
// if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) {
|
|
|
|
|
// DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
|
|
|
|
|
// BladeUser user = AuthUtil.getUser();
|
|
|
|
|
// loadscanEntity.setScanUser(user.getUserName());
|
|
|
|
|
// loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
// loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
// loadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
|
|
|
|
|
// loadscanEntity.setOneClick(2);
|
|
|
|
|
// loadscanEntity.setScanUser(user.getUserName());
|
|
|
|
|
// loadscanEntity.setScanTime(new Date());
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
|
|
|
|
|
// loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
|
|
|
|
|
// loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
|
|
|
|
|
// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) {
|
|
|
|
|
// loadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
|
|
|
|
|
// loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(parcelListEntity.getQuantity())) {
|
|
|
|
|
// loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) {
|
|
|
|
|
// loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) {
|
|
|
|
|
// loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(parcelListEntity.getOrderPackageCode())) {
|
|
|
|
|
// loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(parcelListEntity.getId())) {
|
|
|
|
|
// loadscanEntity.setPackageId(parcelListEntity.getId());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(parcelListEntity.getId())) {
|
|
|
|
|
// loadscanEntity.setPackageId(parcelListEntity.getId());
|
|
|
|
|
// }
|
|
|
|
|
// if (Func.isNotEmpty(parcelListEntity.getStockArticleId())) {
|
|
|
|
|
// loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanService.save(loadscanEntity);
|
|
|
|
|
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
|
|
|
|
|
// warehouseUpdownTypeClient.downPackage(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId());
|
|
|
|
|
// //异步修改包件状态
|
|
|
|
|
// distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// return R.success("成功");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
//2、查询该客户下是否存在库存品
|
|
|
|
|
// 存在 --> 查询库存品是否均完成备货
|
|
|
|
|
// 是 ---> 执行库存品一键装车
|
|
|
|
|
// 否 ---> 提示库存品没有进行备货
|
|
|
|
|
// 不存在 --> 直接进入包件的判断
|
|
|
|
|
//3、数据构建 一件装车需要查询出该客户下的所有包件信息、库存品包件信息。
|
|
|
|
|
//4、维护包件、订单、预约、库存品、装车字段
|
|
|
|
|
//5、检查包件、订单是否和库位信息解除绑定,如果没有则进行解绑
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //先查询有数据的
|
|
|
|
|
// List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverOne(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// //无数据的
|
|
|
|
|
// // List<DistributionLoadscanEntity> distributionLoadscanEntitiesno = baseMapper.selectdeliverOneNo(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// //查询所有的库存品(无拆包)
|
|
|
|
|
// //List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntities = baseMapper.selectdeliverOnevn(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// //查询所有的库存品(拆包)
|
|
|
|
|
// List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntitiesopen = baseMapper.selectdeliverOnevnopen(distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// //将该客户所有的物品上该车辆
|
|
|
|
|
// Integer flag = 0;
|
|
|
|
|
// Integer flag2 = 0;
|
|
|
|
|
// if (distributionLoadscanEntities.size() > 0) {
|
|
|
|
|
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
|
|
|
|
|
// //查询是否重复扫码
|
|
|
|
|
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
|
|
|
|
|
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
|
|
|
|
|
// );
|
|
|
|
|
//
|
|
|
|
|
// if (distributionLoadscanEntitiesflag.size() > 0) {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// flag += 1;
|
|
|
|
|
// //依次插入该装车记录,设置车辆
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
|
|
|
|
|
// distributionLoadscanEntity.setOneClick(2);
|
|
|
|
|
// BladeUser user = AuthUtil.getUser();
|
|
|
|
|
// distributionLoadscanEntity.setScanUser(user.getNickName());
|
|
|
|
|
// distributionLoadscanEntity.setScanTime(new Date());
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
// }
|
|
|
|
|
// if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) {
|
|
|
|
|
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
|
|
|
|
|
// //查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// //更新签收表的装车数量
|
|
|
|
|
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
|
|
|
|
|
// distributionLoadscanService.save(distributionLoadscanEntity);
|
|
|
|
|
// Long packageId = distributionLoadscanEntity.getPackageId();
|
|
|
|
|
// DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId);
|
|
|
|
|
// //TODO 这里一件装车需要进行判断
|
|
|
|
|
// distributionAsyncService.changeDiscussDeliveryListStatus(parcelListEntity.getOrderPackageCode(),distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// }
|
|
|
|
|
//// distributionLoadscanService.saveBatch(distributionLoadscanEntities);
|
|
|
|
|
// }
|
|
|
|
|
// //库存品装车
|
|
|
|
|
//// if (distributionLoadscanvnEntities.size() > 0) {
|
|
|
|
|
//// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) {
|
|
|
|
|
//// //依次插入该装车记录,设置车辆
|
|
|
|
|
//// if (null != distributionDeliverySelfEntity.getDriverId()) {
|
|
|
|
|
//// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
//// }
|
|
|
|
|
//// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
//// distributionLoadscanEntity.setScanStatus(2);
|
|
|
|
|
//// distributionLoadscanEntity.setScanType("1");
|
|
|
|
|
//// distributionLoadscanEntity.setScanTime(new Date());
|
|
|
|
|
//// if (null == distributionLoadscanEntity.getPackageNub()) {
|
|
|
|
|
//// distributionLoadscanEntity.setPackageNub(1);
|
|
|
|
|
//// }
|
|
|
|
|
//// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
|
|
|
|
|
//// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
//// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
|
|
|
|
|
//// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
//// }
|
|
|
|
|
//// if (null != distributionDeliverySelfEntity.getVehicleId()) {
|
|
|
|
|
//// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
|
|
|
|
|
//// }
|
|
|
|
|
//// //查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
//// //更新签收表的装车数量
|
|
|
|
|
//// Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
|
|
|
|
|
//// }
|
|
|
|
|
//// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities);
|
|
|
|
|
//// }
|
|
|
|
|
// if (distributionLoadscanvnEntitiesopen.size() > 0) {
|
|
|
|
|
// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntitiesopen) {
|
|
|
|
|
// //查询是否重复扫码
|
|
|
|
|
// List<DistributionLoadscaninvnEntity> distributionLoadscanEntitiesflag = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
|
|
|
|
|
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
|
|
|
|
|
// .ne(DistributionLoadscaninvnEntity::getScanStatus, 1)
|
|
|
|
|
// );
|
|
|
|
|
//
|
|
|
|
|
// if (distributionLoadscanEntitiesflag.size() > 0) {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// flag2 += 1;
|
|
|
|
|
// //依次插入该装车记录,设置车辆
|
|
|
|
|
// if (null != distributionDeliverySelfEntity.getDriverId()) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
|
|
|
|
|
// distributionLoadscanEntity.setScanType("1");
|
|
|
|
|
// distributionLoadscanEntity.setScanTime(new Date());
|
|
|
|
|
// if (null == distributionLoadscanEntity.getPackageNub()) {
|
|
|
|
|
// distributionLoadscanEntity.setPackageNub(1);
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
|
|
|
|
|
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
// }
|
|
|
|
|
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
|
|
|
|
|
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
|
|
|
|
|
// }
|
|
|
|
|
// //查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// //更新签收表的装车数量
|
|
|
|
|
// Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntitiesopen);
|
|
|
|
|
// }
|
|
|
|
|
// if (flag == 0 && flag2 == 0) {
|
|
|
|
|
// return R.fail(4002, "无数据进行装车");
|
|
|
|
|
// }
|
|
|
|
|
// if (distributionLoadscanEntitiesno.size() > 0) {
|
|
|
|
|
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntitiesno) {
|
|
|
|
|
// //查询是否重复扫码
|
|
|
|
|
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
|
|
|
|
|
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
|
|
|
|
|
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
|
|
|
|
|
// );
|
|
|
|
|
// if (distributionLoadscanEntitiesflag.size() > 0) {
|
|
|
|
|
// continue;
|
|
|
|
|
// }
|
|
|
|
|
// //依次插入该装车记录,设置车辆
|
|
|
|
|
// if (null != distributionDeliverySelfEntity.getDriverId()){
|
|
|
|
|
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
|
|
|
|
|
// distributionLoadscanEntity.setScanStatus(2);
|
|
|
|
|
// distributionLoadscanEntity.setScanType("3");
|
|
|
|
|
// distributionLoadscanEntity.setScanTime(new Date());
|
|
|
|
|
// distributionLoadscanEntity.setScanState(1);
|
|
|
|
|
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
|
|
|
|
|
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
|
|
|
|
|
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
|
|
|
|
|
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
|
|
|
|
|
// }
|
|
|
|
|
// if (null !=distributionDeliverySelfEntity.getVehicleId()){
|
|
|
|
|
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());}
|
|
|
|
|
// //查询本车次是否第一次扫码,没有则更新上车时间
|
|
|
|
|
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
// //更新签收表的装车数量
|
|
|
|
|
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
|
|
|
|
|
// }
|
|
|
|
|
// distributionLoadscanService.saveBatch(distributionLoadscanEntities);
|
|
|
|
|
// }
|
|
|
|
|
// return R.success("成功");
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class) |
|
|
|
@ -2133,8 +1939,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), distributionLoadscaninvnEntity.getLoadedNub()); |
|
|
|
|
//处理出库问题
|
|
|
|
|
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(), distributionLoadscaninvnEntity.getLoadedNub()); |
|
|
|
|
//维护客户信息
|
|
|
|
|
distributionReservationService.maintenanceReservationInfo(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
//维护配送装车状态
|
|
|
|
|
distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//异步处理状态信息
|
|
|
|
|
distributionAsyncService.changeMarketDeliveryListStatus(distributionLoadscaninvnEntity.getOrderPackageCode(), distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId()); |
|
|
|
|
// distributionAsyncService.changeMarketDeliveryListStatus(distributionLoadscaninvnEntity.getOrderPackageCode(), distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId());
|
|
|
|
|
//扣减出库数量
|
|
|
|
|
// DistributionStockListEntity distributionStockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, distributionLoadscaninvnEntity.getInventoryId()));
|
|
|
|
|
// BigDecimal quantityStock = new BigDecimal(distributionStockListEntity.getQuantityStock());
|
|
|
|
@ -5237,10 +5047,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新签收表的装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
//维护订单信息
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId()); |
|
|
|
|
|
|
|
|
|
//扣减订单在库数量
|
|
|
|
|
distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); |
|
|
|
|
// distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
|
|
|
|
|
//异步维护此异常装车包件的订单状态
|
|
|
|
|
distributionAsyncService.maintenanceOrderStatus(parcelListEntity.getOrderCode(),myCurrentWarehouse.getId()); |
|
|
|
|
// 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)) { |
|
|
|
|
//标识该客户存在异常装车包件,为了后续的异常装车审核
|
|
|
|
@ -6677,4 +6491,42 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
|
|
|
|
|
return iPage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@Transactional |
|
|
|
|
public void maintenanceDeliveryInfo(Long deliveryId) { |
|
|
|
|
String method = "###################DistributionDeliveryListServiceImpl执行方法maintenanceDeliveryInfo,"; |
|
|
|
|
if (Func.isEmpty(deliveryId)){ |
|
|
|
|
log.info(method+"参数缺失deliveryId:{}",deliveryId); |
|
|
|
|
throw new RuntimeException("服务器正忙!!!"); |
|
|
|
|
} |
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId); |
|
|
|
|
if (Func.isEmpty(deliveryListEntity)){ |
|
|
|
|
log.info(method+"查询配送失败,deliveryId:{}",deliveryId); |
|
|
|
|
throw new RuntimeException("服务器正忙!!!"); |
|
|
|
|
} |
|
|
|
|
//查询指定配送计划装车件数
|
|
|
|
|
DistributionLoadingNumDTO deliveryLoadingNum = distributionDeliveryListMapper.selectDeliveryLoadingNum(deliveryId); |
|
|
|
|
|
|
|
|
|
int loadingNum = 0; |
|
|
|
|
int signingNum = 0; |
|
|
|
|
int deliveryQuantity = deliveryListEntity.getDeliveryNumber() + deliveryListEntity.getInventoryNub(); |
|
|
|
|
if (Func.isNotEmpty(deliveryLoadingNum)){ |
|
|
|
|
loadingNum += deliveryLoadingNum.getInventoryLoadingQuantity() + deliveryLoadingNum.getPackageLoadingQuantity(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (deliveryQuantity != 0){ |
|
|
|
|
if (loadingNum ==deliveryQuantity ){ |
|
|
|
|
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
|
}else { |
|
|
|
|
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); |
|
|
|
|
} |
|
|
|
|
if (loadingNum == 0){ |
|
|
|
|
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue()); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error(method+"查询配送无计划数量,deliveryId:{}",deliveryId); |
|
|
|
|
} |
|
|
|
|
this.updateById(deliveryListEntity); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|