根据仓库id过滤列表,根据仓库id查询仓库名称

This commit is contained in:
zhou-hongcheng
2026-02-06 10:55:36 +08:00
parent 1e6173c74f
commit d9e5d5187e
3 changed files with 22 additions and 4 deletions
@@ -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<Lease> isTimeOverlapSimple(String cargoOwnerName, Date startDate, Date endDate, Long excludeId) {
LambdaQueryWrapper<Lease> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(Lease::getCargoOwnerName, cargoOwnerName)
@@ -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("备注")
@@ -64,6 +64,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="organizationName != null and organizationName != ''">
and organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="warehouseId != null and warehouseId != ''">
and warehouse_id = #{warehouseId}
</if>
<if test="warehouseName != null and warehouseName != ''">
and warehouse_name like concat('%', #{warehouseName}, '%')
</if>