| @@ -919,18 +919,31 @@ public class WxRentContractController extends WxContractBaseController { | |||||
| List<Date> yearList = wxRentContractService.getYearList(years, 12, rentContract.getRentalStartDate(),endcontract); | List<Date> yearList = wxRentContractService.getYearList(years, 12, rentContract.getRentalStartDate(),endcontract); | ||||
| if (null != yearList && yearList.size() > 0) { | if (null != yearList && yearList.size() > 0) { | ||||
| List<WxRentContractYearsVo> retList = new ArrayList<WxRentContractYearsVo>(); | List<WxRentContractYearsVo> retList = new ArrayList<WxRentContractYearsVo>(); | ||||
| Date begin = null; | |||||
| for (int i = 0 ; i < yearList.size()-1 ; i ++) { | |||||
| int yearindex = i+1; | |||||
| begin = yearList.get(i); | |||||
| Date end = yearList.get(i+1); | |||||
| Date realEnd = DateUtils.getDaySet(end, Calendar.SECOND, -1); | |||||
| if (yearList.size() == 1) { | |||||
| WxRentContractYearsVo vo = new WxRentContractYearsVo(); | WxRentContractYearsVo vo = new WxRentContractYearsVo(); | ||||
| vo.setStart(begin); | |||||
| vo.setEnd(realEnd); | |||||
| vo.setRemark("第"+yearindex+"年度"); | |||||
| vo.setStart(yearList.get(0)); | |||||
| vo.setEnd(rentContract.getRentalEndDate()); | |||||
| vo.setRemark("第1年度"); | |||||
| retList.add(vo); | retList.add(vo); | ||||
| begin = end; | |||||
| }else { | |||||
| Date begin = null; | |||||
| for (int i = 0 ; i < yearList.size()-1 ; i ++) { | |||||
| int yearindex = i+1; | |||||
| begin = yearList.get(i); | |||||
| Date end = yearList.get(i+1); | |||||
| Date realEnd = DateUtils.getDaySet(end, Calendar.SECOND, -1); | |||||
| WxRentContractYearsVo vo = new WxRentContractYearsVo(); | |||||
| vo.setStart(begin); | |||||
| vo.setEnd(realEnd); | |||||
| vo.setRemark("第"+yearindex+"年度"); | |||||
| retList.add(vo); | |||||
| begin = end; | |||||
| } | |||||
| WxRentContractYearsVo vo = new WxRentContractYearsVo(); | |||||
| vo.setStart(yearList.get(yearList.size()-1)); | |||||
| vo.setEnd(rentContract.getRentalEndDate()); | |||||
| vo.setRemark("第"+yearList.size()+"年度"); | |||||
| retList.add(vo); | |||||
| } | } | ||||
| return new ResultData(retList); | return new ResultData(retList); | ||||
| } | } | ||||