From 9d6eda75ccc98e9e4a322d209dda3fa0865d1442 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期五, 05 七月 2024 16:33:32 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java
index 032631f..9bbdea9 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intake/IntakeCtrl.java
@@ -9,7 +9,9 @@
 import com.dy.common.webUtil.ResultCodeMsg;
 import com.dy.pipIrrGlobal.pojoPr.PrIntake;
 import com.dy.pipIrrGlobal.voPr.VoIntake;
+import com.dy.pipIrrGlobal.voPr.VoOnLineIntake;
 import com.dy.pipIrrGlobal.voSe.VoActiveCard;
+import com.dy.pipIrrProject.intake.qo.OnLineIntakesQO;
 import com.dy.pipIrrProject.result.ProjectResultCode;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
@@ -145,7 +147,13 @@
         if (bindingResult != null && bindingResult.hasErrors()) {
             return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
         }
-
+        List<String> intakeNameList = intakeSv.getIntakeName();
+        for (int i = 0; i < intakeNameList.size(); i++) {
+            String intakeName = intakeNameList.get(i);
+            if (intakeName.equals(po.getName())) {
+                return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_NAME_EXIST.getMessage());
+            }
+        }
         Date operateTime = new Date();
         po.setOperateDt(operateTime);
         po.setDeleted((byte)0);
@@ -177,13 +185,20 @@
         if (bindingResult != null && bindingResult.hasErrors()) {
             return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
         }
+        List<String> intakeNameList = intakeSv.getIntakeName();
+        for (int i = 0; i < intakeNameList.size(); i++) {
+            String intakeName = intakeNameList.get(i);
+            if (intakeName.equals(po.getName())) {
+                return BaseResponseUtils.buildFail(ProjectResultCode.INTAKE_NAME_EXIST.getMessage());
+            }
+        }
         int count;
         Date operateTime = new Date();
         po.setOperateDt(operateTime);
         try {
             count = this.intakeSv.update(po);
         } catch (Exception e) {
-            log.error("淇濆瓨鍒嗘按鍙e紓甯�", e);
+            log.error("淇濆瓨鍙栨按鍙e紓甯�", e);
             return BaseResponseUtils.buildException(e.getMessage());
         }
         if (count <= 0) {
@@ -276,4 +291,38 @@
         String fileName = URLEncoder.encode(rawFileName, "UTF-8").replaceAll("\\+", "%20");
         response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
     }
+
+    /**
+     * 鑾峰彇鍙栨按鍙e垪琛紙鍦ㄧ嚎鍜屼笉鍦ㄧ嚎锛�
+     * @param qo
+     * @return
+     */
+    @GetMapping(path = "all_intakes")
+    @SsoAop()
+    public BaseResponse<QueryResultVo<List<VoOnLineIntake>>> getAllIntakes(OnLineIntakesQO qo) {
+        try {
+            QueryResultVo<List<VoOnLineIntake>> res = intakeSv.selectOnLineIntakes(qo);
+            return BaseResponseUtils.buildSuccess(res);
+        } catch (Exception e) {
+            log.error("鏌ヨ鍙栨按鍙e紓甯�", e);
+            return BaseResponseUtils.buildException(e.getMessage());
+        }
+    }
+
+    /**
+     * 鏍规嵁鎿嶄綔鍛樿幏鍙栧父鐢ㄥ彇姘村彛锛堝湪绾垮拰涓嶅湪绾匡級
+     * @param operator
+     * @return
+     */
+    @GetMapping(path = "used_intakes")
+    @SsoAop()
+    public BaseResponse<List<VoOnLineIntake>> getUsedIntakes(Long operator) {
+        try {
+            List<VoOnLineIntake> res = intakeSv.getUsedIntakes(operator);
+            return BaseResponseUtils.buildSuccess(res);
+        } catch (Exception e) {
+            log.error("鏌ヨ鍙栨按鍙e紓甯�", e);
+            return BaseResponseUtils.buildException(e.getMessage());
+        }
+    }
 }

--
Gitblit v1.8.0