فهرست منبع

cad图纸下载移到业务数据中下载

yanguofeng 2 سال پیش
والد
کامیت
fb55f8c7e2
32فایلهای تغییر یافته به همراه75 افزوده شده و 1245 حذف شده
  1. 0 60
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/client/OldAdmClient.java
  2. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AdmFileController.java
  3. 6 86
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AppController.java
  4. 0 17
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ManageController.java
  5. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmCadMapper.java
  6. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmDefineProblemInfoMapper.java
  7. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmProblemMapper.java
  8. 7 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/BuildingData.java
  9. 32 0
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/ConfigData.java
  10. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmCad.java
  11. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmDefineProblemInfo.java
  12. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmProblem.java
  13. 0 26
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OBase.java
  14. 0 19
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OBuilding.java
  15. 0 98
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OEquip.java
  16. 0 51
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OFloor.java
  17. 0 17
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OProject.java
  18. 0 79
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OSpace.java
  19. 0 20
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OldAdmResult.java
  20. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmCadService.java
  21. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmDefineProblemInfoService.java
  22. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmProblemService.java
  23. 0 29
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IQueryFromOldAdm.java
  24. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ISyncApp.java
  25. 0 16
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ISyncOldAdm.java
  26. 0 16
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ServiceUtil.java
  27. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmCadServiceImpl.java
  28. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmDefineProblemInfoServiceImpl.java
  29. 1 1
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmProblemServiceImpl.java
  30. 0 111
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/QueryFromOldAdmImpl.java
  31. 16 17
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncAppImpl.java
  32. 0 569
      adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncOldAdmImpl.java

+ 0 - 60
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/client/OldAdmClient.java

