From d9e5d5187e1fec6820d9923fd9538c3100801096 Mon Sep 17 00:00:00 2001 From: zhou-hongcheng <1064771933@qq.com> Date: Fri, 6 Feb 2026 10:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BB=93=E5=BA=93id=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=88=97=E8=A1=A8=EF=BC=8C=E6=A0=B9=E6=8D=AE=E4=BB=93?= =?UTF-8?q?=E5=BA=93id=E6=9F=A5=E8=AF=A2=E4=BB=93=E5=BA=93=E5=90=8D?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/Lease/LeaseApplicationService.java | 15 +++++++++++++++ .../basic/domain/lease/repository/po/LeasePO.java | 8 ++++---- .../resources/mapper/basic/lease/LeaseMapper.xml | 3 +++ 3 files changed, 22 insertions(+), 4 deletions(-) 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 940188a7c..c91db2035 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 @@ -23,8 +23,10 @@ import com.mhd.basic.interfaces.dto.shipperLeaseDetailsApi.ShipperLeaseDetailsDT import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.system.api.SystemServiceFeign; import com.mhd.system.api.WmsServiceFeign; import com.mhd.system.api.domain.MaterialInventoryDTO; +import com.mhd.system.api.domain.WarehouseFeignPO; import com.mhd.system.api.model.LoginUser; import com.mhd.system.service.ISysDictTypeService; import io.swagger.annotations.ApiModelProperty; @@ -118,9 +120,22 @@ public class LeaseApplicationService { if (ObjectUtil.isNotEmpty(timeOverlapSimple)) { throw new ServiceException("同一货主租赁信息时间不能重叠"); } + setWarehouseInfo(leaseDO); return leaseDomainService.insert(leaseDO); } + @Autowired + private SystemServiceFeign systemServiceFeign; + + private void setWarehouseInfo(LeaseDO leaseDO) { + AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(leaseDO.getWarehouseId()); + if(!"200".equals(String.valueOf(ajaxResult.get("code")))){ + throw new ServiceException("获取仓库信息失败"); + } + WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class); + leaseDO.setWarehouseName(warehouseFeignPO.getWarehouseName()); + } + private List isTimeOverlapSimple(String cargoOwnerName, Date startDate, Date endDate, Long excludeId) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(Lease::getCargoOwnerName, cargoOwnerName) diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/lease/repository/po/LeasePO.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/lease/repository/po/LeasePO.java index ce7433ac6..b934f01ad 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/lease/repository/po/LeasePO.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/lease/repository/po/LeasePO.java @@ -53,13 +53,13 @@ public class LeasePO extends BaseVOEntity{ private BigDecimal leaseArea; @ApiModelProperty("开始日期") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") private Date startDate; @ApiModelProperty("结束日期") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") private Date endDate; @ApiModelProperty("备注") diff --git a/mhd-modules/mhd-system/src/main/resources/mapper/basic/lease/LeaseMapper.xml b/mhd-modules/mhd-system/src/main/resources/mapper/basic/lease/LeaseMapper.xml index 60e23bde4..f8dbdcb3d 100644 --- a/mhd-modules/mhd-system/src/main/resources/mapper/basic/lease/LeaseMapper.xml +++ b/mhd-modules/mhd-system/src/main/resources/mapper/basic/lease/LeaseMapper.xml @@ -64,6 +64,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and organization_name like concat('%', #{organizationName}, '%') + + and warehouse_id = #{warehouseId} + and warehouse_name like concat('%', #{warehouseName}, '%')