浏览代码

fix : 空间更新建筑楼层关系,前端使用flowBuild进行更新

lvxianyun 3 年之前
父节点
当前提交
f925333c71
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      src/main/java/com/persagy/proxy/object/controller/AdmSpaceController.java

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

@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.ws.rs.QueryParam;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -64,7 +65,7 @@ public class AdmSpaceController {
     public AdmResponse count(@RequestBody AdmQueryCriteria request) throws Exception {
         request.setName("space");
         request.setOnlyCount(true);
-        return service.doQuery(AdmContextUtil.toDmpContext(), request, AdmSpace.class);
+        return service.doQuery( AdmContextUtil.toDmpContext(), request, AdmSpace.class);
     }
     /**
      * 创建
@@ -149,7 +150,9 @@ public class AdmSpaceController {
                     if(!flowBuild.contains("-")){
                         if(flowBuild.startsWith("Bd")){
                             admSpace.setBuildingId(flowBuild);
-                            admSpace.setFloorId(null);
+                            Map<String, Object> infos = new HashMap<String,Object>(16);
+                            infos.put("$remove","['floorId']");
+                            admSpace.setInfos(infos);
                         }
                     }else {
                         String[] str = flowBuild.split("-");
@@ -162,8 +165,9 @@ public class AdmSpaceController {
                         }
                     }
                 }else{
-                    admSpace.setBuildingId(null);
-                    admSpace.setFloorId(null);
+                    Map<String, Object> infos = new HashMap<String,Object>(16);
+                    infos.put("$remove","['floorId','buildingId']");
+                    admSpace.setInfos(infos);
                 }
             });
             vos.stream().forEach(space -> {