浏览代码

fix:空间 create 关系维护

lvxianyun 3 年之前
父节点
当前提交
45044f44c8

+ 6 - 2
src/main/java/com/persagy/proxy/adm/controller/AdmSpaceController.java

@@ -17,6 +17,7 @@ import com.persagy.proxy.adm.service.IAdmFloorService;
 import com.persagy.proxy.adm.service.IAdmRelationService;
 import com.persagy.proxy.adm.service.IAdmSpaceService;
 import com.persagy.proxy.adm.utils.AdmContextUtil;
+import com.persagy.proxy.adm.utils.ObjectNameUtil;
 import com.persagy.proxy.common.entity.RelationDTO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -74,9 +75,12 @@ public class AdmSpaceController {
                 msg = "classCode不可以为空!";
                 break;
             }
+            if (StrUtil.isEmpty(admSpace.getName())) {
+                admSpace.setName(ObjectNameUtil.objectName("空间-"));
+            }
         }
-        if(StrUtil.isNotEmpty(msg)){
-            vos = service.doInsertExt( AdmContextUtil.toDmpContext(), AdmSpace.class, vos);
+        if(StrUtil.isEmpty(msg)){
+            vos = service.doInsertExt(AdmContextUtil.toDmpContext(), AdmSpace.class, vos);
             return AdmResponse.success(vos);
         }else{
             return AdmResponse.failure(msg);

+ 1 - 0
src/main/java/com/persagy/proxy/adm/model/AdmSpace.java

@@ -128,6 +128,7 @@ public class AdmSpace extends AdmSBaseEntity<AdmSpace>{
     /** 资产列表 */
     @CascadeColumn
     private List<AdmProperty> propertyList;
+
     /** 空间轮廓线 未使用 */
     //private T spaceOutline;
     /** 对象类型 */

+ 0 - 32
src/main/java/com/persagy/proxy/adm/service/impl/AdmSpaceServiceImpl.java

@@ -402,13 +402,11 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
         if(CollUtil.isNotEmpty(vosR)) {
             List<RelationDTO> relationDTOS = new ArrayList<>(vosR.size());
             vosR.forEach(admSpace -> {
-                JSONObject requestData = new JSONObject();
                 if (StrUtil.isNotEmpty(admSpace.getBuildingId())) {
                     relationDTOS.add(new RelationDTO(null, "ArchSubset", "Bd2Sp", null, admSpace.getBuildingId(), admSpace.getId()));
                 }
                 if (StrUtil.isNotEmpty(admSpace.getFloorId())) {
                     relationDTOS.add(new RelationDTO(null, "ArchSubset", "Fl2Sp", null, admSpace.getFloorId(), admSpace.getId()));
-
                 }
             });
             if (CollUtil.isNotEmpty(relationDTOS)) {
@@ -417,36 +415,6 @@ public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> im
         }
     }
 
-
-    /**
-     * TODO 处理关系标记
-     */
-    private void processRelationType(InstanceUrlParam context, List<AdmSpace> vosR){
-        String[] relationTypes = {"sp2sp_SpaceNeighborhood_5", "sp2sp_TrafficNetwork_1", "sp2sp_ConvectionNetwork_1", "sp2sp_RadiationNetwork_1"};
-        List<String> listtype = Arrays.asList(relationTypes);
-        JSONArray jsonArray = new JSONArray();
-        listtype.forEach(type -> {
-            JSONObject relationProjectCal = new JSONObject();
-            //relationProjectCal.put("");
-
-        });
-        String relationType = "eq2sp_in";
-        /**
-         * val relationType = relationTypeProjectservice.select(SFilter.eq("projectId", projectId!!), SFilter.eq("relationType", "eq2sp_in"),SFilter.eq("zoneType", zoneSpace.classCode!!)).entity()
-         *             if (relationType!=null){
-         *                     relationType.computationalState = 2
-         *                     relationTypeProjectservice.update(relationType)
-         *             }
-         */
-    }
-
-    /**
-     * 清楚和空间关联的数据
-     */
-    private void deleteRelation(InstanceUrlParam context, String relCode, String ObjType){
-    }
-
-
     /**
      * 转换为目标实体,并增加属性
      */