| @@ -191,6 +191,9 @@ public class WxPropertyContractController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | ||||
| WxPropertyContract dbRent = wxPropertyContractMapper.selectByPrimaryKey(wxPropertyContract.getId()); | WxPropertyContract dbRent = wxPropertyContractMapper.selectByPrimaryKey(wxPropertyContract.getId()); | ||||
| dbRent.setPreviewBillRentList(wxPropertyContract.getPreviewBillRentList()); | dbRent.setPreviewBillRentList(wxPropertyContract.getPreviewBillRentList()); | ||||
| if(dbRent.getRentStartType()!=null && dbRent.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| dbRent.setRentalStartDate(dbRent.getStartDate()); | |||||
| } | |||||
| List<WxBillProperty> result = wxPropertyContractService.buildProperty(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false); | List<WxBillProperty> result = wxPropertyContractService.buildProperty(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @@ -114,6 +114,10 @@ public class WxRentContractController extends BaseController { | |||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::buildBillPriceList"); | ||||
| WxRentContract dbRent = wxRentContractMapper.selectByPrimaryKey(wxRentContract.getId()); | WxRentContract dbRent = wxRentContractMapper.selectByPrimaryKey(wxRentContract.getId()); | ||||
| dbRent.setPreviewBillRentList(wxRentContract.getPreviewBillRentList()); | dbRent.setPreviewBillRentList(wxRentContract.getPreviewBillRentList()); | ||||
| if(dbRent.getRentStartType()!=null && dbRent.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ | |||||
| dbRent.setRentalStartDate(dbRent.getStartDate()); | |||||
| } | |||||
| List<WxBillRent> result = wxRentContractService.buildRent(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false); | List<WxBillRent> result = wxRentContractService.buildRent(new WxMerchant(),getUserId(),dbRent, EnumIsPreview.YES.getCode(), false); | ||||
| return new ResultData(result); | return new ResultData(result); | ||||
| } | } | ||||
| @@ -210,7 +210,6 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| record.setRentContractId(id); | record.setRentContractId(id); | ||||
| record.setTenantId(tenantId); | record.setTenantId(tenantId); | ||||
| record.setSortColumns(BaseEntity.SortField.Id_ASC); | record.setSortColumns(BaseEntity.SortField.Id_ASC); | ||||
| updateBillStatus(record); | |||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(record); | List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(record); | ||||
| PageInfo<WxBillRent> pageInfo = new PageInfo<>(billRentList); | PageInfo<WxBillRent> pageInfo = new PageInfo<>(billRentList); | ||||
| @@ -1138,12 +1138,19 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); | SimpleDateFormat sdMR = new SimpleDateFormat("MM-dd"); | ||||
| SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); | ||||
| SimpleDateFormat sdD = new SimpleDateFormat("d"); | |||||
| SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); | |||||
| // System.out.println(sd.format(startDate)); | |||||
| // System.out.println(sd.format(endDate)); | |||||
| if(i == billTimeVoListSize - 1){//最后 | if(i == billTimeVoListSize - 1){//最后 | ||||
| if(sdMR.format(startDate).equals(sdMR.format(wxRentContract.getRentalStartDate())) && sdMR.format(endDate).equals(sdMR.format(wxRentContract.getRentalEndDate())) ){ | |||||
| int months = getMonths(sdM.format(startDate)+"-01",sdM.format(endDate)+"-01"); | |||||
| months++; | |||||
| //判断是否满足整月 | |||||
| int startInt = Integer.parseInt(sdD.format(startDate)); | |||||
| int endInt = Integer.parseInt(sdD.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))); | |||||
| if(startInt == endInt){ | |||||
| int months = getMonths(sdM.format(startDate)+"-01",sdM.format(DateUtils.getDaySet(endDate,Calendar.DATE,1))+"-01"); | |||||
| needpay = new Double(months * priceD).longValue(); | needpay = new Double(months * priceD).longValue(); | ||||
| }else { | |||||
| }else{ | |||||
| needpay = new Double(getMonthNeedPay(priceD, startDate, endDate)).longValue(); | needpay = new Double(getMonthNeedPay(priceD, startDate, endDate)).longValue(); | ||||
| } | } | ||||
| }else if(i == 0){//第一期 | }else if(i == 0){//第一期 | ||||
| @@ -139,9 +139,9 @@ | |||||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | <update id="updateNotPaidStatus" parameterType="hashmap"> | ||||
| update wx_bill_property b set b.status=#{notPaid},b.expired_day= | update wx_bill_property b set b.status=#{notPaid},b.expired_day= | ||||
| DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day)) | |||||
| DATEDIFF(now(), b.receive_date) | |||||
| where b.tenant_id=#{tenantId} and b.status!=#{paid} and b.status!=6 and | where b.tenant_id=#{tenantId} and b.status!=#{paid} and b.status!=6 and | ||||
| DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day)) >0 | |||||
| DATEDIFF(now(), b.receive_date) >0 | |||||
| </update> | </update> | ||||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | <update id="updateWaitPayStatus" parameterType="hashmap"> | ||||
| @@ -147,9 +147,9 @@ | |||||
| <update id="updateNotPaidStatus" parameterType="hashmap"> | <update id="updateNotPaidStatus" parameterType="hashmap"> | ||||
| update wx_bill_rent b set b.status=#{notPaid},b.expired_day= | update wx_bill_rent b set b.status=#{notPaid},b.expired_day= | ||||
| DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`rent_contract_id`) day)) | |||||
| DATEDIFF(now(), b.receive_date) | |||||
| where b.tenant_id=#{tenantId} and b.status!=#{paid} and b.status!=6 and | where b.tenant_id=#{tenantId} and b.status!=#{paid} and b.status!=6 and | ||||
| DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`rent_contract_id`) day)) >0 | |||||
| DATEDIFF(now(), b.receive_date) >0 | |||||
| </update> | </update> | ||||
| <update id="updateWaitPayStatus" parameterType="hashmap"> | <update id="updateWaitPayStatus" parameterType="hashmap"> | ||||