Browse Source

一键装车调整

single_db
汤建军 1 year ago
parent
commit
a8de159170
  1. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  2. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  3. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  4. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  5. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java

@ -128,4 +128,10 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
void updateOrderPackageCodeById(@Param("packageId") Long packageId, @Param("orderPackageStatus") String orderPackageStatus); void updateOrderPackageCodeById(@Param("packageId") Long packageId, @Param("orderPackageStatus") String orderPackageStatus);
/**
* 批量修改包件装车状态
* @param packageIds
* @return
*/
Integer updatePackageListByIds(@Param("packageIds") List<Long> packageIds);
} }

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -878,6 +878,12 @@
set order_package_status = #{orderPackageStatus} set order_package_status = #{orderPackageStatus}
where id = #{packageId} where id = #{packageId}
</update> </update>
<update id="updatePackageListByIds">
UPDATE logpm_distribution_parcel_list SET order_package_loading_status = 20 WHERE id IN
<foreach collection="packageIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper> </mapper>

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java

@ -207,7 +207,7 @@ public interface IDistributionAsyncService {
/** /**
* 维护订单预约装车状态 * 维护订单预约装车状态
* @param parcelListEntity * @param packageId
*/ */
void checkReservationStatusAndLoadingStatusByPackage(Long packageId); void checkReservationStatusAndLoadingStatusByPackage(Long packageId);
@ -258,4 +258,10 @@ public interface IDistributionAsyncService {
* @param orderPackageId * @param orderPackageId
*/ */
void checkRetentionZeroPackageReservationAndDeliveryInfo(Long reservationId, Long deliveryId, Long orderPackageId, Long orderId); void checkRetentionZeroPackageReservationAndDeliveryInfo(Long reservationId, Long deliveryId, Long orderPackageId, Long orderId);
/**
* 批量修改包件装车状态
* @param updatePackageList
*/
void updatepackageListLoadingStatus(List<DistributionParcelListEntity> updatePackageList);
} }

15
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java

@ -905,12 +905,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
} }
@Override @Override
public void checkOrderLoadingStatus(Long packageId) { public void checkOrderLoadingStatus(Long orderId) {
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId); if (Func.isNotEmpty(orderId)) {
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId);
distributionParcelListService.updateById(parcelListEntity);
if (Func.isNotEmpty(parcelListEntity)) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
Integer orderLoadingNum = distributionLoadscanMapper.selectOrderLoadingNum(stockArticleEntity.getId()); Integer orderLoadingNum = distributionLoadscanMapper.selectOrderLoadingNum(stockArticleEntity.getId());
if (Func.isNotEmpty(orderLoadingNum) && orderLoadingNum > 0) { if (Func.isNotEmpty(orderLoadingNum) && orderLoadingNum > 0) {
if (stockArticleEntity.getTotalNumber() == orderLoadingNum) { if (stockArticleEntity.getTotalNumber() == orderLoadingNum) {
@ -1342,6 +1339,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
maintenanceDeliveryPackageNum(deliveryId); maintenanceDeliveryPackageNum(deliveryId);
} }
@Override
public void updatepackageListLoadingStatus(List<DistributionParcelListEntity> updatePackageList) {
List<Long> packageIds = updatePackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
Integer i = distributionParcelListMapper.updatePackageListByIds(packageIds);
}
/** /**
* 维护配送数量和状态 * 维护配送数量和状态
* *

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

@ -1402,6 +1402,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// ----------------------------2023-09-06 PDA一键装车调整---------------------------------------- // ----------------------------2023-09-06 PDA一键装车调整----------------------------------------
//1、查询该客户下是否还存在需要装车的包件和库存品 //1、查询该客户下是否还存在需要装车的包件和库存品
StringBuilder orderPackages = new StringBuilder();
//查询配送任务配车司机信息 //查询配送任务配车司机信息
DistributionDeliveryListEntity distributionDeliveryListEntity = this.getById(distrilbutionloadingscanDTO.getDeliveryId()); DistributionDeliveryListEntity distributionDeliveryListEntity = this.getById(distrilbutionloadingscanDTO.getDeliveryId());
@ -1447,6 +1448,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
case "0": case "0":
//订制品 //订制品
// v.forEach(ord -> { // v.forEach(ord -> {
List<DistributionParcelListEntity> updatePackageList = new ArrayList<>();
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(distrilbutionloadingscanDTO.getReservationId(), reservationStockarticleEntity.getStockArticleId()); List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageByReservationAndStockArticle(distrilbutionloadingscanDTO.getReservationId(), reservationStockarticleEntity.getStockArticleId());
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { 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())); 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()));
@ -1503,12 +1505,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//扣减在库订单的在库数量 //扣减在库订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub()); Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId()); distributionAsyncService.checkOrderLoadingStatus(parcelListEntity.getStockArticleId());
distributionAsyncService.checkOrderLoadingStatus(parcelListEntity.getId()); updatePackageList.add(parcelListEntity);
//拼接包条码
orderPackages.append(parcelListEntity.getOrderPackageCode()).append(",");
} }
//异步修改包件状态 //异步修改包件状态
// distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId()); // distributionAsyncService.changeMarketDeliveryListStatus(loadscanEntity.getOrderPackageCode(), loadscanEntity.getDeliveryId());
} }
distributionAsyncService.updatepackageListLoadingStatus(updatePackageList);
// }); // });
break; break;
case "1": case "1":
@ -1713,6 +1720,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} }
} }
} }
warehouseUpdownTypeClient.downPackageOrDelTray(orderPackages.deleteCharAt(orderPackages.length() -1).toString(), myCurrentWarehouse.getId());
return Resp.scanSuccess("操作成功", "装车成功"); return Resp.scanSuccess("操作成功", "装车成功");
} }

Loading…
Cancel
Save