Browse Source

自提取消功能完善

dev-pushdata-important
汤建军 1 year ago
parent
commit
b374fdbe82
  1. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  2. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  3. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  4. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  5. 80
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

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

@ -1171,6 +1171,7 @@
logpm_distribution_signfor lds logpm_distribution_signfor lds
JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id
<where> <where>
ldr.reservation_status != 40
<if test="deliveryListId != null and deliveryListId != ''"> <if test="deliveryListId != null and deliveryListId != ''">
and lds.delivery_id = #{deliveryListId} and lds.delivery_id = #{deliveryListId}
</if> </if>

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml

@ -457,14 +457,15 @@
</select> </select>
<select id="selectBillLadingPackage" <select id="selectBillLadingPackage"
resultType="com.logpm.distribution.entity.DistributionParcelListEntity"> resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
SELECT ldpl.* FROM logpm_distrilbution_bill_package AS ldbp LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id WHERE bill_lading_id in SELECT ldpl.* FROM logpm_distrilbution_bill_package AS ldbp LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldbp.parce_list_id = ldpl.id
WHERE packet_bar_status != '3' AND bill_lading_id in
<foreach collection="ids" item="id" open="(" separator="," close=")"> <foreach collection="ids" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</select> </select>
<select id="selectBillLadingInventory" <select id="selectBillLadingInventory"
resultType="com.logpm.distribution.entity.DistributionDeliveryDetailsEntity"> resultType="com.logpm.distribution.entity.DistributionDeliveryDetailsEntity">
SELECT * FROM logpm_distribution_addvalue_detail WHERE bill_lading_id IN SELECT * FROM logpm_distribution_delivery_details WHERE inventory_status != '3' AND bill_lading_id IN
<foreach collection="ids" item="id" open="(" separator="," close=")"> <foreach collection="ids" item="id" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>

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

@ -182,6 +182,12 @@ public interface IDistributionStockListService extends BaseService<DistributionS
*/ */
List<DistributionMerchantStockListVO> getMerchantStockList(String materielCode); List<DistributionMerchantStockListVO> getMerchantStockList(String materielCode);
/**
* 维护库存品的占用数量
* @param stockListId
* @param quantity
*/
void updateInventoryQuantityOccupied(Long stockListId, Integer quantity);
// /** // /**

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

@ -704,6 +704,16 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return distributionMerchantStockListVOS; return distributionMerchantStockListVOS;
} }
@Override
@Transactional
public void updateInventoryQuantityOccupied(Long stockListId, Integer quantity) {
DistributionStockListEntity stockListEntity = this.getById(stockListId);
if (Func.isNotEmpty(stockListEntity)){
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - quantity);
this.updateById(stockListEntity);
}
}
} }
// @Override // @Override

