From 809a190ccf0cd2f8adb10dbac0a0c3c01274e69c Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Sat, 14 Mar 2026 15:23:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=87=BA=E7=A7=9F=E7=8E=87?= =?UTF-8?q?=E7=A7=9F=E8=B5=81=E6=95=A3=E7=A7=9F=E9=9D=A2=E7=A7=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/Lease/LeaseApplicationService.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/Lease/LeaseApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/Lease/LeaseApplicationService.java index a168a29ac..43c8b8240 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/Lease/LeaseApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/Lease/LeaseApplicationService.java @@ -322,7 +322,21 @@ public class LeaseApplicationService { BeanUtils.copyProperties(ca, shipperLeaseDetails); shipperLeaseDetails.setBusinessDate(yesterday); // 散租面积直接使用租赁管理页面维护的面积 - shipperLeaseDetails.setLeaseArea(ca.getLeaseArea()); + //查询这个货主的物料面积 + BigDecimal leaseArea = BigDecimal.ZERO; + MaterialInventoryDTO materialInventoryDTO = new MaterialInventoryDTO(); + materialInventoryDTO.setShipperId(ca.getShipperId()); + materialInventoryDTO.setWarehouseId(ca.getWarehouseId()); + AjaxResult ajaxResult = WmsServiceFeign.materialInventoryApiListAll(materialInventoryDTO); + if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))) { + List batchDetailFeignPOList = JSON.parseArray( + com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), MaterialInventoryPO.class); + leaseArea = batchDetailFeignPOList.stream() + .map(MaterialInventoryPO::getArea) + .filter(Objects::nonNull) + .reduce(BigDecimal.ZERO, BigDecimal::add); + } + shipperLeaseDetails.setLeaseArea(leaseArea); log.info("货主:{},仓库:{},散租面积:{}(来自租赁管理)", ca.getCargoOwnerName(), ca.getWarehouseName(), ca.getLeaseArea()); // 如果已存在,则更新;否则新增