Browse Source

配送调整

training
kilo 1 year ago
parent
commit
7efac8201d
  1. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  3. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java
  4. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java
  5. 25
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  6. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java

@ -89,8 +89,8 @@ public class DistributionDeliveryAppController {
@GetMapping("/order") @GetMapping("/order")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
@ApiOperation(value = "查看订单", notes = "DistributionAppDeliveryListDTO") @ApiOperation(value = "查看订单", notes = "DistributionAppDeliveryListDTO")
public R<IPage<DistributionAppStockArticleVO>> order(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO, Query query) { public R<List<DistributionAppStockArticleVO>> order(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) {
IPage<DistributionAppStockArticleVO> pages = distributionDeliveryInfoService.selectDistributionAppDeliveryorder(Condition.getPage(query), distributionAppDeliveryListDTO); List<DistributionAppStockArticleVO> pages = distributionDeliveryInfoService.selectDistributionAppDeliveryorder(distributionAppDeliveryListDTO);
return R.data(pages); return R.data(pages);
} }

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -426,7 +426,7 @@
FROM FROM
logpm_distribution_stock_list logpm_distribution_stock_list
<where> <where>
service_type = #{par.serviceType} and warehouse_name = #{par.warehouseName} service_type = #{par.serviceType} and warehouse_id = #{par.warehouseId}
<if test="par.incomingBatch != null and par.incomingBatch != ''"> <if test="par.incomingBatch != null and par.incomingBatch != ''">
and incoming_batch like concat('%',#{par.incomingBatch},'%') and incoming_batch like concat('%',#{par.incomingBatch},'%')
</if> </if>

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryInfoService.java

@ -92,7 +92,7 @@ public interface IDistributionDeliveryInfoService extends BaseService<Distributi
* @param distributionAppDeliveryListDTO * @param distributionAppDeliveryListDTO
* @return * @return
*/ */
IPage<DistributionAppStockArticleVO> selectDistributionAppDeliveryorder(IPage<DistributionAppStockArticleVO> page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO); List<DistributionAppStockArticleVO> selectDistributionAppDeliveryorder(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO);
/** /**
* 从客户查看库存品 * 从客户查看库存品
* *

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryInfoServiceImpl.java

@ -156,7 +156,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
} }
@Override @Override
public IPage<DistributionAppStockArticleVO> selectDistributionAppDeliveryorder(IPage<DistributionAppStockArticleVO> page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { public List<DistributionAppStockArticleVO> selectDistributionAppDeliveryorder(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) {
//-------------------------------------2023-10-07 客户查看订单详情----------------------------------------------------------------- //-------------------------------------2023-10-07 客户查看订单详情-----------------------------------------------------------------
// 这里先查询出客户的订单信息,然后查询订单的预约包件信息 // 这里先查询出客户的订单信息,然后查询订单的预约包件信息
@ -332,7 +332,7 @@ public class DistributionDeliveryInfoServiceImpl extends BaseServiceImpl<Distrib
distributionAppStockArticleVOS.add(appStockArticleVO); distributionAppStockArticleVOS.add(appStockArticleVO);
}); });
} }
return page.setRecords(distributionAppStockArticleVOS); return distributionAppStockArticleVOS;
} }
// packageListByReservationId.stream().collect(Collectors.groupingBy()) // packageListByReservationId.stream().collect(Collectors.groupingBy())

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

@ -2247,13 +2247,15 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionAppDeliveryListVO.setVehicleStatus_name("未配车"); distributionAppDeliveryListVO.setVehicleStatus_name("未配车");
} }
//查询是否备货 //查询是否备货
distributionAppDeliveryListVO.setIsstock("备货完成"); distributionAppDeliveryListVO.setIsstock("备货未完成");
Integer reNub = distributionStockMapper.selectCount(new QueryWrapper<DistributionStockEntity>().lambda() List<DistributionStockEntity> stockEntityList = distributionStockMapper.selectList(new QueryWrapper<DistributionStockEntity>().lambda()
.in(!reList.isEmpty(), DistributionStockEntity::getReservationId, reList) .eq(DistributionStockEntity::getReservationId, distributionAppDeliveryListVO.getReservationId()));
).intValue(); //扫描件数 if (Func.isNotEmpty(stockEntityList)){
Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数 Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数
if (reNub < deliveryNumber) { int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum();
distributionAppDeliveryListVO.setIsstock("备货未完成"); if (sum == deliveryNumber) {
distributionAppDeliveryListVO.setIsstock("备货完成");
}
} }
//查询司机 //查询司机
List<DistributionAppDeliverySelfVO> distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId()); List<DistributionAppDeliverySelfVO> distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId());
@ -2640,6 +2642,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
.ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()) .ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
.ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue()) .ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
.notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()})); .notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()}));
if (Func.isEmpty(distributionParcelListEntities)){
throw new RuntimeException(s.getOrderCode()+"无可用数量");
}
distributionParcelListEntities.forEach(dp -> { distributionParcelListEntities.forEach(dp -> {
if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
if (!Func.equals(dp.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(dp.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) { if (!Func.equals(dp.getOrderPackageFreezeStatus(), OrderPackageFreezeStatusConstant.yidongjie.getValue()) && !Func.equals(dp.getOrderPackageReservationStatus(), OrderPackageReservationStatusConstant.yiyueyue.getValue())) {
@ -2666,12 +2672,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); s.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue());
s.setAvailableQuantity(0); s.setAvailableQuantity(0);
distributionStockArticleService.updateById(s); distributionStockArticleService.updateById(s);
} else { } else {
packageListInfo.forEach(p -> { packageListInfo.forEach(p -> {
orderPackageNum.getAndAdd(p.getQuantity()); orderPackageNum.getAndAdd(p.getQuantity());
DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity();
reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.zhengchang.getValue()); reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.xinzeng.getValue());
reservationPackageEntity.setPacketBarCode(p.getOrderPackageCode()); reservationPackageEntity.setPacketBarCode(p.getOrderPackageCode());
reservationPackageEntity.setStockArticleId(s.getId()); reservationPackageEntity.setStockArticleId(s.getId());
reservationPackageEntity.setReservationId(reservationEntity.getId()); reservationPackageEntity.setReservationId(reservationEntity.getId());
@ -2727,6 +2732,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}); });
} else { } else {
log.error("###########################零担订单查询品类错误,订单ID:{}", s.getId()); log.error("###########################零担订单查询品类错误,订单ID:{}", s.getId());
throw new RuntimeException(s.getOrderCode()+"无可用数量");
} }
} }
} else { } else {
@ -2774,6 +2780,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity(); DistributionStockupInfoEntity stockupInfoEntity = new DistributionStockupInfoEntity();
stockupInfoEntity.setReservationId(reservationEntity.getId()); stockupInfoEntity.setReservationId(reservationEntity.getId());
stockupInfoEntity.setStockupId(deliveryStockupInfo.getId()); stockupInfoEntity.setStockupId(deliveryStockupInfo.getId());
stockupInfoEntity.setStockUpType("1");
distributionStockupInfoService.save(stockupInfoEntity); distributionStockupInfoService.save(stockupInfoEntity);
} else { } else {
//根据配送计划和运单号查询出该预约 //根据配送计划和运单号查询出该预约

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -1125,7 +1125,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// ).stream().mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum(); // ).stream().mapToInt(DistributionLoadscaninvnEntity::getReceivedQuantity).sum();
distributionAppDeliveryListVO.setSignNub(signNum.get()); distributionAppDeliveryListVO.setSignNub(signNum.get());
distributionAppDeliveryListVO.setDeliveryNumber(loadNum.get()); distributionAppDeliveryListVO.setLoadingNub(loadNum.get());
// distributionAppDeliveryListVO.setDeliveryNumber(loadNum.get());
//查询完成客户数 //查询完成客户数
Integer cusCount = distributionDeliveryListMapper.selectCompletecusInCount(distributionAppDeliveryListVO.getId()); Integer cusCount = distributionDeliveryListMapper.selectCompletecusInCount(distributionAppDeliveryListVO.getId());
//查询完成订单数 //查询完成订单数

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -459,7 +459,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return null; return null;
} }
DistributionStockListDTO stockListDTO = Func.copy(distributionStockList, DistributionStockListDTO.class); DistributionStockListDTO stockListDTO = Func.copy(distributionStockList, DistributionStockListDTO.class);
stockListDTO.setWarehouseName(myCurrentWarehouse.getName()); stockListDTO.setWarehouseId(myCurrentWarehouse.getId());
List<DistributionStockListVO> stockListVOList = baseMapper.selectAllStockList(stockListDTO); List<DistributionStockListVO> stockListVOList = baseMapper.selectAllStockList(stockListDTO);
page.setRecords(stockListVOList); page.setRecords(stockListVOList);
return page; return page;

Loading…
Cancel
Save