From b247128f3ead3eb202e421d9474b6d96c4822bf1 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 8 Jul 2024 09:28:08 +0800 Subject: [PATCH] =?UTF-8?q?1.bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/entity/BasicTenantCodeEntity.java | 4 + .../vo/PriceDispatchAddClientVO.java | 50 ---------- .../com/logpm/trunkline/dto/LoadCarsDTO.java | 3 + .../vo/TrunklineBillladingWaybillVO.java | 1 + .../feign/IWarehouseTrayTypeClient.java | 4 + .../mapper/AftersalesAbnormalRecordMapper.xml | 4 +- .../impl/BasicdataCodeServiceImpl.java | 27 +++-- .../impl/BasicdataTrayServiceImpl.java | 7 +- .../distribution/dto/PushInstallDTO.java | 69 ------------- .../factory/aspect/JobAnnotationAspect.java | 5 - .../java/com/logpm/trunkline/bean/Resp.java | 9 ++ .../logpm/trunkline/dto/OrderDetailsDTO.java | 4 +- .../mapper/TrunklineAdvanceDetailMapper.xml | 12 ++- .../mapper/TrunklineBillladingMapper.xml | 4 +- .../TrunklineBillladingPackageMapper.java | 2 + .../TrunklineBillladingPackageMapper.xml | 9 ++ .../TrunklineBillladingWaybillMapper.xml | 18 ++-- .../mapper/TrunklineCarsLoadMapper.xml | 9 ++ .../mapper/TrunklineLoadSignOrderMapper.xml | 3 + .../ITrunklineBillladingPackageServicie.java | 3 + .../service/impl/InComingServiceImpl.java | 26 +++-- .../impl/OpenOrderAsyncServiceImpl.java | 24 +++-- .../service/impl/OpenOrderServiceImpl.java | 18 +++- .../TrunklineAdvanceDetailServiceImpl.java | 13 +++ .../impl/TrunklineAdvanceServiceImpl.java | 1 + ...TrunklineBillladingPackageServiceImpl.java | 79 +++++++++------ .../impl/TrunklineBillladingServiceImpl.java | 99 ++++++++++++------- .../impl/TrunklineCarsLoadServiceImpl.java | 78 +++++++++++++-- .../feign/WarehouseTrayTypeClient.java | 10 ++ 29 files changed, 355 insertions(+), 240 deletions(-) diff --git a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicTenantCodeEntity.java b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicTenantCodeEntity.java index d4de7f1b0..64e445d85 100644 --- a/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicTenantCodeEntity.java +++ b/blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/entity/BasicTenantCodeEntity.java @@ -65,6 +65,10 @@ public class BasicTenantCodeEntity extends TenantEntity implements Serializable @ApiModelProperty(value = "编码") private String code; + @JsonSerialize(using = ToStringSerializer.class) + @ApiModelProperty(value = "简称") + private String desName; + @ApiModelProperty(value = "预留1") private String reserve1; /** diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAddClientVO.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAddClientVO.java index 3cac4285a..e69de29bb 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAddClientVO.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/PriceDispatchAddClientVO.java @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * Neither the name of the dreamlu.net developer nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * Author: Chill 庄骞 (smallchill@163.com) - */ -package com.logpm.basicdata.vo; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; -import lombok.Data; - -import java.io.Serializable; - -/** - * 基础价格按品类计费 视图实体类 - * - * @author zqb - * @since 2024-04-02 - */ -@Builder -@Data -public class PriceDispatchAddClientVO implements Serializable { - - private static final long serialVersionUID = 1L; - - @ApiModelProperty(value = "品类id") - private Long categoryId; - @ApiModelProperty(value = "分货费") - private Double sortPrice; - @ApiModelProperty(value = "装卸费") - private Double handlingPrice; - @ApiModelProperty(value = "平移费") - private Double relocationPrice; - @ApiModelProperty(value = "上楼费") - private Double upstairsDeliveryPrice; - @ApiModelProperty(value = "配送-上楼费免费楼层") - private Integer dispatchStairsCarryingCharge; - -} diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java index 9be5f4678..50e14c9d7 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/LoadCarsDTO.java @@ -30,6 +30,7 @@ public class LoadCarsDTO implements Serializable { private Integer pageSize; private String loadCarsNo; + private String loadStatus; private Long warehouseId; @@ -150,4 +151,6 @@ public class LoadCarsDTO implements Serializable { private Date unloadTimeStart; private Date unloadTimeEnd; + private String carsNo; + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingWaybillVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingWaybillVO.java index 77f49e028..c9b401876 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingWaybillVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineBillladingWaybillVO.java @@ -34,5 +34,6 @@ public class TrunklineBillladingWaybillVO extends TrunklineBillladingWaybillEnti private Long billladingWaybillId; private Integer totalPlanNum; private Integer scanNum; + private Integer noBillladingNum; } diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java index 03a422aad..f9998f26c 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java @@ -18,6 +18,7 @@ package com.logpm.warehouse.feign; import com.alibaba.fastjson.JSONObject; +import com.logpm.warehouse.entity.WarehouseTrayTypeEntity; import com.logpm.warehouse.vo.TrayTypeDataVO; import org.springblade.common.constant.ModuleNameConstant; import org.springblade.core.tool.api.R; @@ -74,4 +75,7 @@ public interface IWarehouseTrayTypeClient { @GetMapping(API_PREFIX+"/trayToNull") void trayToNull(@RequestParam String trayCode,@RequestParam String remark); + + @GetMapping(API_PREFIX+"/findTrayTypeEntity") + WarehouseTrayTypeEntity findTrayTypeEntity(@RequestParam String trayCode); } diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml index a7d04bc5c..f21623007 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordMapper.xml @@ -57,9 +57,7 @@ and deal_time <= #{param.dealDateEnd} - - - order by up_time desc + order by create_time desc diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml index 000a63622..60364c065 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingMapper.xml @@ -80,8 +80,8 @@ carrier_name carrierName, remark remark from logpm_trunkline_billlading - where billlading_status = '2' - + where billlading_status = #{param.billladingStatus} + AND warehouse_id = #{param.warehouseId} + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml index dcba35b9c..f8e8ffe2d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineBillladingWaybillMapper.xml @@ -22,8 +22,8 @@ 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 1f0d3ee16..e44448a28 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 @@ -45,6 +45,12 @@ and ltcl.start_warehouse_id = #{param.warehouseId} + + and ltcl.cars_no = #{param.loadCarsNo} + + + and ltcl.load_status = #{param.loadStatus} + group by ltcl.id,ltcl.cars_no, ltcl.plan_loading_number, ltcl.real_loading_number, @@ -387,6 +393,9 @@ and ltcl.create_time <= #{param.endTime} + + and ltcl.cars_no <= #{param.loadCarsNo} + group by ltcl.id order by ltcl.create_time desc diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml index 915fa9162..b235ee887 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineLoadSignOrderMapper.xml @@ -97,6 +97,9 @@ and ltlso.load_id = #{param.loadId} + + and ltcl.cars_no = #{param.loadCarsNo} + and ltlso.sign_status = '20' and ltlso.sign_time >= #{param.enterTimeStart} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingPackageServicie.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingPackageServicie.java index e6cb464d1..34c35b9da 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingPackageServicie.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineBillladingPackageServicie.java @@ -19,4 +19,7 @@ public interface ITrunklineBillladingPackageServicie extends BaseService findBillladingPackages(List orderPackageCodes); void saveEntityBatch(List noOrderPackageCodes, Long billladingId, Long warehouseId, Integer incomingType); + + List findListByBillladingAndWaybillId(Long billladingId, Long waybillId); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java index 6d0b500b4..e1146ed9f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java @@ -436,18 +436,30 @@ public class InComingServiceImpl implements IInComingService { String packageCode = packageCodes.get(0); TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailService.findEntityByOrderPackageCode(packageCode); Long advanceId = advanceDetailEntity.getAdvanceId(); + Long waybillId = advanceDetailEntity.getWaybillId(); TrunklineAdvanceEntity advanceEntity = advanceService.getById(advanceId); String dealerName = advanceEntity.getDealerName(); String dealerCode = advanceEntity.getDealerCode(); String brand = advanceEntity.getBrand(); - BasicdataTripartiteMallEntity tripartiteMallEntity = tripartiteMallClient.findEntityByDealerNameAndDealerCodeAndBrand(dealerName,dealerCode,brand); - if(!Objects.isNull(tripartiteMallEntity)){ - Long clientId = tripartiteMallEntity.getClientId(); - BasicdataStorageServicesEntity storageServicesEntity = storageServicesClient.findEntityBySendWarehouseIdAndClientId(warehouseId, clientId); - if(!Objects.isNull(storageServicesEntity)){ - String serveWarehouseName = storageServicesEntity.getServeWarehouseName(); - return Resp.scanSuccess(dealerName+"的服务仓库为"+serveWarehouseName,dealerName+"的服务仓库为"+serveWarehouseName); + if(Objects.isNull(waybillId)){ + WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId); + if(!Objects.isNull(waybillEntity)){ + String destinationWarehouseName = waybillEntity.getDestinationWarehouseName(); + return Resp.scanSuccess(dealerName+"的目的仓库为"+destinationWarehouseName,dealerName+"的目的仓库为"+destinationWarehouseName); + }else{ + return Resp.scanSuccess("商家为"+dealerName,"商家为"+dealerName); } + }else{ + BasicdataTripartiteMallEntity tripartiteMallEntity = tripartiteMallClient.findEntityByDealerNameAndDealerCodeAndBrand(dealerName,dealerCode,brand); + if(!Objects.isNull(tripartiteMallEntity)){ + Long clientId = tripartiteMallEntity.getClientId(); + BasicdataStorageServicesEntity storageServicesEntity = storageServicesClient.findEntityBySendWarehouseIdAndClientId(warehouseId, clientId); + if(!Objects.isNull(storageServicesEntity)){ + String serveWarehouseName = storageServicesEntity.getServeWarehouseName(); + return Resp.scanSuccess(dealerName+"的服务仓库为"+serveWarehouseName,dealerName+"的服务仓库为"+serveWarehouseName); + } + } + return Resp.scanSuccess("商家为"+dealerName,"商家为"+dealerName); } } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java index 9bdb50f13..72acebbd6 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderAsyncServiceImpl.java @@ -826,6 +826,7 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { @Override public void dealwithBillladingInfo(List advanceIds,Long warehouseId,String warehouseName,Long waybillId,String waybillNo) { + //查询这些暂存单所有包件有在哪些提货单中有多少个 List billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds); List addBillladingWaybillEntities = new ArrayList<>(); List updateBillladingWaybillEntities = new ArrayList<>(); @@ -846,25 +847,26 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { //把billladingEntities转化成以id为key的Map Map billladingMap = billladingEntities.stream().collect(Collectors.toMap(TrunklineBillladingEntity::getId, Function.identity())); - List billladingWaybillEntities = trunklineBillladingWaybillService.getNoDataWaybillByBillladingIds(billladingIds); + //查询这些提货单下没有运单的数据 + List billladingNoWaybillEntities = trunklineBillladingWaybillService.getNoDataWaybillByBillladingIds(billladingIds); //把billladingWaybillEntities转化成以billladingId为key的Map - Map billladingWaybillMap = billladingWaybillEntities.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getId, Function.identity())); + Map billladingNoWaybillMap = billladingNoWaybillEntities.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getBillladingId, Function.identity())); billladingPackageMap.keySet().forEach(billladingId -> { BillladingPackageVO billladingPackageVO = billladingPackageMap.get(billladingId); Integer num = billladingPackageVO.getNum(); - TrunklineBillladingWaybillEntity billladingWaybillEntity = billladingWaybillMap.get(billladingId); - if(!Objects.isNull(billladingWaybillEntity)){ + TrunklineBillladingWaybillEntity billladingNoWaybillEntity = billladingNoWaybillMap.get(billladingId); + if(!Objects.isNull(billladingNoWaybillEntity)){ TrunklineBillladingEntity billladingEntity = billladingMap.get(billladingId); - Integer realNum = billladingWaybillEntity.getRealNum(); + Integer realNum = billladingNoWaybillEntity.getRealNum(); if (realNum > num) { - billladingWaybillEntity.setRealNum(realNum - num); + billladingNoWaybillEntity.setRealNum(realNum - num); } else if (realNum.equals(num)) { - billladingWaybillEntity.setRealNum(0); - billladingWaybillEntity.setIsDeleted(1); + billladingNoWaybillEntity.setRealNum(0); + billladingNoWaybillEntity.setIsDeleted(1); } - updateBillladingWaybillEntities.add(billladingWaybillEntity); + updateBillladingWaybillEntities.add(billladingNoWaybillEntity); TrunklineBillladingWaybillEntity addbillladingWaybillEntity = new TrunklineBillladingWaybillEntity(); addbillladingWaybillEntity.setWarehouseId(warehouseId); addbillladingWaybillEntity.setWarehouseName(warehouseName); @@ -887,6 +889,10 @@ public class OpenOrderAsyncServiceImpl implements IOpenOrderAsyncService { for (TrunklineBillladingEntity billladingEntity : updateFeeBilllading) { trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(billladingEntity); } + + + + } 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 5d40918b9..b05256ea2 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 @@ -449,6 +449,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setStockCount(advanceDetailStockNumVO.getStockNum()); waybillEntity.setStockWeight(advanceDetailStockNumVO.getStockWeight()); waybillEntity.setStockVolume(advanceDetailStockNumVO.getStockVolume()); + List billladingPackageList = advanceDetailService.findBillladingPackageByAdvanceIdsAnd(advanceIds); + //把billladingPackageList中的所有num累加 + waybillEntity.setBillladingNum(billladingPackageList.stream().mapToInt(BillladingPackageVO::getNum).sum()); waybillEntity.setTotalFreight(openOrderDTO.getTotalFreight()); waybillEntity.setDeliveryFee(openOrderDTO.getDeliveryFee()); @@ -2292,7 +2295,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { List list = new ArrayList<>(); importOrderNoPackageExcelDTOMap.keySet().forEach(key -> { ImportOrderNoPackageExcelDTO importOrderNoPackageExcelDTO = importOrderNoPackageExcelDTOMap.get(key); - if(Objects.isNull(importOrderNoPackageExcelDTO)){ + if(!Objects.isNull(importOrderNoPackageExcelDTO)){ String orderCode = importOrderNoPackageExcelDTO.getOrderCode(); TrunklineAdvanceEntity advanceEntity = new TrunklineAdvanceVO(); advanceEntity.setWarehouseId(warehouseId); @@ -2375,7 +2378,6 @@ public class OpenOrderServiceImpl implements IOpenOrderService { }else{ advanceDetailModel.setWeight(new BigDecimal(weight)); } - advanceDetailModel.setWeight(new BigDecimal(importOrderNoPackageExcelDTO.getWeight())); advanceDetailModel.setPackageStatus("0"); List orderPackageCodes = basicdataCodeClient.getBatchPackageCodeByType(warehouseCode, orderCode, totalNum); @@ -3249,6 +3251,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService { StringBuilder stringBuilder = new StringBuilder(); List msgList = new ArrayList<>(); + String newBrand = openOrderDTO.getBrand(); + Long newBrandId = openOrderDTO.getBrandId(); + String brand = waybillEntity.getBrand(); + Long brandId = waybillEntity.getBrandId(); + if(!ObjectUtil.equals(newBrandId,brandId)){ + EditOrderMsgVO editOrderMsgVO = new EditOrderMsgVO(); + editOrderMsgVO.setItemName("品牌"); + editOrderMsgVO.setOldValue(brand); + editOrderMsgVO.setNewValue(newBrand); + msgList.add(editOrderMsgVO); + } + String newDeparture = openOrderDTO.getDeparture(); String departure = waybillEntity.getDeparture(); if(!ObjectUtil.equals(newDeparture,departure)){ diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java index f49cbe8b2..2b241bf1f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java @@ -28,6 +28,7 @@ import com.logpm.warehouse.feign.IWarehouseWaybillClient; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant; +import org.springblade.common.utils.CommonUtil; import org.springblade.common.utils.QRCodeUtil; import org.springblade.common.utils.TemplateUtil; import org.springblade.core.log.exception.ServiceException; @@ -168,6 +169,14 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl pageList = baseMapper.findOrderDetails(page,orderDetailsDTO); return R.data(pageList); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java index 624a501da..808dc53c3 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java @@ -1014,6 +1014,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl advanceDetailEntityQueryWrapper = new QueryWrapper<>(); - advanceDetailEntityQueryWrapper.in("order_package_code",noOrderPackageCodes) - .eq("warehouse_id",warehouseId); + advanceDetailEntityQueryWrapper.in("order_package_code",noOrderPackageCodes); List advanceDetailList = trunklineAdvanceDetailService.list(advanceDetailEntityQueryWrapper); if(advanceDetailList.isEmpty()){ @@ -244,13 +243,16 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl advanceEntityQueryWrapper = new QueryWrapper<>(); - advanceEntityQueryWrapper.in("id",advanceIdsSet) - .eq("waybill_status","1"); + advanceEntityQueryWrapper.in("id",advanceIdsSet); List advanceEntities = trunklineAdvanceService.list(advanceEntityQueryWrapper); + + //把所有暂存单已开单的运单号提取出来 //把advanceEntities所有元素的waybillNo放入一个Set - Set waybillNoSet = advanceEntities.stream().map(TrunklineAdvanceEntity::getWaybillNo).collect(Collectors.toSet()); + Set waybillNoSet = advanceEntities.stream().filter(advanceEntity -> !StringUtil.isEmpty(advanceEntity.getWaybillNo())).map(TrunklineAdvanceEntity::getWaybillNo).collect(Collectors.toSet()); + + //所有已开单暂存单运单信息 Map waybillEntityMap = new HashMap<>(); if(!waybillNoSet.isEmpty()){ List waybillEntityList = warehouseWaybillClient.findWaybillBilllByWaybillNos(new ArrayList<>(waybillNoSet)); @@ -259,21 +261,26 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl advanceEntityMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); + //把这次所有入库的包件根据暂存单id进行分组 //把advanceDetailList中的所有元素的advanceId分组 Map> advanceIdGroupedEntities = advanceDetailList.stream() .collect(Collectors.groupingBy(TrunklineAdvanceDetailEntity::getAdvanceId)); + //把没开单的暂存单包件放在一起 + List noWaybillList = new ArrayList<>(); + Map waybillNoMNumMap = new HashMap<>(); Map finalWaybillEntityMap = waybillEntityMap; advanceEntityMap.keySet().forEach(advanceId -> { TrunklineAdvanceEntity advanceEntity = advanceEntityMap.get(advanceId); + List advanceDetailEntities = advanceIdGroupedEntities.get(advanceId); String waybillNo = advanceEntity.getWaybillNo(); if(StringUtil.isNotBlank(waybillNo)){ - List advanceDetailEntities = advanceIdGroupedEntities.get(advanceId); - int size = advanceDetailEntities.size(); + int size = advanceDetailEntities.size();//入库件数 WarehouseWaybillEntity waybillEntity = finalWaybillEntityMap.get(waybillNo); if(!Objects.isNull(waybillEntity)){ Integer stockCount = waybillEntity.getStockCount(); @@ -284,13 +291,9 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl totalCount){ -// waybillEntity.setStockCount(totalCount); diff = totalCount - stockCount; }else{ -// waybillEntity.setStockCount(all); diff = size; } Integer integer = waybillNoMNumMap.get(waybillNo); @@ -302,6 +305,8 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl addList = new ArrayList<>(); List updateList = new ArrayList<>(); TrunklineBillladingWaybillEntity noWaybillNoData = trunklineBillladingWaybillService.findNoWaybillNoData(billladingId); + if(CollUtil.isNotEmpty(noWaybillList)){ + int size = noWaybillList.size(); + if(Objects.isNull(noWaybillNoData)){ + noWaybillNoData = new TrunklineBillladingWaybillEntity(); + noWaybillNoData.setWarehouseId(warehouseId); + noWaybillNoData.setWarehouseName(warehouseEntity.getName()); + noWaybillNoData.setBillladingId(billladingId); + noWaybillNoData.setBilladingCode(trunklineBillladingEntity.getBillladingCode()); + noWaybillNoData.setWaybillNo("————"); + noWaybillNoData.setRealNum(size); + noWaybillNoData.setRealWeight(BigDecimal.ZERO); + noWaybillNoData.setRealVolume(BigDecimal.ZERO); + }else{ + Integer realNum = noWaybillNoData.getRealNum(); + noWaybillNoData.setRealNum(realNum+size); + } + } + + for (String waybillNo : waybillNoSet) { Integer integer = waybillNoMNumMap.get(waybillNo); @@ -340,33 +363,28 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl findListByBillladingAndWaybillId(Long billladingId, Long waybillId) { + return baseMapper.findListByBillladingAndWaybillId(billladingId,waybillId); + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java index 2ca83bf22..ba5a808bf 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineBillladingServiceImpl.java @@ -107,41 +107,52 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl saveBillladingWaybillList = new ArrayList<>(); -// Map waybillBillladingNumMap = new HashMap<>(); //保存提货运单 List billladingWaybillList = billladingDTO.getBillladingWaybillList(); - for (TrunklineBillladingWaybillVO billladingWaybillVO:billladingWaybillList){ - TrunklineBillladingWaybillEntity billladingWaybillEntity = new TrunklineBillladingWaybillEntity(); - BeanUtil.copy(billladingWaybillVO,billladingWaybillEntity); - billladingWaybillEntity.setBillladingId(billladingId); - billladingWaybillEntity.setBilladingCode(trunklineBillladingEntity.getBillladingCode()); - billladingWaybillEntity.setRealNum(0); - billladingWaybillEntity.setRealWeight(BigDecimal.ZERO); - billladingWaybillEntity.setRealVolume(BigDecimal.ZERO); - billladingWaybillEntity.setBillladingFee(BigDecimal.ZERO); -// billladingWaybillEntity.setPlanNum(billladingWaybillVO.getPlanNum()); - saveBillladingWaybillList.add(billladingWaybillEntity); -// waybillBillladingNumMap.put(billladingWaybillVO.getWaybillId(),billladingWaybillVO.getPlanNum()); + if(CollUtil.isNotEmpty(billladingWaybillList)){ + //把billladingWaybillList中所有元素的waybillId放到一个List + List waybillIdList = billladingWaybillList.stream() + .map(TrunklineBillladingWaybillVO::getWaybillId) + .collect(Collectors.toList()); + //查询运单 + Map waybillEntityMap = new HashMap<>(); + + if(CollUtil.isNotEmpty(waybillIdList)){ + List waybillEntityList = warehouseWaybillClient.findListByWaybillIds(waybillIdList); + //把waybillEntityList转化为waybillId为key的Map + waybillEntityMap = waybillEntityList.stream() + .collect(Collectors.toMap(WarehouseWaybillEntity::getId, waybillEntity -> waybillEntity)); + } + + List updateWaybillList = new ArrayList<>(); + for (TrunklineBillladingWaybillVO billladingWaybillVO:billladingWaybillList){ + Long waybillId = billladingWaybillVO.getWaybillId(); + WarehouseWaybillEntity warehouseWaybillEntity = waybillEntityMap.get(waybillId); + if(!Objects.isNull(warehouseWaybillEntity)){ + Integer noBillladingNum = billladingWaybillVO.getNoBillladingNum(); + Integer billladingNum = warehouseWaybillEntity.getBillladingNum(); + Integer totalCount = warehouseWaybillEntity.getTotalCount(); + if(billladingNum+noBillladingNum > totalCount){ + log.warn("########saveNew1: "+waybillId+"已大于运单总件数"); + continue; + } + warehouseWaybillEntity.setBillladingNum(billladingNum+noBillladingNum); + updateWaybillList.add(warehouseWaybillEntity); + + TrunklineBillladingWaybillEntity billladingWaybillEntity = new TrunklineBillladingWaybillEntity(); + BeanUtil.copy(billladingWaybillVO,billladingWaybillEntity); + billladingWaybillEntity.setBillladingId(billladingId); + billladingWaybillEntity.setBilladingCode(trunklineBillladingEntity.getBillladingCode()); + billladingWaybillEntity.setRealNum(billladingWaybillVO.getNoBillladingNum()); + billladingWaybillEntity.setRealWeight(BigDecimal.ZERO); + billladingWaybillEntity.setRealVolume(BigDecimal.ZERO); + billladingWaybillEntity.setBillladingFee(BigDecimal.ZERO); + saveBillladingWaybillList.add(billladingWaybillEntity); + } + } + billladingWaybillService.saveBatch(saveBillladingWaybillList); + warehouseWaybillClient.updateList(updateWaybillList); } - billladingWaybillService.saveBatch(saveBillladingWaybillList); - -// Set waybillIds = waybillBillladingNumMap.keySet(); -// -// List waybillEntityList = warehouseWaybillClient.findListByWaybillIds(new ArrayList<>(waybillIds)); -// waybillEntityList.forEach(waybillEntity -> { -// Long waybillEntityId = waybillEntity.getId(); -// Integer planNum = waybillBillladingNumMap.get(waybillEntityId); -// if(Objects.isNull(planNum)){ -// planNum = 0; -// } -// Integer billladingNum = waybillEntity.getBillladingNum(); -// if(Objects.isNull(billladingNum)){ -// billladingNum = 0; -// } -// waybillEntity.setBillladingNum(billladingNum+planNum); -// }); -// -// warehouseWaybillClient.updateList(waybillEntityList); TrunklineBillladingLogEntity logEntity = new TrunklineBillladingLogEntity(); @@ -654,6 +665,7 @@ public class TrunklineBillladingServiceImpl extends BaseServiceImpl billladingPackageEntities = trunklineBillladingPackageServicie.findListByBillladingAndWaybillId(billladingId,waybillId); + if(CollUtil.isNotEmpty(billladingPackageEntities)){ + int size = billladingPackageEntities.size(); + noWaybillNoBillladingWaybill.setRealNum(realNum-size); + } + billladingWaybillService.updateById(noWaybillNoBillladingWaybill); + } + + + billladingWaybillService.updateBillladingFeeByBillladingId(trunklineBillladingEntity); return R.success("添加成功"); } 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 ea92374ac..906dc99de 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 @@ -40,6 +40,7 @@ import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper; import com.logpm.trunkline.service.*; import com.logpm.trunkline.vo.*; import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity; +import com.logpm.warehouse.entity.WarehouseTrayTypeEntity; import com.logpm.warehouse.entity.WarehouseWayBillDetail; import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseTrayTypeClient; @@ -349,7 +350,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl map = new HashMap<>(); map.put("orders", orders); + WarehouseTrayTypeEntity trayTypeEntity = trayTypeClient.findTrayTypeEntity(trayCode); + if(!Objects.isNull(trayTypeEntity)){ + Integer totalNum = trayTypeEntity.getTotalNum(); + return Resp.scanData("打托成功", totalNum+"件",map); + } return R.data(map); } @@ -3668,8 +3674,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsOrderIdList = new ArrayList<>(); for (String s : split) { carsOrderIdList.add(Long.parseLong(s)); } + Long carsOrderId = carsOrderIdList.get(0); + TrunklineCarsOrderEntity carsOrder = trunklineCarsOrderService.getById(carsOrderId); + loadId = carsOrder.getLoadId(); + TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); + if(Objects.isNull(carsLoadEntity)){ + log.warn("###########updateWaybillOrderIsCustemer: 配载计划不存在 loadId={}",loadId); + return R.fail(405,"配载计划不存在"); + + } baseMapper.updateWaybillOrderIsCustemer(carsOrderIdList, isCustomer); + //取消节点的签收单 + cancleCustomerSignOrder(loadId, warehouseId); + carsLoadEntity.setIsCustomer("2"); + updateById(carsLoadEntity); + + //生成直发商家签收单 + createCustomerSignOrder(loadId, warehouseId); + return R.success("更新成功"); } @@ -4648,6 +4699,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("tray_code",trayCode) + .eq("is_deleted",0); + return warehouseTrayTypeService.getOne(queryWrapper); + } + }