Browse Source

预约编辑库存品Bug修复

training
kilo 1 year ago
parent
commit
1021202d8b
  1. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java
  2. 16
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java
  3. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java
  4. 28
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTrayRetentionVO.java
  5. 45
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java
  6. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java
  7. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java
  8. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java
  9. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.java
  10. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml
  11. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  12. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionAsyncService.java
  13. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  14. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  15. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java
  16. 141
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java
  17. 91
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  18. 95
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  19. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java
  20. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java
  21. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java
  22. 48
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionDeliveryListClient.java

@ -64,6 +64,18 @@ public interface IDistributionDeliveryListClient {
DistributionDeliveryListVO getDeliveryDriverInfo(@RequestParam("current") Long deliveryId);
/**
* 滞留配送任务包件
* @param deliveryId
* @param reservationId
* @param orderPackageId
* @param conditions 1-订制品 2-库存
* @return
*/
@GetMapping(TOP+"/retentionDeliveryReservationPackage")
boolean retentionDeliveryReservationPackage(@RequestParam("deliveryId")Long deliveryId,@RequestParam("reservationId") Long reservationId,@RequestParam("orderPackageId") Long orderPackageId,@RequestParam("conditions") Integer conditions);
// /**
// * 根据配送任务ID查询配送司机信息
// * @param distributionRetentionScanVo

16
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionReservationClient.java

@ -49,20 +49,4 @@ public interface IDistributionReservationClient {
@GetMapping(TOP)
BladePage<DistributionReservationEntity> reservationTop(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
/**
* 根据配送任务ID查询配送司机信息
* @param distributionRetentionScanVo
* @return
*/
@GetMapping(TOP+"/retentionCancelReservationPack")
boolean retentionCancelReservationPack(@RequestBody DistributionRetentionScanVo distributionRetentionScanVo);
// /**
// * 根据配送任务ID查询配送司机信息
// * @param distributionRetentionScanVo
// * @return
// */
// @Post(TOP+"/retentionCancelReservationPack")
// boolean retentionCancelReservationPack(@RequestBody DistributionRetentionScanVo distributionRetentionScanVo);
}

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionRetentionScanVo.java

@ -68,6 +68,10 @@ public class DistributionRetentionScanVo {
*/
private Integer conditions;
/**
* 类型
*/
private Integer scanType;
/**
* 配送ID

28
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionTrayRetentionVO.java

@ -0,0 +1,28 @@
package com.logpm.distribution.vo;
import lombok.Data;
import java.util.List;
@Data
public class DistributionTrayRetentionVO {
private Long trayTypeId;
private String trayCode;//托盘码
private String trayName;//托盘名称
private Long warehosueId;//仓库ID
private String warehosueName;//仓库名称
private List<DistributionRetentionScanVo> GoodsList;//仓库名称
}

45
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseRetentionScanEntity.java

@ -181,9 +181,52 @@ public class WarehouseRetentionScanEntity extends TenantEntity {
private Long deliveryId;
/**
* 配送任务ID
* 滞留任务Id
*/
@ApiModelProperty(value = "配送任务ID")
private Long refId;
/**
* 托盘Id
*/
@ApiModelProperty(value = "托盘Id")
private Long trayId;
/**
* 托盘码
*/
@ApiModelProperty(value = "托盘码")
private String trayCode;
/**
* 托盘名称
*/
@ApiModelProperty(value = "托盘名称")
private String trayName;
/**
* 取消人Id
*/
@ApiModelProperty(value = "取消人Id")
private String cancelRetentionUserId;
/**
* 取消人名称
*/
@ApiModelProperty(value = "取消人名称")
private String cancelRetentionUserName;
/**
* 取消时间
*/
@ApiModelProperty(value = "取消时间")
private String cancelRetentionTime;
/**
* 取消状态 0- 1-
*/
@ApiModelProperty(value = "取消状态 0-否 1-是")
private String cancelRetentionStatus;
}

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

@ -284,10 +284,10 @@ public class DistributionDeliveryAppController {
/**
* 扫描查询配送任务下的包件信息
*/
@PostMapping("/getZeroPackageInfo")
@PostMapping("/retentionTrayScan")
@ApiOperationSupport(order = 11)
public R getZeroPackageInfo(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R distributionParcelListVOS = distributionDeliveryListService.getZeroPackageInfo(distrilbutionloadingscanDTO);
R distributionParcelListVOS = distributionDeliveryListService.getTrayInfoAndPackageList(distrilbutionloadingscanDTO);
return R.data(distributionParcelListVOS);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionDeliveryListClient.java

@ -60,6 +60,11 @@ public class DistributionDeliveryListClient implements IDistributionDeliveryList
return distributionDeliveryListService.getDeliveryList(deliveryId);
}
@Override
public boolean retentionDeliveryReservationPackage(Long deliveryId, Long reservationId, Long orderPackageId, Integer conditions) {
return distributionDeliveryListService.retentionDeliveryReservationPackage(deliveryId,reservationId,orderPackageId,conditions);
}
// @Override
// public void retentionCancelDeliveryPack(DistributionRetentionScanVo distributionRetentionScanVo) {
// distributionDeliveryListService.retentionCancelDeliveryPack(distributionRetentionScanVo);

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionReservationClient.java

@ -51,9 +51,6 @@ public class DistributionReservationClient implements IDistributionReservationCl
return BladePage.of(page);
}
@Override
public boolean retentionCancelReservationPack(DistributionRetentionScanVo distributionRetentionScanVo) {
return reservationService.retentionCancelReservationPack(distributionRetentionScanVo);
}
}

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

@ -65,4 +65,12 @@ public interface DistributionAddvaluePackageMapper extends BaseMapper<Distributi
* @param packageId
*/
void deleteAddvaluePackage(@Param("reservationId")Long reservationId,@Param("packageId") Long packageId);
/**
* 删除指定增值服务项包件列表
* @param reservationId
* @param id
* @param addvalueDetailId
*/
void deleteAddvaluePackageByDetailId(@Param("reservationId")Long reservationId,@Param("packageId") Long id,@Param("addvalueDetailId") Long addvalueDetailId);
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionAddvaluePackageMapper.xml

@ -37,6 +37,9 @@
<delete id="deleteAddvaluePackage">
DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId}
</delete>
<delete id="deleteAddvaluePackageByDetailId">
DELETE FROM logpm_distribution_addvalue_package WHERE reservation_id = #{reservationId} and package_id = #{packageId} And addvalue_detail_id = #{addvalueDetailId}
</delete>
<select id="selectDistributionAddvaluePackagePage" resultMap="distributionAddvaluePackageResultMap">
select * from logpm_distribution_addvalue_package where is_deleted = 0
</select>

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -1621,7 +1621,8 @@
ldsl.cargo_number AS materialNumber,
ldsl.description_goods AS materialName,
2 AS conditions,
ldsl.incoming_batch AS 入库批次
ldsl.incoming_batch AS 入库批次,
1 AS scanType
FROM
logpm_distribution_delivery_list AS lddl
LEFT JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id
@ -1642,7 +1643,8 @@
ldpl.id AS orderPackageId,
ldpl.order_package_code AS orderPackageCode,
ldpl.quantity AS retentionQuantity,
1 AS conditions
1 AS conditions,
1 AS scanType
FROM
logpm_distribution_delivery_list AS lddl
LEFT JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id
@ -1666,7 +1668,8 @@
ldrs.reservation_num AS maxRetention,
ldrzp.parcel_list_id AS orderPackageId,
ldpl.firsts AS materialName,
3 AS conditions
3 AS conditions,
2 AS scanType
FROM
logpm_distribution_delivery_list AS lddl
LEFT JOIN logpm_distribution_signfor AS lds ON lds.delivery_id = lddl.id

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

