From b3b17b231e2f2840332ce6eb96f791865fdec6d5 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期一, 14 四月 2025 16:38:16 +0800
Subject: [PATCH] 代码优化
---
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java | 125 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 125 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java
new file mode 100644
index 0000000..849d552
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java
@@ -0,0 +1,125 @@
+package com.dy.pipIrrTemp.delSome;
+
+import com.dy.pipIrrGlobal.daoTmp.DeleteMapper;
+import com.dy.pipIrrGlobal.voTmp.VoStLossAmountDay;
+import com.dy.pipIrrGlobal.voTmp.VoStLossAmountMonth;
+import com.dy.pipIrrGlobal.voTmp.VoStLossAmountYear;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/12/11 10:54
+ * @Description
+ */
+
+@Slf4j
+@Service
+public class DelSomeLossAmountSv {
+
+ private DeleteMapper dao;
+
+ @Autowired
+ private void setDao(DeleteMapper dao){
+ this.dao = dao;
+ }
+
+ public void delStLossDay(){
+ VoStLossAmountDay first = null ;
+ List<VoStLossAmountDay> list = dao.selectAllStLossDay() ;
+ if(list != null && list.size() > 0){
+ for(VoStLossAmountDay vo : list){
+ if(first == null){
+ first = vo ;
+ }else{
+ if(first.intakeId.longValue() != vo.intakeId.longValue()){
+ //鍙栨按鍙e彉浜�
+ first = vo ;
+ }else{
+ if(!first.dt.equals(vo.dt)) {
+ //鏃ユ湡鍙樹簡
+ first = vo ;
+ }else{
+ //鍚屼竴涓彇姘村彛鍚屾棩鏈�
+ doDelStLossDay(vo.id) ;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public void delStLossMonth(){
+ VoStLossAmountMonth first = null ;
+ List<VoStLossAmountMonth> list = dao.selectAllStLossMonth() ;
+ if(list != null && list.size() > 0){
+ for(VoStLossAmountMonth vo : list){
+ if(first == null){
+ first = vo ;
+ }else{
+ if(first.intakeId.longValue() != vo.intakeId.longValue()){
+ //鍙栨按鍙e彉浜�
+ first = vo ;
+ }else{
+ if(first.year.intValue() != vo.year.intValue()) {
+ //骞村害鍙樹簡
+ first = vo ;
+ }else{
+ if(first.month.intValue() != vo.month.intValue()){
+ //鏈堜唤鍙樹簡
+ first = vo ;
+ }else{
+ //鍚屼竴涓彇姘村彛鍚屽勾鍚屾湀
+ doDelStLossMonth(vo.id) ;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ public void delStLossYear(){
+ VoStLossAmountYear first = null ;
+ List<VoStLossAmountYear> list = dao.selectAllStLossYear() ;
+ if(list != null && list.size() > 0){
+ for(VoStLossAmountYear vo : list){
+ if(first == null){
+ first = vo ;
+ }else{
+ if(first.intakeId.longValue() != vo.intakeId.longValue()){
+ //鍙栨按鍙e彉浜�
+ first = vo ;
+ }else{
+ if(first.year.intValue() != vo.year.intValue()) {
+ //骞村害鍙樹簡
+ first = vo ;
+ }else{
+ //鍚屼竴涓彇姘村彛鍚屽勾
+ doDelStLossYear(vo.id) ;
+ }
+ }
+ }
+ }
+ }
+ }
+ @Transactional
+ int doDelStLossDay(Long id){
+ return dao.deleteStLossDayById(id) ;
+ }
+ @Transactional
+ int doDelStLossMonth(Long id){
+ return dao.deleteStLossMonthById(id) ;
+ }
+
+ @Transactional
+ int doDelStLossYear(Long id){
+ return dao.deleteStLossYearById(id) ;
+ }
+
+}
--
Gitblit v1.8.0