| | |
| | | import com.java110.intf.user.IOwnerInnerServiceSMO; |
| | | import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO; |
| | | import com.java110.report.bmo.reportFeeMonthStatistics.IGetReportFeeMonthStatisticsBMO; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.utils.util.ListUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | |
| | | import java.lang.reflect.Field; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @Service("getReportFeeMonthStatisticsBMOImpl") |
| | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | |
| | |
| | | .setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | tmpReportFeeMonthStatisticsDto.setHisOweAmount(hisOweAmountDec.doubleValue()); |
| | | |
| | | |
| | | //当月应收 |
| | | curReceivableAmountDec = new BigDecimal(tmpReportFeeMonthStatisticsDto.getCurReceivableAmount()); |
| | | curReceivableAmountDec = curReceivableAmountDec.add(new BigDecimal(reportFeeMonthStatisticsDto.getCurReceivableAmount())) |
| | |
| | | .setScale(2, BigDecimal.ROUND_HALF_UP); |
| | | tmpReportFeeMonthStatisticsDto.setReceivedAmount(receivedAmountDec.doubleValue() + ""); |
| | | } |
| | | |
| | | return reportFeeMonthStatisticsDtos; |
| | | } |
| | | |
| | |
| | | return tmpReportFeeMonthStatisticsDto; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + ""); |
| | | reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + ""); |
| | | int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFloorUnitFeeSummaryCount(reportFeeMonthStatisticsDto); |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | if (count > 0) { |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFloorUnitFeeSummary(reportFeeMonthStatisticsDto); |
| | |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryFeeBreakdown(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | if (StringUtil.isEmpty(reportFeeMonthStatisticsDto.getYearMonth())) { |
| | | reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + ""); |
| | | reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + ""); |
| | |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | |
| | | reportFeeMonthStatisticsDto.setFeeYear(DateUtil.getYear() + ""); |
| | | reportFeeMonthStatisticsDto.setFeeMonth(DateUtil.getMonth() + ""); |
| | | |
| | |
| | | @Override |
| | | public ResponseEntity<String> queryOweFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryOweFeeDetailCount(reportFeeMonthStatisticsDto); |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | if (count > 0) { |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryOweFeeDetail(reportFeeMonthStatisticsDto); |
| | | ReportFeeMonthStatisticsDto tmpReportFeeMonthStatisticsDto = reportFeeMonthStatisticsInnerServiceSMOImpl.queryOweFeeDetailMajor(reportFeeMonthStatisticsDto); |
| | | if (reportFeeMonthStatisticsDtos != null && reportFeeMonthStatisticsDtos.size() > 0) { |
| | | if (!ListUtil.isNull(reportFeeMonthStatisticsDtos)) { |
| | | for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto1 : reportFeeMonthStatisticsDtos) { |
| | | // reportFeeMonthStatisticsDto1.setAllReceivableAmount(tmpReportFeeMonthStatisticsDto.getAllReceivableAmount()); |
| | | // reportFeeMonthStatisticsDto1.setAllReceivedAmount(tmpReportFeeMonthStatisticsDto.getAllReceivedAmount()); |
| | |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * 前台查询分页查询 |
| | | * |
| | | * @param reportFeeMonthStatisticsDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResponseEntity<String> queryPayFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | ResultVo resultVo = queryPayFeeDetailInnerServiceSMOImpl.query(reportFeeMonthStatisticsDto); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * @param ownerIds |
| | | * @param reportFeeMonthStatisticsDtos |
| | | */ |
| | | private void refreshReportFeeMonthStatistics(List<String> ownerIds, List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) { |
| | | |
| | | if (ownerIds == null || ownerIds.size() < 1) { |
| | | return; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryPrePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePaymentCount(reportFeeMonthStatisticsDto); |
| | |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryDeadlinePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryDeadlinePaymentCount(reportFeeMonthStatisticsDto); |
| | |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryOwePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | List<ReportFeeMonthStatisticsDto> reportAllFeeMonthStatisticsDtos = null; |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | ResultVo resultVo = new ResultVo(reportAllFeeMonthStatisticsDtos); |
| | | |
| | |
| | | //获取总条数 |
| | | int size = staffs.size(); |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) size / (double) repairUserDto.getRow()), repairUserList.size(), repairUserList, staffs, repairUser); |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) size / (double) repairUserDto.getRow()), size, repairUserList, staffs, repairUser); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryHuaningOweFee(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningOweFee(reportFeeMonthStatisticsDto); |
| | | int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningOweFeeCounts(reportFeeMonthStatisticsDto); |
| | | if (count > 0) { |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningOweFee(reportFeeMonthStatisticsDto); |
| | | } else { |
| | | reportFeeMonthStatisticsDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(reportFeeMonthStatisticsDtos); |
| | | 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; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryHuaningPayFee(Map paramInfo) { |
| | | |
| | | List<Map> reportFeeMonthStatisticsDtos = null; |
| | | |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningPayFee(paramInfo); |
| | | |
| | | ResponseEntity<String> responseEntity = ResultVo.createResponseEntity(reportFeeMonthStatisticsDtos); |
| | | |
| | | int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningPayFeeCounts(paramInfo); |
| | | if (count > 0) { |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningPayFee(paramInfo); |
| | | } else { |
| | | reportFeeMonthStatisticsDtos = new ArrayList<>(); |
| | | } |
| | | ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = BeanConvertUtil.covertBean(paramInfo, ReportFeeMonthStatisticsDto.class); |
| | | 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; |
| | | } |
| | | |
| | |
| | | calendar.set(Calendar.MONTH, 0); |
| | | Date curStart = calendar.getTime(); |
| | | |
| | | |
| | | for (Map paramIn : reportFeeMonthStatisticsDtos) { |
| | | |
| | | startTime = (Date) paramIn.get("startTime"); |
| | | endTime = (Date) paramIn.get("endTime"); |
| | | BigDecimal money = (BigDecimal) paramIn.get("oweAmount"); |
| | |
| | | paramIn.put("bfAmount", 0); |
| | | continue; |
| | | } |
| | | |
| | | //每月金额 |
| | | BigDecimal monthAmount = money.divide(new BigDecimal(month), 2, BigDecimal.ROUND_HALF_EVEN); |
| | | |
| | | if (startTime.getTime() < curStart.getTime()) { |
| | | BigDecimal btAmountDec = monthAmount.multiply(new BigDecimal(curMonth)).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | paramIn.put("btAmount", btAmountDec.doubleValue()); |
| | |
| | | paramIn.put("bfAmount", bfAmountDec.doubleValue()); |
| | | continue; |
| | | } |
| | | |
| | | if (startTime.getTime() >= curStart.getTime()) { |
| | | paramIn.put("btAmount", money.doubleValue()); |
| | | paramIn.put("bfAmount", 0); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> queryPrePayment(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) { |
| | | |
| | | int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePaymentNewCount(reportFeeMonthStatisticsDto); |
| | | |
| | | List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null; |
| | | if (count > 0) { |
| | | reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPrePayment(reportFeeMonthStatisticsDto); |
| | |
| | | } |
| | | |
| | | private void freshReportOweDay(List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) { |
| | | |
| | | int day = 0; |
| | | for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) { |
| | | try { |
| | | day = DateUtil.daysBetween(DateUtil.getDateFromStringA(reportFeeMonthStatisticsDto.getDeadlineTime()), |
| | | DateUtil.getDateFromStringA(reportFeeMonthStatisticsDto.getFeeCreateTime())); |
| | | day = DateUtil.daysBetween(DateUtil.getDateFromStringB(reportFeeMonthStatisticsDto.getEndTime()), |
| | | DateUtil.getDateFromStringB(reportFeeMonthStatisticsDto.getStartTime())); |
| | | reportFeeMonthStatisticsDto.setOweDay(day); |
| | | } catch (Exception e) { |
| | | logger.error("计算欠费天数失败", e); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private void freshReportDeadlineDay(List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos) { |
| | | |
| | | Date nowDate = DateUtil.getCurrentDate(); |
| | | |
| | | for (ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto : reportFeeMonthStatisticsDtos) { |
| | | try { |
| | | int day = DateUtil.daysBetween(DateUtil.getDateFromString(reportFeeMonthStatisticsDto.getDeadlineTime(), |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | } |