From 203223860baa19deb6860eb2ba3181910d662980 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期四, 17 四月 2025 14:22:59 +0800
Subject: [PATCH] 1. 轮灌组被终止时灌溉时长为实际数值。2. 计划历史表按照创建时间倒排序。3. 发布计划时判断是否同项目下未完成计划,是否其他项目下使用了本计划的轮灌组且计划未完成。4. 根据计划ID获取计划最新状态。

---
 pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuTaskSv.java |  132 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 132 insertions(+), 0 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuTaskSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuTaskSv.java
new file mode 100644
index 0000000..6c86bbf
--- /dev/null
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-base/src/main/java/com/dy/pipIrrBase/rtuUpgrade/task/UgRtuTaskSv.java
@@ -0,0 +1,132 @@
+package com.dy.pipIrrBase.rtuUpgrade.task;
+
+import com.dy.common.webUtil.QueryResultVo;
+import com.dy.pipIrrGlobal.daoRm.UgRtuTaskMapper;
+import com.dy.pipIrrGlobal.pojoUg.UgRtuTask;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.common.utils.PojoUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/11/5 8:33
+ * @Description
+ */
+@Slf4j
+@Service
+public class UgRtuTaskSv {
+
+    @Autowired
+    private UgRtuTaskMapper dao ;
+
+    /**
+     * 寰楀埌涓�涓竴浜涘崌绾х▼搴�
+     * @param id 涓�浜涘崌绾х▼搴廔D
+     * @return 涓�浜涘崌绾х▼搴忓疄浣�
+     */
+    public UgRtuTask selectById(Long id){
+        return this.dao.selectByPrimaryKey(id) ;
+    }
+
+    /**
+     * 寰楀埌涓�浜涘崌绾х▼搴�
+     * @return 涓�浜涘崌绾х▼搴�
+     */
+    public QueryResultVo<List<UgRtuTask>> selectSome(QueryTaskVo queryVo){
+        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo) ;
+        Long itemTotal = this.dao.selectTotal(params) ;
+
+        QueryResultVo<List<UgRtuTask>> rsVo = new QueryResultVo<>() ;
+        rsVo.pageSize = queryVo.pageSize ;
+        rsVo.pageCurr = queryVo.pageCurr ;
+        rsVo.calculateAndSet(itemTotal, params);
+        rsVo.obj = this.dao.selectSome(params) ;
+
+        return rsVo ;
+    }
+
+    /**
+     * 寰楀埌鎵�鏈夊崌绾х▼搴忚褰旾D鍜屾枃浠跺悕绉�
+     * @return 涓�浜涘崌绾х▼搴�
+     */
+    public QueryResultVo<List<UgRtuTask>> selectAll(){
+        QueryResultVo<List<UgRtuTask>> rsVo = new QueryResultVo<>() ;
+        rsVo.obj = this.dao.selectAll() ;
+        return rsVo ;
+    }
+
+    /**
+     * 鏂板淇濆瓨鍒嗘按鍙e疄浣�
+     * @param po 瀹炰綋
+     * @return 鏁伴噺
+     */
+    @Transactional
+    public int save(UgRtuTask po){
+        return this.dao.insertSelective(po) ;
+    }
+    /**
+     * 淇濆瓨淇敼瀹炰綋
+     * @param po 瀹炰綋
+     * @return 鏁伴噺
+     */
+    @Transactional
+    public int update(UgRtuTask po){
+        return this.dao.updateByPrimaryKeySelective(po) ;
+    }
+
+    /**
+     * 鎵ц浠诲姟
+     * @param id 瀹炰綋ID
+     * @return 鏁伴噺
+     */
+    @Transactional
+    public int execute(Long id){
+        return this.dao.executeById(id) ;
+    }
+
+    /**
+     * 缁撴潫浠诲姟
+     * @param id 瀹炰綋ID
+     * @return 鏁伴噺
+     */
+    @Transactional
+    public int over(Long id){
+        return this.dao.overById(id) ;
+    }
+
+    /**
+     * 鎵ц浠诲姟
+     * @param id 瀹炰綋ID
+     * @return 鏁伴噺
+     */
+    @Transactional
+    public int isExecute(Long id){
+        return this.dao.isExecuteById(id) ;
+    }
+
+    /**
+     * 缁撴潫浠诲姟
+     * @param id 瀹炰綋ID
+     * @return 鏁伴噺
+     */
+    @Transactional
+    public int isOver(Long id){
+        return this.dao.isOverById(id) ;
+    }
+
+    /**
+     * 閫昏緫鍒犻櫎瀹炰綋
+     * @param id 瀹炰綋ID
+     * @return 鏁伴噺
+     */
+    @Transactional
+    public int delete(Long id){
+        return this.dao.deleteLogicById(id) ;
+    }
+
+}

--
Gitblit v1.8.0