From b864a88a6d34cbed2cfaad7f5e843ea1330c9c91 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 18 七月 2024 10:31:33 +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/ReplenishService.java |   54 +++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 47 insertions(+), 7 deletions(-)

diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java
index be57c41..13c704b 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java
@@ -3,13 +3,15 @@
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.example.erp.entity.pp.FlowCard;
 import com.example.erp.entity.pp.PatchLog;
-import com.example.erp.entity.pp.Rework;
+import com.example.erp.entity.pp.ReportingWork;
 import com.example.erp.entity.userInfo.SysError;
+import com.example.erp.mapper.pp.FlowCardMapper;
 import com.example.erp.mapper.pp.PatchLogMapper;
+import com.example.erp.mapper.pp.ReportingWorkMapper;
 import com.example.erp.service.userInfo.SysErrorService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -23,11 +25,24 @@
 @DS("pp")
 @Transactional(rollbackFor = Exception.class)
 public class ReplenishService {
-    @Autowired
+    final
     PatchLogMapper patchMapper;
 
-    @Autowired
+    final
     SysErrorService sysErrorService;
+
+    final
+    ReportingWorkMapper reportingWorkMapper;
+
+    final
+    FlowCardMapper flowCardMapper;
+
+    public ReplenishService(PatchLogMapper patchMapper, SysErrorService sysErrorService, ReportingWorkMapper reportingWorkMapper,FlowCardMapper flowCardMapper) {
+        this.patchMapper = patchMapper;
+        this.sysErrorService = sysErrorService;
+        this.reportingWorkMapper = reportingWorkMapper;
+        this.flowCardMapper = flowCardMapper;
+    }
 
 
     public List<Map<String, Object>> getSelectReplenish(Integer pageNum, Integer pageSize) {
@@ -79,6 +94,7 @@
                     //娣诲姞杩斿伐璁板綍锛屼慨鏀规鐮存槑缁嗘暟閲�
                     patchMapper.insertReplenish(patchLog,oddNumber);
                     patchMapper.updateDamageDetails(patchLog);
+                    patchMapper.updateReportingWorkDetail(patchLog.getReportingWorkId(), Integer.valueOf(patchLog.getOrderSort()),patchLog.getTechnologyNumber());
                 }
             }
 
@@ -114,9 +130,11 @@
             if (!patchLoglist.isEmpty()){
                 for (PatchLog patchLog : patchLoglist) {
                     //瀹℃牳
-                    patchMapper.updateReplenish(patchLog,userName);
+                   patchMapper.updateReplenish(patchLog,userName);
+                    ReportingWork reportingWork = reportingWorkMapper
+                            .selectOne(new QueryWrapper<ReportingWork>().eq("reporting_work_id",patchLog.getReportingWorkId()));
                     //淇敼灏忕墖娴佺▼鍗℃暟閲�
-                    patchMapper.updateOrderProcessDetail(patchLog);
+                    patchMapper.updateOrderProcessDetail(patchLog,reportingWork);
                 }
             }
 
@@ -153,8 +171,30 @@
         return oddNumbers;
     }
 
+    public Object selectPrintSv(java.sql.Date selectTime1, java.sql.Date selectTime2, FlowCard flowCard) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", flowCardMapper.selectReplenishPrintMp(selectTime1,selectTime2,flowCard));
+        map.put("type", flowCardMapper.selectType());
+        return map;
+    }
+
+    public Map<String, Object> getSelectPrintCustomLabelSv(String type, Map<String, Object> object) {
+        Map<String, Object> map = new HashMap<>();
+        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//鏈�缁堢粨鏋�
+        List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class);
+        if (!flowCardList.isEmpty()) {
+            for (FlowCard flowCard : flowCardList) {
+
+                Map<String, Object> itemmap = new HashMap<>();
+                itemmap.put("data", flowCardMapper.getRepairPrintCustomData(flowCard.getProcessId(),flowCard.getTechnologyNumber()));
+                list.add(itemmap);
 
 
-
+            }
+        }
+        map.put("data", list);
+        map.put("title", flowCardMapper.getPrintTitle(type));
+        return map;
+    }
 }
 

--
Gitblit v1.8.0