diff --git a/mallinkAdmin/src/main/resources/db/migration/V202408000000002.sql b/mallinkAdmin/src/main/resources/db/migration/V202408000000002.sql new file mode 100644 index 000000000..dfa5545de --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V202408000000002.sql @@ -0,0 +1,7 @@ +ALTER TABLE wx_rent_contract ADD COLUMN first_bill_date_start timestamp COMMENT '首期账单开始时间'; +ALTER TABLE wx_rent_contract ADD COLUMN first_bill_date_end timestamp COMMENT '首期账单结束时间'; + +ALTER TABLE wx_property_contract ADD COLUMN first_bill_date_start timestamp COMMENT '首期账单开始时间'; +ALTER TABLE wx_property_contract ADD COLUMN first_bill_date_end timestamp COMMENT '首期账单结束时间'; + + diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java index ddba07f15..bb1a7e0bc 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxPropertyContract.java @@ -242,6 +242,12 @@ public class WxPropertyContract extends TenantEntity { private String shopNumbers; @TableField(exist = false) private List shopIdsQuery; + + @io.swagger.annotations.ApiModelProperty(value = "首期账单开始时间", name = "firstBillDateStart") + private Date firstBillDateStart; + + @io.swagger.annotations.ApiModelProperty(value = "首期账单结束时间", name = "firstBillDateEnd") + private Date firstBillDateEnd; //查询过期提醒 @TableField(exist = false) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java index 9f706c889..03d478bbd 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxRentContract.java @@ -447,6 +447,12 @@ public class WxRentContract extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value = "设计文件", name = "outDateNotifyPhone") private String designFile; + @io.swagger.annotations.ApiModelProperty(value = "首期账单开始时间", name = "firstBillDateStart") + private Date firstBillDateStart; + + @io.swagger.annotations.ApiModelProperty(value = "首期账单结束时间", name = "firstBillDateEnd") + private Date firstBillDateEnd; + //查询过期提醒 @TableField(exist = false) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 2c3259223..332ad3e80 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -711,6 +711,16 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService } } + if (null != billTimeVoList && billTimeVoList.size() > 0 ) { + BillTimeVo firstBillTime = billTimeVoList.get(0); + WxPropertyContract cupdate = new WxPropertyContract(); + cupdate.updateTenantInfo(wxPropertyContract); + cupdate.setId(wxPropertyContract.getId()); + cupdate.setFirstBillDateStart(firstBillTime.getStartDate()); + cupdate.setFirstBillDateEnd(firstBillTime.getEndDate()); + wxPropertyContractMapper.updateById(cupdate); + } + //结算其他金额 Date billStartDate = null; Date billEndDate = null; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 9382c5bc7..cb44d4304 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -825,22 +825,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { int dayType = wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; Date date = new Date(); - Calendar instance = Calendar.getInstance(); - instance.setTime(wxRentContract.getRentalStartDate()); - instance.add(Calendar.DAY_OF_MONTH, -1); - Date time = instance.getTime(); - //wxBillDeposit.setReceiveDate(time); - - //账单开始时间 - instance.clear(); - instance.setTime(time); - instance.add(Calendar.DAY_OF_MONTH, 1); - wxBillDeposit.setStarttime(instance.getTime()); - //账单结束时间 - instance.clear(); - instance.setTime(time); - instance.add(dayType, wxRentContract.getLease()); - wxBillDeposit.setEndtime(instance.getTime()); + wxBillDeposit.setStarttime(wxRentContract.getFirstBillDateStart()); + wxBillDeposit.setEndtime(wxRentContract.getFirstBillDateEnd()); + wxBillDeposit.setStatus(EnumBillStatus.WAIT_PAY.getCode()); //wxBillDeposit.setExpiredDay(0L); //wxBillDeposit.setReceiveDate(time); @@ -1245,6 +1232,16 @@ public class WxRentContractServiceImpl implements WxRentContractService { billTimeVoList.add(billTimeVo); } } + + if (null != billTimeVoList && billTimeVoList.size() > 0 ) { + BillTimeVo firstBillTime = billTimeVoList.get(0); + WxRentContract cupdate = new WxRentContract(); + cupdate.updateTenantInfo(wxRentContract); + cupdate.setId(wxRentContract.getId()); + cupdate.setFirstBillDateStart(firstBillTime.getStartDate()); + cupdate.setFirstBillDateEnd(firstBillTime.getEndDate()); + wxRentContractMapper.updateById(cupdate); + } //免租期 List freePeriods = getFreeDays(wxRentContract); diff --git a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml index f77dc3917..963e71dfa 100644 --- a/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPropertyContractMapper.xml @@ -64,13 +64,16 @@ + + + `id`,`merchant_id`,`decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`create_type`,`shop_ids`,`shop_numbers`, `sign_date`,`receive_period`,`tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,`price_detail`, `deposit`,`pay_date`,`is_del`,`merchant_name`,`brand`,`business_id`,`receive_period_unit`,`create_by`,`update_by`, - `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`,`fees_standards_info`, + `shop_type`,`updatetime`,`createtime`,`rent_area`,`rent_shop_type`,`fees_standards_info`,`first_bill_date_start`,`first_bill_date_end`, `link_person`,`link_phone`,`pay_account`,`filename`,`lease`,`rent_contract_id`,`day_price_calcute`,`month_average_days`, `start_date`,`end_date`,`apply_status`,`adjust_period`,`business_type`,adjust_ratio,`rent_info`,fixed_price, `file_names`,price_unit,rent_price,subject_name,rent_start_type,`operation_type`,late_pay_ratio,late_pay_day,end_contract_time,out_date_notify_days,out_date_notify_phone diff --git a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml index c9b39a10a..e7a2a7f6a 100644 --- a/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxRentContractMapper.xml @@ -131,6 +131,9 @@ + + + @@ -138,7 +141,7 @@ `shop_type_sub`,`lease_purpose`,`contractual_rules`,`delivery_date`,`delivery_grace_period`,`opening_date`,`business_hours`,`scope_metre`, `decimal_size`,`price`,`rental_start_date`,`rental_end_date`,`sign_date`,`receive_period`,`receive_period_unit`, `tenant_id`,`parent_tenant_id`,`filepath`,`status`,`contract_number`,`price_detail`,`create_by`,`update_by`, - `first_party_bank_info`,`second_party_bank_info`,`second_party_tax_info`,`day_price_calcute`, + `first_party_bank_info`,`second_party_bank_info`,`second_party_tax_info`,`day_price_calcute`,`first_bill_date_start`,`first_bill_date_end`, `property_name`,`property_fee`,`fee_cycle`,`water_fee`,`electricity_fees`,`month_average_days`,`free_period_remark`, `deposit`,cashtype_content_lsit,cashtype_lsit,`pay_date`,`is_del`,`merchant_name`,`revenue_jumps_remark`, `brand`,`business_id`,`shop_type`,`shop_type_str`,`updatetime`,`createtime`,`link_person`,`link_phone`,`link_address`, @@ -382,6 +385,8 @@ + + @@ -390,7 +395,7 @@ rc.price as rent_price,rc.contract_number,rc.shop_name,rc.type,rc.apply_status,rc.price_detail,rc.revenue_fixed_rent_price,rc.revenue_rent_price, rc.rent_shop_type,rc.rent_info,pc.price as property_price,rc.merchant_id,pc.`status` as property_status, rc.price_unit as rent_price_unit,pc.price_unit as property_price_unit,rc.day_price_calcute,rc.free_period_remark, - rc.business_type businessType,rc.month_average_days,rc.revenue_jumps_remark + rc.business_type businessType,rc.month_average_days,rc.revenue_jumps_remark,rc.first_bill_date_start,rc.first_bill_date_end from wx_rent_contract rc left join wx_property_contract pc on rc.id=pc.rent_contract_id