| | |
| | | list.add(DateUtil.addMonthToDate(startDate,i*6)); |
| | | } |
| | | if(restMonth>0 || monthDays>0){ |
| | | list.add(DateUtil.addMonthToDate(startDate,monthSix)); |
| | | list.add(DateUtil.addMonthToDate(startDate,monthSix*6)); |
| | | } |
| | | return list; |
| | | } |
| | |
| | | list.add(DateUtil.addMonthToDate(startDate,i*3)); |
| | | } |
| | | if(restMonth>0 || monthDays>0){ |
| | | list.add(DateUtil.addMonthToDate(startDate,monthThree)); |
| | | list.add(DateUtil.addMonthToDate(startDate,monthThree*3)); |
| | | } |
| | | return list; |
| | | } |
| | |
| | | private void dealCircleDateBillBiz( List<Date> dateList ,YwContract model, YwContractDetail d, Date freeStart, Date freeEnd, List<YwContractBill> list ) { |
| | | int temp = 0; |
| | | for(Date start : dateList){ |
| | | Date end = model.getEndDate(); |
| | | Date end = d.getEndDate(); |
| | | if(temp+1 < dateList.size()){ |
| | | end =DateUtil.addDaysToDate(dateList.get(temp+1),-1); |
| | | } |
| | | temp++; |
| | | YwContractBill bill = initCreateBillModel(model,d ); |
| | | bill.setStartDate(start);//账单开始 |
| | | bill.setEndDate(end);//账单结束 |
| | |
| | | bill.setReceivableFee(totalFee); |
| | | bill.setBillType(Constants.ZERO); |
| | | |
| | | temp++; |
| | | |
| | | bill.setCompanyId(model.getCompanyId()); |
| | | list.add(bill); |
| | | } |
| | |
| | | |
| | | private BigDecimal getTotalFeeByStartEnd(YwContract model, YwContractDetail d, YwContractBill bill,Date freeStart,Date freeEnd) { |
| | | BigDecimal totalFee = new BigDecimal(0); |
| | | DateCompare dateCompare = DateCompare.dayCompare(bill.getStartDate(),bill.getEndDate(),freeStart,freeEnd); |
| | | DateCompare dateCompare = DateCompare.dayCompare(bill.getStartDate(),DateUtil.addDaysToDate(bill.getEndDate(),1),freeStart,DateUtil.addDaysToDate(freeEnd,1)); |
| | | if(Constants.equalsInteger(d.getCircleType(),Constants.ZERO)){ |
| | | //0=元每平米天 |
| | | int days = dateCompare.getDay(); |
| | | int days = dateCompare.getDay() ; |
| | | BigDecimal areas = getAreasNumBYRooms(model.getRoomList()); |
| | | totalFee = new BigDecimal(days).multiply(areas).multiply(Constants.formatBigdecimal(d.getPrice()));//总价格 |
| | | }else if(Constants.equalsInteger(d.getCircleType(),Constants.ONE)){ |
| | |
| | | totalFee = year.multiply(areas).multiply(Constants.formatBigdecimal(d.getPrice()));//总价格 |
| | | }else if(Constants.equalsInteger(d.getCircleType(),Constants.THREE)){ |
| | | //3=元每天 |
| | | int days = dateCompare.getDay(); |
| | | int days = dateCompare.getDay() ; |
| | | totalFee = new BigDecimal(days).multiply(Constants.formatBigdecimal(d.getPrice()));//总价格 |
| | | }else if(Constants.equalsInteger(d.getCircleType(),Constants.FOUR)){ |
| | | //4=元每月 |