Browse Source

优化:优化pom的jar坐标

lijie 2 years ago
parent
commit
06da88c7fb

+ 2 - 2
adm-business/adm-middleware/src/main/java/com/persagy/proxy/dictionary/model/AdmRelationType.java

@@ -1,8 +1,8 @@
 package com.persagy.proxy.dictionary.model;
 
+import com.alibaba.fastjson.JSONObject;
 import lombok.Data;
 
-import javax.json.Json;
 import java.util.Date;
 
 /**
@@ -63,7 +63,7 @@ public class AdmRelationType {
     /** 从对象 */
     private String fromObject;
     /** 机电系统类型 */
-    private Json mepSystemType;
+    private JSONObject mepSystemType;
     /** 图类型 */
     private String graphicType;
     /** 边类型 */

+ 9 - 4
adm-business/adm-middleware/src/main/java/com/persagy/proxy/object/controller/AdmSystemController.java

@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.alibaba.excel.EasyExcel;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -39,7 +41,6 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.json.JsonObject;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotNull;
 import javax.ws.rs.QueryParam;
@@ -191,9 +192,13 @@ public class AdmSystemController {
      * @throws Exception
      */
     @PostMapping("/link-equip")
-    public AdmCreateResponse createRelateEquip(@RequestBody JsonObject createRequest, @QueryParam("projectId") String projectId) throws Exception {
-        String sysId = createRequest.get("sysId").toString();
-        List<String> equipIdList = (List<String>)createRequest.get("equipIdList");
+    public AdmCreateResponse createRelateEquip(@RequestBody JSONObject createRequest, @QueryParam("projectId") String projectId) throws Exception {
+        String sysId = createRequest.getString("sysId");
+        List<String> equipIdList = new ArrayList<>();
+        if (StrUtil.isNotBlank(createRequest.getString("equipIdList"))
+                && createRequest.getString("equipIdList").startsWith(StrUtil.BRACKET_START)){
+            equipIdList = JSONArray.parseArray(createRequest.getString("equipIdList"),String.class);
+        }
         List<ObjectNode> relations = new ArrayList<>(equipIdList.size());
         equipIdList.stream().forEach(euipId -> {
             ObjectNode objectNode = JsonNodeFactory.instance.objectNode();

+ 0 - 5
adm-business/adm-middleware/src/main/java/com/persagy/proxy/object/model/AdmEquipment.java

@@ -11,7 +11,6 @@ import com.persagy.proxy.dictionary.model.AdmObjectType;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import javax.persistence.Column;
 import java.util.List;
 import java.util.Map;
 
@@ -177,19 +176,15 @@ public class AdmEquipment extends AdmBaseEntity<AdmEquipment> {
 
     /******************************** 报表使用 **************************************/
     /** 资产id */
-    @Column(name = "link_id")
     private String linkId;
 
     /** 资产名称 */
-    @Column(name = "link_name")
     private String linkEquipName;
 
     /** 资产本地名称 */
-    @Column(name = "link_local_name")
     private String linkEquipLocalName;
 
     /** 资产分类 */
-    @Column(name = "link_family")
     private String linkFamily;
 
     /** 系统对象 */