This commit is contained in:
zhangchenbiao
2024-04-23 16:38:52 +08:00
parent 377873d8f1
commit f79c028ca4
4 changed files with 14 additions and 5 deletions

View File

@@ -8,6 +8,7 @@
<result column="rent_type" jdbcType="TINYINT" property="rentType" /> <result column="rent_type" jdbcType="TINYINT" property="rentType" />
<result column="sign_time" jdbcType="TIMESTAMP" property="signTime" /> <result column="sign_time" jdbcType="TIMESTAMP" property="signTime" />
<result column="contract_start_time" jdbcType="TIMESTAMP" property="contractStartTime" /> <result column="contract_start_time" jdbcType="TIMESTAMP" property="contractStartTime" />
<result column="contract_end_time" jdbcType="TIMESTAMP" property="contractEndTime" />
<result column="contract_months" jdbcType="INTEGER" property="contractMonths" /> <result column="contract_months" jdbcType="INTEGER" property="contractMonths" />
<result column="shop_rent_type" jdbcType="TINYINT" property="shopRentType" /> <result column="shop_rent_type" jdbcType="TINYINT" property="shopRentType" />
<result column="month_rent" jdbcType="VARCHAR" property="monthRent" /> <result column="month_rent" jdbcType="VARCHAR" property="monthRent" />
@@ -23,7 +24,7 @@
</resultMap> </resultMap>
<sql id="allColumn"> <sql id="allColumn">
id, shop_id, point_id, rent_type, sign_time, contract_start_time, contract_months, shop_rent_type, id, shop_id, point_id, rent_type, sign_time, contract_start_time, contract_end_time, contract_months, shop_rent_type,
month_rent, first_year_month_rent, second_year_month_rent, third_year_month_rent, contract_pic, month_rent, first_year_month_rent, second_year_month_rent, third_year_month_rent, contract_pic,
house_certificate_pic, audit_id, deleted, create_time, update_time house_certificate_pic, audit_id, deleted, create_time, update_time
</sql> </sql>

View File

@@ -42,6 +42,12 @@ public class ShopRentInfoDO {
@Column(name = "contract_start_time") @Column(name = "contract_start_time")
private Date contractStartTime; private Date contractStartTime;
/**
* 合同结束日期
*/
@Column(name = "contract_end_time")
private Date contractEndTime;
/** /**
* 签约年限 * 签约年限
*/ */

View File

@@ -40,6 +40,9 @@ public class AddRentContractRequest {
@ApiModelProperty("合同开始日期") @ApiModelProperty("合同开始日期")
private Date contractStartTime; private Date contractStartTime;
@ApiModelProperty("合同结束日期")
private Date contractEndTime;
@ApiModelProperty("签约年限") @ApiModelProperty("签约年限")
private Integer contractMonths; private Integer contractMonths;
@@ -79,7 +82,7 @@ public class AddRentContractRequest {
} }
return true; return true;
} }
if(Objects.isNull(signTime) || Objects.isNull(contractStartTime)){ if(Objects.isNull(signTime) || Objects.isNull(contractStartTime) || Objects.isNull(contractEndTime)){
return false; return false;
} }
if(Objects.isNull(contractMonths) || Objects.isNull(shopRentType)){ if(Objects.isNull(contractMonths) || Objects.isNull(shopRentType)){
@@ -111,6 +114,7 @@ public class AddRentContractRequest {
shopRentInfoDO.setRentType(param.getRentType()); shopRentInfoDO.setRentType(param.getRentType());
shopRentInfoDO.setSignTime(param.getSignTime()); shopRentInfoDO.setSignTime(param.getSignTime());
shopRentInfoDO.setContractStartTime(param.getContractStartTime()); shopRentInfoDO.setContractStartTime(param.getContractStartTime());
shopRentInfoDO.setContractEndTime(param.getContractEndTime());
shopRentInfoDO.setContractMonths(param.getContractMonths()); shopRentInfoDO.setContractMonths(param.getContractMonths());
shopRentInfoDO.setShopRentType(param.getShopRentType()); shopRentInfoDO.setShopRentType(param.getShopRentType());
shopRentInfoDO.setMonthRent(param.getMonthRent()); shopRentInfoDO.setMonthRent(param.getMonthRent());

View File

@@ -82,9 +82,7 @@ public class ShopRentInfoVO {
result.setSignTime(shopRentInfo.getSignTime()); result.setSignTime(shopRentInfo.getSignTime());
if(RentTypeEnum.RENT.getCode().equals(shopRentInfo.getRentType())){ if(RentTypeEnum.RENT.getCode().equals(shopRentInfo.getRentType())){
result.setContractStartTime(shopRentInfo.getContractStartTime()); result.setContractStartTime(shopRentInfo.getContractStartTime());
LocalDate start = shopRentInfo.getContractStartTime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDate(); result.setContractEndTime(shopRentInfo.getContractEndTime());
Instant instant = start.plusMonths(shopRentInfo.getContractMonths()).minusDays(1L).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
result.setContractEndTime(Date.from(instant));
result.setContractMonths(shopRentInfo.getContractMonths()); result.setContractMonths(shopRentInfo.getContractMonths());
} }
result.setShopRentType(shopRentInfo.getShopRentType()); result.setShopRentType(shopRentInfo.getShopRentType());