liurunyu
2024-12-27 27bd4b5c03bbc8b665ffecb87d6c2cae3262e503
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StClientSv.java
@@ -30,14 +30,19 @@
    protected StClientAmountYearMapper stClientAmountYearDao ;
    /**
     * 月统计---漏损
     * 月统计---农户用水量及金额
     */
    @Transactional
    protected void statisticsMonth(Integer statisticsYear, Integer statisticsMonth, Long statisticsStartId, Long statisticsEndId){
        List<VoClientAmountStatistics> list = rmClientAmountDayDao.statisticsByClient(statisticsStartId, statisticsEndId) ;
        if(list != null && list.size() > 0){
            for(VoClientAmountStatistics vo : list){
                StClientAmountMonth po = stClientAmountMonthDao.selectByClientIdAndYearAndMonth(vo.clientId, statisticsYear, statisticsMonth) ;
                List<StClientAmountMonth> listOfMonth = stClientAmountMonthDao.selectByClientIdAndYearAndMonth(vo.clientId, statisticsYear, statisticsMonth) ;
                StClientAmountMonth po = null ;
                if(listOfMonth != null && listOfMonth.size() > 0){
                    //程序逻辑控制上,集合中只有一个对象
                    po = listOfMonth.get(0) ;
                }
                if(po == null) {
                    po = new StClientAmountMonth();
                }
@@ -55,14 +60,19 @@
    }
    /**
     * 年统计---漏损
     * 年统计---农户用水量及金额
     */
    @Transactional
    protected void statisticsYear(Integer statisticsYear){
        List<VoClientAmountStatistics> list = stClientAmountMonthDao.statisticsByClient(statisticsYear) ;
        if(list != null && list.size() > 0){
            for(VoClientAmountStatistics vo : list){
                StClientAmountYear po = stClientAmountYearDao.selectByClientIdAndYear(vo.clientId, statisticsYear) ;
                List<StClientAmountYear> listOfYear = stClientAmountYearDao.selectByClientIdAndYear(vo.clientId, statisticsYear) ;
                StClientAmountYear po = null ;
                if(listOfYear != null && listOfYear.size() > 0){
                    //程序逻辑控制上,集合中只有一个对象
                    po = listOfYear.get(0) ;
                }
                if(po == null) {
                    po = new StClientAmountYear();
                }