java110
2021-08-14 9cfa6654446ca4da9612e39decae33f47c2298c9
优化代码
8个文件已修改
146 ■■■■■ 已修改文件
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/report/IReportFeeMonthStatisticsInnerServiceSMO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/api/ReportFeeMonthStatisticsApi.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/IGetReportFeeMonthStatisticsBMO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -2226,4 +2226,50 @@
            limit #{page}, #{row}
        </if>
    </select>
    <select id="queryHuaningPayFeeTwoCount" parameterType="Map" resultType="Map">
        select count(1) count
        from (
        select t.floor_num floorNum,sum(pfdm.receivable_amount) receivableAmount ,
        sum(pfdm.received_amount) receivedAmount,SUM(pfdm1.discount_amount) receivedAmount1,
        SUM(pfdm2.received_amount) receivedAmount2
        from f_floor t
        LEFT JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
        LEFT JOIN building_room br on br.unit_id = bu.unit_id  and br.status_cd = '0'
        LEFT JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
        LEFT join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
        LEFT JOIN pay_fee_detail_month pfdm on  pf.fee_id = pfdm.fee_id and pfd.detail_id = pfdm.detail_id and pfdm.status_cd = '0'
        LEFT JOIN pay_fee_detail_month pfdm1 on  pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and pfdm1.status_cd = '0' and pfdm1.detail_year =  #{year}  and pfdm1.detail_month &lt; #{month}
        LEFT JOIN pay_fee_detail_month pfdm2 on  pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and pfdm2.status_cd = '0' and pfdm2.detail_year =  #{year}  and pfdm2.detail_month &gt; #{month}
        where 1=1
        and DATE_FORMAT(pfd.create_time,'%Y-%m') =  #{yearMonth}
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        GROUP BY t.floor_num
        ) tt
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="queryHuaningPayFeeTwo" parameterType="Map" resultType="Map">
        select t.floor_num floorNum,sum(pfdm.receivable_amount) receivableAmount ,
        sum(pfdm.received_amount) receivedAmount,SUM(pfdm1.discount_amount) receivedAmount1,
        SUM(pfdm2.received_amount) receivedAmount2
        from f_floor t
        LEFT JOIN building_unit bu on t.floor_id = bu.floor_id and bu.status_cd = '0'
        LEFT JOIN building_room br on br.unit_id = bu.unit_id  and br.status_cd = '0'
        LEFT JOIN pay_fee pf on pf.payer_obj_id = br.room_id and pf.status_cd = '0'
        LEFT join pay_fee_detail pfd on pf.fee_id = pfd.fee_id and pfd.status_cd = '0'
        LEFT JOIN pay_fee_detail_month pfdm on  pf.fee_id = pfdm.fee_id and pfd.detail_id = pfdm.detail_id and pfdm.status_cd = '0'
        LEFT JOIN pay_fee_detail_month pfdm1 on  pf.fee_id = pfdm1.fee_id and pfd.detail_id = pfdm1.detail_id and pfdm1.status_cd = '0' and pfdm1.detail_year =  #{year}  and pfdm1.detail_month &lt; #{month}
        LEFT JOIN pay_fee_detail_month pfdm2 on  pf.fee_id = pfdm2.fee_id and pfd.detail_id = pfdm2.detail_id and pfdm2.status_cd = '0' and pfdm2.detail_year =  #{year}  and pfdm2.detail_month &gt; #{month}
        where 1=1
        and DATE_FORMAT(pfd.create_time,'%Y-%m') =  #{yearMonth}
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        GROUP BY t.floor_num
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
</mapper>
java110-interface/src/main/java/com/java110/intf/report/IReportFeeMonthStatisticsInnerServiceSMO.java
@@ -375,4 +375,11 @@
    @RequestMapping(value = "/queryHuaningPayFee", method = RequestMethod.POST)
    List<Map> queryHuaningPayFee(@RequestBody Map paramInfo);
    @RequestMapping(value = "/queryHuaningPayFeeTwoCount", method = RequestMethod.POST)
    int queryHuaningPayFeeTwoCount(@RequestBody Map paramInfo);
    @RequestMapping(value = "/queryHuaningPayFeeTwo", method = RequestMethod.POST)
    List<Map> queryHuaningPayFeeTwo(@RequestBody Map paramInfo);
}
service-report/src/main/java/com/java110/report/api/ReportFeeMonthStatisticsApi.java
@@ -646,6 +646,32 @@
        paramInfo.put("row", row);
        return getReportFeeMonthStatisticsBMOImpl.queryHuaningPayFee(paramInfo);
    }
    /**
     * 查询华宁物业 欠费统计报表
     * 作者: 吴学文
     * 时间:2021-08-13
     *
     * @param communityId 小区ID
     * @return
     * @serviceCode /reportFeeMonthStatistics/queryHuaningPayFeeTwo
     * @path /app/reportFeeMonthStatistics/queryHuaningPayFeeTwo
     */
    @RequestMapping(value = "/queryHuaningPayFeeTwo", method = RequestMethod.GET)
    public ResponseEntity<String> queryHuaningPayFeeTwo(
            @RequestParam(value = "communityId") String communityId,
            @RequestParam(value = "year") int year,
            @RequestParam(value = "month") int month,
            @RequestParam(value = "page") int page,
            @RequestParam(value = "row") int row
    ) {
        Map paramInfo = new HashMap();
        paramInfo.put("communityId", communityId);
        paramInfo.put("year", year);
        paramInfo.put("month", month);
        paramInfo.put("page", page);
        paramInfo.put("row", row);
        return getReportFeeMonthStatisticsBMOImpl.queryHuaningPayFeeTwo(paramInfo);
    }
}
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/IGetReportFeeMonthStatisticsBMO.java
@@ -92,4 +92,6 @@
     * @return
     */
    ResponseEntity<String> queryHuaningPayFee(Map paramInfo);
    ResponseEntity<String> queryHuaningPayFeeTwo(Map paramInfo);
}
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
@@ -840,6 +840,31 @@
    }
    @Override
    public ResponseEntity<String> queryHuaningPayFeeTwo(Map paramInfo) {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.YEAR, (int) paramInfo.get("year"));
        calendar.set(Calendar.MONTH, (int) paramInfo.get("month") - 1);
        paramInfo.put("yearMonth", DateUtil.getFormatTimeString(calendar.getTime(), "YYYY-MM"));
        calendar.add(Calendar.MONTH, 1);
        paramInfo.put("nextYear", calendar.get(Calendar.YEAR));
        paramInfo.put("nextMonth", calendar.get(Calendar.MONTH) + 1);
        int count = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningPayFeeTwoCount(paramInfo);
        List<Map> reportFeeMonthStatisticsDtos = null;
        if (count > 0) {
            reportFeeMonthStatisticsDtos = reportFeeMonthStatisticsInnerServiceSMOImpl.queryHuaningPayFeeTwo(paramInfo);
        } else {
            reportFeeMonthStatisticsDtos = new ArrayList<>();
        }
        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) paramInfo.get("row")), count, 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);
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java
@@ -318,4 +318,8 @@
    int queryHuaningPayFeeCount(Map paramInfo);
    List<Map> queryHuaningPayFee(Map beanCovertMap);
    int queryHuaningPayFeeTwoCount(Map paramInfo);
    List<Map> queryHuaningPayFeeTwo(Map beanCovertMap);
}
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java
@@ -292,6 +292,27 @@
    }
    @Override
    public int queryHuaningPayFeeTwoCount(Map info) {
        logger.debug("查询queryHuaningPayFeeTwoCount数据 入参 info : {}", info);
        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFeeTwoCount", info);
        if (businessReportFeeMonthStatisticsInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessReportFeeMonthStatisticsInfos.get(0).get("count").toString());
    }
    @Override
    public List<Map> queryHuaningPayFeeTwo(Map info) {
        logger.debug("查询queryHuaningPayFeeTwo 入参 info : {}", info);
        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFeeTwo", info);
        return businessReportFeeMonthStatisticsInfos;
    }
    @Override
    public Map queryPayFeeDetailCount(Map info) {
        logger.debug("查询费用月统计数据 入参 info : {}", info);
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -492,6 +492,21 @@
        List<Map> deposits = reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFee(BeanConvertUtil.beanCovertMap(paramInfo));
        return deposits;
    }
    @Override
    public int queryHuaningPayFeeTwoCount(@RequestBody Map paramInfo) {
        return reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFeeTwoCount(paramInfo);
    }
    @Override
    public List<Map> queryHuaningPayFeeTwo(@RequestBody Map paramInfo) {
        int page = (int)paramInfo.get("page");
        if (page != PageDto.DEFAULT_PAGE) {
            paramInfo.put("page",(page - 1) * (int)paramInfo.get("row"));
        }
        List<Map> deposits = reportFeeMonthStatisticsServiceDaoImpl.queryHuaningPayFeeTwo(BeanConvertUtil.beanCovertMap(paramInfo));
        return deposits;
    }
    public IReportFeeMonthStatisticsServiceDao getReportFeeMonthStatisticsServiceDaoImpl() {
        return reportFeeMonthStatisticsServiceDaoImpl;