From 3c33812401201ed351411485f83941c626ec367f Mon Sep 17 00:00:00 2001 From: mashuai Date: Wed, 4 Dec 2024 10:50:10 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/bonus/material/lease/domain/MaLeaseDto.java | 6 ++++++ .../com/bonus/material/lease/domain/MaLeaseInfo.java | 6 ++++++ .../lease/service/impl/MaLeaseInfoServiceImpl.java | 9 ++++++--- .../mapper/material/lease/MaLeaseInfoMapper.xml | 5 +++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/domain/MaLeaseDto.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/domain/MaLeaseDto.java index eadebb4..9f68567 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/domain/MaLeaseDto.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/domain/MaLeaseDto.java @@ -2,6 +2,7 @@ package com.bonus.material.lease.domain; import com.bonus.common.core.web.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @@ -71,4 +72,9 @@ public class MaLeaseDto extends BaseEntity { private String orderUser; + @ApiModelProperty(value = "需求发布公司") + private String publishCompany; + + @ApiModelProperty(value = "接单公司") + private String orderCompany; } diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/domain/MaLeaseInfo.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/domain/MaLeaseInfo.java index 7267570..a719410 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/domain/MaLeaseInfo.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/domain/MaLeaseInfo.java @@ -81,6 +81,9 @@ public class MaLeaseInfo extends BaseEntity implements Serializable { */ private String publishUser; + @ApiModelProperty(value = "需求发布公司") + private String publishCompany; + /** * 需求截止日期(年月日) */ @@ -107,6 +110,9 @@ public class MaLeaseInfo extends BaseEntity implements Serializable { */ private String orderUser; + @ApiModelProperty(value = "接单公司") + private String orderCompany; + /** * 接单时间 */ diff --git a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/service/impl/MaLeaseInfoServiceImpl.java b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/service/impl/MaLeaseInfoServiceImpl.java index 9defb47..be082e2 100644 --- a/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/service/impl/MaLeaseInfoServiceImpl.java +++ b/bonus-modules/bonus-material-mall/src/main/java/com/bonus/material/lease/service/impl/MaLeaseInfoServiceImpl.java @@ -179,8 +179,8 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService { @Override public List list(MaLeaseDto dto) { //获取当前登录人id - Long userId = SecurityUtils.getUserId(); - dto.setCreateBy(String.valueOf(userId)); + String companyId = String.valueOf(SecurityUtils.getLoginUser().getSysUser().getCompanyId()); + dto.setPublishCompany(companyId); List list = leaseInfoMapper.list(dto); //查询列表中数据,如果需求截止日期超过当前,则修改状态为已过期 for (MaLeaseVo maLeaseVo : list) { @@ -260,7 +260,9 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService { return AjaxResult.error(HttpCodeEnum.TO_PARAM_NULL.getCode(), HttpCodeEnum.TO_PARAM_NULL.getMsg()); } Long userId = SecurityUtils.getUserId(); + Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId(); maLeaseInfo.setOrderUser(String.valueOf(userId)); + maLeaseInfo.setOrderCompany(String.valueOf(companyId)); maLeaseInfo.setOrderTime(DateUtils.getNowDate()); maLeaseInfo.setLeaseStatus(LeaseInfoEnum.LEASE_ORDER_RECEIVED.getStatus()); int result = leaseInfoMapper.updateDevInfo(maLeaseInfo); @@ -274,7 +276,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService { */ @Override public List rentList(MaLeaseDto dto) { - dto.setOrderUser(String.valueOf(SecurityUtils.getUserId())); + dto.setOrderCompany(String.valueOf(SecurityUtils.getLoginUser().getSysUser().getCompanyId())); return leaseInfoMapper.rentList(dto); } @@ -291,6 +293,7 @@ public class MaLeaseInfoServiceImpl implements MaLeaseInfoService { maLeaseInfo.setLeaseStatus(LeaseInfoEnum.LEASE_PENDING_ORDER.getStatus()); maLeaseInfo.setStartTime(DateUtils.getNowDate()); maLeaseInfo.setPublishUser(String.valueOf(userId)); + maLeaseInfo.setPublishCompany(String.valueOf(SecurityUtils.getLoginUser().getSysUser().getCompanyId())); } /** diff --git a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/lease/MaLeaseInfoMapper.xml b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/lease/MaLeaseInfoMapper.xml index 3f17073..5e5900c 100644 --- a/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/lease/MaLeaseInfoMapper.xml +++ b/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/lease/MaLeaseInfoMapper.xml @@ -70,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, update_time = #{updateTime}, order_user = #{orderUser}, + order_company = #{orderCompany}, order_time = #{orderTime}, where id = #{id} @@ -196,7 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_company_info c ON m.company_id = c.company_id LEFT JOIN sys_user su ON m.publish_user = su.user_id LEFT JOIN sys_user su1 ON m.order_user = su1.user_id - WHERE 1 = 1 and m.create_by = #{createBy} + WHERE 1 = 1 and m.publish_company = #{publishCompany} and m.lease_code like concat('%',#{leaseCode},'%') @@ -378,7 +379,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN base_address b ON b.id = m.area_id LEFT JOIN sys_user su ON m.publish_user = su.user_id LEFT JOIN sys_user su1 ON m.order_user = su1.user_id - WHERE 1 = 1 and m.order_user = #{orderUser} and m.lease_status = '1' + WHERE 1 = 1 and m.order_company = #{orderCompany} and m.lease_status = '1' and m.lease_code like concat('%',#{leaseCode},'%')