diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
index a4ee0e5a6..cb89d8718 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
@@ -616,28 +616,27 @@
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id
LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
- LEFT JOIN
- (SELECT ldsaa.id,SUM(ldpll.quantity) AS num
- FROM logpm_distribution_stock_article ldsaa
- LEFT JOIN logpm_distribution_parcel_list ldpll ON ldsaa.id = ldpll.stock_article_id
- WHERE ldpll.order_package_loading_status != '20'
- AND ldpll.order_package_reservation_status !='20'
- AND ldpll.order_package_status != '70'
- AND ldpll.conditions != 2
- AND ldsaa.warehouse_id = #{par.warehouseId}
- AND ldpll.warehouse_id = #{par.warehouseId}
- AND ldsaa.type_service = #{par.typeService}
-
- and ldsaa.order_code like concat(#{par.orderCode},'%')
-
- GROUP BY ldsaa.id
- )
- AS t ON t.id = ldsa.id
ldsa.order_status in ('10','20','30','70')
and ldsa.reservation_status in ('10','20')
- and t.num > 0
-
+ AND EXISTS (
+ SELECT 1
+ FROM logpm_distribution_parcel_list ldpll
+ WHERE
+ ldsa.id = ldpll.stock_article_id
+
+ AND ldpll.order_package_loading_status != '20'
+ AND ldpll.order_package_reservation_status != '20'
+ AND ldpll.order_package_status != '70'
+ AND ldpll.conditions != 2
+ AND ldpll.warehouse_id = #{par.warehouseId}
+ AND ldsa.type_service = #{par.typeService}
+
+ and ldpll.order_code like concat(#{par.orderCode},'%')
+
+ GROUP BY ldpll.stock_article_id
+ HAVING SUM(ldpll.quantity) > 0
+ )
AND ldsa.hand_quantity > 0
and ldsa.warehouse_id = #{par.warehouseId}
diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
index 62d9b0ff6..950a1d84d 100644
--- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
+++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
@@ -114,57 +114,57 @@ import java.util.stream.Collectors;
public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl implements IDistrilbutionBillLadingService {
@Autowired
- private IDistributionDeliveryChargeService distributionDeliveryChargeService;
+ private IDistributionDeliveryChargeService distributionDeliveryChargeService;
@Autowired
- private IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
+ private IDistributionDeliveryDetailsService distributionDeliveryDetailsService;
@Autowired
- private IDistributionReservationService distributionReservationService;
+ private IDistributionReservationService distributionReservationService;
@Autowired
- private IDistributionPrintService distributionPrintService;
+ private IDistributionPrintService distributionPrintService;
@Autowired
- private IDistributionStockArticleService distributionStockArticleService;
+ private IDistributionStockArticleService distributionStockArticleService;
@Autowired
- private IDistributionParcelListService distributionParcelListService;
+ private IDistributionParcelListService distributionParcelListService;
@Autowired
- private IDistributionBillLadingScanService distributionBillLadingScanService;
+ private IDistributionBillLadingScanService distributionBillLadingScanService;
@Autowired
- private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
+ private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper;
@Autowired
- private IDistrilbutionBillStockService distrilbutionBillStockService;
+ private IDistrilbutionBillStockService distrilbutionBillStockService;
@Autowired
- private IDistributionStockupScanService distributionStockupScanService;
+ private IDistributionStockupScanService distributionStockupScanService;
@Autowired
- private IDistributionStockListService distributionStockListService;
+ private IDistributionStockListService distributionStockListService;
@Autowired
- private DistributionStockListMapper distributionStockListMapper;
+ private DistributionStockListMapper distributionStockListMapper;
@Autowired
- private IDistributionAsyncService distributionAsyncService;
+ private IDistributionAsyncService distributionAsyncService;
@Autowired
- private IDistributionStockService distributionStockService;
+ private IDistributionStockService distributionStockService;
@Autowired
@Lazy
- private IDistributionStockupService distributionStockupService;
+ private IDistributionStockupService distributionStockupService;
@Autowired
- private IDistributionStockupInfoService distributionStockupInfoService;
+ private IDistributionStockupInfoService distributionStockupInfoService;
@Autowired
- private IBasicdataWarehouseClient basicdataWarehouseClient;
+ private IBasicdataWarehouseClient basicdataWarehouseClient;
@Autowired
- private IDistributionReservationZeroPackageService distributionZeroPackageService; //零担配送记录
+ private IDistributionReservationZeroPackageService distributionZeroPackageService; //零担配送记录
@Autowired
- private IDistributionParcelNumberService distributionParcelNumberService; //零担配送数量记录
+ private IDistributionParcelNumberService distributionParcelNumberService; //零担配送数量记录
@Autowired
- private IDistrilbutionBillPackageService distrilbutionBillPackageService;
+ private IDistrilbutionBillPackageService distrilbutionBillPackageService;
@Autowired
- private IBasicdataWarehouseClient warehouseClient;
+ private IBasicdataWarehouseClient warehouseClient;
@Autowired
- private IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
+ private IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
@Autowired
- private IDisStockListDetailService disStockListDetailService;
+ private IDisStockListDetailService disStockListDetailService;
@Autowired
- private BladeRedis redis;
+ private BladeRedis redis;
@Autowired
private IUserClient userClient;
@@ -374,15 +374,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl stockDTOList = distrilbutionBillLading.getStockDTOList();
- boolean flag = stockDTOList.stream().anyMatch(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity())|| distributionStockListDTO.getInventoryQuantity().equals(0));
- if (flag){
+ boolean flag = stockDTOList.stream().anyMatch(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity()) || distributionStockListDTO.getInventoryQuantity().equals(0));
+ if (flag) {
String collect = stockDTOList.stream().filter(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity())).map(DistributionStockListDTO::getIncomingBatch).collect(Collectors.joining(","));
- log.info("自提修改库存品未填写数量>>>未填写库存品批次号:{}",collect);
+ log.info("自提修改库存品未填写数量>>>未填写库存品批次号:{}", collect);
throw new RuntimeException("请填写正确的库存品数量");
}
//全部库存品数据
@@ -410,11 +410,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl> map = null;
- if (!listDetails.isEmpty()){
- map = listDetails.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId));
+ if (!listDetails.isEmpty()) {
+ map = listDetails.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId));
}
for (DistributionStockListDTO distributionStockListDTO : stockDTOList) {
- if (!map.isEmpty()){
+ if (!map.isEmpty()) {
DistributionDeliveryDetailsEntity distributionDeliveryDetailsEntity = map.get(distributionStockListDTO.getId()).get(0);
Integer quantity = distributionDeliveryDetailsEntity.getQuantity();
int i = quantity - distributionStockListDTO.getInventoryQuantity();
@@ -425,9 +425,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0){
+ if (i > 0) {
deliveryDetails.setQuantity(distributionDeliveryDetailsEntity.getQuantity() - i);
//减少
@@ -438,11 +438,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl !Func.isEmpty(f.getStockPackageCode())).mapToInt(DisStockListDetailEntity::getNum).sum();
- log.info("自提修改库存品>>>>>>>>当前计划数量:{},备货数量:{}",deliveryDetails.getQuantity(),sum);
+ log.info("自提修改库存品>>>>>>>>当前计划数量:{},备货数量:{}", deliveryDetails.getQuantity(), sum);
// 优先取消未备货
- if (sum > 0){
+ if (sum > 0) {
//存在备货
throw new RuntimeException("该库存品已备货无法减少");
// if (sum >= deliveryDetails.getQuantity()) {
@@ -453,7 +453,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl ids = stockListDetailEntities.subList(0, i).stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList());
disStockListDetailService.removeBatchByIds(ids);
@@ -463,15 +463,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl ids = new ArrayList<>();
//进行删除
- map.forEach((k,v)->{
+ map.forEach((k, v) -> {
ids.add(v.get(0).getId());
distributionAsyncService.getInventoryNumUpdate(k, v.get(0).getQuantity(), 2);
//删除
disStockListDetailService.remove(Wrappers.query().lambda()
- .eq(DisStockListDetailEntity::getReservationId,distrilbutionBillLading.getId())
- .eq(DisStockListDetailEntity::getStockListId,k)
- .eq(DisStockListDetailEntity::getStockPackageStatus,"2")
+ .eq(DisStockListDetailEntity::getReservationId, distrilbutionBillLading.getId())
+ .eq(DisStockListDetailEntity::getStockListId, k)
+ .eq(DisStockListDetailEntity::getStockPackageStatus, "2")
);
});
//删除没有的库存品
@@ -670,7 +670,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = distrilbutionBillStockService.list(Wrappers.query().lambda()
.eq(!distrilbutionBillLading.getStockArticleId().contains(","), DistrilbutionBillStockEntity::getStockArticleId, distrilbutionBillLading.getStockArticleId())
.in(distrilbutionBillLading.getStockArticleId().contains(","), DistrilbutionBillStockEntity::getStockArticleId, distrilbutionBillLading.getStockArticleId().split(","))
@@ -695,7 +695,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelLisList = distrilbutionBillLading.getParcelLisList();
- Map> packageMap =null;
- if (Func.isNotEmpty( distrilbutionBillLading.getBillPackageEntityList())){
- List packageEntityList= distrilbutionBillLading.getBillPackageEntityList();
+ Map> packageMap = null;
+ if (Func.isNotEmpty(distrilbutionBillLading.getBillPackageEntityList())) {
+ List packageEntityList = distrilbutionBillLading.getBillPackageEntityList();
List packageisd = packageEntityList.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList());
List distributionParcelListEntities = distributionParcelListService.listByIds(packageisd);
- if (Func.isNotEmpty(distributionParcelListEntities)){
+ if (Func.isNotEmpty(distributionParcelListEntities)) {
packageMap = distributionParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getStockArticleId));
}
}
Map> zeroPackageMap = null;
- if (Func.isNotEmpty( distrilbutionBillLading.getParcelLisList())){
+ if (Func.isNotEmpty(distrilbutionBillLading.getParcelLisList())) {
List zeroPackageList = distrilbutionBillLading.getParcelLisList();
zeroPackageMap = zeroPackageList.stream().collect(Collectors.groupingBy(DistributionParcelListDTO::getStockArticleId));
}
@@ -733,11 +732,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
@@ -763,7 +762,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
@@ -792,7 +791,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0 || Func.isEmpty(distributionParcelListDTO.getQuantity()) ){
+ if (distributionParcelListDTO.getQuantity() > 0 || Func.isEmpty(distributionParcelListDTO.getQuantity())) {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setParcelListId(distributionParcelListDTO.getId());
distributionReservationZeroPackageEntity.setCategoryName(distributionParcelListDTO.getFirsts());
@@ -839,16 +838,16 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl zeroOrderDetail = distributionStockArticleService.getZeroOrderDetail(Long.parseLong(s));
- if (Func.isNotEmpty(zeroOrderDetail)){
+ if (Func.isNotEmpty(zeroOrderDetail)) {
for (DistributionParcelNumberVO distributionParcelNumberVO : zeroOrderDetail) {
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
distributionReservationZeroPackageEntity.setRealityQuantity(0);
@@ -868,18 +867,18 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelNumberEntityList = distributionParcelNumberService.list(Wrappers.query().lambda()
.in(DistributionParcelNumberEntity::getParcelListId, zeroPackageIds)
);
List ids = parcelNumberEntityList.stream().filter(f -> f.getQuantity() == (f.getOutboundQuantity() + f.getDeliveryQuantity())).map(DistributionParcelNumberEntity::getParcelListId).collect(Collectors.toList());
packageIds.addAll(ids);
}
- if (!Func.isEmpty(packageIds)){
+ if (!Func.isEmpty(packageIds)) {
distributionParcelListService.update(new UpdateWrapper().lambda()
- .in(DistributionParcelListEntity::getId,packageIds)
- .set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.yiyueyue.getValue())
+ .in(DistributionParcelListEntity::getId, packageIds)
+ .set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
);
}
- distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId());
+ distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), stockArticleEntity.getWarehouseId());
}
- if (Func.isNotEmpty(packageEntityList)){
+ if (Func.isNotEmpty(packageEntityList)) {
distrilbutionBillPackageService.saveBatch(packageEntityList);
}
}
-
-
//操作图片
if (!distrilbutionBillLading.getPrintList().isEmpty()) {
addPrint(distrilbutionBillLading);
}
if (!distrilbutionBillLading.getStockDTOList().isEmpty()) {
boolean flag = distrilbutionBillLading.getStockDTOList().stream().anyMatch(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity()) || distributionStockListDTO.getInventoryQuantity().equals(0));
- if (flag){
+ if (flag) {
String collect = distrilbutionBillLading.getStockDTOList().stream().filter(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity())).map(DistributionStockListDTO::getIncomingBatch).collect(Collectors.joining(","));
- log.info("自提添加库存品未填写数量>>>未填写库存品批次号:{}",collect);
+ log.info("自提添加库存品未填写数量>>>未填写库存品批次号:{}", collect);
throw new RuntimeException("请填写正确的库存品数量");
}
//没有
@@ -968,8 +965,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImplupdate().lambda()
- .eq(DistributionDeliveryChargeEntity::getBillLading,distrilbutionBillLading.getId())
- .set(DistributionDeliveryChargeEntity::getIsDeleted,1)
+ .eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLading.getId())
+ .set(DistributionDeliveryChargeEntity::getIsDeleted, 1)
);
List listEntity = new ArrayList<>();
distrilbutionBillLading.getFei().forEach((k, v) -> {
@@ -986,8 +983,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = Func.toLongList(distrilbutionBillLading.getPackageIds());
List distributionParcelListEntities = distributionParcelListService.listByIds(list);
- if (distributionParcelListEntities.isEmpty()){
+ if (distributionParcelListEntities.isEmpty()) {
//查询包件信息失败
- log.error(method+"查询包件信息失败PackageIds:{}",distrilbutionBillLading.getPackageIds());
+ log.error(method + "查询包件信息失败PackageIds:{}", distrilbutionBillLading.getPackageIds());
return R.fail("当前勾选存在包件数据错误,请联系管理员处理");
}
//校验包件是否具备被签收的性质
- if (distributionParcelListEntities.stream().anyMatch(p-> !OrderPackageStatusConstant.yiruku.getValue().equals(p.getOrderPackageStatus()))) {
+ if (distributionParcelListEntities.stream().anyMatch(p -> !OrderPackageStatusConstant.yiruku.getValue().equals(p.getOrderPackageStatus()))) {
String collect = distributionParcelListEntities.stream().filter(p -> !OrderPackageStatusConstant.yiruku.getValue().equals(p.getOrderPackageStatus())).map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
- log.error(method+"自提签收包件失败,不在库包件进行签收orderPackageCode:{}",collect);
+ log.error(method + "自提签收包件失败,不在库包件进行签收orderPackageCode:{}", collect);
return R.fail("当前勾选存在包件不在库,请核对和进行操作");
}
//进行订制品和零担的区分
Map> packageMap = distributionParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions));
List ladingScanEntities = new ArrayList<>();
- if (!packageMap.isEmpty()){
+ if (!packageMap.isEmpty()) {
// packageMap.forEach((k,v)->{
// switch (k){
// case 1:
@@ -1266,7 +1261,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl pushOldPackageSigning) {
for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) {
User user = redis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getAdministratorsId());
- log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user);
+ log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}", user);
if (user == null) {
R userT = userClient.userInfoById(signPushDataUnitDTO.getAdministratorsId());
if (userT.isSuccess()) {
@@ -1377,13 +1373,13 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>用户名称:{}",user.getName());
+ } else {
+ log.info("用户无电话号码且账号信息为空>>用户名称:{}", user.getName());
}
}
}
@@ -1399,7 +1395,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl customer) {
for (SignPushDataContactDTO signPushDataUnitDTO : customer) {
User user = redis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId());
- log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user);
+ log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}", user);
if (user == null) {
R userT = userClient.userInfoById(signPushDataUnitDTO.getSignUserId());
if (userT.isSuccess()) {
@@ -1410,15 +1406,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>用户名称:{}",user.getName());
+ } else {
+ log.info("用户无电话号码且账号信息为空>>用户名称:{}", user.getName());
}
}
}
@@ -1427,12 +1423,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl handleSignPackage(Map> packageMap,Long id,Long warehouseId){
+ public List handleSignPackage(Map> packageMap, Long id, Long warehouseId) {
String method = "###################DistributionBillLadingServiceImpl.handleSignPackage";
List ladingScanEntities = new ArrayList<>();
List orderCodes = new ArrayList<>();
- packageMap.forEach((k,v)->{
- switch (k){
+ packageMap.forEach((k, v) -> {
+ switch (k) {
case 1:
//定制品
for (DistributionParcelListEntity parcelListEntity : v) {
@@ -1449,10 +1445,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImplupdate().lambda()
- .eq(DistributionParcelListEntity::getId,parcelListEntity.getId())
- .set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.yiyueyue.getValue())
- .set(DistributionParcelListEntity::getOrderPackageLoadingStatus,OrderPackageLoadingStatusConstant.yizhuangche.getValue())
- .set(DistributionParcelListEntity::getOrderPackageStatus,OrderPackageStatusConstant.yiqianshou.getValue())
+ .eq(DistributionParcelListEntity::getId, parcelListEntity.getId())
+ .set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue())
+ .set(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue())
+ .set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue())
);
//维护订单
orderCodes.add(parcelListEntity.getOrderCode());
@@ -1474,8 +1470,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
//将这些包件还原成可操作状态
Integer num = distributionParcelListService.restorePakcageByIds(packageIds);
- log.info("######################取消自提单释放包件>>>>>:{}",num);
- ids.forEach(id ->{
+ log.info("######################取消自提单释放包件>>>>>:{}", num);
+ ids.forEach(id -> {
//查询自提单存在的零担订单
List reservationZeroPackageEntities = distributionZeroPackageService.list(Wrappers.query().lambda()
.eq(DistributionReservationZeroPackageEntity::getReservationId, id)
.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "2")
);
- if (Func.isNotEmpty(reservationZeroPackageEntities)){
+ if (Func.isNotEmpty(reservationZeroPackageEntities)) {
List collect = reservationZeroPackageEntities.stream().map(DistributionReservationZeroPackageEntity::getStockArticleId).distinct().collect(Collectors.toList());
//释放零担资源
- distributionZeroPackageService.recoverZeroPackage(id,collect);
+ distributionZeroPackageService.recoverZeroPackage(id, collect);
}
});
//维护订单状态
@@ -1738,21 +1734,21 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionParcelListService.listByIds(packageIds);
String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).collect(Collectors.joining(","));
List warehouseIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getWarehouseId).distinct().collect(Collectors.toList());
- if (!warehouseIds.isEmpty()){
- if (warehouseIds.size() == 1){
- distributionStockArticleService.maintenanceOrderInfo(orderCodes,warehouseIds.get(0));
- }else {
- log.error("#################自提订制品包件缺失warehouseId错误warehouseIds:{}",warehouseIds);
+ if (!warehouseIds.isEmpty()) {
+ if (warehouseIds.size() == 1) {
+ distributionStockArticleService.maintenanceOrderInfo(orderCodes, warehouseIds.get(0));
+ } else {
+ log.error("#################自提订制品包件缺失warehouseId错误warehouseIds:{}", warehouseIds);
throw new ServiceException("修改失败!!!");
}
- }else {
- log.error("#################自提订制品包件缺失warehouseId信息packageIds:{}",packageIds);
+ } else {
+ log.error("#################自提订制品包件缺失warehouseId信息packageIds:{}", packageIds);
throw new ServiceException("修改失败!!!");
}
}
@@ -1795,17 +1791,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0) {
//减少了
distributionParcelNumberService.updateBillNum(i.getParcelListId(), i1, 1);
} else if (i1 < 0) {
//增加了
- distributionParcelNumberService.updateBillNum(i.getParcelListId(),i1, 1);
+ distributionParcelNumberService.updateBillNum(i.getParcelListId(), i1, 1);
} else {
//不做操作!
iterator.remove();
@@ -1822,26 +1818,26 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionStockArticleEntities = collect.get(i.getStockArticleId());
- if (Func.isEmpty(distributionStockArticleEntities)){
+ if (Func.isEmpty(distributionStockArticleEntities)) {
longs.add(i.getParcelListId());
}
}
}
List distributionStockArticleEntities = collect.get(i.getStockArticleId());
- if (!Func.isEmpty(distributionStockArticleEntities)){
+ if (!Func.isEmpty(distributionStockArticleEntities)) {
String orderCode = distributionStockArticleEntities.get(0).getOrderCode();
Long warehouseId = distributionStockArticleEntities.get(0).getWarehouseId();
- log.info("#############维护零担订单信息:{},:{}",orderCode,warehouseId);
- distributionStockArticleService.maintenanceOrderInfo(orderCode,warehouseId);
+ log.info("#############维护零担订单信息:{},:{}", orderCode, warehouseId);
+ distributionStockArticleService.maintenanceOrderInfo(orderCode, warehouseId);
}
});
if (!longs.isEmpty()) {
// distributionZeroPackageService.deleteLogic(longs);
//进行零担在库数量恢复
- distributionZeroPackageService.recoverZeroPackage(distrilbutionBillLadingDTO.getId(),longs);
+ distributionZeroPackageService.recoverZeroPackage(distrilbutionBillLadingDTO.getId(), longs);
// distributionZeroPackageService.cancelZeroPackage(longs);
}
@@ -1874,7 +1870,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl stockArticleList = distrilbutionBillLading.getStockArticleList();
@@ -1886,49 +1882,49 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl orderIds = new ArrayList<>();
//订制品选择包件
Map> packageMap = null;
- if (Func.isNotEmpty(distrilbutionBillLading.getBillPackageEntityList())){
- packageMap = distrilbutionBillLading.getBillPackageEntityList().stream().collect(Collectors.groupingBy(DistrilbutionBillPackageEntity::getStockArticleId));
+ if (Func.isNotEmpty(distrilbutionBillLading.getBillPackageEntityList())) {
+ packageMap = distrilbutionBillLading.getBillPackageEntityList().stream().collect(Collectors.groupingBy(DistrilbutionBillPackageEntity::getStockArticleId));
}
//零担包件信息
- Map> zerpPackageMap = null;
- if (Func.isNotEmpty( distrilbutionBillLading.getParcelLisList())){
- zerpPackageMap = distrilbutionBillLading.getParcelLisList().stream().collect(Collectors.groupingBy(DistributionParcelListDTO::getStockArticleId));
+ Map> zerpPackageMap = null;
+ if (Func.isNotEmpty(distrilbutionBillLading.getParcelLisList())) {
+ zerpPackageMap = distrilbutionBillLading.getParcelLisList().stream().collect(Collectors.groupingBy(DistributionParcelListDTO::getStockArticleId));
}
//收集需要进行维护的订单
List orderCodes = new ArrayList<>();
- stockArticleList.forEach(s->{
- if (!entityList.isEmpty()){
+ stockArticleList.forEach(s -> {
+ if (!entityList.isEmpty()) {
boolean flag = entityList.stream().anyMatch(a -> s.getId().equals(a.getStockArticleId()));
- if (flag){
+ if (flag) {
//存在计划中
Iterator iterator = entityList.iterator();
- while (iterator.hasNext()){
+ while (iterator.hasNext()) {
DistrilbutionBillStockEntity next = iterator.next();
- if (next.getStockArticleId().equals(s.getId())){
+ if (next.getStockArticleId().equals(s.getId())) {
iterator.remove();
}
}
- }else {
+ } else {
orderIds.add(s.getId());
}
- }else {
+ } else {
//整单新增
orderIds.add(s.getId());
}
});
- //取消订单
- if (!entityList.isEmpty()){
+ //取消订单
+ if (!entityList.isEmpty()) {
for (DistrilbutionBillStockEntity distrilbutionBillStock : entityList) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distrilbutionBillStock.getStockArticleId());
- if (Func.isEmpty(stockArticleEntity)){
+ if (Func.isEmpty(stockArticleEntity)) {
//订单数据错误
- log.error(">>>>>>>>>>>>>>>>>>>>>自提取消订单错误stockArticleEntityId:{}",distrilbutionBillStock.getStockArticleId());
+ log.error(">>>>>>>>>>>>>>>>>>>>>自提取消订单错误stockArticleEntityId:{}", distrilbutionBillStock.getStockArticleId());
return false;
}
//查询是取消零担还是取消订制品
- if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())){
+ if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())) {
distrilbutionBillPackageService.update(Wrappers.update()
.eq("stock_article_id", distrilbutionBillStock.getStockArticleId())
.eq("bill_lading_id", distrilbutionBillStock.getBillLadingId())
@@ -1968,38 +1964,38 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageEntityList = new ArrayList<>();
//剩下的计划内就是需要进行取消的
//订单新增
- if (!orderIds.isEmpty()){
+ if (!orderIds.isEmpty()) {
List addOrderIds = new ArrayList<>();
List zeroOrderIds = new ArrayList<>();
for (Long orderId : orderIds) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId);
- if (Func.isEmpty(stockArticleEntity)){
+ if (Func.isEmpty(stockArticleEntity)) {
return false;
}
- if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())){
+ if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())) {
//定制品
- if (Func.isNotEmpty(packageMap)){
+ if (Func.isNotEmpty(packageMap)) {
//订制品都未进行包件的选择,需要对新增的订单进行可用包件全部添加
- if (Func.isEmpty(packageMap.get(stockArticleEntity.getId()))){
+ if (Func.isEmpty(packageMap.get(stockArticleEntity.getId()))) {
//对该订单下所有包件进行计划的添加
addOrderIds.add(stockArticleEntity.getId());
}
- }else {
+ } else {
//对该订单下所有包件进行计划的添加
addOrderIds.add(stockArticleEntity.getId());
}
- }else if (IsOrNoConstant.yes.getValue().equals(stockArticleEntity.getIsZero())){
+ } else if (IsOrNoConstant.yes.getValue().equals(stockArticleEntity.getIsZero())) {
//零担
- if (Func.isNotEmpty(zerpPackageMap)){
- if (Func.isEmpty(zerpPackageMap.get(stockArticleEntity.getId()))){
+ if (Func.isNotEmpty(zerpPackageMap)) {
+ if (Func.isEmpty(zerpPackageMap.get(stockArticleEntity.getId()))) {
//未进行数量录入操作
zeroOrderIds.add(stockArticleEntity.getId());
}
- }else {
+ } else {
zeroOrderIds.add(stockArticleEntity.getId());
}
- }else{
- log.info("####################3订单缺失IsZero字段:{}",stockArticleEntity.getId());
+ } else {
+ log.info("####################3订单缺失IsZero字段:{}", stockArticleEntity.getId());
return false;
}
DistrilbutionBillStockEntity distrilbutionBillStock = new DistrilbutionBillStockVO();
@@ -2011,7 +2007,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda()
@@ -2021,8 +2017,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl{
+ if (!Func.isEmpty(parcelListEntities)) {
+ parcelListEntities.forEach(p -> {
DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity();
billPackageEntity.setBillLadingId(distrilbutionBillLading.getId());
billPackageEntity.setParceListId(p.getId());
@@ -2039,23 +2035,23 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl zeroPackageEntities = new ArrayList<>();
- if (!zeroOrderIds.isEmpty()){
+ if (!zeroOrderIds.isEmpty()) {
//查询所有的零担信息
List parcelNumberEntityList = distributionParcelNumberService.list(Wrappers.query().lambda()
.in(DistributionParcelNumberEntity::getStockArticleId, zeroOrderIds)
.apply("(hand_quantity - delivery_quantity) >0")
);
- if (Func.isEmpty(parcelNumberEntityList)){
- log.error("#########################无可用包件orderIds:{}",zeroOrderIds);
+ if (Func.isEmpty(parcelNumberEntityList)) {
+ log.error("#########################无可用包件orderIds:{}", zeroOrderIds);
return false;
}
- parcelNumberEntityList.forEach(zp->{
+ parcelNumberEntityList.forEach(zp -> {
//查询包件
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(zp.getParcelListId());
DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity();
@@ -2065,8 +2061,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>>>>>>>>>零担品类增加计划数量getHandQuantity:{}getDeliveryQuantity:{}(zp.getHandQuantity() - zp.getDeliveryQuantity()):{}",zp.getHandQuantity(),zp.getDeliveryQuantity(),(zp.getHandQuantity() - zp.getDeliveryQuantity()));
- distributionParcelNumberService.updateBillNum(zp.getParcelListId(),(zp.getHandQuantity() - zp.getDeliveryQuantity()),1);
+ log.info(">>>>>>>>>>>>>>>>>>>>>>>>零担品类增加计划数量getHandQuantity:{}getDeliveryQuantity:{}(zp.getHandQuantity() - zp.getDeliveryQuantity()):{}", zp.getHandQuantity(), zp.getDeliveryQuantity(), (zp.getHandQuantity() - zp.getDeliveryQuantity()));
+ distributionParcelNumberService.updateBillNum(zp.getParcelListId(), (zp.getHandQuantity() - zp.getDeliveryQuantity()), 1);
});
List collect = parcelNumberEntityList.stream().map(DistributionParcelNumberEntity::getParcelListId).collect(Collectors.toList());
distributionParcelListService.update(Wrappers.update()
@@ -2076,23 +2072,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionStockArticleEntities = distributionStockArticleService.listByIds(cancelOrderIds);
- if (Func.isEmpty(distributionStockArticleEntities)){
- log.info("#####################查询订单失败,orderIds:{}",cancelOrderIds);
+ if (Func.isEmpty(distributionStockArticleEntities)) {
+ log.info("#####################查询订单失败,orderIds:{}", cancelOrderIds);
}
String orderCodes = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getOrderCode).collect(Collectors.joining(","));
List collect = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getWarehouseId).distinct().collect(Collectors.toList());
- if (collect.isEmpty()){
- log.info("#####################订单列表warehouseId字段缺失,orderIds:{}",cancelOrderIds);
+ if (collect.isEmpty()) {
+ log.info("#####################订单列表warehouseId字段缺失,orderIds:{}", cancelOrderIds);
return false;
}
- if (collect.size()>1){
- log.info("#####################自提操作多个仓库订单,orderIds:{}",cancelOrderIds);
+ if (collect.size() > 1) {
+ log.info("#####################自提操作多个仓库订单,orderIds:{}", cancelOrderIds);
return false;
}
- distributionStockArticleService.maintenanceOrderInfo(orderCodes,collect.get(0));
+ distributionStockArticleService.maintenanceOrderInfo(orderCodes, collect.get(0));
}
return true;
}
@@ -2261,10 +2255,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl pageList(IPage