80
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -102,6 +102,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
private final IDistributionBillLadingScanService distributionBillLadingScanService; private final IDistributionBillLadingScanService distributionBillLadingScanService;
private final IDistrilbutionBillStockService distrilbutionBillStockService; private final IDistrilbutionBillStockService distrilbutionBillStockService;
private final IDistributionStockupScanService distributionStockupScanService; private final IDistributionStockupScanService distributionStockupScanService;
@ -198,6 +200,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
} }
//判断有没有库存品数据 //判断有没有库存品数据
private void updateStockBill(DistrilbutionBillLadingDTO distrilbutionBillLading) { private void updateStockBill(DistrilbutionBillLadingDTO distrilbutionBillLading) {
List<DistributionDeliveryDetailsEntity> list = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda() List<DistributionDeliveryDetailsEntity> list = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
@ -247,9 +250,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
/** /**
* 提货单 新增或修改 * 提货单 新增或修改
*
* @param distrilbutionBillLading * @param distrilbutionBillLading
* @return * @return
*/ */
@ -623,8 +626,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
@Override @Override
public boolean signImages(DistrilbutionBillLadingDTO distrilbutionBillLading) { public boolean signImages(DistrilbutionBillLadingDTO distrilbutionBillLading) {
//修改图片 //修改图片
List<DistributionPrintEntity> printEntityList = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda().eq(DistributionPrintEntity::getBillLadingId, distrilbutionBillLading.getId())); List<DistributionPrintEntity> printEntityList = distributionPrintService.list(Wrappers.<DistributionPrintEntity>query().lambda().eq(DistributionPrintEntity::getBillLadingId, distrilbutionBillLading.getId()));
if (!printEntityList.isEmpty()) { if (!printEntityList.isEmpty()) {
@ -671,12 +672,20 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//满足进行取消自提,进行自提单的资源释放 //满足进行取消自提,进行自提单的资源释放
//直接对配送的包件和库存品进行取消 //直接对配送的包件和库存品进行取消
Integer a = this.cancelBillLodingPackage(ids); Integer a = this.cancelBillLodingPackage(ids);
switch (a) {
case 0:
//进行自提单的取消
this.removeBatchByIds(ids);
return R.status(true); return R.status(true);
case 1:
return R.fail("未授权!!!");
case 2:
return R.fail("存在签收包件");
}
return R.status(false);
} }
@Transactional
private Integer cancelBillLodingPackage(List<Long> ids) { private Integer cancelBillLodingPackage(List<Long> ids) {
String method = "##########类DistrilbutionBillLadingServiceImpl执行方法cancelBillLoding,"; String method = "##########类DistrilbutionBillLadingServiceImpl执行方法cancelBillLoding,";
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
@ -688,20 +697,32 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectBillLadingPackage(ids); List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectBillLadingPackage(ids);
if (Func.isNotEmpty(distributionParcelListEntities)) { if (Func.isNotEmpty(distributionParcelListEntities)) {
List<DistributionParcelListEntity> signingPakcage = distributionParcelListEntities.stream().filter(f -> f.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).collect(Collectors.toList()); List<DistributionParcelListEntity> signingPakcage = distributionParcelListEntities.stream().filter(f -> f.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).collect(Collectors.toList());
if (Func.isEmpty(signingPakcage)){ if (Func.isNotEmpty(signingPakcage)) {
//存在签收包件 //存在签收包件
return 3; return 2;
} }
//取消包件
UpdateWrapper<DistrilbutionBillPackageEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda()
.in(DistrilbutionBillPackageEntity::getBillLadingId,ids)
.set(DistrilbutionBillPackageEntity::getPacketBarStatus,"3")
;
distrilbutionBillPackageService.update(updateWrapper);
//取消订单
UpdateWrapper<DistrilbutionBillStockEntity> orderUpdateWrapper = new UpdateWrapper<>();
orderUpdateWrapper.lambda()
.in(DistrilbutionBillStockEntity::getBillLadingId,ids)
.set(DistrilbutionBillStockEntity::getOrderStatus,"3")
;
distrilbutionBillStockService.update(orderUpdateWrapper);
List<Long> packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); List<Long> packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
//将这些包件还原成可操作状态 //将这些包件还原成可操作状态
Integer num = distributionParcelListService.restorePakcageByIds(packageIds); Integer num = distributionParcelListService.restorePakcageByIds(packageIds);
//维护订单状态 //维护订单状态
String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(",")); String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCodes, myCurrentWarehouse.getId()); distributionStockArticleService.maintenanceOrderInfo(orderCodes, myCurrentWarehouse.getId());
}else {
log.error(method+"查询无包件信息:{}",ids);
//自提无包件信息
return 2;
} }
//取消库存品 //取消库存品
//查询自提库存品信息 //查询自提库存品信息
@ -709,25 +730,21 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (Func.isNotEmpty(distributionStockListEntities)) { if (Func.isNotEmpty(distributionStockListEntities)) {
//已经备货的库存品 存在库存品包件 //已经备货的库存品 存在库存品包件
distributionStockListEntities.forEach(ddd -> { distributionStockListEntities.forEach(ddd -> {
//恢复库存品数量
distributionStockListService.updateInventoryQuantityOccupied(ddd.getStockListId(),ddd.getQuantity());
//进行库存品包件取消 //进行库存品包件取消
if (ddd.getStockStatus().equals("3")) { if (ddd.getStockStatus().equals("3")) {
disStockListDetailService.cancelInventoryPackageByReservationIdAnStockListId(ddd.getStockListId(), ddd.getBillLadingId()); disStockListDetailService.cancelInventoryPackageByReservationIdAnStockListId(ddd.getStockListId(), ddd.getBillLadingId());
} }
//恢复库存品数量
} }
); );
//对所有的库存品相关进行取消标识 //对所有的库存品相关进行取消标识
UpdateWrapper<DistributionDeliveryDetailsEntity> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<DistributionDeliveryDetailsEntity> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda() updateWrapper.lambda()
.set(DistributionDeliveryDetailsEntity::getConditions,3) .set(DistributionDeliveryDetailsEntity::getInventoryStatus, 3)
.set(DistributionDeliveryDetailsEntity::getQuantity, 0) .set(DistributionDeliveryDetailsEntity::getQuantity, 0)
.in(DistributionDeliveryDetailsEntity::getBillLadingId, ids); .in(DistributionDeliveryDetailsEntity::getBillLadingId, ids);
distributionDeliveryDetailsService.update(updateWrapper); distributionDeliveryDetailsService.update(updateWrapper);
@ -737,6 +754,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/** /**
* 自提没有包件信息添加包件 * 自提没有包件信息添加包件
*
* @param stockArticleId * @param stockArticleId
* @param billId * @param billId
* @param parcelLisList * @param parcelLisList
@ -786,9 +804,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
/** /**
* 添加提货包件数据 * 添加提货包件数据
*
* @return * @return
*/ */
public Boolean updateBillPackeg(DistrilbutionBillLadingDTO distrilbutionBillLading) { public Boolean updateBillPackeg(DistrilbutionBillLadingDTO distrilbutionBillLading) {
@ -857,9 +875,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
/** /**
* 修改零担 * 修改零担
*
* @param distrilbutionBillLadingDTO * @param distrilbutionBillLadingDTO
* @return * @return
*/ */
@ -927,7 +945,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
zeroPackageEntity.setRealityQuantity(0); zeroPackageEntity.setRealityQuantity(0);
packageEntityList.add(zeroPackageEntity); packageEntityList.add(zeroPackageEntity);
}); });
if(!packageEntityList.isEmpty()){ distributionZeroPackageService.saveBatch(packageEntityList); } if (!packageEntityList.isEmpty()) {
distributionZeroPackageService.saveBatch(packageEntityList);
}
} else { } else {
log.warn("没有品类数据"); log.warn("没有品类数据");
@ -938,8 +958,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
/** /**
* 修改操作订单数据 * 修改操作订单数据
* *
@ -1958,6 +1976,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
return true; return true;
} }
/** /**
* 处理提货库存品签收 * 处理提货库存品签收
*/ */
@ -1983,15 +2002,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
} }
} }
/** /**
* 修改包件签收状态 * 修改包件签收状态
*/ */
@ -2045,7 +2061,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}); });
// if(!scanEntityList.isEmpty()){ // if(!scanEntityList.isEmpty()){
// distributionBillLadingScanService.saveBatch(scanEntityList); // distributionBillLadingScanService.saveBatch(scanEntityList);
// } // }
@ -2054,8 +2069,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
} }
@Override @Override
public DistrilbutionBillLadingVO listNum(Map<String, Object> distrilbutionBillLading) { public DistrilbutionBillLadingVO listNum(Map<String, Object> distrilbutionBillLading) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
@ -2223,6 +2236,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/** /**
* 零担的包件物料数据查询 * 零担的包件物料数据查询
*
* @param billLadingAppDTO * @param billLadingAppDTO
* @return * @return
*/ */
@ -2260,6 +2274,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/** /**
* 零担批量签收 * 零担批量签收
*
* @param billLadingAppDTO * @param billLadingAppDTO
* @return * @return
*/ */
@ -2346,6 +2361,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/** /**
* 查询订单信息 * 查询订单信息
*
* @param billLadingAppDTO * @param billLadingAppDTO
* @return * @return
*/ */
@ -2387,6 +2403,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/** /**
* 零担单个签收 * 零担单个签收
*
* @param billLadingAppDTO * @param billLadingAppDTO
* @return * @return
*/ */
@ -2475,6 +2492,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/** /**
* 添加自提图片 * 添加自提图片
*
* @param billLadingAppDTO * @param billLadingAppDTO
* @return * @return
*/ */
@ -2528,6 +2546,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/** /**
* 查询自提签收图片 * 查询自提签收图片
*
* @param billLadingAppDTO * @param billLadingAppDTO
* @return * @return
*/ */
@ -2562,6 +2581,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
/** /**
* 修改订单状态 * 修改订单状态
*
* @return * @return
*/ */
public Boolean updateStockArticle(Integer sum, Long stockArticleId) { public Boolean updateStockArticle(Integer sum, Long stockArticleId) {

Loading…
Cancel
Save