| | |
| | | int monthSix = months / 6;//6个月维度数量 |
| | | int restMonth = months % 6;//剩余的整月 |
| | | int monthDays = dateCompare.getMonthDays();//不满一个月的天数 |
| | | Date date = new Date(); |
| | | List<Date> list = new ArrayList<>(); |
| | | for (int i = 0; i < monthSix; i++) { |
| | | list.add(DateUtil.addMonthToDate(date,i*6)); |
| | | list.add(DateUtil.addMonthToDate(startDate,i*6)); |
| | | } |
| | | if(restMonth>0 || monthDays>0){ |
| | | list.add(DateUtil.addDaysToDate(date,monthSix)); |
| | | list.add(DateUtil.addDaysToDate(startDate,monthSix)); |
| | | } |
| | | return list; |
| | | } |
| | |
| | | int monthThree = months / 3;//3个月维度数量 |
| | | int restMonth = months % 3;//剩余的整月 |
| | | int monthDays = dateCompare.getMonthDays();//不满一个月的天数 |
| | | Date date = new Date(); |
| | | List<Date> list = new ArrayList<>(); |
| | | for (int i = 0; i < monthThree; i++) { |
| | | list.add(DateUtil.addMonthToDate(date,i*3)); |
| | | list.add(DateUtil.addMonthToDate(startDate,i*3)); |
| | | } |
| | | if(restMonth>0 || monthDays>0){ |
| | | list.add(DateUtil.addDaysToDate(date,monthThree)); |
| | | list.add(DateUtil.addDaysToDate(startDate,monthThree)); |
| | | } |
| | | 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 = DateUtil.addDaysToDate(DateUtil.addYearToDate(start,1),-1);//结束日期为下一个周期的前一天 |
| | | if(end.getTime()> d.getEndDate().getTime() ){ |
| | | end = d.getEndDate(); |
| | | Date end = d.getEndDate(); |
| | | if(temp+1 < dateList.size()){ |
| | | end =DateUtil.addDaysToDate(dateList.get(temp+1),-1); |
| | | } |
| | | YwContractBill bill = initCreateBillModel(model,d ); |
| | | bill.setStartDate(start);//账单开始 |
| | |
| | | bill.setReceivableFee(totalFee); |
| | | bill.setBillType(Constants.ZERO); |
| | | |
| | | temp++; |
| | | list.add(bill); |
| | | } |
| | | } |
| | |
| | | DateCompare dateCompare = DateCompare.monthYearCompare(startDate, endDate ); |
| | | int years = dateCompare.getYear(); |
| | | int yeardays = dateCompare.getYearDays(); |
| | | Date date = new Date(); |
| | | List<Date> list = new ArrayList<>(); |
| | | for (int i = 0; i < years; i++) { |
| | | list.add(DateUtil.addYearToDate(date,i)); |
| | | list.add(DateUtil.addYearToDate(startDate,i)); |
| | | } |
| | | if(yeardays>0){ |
| | | list.add(DateUtil.addYearToDate(date,years)); |
| | | list.add(DateUtil.addYearToDate(startDate,years)); |
| | | } |
| | | return list; |
| | | } |