@ -187,11 +187,11 @@ public interface IDistributionAsyncService {
void stockupSelfOffShelf(StockupDTO stockupDTO) throws InterruptedException;
/**
* 检查维护装车状态
* 检查维护包件订单预约装车状态配送惹怒我预约状态
* @param parcelListEntity
* @param deliveryId
*/
void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId);
void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId,Long reservationId);
/**
* 托盘装车 维护装车状态

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -317,6 +317,23 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
List<DistributionDeliverySelfVO> getDriverInfo(Long deliveryId);
/**
* 查询托盘以及托盘下的所有包件信息
* @param distrilbutionloadingscanDTO
* @return
*/
R getTrayInfoAndPackageList(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
* 滞留取消包件标记
* @param deliveryId
* @param reservationId
* @param orderPackageId
* @param conditions
* @return
*/
boolean retentionDeliveryReservationPackage(Long deliveryId, Long reservationId, Long orderPackageId, Integer conditions);
// /**
// * 滞留取消配送
// * @param distributionRetentionScanVo

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -226,10 +226,5 @@ public interface IDistributionReservationService extends BaseService<Distributio
*/
R getReservationPackageListByOrderId(Long orderId, Long reservationId,IPage<DistributionReservationOrderPackageVO> page);
/**
* 滞留扫描取消包件
* @param distributionRetentionScanVo
* @return
*/
boolean retentionCancelReservationPack(DistributionRetentionScanVo distributionRetentionScanVo);
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java

@ -639,6 +639,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}
@Override
public R addvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvalueVO> addvalueInfo = distributionAddvalueMapper.addvalueInfo(distributionAppAddvalueDTO.getReservationId());
addvalueInfo.stream().filter(a -> Func.isNotEmpty(a.getPackageListIds())).forEach(a -> {
@ -653,6 +654,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}
@Override
@Transactional
public R cancelSignAddValuePackage(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageDTO> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
if (Func.isEmpty(packageEntityList)) {
@ -673,7 +675,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
distributionAddvalueMapper.deleteAddvalue(distributionAppAddvalueDTO.getReservationId(), distributionAppAddvalueDTO.getAddvalueType());
}
packageIds.forEach(id -> {
distributionAddvaluePackageMapper.deleteAddvaluePackage(distributionAppAddvalueDTO.getReservationId(), id);
distributionAddvaluePackageMapper.deleteAddvaluePackageByDetailId(distributionAppAddvalueDTO.getReservationId(), id,distributionAppAddvalueDTO.getAddvalueDetailId());
});
} else {
log.error("###########该包件不存在增值服务项包件列表中");
@ -683,6 +685,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}
@Override
@Transactional
public R updatePCAddvalueInfo(DistributionAppAddvalueDTO distributionAppAddvalueDTO) {
List<DistributionAddvaluePackageDTO> packageEntityList = distributionAppAddvalueDTO.getPackageEntityList();
if (Func.isEmpty(packageEntityList)) {
@ -707,7 +710,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl<Distributio
}
if (increasePackage.size() == 0) {
//添加包件都已经存在在增值服务列表
return Resp.scanFail("添加失败", "包件已存在");
return R.fail("包件已存在");
}
if (increasePackage.size() > 0) {

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

@ -723,70 +723,89 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService {
}
@Override
public void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId) {
//首先能够进入这个检测方法那么此包件就是进行装车了,这里对包件装车状态再次进行维护
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
distributionParcelListService.updateById(parcelListEntity);
@Transactional
public void checkLoadingByPackage(DistributionParcelListEntity parcelListEntity, Long deliveryId,Long reservationId) {
if (Func.isEmpty(parcelListEntity)){
log.error("############包件信息异常:{}",parcelListEntity);
throw new RuntimeException("包件信息异常");
}
//维护包件所属订单是否均已完成装车,如果均已完成装车则订单进行装车状态的修改
switch (parcelListEntity.getConditions()){
case 1:
break;
//维护此包件对应的订单装车状态
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
if (Func.isNotEmpty(stockArticleEntity)){
//查询订单的所有包件
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId()));
boolean orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (orderLoadingFlag){
stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
}else {
orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
if (!orderLoadingFlag){
stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
}
}
distributionStockArticleService.updateById(stockArticleEntity);
}
//维护预约计划
List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId);
if (Func.isNotEmpty(reservationEntityList) && reservationEntityList.size()>0){
for (DistributionReservationEntity reservationEntity : reservationEntityList) {
List<DistributionParcelListEntity> reservationParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId());
if (Func.isNotEmpty(reservationParcelListEntities)&& reservationParcelListEntities.size()>0){
boolean reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (reservationLoadingFlag){
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
}else {
reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
if (reservationLoadingFlag){
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue());
}else {
reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue());
}
}
distributionReservationMapper.updateById(reservationEntity);
}
}
}
//维护配送计划
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId);
if (Func.isNotEmpty(deliveryListEntity)){
List<DistributionParcelListEntity> deliveryParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId);
if (Func.isNotEmpty(deliveryParcelListEntities) && deliveryParcelListEntities.size()>0){
boolean deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (deliveryLoadingFlag){
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());
}else {
deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
if (deliveryLoadingFlag){
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
}else {
deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue());
}
}
distributionDeliveryListMapper.updateById(deliveryListEntity);
}
case 3:
break;
}
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
// //首先能够进入这个检测方法那么此包件就是进行装车了,这里对包件装车状态再次进行维护
// if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){
// parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
// parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
// distributionParcelListService.updateById(parcelListEntity);
// }
//
// //维护此包件对应的订单装车状态
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
// if (Func.isNotEmpty(stockArticleEntity)){
// //查询订单的所有包件
// List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId()));
// boolean orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
// if (orderLoadingFlag){
// stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue());
// }else {
// orderLoadingFlag = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
// if (!orderLoadingFlag){
// stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue());
// }
// }
// distributionStockArticleService.updateById(stockArticleEntity);
// }
// //维护预约计划
// List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(deliveryId);
// if (Func.isNotEmpty(reservationEntityList) && reservationEntityList.size()>0){
// for (DistributionReservationEntity reservationEntity : reservationEntityList) {
// List<DistributionParcelListEntity> reservationParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationEntity.getId());
// if (Func.isNotEmpty(reservationParcelListEntities)&& reservationParcelListEntities.size()>0){
// boolean reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
// if (reservationLoadingFlag){
// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue());
// }else {
// reservationLoadingFlag = reservationParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
// if (reservationLoadingFlag){
// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.daizhuangche.getValue());
// }else {
// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue());
// }
// }
// distributionReservationMapper.updateById(reservationEntity);
// }
// }
// }
// //维护配送计划
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId);
// if (Func.isNotEmpty(deliveryListEntity)){
// List<DistributionParcelListEntity> deliveryParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(deliveryId);
// if (Func.isNotEmpty(deliveryParcelListEntities) && deliveryParcelListEntities.size()>0){
// boolean deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
// if (deliveryLoadingFlag){
// deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue());
// }else {
// deliveryLoadingFlag = deliveryParcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()));
// if (deliveryLoadingFlag){
// deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.weizhuangche.getValue());
// }else {
// deliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue());
// }
// }
// distributionDeliveryListMapper.updateById(deliveryListEntity);
// }
// }
}

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

