|
@@ -6,7 +6,9 @@ import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
+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.bdtp.adm.client.DicClient;
|
|
|
import com.persagy.bdtp.adm.client.RwdClient;
|
|
@@ -189,10 +191,37 @@ public class SyncAppImpl implements ISyncApp {
|
|
|
|
|
|
private void packInfos(List<ObjectNode> dataList){
|
|
|
for(ObjectNode node : dataList) {
|
|
|
+ handle4Download(node);
|
|
|
DataExtrasUtil.packObjExtras(node);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private void handle4Download(ObjectNode node){
|
|
|
+ JsonNode ol = node.get("outline");
|
|
|
+ if(ol != null){
|
|
|
+ try {
|
|
|
+ node.set("outline", objectMapper.readValue(ol.asText(), ArrayNode.class));
|
|
|
+ }catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ JsonNode bl = node.get("bimLocation");
|
|
|
+ if(bl != null) {
|
|
|
+ try {
|
|
|
+ String[] arr = bl.asText().split(",");
|
|
|
+ ObjectNode ln = objectMapper.createObjectNode();
|
|
|
+ ln.put("x", Double.parseDouble(arr[0]));
|
|
|
+ ln.put("y", Double.parseDouble(arr[1]));
|
|
|
+ ln.put("z", Double.parseDouble(arr[2]));
|
|
|
+ node.set("location", ln);
|
|
|
+ node.remove("bimLocation");
|
|
|
+ }catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public BuildingData downloadBuildingData(String projectId, String buildingId, String uploadFlag, String lastDownloadTime) {
|
|
|
throw new RuntimeException("not supported");
|
|
@@ -383,6 +412,7 @@ public class SyncAppImpl implements ISyncApp {
|
|
|
return job.getStatus();
|
|
|
} else {
|
|
|
job = new AdmUploadJob();
|
|
|
+ job.setId(uploadJobId);
|
|
|
job.setProjectId(projectId);
|
|
|
job.setOperator(operator);
|
|
|
job.setStatus(AdmConst.UPLOAD_PROCESSING);
|
|
@@ -419,6 +449,7 @@ public class SyncAppImpl implements ISyncApp {
|
|
|
Iterator<ObjectNode> iter = list.iterator();
|
|
|
while (iter.hasNext()) {
|
|
|
ObjectNode entity = iter.next();
|
|
|
+ handle4Upload(entity);
|
|
|
DataExtrasUtil.unpackObjExtras(entity);
|
|
|
entity.remove("ts");
|
|
|
|
|
@@ -444,8 +475,8 @@ public class SyncAppImpl implements ISyncApp {
|
|
|
entity.put("modifier", operator);
|
|
|
entity.put("modifiedTime", time);
|
|
|
|
|
|
-
|
|
|
- if(AdmConst.OBJ_TYPE_SPACE.equals(entity.get("objType")))
|
|
|
+
|
|
|
+ if(entity.get("outline") != null)
|
|
|
entity.remove("outline");
|
|
|
|
|
|
|
|
@@ -608,6 +639,19 @@ public class SyncAppImpl implements ISyncApp {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private void handle4Upload(ObjectNode node){
|
|
|
+ JsonNode l = node.get("location");
|
|
|
+ if(l != null) {
|
|
|
+ try {
|
|
|
+ node.put("bimLocation", StrUtil.join(",", l.get("x").asDouble(), l.get("y").asDouble(), l.get("z").asDouble()));
|
|
|
+ node.remove("location");
|
|
|
+ }catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void markM2dState(Object item){
|
|
|
|
|
|
}
|