Browse Source

fix bug:设计照明功率、设计图纸编码、设计供热功率、空间是否受影响、楼层id、RFID标识 无法修改

lijie 3 years ago
parent
commit
b1eddf7e36

+ 4 - 1
src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.basic.utils.JsonNodeUtils;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.proxy.adm.constant.AdmDictConstant;
 import com.persagy.proxy.adm.request.*;
 import com.persagy.proxy.adm.service.IAdmRelationService;
@@ -128,6 +129,7 @@ public class AdmSpaceController {
             return AdmResponse.success(new ArrayList<>());
         }
         Map<String, Field> fieldMap = JsonNodeUtils.getFieldMap(AdmSpace.class);
+        Map<String, Field> objFieldMap = JsonNodeUtils.getFieldMap(ObjectDigital.class);
         Set<String> fields = fieldMap.keySet();
         for (AdmSpace space : vos) {
             Map<String, Object> infos = space.getInfos();
@@ -137,7 +139,8 @@ public class AdmSpaceController {
             Set<String> mapKeys = infos.keySet();
             for (String mapKey : mapKeys) {
                 if ((AdmDictConstant.TABLE_INFOS.contains(mapKey)
-                        && !AdmDictConstant.HEIGHT.equals(mapKey))
+                        && !AdmDictConstant.HEIGHT.equals(mapKey)
+                        && objFieldMap.containsKey(mapKey))
                         || AdmDictConstant.PIC.equals(mapKey)){
                     // 这些信息就算在infos也不更新,
                     // 和com.persagy.proxy.dictionary.service.impl.AbstractAdmDictBaseServiceImpl.handleObjectInfoPath

+ 4 - 0
src/main/java/com/persagy/proxy/object/model/AdmSpace.java

@@ -48,6 +48,10 @@ public class AdmSpace extends AdmBaseEntity<AdmSpace> {
     private Integer state;
     /** 空间常驻人数 */
     private Double permanentPeopleNum;
+    /** 设计图纸中编码 */
+    private String cADID;
+    /** RFID标识 */
+    private String rFID;
 
     /** 井深 */
     private Double depth;

+ 13 - 2
src/main/java/com/persagy/proxy/object/service/impl/AdmSpaceServiceImpl.java

@@ -22,8 +22,10 @@ import com.persagy.dmp.common.helper.SpringHelper;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.define.entity.ObjectTypeDefine;
 import com.persagy.dmp.digital.client.DigitalObjectFacade;
+import com.persagy.dmp.digital.entity.ObjectDigital;
 import com.persagy.dmp.digital.entity.ObjectRelation;
 import com.persagy.dmp.simple.client.DigitalObjectSimpleFacade;
+import com.persagy.proxy.adm.annotations.CascadeColumn;
 import com.persagy.proxy.adm.constant.*;
 import com.persagy.proxy.adm.request.AdmDCSQueryRequest;
 import com.persagy.proxy.adm.request.AdmQueryCriteria;
@@ -215,13 +217,22 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
             admSystemList.addAll(vo.getGeneralSystem());
         }
         // 3.对部分infos值在infos中也放置一份
+        Map<String, Field> objFieldMap = JsonNodeUtils.getFieldMap(ObjectDigital.class);
+        Map<String, Field> fieldMap = JsonNodeUtils.getFieldMap(AdmSpace.class);
+        Set<String> fields = fieldMap.keySet();
         for (AdmSpace space : vos) {
             Map<String, Object> infos = space.getInfos();
             if (MapUtil.isEmpty(infos)){
                 infos = new HashMap<>();
             }
-            // 重新放置一下height的值
-            infos.put(AdmDictConstant.HEIGHT,ReflectUtil.getFieldValue(space,AdmDictConstant.HEIGHT));
+            for (String fieldKey : fields) {
+                if (fieldMap.get(fieldKey).isAnnotationPresent(CascadeColumn.class)
+                        || objFieldMap.containsKey(fieldKey)){
+                    continue;
+                }
+                // 重新放置一下height的值
+                infos.put(fieldKey,ReflectUtil.getFieldValue(space,fieldKey));
+            }
             space.setInfos(infos);
         }
         // 对象扩展属性赋值