java110
2020-10-19 2a31b6bf020f10d23ade9d09a656dca86f301f3f
优化代码
9个文件已修改
322 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/reportFeeMonthStatistics/ReportFeeMonthStatisticsDto.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-interface/src/main/java/com/java110/intf/report/IReportFeeMonthStatisticsInnerServiceSMO.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/api/ReportFeeMonthStatisticsApi.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/IGetReportFeeMonthStatisticsBMO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/reportFeeMonthStatistics/ReportFeeMonthStatisticsDto.java
@@ -37,7 +37,10 @@
    private String unitNum;
    private String roomId;
    private String roomNum;
    private String carNum;
    private String payerObjType;
    private String objCount;
    private Date createTime;
@@ -47,6 +50,7 @@
    private String statusCd = "0";
    private int oweDay;
    public String getReceivableAmount() {
@@ -265,4 +269,28 @@
    public void setOweDay(int oweDay) {
        this.oweDay = oweDay;
    }
    public String getObjCount() {
        return objCount;
    }
    public void setObjCount(String objCount) {
        this.objCount = objCount;
    }
    public String getCarNum() {
        return carNum;
    }
    public void setCarNum(String carNum) {
        this.carNum = carNum;
    }
    public String getPayerObjType() {
        return payerObjType;
    }
    public void setPayerObjType(String payerObjType) {
        this.payerObjType = payerObjType;
    }
}
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
@@ -762,5 +762,65 @@
            limit #{page}, #{row}
        </if>
    </select>
    <select id="queryPrePaymentNewCount" parameterType="Map" resultType="Map">
        select count(1) count
        from (
        select pfc.fee_name feeName, f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,t.end_time endTime ,oc.car_num carNum
        from pay_fee t
        inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
        left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
        left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        left join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0'
        left join owner_car oc on t.payer_obj_id = oc.car_id and t.payer_obj_type = '6666' and oc.status_cd = '0'
        where t.state = '2008001'
        and t.status_cd = '0'
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="startTime !=null">
            and t.create_time &gt;= #{startTime}
        </if>
        <if test="endTime !=null">
            and t.create_time &lt;= #{endTime}
        </if>
        ) t
    </select>
    <!-- 查询费用月统计信息 add by wuxw 2018-07-03 -->
    <select id="queryPrePayment" parameterType="Map" resultType="Map">
        select pfc.fee_name feeName, f.floor_num floorNum,bu.unit_num unitNum,br.room_num roomNum,t.end_time endTime ,
        oc.car_num carNum,t.payer_obj_type payerObjType
        from pay_fee t
        inner join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
        left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
        left join building_unit bu on br.unit_id = bu.unit_id and bu.status_cd = '0'
        left join f_floor f on f.floor_id = bu.floor_id and f.status_cd = '0'
        left join owner_car oc on t.payer_obj_id = oc.car_id and t.payer_obj_type = '6666' and oc.status_cd = '0'
        where t.state = '2008001'
        and t.status_cd = '0'
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="startTime !=null">
            and t.create_time &gt;= #{startTime}
        </if>
        <if test="endTime !=null">
            and t.create_time &lt;= #{endTime}
        </if>
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
    <select id="queryPrePaymentCount" parameterType="Map" resultType="Map">
        select pfc.fee_name feeName,count(t.payer_obj_id) from pay_fee t
        left join pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
        where t.state = '2008001'
        and t.status_cd = '0'
        and t.end_time &gt; #{startTime}
        and t.end_time &lt; #{endTime}
        and t.community_id= #{communityId}
        group by pfc.fee_name ,pfc.config_id
    </select>
