| | |
| | | package com.java110.report.bmo.reportFeeMonthStatistics.impl; |
| | | |
| | | import com.java110.dto.fee.FeeDto; |
| | | import com.java110.dto.reportFeeMonthStatistics.ReportFeeMonthStatisticsDto; |
| | | import com.java110.intf.IReportFeeMonthStatisticsInnerServiceSMO; |
| | | import com.java110.report.bmo.reportFeeMonthStatistics.IGetReportFeeMonthStatisticsBMO; |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryPrePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePaymentCount(reportFeeMonthStatisticsDto); |
| | | |
| | | ResultVo resultVo = new ResultVo(reportFeeMonthStatisticsDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryPrePayment(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePaymentNewCount(reportFeeMonthStatisticsDto); |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | if (count > 0) { |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePayment(reportFeeMonthStatisticsDto); |
| | | for (ReportFeeMonthStatisticsDto tmpReportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) { |
| | | if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(tmpReportFeeMonthStatisticsDto.getPayerObjType())) { |
| | | tmpReportFeeMonthStatisticsDto.setObjName(tmpReportFeeMonthStatisticsDto.getFloorNum() |
| | | + "栋" + tmpReportFeeMonthStatisticsDto.getUnitNum() |
| | | + "单元" + tmpReportFeeMonthStatisticsDto.getRoomNum() + "室"); |
| | | } else { |
| | | tmpReportFeeMonthStatisticsDto.setObjName(tmpReportFeeMonthStatisticsDto.getCarNum()); |
| | | } |
| | | |
| | | try { |
| | | tmpReportFeeMonthStatisticsDto.setOweDay(DateUtil.daysBetween(DateUtil.getCurrentDate(), DateUtil.getDateFromString(tmpReportFeeMonthStatisticsDto.getEndTime(), DateUtil.DATE_FORMATE_STRING_A))); |
| | | } catch (ParseException e) { |
| | | logger.error("费用结束时间错误" + tmpReportFeeMonthStatisticsDto.getEndTime(), e); |
| | | } |
| | | } |
| | | } else { |
| | | reportFeeMonthStatisticsDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportFeeMonthStatisticsDto.getRow()), count, reportFeeMonthStatisticsDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | private void freshReportOweDay(List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) { |
| | | |
| | | Date monthFirstDate = DateUtil.getNextMonthFirstDate(); |