Browse Source

Merge remote-tracking branch 'origin/dev' into pre-production

pre-production
汤建军 2 months ago
parent
commit
321d79a781
  1. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  2. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  3. 12
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  4. 4
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportStockMapper.xml

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -1339,7 +1339,7 @@
( lawo.create_time + INTERVAL 3 DAY ) AS endCreateTime,
lawo.update_time AS updateTime,
GROUP_CONCAT( lapr.result_type ) AS resultType,
IFNULL( SUM( lapr.money ), 0 ) AS money,
(SELECT SUM(money) FROM logpm_aftersales_processing_results WHERE is_deleted = 0 AND work_order_id = lawo.id) AS money,
lawo.warehouse_service_name AS warehouseServiceName,
lawo.headquarters_name AS headquartersName,
lawo.over_time AS overTime,

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

@ -893,8 +893,9 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
//维护预约的预约数量
maintenanceReservationStatus(reservationId,deliveryId);
// maintenanceReservationPackageNum(reservationId);
// maintenanceDeliveryPackageNum(deliveryId);
maintenanceDeliveryPackageNum(deliveryId);
}
}
@ -1804,6 +1805,19 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
}
}
private void maintenanceDeliveryStatus(Long deliveryId) {
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId);
if (Func.isNotEmpty(distributionDeliveryListEntity)) {
List<DistributionReservationEntity> distributionReservationEntities = distributionDeliveryListMapper.selectReservationByDeliveryListId(distributionDeliveryListEntity.getId());
Integer planNum = 0 ;
if (Func.isNotEmpty(distributionReservationEntities)) {
planNum += distributionReservationEntities.stream().mapToInt(DistributionReservationEntity::getReservationNum).sum() + distributionReservationEntities.stream().mapToInt(DistributionReservationEntity::getReservationStockListNum).sum();
}
if (planNum == 0) {
distributionDeliveryListMapper.deleteById(distributionDeliveryListEntity);
}
}
}
/**
* 维护预约数量和状态
@ -1837,6 +1851,31 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
}
private void maintenanceReservationStatus(Long reservationId,Long deliveryId) {
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId);
if (Func.isNotEmpty(distributionReservationEntity)) {
List<DistributionReservationStockarticleEntity> distributionReservationStockarticleEntities = distributionReservationMapper.selectStockArticleByReservationId(distributionReservationEntity.getId());
Integer planNum = 0;
if (Func.isNotEmpty(distributionReservationStockarticleEntities)) {
planNum += distributionReservationStockarticleEntities.stream().mapToInt(DistributionReservationStockarticleEntity::getReservationNum).sum();
}
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(distributionReservationEntity.getId());
if (Func.isNotEmpty(distributionReservationStocklistEntities)) {
//统计库存品数
planNum += distributionReservationStocklistEntities.stream().mapToInt(DistributionReservationStocklistEntity::getReservationNum).sum();
}
distributionReservationMapper.updateById(distributionReservationEntity);
if (planNum == 0 ) {
distributionReservationEntity.setIsDeleted(1);
distributionReservationEntity.setCancelReason("无计划数据,系统取消");
distributionReservationEntity.setReservationStatus(ReservationStatusConstant.yiquexiao.getValue());
distributionReservationMapper.updateById(distributionReservationEntity);
//删除签收表数据
distributionSignforMapper.deleteByReservationAndDeliveryId(reservationId,deliveryId);
}
}
}
// @Transactional
private void checkReservationAndDeliverySigningStatus(Long reservationId, Long deliveryId) {
//维护客户签收状态

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

@ -3168,11 +3168,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isNotEmpty(packageListInfo)) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + ",客户:" + reservationEntity.getConsignee() + ",文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + ",客户:" + reservationEntity.getConsignee() + ",司机完成签收,无法追加订单");
}
packageListInfo.forEach(p -> {
orderPackageNum.getAndAdd(p.getQuantity());
@ -3197,11 +3197,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} else {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + ",客户:" + reservationEntity.getConsignee() + ",文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + ",客户:" + reservationEntity.getConsignee() + ",司机完成签收,无法追加订单");
}
//查询该订单下的所有包件信息并插入该计划中
//添加该订单下可操作包件至计划中
@ -3338,11 +3338,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (Func.isEmpty(oldPackageList.get(p.getOrderPackageCode()))) {
if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "文员完成复核,无法追加订单");
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + ",客户:" + reservationEntity.getConsignee() + ",文员完成复核,无法追加订单");
}
if (Func.isNotEmpty(reservationEntity) && reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())) {
log.error("#############商配文员对司机完成签收订单追加reservationId:{}", reservationEntity.getId());
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "司机完成签收,无法追加订单");
throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + ",客户:" + reservationEntity.getConsignee() + ",司机完成签收,无法追加订单");
}
//为该订单新增了包件
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();

4
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportStockMapper.xml

@ -63,11 +63,11 @@
t.service_type service_type,
t.cargo_number,
t.description_goods,
t.warehousing_time,
t.create_time warehousing_time,
t.despatch,
t.order_code,
dpl.order_package_code package_code,
t.quantity_stock,
t.quantity_stock + t.quantity_occupied + t.outbound_quantity quantity_stock,
lwug.allocation_title
from logpm_distribution_stock_list t
left join logpm_distribution_stock_list_info dsli

Loading…
Cancel
Save