</mapper>
java110-interface/src/main/java/com/java110/intf/report/IReportFeeMonthStatisticsInnerServiceSMO.java
@@ -27,14 +27,13 @@
    public int saveReportFeeMonthStatistics(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo);
    @RequestMapping(value = "/updateReportFeeMonthStatistics", method = RequestMethod.POST)
    public int updateReportFeeMonthStatistics(@RequestBody  ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo);
    public int updateReportFeeMonthStatistics(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo);
    @RequestMapping(value = "/deleteReportFeeMonthStatistics", method = RequestMethod.POST)
    public int deleteReportFeeMonthStatistics(@RequestBody  ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo);
    public int deleteReportFeeMonthStatistics(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo);
    /**
     * <p>查询小区楼信息</p>
     *
     *
     * @param reportFeeMonthStatisticsDto 数据对象分享
     * @return ReportFeeMonthStatisticsDto 对象数据
@@ -54,6 +53,7 @@
    /**
     * 查询费用汇总表个数
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -62,6 +62,7 @@
    /**
     * 查询费用汇总表
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -70,6 +71,7 @@
    /**
     * 查询费用汇总表个数
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -78,6 +80,7 @@
    /**
     * 查询费用汇总表
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -86,6 +89,7 @@
    /**
     * 查询费用汇总表个数
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -94,13 +98,16 @@
    /**
     * 查询费用汇总表
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
    @RequestMapping(value = "/queryFeeBreakdown", method = RequestMethod.POST)
    List<ReportFeeMonthStatisticsDto> queryFeeBreakdown(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    /**
     * 查询费用汇总表个数
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -109,6 +116,7 @@
    /**
     * 查询费用汇总表
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -116,6 +124,25 @@
    List<ReportFeeMonthStatisticsDto> queryFeeDetail(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    /**
     * 查询费用汇总表个数
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
    @RequestMapping(value = "/queryPrePaymentNewCount", method = RequestMethod.POST)
    int queryPrePaymentNewCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    /**
     * 查询费用汇总表
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
    @RequestMapping(value = "/queryPrePayment", method = RequestMethod.POST)
    List<ReportFeeMonthStatisticsDto> queryPrePayment(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    /**
     * 查询费用汇总表个数
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
@@ -124,11 +151,21 @@
    /**
     * 查询费用汇总表
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
    @RequestMapping(value = "/queryOweFeeDetail", method = RequestMethod.POST)
    List<ReportFeeMonthStatisticsDto> queryOweFeeDetail(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    /**
     * 查询预付费户数
     *
     * @param reportFeeMonthStatisticsDto
     * @return
     */
    @RequestMapping(value = "/queryPrePaymentCount", method = RequestMethod.POST)
    List<ReportFeeMonthStatisticsDto> queryPrePaymentCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
}
service-report/src/main/java/com/java110/report/api/ReportFeeMonthStatisticsApi.java
@@ -9,14 +9,13 @@
import com.java110.report.bmo.reportFeeMonthStatistics.IUpdateReportFeeMonthStatisticsBMO;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.DateUtil;
import com.java110.utils.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Calendar;
@RestController
@@ -284,4 +283,46 @@
    }
    /**
     * 查询费用分项表
     *
     * @param communityId 小区ID
     * @return
     * @serviceCode /reportFeeMonthStatistics/queryPrePaymentCount
     * @path /app/reportFeeMonthStatistics/queryPrePaymentCount
     */
    @RequestMapping(value = "/queryPrePaymentCount", method = RequestMethod.GET)
    public ResponseEntity<String> queryPrePaymentCount(@RequestParam(value = "communityId") String communityId) {
        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
        reportFeeMonthStatisticsDto.setCommunityId(communityId);
        reportFeeMonthStatisticsDto.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DAY_OF_MONTH, 7);
        reportFeeMonthStatisticsDto.setEndTime(DateUtil.getFormatTimeString(calendar.getTime(), DateUtil.DATE_FORMATE_STRING_A));
        return getReportFeeMonthStatisticsBMOImpl.queryPrePaymentCount(reportFeeMonthStatisticsDto);
    }
    /**
     * 查询费用分项表
     *
     * @param communityId 小区ID
     * @return
     * @serviceCode /reportFeeMonthStatistics/queryPrePayment
     * @path /app/reportFeeMonthStatistics/queryPrePayment
     */
    @RequestMapping(value = "/queryPrePayment", method = RequestMethod.GET)
    public ResponseEntity<String> queryPrePayment(@RequestParam(value = "communityId") String communityId,
                                                  @RequestParam(value = "page") int page,
                                                  @RequestParam(value = "row") int row) {
        ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto = new ReportFeeMonthStatisticsDto();
        reportFeeMonthStatisticsDto.setCommunityId(communityId);
        reportFeeMonthStatisticsDto.setPage(page);
        reportFeeMonthStatisticsDto.setRow(row);
        reportFeeMonthStatisticsDto.setStartTime(DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_A));
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DAY_OF_MONTH, 7);
        reportFeeMonthStatisticsDto.setEndTime(DateUtil.getFormatTimeString(calendar.getTime(), DateUtil.DATE_FORMATE_STRING_A));
        return getReportFeeMonthStatisticsBMOImpl.queryPrePayment(reportFeeMonthStatisticsDto);
    }
}
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/IGetReportFeeMonthStatisticsBMO.java
@@ -28,7 +28,12 @@
    ResponseEntity<String> queryFeeBreakdown(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    ResponseEntity<String> queryFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    ResponseEntity<String> queryOweFeeDetail(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    ResponseEntity<String> queryPrePaymentCount(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
    ResponseEntity<String> queryPrePayment(ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto);
}
service-report/src/main/java/com/java110/report/bmo/reportFeeMonthStatistics/impl/GetReportFeeMonthStatisticsBMOImpl.java
@@ -1,5 +1,6 @@
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;
@@ -12,6 +13,7 @@
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;
@@ -139,6 +141,54 @@
        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();
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java
@@ -119,6 +119,7 @@
     * @throws DAOException DAO异常
     */
    List<Map> queryFeeBreakdown(Map info) throws DAOException;
    /**
     * 查询费用月统计总数
     *
@@ -146,6 +147,24 @@
     * @return 费用月统计数量
     */
    int queryOweFeeDetailCount(Map info);
    /**
     * 查询费用月统计信息(instance过程)
     * 根据bId 查询费用月统计信息
     *
     * @param info bId 信息
     * @return 费用月统计信息
     * @throws DAOException DAO异常
     */
    List<Map> queryPrePayment(Map info) throws DAOException;
    /**
     * 查询费用月统计总数
     *
     * @param info 费用月统计信息
     * @return 费用月统计数量
     */
    int queryPrePaymentNewCount(Map info);
    /**
@@ -158,6 +177,15 @@
     */
    List<Map> queryOweFeeDetail(Map info) throws DAOException;
    /**
     * 查询预交费
     * 根据bId 查询费用月统计信息
     *
     * @param info bId 信息
     * @return 费用月统计信息
     * @throws DAOException DAO异常
     */
    List<Map> queryPrePaymentCount(Map info) throws DAOException;
}
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java
@@ -191,6 +191,7 @@
        return businessReportFeeMonthStatisticsInfos;
    }
    @Override
    public int queryOweFeeDetailCount(Map info) {
        logger.debug("查询费用月统计数据 入参 info : {}", info);
@@ -211,9 +212,35 @@
        return businessReportFeeMonthStatisticsInfos;
    }
    @Override
    public int queryPrePaymentNewCount(Map info) {
        logger.debug("查询费用月统计数据 入参 info : {}", info);
        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryPrePaymentNewCount", info);
        if (businessReportFeeMonthStatisticsInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessReportFeeMonthStatisticsInfos.get(0).get("count").toString());
    }
    @Override
    public List<Map> queryPrePayment(Map info) throws DAOException {
        logger.debug("查询费用月统计信息 入参 info : {}", info);
        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryPrePayment", info);
        return businessReportFeeMonthStatisticsInfos;
    }
    @Override
    public List<Map> queryPrePaymentCount(Map info) throws DAOException {
        logger.debug("查询费用月统计信息 入参 info : {}", info);
        List<Map> businessReportFeeMonthStatisticsInfos = sqlSessionTemplate.selectList("reportFeeMonthStatisticsServiceDaoImpl.queryPrePaymentCount", info);
        return businessReportFeeMonthStatisticsInfos;
    }
}
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -153,6 +153,26 @@
        return reportFeeMonthStatisticss;
    }
    @Override
    public int queryPrePaymentNewCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        return reportFeeMonthStatisticsServiceDaoImpl.queryPrePaymentNewCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
    }
    @Override
    public List<ReportFeeMonthStatisticsDto> queryPrePayment(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        //校验是否传了 分页信息
        int page = reportFeeMonthStatisticsDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            reportFeeMonthStatisticsDto.setPage((page - 1) * reportFeeMonthStatisticsDto.getRow());
        }
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticss = BeanConvertUtil.covertBeanList(reportFeeMonthStatisticsServiceDaoImpl.queryPrePayment(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto)), ReportFeeMonthStatisticsDto.class);
        return reportFeeMonthStatisticss;
    }
    @Override
    public int queryOweFeeDetailCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        return reportFeeMonthStatisticsServiceDaoImpl.queryOweFeeDetailCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto));
    }
@@ -172,6 +192,16 @@
        return reportFeeMonthStatisticss;
    }
    @Override
    public List<ReportFeeMonthStatisticsDto> queryPrePaymentCount(@RequestBody ReportFeeMonthStatisticsDto reportFeeMonthStatisticsDto) {
        //校验是否传了 分页信息
        List<ReportFeeMonthStatisticsDto> reportFeeMonthStatisticss = BeanConvertUtil.covertBeanList(reportFeeMonthStatisticsServiceDaoImpl.queryPrePaymentCount(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsDto)), ReportFeeMonthStatisticsDto.class);
        return reportFeeMonthStatisticss;
    }
    public IReportFeeMonthStatisticsServiceDao getReportFeeMonthStatisticsServiceDaoImpl() {
        return reportFeeMonthStatisticsServiceDaoImpl;