@@ -1,60 +0,0 @@
-package com.persagy.adm.server.custom.client;
-
-import com.persagy.adm.server.custom.entity.oldadm.*;
-import com.persagy.dmp.basic.config.DigitalFeignConfig;
-import feign.Response;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-import java.util.Map;
-
-@FeignClient(name = "amd-old", configuration = DigitalFeignConfig.class,
-		url = "${persagy.adm.oldPlatformUrl}")
-public interface OldAdmClient {
-
-	@PostMapping("/persagy-sso-server/users/login")
-	Map<String, Object> login(
-			@RequestBody Map<String, Object> params);
-
-	@PostMapping("/datacenter/object/project/query")
-	OldAdmResult<List<OProject>> queryProject(
-			@RequestHeader("groupCode") String groupCode,
-			@RequestHeader("projectId") String projectId,
-			@RequestHeader("appId") String appId,
-			@RequestHeader("userId") String userId,
-			@RequestHeader("token") String token,
-			@RequestBody Map<String, Object> params);
-
-	@PostMapping("/datacenter/object/building/query")
-	OldAdmResult<List<OBuilding>> queryBuilding(
-			@RequestHeader("groupCode") String groupCode,
-			@RequestHeader("projectId") String projectId,
-			@RequestHeader("appId") String appId,
-			@RequestHeader("userId") String userId,
-			@RequestHeader("token") String token,
-			@RequestBody Map<String, Object> params);
-
-	@PostMapping("/datacenter/object/zone/query")
-	OldAdmResult<List<OSpace>> querySpace(
-			@RequestHeader("groupCode") String groupCode,
-			@RequestHeader("projectId") String projectId,
-			@RequestHeader("appId") String appId,
-			@RequestHeader("userId") String userId,
-			@RequestHeader("token") String token,
-			@RequestBody Map<String, Object> params);
-
-	@PostMapping("/datacenter/object/equip/query")
-	OldAdmResult<List<OEquip>> queryEquip(
-			@RequestHeader("groupCode") String groupCode,
-			@RequestHeader("projectId") String projectId,
-			@RequestHeader("appId") String appId,
-			@RequestHeader("userId") String userId,
-			@RequestHeader("token") String token,
-			@RequestBody Map<String, Object> params);
-
-	@GetMapping(value = "/image-service/common/file_get",consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
-	Response getFloorMap(@RequestParam String key, @RequestParam String systemId);
-
-}

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AdmFileController.java

@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.dao.AdmFileMapper;
-import com.persagy.adm.server.custom.entity.AdmCad;
+import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.persagy.adm.server.custom.entity.CadFileQueryParam;
 import com.persagy.adm.server.custom.service.IAdmCadService;
 import org.apache.commons.lang.StringUtils;

+ 6 - 86
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/AppController.java

@@ -2,10 +2,10 @@ package com.persagy.adm.server.custom.controller;
 
 import cn.hutool.core.util.StrUtil;
 import com.persagy.adm.server.custom.client.ImageServiceClient;
-import com.persagy.adm.server.custom.client.OldAdmClient;
 import com.persagy.adm.server.custom.common.AdmRequest;
 import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.datatx.DataTxHandler;
+import com.persagy.adm.server.custom.entity.ConfigData;
 import com.persagy.adm.server.custom.entity.Dict;
 import com.persagy.adm.server.custom.entity.DownLoadData;
 import com.persagy.adm.server.custom.entity.UploadRtn;
@@ -25,17 +25,14 @@ import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
+/**
+ * APP离线数据服务
+ */
 @RestController
 @RequestMapping("/adm")
 public class AppController {
 
 	@Autowired
-	private ImageServiceClient imageServiceClient;
-
-	@Autowired
-	private OldAdmClient admClient;
-
-	@Autowired
 	@Qualifier(ServiceUtil.SYNC_APP_IMPL)
 	private ISyncApp syncApp;
 
@@ -55,45 +52,12 @@ public class AppController {
 	}
 
 	@RequestMapping("/config")
-	public AdmResult<Map<String, Object>> config(@RequestBody AdmRequest req){
+	public AdmResult<ConfigData> config(@RequestBody AdmRequest req){
 		return AdmResult.success(syncApp.downloadConfig(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
 	@RequestMapping("/frame")
 	public AdmResult<Map<String, Object>> frame(@RequestBody AdmRequest req){
-//		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-//
-//		List<ObjectNode> prjList = ServiceUtil.call(() -> objClient.query(req.getGroupCode(), req.getProjectId(), AdmConst.APP_ID, req.getUserId(), getQueryCriteria("project", objectMapper)));
-//
-//		//建筑和楼层,暂时从dbtp获取
-//		List<ObjectNode> bdList = ServiceUtil.call(() -> objClient.query(req.getGroupCode(), req.getProjectId(), AdmConst.APP_ID, req.getUserId(), getQueryCriteria("building", objectMapper)));
-//
-//		QueryCriteria flCriteria = getQueryCriteria("floor", objectMapper);
-//		flCriteria.getCriteria().putObject("relationTo").put("graphCode", "ArchSubset").put("relCode", "Bd2Fl");
-//		List<ObjectNode> flList = ServiceUtil.call(() -> objClient.query(req.getGroupCode(), req.getProjectId(), AdmConst.APP_ID, req.getUserId(), flCriteria));
-//
-//		QueryCriteria relCriteria = getQueryCriteria(null, objectMapper);
-//		relCriteria.getCriteria().put("graphCode", "ArchSubset").put("relCode", "Bd2Fl");
-//		List<ObjectRelation> relList = ServiceUtil.call(() -> relationClient.query(req.getGroupCode(), req.getProjectId(), AdmConst.APP_ID, req.getUserId(), relCriteria));
-//
-//		//为楼层数据设置buildingId
-//		for(ObjectNode n : flList){
-//			String flId = n.get("id").asText();
-//			for(ObjectRelation r : relList){
-//				if(r.getObjTo().equals(flId)){
-//					n.put("buildingId", r.getObjFrom());
-//					relList.remove(r);
-//					break;
-//				}
-//			}
-//		}
-//
-//		HashMap<String, Object> data = new HashMap<>();
-//		data.put("projects", prjList);
-//		data.put("buildings", bdList);
-//		data.put("floors", flList);
-//		return AdmResult.success(data);
-
 		return AdmResult.success(syncApp.downloadFrameData(req.getGroupCode(), req.getProjectId(), req.getUserId()));
 	}
 
@@ -101,50 +65,12 @@ public class AppController {
 	public AdmResult<DownLoadData> download(@RequestBody AdmRequest req){
 		DownLoadData data;
 		if(StrUtil.isNotBlank(req.getBuildingId())) {
-			if(ServiceUtil.SYNC_APP_IMPL.equals("syncAppImpl")) //临时兼容
-				data = syncApp.downloadBuildingData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBuildingId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
-			else
-				data = syncApp.downloadBuildingData(req.getProjectId(), req.getBuildingId(), req.getUploadFlag(), req.getLastDownloadTime());
+			data = syncApp.downloadBuildingData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBuildingId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
 		} else
 			data = syncApp.downloadProjectData(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getClientId(), req.getBdtpDownloadTs(), req.getAdmDownloadTs());
 		return AdmResult.success(data);
 	}
 
-//	@RequestMapping("/downloadFl")
-//	public AdmResult<Map<String, Object>> downloadFl(@RequestBody AdmRequest req){
-//		return AdmResult.success(syncApp.downloadFloorData(req.getProjectId(), req.getFloorId(), req.getUploadFlag(), req.getLastDownloadTime()));
-//	}
-
-	@RequestMapping("/downloadMap")
-	public void downloadMap(HttpServletRequest request, HttpServletResponse response, @RequestParam String key){
-		InputStream inputStream = null;
-		try {
-			Response serviceResponse;
-			if(ServiceUtil.SYNC_APP_IMPL.equals("syncAppImpl")) //临时兼容
-				serviceResponse = imageServiceClient.fileGet(key, "revit");
-			else
-				serviceResponse = admClient.getFloorMap(key, "revit");
-
-			Response.Body body = serviceResponse.body();
-
-			inputStream = body.asInputStream();
-			BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
-			Object o = serviceResponse.headers().get("Content-Disposition");
-			String contentDisposition = o != null ? o.toString().replace("[","").replace("]","") : "attachment;filename=map.jsonz";
-			response.setHeader("Content-Disposition", contentDisposition);
-			BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(response.getOutputStream());
-			int length = 0;
-			byte[] temp = new byte[1024 * 10];
-			while ((length = bufferedInputStream.read(temp)) != -1) {
-				bufferedOutputStream.write(temp, 0, length);
-			}
-			bufferedOutputStream.flush();
-			bufferedOutputStream.close();
-			bufferedInputStream.close();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
 
 	@RequestMapping("/upload")
 	public AdmResult<UploadRtn> upload(HttpServletRequest request){
@@ -152,10 +78,4 @@ public class AppController {
 		return AdmResult.success(syncApp.uploadData(admRequest.getUploadData(), admRequest.getGroupCode(), admRequest.getProjectId(), admRequest.getUserId(), admRequest.getClientId()));
 	}
 
-	@PostMapping("/uploadFile")
-	public AdmResult uploadFile(){
-		//TODO
-		return null;
-	}
-
 }

+ 0 - 17
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/controller/ManageController.java

@@ -2,7 +2,6 @@ package com.persagy.adm.server.custom.controller;
 
 import com.persagy.adm.server.custom.common.AdmRequest;
 import com.persagy.adm.server.custom.common.AdmResult;
-import com.persagy.adm.server.custom.service.ISyncOldAdm;
 import com.persagy.adm.server.custom.service.ISyncSpace;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.CrossOrigin;
@@ -16,24 +15,8 @@ import java.util.Map;
 @RestController
 @RequestMapping("/manage")
 public class ManageController {
-
-	@Autowired
-	private ISyncOldAdm syncOldAdm;
-
 	@Autowired
 	private ISyncSpace syncSpace;
-
-	@RequestMapping("/syncOldAdm")
-	public AdmResult<Object> syncOldAdm(@RequestBody AdmRequest req){
-		String groupCode = req.getGroupCode();
-		String projectId = req.getProjectId();
-
-		Map<String, Object> syncResult = syncOldAdm.syncData(groupCode, projectId);
-		syncOldAdm.handleJobSpace(projectId);
-		syncOldAdm.uploadFloorMap(groupCode, projectId);
-		return AdmResult.success(syncResult);
-	}
-
 	@RequestMapping("/syncSpace")
 	public AdmResult<Object> syncSpace(@RequestBody AdmRequest req){
 		Map<String, Object> syncResult = syncSpace.sync(req.getGroupCode(), req.getProjectId(), req.getUserId(), req.getFloorId(), "GeneralZone");

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmCadMapper.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.dao;
 
-import com.persagy.adm.server.custom.entity.AdmCad;
+import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmDefineProblemInfoMapper.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.dao;
 
-import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
+import com.persagy.adm.server.custom.entity.db.AdmDefineProblemInfo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/dao/AdmProblemMapper.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.dao;
 
-import com.persagy.adm.server.custom.entity.AdmProblem;
+import com.persagy.adm.server.custom.entity.db.AdmProblem;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**

+ 7 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/BuildingData.java

@@ -31,6 +31,13 @@ public class BuildingData extends DownLoadData {
 	// 核查问题数据
 	private List<AdmProblem> problems;
 
+	/**
+	 * ADM图纸
+	 */
+	private List<AdmCad> admCads;
+
+
+
 	/** 待废弃 */
 	private String timestamp;
 

+ 32 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/ConfigData.java

@@ -0,0 +1,32 @@
+package com.persagy.adm.server.custom.entity;
+
+import com.persagy.adm.server.custom.entity.db.*;
+import lombok.Builder;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 配置数据
+ */
+@Data
+@Builder
+public class ConfigData {
+    //配置数据查询
+    private List<AdmM2dEquip> m2dTypes;
+    private List<AdmInfosConfig> infosConfig;
+    private List<AdmRelsConfig> relConfig;
+    private List<AdmPipeConfig> pipeConfig;
+    private List<AdmConfig> config;
+    private List<AdmComponent> component;
+    private List<AdmContainerConfig> containerConfig;
+    /**
+     * 问题类型
+     */
+    private List<AdmDefineProblemType> admDefineProblemTypes;
+    /**
+     * 问题类型对应信息点定义
+     */
+    private List<AdmDefineProblemInfo> admDefineProblemInfos;
+
+}

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmCad.java

@@ -1,4 +1,4 @@
-package com.persagy.adm.server.custom.entity;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmDefineProblemInfo.java

@@ -1,4 +1,4 @@
-package com.persagy.adm.server.custom.entity;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/AdmProblem.java

@@ -1,4 +1,4 @@
-package com.persagy.adm.server.custom.entity;
+package com.persagy.adm.server.custom.entity.db;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import java.io.Serializable;

+ 0 - 26
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OBase.java

@@ -1,26 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import lombok.Data;
-
-import java.util.Map;
-
-@Data
-abstract public class OBase {
-
-	private String id;
-
-	private String name;
-
-	private String localId;
-
-	private String localName;
-
-	private String objectType;
-
-	private Map<String, Object> infos;
-
-	private String createTime;
-
-	private String lastUpdate;
-
-}

+ 0 - 19
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OBuilding.java

@@ -1,19 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class OBuilding extends OBase {
-
-	/** 项目ID */
-	private String projectId;
-	/** 平台默认二维码 */
-	private String defaultQRCode;
-	/** 建筑二维码图片 */
-	private String buildQRCode;
-
-	private List<OFloor> floor;
-
-}

+ 0 - 98
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OEquip.java

@@ -1,98 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import com.fasterxml.jackson.annotation.JsonAlias;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.Data;
-
-import java.util.List;
-import java.util.Map;
-
-@Data
-public class OEquip extends OBase {
-
-	/** 二维码内容 */
-	private String defaultQRCode;
-	/** 设计图纸中编码 */
-	private String cadId;
-	/** RFID标识 */
-	private String rfId;
-
-
-	/** BIM模型中编码 */
-	private String bimId;
-	/** BIM构建编码 */
-	private String bimTypeId;
-	/** BIM模型中坐标 */
-	private String bimLocation;
-	/** 坐标对象数据 */
-	@JsonProperty("location")
-	@JsonAlias("locationJson")
-	private Map<String, Double> location;
-	/** 现场发现人员 */
-	private String findPeople;
-
-	/** 项目ID */
-	private String projectId;
-	/** 设备类型code */
-	private String classCode;
-	/** 设备所在建筑ID */
-	private String buildingId;
-	/** 设备所在楼层id */
-	private String floorId;
-	/** 设备关联的资产id */
-	private String propertyId;
-
-	/** 参见 EquipmentProSy **/
-	/** 品牌型号id */
-	private String dpManufacturerId;
-
-	/** 供应商信息id */
-	private String dpSupplierId;
-
-	/** 维修商信息id */
-	private String dpMaintainerId;
-
-	/** 保险公司信息id */
-	private String dpInsurerId;
-
-	/** 设备型号id */
-	private String dpSpecificationId;
-
-	/** 品牌id */
-	private String dpBrandId;
-
-	/** Revit族 */
-	private String bimFamilyName;
-	/** Revit族类型 */
-	private String bimFamilySymbol;
-	/** 设备序号 */
-	private Double equipSerial;
-
-	/** 部件关联设备的id */
-	private String parentId;
-	/** 系统id集合 */
-	private List<String> systemList;
-	/** 项目自定义类型 */
-	private String customCategory;
-	/** 任务状态 */
-	private Integer taskState;
-	/** 模型id */
-	private String modelId;
-	/** 贴码状态 */
-	private Integer codeType;
-	/** 备注 */
-	private String note;
-
-	/** 客户端id */
-	private String appId;
-	/** 方案id */
-	private String schemeId;
-
-	/** 系统编码 */
-	private String systemCode;
-	/** 系统名称 */
-	private String systemName;
-	/** 二维码图片 */
-	private String qrcodePic;
-
-}

+ 0 - 51
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OFloor.java

@@ -1,51 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import lombok.Data;
-
-import java.util.List;
-import java.util.Map;
-
-@Data
-public class OFloor extends OBase {
-
-	/** 平台默认二维码 */
-	private String defaultQRCode;
-	/** 项目ID */
-	private String projectId;
-	/** 建筑ID */
-	private String buildingId;
-	/** 坐标 */
-	private String bimLocation;
-	/** BIM模型中编码 */
-	private String bimId;
-	/** BIMID前缀 */
-	private String bimIdPre;
-	/** 楼层顺序号 */
-	private Integer floorSequenceID;
-	/** 楼层常驻人数 */
-	private Integer permanentPeopleNum;
-	/** 楼层编码 */
-	private String floorIdentity;
-
-	/** 模型文件id */
-	private String modelId;
-
-	/** 楼层选定区域轮廓线 */
-	private List<ObjectNode> outline;
-
-	/** 数量 */
-	private String count;
-
-	/** 自定义信息点 */
-	private Map<String, Object> properties;
-
-	/** 二维码图片 */
-	private String qrcodePic;
-
-	public String getFloorMap(){
-		Map<String, Object> infos = getInfos();
-		return infos != null ? (String) infos.get("floorMap") : null;
-	}
-
-}

+ 0 - 17
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OProject.java

@@ -1,17 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import lombok.Data;
-
-@Data
-public class OProject extends OBase {
-
-	/** 项目介绍 */
-	private String introduction;
-	/** 集团编码 */
-	private String groupCode;
-	/** 商业层数 */
-	private String businessFloorNum;
-	/** 办公层数 */
-	private String officeFloorNum;
-
-}

+ 0 - 79
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OSpace.java

@@ -1,79 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import cn.hutool.core.map.CaseInsensitiveMap;
-import lombok.Data;
-
-import java.util.ArrayList;
-
-@Data
-public class OSpace extends OBase {
-
-	/** 项目ID */
-	private String projectId;
-	/** 建筑ID */
-	private String buildingId;
-	/** 楼层ID */
-	private String floorId;
-	/** 平台二维码 */
-	private String defaultQRCode;
-	/** BIM模型中编码 */
-	private String bimId;
-
-	/** 楼层选定区域轮廓线 */
-	private ArrayList<ArrayList<ArrayList<CaseInsensitiveMap>>> outline;
-	/** 轮廓线2 未使用*/
-	private ArrayList<ArrayList<ArrayList<CaseInsensitiveMap>>> outline2;
-//	/** 图片 */
-//	private ArrayList<AdmTaskPic> pic;
-	/** 空间是否受影响 */
-	private String state;
-	/** 空间常驻人数 */
-	private Integer permanentPeopleNum;
-
-	/** 井深 */
-	private Float depth;
-	/** 面宽 */
-	private Float width;
-	/** 建筑面积 */
-	private Float buildArea;
-	/** 使用面积 */
-	private Float netArea;
-	/** 高 */
-	private Float height;
-	/** 备注文字 */
-	private String intro;
-	/** 设计供冷功率 */
-	private Float ratedCoolingp;
-	/** 设计供热功率 */
-	private Float ratedHeatingp;
-	/** 空调形式 */
-	private String acType;
-	/** 空间朝向 */
-	private String zoneOrientation;
-	/** 空间功能区类型 */
-	private String roomFuncType;
-
-	/** 空间序号 */
-	private Float roomSerial;
-	/** 项目空间功能区类型 */
-	private String projRoomFuncType;
-	/** 设计照明功率 */
-	private Float ratedLightp;
-	/** 内外区分类 */
-	private String zoneType;
-	/** 租赁业态类型 */
-	private Integer tenantType;
-	/** 所属租户 */
-	private String tenant;
-	/** 配电容量 */
-	private Float elecCap;
-	/** 污染等级 */
-	private String pollutionDegree;
-
-	/** 对象类型code */
-	private String classCode;
-
-	/** 二维码图片 */
-	private String qrcodePic;
-
-}

+ 0 - 20
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/entity/oldadm/OldAdmResult.java

@@ -1,20 +0,0 @@
-package com.persagy.adm.server.custom.entity.oldadm;
-
-import lombok.Data;
-
-@Data
-public class OldAdmResult<T> {
-
-	private String result;
-
-	private String Message;
-
-	private T content;
-
-	private int pageNumber;
-
-	private int pageSize;
-
-	private int total;
-
-}

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmCadService.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service;
 
-import com.persagy.adm.server.custom.entity.AdmCad;
+import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmDefineProblemInfoService.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service;
 
-import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
+import com.persagy.adm.server.custom.entity.db.AdmDefineProblemInfo;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IAdmProblemService.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service;
 
-import com.persagy.adm.server.custom.entity.AdmProblem;
+import com.persagy.adm.server.custom.entity.db.AdmProblem;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**

+ 0 - 29
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/IQueryFromOldAdm.java

@@ -1,29 +0,0 @@
-package com.persagy.adm.server.custom.service;
-
-import com.persagy.adm.server.custom.entity.oldadm.OBuilding;
-import com.persagy.adm.server.custom.entity.oldadm.OEquip;
-import com.persagy.adm.server.custom.entity.oldadm.OProject;
-import com.persagy.adm.server.custom.entity.oldadm.OSpace;
-
-import java.util.List;
-
-/**
- * 从老adm查询数据
- */
-public interface IQueryFromOldAdm {
-
-	/**
-	 * 登录系统
-	 * @return token
-	 */
-	String login();
-
-	List<OProject> queryProject(String token, String groupCode, String projectId);
-
-	List<OBuilding> queryBdAnFl(String token, String groupCode, String projectId);
-
-	List<OSpace> querySpace(String token, String groupCode, String projectId);
-
-	List<OEquip> queryEquip(String token, String groupCode, String projectId);
-
-}

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ISyncApp.java

@@ -15,7 +15,7 @@ public interface ISyncApp {
 
 	Dict downloadDict(String groupCode, String projectId, String userId);
 
-	Map<String, Object> downloadConfig(String groupCode, String projectId, String userId);
+	ConfigData downloadConfig(String groupCode, String projectId, String userId);
 
 	Map<String, Object> downloadFrameData(String groupCode, String projectId, String userId);
 

+ 0 - 16
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ISyncOldAdm.java

@@ -1,16 +0,0 @@
-package com.persagy.adm.server.custom.service;
-
-import java.util.Map;
-
-/**
- * 从老adm同步正向交付数据和建筑楼层等初始化数据
- */
-public interface ISyncOldAdm {
-
-	Map<String, Object> syncData(String groupCode, String projectId);
-
-	void handleJobSpace(String projectId);
-
-	void uploadFloorMap(String groupCode, String projectId);
-
-}

+ 0 - 16
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/ServiceUtil.java

@@ -5,7 +5,6 @@ import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.persagy.adm.server.custom.common.AdmResult;
 import com.persagy.adm.server.custom.entity.Pagination;
-import com.persagy.adm.server.custom.entity.oldadm.OldAdmResult;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.model.response.CommonResult;
 
@@ -63,19 +62,4 @@ public class ServiceUtil {
 		return list;
 	}
 
-
-	public static <T> T callOldAdm(Supplier<OldAdmResult<T>> action, Pagination pagination) {
-		OldAdmResult<T> result = action.get();
-		if(SUCCESS.equals(result.getResult())) {
-			if(pagination != null)
-				pagination.setTotal(result.getTotal());
-			return result.getContent();
-		}
-		throw new CallException(new AdmResult<>(result.getResult(), result.getMessage()));
-	}
-
-	public static <T> T callOldAdm(Supplier<OldAdmResult<T>> action) {
-		return callOldAdm(action, null);
-	}
-
 }

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmCadServiceImpl.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service.impl;
 
-import com.persagy.adm.server.custom.entity.AdmCad;
+import com.persagy.adm.server.custom.entity.db.AdmCad;
 import com.persagy.adm.server.custom.dao.AdmCadMapper;
 import com.persagy.adm.server.custom.service.IAdmCadService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmDefineProblemInfoServiceImpl.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service.impl;
 
-import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
+import com.persagy.adm.server.custom.entity.db.AdmDefineProblemInfo;
 import com.persagy.adm.server.custom.dao.AdmDefineProblemInfoMapper;
 import com.persagy.adm.server.custom.service.IAdmDefineProblemInfoService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

+ 1 - 1
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/AdmProblemServiceImpl.java

@@ -1,6 +1,6 @@
 package com.persagy.adm.server.custom.service.impl;
 
-import com.persagy.adm.server.custom.entity.AdmProblem;
+import com.persagy.adm.server.custom.entity.db.AdmProblem;
 import com.persagy.adm.server.custom.dao.AdmProblemMapper;
 import com.persagy.adm.server.custom.service.IAdmProblemService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

+ 0 - 111
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/QueryFromOldAdmImpl.java

@@ -1,111 +0,0 @@
-package com.persagy.adm.server.custom.service.impl;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.persagy.adm.server.custom.client.OldAdmClient;
-import com.persagy.adm.server.custom.entity.db.AdmM2dEquip;
-import com.persagy.adm.server.custom.entity.Pagination;
-import com.persagy.adm.server.custom.entity.oldadm.*;
-import com.persagy.adm.server.custom.service.IConfigService;
-import com.persagy.adm.server.custom.service.IQueryFromOldAdm;
-import com.persagy.adm.server.custom.service.ServiceUtil;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.io.IOException;
-import java.util.*;
-import java.util.function.Supplier;
-
-@Service
-public class QueryFromOldAdmImpl implements IQueryFromOldAdm {
-
-	private static String user = "bdtp";
-
-	private static String password = "123456";
-
-	private static String appId = "adm";
-
-	@Autowired
-	private OldAdmClient admClient;
-
-	@Autowired
-	private IConfigService configService;
-
-	@Autowired
-	private ObjectMapper objectMapper;
-
-	@Override
-	public String login() {
-		HashMap<String, Object> params = new HashMap<>();
-		params.put("name", user);
-		params.put("password", password);
-		Map<String, Object> longinInfo = admClient.login(params);
-		if("Success".equals(longinInfo.get("code"))){
-			Map data = (Map)longinInfo.get("data");
-			return (String) data.get("token");
-		}
-		return null;
-	}
-
-	@Override
-	public List<OProject> queryProject(String token, String groupCode, String projectId) {
-		return ServiceUtil.callOldAdm(() -> admClient.queryProject(groupCode, projectId, appId, user, token, new HashMap<>()));
-	}
-
-	@Override
-	public List<OBuilding> queryBdAnFl(String token, String groupCode, String projectId) {
-		HashMap<String,Object> params = new HashMap<>();
-		HashMap<String, Object> cascade = new HashMap<>();
-		cascade.put("name", "floor");
-		cascade.put("orders", "floorSequenceID asc");
-		params.put("cascade", Arrays.asList(cascade));
-		return ServiceUtil.callOldAdm(() -> admClient.queryBuilding(groupCode, projectId, appId, user, token, params));
-	}
-
-	@Override
-	public List<OSpace> querySpace(String token, String groupCode, String projectId) {
-		HashMap<String,Object> params = new HashMap<>();
-		params.put("zoneTypeList", Arrays.asList("GeneralZone", "OtherZone"));
-		//params.put("zoneType", "GeneralZone");
-
-		Pagination pagination = new Pagination(1000);
-		return queryAllPage(() -> admClient.querySpace(groupCode, projectId, appId, user, token, params), params, pagination);
-	}
-
-	private <T> List<T> queryAllPage(Supplier<OldAdmResult<List<T>>> action, Map<String,Object> params, Pagination pagination){
-		List<T> list = null;
-		while (pagination.isHasNext()){
-			params.put("pageNumber", pagination.getPageNum());
-			params.put("pageSize", pagination.getPageSize());
-			if(list == null)
-				list = ServiceUtil.callOldAdm(action, pagination);
-			else
-				list.addAll(ServiceUtil.callOldAdm(action, pagination));
-			pagination.next();
-		}
-		return list;
-	}
-
-	@Override
-	public List<OEquip> queryEquip(String token, String groupCode, String projectId) {
-		HashMap<String,Object> params = new HashMap<>();
-		Pagination pagination = new Pagination(1000);
-
-		//TODO 暂时仅同步正向交付的设备,按设备类过滤
-		List<AdmM2dEquip> equips = configService.queryM2dEquip(projectId);
-		List<String> classCodeList = new ArrayList<>(equips.size());
-		for (AdmM2dEquip equip : equips) {
-			classCodeList.add(equip.getClassCode());
-		}
-		if (classCodeList.size() > 0) {
-			try {
-				String filter = "classCode in " + objectMapper.writeValueAsString(classCodeList);
-				params.put("filters", filter);
-			} catch (IOException e) {
-
-			}
-		}
-
-		return queryAllPage(() -> admClient.queryEquip(groupCode, projectId, appId, user, token, params), params, pagination);
-	}
-
-}

+ 16 - 17
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncAppImpl.java

@@ -23,7 +23,7 @@ import com.persagy.adm.server.custom.entity.db.AdmDefineProblemType;
 import com.persagy.adm.server.custom.service.*;
 import com.persagy.adm.server.custom.util.DataExtrasUtil;
 import com.persagy.adm.server.custom.dao.AdmDefineProblemInfoMapper;
-import com.persagy.adm.server.custom.entity.AdmDefineProblemInfo;
+import com.persagy.adm.server.custom.entity.db.AdmDefineProblemInfo;
 import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.constant.ValidEnum;
 import com.persagy.dmp.define.entity.RelationDefine;
@@ -165,7 +165,7 @@ public class SyncAppImpl implements ISyncApp {
 	}
 
 	@Override
-	public Map<String, Object> downloadConfig(String groupCode, String projectId, String userId) {
+	public ConfigData downloadConfig(String groupCode, String projectId, String userId) {
 		//配置数据查询
 		List<AdmM2dEquip> m2dTypes = configService.queryM2dEquip(projectId);
 		List<AdmInfosConfig> infosConfig = configService.queryInfosConfig(projectId);
@@ -176,24 +176,18 @@ public class SyncAppImpl implements ISyncApp {
 		List<AdmContainerConfig> containerConfig = configService.queryContainerConfig(projectId);
 		// 下载问题类型
 		List<AdmDefineProblemType> admDefineProblemTypes = configService.queryDefineProblemTypes();
-		// 下载ADM图纸
-		List<AdmCad> admFiles = admCadMapper.selectList(new LambdaQueryWrapper<AdmCad>().eq(AdmCad::getProjectId,projectId));
 		// 下载问题类型对应信息点定义
 		List<AdmDefineProblemInfo> admDefineProblemInfos = admDefineProblemInfoMapper.selectList(null);
 
-		HashMap<String, Object> data = new HashMap<>();
-		data.put("m2dTypes", m2dTypes);
-		data.put("infosConfig", infosConfig);
-		data.put("relConfig", relConfig);
-		data.put("pipeConfig", pipeConfig);
-		data.put("config", config);
-		data.put("component", component);
-		data.put("containerConfig", containerConfig);
-		data.put("problemTypeConfig",admDefineProblemTypes);
-		data.put("admFiles",admFiles);
-		data.put("admDefineProblemInfos",admDefineProblemInfos);
-
-		return data;
+		return ConfigData.builder().m2dTypes(m2dTypes)
+				.infosConfig(infosConfig)
+				.relConfig(relConfig)
+				.pipeConfig(pipeConfig)
+				.config(config)
+				.component(component)
+				.containerConfig(containerConfig)
+				.admDefineProblemTypes(admDefineProblemTypes)
+				.admDefineProblemInfos(admDefineProblemInfos).build();
 	}
 
 	@Override
@@ -281,6 +275,9 @@ public class SyncAppImpl implements ISyncApp {
 		// 问题相关数据
 		List<AdmProblem> problems = problemMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<>(),projectId,buildingId,operator,admDownloadTs));
 
+		// 下载ADM图纸
+		List<AdmCad> admCads = admCadMapper.selectList(new LambdaQueryWrapper<AdmCad>().eq(AdmCad::getProjectId,projectId).eq(AdmCad::getBuildingId,buildingId));
+
 		List<AdmFile> file = fileMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<AdmFile>(), projectId, buildingId, operator, admDownloadTs));
 		List<AdmQrCode> qrCode = qrCodeMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<AdmQrCode>(), projectId, buildingId, operator, admDownloadTs));
 		List<AdmServeArea> serveArea = serveAreaMapper.selectList(buildDownloadQueryWrapper(new QueryWrapper<AdmServeArea>(), projectId, buildingId, operator, admDownloadTs));
@@ -300,6 +297,8 @@ public class SyncAppImpl implements ISyncApp {
 		data.buildDownloadTs();
 		// 核查问题数据
 		data.setProblems(problems);
+		// CAD图纸数据
+		data.setAdmCads(admCads);
 		return data;
 	}
 

+ 0 - 569
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/service/impl/SyncOldAdmImpl.java

@@ -1,569 +0,0 @@
-package com.persagy.adm.server.custom.service.impl;
-
-import cn.hutool.core.date.DatePattern;
-import cn.hutool.core.date.DateUtil;
-import cn.hutool.core.util.ArrayUtil;
-import cn.hutool.core.util.IdUtil;
-import cn.hutool.core.util.ReflectUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.persagy.adm.server.custom.client.OldAdmClient;
-import com.persagy.adm.server.custom.common.AdmConst;
-import com.persagy.adm.server.custom.common.AdmResult;
-import com.persagy.adm.server.custom.dao.AdmJobSpaceMapper;
-import com.persagy.adm.server.custom.dao.AdmObjectMapper;
-import com.persagy.adm.server.custom.entity.db.AdmJobSpace;
-import com.persagy.adm.server.custom.entity.db.AdmObject;
-import com.persagy.adm.server.custom.entity.oldadm.*;
-import com.persagy.adm.server.custom.service.CallException;
-import com.persagy.adm.server.custom.service.IAdmObjectService;
-import com.persagy.adm.server.custom.service.IQueryFromOldAdm;
-import com.persagy.adm.server.custom.service.ISyncOldAdm;
-import com.persagy.adm.server.custom.util.GeomUtil;
-import com.persagy.dmp.common.constant.ResponseCode;
-import com.persagy.dmp.common.constant.ValidEnum;
-import com.persagy.dmp.common.exception.BusinessException;
-import com.persagy.dmp.common.helper.SpringHelper;
-//import com.persagy.dmp.file.client.FileClientFacade;
-//import com.persagy.dmp.file.model.FileInfo;
-//import com.persagy.dmp.file.model.FileInfoCreator;
-//import com.persagy.dmp.storage.utils.FileStorageHelper;
-import org.locationtech.jts.geom.Polygon;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.*;
-import java.util.stream.Collectors;
-
-@Service
-public class SyncOldAdmImpl implements ISyncOldAdm {
-
-	@Autowired
-	private IQueryFromOldAdm queryOldAdm;
-
-	@Autowired
-	private IAdmObjectService objectService;
-
-	@Autowired
-	private AdmObjectMapper objectMapper;
-
-	@Autowired
-	private AdmJobSpaceMapper jobSpaceMapper;
-
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public Map<String, Object> syncData(String groupCode, String projectId) {
-		String token = queryOldAdm.login();
-		if(StrUtil.isNotBlank(token)){
-			List<OBuilding> bdList = queryOldAdm.queryBdAnFl(token, groupCode, projectId);
-
-			List<OSpace> spList = queryOldAdm.querySpace(token, groupCode, projectId);
-			spList = spList.stream().filter(space -> GeomUtil.checkPolygon(space.getOutline())).collect(Collectors.toList());
-
-			List<OEquip> eqList  = queryOldAdm.queryEquip(token, groupCode, projectId);
-
-			List<AdmObject> bdObjs = new ArrayList<>(bdList.size());
-			List<AdmObject> flObjs = new ArrayList<>();
-			List<AdmObject> spObjs = new ArrayList<>(spList.size());
-			List<AdmObject> eqObjs = new ArrayList<>(eqList.size());
-
-			transEntities(bdObjs, bdList, (bdObj, oBd) -> {
-				setBdData(bdObj, (OBuilding) oBd);
-				if(((OBuilding) oBd).getFloor() != null)
-					transEntities(flObjs, ((OBuilding) oBd).getFloor(), (flObj, oFl) -> setFlData(flObj, (OFloor) oFl));
-			});
-
-			transEntities(spObjs, spList, (spObj, oSp) -> setSpData(spObj, (OSpace) oSp));
-			transEntities(eqObjs, eqList, (eqObj, oEq) -> setEqData(eqObj, (OEquip) oEq));
-
-			Map<String, String> floorIdMap = new HashMap<>();
-			List<AdmObject> dbBds = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_BUILDING);
-			List<AdmObject> dbFls = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_FLOOR);
-			List<AdmObject> dbSps = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_SPACE);
-			List<AdmObject> dbEqs = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_EQUIPMENT);
-
-			List<AdmObject>[] operations = new List[]{new ArrayList<>(), new ArrayList<>()};
-
-			syncObjs(bdObjs, dbBds, operations, 1, floorIdMap);
-			syncObjs(flObjs, dbFls, operations, 2, floorIdMap);
-			syncObjs(spObjs, dbSps, operations, 3, floorIdMap);
-			syncObjs(eqObjs, dbEqs, operations, 4, floorIdMap);
-
-			objectService.insert(operations[0]);
-			objectService.update(operations[1]);
-
-			/*uploadFloorMap(flObjs, groupCode, projectId);*/
-			HashMap<String, Object> rtn = new HashMap<>();
-			rtn.put(AdmConst.OBJ_TYPE_BUILDING, bdObjs.size());
-			rtn.put(AdmConst.OBJ_TYPE_FLOOR, flObjs.size());
-			rtn.put(AdmConst.OBJ_TYPE_SPACE, spObjs.size());
-			rtn.put(AdmConst.OBJ_TYPE_EQUIPMENT, eqObjs.size());
-
-			return rtn;
-		}
-		throw new CallException(new AdmResult(ResponseCode.A0220.getCode(), "ADM platform: " + ResponseCode.A0220.getDesc()));
-	}
-
-	//TODO 设备同步时,按正逆向规则过滤
-	private void syncObjs(List<AdmObject> objs, List<AdmObject> dbItems, List<AdmObject>[] operations, int objMark, Map<String, String> floorIdMap){
-		HashMap<String, AdmObject> dbMap = new HashMap<>();
-		for (AdmObject dbItem : dbItems){
-			dbMap.put(getFixedIdForSync(dbItem, objMark), dbItem);
-		}
-
-		String timestamp =  DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN);
-
-		for(AdmObject obj : objs) {
-			AdmObject dbItem = dbMap.remove(getFixedIdForSync(obj, objMark));
-			if(dbItem == null) {
-				obj.setCreator(AdmConst.CREATOR_SYNC);
-				obj.setModifiedTime(timestamp); //保留从老adm同步过来的createTime,设置updateTime
-				obj.setD2mState(ValidEnum.TRUE.getType());
-				obj.setDeliveryState(ValidEnum.FALSE.getType());
-
-				if(objMark == 3 || objMark == 4) { //新增空间|设备
-					if(floorIdMap.size() > 0){
-						String fixedFloorId = floorIdMap.get(obj.getFloorId());
-						if(fixedFloorId != null)
-							obj.setFloorId(fixedFloorId);
-					}
-				}
-
-				operations[0].add(obj); //add
-			} else {
-				AdmObject updateItem = mergeObj(obj, dbItem, timestamp, objMark);
-				if(updateItem != null)
-					operations[1].add(updateItem); //modify
-
-				if(objMark == 2 && !obj.getId().equals(dbItem.getId())) {
-					floorIdMap.put(obj.getId(), dbItem.getId());
-				}
-			}
-		}
-
-		if (dbMap.size() > 0) { //remove
-			for(AdmObject obj : dbMap.values()){
-				obj.setValid(ValidEnum.FALSE.getType());
-				obj.setModifiedTime(timestamp);
-				obj.setModifier(AdmConst.CREATOR_SYNC);
-				//obj.setUploadFlag(null);
-				operations[1].add(obj);
-			}
-		}
-	}
-
-	/**
-	 * 同步数据时固定的id,优先取bimId,没有bimId取数据id
-	 */
-	private String getFixedIdForSync(AdmObject obj, int objMark){
-		String bimId = null;
-		JsonNode node = obj.getInfo("bimId");
-		if(node != null)
-			bimId = node.asText();
-
-		if(StrUtil.isNotBlank(bimId))
-			return bimId;
-
-		if(objMark == 1) //建筑
-			return obj.getLocalId();
-		else if(objMark == 2) //楼层
-			return obj.getBuildingId() + ":" + obj.getLocalId();
-
-		return obj.getId();
-	}
-
-	private AdmObject mergeObj(AdmObject obj, AdmObject dbItem, String timestamp, int objMark){
-		if(objNotChange(obj, dbItem))
-			return null;
-
-		//合并属性和信息点
-//		if(objMark == 3) {//space
-//
-//		} else if(objMark == 4) {//equipment
-//
-//		}
-		if (obj.getInfos() != null) {
-			if (dbItem.getInfos() == null)
-				dbItem.setInfos(obj.getInfos());
-			else
-				dbItem.getInfos().setAll(obj.getInfos());
-		}
-
-		dbItem.setModifiedTime(timestamp);
-		dbItem.setModifier(AdmConst.CREATOR_SYNC);
-		//dbItem.setUploadFlag(null);
-		dbItem.setD2mState(ValidEnum.TRUE.getType());
-		dbItem.setDeliveryState(ValidEnum.FALSE.getType());
-
-		return dbItem;
-	}
-
-	private boolean objNotChange(AdmObject obj, AdmObject dbItem){
-		//TODO 数据无变化判断
-		return false;
-	}
-
-	private <T extends OBase> void transEntities(List<AdmObject> targetList, List<T> list, SetDataAction setDataAction){
-		if(list != null && list.size() > 0) {
-			for(T item : list) {
-				AdmObject obj = buildAdmObject(item);
-				setDataAction.setData(obj, item);
-				targetList.add(obj);
-			}
-		}
-	}
-
-	private AdmObject buildAdmObject(OBase base){
-		AdmObject obj = new AdmObject();
-		obj.setId(base.getId());
-		obj.setLocalId(base.getLocalId());
-		obj.setName(base.getName());
-		obj.setLocalName(base.getLocalName());
-		obj.setObjType(base.getObjectType());
-
-		if (base.getInfos() != null)
-			obj.setInfos(mapToNode(base.getInfos()));
-
-		if(base.getCreateTime() != null) //同步数据中没有createTime时,设置为当前时间
-			obj.setCreationTime(DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN));
-
-		obj.setValid(ValidEnum.TRUE.getType());
-
-		return obj;
-	}
-
-	private void setBdData(AdmObject obj, OBuilding bd){
-		obj.setProjectId(bd.getProjectId());
-		obj.setClassCode(bd.getObjectType());
-		//obj.setBuildingId(bd.getId());
-
-		if(bd.getDefaultQRCode() != null)
-			getInfos(obj).put("defaultQRCode", bd.getDefaultQRCode());
-		if(bd.getBuildQRCode() != null)
-			getInfos(obj).put("buildQRCode", bd.getBuildQRCode());
-	}
-
-	private void setFlData(AdmObject obj, OFloor fl){
-		obj.setProjectId(fl.getProjectId());
-		obj.setBuildingId(fl.getBuildingId());
-		//obj.setFloorId(fl.getId());
-		obj.setClassCode(fl.getObjectType());
-
-		setInfos(obj, fl, "projectId", "buildingId", "floorId");
-	}
-
-	private void setSpData(AdmObject obj, OSpace sp) {
-		obj.setProjectId(sp.getProjectId());
-		obj.setBuildingId(sp.getBuildingId());
-		obj.setFloorId(sp.getFloorId());
-		obj.setClassCode(sp.getClassCode());
-		obj.setObjType(AdmConst.OBJ_TYPE_SPACE);
-
-		setInfos(obj, sp, "projectId", "buildingId", "floorId", "classCode");
-	}
-
-	private void setEqData(AdmObject obj, OEquip eq) {
-		obj.setProjectId(eq.getProjectId());
-		obj.setBuildingId(eq.getBuildingId());
-		obj.setFloorId(eq.getFloorId());
-		obj.setClassCode(eq.getClassCode());
-
-		setInfos(obj, eq, "projectId", "buildingId", "floorId", "propertyId", "classCode");
-	}
-
-	private void setInfos(AdmObject obj, OBase oEntity, String... ignoreFields){
-		Field[] fields = oEntity.getClass().getDeclaredFields();
-		for (Field field : fields) {
-			if(ignoreFields.length == 0 || !ArrayUtil.contains(ignoreFields, field.getName())) {
-				Object val = ReflectUtil.getFieldValue(oEntity, field);
-				if(val != null) {
-					ObjectNode infos = getInfos(obj);
-					if(val instanceof String)
-						infos.put(field.getName(), (String)val);
-					else if(val instanceof Integer)
-						infos.put(field.getName(), (Integer)val);
-					else if(val instanceof Float)
-						infos.put(field.getName(), (Float)val);
-					else if(val instanceof Double)
-						infos.put(field.getName(), (Double)val);
-					else if(val instanceof List)
-						infos.putArray(field.getName()).addAll(listToNode((List)val));
-					else if(val instanceof Map)
-						infos.putObject(field.getName()).setAll(mapToNode((Map)val));
-				}
-			}
-		}
-	}
-
-	private ObjectNode getInfos(AdmObject obj) {
-		ObjectNode objectNode = obj.getInfos();
-		if(objectNode == null){
-			ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-			objectNode = objectMapper.createObjectNode();
-			obj.setInfos(objectNode);
-		}
-		return objectNode;
-	}
-
-	private ObjectNode mapToNode(Map<String, Object> map){
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-		try {
-			String json = objectMapper.writeValueAsString(map);
-			return objectMapper.readValue(json, ObjectNode.class);
-		} catch (IOException e) {
-			throw new BusinessException(ResponseCode.A0427.getCode(), ResponseCode.A0427.getDesc());
-		}
-	}
-
-	private ArrayNode listToNode(List<Object> list){
-		ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-		try {
-			String json = objectMapper.writeValueAsString(list);
-			return objectMapper.readValue(json, ArrayNode.class);
-		} catch (IOException e) {
-			throw new BusinessException(ResponseCode.A0427.getCode(), ResponseCode.A0427.getDesc());
-		}
-	}
-
-	interface SetDataAction {
-		void setData(AdmObject obj, OBase oldAdmEntity);
-	}
-
-	/**
-	 * 创建/合并任务空间数据
-	 */
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void handleJobSpace(String projectId){
-		QueryWrapper<AdmObject> queryWrapper = new QueryWrapper<>();
-		queryWrapper.eq("project_id", projectId).eq("obj_type", AdmConst.OBJ_TYPE_SPACE).eq("valid", ValidEnum.TRUE.getType()).orderByAsc("floor_id");
-		List<AdmObject> spaceList = objectMapper.selectList(queryWrapper);
-
-		QueryWrapper<AdmJobSpace> wrapper = new QueryWrapper<>();
-		wrapper.eq("project_id", projectId).eq("valid", ValidEnum.TRUE.getType());
-		List<AdmJobSpace> jobSpaceList = jobSpaceMapper.selectList(wrapper);
-
-		//空间按层分组,优先使用OtherZone,缺省GeneralZone
-		LinkedHashMap<String, List<AdmObject>> map = new LinkedHashMap<>();
-		String floorId = null;
-		List<AdmObject> generalList = null;
-		List<AdmObject> otherList = null;
-		for(AdmObject sp : spaceList){
-			if(floorId == null || !floorId.equals(sp.getFloorId())) {
-				if(floorId != null)
-					map.put(floorId, otherList.size() > 0 ? otherList : generalList);
-
-				floorId = sp.getFloorId();
-				generalList = new ArrayList<>();
-				otherList = new ArrayList<>();
-			}
-
-			String zone = sp.getClassCode();
-			if("GeneralZone".equals(zone))
-				generalList.add(sp);
-			else if("OtherZone".equals(zone))
-				otherList.add(sp);
-		}
-		if(floorId != null)
-			map.put(floorId, otherList.size() > 0 ? otherList : generalList);
-
-		List<AdmJobSpace> toCreate = new ArrayList<>();
-		List<AdmJobSpace> toModify = new ArrayList<>();
-
-		String time = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN);
-
-		//按楼层进行空间匹配操作
-		for (Map.Entry<String, List<AdmObject>> entry : map.entrySet()) {
-			floorId = entry.getKey();
-
-			HashMap<String, AdmJobSpace> jobMap = new HashMap<>();
-			for (int i = 0; i < jobSpaceList.size(); i++) {
-				AdmJobSpace jobSpace = jobSpaceList.get(i);
-				if(jobSpace.getFloorId().equals(floorId)){
-					jobMap.put(jobSpace.getSpaceId(), jobSpace);
-
-					jobSpaceList.remove(i);
-					i--;
-				}
-			}
-
-			List<AdmObject> sps = entry.getValue();
-			for(AdmObject sp : sps){
-				ArrayNode spOutline = (ArrayNode) sp.getInfo("outline");
-				AdmJobSpace job = jobMap.remove(sp.getId());
-				if(job != null) {
-					//id匹配,轮廓变化的空间,重置任务状态
-					if(!outlineMatch(job.getOutline(), spOutline)){
-						job.setArchState(AdmConst.JOB_STATE_PROCESSING);
-						job.setEquipState(AdmConst.JOB_STATE_PROCESSING);
-						job.setOutline(spOutline);
-						toModify.add(job);
-					} // else id和轮廓都匹配,不做处理
-				} else {
-					//id未匹配,轮廓完全一致的任务空间,重新设置spaceId
-					job = matchByOutline(jobMap, sp);
-					if(job != null) {
-						job.setSpaceId(sp.getId());
-						toModify.add(job);
-					}
-				}
-
-				if (job == null) {
-					job = new AdmJobSpace();
-					job.setId(IdUtil.fastSimpleUUID());
-					job.setSpaceId(sp.getId());
-					job.setOutline((ArrayNode) sp.getInfo("outline"));
-					job.setArchState(AdmConst.JOB_STATE_PROCESSING);
-					job.setEquipState(AdmConst.JOB_STATE_PROCESSING);
-					job.setProjectId(projectId);
-					job.setBuildingId(sp.getBuildingId());
-					job.setFloorId(sp.getFloorId());
-					job.setCreationTime(time);
-					job.setCreator(AdmConst.CREATOR_SYNC);
-					job.setValid(ValidEnum.TRUE.getType());
-
-					toCreate.add(job);
-				}
-			}
-
-			//楼层中未找到匹配关系的任务空间
-			for(AdmJobSpace job : jobMap.values()){
-				job.setValid(ValidEnum.FALSE.getType());
-				toModify.add(job);
-			}
-		}
-
-		//项目下未找到匹配关系的任务空间
-		for(AdmJobSpace job : jobSpaceList){
-			job.setValid(ValidEnum.FALSE.getType());
-			toModify.add(job);
-		}
-
-		for(AdmJobSpace job : toCreate) {
-			jobSpaceMapper.insert(job);
-		}
-		for(AdmJobSpace job : toModify) {
-			job.setModifiedTime(time);
-			job.setModifier(AdmConst.CREATOR_SYNC);
-			//job.setUploadFlag(null);
-			jobSpaceMapper.updateById(job);
-		}
-	}
-
-	private AdmJobSpace matchByOutline(HashMap<String, AdmJobSpace> jobMap, AdmObject space){
-		if(jobMap.size() == 0)
-			return null;
-
-		ArrayNode o1 = (ArrayNode) space.getInfo("outline");
-		if(!isValidOutline(o1))
-			return null;
-
-		Polygon[] ps = GeomUtil.getPolygon(o1);
-		Map.Entry<String, AdmJobSpace> target = null;
-		for(Map.Entry<String, AdmJobSpace> entry : jobMap.entrySet()){
-			ArrayNode o2 = entry.getValue().getOutline();
-			if(isValidOutline(o2) && polygonsMatch(ps, GeomUtil.getPolygon(o2))){
-				target = entry;
-				break;
-			}
-		}
-		if(target != null){
-			jobMap.remove(target.getKey());
-			return target.getValue();
-		}
-		return null;
-	}
-
-	/**
-	 * 判断空间轮廓是否变化
-	 * TODO 区分覆盖等情况
-	 */
-	private boolean outlineMatch(ArrayNode o1, ArrayNode o2){
-		return polygonsMatch(GeomUtil.getPolygon(o1), GeomUtil.getPolygon(o2));
-	}
-
-
-	/**
-	 * 轮廓匹配判断
-	 * TODO 暂不考虑顺序
-	 */
-	private boolean polygonsMatch(Polygon[] ps1, Polygon[] ps2){
-		if (ps1.length == ps2.length) {
-			for (int i = 0; i < ps2.length; i++) {
-				if (!ps1[i].equalsExact(ps2[i]))
-					return false;
-			}
-			return true;
-		}
-		return false;
-	}
-
-	private boolean isValidOutline(ArrayNode outline) {
-		if(outline != null && outline.size() > 0 && outline.get(0).isArray()) {
-			ArrayNode o1 = (ArrayNode) outline.get(0);
-			if (o1.size() > 0 && o1.get(0).isArray()) {
-				ArrayNode o2 = (ArrayNode) o1.get(0);
-				return o2.size() >= 3;
-			}
-		}
-		return false;
-	}
-
-	@Autowired
-	private OldAdmClient oldAdmClient;
-
-	/**
-	 *	把地图文件从image-service转存到文件服务
-	 */
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public void uploadFloorMap(String groupCode, String projectId) {
-		/* 不使用
-		List<AdmObject> floors = objectService.queryM2dByObjType(projectId, AdmConst.OBJ_TYPE_FLOOR);
-		List<AdmObject> modifiedFloors = new ArrayList<>();
-		for(AdmObject floor : floors) {
-			ObjectNode infos = floor.getInfos();
-			if(infos != null) {
-				JsonNode mapNode = infos.get("floorMap");
-				JsonNode mapIdNode = infos.get("floorMapId");
-				if(mapNode != null){
-					String map = mapNode.asText();
-					String mapId = mapIdNode != null ? mapIdNode.asText() : null;
-					if(mapId != null) {
-						FileInfo fileInfo = FileClientFacade.load(mapId);
-						if(fileInfo != null && fileInfo.getFileName().equals(map))
-							continue; //文件无变化
-
-						//删除之前的地图文件
-						FileStorageHelper.deleteFile(mapId);
-					}
-
-					try {
-						Response serviceResponse = oldAdmClient.getFloorMap(map, "revit");
-						Response.Body body = serviceResponse.body();
-
-						InputStream inputStream = body.asInputStream();
-						FileInfo fileInfo = FileInfoCreator.of(groupCode, projectId, AdmConst.APP_ID, map);
-						String fileId = FileStorageHelper.uploadFile(fileInfo, inputStream);
-
-						infos.put("floorMapId", fileId);
-						modifiedFloors.add(floor);
-					} catch (Exception e) {
-						e.printStackTrace();
-					}
-				}
-			}
-		}
-
-		objectService.update(modifiedFloors);
-		*/
-	}
-
-}