From b5a9dccccaf5bed064891a05ec8ff3f21de9cff0 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 25 九月 2024 16:31:14 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java       |   17 ++++++++++++++---
 north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java |    6 +++---
 north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue          |    2 +-
 north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java         |    6 ++++++
 north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml                           |   28 ++++++++++++++++++++++++++++
 5 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue b/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
index 81b47b1..595cdeb 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -793,7 +793,7 @@
 
 //绗竴娆″姞杞芥暟鎹�
 let groupChangeProcess = ref(false)//鐢ㄤ簬鏈彮缁勬樉绀洪棶棰�
-request.post(`/reportingWork/selectProcess`).then((res) => {
+request.post(`/reportingWork/selectProcess/${user.user.userId}`).then((res) => {
   if (res.code == 200) {
     titleSelectJson.value.processType = res.data.process
     if(user.user.address!==null && user.user.address!==''){
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
index 8cf2442..67448c5 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
@@ -40,9 +40,9 @@
         return  Result.seccess(reportingWorkService.AddSelectLastWorkSv(processIdStr,technologyStr,process,reportType));
     }
     @ApiOperation("鏌ヨ宸ュ簭")
-    @PostMapping  ("/selectProcess")
-    public Result SelectProcess()  {
-        return  Result.seccess(reportingWorkService.SelectProcessSv());
+    @PostMapping  ("/selectProcess/{userId}")
+    public Result SelectProcess(@PathVariable String userId)  {
+        return  Result.seccess(reportingWorkService.SelectProcessSv(userId));
     }
 
     @ApiOperation("鎶ュ伐鏂板")
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
index 813289a..5b8ff8f 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/ReportingWorkMapper.java
@@ -88,4 +88,10 @@
     Boolean updateRWPatchNum(String reportingWorkId, Integer patchNum);
 
     Boolean updateRWDPatchNum(String reportingWorkId, String orderSort, Integer technologyNumber, Integer patchNum);
+
+    String selectUserProcess(String userId);
+
+    List<Map<String,String>> getSelectProcessJiajiao();
+
+    List<Map<String,String>> getSelectProcessDuoqu();
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
index 95c2bd1..924c8ed 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -25,7 +25,6 @@
 import com.example.erp.service.userInfo.LogService;
 import com.example.erp.service.userInfo.SysErrorService;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -178,9 +177,21 @@
     }
 
     //鏌ヨ宸ュ簭
-    public Map<String, Object> SelectProcessSv() {
+    public Map<String, Object> SelectProcessSv(String userId) {
         Map<String, Object> map = new HashMap<>();
-        map.put("process", reportingWorkMapper.SelectProcessMp());
+        String process = reportingWorkMapper.selectUserProcess(userId);
+        if (process==null) {
+            map.put("process", reportingWorkMapper.SelectProcessMp());
+        }
+        else {
+            if (process.equals("澶硅兌")){
+                map.put("process",reportingWorkMapper.getSelectProcessJiajiao() );
+            }
+            if (process.equals("鎶�鏈儴澶氭洸")){
+                map.put("process",reportingWorkMapper.getSelectProcessDuoqu() );
+            }
+        }
+
         return map;
     }
 
diff --git a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
index 79f2ed6..7f8fbb5 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -886,4 +886,32 @@
         where reporting_work_id=#{reportingWorkId} and order_number = #{orderSort}
           and technology_number = #{technologyNumber}
     </update>
+
+    <select id="selectUserProcess">
+        select address from erp_user_info.user where login_name=#{userId}
+    </select>
+
+    <select id="getSelectProcessJiajiao">
+        SELECT * FROM (
+                          SELECT * FROM sd.basic_data
+                          WHERE basic_type='product' AND basic_category='process' AND basic_name='澶硅兌'
+
+                          UNION
+
+                          SELECT * FROM sd.basic_data
+                          WHERE basic_type='product' AND basic_category='process' AND basic_name='鍧囪川'
+                      ) AS combined_results;
+    </select>
+
+    <select id="getSelectProcessDuoqu">
+        SELECT * FROM (
+                          SELECT * FROM sd.basic_data
+                          WHERE basic_type='product' AND basic_category='process' AND basic_name='鎶�鏈儴澶氭洸'
+
+                          UNION
+
+                          SELECT * FROM sd.basic_data
+                          WHERE basic_type='product' AND basic_category='process' AND basic_name='閽㈠寲'
+                      ) AS combined_results;
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0