liurunyu
2024-12-11 b81e59b6ef96ac100109f7662365ff3bec805a2d
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeClientAmountSv.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrTemp.delSome;
import com.dy.pipIrrGlobal.daoTmp.DeleteMapper;
import com.dy.pipIrrGlobal.voTmp.VoStClientAmountDay;
import com.dy.pipIrrGlobal.voTmp.VoStClientAmountMonth;
import com.dy.pipIrrGlobal.voTmp.VoStClientAmountYear;
import lombok.extern.slf4j.Slf4j;
@@ -26,6 +27,31 @@
    @Autowired
    private void setDao(DeleteMapper dao){
        this.dao = dao;
    }
    public void delStClientDay(){
        VoStClientAmountDay first = null ;
        List<VoStClientAmountDay> list = dao.selectAllStClientDay() ;
        if(list != null && list.size() > 0){
            for(VoStClientAmountDay vo : list){
                if(first == null){
                    first = vo ;
                }else{
                    if(first.clientId.longValue() != vo.clientId.longValue()){
                        //农户变了
                        first = vo ;
                    }else{
                        if(!first.dt.equals(vo.dt)) {
                            //日期变了
                            first = vo ;
                        }else{
                            //同一个农户同日期
                            doDelStClientDay(vo.id) ;
                        }
                    }
                }
            }
        }
    }
    public void delStClientMonth(){
@@ -84,6 +110,11 @@
        }
    }
    @Transactional
    int doDelStClientDay(Long id){
        return dao.deleteStClientDayById(id) ;
    }
    @Transactional
    int doDelStClientMonth(Long id){
        return dao.deleteStClientMonthById(id) ;
    }