diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/OldSystemDataPushConfig.java b/blade-biz-common/src/main/java/org/springblade/common/constant/OldSystemDataPushConfig.java index 3118eb3fa..f305700d5 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/OldSystemDataPushConfig.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/OldSystemDataPushConfig.java @@ -103,6 +103,9 @@ public class OldSystemDataPushConfig { //仁寿欧派大家居 warehourseIds.add("127"); + //生活家成都仓 + warehourseIds.add("71"); + } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java index ec786854c..557f082fb 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java @@ -284,5 +284,8 @@ public interface IDistributionParcelListClient { */ @GetMapping(API_PREFIX + "/findOrderInfoByOrderPackageCode") Map findOrderInfoByOrderPackageCode(@RequestParam("orderPackageCode") String orderPackageCode,@RequestParam("warehouseId") Long warehouseId); + + @PostMapping(API_PREFIX + "/deleteListByParcelListIds") + void deleteListByParcelListIds(@RequestBody List deleteParcelListIds); } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelNumberClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelNumberClient.java index 9994502eb..859d29bab 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelNumberClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelNumberClient.java @@ -65,4 +65,7 @@ public interface IDistributionParcelNumberClient { @GetMapping(API_PREFIX+"/addHandleQuantity") void addHandleQuantity(@RequestParam Long packageId, @RequestParam int num); + + @GetMapping(API_PREFIX+"/updateListByPracelListIds") + void updateListByPracelListIds(@RequestParam List updateNumberIds); } diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java index f498609d0..4737ee5fa 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java @@ -65,6 +65,10 @@ public interface IWarehouseWaybillDetailClient { @PostMapping(API_PREFIX+"/addEntity") void addEntity(@RequestBody WarehouseWayBillDetail warehouseWayBillDetail); + + @PostMapping(API_PREFIX+"/addEntityReturnId") + Long addEntityReturnId(@RequestBody WarehouseWayBillDetail warehouseWayBillDetail); + @PostMapping(API_PREFIX+"/findByWaybillIds") List findByWaybillIds(@RequestBody List waybillIds); @PostMapping(API_PREFIX+"/deleteByWaybillNo") diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java index e0388296c..57ae32ce5 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java @@ -175,10 +175,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl zeroPackageDTOS = abnormalRecordDTO.getZeroPackageDTOS(); - if(CollUtil.isEmpty(zeroPackageDTOS)){ - log.warn("################dealAbnormal: 品类信息不存在"); - return R.fail(405,"品类信息不存在"); - } + Integer num = abnormalRecordEntity.getNum(); Long carsLoadScanId = abnormalRecordEntity.getAssociationId(); TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanClient.findEntityById(carsLoadScanId); @@ -203,6 +200,10 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl packageDataList = new ArrayList<>(); + if(CollUtil.isEmpty(zeroPackageDTOS)){ + log.warn("################dealAbnormal: 品类信息不存在"); + return R.fail(405,"品类信息不存在"); + } //入库本仓 Integer enterNum = abnormalRecordDTO.getNum(); //把scanZeroDetailEntityList转化成以packageId为key的map diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java index 8f32ae7da..1c46246c6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java @@ -585,4 +585,11 @@ public class DistributionParcelListClient implements IDistributionParcelListClie public Map findOrderInfoByOrderPackageCode(String orderPackageCode, Long warehouseId) { return distributionParcelListService.findOrderInfoByOrderPackageCode(orderPackageCode,warehouseId); } + + @Override + public void deleteListByParcelListIds(List deleteParcelListIds) { + distributionParcelListService.deleteListByParcelListIds(deleteParcelListIds); + distributionParcelNumberService.deleteListByParcelListIds(deleteParcelListIds); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelNumberClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelNumberClient.java index f220f4d0d..1355cf6c3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelNumberClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelNumberClient.java @@ -82,4 +82,9 @@ public class DistributionParcelNumberClient implements IDistributionParcelNumber distributionParcelNumberService.addZeroQuantity(packageId, num); } + @Override + public void updateListByPracelListIds(List updateNumberIds) { + distributionParcelNumberService.updateListByPracelListIds(updateNumberIds); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java index e809cb894..5bd59c770 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java @@ -313,4 +313,6 @@ public interface DistributionParcelListMapper extends BaseMapper parceListIds); Map findOrderInfoByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode, @Param("warehouseId") Long warehouseId); + + void deleteListByParcelListIds(@Param("parceListIds") List deleteParcelListIds); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 42463486b..b6f547a73 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -1962,4 +1962,12 @@ + + delete from logpm_distribution_parcel_list + where id in + + #{item} + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java index 13a37a426..763753a5f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java @@ -76,4 +76,6 @@ public interface DistributionParcelNumberMapper extends BaseMapper deleteParcelListIds); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml index 913d53953..c65c3a54b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml @@ -86,4 +86,12 @@ parcel_list_id = #{packageId} + + delete from logpm_distribution_parcel_number + where parcel_list_id in + + #{item} + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index 929d55168..c007600d2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -286,4 +286,6 @@ public interface IDistributionParcelListService extends BaseService findOrderInfoByOrderPackageCode(String orderPackageCode, Long warehouseId); void updateEntityByOpenOrderByAdvanceIds(UpdateOrderDTO updateOrderDTO); + + void deleteListByParcelListIds(List deleteParcelListIds); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelNumberService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelNumberService.java index 76284d1b8..a740206b5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelNumberService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelNumberService.java @@ -81,4 +81,7 @@ public interface IDistributionParcelNumberService extends BaseService deleteParcelListIds); + + void updateListByPracelListIds(List updateNumberIds); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java index a28c97c8a..6de4c6c23 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java @@ -1520,4 +1520,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl deleteParcelListIds) { + baseMapper.deleteListByParcelListIds(deleteParcelListIds); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java index f4565d1f5..2aab33a01 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java @@ -17,6 +17,7 @@ package com.logpm.distribution.service.impl; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.logpm.distribution.dto.DistributionParcelNumberDTO; @@ -38,7 +39,10 @@ import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; /** * 订单零担包件数量记录 服务实现类 @@ -178,4 +182,29 @@ public class DistributionParcelNumberServiceImpl extends BaseServiceImpl deleteParcelListIds) { + baseMapper.deleteListByParcelListIds(deleteParcelListIds); + } + + @Override + public void updateListByPracelListIds(List updateNumberIds) { + List distributionParcelListEntities = distributionParcelListService.listByIds(updateNumberIds); + //转化成以id为key的Map + Map parcelListMap = distributionParcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, parcelListEntity -> parcelListEntity)); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in("parcel_list_id", updateNumberIds); + List distributionParcelNumberEntities = baseMapper.selectList(queryWrapper); + distributionParcelNumberEntities.forEach(p->{ + Long parcelListId = p.getParcelListId(); + DistributionParcelListEntity parcelList = parcelListMap.get(parcelListId); + if(!Objects.isNull(parcelList)){ + p.setQuantity(parcelList.getQuantity()); + p.setHandQuantity(parcelList.getQuantity()); + } + }); + updateBatchById(distributionParcelNumberEntities); + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml index 7b80290d1..cb0824de1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml @@ -502,16 +502,16 @@ and ltcl.arrive_time <= #{param.arriveTimeEnd} - and ltcl.arrive_time >= #{param.carrierTimeStart} + and ltcl.carrier_time >= #{param.carrierTimeStart} - and ltcl.arrive_time <= #{param.carrierTimeEnd} + and ltcl.carrier_time <= #{param.carrierTimeEnd} - and ltcl.arrive_time >= #{param.signTimeStart} + and ltcl.sign_time >= #{param.signTimeStart} - and ltcl.arrive_time <= #{param.signTimeEnd} + and ltcl.sign_time <= #{param.signTimeEnd} group by ltcl.id order by ltcl.create_time desc diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 9fbb945cb..2b1542340 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -2478,33 +2478,35 @@ public class OpenOrderServiceImpl implements IOpenOrderService { log.warn("#############updateWaybill: 运单已作废 waybillId={}", waybillId); return R.fail(405, "运单已作废"); } + Integer checkStatus = waybillEntity.getCheckStatus(); + if(checkStatus.equals(1)){ + log.warn("#############updateWaybill: 运单已审核 waybillId={}", waybillId); + return R.fail(405, "运单已审核,不能改单"); + } + Integer waybillType = waybillEntity.getWaybillType(); if(waybillType.equals(2)){ //零担改单限制 Long departureWarehouseId = waybillEntity.getDepartureWarehouseId(); Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId(); Integer totalCount = waybillEntity.getTotalCount(); - DistributionStockArticleEntity startStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, departureWarehouseId); - if(Objects.isNull(startStockArticleEntity)){ - log.warn("#############updateWaybill: 订单信息不存在 waybillId={}", waybillId); - return R.fail(405, "订单信息不存在"); - } - Integer handQuantity = startStockArticleEntity.getHandQuantity(); - if(NumberUtil.equals(handQuantity,0)){ - DistributionStockArticleEntity endStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, destinationWarehouseId); - if(Objects.isNull(endStockArticleEntity)){ + DistributionStockArticleEntity endStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, destinationWarehouseId); + if(Objects.isNull(endStockArticleEntity)){ + DistributionStockArticleEntity startStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, departureWarehouseId); + if(Objects.isNull(startStockArticleEntity)){ log.warn("#############updateWaybill: 订单信息不存在! waybillId={}", waybillId); return R.fail(405, "订单信息不存在!"); } - handQuantity = endStockArticleEntity.getHandQuantity(); + Integer handQuantity = startStockArticleEntity.getHandQuantity(); if(!NumberUtil.equals(handQuantity,totalCount)){ - log.warn("#############updateWaybill: 目的仓数据还未完全到达 waybillId={}", waybillId); - return R.fail(405, "目的仓数据还未完全到达"); + log.warn("#############updateWaybill: 始发仓数据已发运 waybillId={}", waybillId); + return R.fail(405, "始发仓数据已发运"); } }else{ + Integer handQuantity = endStockArticleEntity.getHandQuantity(); if(!NumberUtil.equals(handQuantity,totalCount)){ - log.warn("#############updateWaybill: 始发仓数据已发运 waybillId={}", waybillId); - return R.fail(405, "始发仓数据已发运"); + log.warn("#############updateWaybill: 目的仓数据还未完全到达 waybillId={}", waybillId); + return R.fail(405, "目的仓数据还未完全到达"); } } } @@ -2637,10 +2639,22 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } }else if(waybillType == 2){ + List addList = openOrderDTO.getAddList(); + //把addList中updateType=1的放入一个新的List + List addNewList = addList.stream().filter(waybillDetailDTO -> waybillDetailDTO.getUpdateType() == 1).collect(Collectors.toList()); + + + List orderList = distributionStockArticleClient.findListByWaybillNumber(waybillNo); orderList.forEach(stockArticleEntity -> { stockArticleEntity.setMallId(consigneeId); + stockArticleEntity.setDescriptionGoods(waybillEntity.getGoodsName()); stockArticleEntity.setTotalNumber(totalCount); + Integer handQuantity = stockArticleEntity.getHandQuantity(); + if(handQuantity != 0){ + stockArticleEntity.setHandQuantity(totalCount); + } + if(!Objects.isNull(basicdataClientEntity)){ stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode()); }else{ @@ -2663,18 +2677,53 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } }); + List removeList = openOrderDTO.getRemoveList(); + + List updateNumberIds = new ArrayList<>(); + + + //把addList中updateType=2的元素的id放入一个新的List + List updateList = addList.stream().filter(waybillDetailDTO -> waybillDetailDTO.getUpdateType() == 2).collect(Collectors.toList()); + //把updateList转化成以id为key的Map + Map updateMap = updateList.stream().collect(Collectors.toMap(WaybillDetailDTO::getId, Function.identity())); + + + + List deleteParcelListIds = new ArrayList<>(); + List removeIds = new ArrayList<>(); + if(CollUtil.isNotEmpty(removeList)){ + //把removeList中所有id放入一个List + List list = removeList.stream().map(WaybillDetailDTO::getId).collect(Collectors.toList()); + removeIds.addAll(list); + } + List parcelListEntityList = distributionParcelListClient.findByWaybillNumber(waybillNo); parcelListEntityList.forEach(parcelListEntity -> { Long nowWarehouseId = parcelListEntity.getWarehouseId(); - parcelListEntity.setSendWarehouseId(departureWarehouseId); - parcelListEntity.setSendWarehouseName(departureWarehouseName); - parcelListEntity.setAcceptWarehouseId(destinationWarehouseId); - parcelListEntity.setAcceptWarehouseName(destinationWarehouseName); - - if(nowWarehouseId.equals(destinationWarehouseId)){ - parcelListEntity.setIsTransfer(0); + Long advanceId = parcelListEntity.getAdvanceId(); + Long id = parcelListEntity.getId(); + if(removeIds.contains(advanceId)){ + deleteParcelListIds.add(id); }else{ - parcelListEntity.setIsTransfer(1); + WaybillDetailDTO waybillDetailDTO = updateMap.get(advanceId); + if(!Objects.isNull(waybillDetailDTO)){ + parcelListEntity.setFirsts(waybillDetailDTO.getGoodsName()); + Integer quantity = parcelListEntity.getQuantity(); + if(quantity != 0){ + parcelListEntity.setQuantity(waybillDetailDTO.getNum()); + } + updateNumberIds.add(id); + } + parcelListEntity.setSendWarehouseId(departureWarehouseId); + parcelListEntity.setSendWarehouseName(departureWarehouseName); + parcelListEntity.setAcceptWarehouseId(destinationWarehouseId); + parcelListEntity.setAcceptWarehouseName(destinationWarehouseName); + + if(nowWarehouseId.equals(destinationWarehouseId)){ + parcelListEntity.setIsTransfer(0); + }else{ + parcelListEntity.setIsTransfer(1); + } } }); @@ -2685,6 +2734,80 @@ public class OpenOrderServiceImpl implements IOpenOrderService { distributionParcelListClient.updateList(parcelListEntityList); } + + List addNewNumberList = new ArrayList<>(); + + orderList.forEach(stockArticleEntity -> { + Integer handQuantity = stockArticleEntity.getHandQuantity(); + + + addNewList.forEach(waybillDetailDTO->{ + DistributionParcelListEntity entity = new DistributionParcelListEntity(); + entity.setBrandName(stockArticleEntity.getBrand()); + entity.setDealerName(stockArticleEntity.getConsigneeUnit()); + entity.setFirsts(waybillDetailDTO.getGoodsName()); + Long warehouseId1 = stockArticleEntity.getWarehouseId(); + entity.setWarehouseId(warehouseId1); + entity.setWarehouse(stockArticleEntity.getWarehouse()); + if(handQuantity != 0){ + entity.setQuantity(waybillDetailDTO.getNum()); + }else{ + entity.setQuantity(0); + } + entity.setConditions(3); + entity.setStockArticleId(stockArticleEntity.getId()); + entity.setOrderCode(stockArticleEntity.getOrderCode()); + entity.setOrderPackageStatus("20"); + entity.setOrderPackageFreezeStatus("10"); + entity.setOrderPackageGroundingStatus("10"); + entity.setOrderPackageStockupStatus("10"); + entity.setOrderPackageReservationStatus("10"); + entity.setOrderPackageLoadingStatus("10"); + entity.setWaybillId(waybillId); + entity.setWaybillNumber(waybillNo); + entity.setIsZero("1"); + entity.setAdvanceId(waybillDetailDTO.getId()); + entity.setWarehouseEntryTimeEnd(new Date()); + entity.setSendWarehouseId(departureWarehouseId); + entity.setSendWarehouseName(departureWarehouseName); + entity.setAcceptWarehouseId(destinationWarehouseId); + entity.setAcceptWarehouseName(destinationWarehouseName); + if (departureWarehouseId.equals(destinationWarehouseId)) { + entity.setIsTransfer(0); + } else { + entity.setIsTransfer(1); + } + + Long aLong = distributionParcelListClient.addReturnId(entity); + + DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity(); + parcelNumberEntity.setStockArticleId(entity.getStockArticleId()); + parcelNumberEntity.setWarehouseId(entity.getWarehouseId()); + parcelNumberEntity.setParcelListId(aLong); + parcelNumberEntity.setHandQuantity(entity.getQuantity()); + parcelNumberEntity.setQuantity(entity.getQuantity()); + parcelNumberEntity.setDeliveryQuantity(0); + parcelNumberEntity.setSigninQuantity(0); + parcelNumberEntity.setOutboundQuantity(0); + addNewNumberList.add(parcelNumberEntity); + + + }); + + }); + + if(CollUtil.isNotEmpty(addNewNumberList)){ + distributionParcelNumberClient.addBatch(addNewNumberList); + } + + if(CollUtil.isNotEmpty(deleteParcelListIds)){ + distributionParcelListClient.deleteListByParcelListIds(deleteParcelListIds); + } + + if(CollUtil.isNotEmpty(updateNumberIds)){ + distributionParcelNumberClient.updateListByPracelListIds(updateNumberIds); + } + } trunklineWaybillPackageService.updateWaybillStatus(waybillEntity); @@ -4842,10 +4965,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService { if (StringUtil.isNotBlank(removeMsg)) { stringBuilder.append("明细移除:").append(removeMsg).append(";"); } - + Integer totalNum = 0; + Set goodsList = new HashSet<>(); List addList = openOrderDTO.getAddList(); for (WaybillDetailDTO waybillDetailDTO : addList) { - + Integer num1 = waybillDetailDTO.getNum(); + String goodsName = waybillDetailDTO.getGoodsName(); + goodsList.add(goodsName); + totalNum = totalNum + num1; Integer updateType = waybillDetailDTO.getUpdateType(); if (1 == updateType) { @@ -4867,7 +4994,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService { warehouseWayBillDetail.setSystemDeliveryChargeType(waybillDetailDTO.getSystemDeliveryChargeType()); warehouseWayBillDetail.setSystemPickupChargeType(waybillDetailDTO.getSystemPickupChargeType()); warehouseWayBillDetail.setSystemWarehouseChargeType(waybillDetailDTO.getSystemWarehouseChargeType()); - warehouseWaybillDetailClient.addEntity(warehouseWayBillDetail); + Long waybillDetailId = warehouseWaybillDetailClient.addEntityReturnId(warehouseWayBillDetail); + waybillDetailDTO.setId(waybillDetailId); + stringBuilder.append("明细新增:").append(warehouseWayBillDetail.getProductName()).append(" 数量 ").append(waybillDetailDTO.getNum()).append(" 单价 ").append(waybillDetailDTO.getPrice()).append(";"); } else if (2 == updateType) { @@ -4944,12 +5073,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService { warehouseWaybillDetailClient.updateEntityById(warehouseWayBillDetail); } } + waybillEntity.setGoodsName(String.join(",",goodsList)); Integer newTotalCount = openOrderDTO.getTotalCount(); Integer totalCount = waybillEntity.getTotalCount(); - if (!ObjectUtil.equals(totalCount,newTotalCount)) { - stringBuilder.append("货物总数:").append(totalCount).append("-->").append(newTotalCount).append(";"); - waybillEntity.setTotalCount(newTotalCount); + if (!ObjectUtil.equals(totalCount,totalNum)) { + stringBuilder.append("货物总数:").append(totalCount).append("-->").append(totalNum).append(";"); + waybillEntity.setTotalCount(totalNum); + waybillEntity.setStockCount(totalNum); } BigDecimal newTotalFreight = openOrderDTO.getTotalFreight(); @@ -5210,7 +5341,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { entity.setWarehouse(distributionStockArticleEntity.getWarehouse()); entity.setQuantity(warehouseWayBillDetail.getNum()); entity.setTrainNumber(warehouseWaybill.getCustomerTrain()); - entity.setConditions(1); + entity.setConditions(3); entity.setStockArticleId(orderId); entity.setOrderCode(distributionStockArticleEntity.getOrderCode()); entity.setOrderPackageStatus("20"); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index c179886c5..0732c2fd1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -2997,7 +2997,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIdList); //把zeroDetailVOList所有元素通过id分组 - Map> zeroDetailVOMap = zeroDetailVOList.stream().collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getId)); + Map> zeroDetailVOMap = zeroDetailVOList.stream().collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId)); for (UnloadZeroDTO unloadZeroDTO : unloadZeroList) { Long carsLoadScanId = unloadZeroDTO.getCarsLoadScanId(); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java index ea0859081..b4c8693f6 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java @@ -53,6 +53,12 @@ public class WarehouseWaybillDetailClient implements IWarehouseWaybillDetailClie warehouseWayBillDetailService.save(warehouseWayBillDetail); } + @Override + public Long addEntityReturnId(WarehouseWayBillDetail warehouseWayBillDetail) { + warehouseWayBillDetailService.save(warehouseWayBillDetail); + return warehouseWayBillDetail.getId(); + } + @Override public List findByWaybillIds(List waybillIds) { return warehouseWayBillDetailService.findByWaybillIds(waybillIds);