@ -282,7 +282,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionDeliveryListVO.setReservationList(customList);
//查询司机信息
if (distributionDeliveryListVO.getKind().equals("1")) {
DistributionDeliverySelfEntity deliverySelfServiceOne = distributionDeliverySelfService.getOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionDeliveryListVO.getId()).eq(DistributionDeliverySelfEntity::getIsMaster, 2));
DistributionDeliverySelfEntity deliverySelfServiceOne = distributionDeliverySelfService.getOne(Wrappers.<DistributionDeliverySelfEntity>query().lambda()
.eq(DistributionDeliverySelfEntity::getDeliveryId, distributionDeliveryListVO.getId())
.eq(DistributionDeliverySelfEntity::getIsMaster, 2));
distributionDeliveryListVO.setDriverName(deliverySelfServiceOne.getDriverName());
distributionDeliveryListVO.setDriverPhone(deliverySelfServiceOne.getDriverPhone());
distributionDeliveryListVO.setVehicleName(deliverySelfServiceOne.getVehicleNub());
@ -571,7 +573,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//异步维护状态
// str.append("包件装车");
// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
distributionAsyncService.checkLoadingByPackage(parcelListEntity, distrilbutionloadingscanDTO.getDeliveryId());
// distributionAsyncService.checkLoadingByPackage(parcelListEntity, distrilbutionloadingscanDTO.getDeliveryId());
} else if (parcelListEntityList.size() == 0) {
//查找出该包件信息
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda()
@ -705,6 +707,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
// loadingNum.getAndAdd(loadscanEntity.getPackageNub());
distributionAsyncService.checkLoadingByPackage(parcelListEntity, loadscanEntity.getDeliveryId(),loadscanEntity.getReservationId());
}
}
// str.append("预约客户整托装车");
@ -5471,6 +5474,90 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return null;
}
@Override
public R getTrayInfoAndPackageList(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
String barcode = distrilbutionloadingscanDTO.getBarcode();
if (Func.isEmpty(barcode)){
log.error("#############缺少托盘码,barcode:{}",barcode);
return Resp.scanFail("服务器正忙...","服务器正忙...");
}
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(barcode);
List<WarehouseTrayGoodsEntity> goodsLsit = trayTypeDataVO.getGoodsLsit();
if (Func.isEmpty(goodsLsit)){
log.error("#############托盘无货物,taryCode:{}",barcode);
return Resp.scanFail("该托盘无货物","该托盘无货物");
}
boolean isAll = goodsLsit.stream().allMatch(good -> good.getAssociationType().equals(3));
if (isAll){
int size = goodsLsit.stream().map(WarehouseTrayGoodsEntity::getAssociationValue).distinct().collect(Collectors.toList()).size();
log.error("#############托盘存在多种货物类型,货物种类:{}",size);
return Resp.scanFail("该托盘存在多种货物","该托盘存在多种货物");
}
List<DistributionParcelListEntity> parcelListEntities = baseMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isEmpty(parcelListEntities)){
log.error("#############配送任务不存在包件信息,配送任务ID:{}",distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanFail("配送任务无包件信息","配送任务无包件信息");
}
//查询托盘货物是否都属于该配送计划的包件
boolean isExist = goodsLsit.stream()
.map(WarehouseTrayGoodsEntity::getAssociationId)
.collect(Collectors.toList()).stream()
.allMatch(goodId -> parcelListEntities.stream()
.map(DistributionParcelListEntity::getId)
.collect(Collectors.toList()).contains(goodId));
if (isExist){
DistributionTrayRetentionVO distributionTrayRetentionVO = new DistributionTrayRetentionVO();
DistributionTrayRetentionVO trayRetentionVO = Func.copy(trayTypeDataVO, DistributionTrayRetentionVO.class);
List<DistributionRetentionScanVo> retentionScanVos = new ArrayList<>();
//托盘货物都存在该配送任务的包件列表
//进行客户划分
goodsLsit.forEach(g->{
DistributionRetentionScanVo retentionScanVo = baseMapper.selectRetentionPackage(g.getAssociationValue(), distrilbutionloadingscanDTO.getDeliveryId());
if (Func.isNotEmpty(retentionScanVo)){
retentionScanVo.setScanType(3);
retentionScanVos.add(retentionScanVo);
}else {
log.error("#############查询托盘包件信息错误,包件码为:{}",g.getAssociationValue());
}
});
if (Func.isNotEmpty(retentionScanVos)){
trayRetentionVO.setGoodsList(retentionScanVos);
return R.data(trayRetentionVO);
}
}else {
return Resp.scanFail("托盘存在包件不属于该配送任务","托盘存在包件不属于该配送任务");
}
return null;
}
@Override
@Transactional
public boolean retentionDeliveryReservationPackage(Long deliveryId, Long reservationId, Long orderPackageId, Integer conditions) {
DistributionDeliveryListEntity deliveryListEntity = this.getById(deliveryId);
if (Func.isEmpty(deliveryListEntity)){
log.error("###########查询配送任务异常,deliveyId:{}",deliveryId);
return false;
}
switch (conditions){
case 1:
//订制品
List<DistributionParcelListEntity> parcelListEntities = baseMapper.selectPackageListByDeliveryListId(deliveryId);
if (Func.isNotEmpty(parcelListEntities)){
if (parcelListEntities.size() == deliveryListEntity.getDeliveryNumber()){
//该配送任务下只有一个包件,那么就只会存在一个预约,此时就该进行所有的包件滞留并且进行删除
}
}
break;
case 2:
//库存品
break;
}
return false;
}
public Map<String, String> getDriverCar(String kind, Long deliveryListEntityId) {

95
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -3164,101 +3164,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
return R.data(reservationOrderPackageVO);
}
@Override
public boolean retentionCancelReservationPack(DistributionRetentionScanVo distributionRetentionScanVo) {
log.info("@@@@@@@@@@@@执行了包件滞留取消");
// //滞留取消配送任务
// Integer conditions = distributionRetentionScanVo.getConditions();
// DistributionReservationEntity reservationEntity = this.getById(distributionRetentionScanVo.getReservationId());
// if (Func.isEmpty(reservationEntity)){
// log.error("###########查询预约计划错误,reservationId:{}",distributionRetentionScanVo.getReservationId());
// return false;
// }
// switch (conditions){
// // 1 定制 2-零担 3-库存品
// case 1:
// if (reservationEntity.getReservationNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationStockListNum() == 0){
// //该预约订单只存在该包件并且没有库存品
// this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
// }else {
// DistributionReservationPackageEntity reservationPackageEntity = distributionReservationPackageMapper.selectOne(Wrappers.<DistributionReservationPackageEntity>query().lambda()
// .eq(DistributionReservationPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
// .eq(DistributionReservationPackageEntity::getParceListId, distributionRetentionScanVo.getOrderPackageId())
// .ne(DistributionReservationPackageEntity::getPacketBarStatus, ReservationPackageStatusConstant.quxiao.getValue()));
// reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue());
// distributionReservationPackageMapper.updateById(reservationPackageEntity);
// DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
// .eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
// .eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue())
// .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
// Integer reservationNum = reservationStockarticleEntity.getReservationNum();
// Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity();
// if ((reservationNum - retentionQuantity) == 0){
// reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
// }
// reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity);
// distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity);
// reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity);
// this.updateById(reservationEntity);
// }
// break;
// case 2:
// if (reservationEntity.getReservationStockListNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationNum() == 0){
// this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
// }else {
// DisStockListDetailEntity disStockListDetailEntity = disStockListDetailMapper.selectOne(Wrappers.<DisStockListDetailEntity>query().lambda()
// .eq(DisStockListDetailEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DisStockListDetailEntity::getStockListId, distributionRetentionScanVo.getInventoryId())
// .eq(DisStockListDetailEntity::getId, distributionRetentionScanVo.getOrderPackageId())
// );
// disStockListDetailEntity.setStockPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
// disStockListDetailMapper.updateById(disStockListDetailEntity);
// DistributionReservationStocklistEntity reservationStocklistEntity = distributionReservationStocklistMapper.selectOne(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
// .eq(DistributionReservationStocklistEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationStocklistEntity::getStocklistId, distributionRetentionScanVo.getInventoryId())
// .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationOrderStatusConstant.quxiao.getValue())
// );
// Integer reservationNum = reservationStocklistEntity.getReservationNum();
//
// }
// break;
// case 3:
// if (reservationEntity.getReservationNum() == distributionRetentionScanVo.getRetentionQuantity() && reservationEntity.getReservationStockListNum() == 0){
// //该预约订单只存在该包件并且没有库存品
// this.cancelReservation(Func.copy(reservationEntity,DistributionReservationDTO.class));
// }else {
// DistributionReservationZeroPackageEntity reservationZeroPackageEntity = distributionReservationZeroPackageMapper.selectOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
// .eq(DistributionReservationZeroPackageEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
// .eq(DistributionReservationZeroPackageEntity::getParcelListId, distributionRetentionScanVo.getOrderPackageId())
// .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()));
// if (reservationZeroPackageEntity.getQuantity() == distributionRetentionScanVo.getRetentionQuantity()){
// reservationZeroPackageEntity.setZeroPackageStatus(ReservationPackageStatusConstant.quxiao.getValue());
// }
// reservationZeroPackageEntity.setQuantity(reservationZeroPackageEntity.getQuantity() -distributionRetentionScanVo.getRetentionQuantity());
// distributionReservationZeroPackageMapper.updateById(reservationZeroPackageEntity);
// DistributionReservationStockarticleEntity reservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(Wrappers.<DistributionReservationStockarticleEntity>query().lambda()
// .eq(DistributionReservationStockarticleEntity::getReservationId, distributionRetentionScanVo.getReservationId())
// .eq(DistributionReservationStockarticleEntity::getStockArticleId, distributionRetentionScanVo.getOrderId())
// .eq(DistributionReservationStockarticleEntity::getIsZero, IsOrNoConstant.no.getValue())
// .ne(DistributionReservationStockarticleEntity::getStockArticleStatus, ReservationOrderStatusConstant.quxiao.getValue()));
// Integer reservationNum = reservationStockarticleEntity.getReservationNum();
// Integer retentionQuantity = distributionRetentionScanVo.getRetentionQuantity();
// if ((reservationNum - retentionQuantity) == 0){
// reservationStockarticleEntity.setStockArticleStatus(ReservationOrderStatusConstant.quxiao.getValue());
// }
// reservationStockarticleEntity.setReservationNum(reservationNum - retentionQuantity);
// distributionReservationStockarticleMapper.updateById(reservationStockarticleEntity);
// reservationEntity.setReservationNum(reservationEntity.getReservationNum() - retentionQuantity);
// this.updateById(reservationEntity);
// }
// break;
//
// }
return false;
}
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseRetentionApiController.java

