From 16326722abba1b477d4caa159c32887c1083af62 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 6 Dec 2023 00:35:17 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E6=A8=A1=E5=9D=97=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/trunkline/dto/LoadCarsDTO.java | 3 + .../entity/TrunklineCarsOrderEntity.java | 4 + .../trunkline/vo/CarsLoadAllOrderVO.java | 1 + .../trunkline/vo/ProductUnloadInfoVO.java | 14 ++ .../trunkline/vo/TrunklineCarsLoadLineVO.java | 8 + .../trunkline/vo/TrunklineCarsLoadVO.java | 1 + .../com/logpm/trunkline/vo/UnloadZeroVO.java | 18 ++ .../feign/IWarehouseTrayTypeClient.java | 5 + .../feign/BasicdataWarehouseClient.java | 3 + .../trunkline/api/CarsLoadApiController.java | 112 +++++----- .../api/TripartiteTransferApiController.java | 86 ++++++++ .../controller/CarsLoadController.java | 121 +++++++--- .../TripartiteTransferController.java | 14 +- .../mapper/TrunklineCarsLoadLineMapper.java | 3 + .../mapper/TrunklineCarsLoadLineMapper.xml | 8 + .../mapper/TrunklineCarsLoadMapper.java | 1 + .../mapper/TrunklineCarsLoadMapper.xml | 20 +- .../mapper/TrunklineCarsLoadScanMapper.java | 12 + .../mapper/TrunklineCarsLoadScanMapper.xml | 38 ++++ .../mapper/TrunklineCarsOrderMapper.java | 3 + .../mapper/TrunklineCarsOrderMapper.xml | 11 + .../mapper/TrunklineCarsUnloadScanMapper.java | 4 +- .../mapper/TrunklineCarsUnloadScanMapper.xml | 13 +- .../ITrunklineCarsLoadLineService.java | 3 + .../ITrunklineCarsLoadScanService.java | 13 ++ .../service/ITrunklineCarsLoadService.java | 15 +- .../service/ITrunklineCarsOrderService.java | 3 + .../ITrunklineCarsUnloadScanService.java | 2 + .../TrunklineCarsLoadLineServiceImpl.java | 6 + .../TrunklineCarsLoadScanServiceImpl.java | 24 ++ .../impl/TrunklineCarsLoadServiceImpl.java | 207 ++++++++++++++++-- .../TrunklineCarsOrderEntityServiceImpl.java | 6 + .../TrunklineCarsUnloadScanServiceImpl.java | 5 + .../feign/WarehouseTrayTypeClient.java | 10 + .../mapper/WarehouseTrayGoodsMapper.java | 2 + .../mapper/WarehouseTrayGoodsMapper.xml | 7 + .../service/IWarehouseTrayGoodsService.java | 2 + .../service/IWarehouseTrayTypeService.java | 1 + .../impl/WarehouseTrayGoodsServiceImpl.java | 5 + .../impl/WarehouseTrayTypeServiceImpl.java | 16 ++ 40 files changed, 702 insertions(+), 128 deletions(-) create mode 100644 blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ProductUnloadInfoVO.java create mode 100644 blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadLineVO.java create mode 100644 blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadZeroVO.java create mode 100644 blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/TripartiteTransferApiController.java 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 246a64b19..e29cbb37e 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 @@ -54,4 +54,7 @@ public class LoadCarsDTO implements Serializable { private Long carsLoadScanId; + + private List orderCodes; + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsOrderEntity.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsOrderEntity.java index abfba05a7..3a3056ace 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsOrderEntity.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/entity/TrunklineCarsOrderEntity.java @@ -73,5 +73,9 @@ public class TrunklineCarsOrderEntity extends TenantEntity { /** 是否异常 0否 1是 */ @ApiModelProperty(name = "是否异常 0否 1是",notes = "") private Integer isAbnormal; + /** 卸车数量 */ + @ApiModelProperty(name = "卸车数量",notes = "") + private Integer unloadNum; + } diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java index ffb345ff3..dce96f30f 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/CarsLoadAllOrderVO.java @@ -18,6 +18,7 @@ public class CarsLoadAllOrderVO implements Serializable { private String shipper;//发货单位 private String consignee;//收货单位 private String consigneeName;//收货人 + private String goodsName;//货物名称 private String customerTrain;//客户车次号 private String remark;//备注好 private Integer totalNum;//总件数 diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ProductUnloadInfoVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ProductUnloadInfoVO.java new file mode 100644 index 000000000..c176bf1e2 --- /dev/null +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/ProductUnloadInfoVO.java @@ -0,0 +1,14 @@ +package com.logpm.trunkline.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ProductUnloadInfoVO implements Serializable { + + private String productName; + private Integer loadingNum; + private Integer unloadNum; + +} diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadLineVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadLineVO.java new file mode 100644 index 000000000..89e230bb1 --- /dev/null +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadLineVO.java @@ -0,0 +1,8 @@ +package com.logpm.trunkline.vo; + +import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity; +import lombok.Data; + +@Data +public class TrunklineCarsLoadLineVO extends TrunklineCarsLoadLineEntity { +} diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java index b297ba6c5..9ae0eea8d 100644 --- a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineCarsLoadVO.java @@ -20,6 +20,7 @@ public class TrunklineCarsLoadVO extends TrunklineCarsLoadEntity { private List carsLoadScanPackageList = new ArrayList<>(); private List carsUnloadScanPackageList = new ArrayList<>(); private List zeroList = new ArrayList<>(); + private List unloadZeroList = new ArrayList<>(); private BigDecimal nowTransportCost; private BigDecimal oilCost; diff --git a/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadZeroVO.java b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadZeroVO.java new file mode 100644 index 000000000..6520becfe --- /dev/null +++ b/blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadZeroVO.java @@ -0,0 +1,18 @@ +package com.logpm.trunkline.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +@Data +public class UnloadZeroVO implements Serializable { + + private String waybillNo;//运单号 + private Integer loadingNum;//装车数量 + private Integer unloadNum;//卸车件数 + + private List productUnloadInfoList = new ArrayList<>(); + +} 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 528db4e00..3309d22c9 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 @@ -62,4 +62,9 @@ public interface IWarehouseTrayTypeClient { @GetMapping(API_PREFIX+"/findAllGoodsByTrayCodeAndWarehouseId") List findAllGoodsByTrayCodeAndWarehouseId(@RequestParam String trayCode, @RequestParam Long warehouseId); + + @GetMapping(API_PREFIX+"/deleteZeroOrderByTrayCode") + void deleteZeroOrderByTrayCode(@RequestParam String orderCode, @RequestParam String palletCode, @RequestParam Long wid); + @GetMapping(API_PREFIX+"/changeTrayWarehouseInfo") + void changeTrayWarehouseInfo(@RequestParam String trayCode, @RequestParam Long warehouseId); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java index e39bf4ec9..ea0e2dc7d 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataWarehouseClient.java @@ -179,6 +179,9 @@ public class BasicdataWarehouseClient implements IBasicdataWarehouseClient { JSONObject jsonObject = new JSONObject(); jsonObject.put("warehouseId",warehouseEntity.getId()); jsonObject.put("warehouseName",warehouseEntity.getName()); + jsonObject.put("linkMan",warehouseEntity.getLinkman()); + jsonObject.put("linkPhone",warehouseEntity.getContactNumber()); + jsonObject.put("linkAddress",warehouseEntity.getWarehouseAddress()); list.add(jsonObject); } return list; diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java index a805caf3d..525398678 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java @@ -45,7 +45,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -93,7 +93,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -142,7 +142,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -178,7 +178,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -217,7 +217,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -252,7 +252,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -288,7 +288,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if (!Objects.isNull(myCurrentWarehouse)) { + if (Objects.isNull(myCurrentWarehouse)) { log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse); return R.fail(405, "仓库信息为空"); } @@ -337,7 +337,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -379,7 +379,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -412,32 +412,6 @@ public class CarsLoadApiController { - @ResponseBody - @PostMapping("/arriveUnloadPageList") - @ApiOperationSupport(order = 1) - @ApiOperation(value = "到车列表", notes = "传入loadCarsDTO") - public R arriveUnloadPageList(@RequestBody LoadCarsDTO loadCarsDTO) { - String method = "############arriveUnloadPageList: "; - log.info(method + "请求参数{}", loadCarsDTO); - try{ - - //当前登录人选择的仓库 - BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ - log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); - return R.fail(405,"仓库信息为空"); - } - loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId()); - - return carsLoadService.arriveUnloadPageList(loadCarsDTO); - }catch (CustomerException e){ - log.error(e.message,e); - return R.fail(e.code,e.message); - }catch (Exception e){ - log.error(method+"系统异常",e); - return R.fail(500,"系统异常"); - } - } @ResponseBody @@ -452,7 +426,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -486,7 +460,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -501,7 +475,7 @@ public class CarsLoadApiController { } - return carsLoadService.unloadPackage(loadId,orderPackageCode,myCurrentWarehouse.getId()); + return carsLoadService.unloadPackage(loadId,orderPackageCode,myCurrentWarehouse.getId(),1); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); @@ -526,7 +500,7 @@ public class CarsLoadApiController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -545,7 +519,44 @@ public class CarsLoadApiController { return R.fail(405,"零担品类为空"); } - return carsLoadService.unloadZero(loadId,waybillNo,productInfoList,myCurrentWarehouse.getId(),null); + return carsLoadService.unloadZero(loadId,waybillNo,productInfoList,myCurrentWarehouse.getId(),1); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + } + + + @ResponseBody + @PostMapping("/findUnloadTrayGoodsList") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查询托盘装车了哪些货物", notes = "传入loadCarsDTO") + public R findUnloadTrayGoodsList(@RequestBody LoadCarsDTO loadCarsDTO) { + String method = "############findUnloadTrayGoodsList: "; + log.info(method + "请求参数{}", loadCarsDTO); + Long loadId = loadCarsDTO.getLoadId(); + String trayCode = loadCarsDTO.getTrayCode(); + try{ + + //当前登录人选择的仓库 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); + return R.fail(405,"仓库信息为空"); + } + loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId()); + if(Objects.isNull(loadId)){ + log.warn(method+"配载计划id为空 loadId={}",loadId); + return R.fail(405,"配载计划id为空"); + } + if(StringUtil.isBlank(trayCode)){ + log.warn(method+"托盘码为空 trayCode={}",trayCode); + return R.fail(405,"托盘码为空"); + } + return carsLoadService.findUnloadTrayGoodsList(loadId,trayCode,myCurrentWarehouse.getId()); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); @@ -559,18 +570,17 @@ public class CarsLoadApiController { @ResponseBody @PostMapping("/unloadTray") @ApiOperationSupport(order = 1) - @ApiOperation(value = "卸车托盘", notes = "传入loadCarsDTO") + @ApiOperation(value = "托盘卸车", notes = "传入loadCarsDTO") public R unloadTray(@RequestBody LoadCarsDTO loadCarsDTO) { String method = "############unloadTray: "; log.info(method + "请求参数{}", loadCarsDTO); Long loadId = loadCarsDTO.getLoadId(); - String waybillNo = loadCarsDTO.getWaybillNo(); - List productInfoList = loadCarsDTO.getProductInfoList(); + String trayCode = loadCarsDTO.getTrayCode(); try{ //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -579,17 +589,11 @@ public class CarsLoadApiController { log.warn(method+"配载计划id为空 loadId={}",loadId); return R.fail(405,"配载计划id为空"); } - if(StringUtil.isBlank(waybillNo)){ - log.warn(method+"运单号为空 waybillNo={}",waybillNo); - return R.fail(405,"运单号为空"); - } - - if(productInfoList.isEmpty()){ - log.warn(method+"零担品类为空 waybillNo={}",waybillNo); - return R.fail(405,"零担品类为空"); + if(StringUtil.isBlank(trayCode)){ + log.warn(method+"托盘码为空 trayCode={}",trayCode); + return R.fail(405,"托盘码为空"); } - - return carsLoadService.unloadZero(loadId,waybillNo,productInfoList,myCurrentWarehouse.getId(),null); + return carsLoadService.unloadTray(loadId,trayCode,myCurrentWarehouse.getId()); }catch (CustomerException e){ log.error(e.message,e); return R.fail(e.code,e.message); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/TripartiteTransferApiController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/TripartiteTransferApiController.java new file mode 100644 index 000000000..7888efc9c --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/TripartiteTransferApiController.java @@ -0,0 +1,86 @@ +package com.logpm.trunkline.api; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.basicdata.entity.BasicdataWarehouseEntity; +import com.logpm.basicdata.feign.IBasicdataWarehouseClient; +import com.logpm.trunkline.dto.LoadCarsDTO; +import com.logpm.trunkline.service.ITrunklineCarsLoadService; +import com.logpm.trunkline.vo.TripartiteTransferVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.exception.CustomerException; +import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.web.bind.annotation.*; + +import java.util.Objects; + +@Slf4j +@RestController +@AllArgsConstructor +@RequestMapping("/api/tripartiteTransfer") +@Api(value = "三方中转控制类", tags = "三方中转接口") +public class TripartiteTransferApiController { + + private final IBasicdataWarehouseClient warehouseClient; + private final ITrunklineCarsLoadService carsLoadService; + + @ResponseBody + @PostMapping("/transferLoadPageList") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "三方中转装车列表", notes = "传入loadCarsDTO") + public R tripartiteTransferPageList(@RequestBody LoadCarsDTO loadCarsDTO) { + String method = "############tripartiteTransferPageList: "; + log.info(method + "请求参数{}", loadCarsDTO); + Integer type = loadCarsDTO.getType(); + Integer pageNum = loadCarsDTO.getPageNum(); + Integer pageSize = loadCarsDTO.getPageSize(); + String startDate = loadCarsDTO.getStartDate(); + String endDate = loadCarsDTO.getEndDate(); + try{ + + //当前登录人选择的仓库 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if(Objects.isNull(myCurrentWarehouse)){ + log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); + return R.fail(405,"仓库信息为空"); + } + loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId()); + + if(Objects.isNull(pageNum)){ + loadCarsDTO.setPageNum(1); + } + if(Objects.isNull(pageSize)){ + loadCarsDTO.setPageSize(10); + } + + if(StringUtil.isBlank(startDate)){ + log.warn(method+"开始时间为空 startDate={}",startDate); + return R.fail(405,"开始时间为空"); + } + if(StringUtil.isBlank(endDate)){ + log.warn(method+"结束时间为空 endDate={}",endDate); + return R.fail(405,"结束时间为空"); + } + + if(Objects.isNull(type)){ + log.warn(method+"查询类型为空 type={}",type); + return R.fail(405,"查询类型为空"); + } + IPage tripartiteTransferVOIPage = carsLoadService.tripartiteTransferPageList(loadCarsDTO); + return R.data(tripartiteTransferVOIPage); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error(method+"系统异常",e); + return R.fail(500,"系统异常"); + } + } + + + +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java index 268e04591..0fb994839 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java @@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; -import com.logpm.trunkline.dto.*; +import com.logpm.trunkline.dto.LoadCarsDTO; +import com.logpm.trunkline.dto.TrunklineCarsLoadDTO; +import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO; +import com.logpm.trunkline.dto.TrunklineCarsOrderDTO; import com.logpm.trunkline.service.ITrunklineCarsLoadService; +import com.logpm.trunkline.vo.TrunklineCarsLoadLineVO; import com.logpm.trunkline.vo.TrunklineCarsLoadVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -93,7 +97,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -123,7 +127,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -158,7 +162,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -207,7 +211,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -241,7 +245,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -279,7 +283,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -346,7 +350,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -387,7 +391,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -421,7 +425,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -455,7 +459,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -491,7 +495,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -566,20 +570,20 @@ public class CarsLoadController { log.warn(method+"分摊方式为空 chargeType={}",chargeType); throw new CustomerException(400,"分摊方式为空"); } - if(!"2".equals(chargeType) && !"3".equals(chargeType) && !"4".equals(chargeType)){ + if(!"1".equals(chargeType) && !"2".equals(chargeType) && !"3".equals(chargeType)){ log.warn(method+"分摊方式值不正确 chargeType={}",chargeType); throw new CustomerException(400,"分摊方式值不正确"); } - Long carrierId = carsLoadDTO.getCarrierId(); - if(Objects.isNull(carrierId)){ - log.warn(method+"承运商id为空 carrierId={}",carrierId); - throw new CustomerException(400,"承运商id为空"); - } - String carrierName = carsLoadDTO.getCarrierName(); - if(StringUtil.isBlank(carrierName)){ - log.warn(method+"承运商名称为空 carrierName={}",carrierName); - throw new CustomerException(400,"承运商名称为空"); - } +// Long carrierId = carsLoadDTO.getCarrierId(); +// if(Objects.isNull(carrierId)){ +// log.warn(method+"承运商id为空 carrierId={}",carrierId); +// throw new CustomerException(400,"承运商id为空"); +// } +// String carrierName = carsLoadDTO.getCarrierName(); +// if(StringUtil.isBlank(carrierName)){ +// log.warn(method+"承运商名称为空 carrierName={}",carrierName); +// throw new CustomerException(400,"承运商名称为空"); +// } String carNumber = carsLoadDTO.getCarNumber(); if(StringUtil.isBlank(carNumber)){ log.warn(method+"车牌号为空 carNumber={}",carNumber); @@ -654,10 +658,10 @@ public class CarsLoadController { throw new CustomerException(400,"排序为空"); } List lineCarsOrderList = carsLoadLineDTO.getLineCarsOrderList(); - if (lineCarsOrderList.size() <= 0){ - log.warn(method+"节点关联订单不正确 lineCarsOrderList.size()={}",lineCarsOrderList.size()); - throw new CustomerException(400,"节点关联订单不正确"); - } +// if (lineCarsOrderList.size() <= 0){ +// log.warn(method+"节点关联订单不正确 lineCarsOrderList.size()={}",lineCarsOrderList.size()); +// throw new CustomerException(400,"节点关联订单不正确"); +// } for (TrunklineCarsOrderDTO carsOrderDTO:lineCarsOrderList){ String orderCode = carsOrderDTO.getOrderCode(); if(StringUtil.isBlank(orderCode)){ @@ -697,7 +701,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -746,7 +750,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -782,7 +786,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -827,7 +831,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -873,7 +877,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(405,"仓库信息为空"); } @@ -920,7 +924,7 @@ public class CarsLoadController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if (!Objects.isNull(myCurrentWarehouse)) { + if (Objects.isNull(myCurrentWarehouse)) { log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse); return R.fail(405, "仓库信息为空"); } @@ -998,4 +1002,55 @@ public class CarsLoadController { } + @ResponseBody + @PostMapping("/findLoadFeeByNodeId") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "查询配载计划节点费用信息", notes = "传入loadCarsDTO") + public R findLoadFeeByNodeId(@RequestBody LoadCarsDTO loadCarsDTO) { + String method = "############findLoadFeeByNodeId: "; + log.info(method + "请求参数{}", loadCarsDTO); + Long loadId = loadCarsDTO.getLoadId(); + try{ + //当前登录人选择的仓库 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if (Objects.isNull(myCurrentWarehouse)) { + log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse); + return R.fail(405, "仓库信息为空"); + } + return carsLoadService.findLoadFeeByNodeId(loadId,myCurrentWarehouse.getId()); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error("############sendOrders: 系统异常",e); + return R.fail(500,"############sendOrders: 系统异常"); + } + } + + + @ResponseBody + @PostMapping("/updateLoadFeeByNodeId") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "更新配载计划节点费用信息", notes = "传入loadCarsDTO") + public R updateLoadFeeByNodeId(@RequestBody TrunklineCarsLoadLineVO carsLoadLineVO) { + String method = "############updateLoadFeeByNodeId: "; + log.info(method + "请求参数{}", carsLoadLineVO); + try{ + //当前登录人选择的仓库 + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + if (Objects.isNull(myCurrentWarehouse)) { + log.warn(method + "仓库信息为空 myCurrentWarehouse={}", myCurrentWarehouse); + return R.fail(405, "仓库信息为空"); + } + return carsLoadService.updateLoadFeeByNodeId(carsLoadLineVO); + }catch (CustomerException e){ + log.error(e.message,e); + return R.fail(e.code,e.message); + }catch (Exception e){ + log.error("############updateLoadFeeByNodeId: 系统异常",e); + return R.fail(500,"系统异常"); + } + } + + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java index a61d3cbca..6d0ffcb0b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/TripartiteTransferController.java @@ -74,7 +74,7 @@ public class TripartiteTransferController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -188,7 +188,7 @@ public class TripartiteTransferController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -220,7 +220,7 @@ public class TripartiteTransferController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -252,7 +252,7 @@ public class TripartiteTransferController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -284,7 +284,7 @@ public class TripartiteTransferController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -317,7 +317,7 @@ public class TripartiteTransferController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } @@ -354,7 +354,7 @@ public class TripartiteTransferController { //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - if(!Objects.isNull(myCurrentWarehouse)){ + if(Objects.isNull(myCurrentWarehouse)){ log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse); return R.fail(400,"仓库信息为空"); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.java index 213d5085a..5a5e6ffbf 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.java @@ -5,6 +5,7 @@ import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; @Mapper @@ -19,4 +20,6 @@ public interface TrunklineCarsLoadLineMapper extends BaseMapper findListMoreSortByLoadId(@Param("loadId") Long loadId, @Param("sort") Integer sort); + + BigDecimal getAllNodeFee(@Param("loadId") Long loadId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.xml index 4af301d62..cf79de218 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadLineMapper.xml @@ -40,4 +40,12 @@ and sort > #{sort} + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java index 36786ed3f..cc320d558 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.java @@ -26,4 +26,5 @@ public interface TrunklineCarsLoadMapper extends BaseMapper carsLoadPageList(IPage page, @Param("param") LoadCarsDTO loadCarsDTO); IPage arriveUnloadPageList(IPage page, @Param("param") LoadCarsDTO loadCarsDTO); + } 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 385ff26cf..2f67445f7 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 @@ -115,7 +115,6 @@ + + + + + + + + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java index 0a5408dfa..4be62d33b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.java @@ -7,6 +7,7 @@ import com.logpm.trunkline.entity.TrunklineCarsOrderEntity; import com.logpm.trunkline.vo.CarsLoadAllOrderVO; import com.logpm.trunkline.vo.LoadZeroListVO; import com.logpm.trunkline.vo.NodeNumDataVO; +import com.logpm.trunkline.vo.UnloadZeroVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -22,4 +23,6 @@ public interface TrunklineCarsOrderMapper extends BaseMapper findZeroList(@Param("loadId") Long loadId, @Param("nodeId") Long warehouseId); + List findUnloadZeroList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml index c19690d3d..d4ef6aaa2 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsOrderMapper.xml @@ -63,4 +63,15 @@ ltco.plan_num + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.java index 761766509..c44cb0b7e 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsUnloadScanMapper.java @@ -13,5 +13,7 @@ public interface TrunklineCarsUnloadScanMapper extends BaseMapper + + diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLineService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLineService.java index 5810a5b68..9609fdc92 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLineService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadLineService.java @@ -3,6 +3,7 @@ package com.logpm.trunkline.service; import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity; import org.springblade.core.mp.base.BaseService; +import java.math.BigDecimal; import java.util.List; public interface ITrunklineCarsLoadLineService extends BaseService { @@ -22,4 +23,6 @@ public interface ITrunklineCarsLoadLineService extends BaseService findListMoreSortByLoadId(Long loadId, Integer sort); List findListByLoadId(Long loadId); + + BigDecimal getAllNodeFee(Long loadId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java index 6f373a377..4fbc84051 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java @@ -1,8 +1,12 @@ package com.logpm.trunkline.service; +import com.logpm.trunkline.dto.ProductInfoDTO; import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity; +import com.logpm.trunkline.vo.ProductUnloadInfoVO; import org.springblade.core.mp.base.BaseService; +import java.util.List; + public interface ITrunklineCarsLoadScanService extends BaseService { Integer findNumByLoadId(Long loadId); @@ -14,4 +18,13 @@ public interface ITrunklineCarsLoadScanService extends BaseService findListByLoadIdAndWaybillNo(Long loadId, String waybillNo); + + TrunklineCarsLoadScanEntity findEntityByLoadIdAndOrderPackageCode(Long loadId, String orderPackageCode); + + List findUnloadTrayGoodsList(Long loadId, Long warehouseId, String trayCode); + + List findProductInfoList(Long loadId, String trayCode, String waybillNo); + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java index 493d901c6..963256954 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java @@ -6,6 +6,7 @@ import com.logpm.trunkline.dto.ProductInfoDTO; import com.logpm.trunkline.dto.TrunklineCarsLoadDTO; import com.logpm.trunkline.entity.TrunklineCarsLoadEntity; import com.logpm.trunkline.vo.TripartiteTransferVO; +import com.logpm.trunkline.vo.TrunklineCarsLoadLineVO; import com.logpm.trunkline.vo.TrunklineCarsLoadVO; import org.springblade.core.mp.base.BaseService; import org.springblade.core.tool.api.R; @@ -91,9 +92,9 @@ public interface ITrunklineCarsLoadService extends BaseService productInfoList, Long warehouseId,String trayCode); + R unloadZero(Long loadId, String waybillNo,List productInfoList, Long warehouseId,Integer unbindTray); R findLoadScanWaybillDetailList(Long loadId, String waybillNo, Long warehouseId); @@ -102,4 +103,14 @@ public interface ITrunklineCarsLoadService extends BaseService findListByLoadIdAndNodeId(Long loadId, Long nodeId); List findZeroList(Long loadId, Long warehouseId); + + List findUnloadZeroList(Long loadId, Long warehouseId); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java index 637618ffb..30ef2dd56 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsUnloadScanService.java @@ -11,4 +11,6 @@ public interface ITrunklineCarsUnloadScanService extends BaseService findListByLoadIdAndWaybillNo(Long loadId, String waybillNo) { + return baseMapper.findListByLoadIdAndWaybillNo(loadId,waybillNo); + } + + @Override + public TrunklineCarsLoadScanEntity findEntityByLoadIdAndOrderPackageCode(Long loadId, String orderPackageCode) { + return baseMapper.findEntityByLoadIdAndOrderPackageCode(loadId,orderPackageCode); + } + + @Override + public List findUnloadTrayGoodsList(Long loadId, Long warehouseId, String trayCode) { + return baseMapper.findUnloadTrayGoodsList(loadId,warehouseId,trayCode); + } + + @Override + public List findProductInfoList(Long loadId, String trayCode, String waybillNo) { + return baseMapper.findProductInfoList(loadId,trayCode,waybillNo); + } } 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 bf4a7f8d4..800aa6420 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 @@ -71,7 +71,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("id_deleted",0) + queryWrapper.eq("is_deleted",0) .eq("load_id",loadId); List list = trunklineCarsLoadLineService.list(queryWrapper); trunklineCarsLoadVO.setCarsLoadLineList(list); @@ -759,7 +759,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl page = new Page<>(); + page.setCurrent(loadCarsDTO.getPageNum()); + page.setSize(loadCarsDTO.getPageSize()); + Integer type = loadCarsDTO.getType(); + + Date start = CommonUtil.getStartByDateStr(loadCarsDTO.getStartDate()); + Date end = CommonUtil.getStartByDateStr(loadCarsDTO.getEndDate()); + loadCarsDTO.setStartDate(CommonUtil.dateToStringGeneral(start)); + loadCarsDTO.setEndDate(CommonUtil.dateToStringGeneral(end)); + + IPage pageList = baseMapper.carsLoadPageList(page,loadCarsDTO); + return R.data(pageList); + } + + @Override + public R findLoadFeeByNodeId(Long loadId,Long warehouseId) { + + TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); + if(Objects.isNull(carsLoadEntity)){ + log.warn("##################findLoadFeeByNodeId: 配载or三方计划不存在 loadId={}",loadId); + return R.fail(405,"计划不存在"); + } + + TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); + if(Objects.isNull(carsLoadLineEntity)){ + log.warn("##################findLoadFeeByNodeId: 节点信息不存在 loadId={} warehouseId={}",loadId,warehouseId); + return R.fail(405,"节点信息不存在"); + } + + return R.data(carsLoadLineEntity); + } + + @Override + public R updateLoadFeeByNodeId(TrunklineCarsLoadLineVO carsLoadLineVO) { + + trunklineCarsLoadLineService.updateById(carsLoadLineVO); + + Long loadId = carsLoadLineVO.getLoadId(); + + TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); + if(Objects.isNull(carsLoadEntity)){ + log.warn("##########updateLoadFeeByNodeId: 配载计划信息不存在 loadId={}",loadId); + return R.fail(405,"配载计划信息不存在"); + } + + //重新计算配载计划的费用 + BigDecimal countTransportCost = trunklineCarsLoadLineService.getAllNodeFee(loadId); + carsLoadEntity.setCountTransportCost(countTransportCost); + + updateById(carsLoadEntity); + + return R.success("修改成功"); + } + @Override public R loadingTrayInfo(LoadCarsDTO loadCarsDTO) { log.info("##############loadingTrayInfo: 查询托盘的货物信息"); @@ -1692,7 +1784,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl productInfoList, Long warehouseId,String trayCode) { + public R unloadZero(Long loadId, String waybillNo,List productInfoList, Long warehouseId,Integer unbindTray) { log.info("#############unloadZero: 卸车零担"); TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); @@ -2153,11 +2249,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("load_id",loadId) .eq("warehouse_id",warehouseId) @@ -2304,14 +2407,19 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl packageList = trunklineCarsUnloadScanService.list(queryWrapper); //查询已装车的零担 - List zeroList = trunklineCarsOrderService.findZeroList(loadId,warehouseId); + List zeroList = trunklineCarsOrderService.findUnloadZeroList(loadId,warehouseId); + for (UnloadZeroVO unloadZeroVO : zeroList) { + String waybillNo = unloadZeroVO.getWaybillNo(); + List list = trunklineCarsLoadScanService.findListByLoadIdAndWaybillNo(loadId,waybillNo); + unloadZeroVO.setProductUnloadInfoList(list); + } TrunklineCarsLoadVO trunklineCarsLoadVO = new TrunklineCarsLoadVO(); BeanUtil.copy(carsLoadEntity,trunklineCarsLoadVO); trunklineCarsLoadVO.setCarsUnloadScanPackageList(packageList); - trunklineCarsLoadVO.setZeroList(zeroList); + trunklineCarsLoadVO.setUnloadZeroList(zeroList); return R.data(trunklineCarsLoadVO); } @@ -2357,5 +2465,58 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl list = trunklineCarsLoadScanService.findUnloadTrayGoodsList(loadId,warehouseId,trayCode); + if(list.isEmpty()){ + log.warn("###############findUnloadTrayGoodsList: 托盘上没有该节点的卸货数据 loadId={} trayCode={} warehouseId={]",loadId,trayCode,warehouseId); + return R.fail(405,"托盘上没有该节点的卸货数据"); + } + + return R.data(list); + } + + @Override + public R unloadTray(Long loadId, String trayCode, Long warehouseId) { + TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); + if(Objects.isNull(carsLoadEntity)){ + log.warn("###############unloadTray: 配载计划不存在 loadId={}",loadId); + return R.fail(405,"配载计划不存在"); + } + //查询该节点有没有该托盘的信息 + List list = trunklineCarsLoadScanService.findUnloadTrayGoodsList(loadId,warehouseId,trayCode); + Set set = new TreeSet<>(); + for (TrunklineCarsLoadScanEntity carsLoadScanEntity : list) { + Integer type = carsLoadScanEntity.getType(); + String scanCode = carsLoadScanEntity.getScanCode(); + if(type == 1){ + //包件 + unloadPackage(loadId,scanCode,warehouseId,0); + }else if(type == 2){ + String waybillNo = carsLoadScanEntity.getWaybillNo(); + set.add(waybillNo); + } + } + + //零担处理 + for (String waybillNo:set){ + List productInfoList = trunklineCarsLoadScanService.findProductInfoList(loadId,trayCode,waybillNo); + unloadZero(loadId,waybillNo,productInfoList,warehouseId,0); + } + + //处理托盘的入库和货物的入库 + trayTypeClient.changeTrayWarehouseInfo(trayCode,warehouseId); + + return R.success("卸车成功"); + } + } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java index 960414bf7..80f0bcbc2 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsOrderEntityServiceImpl.java @@ -8,6 +8,7 @@ import com.logpm.trunkline.service.ITrunklineCarsOrderService; import com.logpm.trunkline.vo.CarsLoadAllOrderVO; import com.logpm.trunkline.vo.LoadZeroListVO; import com.logpm.trunkline.vo.NodeNumDataVO; +import com.logpm.trunkline.vo.UnloadZeroVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; @@ -43,4 +44,9 @@ public class TrunklineCarsOrderEntityServiceImpl extends BaseServiceImpl findZeroList(Long loadId, Long warehouseId) { return baseMapper.findZeroList(loadId,warehouseId); } + + @Override + public List findUnloadZeroList(Long loadId, Long warehouseId) { + return baseMapper.findUnloadZeroList(loadId, warehouseId); + } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java index 5b51a31c5..5544f08cb 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsUnloadScanServiceImpl.java @@ -31,4 +31,9 @@ public class TrunklineCarsUnloadScanServiceImpl extends BaseServiceImpl + + update logpm_warehouse_tray_goods + set warehouse_id = #{warehouseId} + where tray_type_id = #{trayTypeId} + + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java index 281e815b5..9fc835b68 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayGoodsService.java @@ -83,4 +83,6 @@ public interface IWarehouseTrayGoodsService extends BaseService getTrayGoodsByStockNoAllocationId(Long marketId, String materialCode, String incomingBatch,Long warehouseId); Integer getNumByZation(Long id); + + void updeteWarehouseIdByTrayTypeId(Long trayTypeId, Long warehouseId); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java index 4b4ca12bf..884632b61 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java @@ -95,4 +95,5 @@ public interface IWarehouseTrayTypeService extends BaseService findAllGoodsByTrayCodeAndWarehouseId(String trayCode, Long warehouseId); + void changeTrayWarehouseInfo(String trayCode, Long warehouseId); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java index 4923fe2c0..c8311212d 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java @@ -275,6 +275,11 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl().lambda() diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java index f797a4ab2..2fdf37a42 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java @@ -2724,6 +2724,22 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("tray_code",trayCode) + .eq("is_deleted",0); + WarehouseTrayTypeEntity trayTypeEntity = baseMapper.selectOne(queryWrapper); + trayTypeEntity.setWarehouseId(warehouseId); + updateById(trayTypeEntity); + + Long trayTypeId = trayTypeEntity.getId(); + + warehouseTrayGoodsService.updeteWarehouseIdByTrayTypeId(trayTypeId,warehouseId); + + } + private R moveTrayOrderPackageCode(WarehouseTrayTypeEntity trayTypeEntity, String orderPackageCode) { Long wid = trayTypeEntity.getWarehouseId();