From 4acdf28be7df0b59882de810481f6a8f53fddc87 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 29 十月 2024 16:42:13 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV
---
pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java | 80 ++++++++++++++++++++++++++++++++++++++++
1 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java
index 3a5ce63..4683b2d 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-irrigate/src/main/java/com/dy/pipIrrIrrigate/project/ProjectSv.java
@@ -1,13 +1,20 @@
package com.dy.pipIrrIrrigate.project;
+import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoIr.IrProjectMapper;
import com.dy.pipIrrGlobal.pojoIr.IrProject;
+import com.dy.pipIrrGlobal.voIr.VoProject;
+import com.dy.pipIrrGlobal.voIr.VoProjectOne;
+import com.dy.pipIrrGlobal.voPr.VoIntake;
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 java.util.Date;
+import java.util.List;
+import java.util.Map;
/**
* @author :WuZeYu
@@ -67,4 +74,77 @@
}
return 1;
}
+
+ /**
+ * 淇敼椤圭洰淇℃伅
+ * @param po
+ * @return
+ */
+ public Integer updateProject(IrProject po){
+ po.setOperateDt(new Date());
+ if (po.getVillageId() != null) {
+ po.setTownId(irProjectMapper.getSupperByVillageId(po.getVillageId()));
+ po.setCountyId(irProjectMapper.getSupperByVillageId(po.getTownId()));
+ po.setCityId(irProjectMapper.getSupperByVillageId(po.getCountyId()));
+ po.setProvinceId(irProjectMapper.getSupperByVillageId(po.getCityId()));
+ }
+ if (po.getTownId() != null) {
+ po.setCountyId(irProjectMapper.getSupperByVillageId(po.getTownId()));
+ po.setCityId(irProjectMapper.getSupperByVillageId(po.getCountyId()));
+ po.setProvinceId(irProjectMapper.getSupperByVillageId(po.getCityId()));
+ }
+ if (po.getCountyId() != null) {
+ po.setCityId(irProjectMapper.getSupperByVillageId(po.getCountyId()));
+ po.setProvinceId(irProjectMapper.getSupperByVillageId(po.getCityId()));
+ }
+ if (po.getCityId() != null) {
+ po.setProvinceId(irProjectMapper.getSupperByVillageId(po.getCityId()));
+ }
+ int rows = irProjectMapper.updateByPrimaryKeySelective(po);
+ if (rows == 0){
+ return 0;
+ }
+ return 1;
+ }
+
+ /**
+ * 淇敼椤圭洰鐘舵��
+ * @param po
+ * @return
+ */
+ public Integer updateProjectState(IrProject po){
+ po.setOperateDt(new Date());
+ int rows = irProjectMapper.updateProjectState(po);
+ if (rows == 0){
+ return 0;
+ }
+ return 1;
+ }
+
+ /**
+ * 鑾峰彇涓�涓」鐩暟鎹�
+ * @param id
+ * @return
+ */
+ public VoProjectOne selectById(Long id){
+ VoProjectOne irProject = irProjectMapper.selectById(id);
+ return irProject;
+ }
+
+ /**
+ * 鍒嗛〉鏌ヨ椤圭洰
+ * @param queryVo
+ * @return
+ */
+ public QueryResultVo<List<VoProject>> getProjects(QueryVo queryVo){
+ Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
+ Long itemTotal = irProjectMapper.getRecordCount(params);
+
+ QueryResultVo<List<VoProject>> rsVo = new QueryResultVo<>();
+ rsVo.pageSize = queryVo.pageSize;
+ rsVo.pageCurr = queryVo.pageCurr;
+ rsVo.calculateAndSet(itemTotal, params);
+ rsVo.obj = irProjectMapper.getProjects(params);
+ return rsVo;
+ }
}
--
Gitblit v1.8.0