@ -96,6 +96,9 @@ public class WarehouseRetentionApiController {
// @GetMapping("/initRetentionList")
// @ApiOperationSupport(order = 1)
// @ApiOperation(value = "初始化滞留车次信息", notes = "传入trayTypeDTO")

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseRetentionRecordController.java

@ -66,9 +66,9 @@ public class WarehouseRetentionRecordController extends BladeController {
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入warehouseRetentionRecord")
public R<WarehouseRetentionRecordVO> detail(WarehouseRetentionRecordEntity warehouseRetentionRecord) {
WarehouseRetentionRecordEntity detail = warehouseRetentionRecordService.getOne(Condition.getQueryWrapper(warehouseRetentionRecord));
return R.data(WarehouseRetentionRecordWrapper.build().entityVO(detail));
public R<WarehouseRetentionRecordVO> detail(Long id) {
WarehouseRetentionRecordVO detail = warehouseRetentionRecordService.getDetail(id);
return R.data(detail);
}
/**
* 滞留记录 分页

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseRetentionRecordService.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.warehouse.dto.RetentionDTO;
import com.logpm.warehouse.dto.WarehouseRetentionRecordDTO;
@ -81,4 +82,10 @@ public interface IWarehouseRetentionRecordService extends BaseService<WarehouseR
*/
R updateRetentionList(WarehouseRetentionRecordDTO warehouseRetentionScanDTOS);
/**
* 查询滞留任务详情
* @param id
* @return
*/
WarehouseRetentionRecordVO getDetail(Long id);
}

48
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java

@ -50,6 +50,7 @@ import com.logpm.warehouse.wrapper.WarehouseRetentionScanWrapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.retention.RetentionTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.log.exception.ServiceException;
@ -60,6 +61,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
@ -82,7 +84,8 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
private final IWarehouseRetentionScanService warehouseRetentionScanService;
private final IDistributionDeliveryListClient deliveryListClient;
private final IBasicdataWarehouseClient warehouseClient;
private final IDistributionReservationClient reservationClient;
// private final IDistributionReservationClient distributionReservationClient;
private final IDistributionDeliveryListClient distributionDeliveryListClient;
@Override
public IPage<WarehouseRetentionRecordVO> selectWarehouseRetentionRecordPage(IPage<WarehouseRetentionRecordVO> page, WarehouseRetentionRecordVO warehouseRetentionRecord) {
@ -159,6 +162,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
}
@Override
@Transactional
public R saveRetentionList(WarehouseRetentionRecordDTO warehouseRetentionRecordDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
@ -184,14 +188,35 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
this.save(warehouseRetentionRecordEntity);
AtomicInteger retentionTotal = new AtomicInteger();
warehouseRetentionScanDTOS.forEach(r->{
r.setRetentionScanTime(new Date());
r.setRetentionScanUserId(user.getUserId());
r.setRetentionScanUsername(user.getUserName());
r.setRetentionQuantity(r.getRetentionQuantity());
retentionTotal.getAndAdd(r.getRetentionQuantity());
r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId());
r.setRefId(warehouseRetentionRecordEntity.getId());
warehouseRetentionScanService.save(Func.copy(r,WarehouseRetentionScanEntity.class));
//查询是否进行多次滞留
WarehouseRetentionScanEntity retentionScanServiceOne = warehouseRetentionScanService.getOne(Wrappers.<WarehouseRetentionScanEntity>query().lambda()
.eq(WarehouseRetentionScanEntity::getConditions, r.getConditions())
.eq(WarehouseRetentionScanEntity::getOrderPackageId, r.getOrderPackageId())
.eq(WarehouseRetentionScanEntity::getReservationId, r.getReservationId())
.eq(WarehouseRetentionScanEntity::getOrderId, r.getOrderId())
.eq(WarehouseRetentionScanEntity::getOrderCode, r.getOrderCode())
.eq(WarehouseRetentionScanEntity::getScanType, r.getScanType())
.ne(WarehouseRetentionScanEntity::getCancelRetentionStatus, IsOrNoConstant.no.getValue())
);
//避免重复添加相同的滞留包件数据
if (Func.isEmpty(retentionScanServiceOne)){
r.setRetentionScanTime(new Date());
r.setRetentionScanUserId(user.getUserId());
r.setRetentionScanUsername(user.getNickName());
r.setRetentionQuantity(r.getRetentionQuantity());
retentionTotal.getAndAdd(r.getRetentionQuantity());
r.setDeliveryId(warehouseRetentionRecordDTO.getDeliveryId());
r.setRefId(warehouseRetentionRecordEntity.getId());
warehouseRetentionScanService.save(Func.copy(r,WarehouseRetentionScanEntity.class));
//进行滞留之后需要对包件进行取消配送的操作
if (r.getConditions().equals(3)){
//零担滞留
}else {
//包件滞留
distributionDeliveryListClient.retentionDeliveryReservationPackage(r.getDeliveryId(),r.getReservationId(),r.getOrderPackageId(),r.getConditions());
}
}
//进行滞留操作的包件需要和原来订单 预约进行绑定解除
//TODO 需要一个取消配送包件的方法
// reservationClient.retentionCancelReservationPack();
@ -280,4 +305,9 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
return Resp.scanSuccess("操作成功","操作成功");
}
@Override
public WarehouseRetentionRecordVO getDetail(Long id) {
return null;
}
}

Loading…
Cancel
Save