From 39f62fa03a2463652e971edfabab56313db6af10 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期六, 28 六月 2025 10:20:34 +0800
Subject: [PATCH] 涉密->工控

---
 lxzn-module-msi/src/main/java/org/jeecg/modules/msi/webapi/controller/MsiWebapiJsonController.java |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/lxzn-module-msi/src/main/java/org/jeecg/modules/msi/webapi/controller/MsiWebapiJsonController.java b/lxzn-module-msi/src/main/java/org/jeecg/modules/msi/webapi/controller/MsiWebapiJsonController.java
index 0a5734b..b3d2a0d 100644
--- a/lxzn-module-msi/src/main/java/org/jeecg/modules/msi/webapi/controller/MsiWebapiJsonController.java
+++ b/lxzn-module-msi/src/main/java/org/jeecg/modules/msi/webapi/controller/MsiWebapiJsonController.java
@@ -1,5 +1,6 @@
 package org.jeecg.modules.msi.webapi.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.fasterxml.jackson.core.type.TypeReference;
 
 import io.swagger.annotations.Api;
@@ -15,6 +16,7 @@
 import org.jeecg.modules.msi.webapi.service.IMsiWebapiJsonService;
 import org.jeecg.modules.msi.webapi.vo.MachineEquipentInfo;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -27,32 +29,27 @@
 @RequestMapping("/msi/webapi")
 public class MsiWebapiJsonController extends JeecgController<MsiWebapiJsonEntity, IMsiWebapiJsonService> {
 
+
+
     @AutoLog(value = "鑷姩鍖栫嚎鏁版嵁鎺ユ敹")
     @ApiOperation(value = "鑷姩鍖栫嚎鏁版嵁鎺ユ敹 ", notes = "鑷姩鍖栫嚎鏁版嵁鎺ユ敹")
-    @PostMapping(value = "/receiveAutomation")
-    public Result<?> receiveSaveMsiWebApiJson(String data) {
+    @RequestMapping(value = "/receiveAutomation")
+    public Result<?> receiveSaveMsiWebApiJson(@RequestBody List<MachineEquipentInfo> data) {
         MsiWebapiJsonEntity entity = new MsiWebapiJsonEntity();
-        if (StringUtils.isBlank(data)) {
+        if (StringUtils.isBlank(data.toString())) {
             return Result.error("鏁版嵁涓虹┖","");
         }
         entity.setModuleType("MDC");
-        entity.setWebapiInfo(data);
+        entity.setWebapiInfo(data.toString());
         //鍚庣画杩涜鍏朵粬涓氬姟鍏宠仈
-        JsonMapper mapper = new JsonMapper();
+//        JsonMapper mapper = new JsonMapper();
+        service.save(entity);
         try {
-            List<MachineEquipentInfo> machineInfoList = mapper.fromJson(data, new TypeReference<List<MachineEquipentInfo>>(){});
-            for (MachineEquipentInfo machineInfo : machineInfoList) {
-
-                System.out.println(machineInfo);
-                // Add additional processing logic here for each item
-            }
-        } catch (IOException e) {
+            service.saveTableAutomationOne(data);
+        } catch (Exception e) {
             log.error("JSON parsing error: {}", e.getMessage());
             return Result.error("鏁版嵁寮傚父", e.getMessage());
-
         }
-
-        service.save(entity);
         return Result.OK("鎺ユ敹鎴愬姛");
     }
 

--
Gitblit v1.9.3