From 1e56bd5cc3be7f7957788f2606c7f56cb4d27f50 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期一, 01 十二月 2025 11:41:42 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10105/r/ERP_override

---
 north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java
index 307bc6a..08189cb 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java
@@ -3,6 +3,7 @@
 import com.alibaba.fastjson.JSON;
 import com.baomidou.dynamic.datasource.annotation.DS;
 import com.example.erp.entity.sd.BasicGlassType;
+import com.example.erp.entity.sd.ProcessAttributeConfig;
 import com.example.erp.mapper.sd.BasicGlassTypeMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -105,4 +106,59 @@
         }
 
     }
+
+    public List<ProcessAttributeConfig> findAllConfig() {
+        return basicGlassTypeMapper.getFindAllConfig();
+    }
+
+    public List<Map<String,Object>> getOneLevelListMapConfig() {
+        List<ProcessAttributeConfig> processAttributeConfigList = basicGlassTypeMapper.getOneLevelListMapConfig();
+        List<Map<String,Object>> list = new ArrayList<>();
+        for (ProcessAttributeConfig processAttributeConfig : processAttributeConfigList) {
+            Map<String,Object> map = new HashMap<>();
+            map.put("value", processAttributeConfig.getInputType());
+            map.put("label", processAttributeConfig.getProcessName());
+            list.add(map);
+        }
+        return list;
+    }
+
+    public Boolean addConfig(Map<String, Object> map) {
+        List<Object> list = (List<Object>) map.get("glassLevel");
+        if(list.get(0)==null
+                || map.get("processType") == null
+                || map.get("processType").equals("")){
+            return false;
+        }
+        ProcessAttributeConfig processAttributeConfigS = new ProcessAttributeConfig();
+        if(map.get("type").equals("add")){
+            if(list.size()==1){
+                ProcessAttributeConfig processAttributeConfig =  basicGlassTypeMapper.selectMaxTypeConfig((Integer) list.get(0));
+                int maxId = Integer.parseInt(processAttributeConfig.getInputType());
+                String newTypeId = String.format("%02d", maxId+1);
+                processAttributeConfigS.setLevel((Integer) list.get(0));
+                processAttributeConfigS.setInputType(newTypeId);
+                processAttributeConfigS.setProcessType((String) map.get("processType"));
+                processAttributeConfigS.setProcessName((String) map.get("processName"));
+            }else if(list.size()==2) {
+                processAttributeConfigS.setLevel((Integer) list.get(0));
+                processAttributeConfigS.setInputType((String) map.get("inputType"));
+                processAttributeConfigS.setProcessType((String) map.get("processType"));
+                processAttributeConfigS.setProcessName((String) map.get("processName"));
+                processAttributeConfigS.setBelong((String) list.get(1));
+            }
+            return basicGlassTypeMapper.insertProcessAttributeConfig(processAttributeConfigS);
+        }else{
+            processAttributeConfigS.setId((Integer) map.get("id"));
+            processAttributeConfigS.setInputType((String) map.get("inputType"));
+            processAttributeConfigS.setProcessType((String) map.get("processType"));
+            processAttributeConfigS.setProcessName((String) map.get("processName"));
+            return basicGlassTypeMapper.updateProcessAttributeConfig(processAttributeConfigS);
+        }
+
+    }
+
+    public Boolean deleteProcessAttributeConfig(Integer id) {
+        return basicGlassTypeMapper.deleteProcessAttributeConfig(id);
+    }
 }

--
Gitblit v1.8.0