xiaogang
2021-07-17 1024666b99a24bd7d5e4dc442d6b0c0319fa2f29
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
@@ -59,9 +59,18 @@
    public ResponseEntity<String> queryReportFeeSummary(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummaryCount(reportFeeMonthStatisticsDto);
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = null;
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsDtos = new ArrayList<>();
        if (count > 0) {
            reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummary(reportFeeMonthStatisticsDto);
            List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticsList = reportFeeMonthStatisticsInnerServiceSMOImpl.queryReportFeeSummary(reportFeeMonthStatisticsDto);
            for (ReportFeeMonthStatisticsDto reportFeeMonthStatistics : reportFeeMonthStatisticsList) {
                //获取应收金额
                double receivableAmount = Double.parseDouble(reportFeeMonthStatistics.getReceivableAmount());
                //获取实收金额
                double receivedAmount = Double.parseDouble(reportFeeMonthStatistics.getReceivedAmount());
                double chargeRate = (receivedAmount / receivableAmount) * 100.0;
                reportFeeMonthStatistics.setChargeRate(String.format("%.2f", chargeRate) + "%");
                reportFeeMonthStatisticsDtos.add(reportFeeMonthStatistics);
            }
        } else {
            reportFeeMonthStatisticsDtos = new ArrayList<>();
        }
@@ -195,6 +204,7 @@
    @Override
    public ResponseEntity<String> queryPayFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        JSONObject countInfo = reportFeeMonthStatisticsInnerServiceSMOImpl.queryPayFeeDetailCount(reportFeeMonthStatisticsDto);
        int count = Integer.parseInt(countInfo.get("count").toString());
@@ -283,7 +293,6 @@
                    reportFeeMonthStatistics.setPreferentialAmount(reportFeeMonthStatistics.getDiscountPrice());
                } else {
                    reportFeeMonthStatistics.setPreferentialAmount("0");
                }
                //减免金额
                if (!StringUtil.isEmpty(reportFeeMonthStatistics.getDiscountSmallType()) && reportFeeMonthStatistics.getDiscountSmallType().equals("2")) {
@@ -325,22 +334,19 @@
                } else {
                    reportFeeMonthStatistics.setVacantHousingReduction("0");
                }
                if (FeeDto.PAYER_OBJ_TYPE_ROOM.equals(reportFeeMonthStatistics.getPayerObjType())) {
                    reportFeeMonthStatistics.setObjName(reportFeeMonthStatistics.getFloorNum()
                            + "栋" + reportFeeMonthStatistics.getUnitNum()
                            + "单元" + reportFeeMonthStatistics.getRoomNum() + "室");
                } else if (FeeDto.PAYER_OBJ_TYPE_CAR.equals(reportFeeMonthStatistics.getPayerObjType())) {
                    reportFeeMonthStatistics.setObjName(reportFeeMonthStatistics.getCarNum());
                }else{
                } else {
                    reportFeeMonthStatistics.setObjName(reportFeeMonthStatistics.getContractCode());
                }
                if (!StringUtil.isEmpty(reportFeeMonthStatistics.getImportFeeName())) {
                    reportFeeMonthStatistics.setFeeName(reportFeeMonthStatistics.getImportFeeName());
                }
                //费用项目
                reportFeeMonthStatistics.setFeeConfigDtos(feeConfigDtos);
                reportList.add(reportFeeMonthStatistics);
@@ -465,6 +471,7 @@
    /**
     * 查询报表专家 统计信息
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -508,6 +515,8 @@
        int transferOrderNumber = 0;
        //派单总数量
        int dispatchNumber = 0;
        //已回访总数量
        int returnNumber = 0;
        if (count > 0) {
            for (RepairUserDto repairUser : repairUsers) {
                RepairUserDto repairUserInfo = new RepairUserDto();
@@ -525,6 +534,10 @@
                    int transferOrderAmount = 0;
                    //派单数量
                    int dispatchAmount = 0;
                    //回访数量
                    int returnAmount = 0;
                    //评分
                    String score = "";
                    for (RepairUserDto repair : repairUserDtoList) {
                        //处理中状态
                        if (repair.getState().equals("10001")) {
@@ -546,6 +559,12 @@
                        } else if (repair.getState().equals("10006")) {  //派单状态
                            int amount = Integer.parseInt(repair.getAmount());
                            dispatchAmount = dispatchAmount + amount;
                        } else if (repair.getState().equals("10008")) {  //已回访状态
                            int amount = Integer.parseInt(repair.getAmount());
                            returnAmount = returnAmount + amount;
                        }
                        if (!StringUtil.isEmpty(repair.getScore())) {
                            score = repair.getScore();
                        }
                    }
                    //员工id
@@ -572,8 +591,14 @@
                    repairUserInfo.setDispatchAmount(Integer.toString(dispatchAmount));
                    //派单报修总数量
                    repairUserInfo.setDispatchNumber(Integer.toString(dispatchNumber));
                    //回访数量
                    repairUserInfo.setReturnAmount(Integer.toString(returnAmount));
                    //回访总数量
                    repairUserInfo.setReturnNumber(Integer.toString(returnNumber));
                    //员工id和姓名信息集合
                    repairUserInfo.setRepairList(staffs);
                    //员工评分
                    repairUserInfo.setScore(score);
                    repairUserList.add(repairUserInfo);
                } else {
                    continue;
@@ -583,6 +608,7 @@
                chargebackNumber = Integer.parseInt(repairUserInfo.getChargebackAmount()) + chargebackNumber;
                transferOrderNumber = Integer.parseInt(repairUserInfo.getTransferOrderAmount()) + transferOrderNumber;
                dispatchNumber = Integer.parseInt(repairUserInfo.getDispatchAmount()) + dispatchNumber;
                returnNumber = Integer.parseInt(repairUserInfo.getReturnAmount()) + returnNumber;
            }
        } else {
            repairUserList = new ArrayList<>();
@@ -594,6 +620,7 @@
        repairUser.setChargebackNumber(Integer.toString(chargebackNumber));
        repairUser.setTransferOrderNumber(Integer.toString(transferOrderNumber));
        repairUser.setDispatchNumber(Integer.toString(dispatchNumber));
        repairUser.setReturnNumber(Integer.toString(returnNumber));
        //获取总条数
        int size = staffs.size();