| @@ -133,6 +133,13 @@ public class WxPropertyContract implements Serializable { | |||
| /*租金合同ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | |||
| private Long rentContractId; | |||
| @io.swagger.annotations.ApiModelProperty(value = "起租开始时间", name = "rentalStartDate") | |||
| private Date startDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "起租结束时间", name = "rentalEndDate") | |||
| private Date endDate; | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| @@ -296,7 +303,21 @@ public class WxPropertyContract implements Serializable { | |||
| rentContractId = _rentContractId; | |||
| } | |||
| public Date getStartDate() { | |||
| return startDate; | |||
| } | |||
| public void setStartDate(Date startDate) { | |||
| this.startDate = startDate; | |||
| } | |||
| public Date getEndDate() { | |||
| return endDate; | |||
| } | |||
| public void setEndDate(Date endDate) { | |||
| this.endDate = endDate; | |||
| } | |||
| public static enum Field | |||
| { | |||
| @@ -171,6 +171,11 @@ public class WxRentContract implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value = "营业额", name = "revenue") | |||
| private Integer revenue; | |||
| @io.swagger.annotations.ApiModelProperty(value = "起租开始时间", name = "rentalStartDate") | |||
| private Date startDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "起租结束时间", name = "rentalEndDate") | |||
| private Date endDate; | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| @@ -420,6 +425,22 @@ public class WxRentContract implements Serializable { | |||
| this.revenue = revenue; | |||
| } | |||
| public Date getStartDate() { | |||
| return startDate; | |||
| } | |||
| public void setStartDate(Date startDate) { | |||
| this.startDate = startDate; | |||
| } | |||
| public Date getEndDate() { | |||
| return endDate; | |||
| } | |||
| public void setEndDate(Date endDate) { | |||
| this.endDate = endDate; | |||
| } | |||
| public static enum Field { | |||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), MerchantId_ASC("`merchant_id` ASC"), MerchantId_DESC("`merchant_id` DESC"), Price_ASC("`price` ASC"), Price_DESC("`price` DESC"), RentalStartDate_ASC("`rental_start_date` ASC"), RentalStartDate_DESC("`rental_start_date` DESC"), RentalEndDate_ASC("`rental_end_date` ASC"), RentalEndDate_DESC("`rental_end_date` DESC"), SignDate_ASC("`sign_date` ASC"), SignDate_DESC("`sign_date` DESC"), ReceivePeriod_ASC("`receive_period` ASC"), ReceivePeriod_DESC("`receive_period` DESC"), TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), Filepath_ASC("`filepath` ASC"), Filepath_DESC("`filepath` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), ContractNumber_ASC("`contract_number` ASC"), ContractNumber_DESC("`contract_number` DESC"), Deposit_ASC("`deposit` ASC"), Deposit_DESC("`deposit` DESC"), PayDate_ASC("`pay_date` ASC"), PayDate_DESC("`pay_date` DESC"), IsDel_ASC("`is_del` ASC"), IsDel_DESC("`is_del` DESC"), MerchantName_ASC("`merchant_name` ASC"), MerchantName_DESC("`merchant_name` DESC"), Brand_ASC("`brand` ASC"), Brand_DESC("`brand` DESC"), BusinessId_ASC("`business_id` ASC"), BusinessId_DESC("`business_id` DESC"), ShopType_ASC("`shop_type` ASC"), ShopType_DESC("`shop_type` DESC"), ShopId_ASC("`shop_id` ASC"), ShopId_DESC("`shop_id` DESC"), Updatetime_ASC("`updatetime` ASC"), Updatetime_DESC("`updatetime` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC"); | |||
| private String value; | |||
| @@ -145,11 +145,21 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| //计租开始时间 | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(record.getRentalStartDate()); | |||
| instance.add(Calendar.MONTH, record.getLease()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setRentalEndDate(instance.getTime()); | |||
| //起租结束时间 | |||
| if(!record.getStartDate().equals(record.getRentalStartDate())){ | |||
| instance.clear(); | |||
| instance.setTime(record.getRentalStartDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setEndDate(instance.getTime()); | |||
| }else{ | |||
| record.setEndDate(record.getStartDate()); | |||
| } | |||
| Date date = new Date(); | |||
| record.setCreatetime(date); | |||
| record.setUpdatetime(date); | |||
| @@ -187,6 +197,15 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| instance.add(Calendar.MONTH, record.getLease()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setRentalEndDate(instance.getTime()); | |||
| //起租结束时间 | |||
| if(!record.getStartDate().equals(record.getRentalStartDate())){ | |||
| instance.clear(); | |||
| instance.setTime(record.getRentalStartDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setEndDate(instance.getTime()); | |||
| }else{ | |||
| record.setEndDate(record.getStartDate()); | |||
| } | |||
| record.setPrice(record.getPrice() != null ? record.getPrice() : 0); | |||
| record.setDeposit(record.getDeposit() != null ? record.getDeposit() : 0); | |||
| record.setUpdatetime(new Date()); | |||
| @@ -118,11 +118,25 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| if (record.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| if(record.getStartDate().after(record.getRentalStartDate())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR,"起租开始时间不能大于计租开始时间"); | |||
| } | |||
| //计租开始时间 | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(record.getRentalStartDate()); | |||
| instance.add(Calendar.MONTH, record.getLease()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setRentalEndDate(instance.getTime()); | |||
| //起租结束时间 | |||
| if(!record.getStartDate().equals(record.getRentalStartDate())){ | |||
| instance.clear(); | |||
| instance.setTime(record.getRentalStartDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setEndDate(instance.getTime()); | |||
| }else{ | |||
| record.setEndDate(record.getStartDate()); | |||
| } | |||
| Date date = new Date(); | |||
| record.setCreatetime(date); | |||
| record.setUpdatetime(date); | |||
| @@ -155,6 +169,16 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setRentalEndDate(instance.getTime()); | |||
| //起租结束时间 | |||
| if(!record.getStartDate().equals(record.getRentalStartDate())){ | |||
| instance.clear(); | |||
| instance.setTime(record.getRentalStartDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setEndDate(instance.getTime()); | |||
| }else{ | |||
| record.setEndDate(record.getStartDate()); | |||
| } | |||
| if (record.getType().equals(EnumRentContractType.RENT_BY_JOINT.getCode())) { | |||
| if (record.getRevenue() == null || record.getRevenue().intValue() == 0) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR, "营业额不能为空且大于0"); | |||
| @@ -30,10 +30,17 @@ | |||
| <result column="filename" jdbcType="VARCHAR" property="filename"/> | |||
| <result column="lease" jdbcType="INTEGER" property="lease"/> | |||
| <result column="rent_contract_id" jdbcType="BIGINT" property="rentContractId"/> | |||
| <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/> | |||
| <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`rent_area`,`link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id` | |||
| `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`, | |||
| `sign_date`,`receive_period`,`tenant_id`,`filepath`,`status`,`contract_number`, | |||
| `deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`, | |||
| `shop_type`,`shop_id`,`updatetime`,`createtime`,`rent_area`, | |||
| `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`, | |||
| `start_date`,`end_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -66,6 +73,8 @@ | |||
| <if test=" null != filename ">and `filename` = #{filename}</if> | |||
| <if test=" null != lease ">and `lease` = #{lease}</if> | |||
| <if test=" null != rentContractId ">and `rent_contract_id` = #{rentContractId}</if> | |||
| <if test=" null != startDate ">and `start_date` = #{startDate}</if> | |||
| <if test=" null != endDate ">and `end_date` = #{endDate}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| @@ -84,10 +93,10 @@ | |||
| <select id="queryPropertyContractData" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select rc.id,rc.merchant_name merchantName,rc.rental_start_date rentalStartDate,rc.rental_end_date | |||
| rentalEndDate,rc.`status`, | |||
| rc.price,rc.contract_number contractNumber,s.shop_number shopNumber,f.floor_name floorName,b.building_name | |||
| buildingName,receive_period receivePeriod, | |||
| rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate | |||
| rentalEndDate,rc.`status`,rc.price,rc.contract_number contractNumber,s.shop_number shopNumber, | |||
| f.floor_name floorName,b.building_name buildingName,receive_period receivePeriod, | |||
| rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate, | |||
| start_date startDate,end_date endDate | |||
| from wx_property_contract rc | |||
| left join wx_shop s on rc.shop_id=s.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| @@ -33,14 +33,17 @@ | |||
| <result column="adjust_ratio" jdbcType="INTEGER" property="adjustRatio"/> | |||
| <result column="adjust_period" jdbcType="INTEGER" property="adjustPeriod"/> | |||
| <result column="pay_ratio" jdbcType="INTEGER" property="payRatio"/> | |||
| <result column="start_date" jdbcType="TIMESTAMP" property="startDate"/> | |||
| <result column="end_date" jdbcType="TIMESTAMP" property="endDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`merchant_id`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`, | |||
| `tenant_id`,`filepath`,`status`,`contract_number`,`deposit`,`pay_date`,`is_del`,`merchant_name`, | |||
| `brand`,`business_id`,`shop_type`,`shop_id`,`updatetime`,`createtime`,`link_person`,`link_phone`, | |||
| `pay_account`,`filename`,`lease`,`type`,`revenue`,`adjust_ratio`,`adjust_period`,`pay_ratio` | |||
| `pay_account`,`filename`,`lease`,`type`,`revenue`,`adjust_ratio`,`adjust_period`,`pay_ratio`, | |||
| `start_date`,`end_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -72,7 +75,9 @@ | |||
| <if test=" null != filename ">and `filename` = #{filename}</if> | |||
| <if test=" null != lease ">and `lease` = #{lease}</if> | |||
| <if test=" null != type ">and `type` = #{type}</if> | |||
| <if test=" null != startDate ">and `start_date` = #{startDate}</if> | |||
| <if test=" null != endDate ">and `end_date` = #{endDate}</if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| @@ -93,7 +98,8 @@ | |||
| <select id="queryRentContractData" resultType="hashmap" parameterType="com.iformall.domain.po.WxRentContract"> | |||
| select rc.id,rc.merchant_name merchantName,rc.rental_start_date rentalStartDate,rc.rental_end_date rentalEndDate,rc.`status`, | |||
| rc.price,rc.contract_number contractNumber,s.shop_number shopNumber,f.floor_name floorName,b.building_name buildingName, | |||
| rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type | |||
| rc.lease,rc.filepath,rc.filename,rc.pay_account payAccount,rc.sign_date signDate,rc.merchant_id merchantId,rc.type, | |||
| rc.start_date startDate,rc.end_date endDate | |||
| from wx_rent_contract rc | |||
| left join wx_shop s on rc.shop_id=s.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||