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

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

View File

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

View File

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