From 05d6de25d55bdf1e2f3cde9d310c2cd14d59837a Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期三, 17 七月 2024 12:51:33 +0800
Subject: [PATCH] 提交

---
 north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

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 3577ab8..2b03502 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
@@ -5,14 +5,12 @@
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
-import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
 import com.example.erp.common.Constants;
 import com.example.erp.entity.pp.DamageDetails;
 import com.example.erp.entity.pp.FlowCard;
 import com.example.erp.entity.pp.ReportingWork;
 import com.example.erp.entity.pp.ReportingWorkDetail;
 import com.example.erp.entity.sd.Order;
-import com.example.erp.entity.sd.OrderDetail;
 import com.example.erp.entity.sd.OrderProcessDetail;
 import com.example.erp.exception.ServiceException;
 import com.example.erp.mapper.pp.*;
@@ -20,7 +18,6 @@
 import com.example.erp.mapper.sd.OrderMapper;
 import com.example.erp.mapper.sd.OrderProcessDetailMapper;
 import com.example.erp.service.sd.OrderProcessDetailService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -66,7 +63,7 @@
     public Map<String, Object> AddSelectLastWorkSv(String processIdStr, String technologyStr, String process) {
         Map<String, Object> map = new HashMap<>();
         //鏌ヨ娴佺▼鍗″伐鑹烘祦绋�
-        String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr);
+        String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr,technologyStr);
 
 
 
@@ -203,11 +200,18 @@
                 });
             }
             //鏌ヨ娴佺▼鍗″伐鑹烘祦绋�
-            String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(reportingWork.getProcessId());
+            String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(reportingWork.getProcessId(), reportingWorkDetail.getTechnologyNumber());
 
             int index = technologicalProcess.indexOf("-");
-            //鑾峰彇宸ヨ壓娴佺▼绗竴涓伐搴�
-            String interceptProcess = technologicalProcess.substring(0, index);
+            String interceptProcess = "";
+            if (index <0){
+                 interceptProcess = technologicalProcess;
+            }
+            else {
+                //鑾峰彇宸ヨ壓娴佺▼绗竴涓伐搴�
+                 interceptProcess = technologicalProcess.substring(0, index);
+            }
+
 
             //鍒ゆ柇褰撳墠宸ュ簭鏄惁涓虹涓�閬撳伐搴忓伐搴忥紝浣跨敤娴佺▼鍗¤〃鏁伴噺鎴栬�呭皬鐗囨祦绋嬭〃涓婂伐搴忔暟閲�
             int processNum = 0;
@@ -283,8 +287,12 @@
     public boolean ReviewReportingWorkSv(Map<String, String> reportingWork) {
 
         String processId = reportingWork.get("processId");
+        String thisProcess = reportingWork.get("thisProcess");
+        int index = processId.lastIndexOf("/") + 1;
+        String result = processId.substring(index);
 
-        LambdaUpdateWrapper
+if (thisProcess.equals("澶硅兌") || thisProcess.equals("涓┖") || thisProcess.equals("浠撳偍")){
+    LambdaUpdateWrapper
                 <ReportingWork> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper
                 .eq(ReportingWork::getProcessId, processId.substring(0, 14))
@@ -292,8 +300,10 @@
                 .eq(ReportingWork::getReviewedState, 0)
                 .setSql("reviewed_state =1");
         reportingWorkMapper.update(null, updateWrapper);
+}else {
+    reportingWorkMapper.ReviewReportingWorkMp(processId.substring(0, 14),reportingWork.get("process"),result);
 
-
+}
         return true;
     }
 

--
Gitblit v1.8.0