wuzeyu
2024-12-27 f5f8138f4f50eedd3598a9073956f0afa56e7139
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StIntakeSv.java
@@ -5,9 +5,7 @@
import com.dy.pipIrrGlobal.daoSt.StIntakeAmountYearMapper;
import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountMonth;
import com.dy.pipIrrGlobal.pojoSt.StIntakeAmountYear;
import com.dy.pipIrrGlobal.pojoSt.StLossYear;
import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics;
import com.dy.pipIrrGlobal.voSt.VoIntakeLossStatistics;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -32,14 +30,19 @@
    protected StIntakeAmountYearMapper stIntakeAmountYearDao ;
    /**
     * 月统计---漏损
     * 月统计---取水口用水量
     */
    @Transactional
    protected void statisticsMonth(Integer statisticsYear, Integer statisticsMonth, Long statisticsStartId, Long statisticsEndId){
        List<VoIntakeAmountStatistics> list = rmIntakeAmountDayDao.statisticsByIntake(statisticsStartId, statisticsEndId) ;
        if(list != null && list.size() > 0){
            for(VoIntakeAmountStatistics vo : list){
                StIntakeAmountMonth po = this.stIntakeAmountMonthDao.selectByIntakeIdAndYearAndMonth(vo.intakeId, statisticsYear, statisticsMonth) ;
                List<StIntakeAmountMonth> listOfMonth = this.stIntakeAmountMonthDao.selectByIntakeIdAndYearAndMonth(vo.intakeId, statisticsYear, statisticsMonth) ;
                StIntakeAmountMonth po = null ;
                if(listOfMonth != null && listOfMonth.size() > 0) {
                    //程序逻辑控制上,集合中只有一个对象
                    po = listOfMonth.get(0);
                }
                if(po == null){
                    po = new StIntakeAmountMonth() ;
                }
@@ -57,14 +60,19 @@
    }
    /**
     * 年统计---漏损
     * 年统计---取水口用水量
     */
    @Transactional
    protected void statisticsYear(Integer statisticsYear){
        List<VoIntakeAmountStatistics> list = stIntakeAmountMonthDao.statisticsByIntake(statisticsYear) ;
        if(list != null && list.size() > 0){
            for(VoIntakeAmountStatistics vo : list){
                StIntakeAmountYear po = stIntakeAmountYearDao.selectByIntakeIdAndYear(vo.intakeId, statisticsYear) ;
                List<StIntakeAmountYear> listOfYear = stIntakeAmountYearDao.selectByIntakeIdAndYear(vo.intakeId, statisticsYear) ;
                StIntakeAmountYear po = null ;
                if(listOfYear != null && listOfYear.size() > 0) {
                    //程序逻辑控制上,集合中只有一个对象
                    po = listOfYear.get(0);
                }
                if(po == null){
                    po = new StIntakeAmountYear() ;
                }