From a15dba424e67b4773a546246c396b83d3b820d98 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期四, 04 七月 2024 10:27:12 +0800
Subject: [PATCH] 提交重复订单提示

---
 north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java |  184 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 179 insertions(+), 5 deletions(-)

diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
index 0634f98..7472351 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -6,20 +6,23 @@
 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.sd.Order;
-import com.example.erp.entity.sd.OrderDetail;
 import com.example.erp.entity.sd.OrderGlassDetail;
 import com.example.erp.entity.sd.OrderProcessDetail;
 import com.example.erp.mapper.pp.FlowCardMapper;
 import com.example.erp.mapper.sd.OrderGlassDetailMapper;
 import com.example.erp.mapper.sd.OrderProcessDetailMapper;
-import org.springframework.beans.factory.annotation.Autowired;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.stereotype.Service;
 
-import java.sql.Date;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import java.io.IOException;
+
+
+import java.sql.Date;
+import java.util.*;
 
 import static com.example.erp.service.sd.OrderService.getOrderProcessDetails;
 
@@ -71,6 +74,8 @@
 
                 //淇敼鍒嗘灦鐘舵��
                 flowCardMapper.updateDeleteState(orderId, processId);
+                //鍒犻櫎鎶ュ伐娴佺▼鏄庣粏琛ㄦ暟鎹�
+                flowCardMapper.deleteReportingWork(processId);
                 //鍒犻櫎鍒嗘灦鏄庣粏
                 flowCardMapper.deleteFlowCardMp(orderId, processId);
                 //鍒ゆ柇璇ヨ鍗曟祦绋嬪崱鏄惁鍏ㄩ儴鍒犻櫎
@@ -187,4 +192,173 @@
         map.put("data", flowCardMapper.selectLastSchedulingMp(selectTime1, selectTime2, flowCard));
         return map;
     }
+
+    public Object flowCardDetailSv(String processId, FlowCard flowCard) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", flowCardMapper.flowCardDetailMp(processId, flowCard));
+        return map;
+    }
+
+    public Object selectPrintFlowCardSv(Date selectTime1, Date selectTime2, String orderId, String project, FlowCard flowCard) {
+        if ("null".equals(orderId)) {
+            orderId = "";
+        }
+        if ("null".equals(project)) {
+            project = "";
+        }
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", flowCardMapper.selectPrintFlowCardMp(selectTime1, selectTime2, orderId, project, flowCard));
+        return map;
+    }
+
+    public Object selectPrintFlowCard(Date selectTime1, Date selectTime2) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", flowCardMapper.selectPrintFlowCard(selectTime1, selectTime2));
+        return map;
+    }
+
+    public Object selectPrintSv(String orderId, FlowCard flowCard) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", flowCardMapper.selectPrintMp(orderId, flowCard));
+        map.put("type", flowCardMapper.selectType());
+        return map;
+    }
+
+    private static Map<String, Object> parseJson(String json) {
+        ObjectMapper objectMapper = new ObjectMapper();
+        try {
+            return objectMapper.readValue(json, new TypeReference<Map<String, Object>>() {});
+        } catch (IOException e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+    public Map<String, Object> getSelectPrintingSv(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("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), flowCard.getTechnologyNumber()));
+                itemmap.put("numberList", flowCardMapper.getGlassNumber(flowCard.getTechnologyNumber(),flowCard.getProcessId()));
+
+                //娴佺▼鍗℃槑缁嗘暟鎹�
+                List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber());
+                List<Map<String, Object>> glassList = flowCardMapper.getGlassNumber(flowCard.getTechnologyNumber(),flowCard.getProcessId());
+                //宸ヨ壓娴佺▼
+                List<Map<String, Object>> processList = flowCardMapper.getProcessList(flowCard.getProcessId(), flowCard.getTechnologyNumber());
+                itemmap.put("detailList", detailList);
+                itemmap.put("processList", processList);
+                list.add(itemmap);
+
+            }
+        }
+        map.put("data", list);
+        return map;
+    }
+
+    public Boolean updateComposingSv(Map<String, Object> object) {
+        List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("composing")), FlowCard.class);
+        if (!flowCardList.isEmpty()) {
+            for (FlowCard flowCard : flowCardList) {
+                flowCardMapper.updateComposing(flowCard.getProcessId());
+            }
+            return true;
+        }
+        else {
+            return false;
+
+        }
+    }
+
+    public Map<String, Object> getSelectPrintLabelSv(String projectNo) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", flowCardMapper.getPrintLabel(projectNo));
+        return map;
+    }
+
+    public Map<String, Object> getSelectPrintLabelSv1(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) {
+                    // Integer count=flowCardMapper.getPrintLabelCount(flowCard.getProcessId(), flowCard.getTechnologyNumber());
+                    Map<String, Object> itemmap = new HashMap<>();
+                    // for (int i = 0; i < count; i++) {
+                    itemmap.put("data", flowCardMapper.getPrintLabel1(flowCard.getProcessId(), flowCard.getTechnologyNumber()));
+                    list.add(itemmap);
+                    //}
+
+                }
+            }
+            map.put("data", list);
+
+        return map;
+    }
+
+    public Map<String, Object> printFlowCardDetailsSv(String processId, String technologyNumber, FlowCard flowCard) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", flowCardMapper.printFlowCardDetailsMp(processId, technologyNumber, flowCard));
+        return map;
+    }
+
+    public Boolean printSortSv(Map<String, Object> object) {
+        List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class);
+        if (!FlowCardList.isEmpty()) {
+            for (FlowCard flowCard : FlowCardList) {
+                flowCardMapper.printSortMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getTechnologyNumber(),flowCard.getSort());
+            }
+        }
+        return true;
+    }
+
+
+    public Map<String, Object> getSelectPrintCustomLabelSv(String type, Integer lableType, 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()) {
+            Set<String> processedProcessIds = new HashSet<>();  // 鐢ㄦ潵瀛樻斁宸插鐞嗚繃鐨� processId
+
+            if (lableType != 2){
+                for (FlowCard flowCard : flowCardList) {
+                    String processId = flowCard.getProcessId();
+
+                    // 妫�鏌ユ槸鍚﹀凡缁忓鐞嗚繃璇� processId锛屽鏋滃鐞嗚繃鍒欒烦杩�
+                    if (processedProcessIds.contains(processId)) {
+                        continue;
+                    }
+                    Map<String, Object> itemmap = new HashMap<>();
+                    itemmap.put("data", flowCardMapper.getPrintCustomData(flowCard.getProcessId(),flowCard.getTechnologyNumber()));
+                    list.add(itemmap);
+
+                    // 灏嗚 processId 鍔犲叆宸插鐞嗛泦鍚�
+                    processedProcessIds.add(processId);
+                }
+            }
+            else{
+                for (FlowCard flowCard : flowCardList) {
+                    Map<String, Object> itemmap = new HashMap<>();
+                    itemmap.put("data", flowCardMapper.getPrintCustomData(flowCard.getProcessId(),flowCard.getTechnologyNumber()));
+                    list.add(itemmap);
+                }
+            }
+        }
+        map.put("data", list);
+        map.put("title", flowCardMapper.getPrintTitle(type));
+        return map;
+    }
+
+    public Object getCustomLabelDetailSv(String name, String form, String id, FlowCard flowCard) {
+        Map<String, Object> map = new HashMap<>();
+        map.put("data", flowCardMapper.getCustomLabelDetailMp(name, form,id, flowCard));
+        return map;
+    }
+
 }
+
+

--
Gitblit v1.8.0