From ddd56a8f37eb47d933a7064be9341feb8dbd8165 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期四, 04 七月 2024 16:51:34 +0800
Subject: [PATCH] edit params and file Api

---
 pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java |   99 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 97 insertions(+), 2 deletions(-)

diff --git a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
index 353bbd1..48793d7 100644
--- a/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
+++ b/pms-parent/pms-web-station/src/main/java/com/dy/pmsStation/assemblyStep/AssemblyStepCtrl.java
@@ -1,8 +1,18 @@
 package com.dy.pmsStation.assemblyStep;
 
+import com.dy.common.webUtil.BaseResponse;
+import com.dy.common.webUtil.BaseResponseUtils;
+import com.dy.pmsGlobal.pojoPlt.PltProductFile;
+import com.dy.pmsGlobal.pojoPlt.PltProductParams;
+import com.dy.pmsGlobal.pojoPlt.PltProductQualityInspectionItems;
+import com.dy.pmsGlobal.pojoPlt.PltProductTestInspectionItems;
+import com.dy.pmsGlobal.pojoPr.PrProductionNode;
+import jakarta.validation.Valid;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
 
 /**
  *璁板綍缁勮鍚勬楠�
@@ -11,4 +21,89 @@
 @RestController
 @RequestMapping(path = "assemblyStep")
 public class AssemblyStepCtrl {
+    private AssemblyStepSv sv;
+    @Autowired
+    public void setSv(AssemblyStepSv sv) {
+        this.sv = sv;
+    }
+
+    @PostMapping(path = "save")
+    public BaseResponse save(@RequestBody @Valid QueryVo vo) {
+        log.info("AssemblyStepCtrl.save()");
+        int count = sv.save(vo);
+        if (count <= 0) {
+            return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+        } else {
+            return BaseResponseUtils.buildSuccess(true);
+        }
+    }
+
+    @PostMapping(path = "repair")
+    public BaseResponse repair(@RequestBody @Valid QueryVo vo) {
+        log.info("AssemblyStepCtrl.repair()");
+        int count = sv.repair(vo);
+        if (count <= 0) {
+            return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+        } else {
+            return BaseResponseUtils.buildSuccess(true);
+        }
+    }
+    /**
+     * 鏍规嵁鑺傜偣鐨勬煡鍑鸿妭鐐逛綔涓氭寚瀵间功
+     * @param
+     * @return
+     */
+    @GetMapping(path="getSopByNodeId")
+    public BaseResponse<PrProductionNode> getSopByNodeId(String nodeId){
+        PrProductionNode result = sv.getSopByNodeId(nodeId);
+        return BaseResponseUtils.buildSuccess(result);
+    }
+    /**
+     * 鏍规嵁浜у搧鏌ュ嚭 涓昏鎶�鏈弬鏁�
+     * @param
+     * @return
+     */
+    @GetMapping(path="getParamsByProId")
+    public BaseResponse<List<PltProductParams>> getParamsByProId(String proId){
+        List<PltProductParams> result = sv.getParamsByProId(proId);
+        return BaseResponseUtils.buildSuccess(result);
+    }
+    /**
+     * 鏍规嵁浜у搧鏌ュ嚭浜у搧鏂囦欢 涓昏鎶�鏈弬鏁�
+     * @param
+     * @return
+     */
+    @GetMapping(path="getFileByProId")
+    public BaseResponse<List<PltProductFile>> getFileByProId(String proId){
+        List<PltProductFile> result = sv.getFileByProId(proId);
+        return BaseResponseUtils.buildSuccess(result);
+    }
+    @GetMapping(path = "getQualityItems")
+    public BaseResponse<List<PltProductQualityInspectionItems>> getQualityItems(String proId) {
+        log.info("AssemblyStepCtrl.getQualityItems()");
+        List<PltProductQualityInspectionItems> result = sv.getQualityItems(proId);
+        return BaseResponseUtils.buildSuccess(result);
+    }
+    @GetMapping(path = "getTestItems")
+    public BaseResponse<List<PltProductTestInspectionItems>> getTestItems(String proId) {
+        log.info("AssemblyStepCtrl.getTestItems()");
+        List<PltProductTestInspectionItems> result = sv.getTestItems(proId);
+        return BaseResponseUtils.buildSuccess(result);
+    }
+
+    /**
+     * 娴嬭瘯鎴栧搧妫�閮借皟鐢ㄨ繖涓帴鍙�
+     * @param vo
+     * @return
+     */
+    @PostMapping(path = "testing")
+    public BaseResponse testing(@RequestBody @Valid QueryVo vo) {
+        log.info("AssemblyStepCtrl.testing()");
+        int count = sv.testing(vo);
+        if (count <= 0) {
+            return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�");
+        } else {
+            return BaseResponseUtils.buildSuccess(true);
+        }
+    }
 }

--
Gitblit v1.8.0