From eabb757720375b74900027e23e50303b7e02ca36 Mon Sep 17 00:00:00 2001
From: huang <1532065656@qq.com>
Date: 星期二, 09 十二月 2025 17:04:23 +0800
Subject: [PATCH] 添加nacos配置中心,可动态更新mes导入工程接口;修改Excel表数据转json格式

---
 mes-processes/mes-plcSend/src/main/java/com/mes/device/service/impl/GlassInfoServiceImpl.java |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/mes-processes/mes-plcSend/src/main/java/com/mes/device/service/impl/GlassInfoServiceImpl.java b/mes-processes/mes-plcSend/src/main/java/com/mes/device/service/impl/GlassInfoServiceImpl.java
index 5d8b503..9b1dd51 100644
--- a/mes-processes/mes-plcSend/src/main/java/com/mes/device/service/impl/GlassInfoServiceImpl.java
+++ b/mes-processes/mes-plcSend/src/main/java/com/mes/device/service/impl/GlassInfoServiceImpl.java
@@ -7,6 +7,8 @@
 import com.mes.device.mapper.DeviceGlassInfoMapper;
 import com.mes.device.service.GlassInfoService;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cloud.context.config.annotation.RefreshScope;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
@@ -27,6 +29,7 @@
  * @since 2024-11-20
  */
 @Slf4j
+@RefreshScope
 @Service("deviceGlassInfoService")
 public class GlassInfoServiceImpl extends ServiceImpl<DeviceGlassInfoMapper, GlassInfo> implements GlassInfoService {
 
@@ -212,6 +215,14 @@
         }
     }
 
+    @Value("${mes.engineering.import-url}")
+    private String mesEngineeringImportUrl;
+
+    @Override
+    public String getMesEngineeringImportUrl() {
+        return mesEngineeringImportUrl;
+    }
+
     @Override
     public Map<String, Object> buildEngineerImportPayload(List<Map<String, Object>> excelRows) {
         Map<String, Object> result = new HashMap<>();
@@ -235,7 +246,6 @@
                     int qty = (int) parseDouble(row.getOrDefault("quantity", 1), 1);
                     if (qty <= 0) qty = 1;
                     String glassId = str(row.get("glassId"));
-                    Integer orderNumber = Integer.parseInt(str(row.get("orderNumber")));
                     String filmsId = strOrDefault(row.get("filmsId"), filmsIdDefaultFinal);
                     String flowCardId = str(row.get("flowCardId"));
                     String productName = str(row.get("productName"));
@@ -256,7 +266,6 @@
                         m.put("glassId", finalGlassId);
                         m.put("engineerId", engineerIdFinal);
                         m.put("flowCardId", finalFlowCardId);
-                        m.put("orderNumber", orderNumber);
                         m.put("productSortNumber", idx + 1);
                         m.put("hollowCombineDirection", "0");
                         m.put("width", width);
@@ -279,7 +288,7 @@
                         m.put("combine", 0);
                         m.put("markIcon", "");
                         m.put("filmRemove", 0);
-                        m.put("flowCardSequence", String.valueOf(idx + 1));
+                        m.put("flowCardSequence", flowCardId + "/" + (idx + 1));
                         m.put("process", "");
                         m.put("rawAngle", 0);
                         m.put("graphNo", 0);
@@ -324,7 +333,7 @@
             double height = parseDouble(row.get("height"), 0d);
             double thickness = parseDouble(row.get("thickness"), thicknessDefaultFinal);
             String filmsId = strOrDefault(row.get("filmsId"), filmsIdDefaultFinal);
-            Integer orderNumber = Integer.parseInt(str(row.get("orderNumber")));
+
             String productName = str(row.get("productName"));
             String customerName = str(row.get("customerName"));
 
@@ -339,7 +348,6 @@
                 m.put("totalLayer", 0);
                 m.put("layer", 0);
                 m.put("glassTotal", 1);
-                m.put("orderNumber", orderNumber);
                 m.put("productName", productName);
                 m.put("customerName", customerName);
                 flowCardMap.put(flowCardId, m);

--
Gitblit v1.8.0