|
@@ -14,7 +14,6 @@ import com.persagy.bdtp.adm.common.AdmConst;
|
|
import com.persagy.bdtp.adm.dao.AdmJobSpaceMapper;
|
|
import com.persagy.bdtp.adm.dao.AdmJobSpaceMapper;
|
|
import com.persagy.bdtp.adm.entity.Pagination;
|
|
import com.persagy.bdtp.adm.entity.Pagination;
|
|
import com.persagy.bdtp.adm.entity.db.AdmJobSpace;
|
|
import com.persagy.bdtp.adm.entity.db.AdmJobSpace;
|
|
-import com.persagy.bdtp.adm.entity.db.AdmObject;
|
|
|
|
import com.persagy.bdtp.adm.service.ISyncSpace;
|
|
import com.persagy.bdtp.adm.service.ISyncSpace;
|
|
import com.persagy.bdtp.adm.service.ServiceUtil;
|
|
import com.persagy.bdtp.adm.service.ServiceUtil;
|
|
import com.persagy.bdtp.adm.util.GeomUtil;
|
|
import com.persagy.bdtp.adm.util.GeomUtil;
|
|
@@ -106,12 +105,11 @@ public class SyncSpaceImpl implements ISyncSpace {
|
|
List<AdmJobSpace> jobSpaceList = jobSpaceMapper.selectList(wrapper);
|
|
List<AdmJobSpace> jobSpaceList = jobSpaceMapper.selectList(wrapper);
|
|
|
|
|
|
HashMap<String, AdmJobSpace> jobMap = new HashMap<>(jobSpaceList.size());
|
|
HashMap<String, AdmJobSpace> jobMap = new HashMap<>(jobSpaceList.size());
|
|
- jobSpaceList.forEach(job -> jobMap.put(job.getBimId() != null ? job.getBimId() : job.getSpaceId(), job));
|
|
|
|
|
|
+ jobSpaceList.forEach(job -> jobMap.put(job.getSpaceId(), job));
|
|
|
|
|
|
//同步操作
|
|
//同步操作
|
|
for(ObjectNode sp : spList){
|
|
for(ObjectNode sp : spList){
|
|
String spId = sp.get("id").asText();
|
|
String spId = sp.get("id").asText();
|
|
- String bimId = sp.get("bimId") != null ? sp.get("bimId").asText() : null;
|
|
|
|
|
|
|
|
ArrayNode spOutline = null;
|
|
ArrayNode spOutline = null;
|
|
Object o1 = sp.get("outline");
|
|
Object o1 = sp.get("outline");
|
|
@@ -125,7 +123,7 @@ public class SyncSpaceImpl implements ISyncSpace {
|
|
if(!GeomUtil.checkPolygon(spOutline))
|
|
if(!GeomUtil.checkPolygon(spOutline))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
- AdmJobSpace job = jobMap.remove(bimId != null ? bimId : spId);
|
|
|
|
|
|
+ AdmJobSpace job = jobMap.remove(spId);
|
|
if(job != null) { //id匹配
|
|
if(job != null) { //id匹配
|
|
boolean change = false;
|
|
boolean change = false;
|
|
|
|
|
|
@@ -138,8 +136,7 @@ public class SyncSpaceImpl implements ISyncSpace {
|
|
}
|
|
}
|
|
|
|
|
|
//重置空间id
|
|
//重置空间id
|
|
- if(!Objects.equals(spId, job.getSpaceId()) || !Objects.equals(bimId, job.getBimId())) {
|
|
|
|
- job.setBimId(bimId);
|
|
|
|
|
|
+ if(!Objects.equals(spId, job.getSpaceId())) {
|
|
job.setSpaceId(spId);
|
|
job.setSpaceId(spId);
|
|
change = true;
|
|
change = true;
|
|
}
|
|
}
|
|
@@ -147,11 +144,9 @@ public class SyncSpaceImpl implements ISyncSpace {
|
|
//轮廓和空间id都一致的,不需要做处理
|
|
//轮廓和空间id都一致的,不需要做处理
|
|
if(change)
|
|
if(change)
|
|
toModify.add(job);
|
|
toModify.add(job);
|
|
- } else { //bimId未匹配
|
|
|
|
|
|
+ } else { //id未匹配
|
|
job = matchByOutline(jobMap, sp);
|
|
job = matchByOutline(jobMap, sp);
|
|
- if(job != null) { //轮廓完全一致的任务空间,重新设置bimId和spaceId
|
|
|
|
- job.setBimId(bimId);
|
|
|
|
-
|
|
|
|
|
|
+ if(job != null) { //轮廓完全一致的任务空间,重新设置spaceId
|
|
job.setSpaceId(spId);
|
|
job.setSpaceId(spId);
|
|
toModify.add(job);
|
|
toModify.add(job);
|
|
}
|
|
}
|
|
@@ -161,7 +156,6 @@ public class SyncSpaceImpl implements ISyncSpace {
|
|
job = new AdmJobSpace();
|
|
job = new AdmJobSpace();
|
|
job.setId(IdUtil.fastSimpleUUID());
|
|
job.setId(IdUtil.fastSimpleUUID());
|
|
job.setSpaceId(spId);
|
|
job.setSpaceId(spId);
|
|
- job.setBimId(bimId);
|
|
|
|
job.setOutline(spOutline);
|
|
job.setOutline(spOutline);
|
|
job.setArchState(AdmConst.JOB_STATE_PROCESSING);
|
|
job.setArchState(AdmConst.JOB_STATE_PROCESSING);
|
|
job.setEquipState(AdmConst.JOB_STATE_PROCESSING);
|
|
job.setEquipState(AdmConst.JOB_STATE_PROCESSING);
|