|
@@ -8,6 +8,10 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.persagy.common.exception.BusinessException;
|
|
|
+import com.persagy.fm.common.constant.CommonConstant;
|
|
|
+import com.persagy.fm.common.constant.CommonMessage;
|
|
|
+import com.persagy.fm.common.constant.DataRequestPathUtil;
|
|
|
+import com.persagy.fm.common.constant.DataRequestProcessUtil;
|
|
|
import com.persagy.fm.common.old.utils.StringUtil;
|
|
|
import com.persagy.fm.common.old.utils.ToolsUtil;
|
|
|
import com.persagy.fm.sop.constant.SopCommonConst;
|
|
@@ -102,7 +106,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
* 若获取项目下字典名称为空,name使用数据平台的数据
|
|
|
* update by yuecaipu on 2018-5-9 18:15
|
|
|
*/
|
|
|
- objName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, object.getString("obj_id"));
|
|
|
+ objName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, object.getString("obj_id"));
|
|
|
objName = objName == null ? result.getString("eqName"):objName;
|
|
|
object.put("obj_name", objName);
|
|
|
object.put("obj_code", result.getString("eq"));
|
|
@@ -198,7 +202,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
JSONObject spaceClassJson = JSONObject.parseObject(spaceClass);
|
|
|
if (DBConst.Result.SUCCESS.equals(spaceClassJson.getString(DBConst.Result.RESULT))) {
|
|
|
JSONArray content = spaceClassJson.getJSONArray(DBConst.Result.CONTENT);
|
|
|
- filterObjByKeyWords(keyWords, objects, content, SopCommonConst.data_type_space_class);
|
|
|
+ filterObjByKeyWords(keyWords, objects, content, CommonConstant.data_type_space_class);
|
|
|
}
|
|
|
}
|
|
|
// 3.搜索 build_func_type-建筑功能类型
|
|
@@ -245,8 +249,6 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
}
|
|
|
}
|
|
|
if (!criterias.isEmpty()) {
|
|
|
-// String projectId = StringUtil.transferId(criterias.getJSONObject(0).getString("id"), SopCommonConst.tag_project);
|
|
|
-// String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query_post, projectId, null);
|
|
|
String requestUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query_post);
|
|
|
JSONObject params = new JSONObject();
|
|
|
params.put("projectId", projectId);
|
|
@@ -312,7 +314,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
@Override
|
|
|
public String searchObjectClass(String jsonStr) throws Exception {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
|
|
|
- String projectId = SopCommonConst.group_sop_id;
|
|
|
+ String projectId = SopCommonConst.GROUP_SOP_ID;
|
|
|
String keyWord = jsonObject.getString("keyword");
|
|
|
keyWord = keyWord == null ? "" : keyWord;
|
|
|
String[] keyWords = keyWord.split(" +");
|
|
@@ -740,8 +742,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
String buildStr = httpPostRequestDataPlatform(url, "{\"projectId\":\"" + projectId + "\",\"criteria\":{\"type\":[\"Bd\"]}}");
|
|
|
JSONObject buildJson = JSONObject.parseObject(buildStr);
|
|
|
if("success".equals(buildJson.getString("Result"))){
|
|
|
- Map<String, String> idLocalNameMap = getObjectIdNameMap(buildJson, SopCommonConst.info_name_local_name_build);
|
|
|
- Map<String, String> idLocalIdMap = getObjectIdNameMap(buildJson, SopCommonConst.info_name_local_id_build);
|
|
|
+ Map<String, String> idLocalNameMap = getObjectIdNameMap(buildJson, CommonConstant.info_name_local_name_build);
|
|
|
+ Map<String, String> idLocalIdMap = getObjectIdNameMap(buildJson, CommonConstant.info_name_local_id_build);
|
|
|
JSONArray builds = new JSONArray();
|
|
|
JSONObject build;
|
|
|
//for(String id : idLocalNameMap.keySet()){
|
|
@@ -760,7 +762,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
// buildItem = buildArray.getJSONObject(i);
|
|
|
// build = new JSONObject();
|
|
|
// build.put("obj_id", buildItem.getString("id"));
|
|
|
-// build.put("obj_name", buildItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_build));
|
|
|
+// build.put("obj_name", buildItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_build));
|
|
|
// builds.add(build);
|
|
|
// }
|
|
|
buildStr = ToolsUtil.successJsonMsg(builds);
|
|
@@ -818,16 +820,16 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
floor = new JSONObject();
|
|
|
floorId = floorItem.getString("id");
|
|
|
floor.put("obj_id", floorId);
|
|
|
- floor.put("obj_name", floorItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_floor));
|
|
|
- floor.put("obj_code", floorItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_id_floor));
|
|
|
- //buildId = StringUtil.transferId(floorId, SopCommonConst.tag_build);
|
|
|
+ floor.put("obj_name", floorItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_floor));
|
|
|
+ floor.put("obj_code", floorItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_id_floor));
|
|
|
+ //buildId = StringUtil.transferId(floorId, CommonConstant.tag_build);
|
|
|
buildId = floorId_location.get(floorId) == null ? null : floorId_location.get(floorId).getString("building");
|
|
|
floorList = floorMap.getOrDefault(buildId, new JSONArray());
|
|
|
floorList.add(floor);
|
|
|
floorMap.put(buildId, floorList);
|
|
|
}
|
|
|
//遍历建筑 {"buildingId":"buildingName"}
|
|
|
- Map<String, String> map = getObjectIdNameMap(buildJson, SopCommonConst.info_name_local_name_build);
|
|
|
+ Map<String, String> map = getObjectIdNameMap(buildJson, CommonConstant.info_name_local_name_build);
|
|
|
builds = new JSONArray();
|
|
|
//for(String id : map.keySet()){
|
|
|
String id;
|
|
@@ -874,10 +876,10 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
String buildUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query);
|
|
|
String floorParamStr, buildParamStr, spaceStr, floorStr, buildStr;
|
|
|
String floorUrl, spaceParmaStr = "{\"projectId\":\"" + projectId + "\",\"criteria\":{\"id\":\""+objId+"\",\"type\":[\"Sp\"]}}";
|
|
|
- if(SopCommonConst.data_type_floor.equals(objType)){
|
|
|
+ if(CommonConstant.data_type_floor.equals(objType)){
|
|
|
// floorUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query, projectId, projectCache.getProjectSecretById(projectId));
|
|
|
floorUrl = getDataPlatformPath(DataRequestPathUtil.dataPlat_object_batch_query);
|
|
|
- String buildId = transferId(objId, SopCommonConst.tag_build, dataPlatBasePath);
|
|
|
+ String buildId = transferId(objId, CommonConstant.tag_build, dataPlatBasePath);
|
|
|
buildParamStr = "{\"projectId\":\"" + projectId + "\",\"criterias\":[{\"id\":\""+buildId+"\"}]}";
|
|
|
floorParamStr = "{\"projectId\":\"" + projectId + "\",\"criterias\":[{\"id\":\""+objId+"\"}]}";
|
|
|
}else{
|
|
@@ -904,7 +906,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
if("success".equals(spaceJson.getString("Result")) && "success".equals(floorJson.getString("Result")) && "success".equals(buildJson.getString("Result"))){
|
|
|
//定义缓存Map
|
|
|
//key:buildId value:build
|
|
|
- Map<String, String> buildMap = new HashMap<String, String>();
|
|
|
+ Map<String, String> buildMap = new HashMap<>();
|
|
|
//key:floorId value:floor
|
|
|
Map<String, String> floorMap = new HashMap<String, String>();
|
|
|
//定义变量
|
|
@@ -915,13 +917,13 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
buildArray = buildJson.getJSONArray("Content");
|
|
|
for(int i=0; i<buildArray.size(); i++){
|
|
|
buildItem = buildArray.getJSONObject(i);
|
|
|
- buildMap.put(buildItem.getString("id"), buildItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_build));
|
|
|
+ buildMap.put(buildItem.getString("id"), buildItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_build));
|
|
|
}
|
|
|
//处理楼层数据
|
|
|
floorArray = floorJson.getJSONArray("Content");
|
|
|
for(int i=0; i<floorArray.size(); i++){
|
|
|
floorItem = floorArray.getJSONObject(i);
|
|
|
- floorMap.put(floorItem.getString("id"), floorItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_floor));
|
|
|
+ floorMap.put(floorItem.getString("id"), floorItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_floor));
|
|
|
}
|
|
|
//处理空间数据
|
|
|
spaceArray = spaceJson.getJSONArray("Content");
|
|
@@ -939,8 +941,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
space = new JSONObject();
|
|
|
spaceId = spaceItem.getString("id");
|
|
|
if(needBack){
|
|
|
- //floorId = StringUtil.transferId(spaceId, SopCommonConst.tag_floor);
|
|
|
- //buildId = StringUtil.transferId(spaceId, SopCommonConst.tag_build);
|
|
|
+ //floorId = StringUtil.transferId(spaceId, CommonConstant.tag_floor);
|
|
|
+ //buildId = StringUtil.transferId(spaceId, CommonConstant.tag_build);
|
|
|
floorId = spaceId_location.get(spaceId) == null ? null : spaceId_location.get(spaceId).getString("floor");
|
|
|
buildId = spaceId_location.get(spaceId) == null ? null : spaceId_location.get(spaceId).getString("building");
|
|
|
if(floorMap.containsKey(floorId)){
|
|
@@ -951,8 +953,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
space.put("parents", JSONArray.parseArray(parentStr));
|
|
|
}
|
|
|
space.put("obj_id", spaceId);
|
|
|
- space.put("obj_name", spaceItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_space));
|
|
|
- space.put("obj_code", spaceItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_id_space));
|
|
|
+ space.put("obj_name", spaceItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_space));
|
|
|
+ space.put("obj_code", spaceItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_id_space));
|
|
|
spaces.add(space);
|
|
|
}
|
|
|
resultStr = ToolsUtil.successJsonMsg(spaces);
|
|
@@ -1018,12 +1020,12 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
systemItem = systemArray.getJSONObject(i);
|
|
|
system = new JSONObject();
|
|
|
systemId = systemItem.getString("id");
|
|
|
- systemName = systemItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_system);
|
|
|
+ systemName = systemItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_system);
|
|
|
String category = systemItem.getString("category");
|
|
|
systemClass = category == null || category.length() < 2 ? null : category.substring(0, 2);
|
|
|
system.put("obj_id", systemId);
|
|
|
system.put("obj_name", systemName);
|
|
|
- system.put("obj_code", systemItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_id_system));
|
|
|
+ system.put("obj_code", systemItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_id_system));
|
|
|
//位置信息(所属建筑)
|
|
|
system.put("location", systemItem.getJSONObject("location"));
|
|
|
systemList = systemMap.getOrDefault(systemClass, new ArrayList<String>());
|
|
@@ -1034,7 +1036,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
buildArray = buildJson.getJSONArray("Content");
|
|
|
for(int i=0; i<buildArray.size(); i++){
|
|
|
buildItem = buildArray.getJSONObject(i);
|
|
|
- buildMap.put(buildItem.getString("id"), buildItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_build));
|
|
|
+ buildMap.put(buildItem.getString("id"), buildItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_build));
|
|
|
}
|
|
|
//处理数据字典
|
|
|
dictArray = dictJson.getJSONArray("Content");
|
|
@@ -1061,7 +1063,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
for(String systemObj : systemList){
|
|
|
system = JSONObject.parseObject(systemObj);
|
|
|
systemId = system.getString("obj_id");
|
|
|
- //buildId = StringUtil.transferId(systemId, SopCommonConst.tag_build);
|
|
|
+ //buildId = StringUtil.transferId(systemId, CommonConstant.tag_build);
|
|
|
buildId = systemId_location.get(systemId) == null ? null : systemId_location.get(systemId).getString("building");
|
|
|
buildName = buildMap.get(buildId);
|
|
|
if(needBack){
|
|
@@ -1108,7 +1110,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
systemItem = systemArray.getJSONObject(i);
|
|
|
system = new JSONObject();
|
|
|
system.put("system_id", systemItem.getString("id"));
|
|
|
- system.put("system_name", systemItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_system));
|
|
|
+ system.put("system_name", systemItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_system));
|
|
|
systems.add(system);
|
|
|
}
|
|
|
resultStr = ToolsUtil.successJsonMsg(systems);
|
|
@@ -1152,9 +1154,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
for(int i = 0; i < objectArray.size(); i++) {
|
|
|
JSONObject queryContent= objectArray.getJSONObject(i);
|
|
|
String obj_id = queryContent.getString("id");
|
|
|
- if(obj_id.startsWith(SopCommonConst.tag_floor)) {
|
|
|
+ if(obj_id.startsWith(CommonConstant.tag_floor)) {
|
|
|
floorIdInContents.add(obj_id);
|
|
|
- }else if(obj_id.startsWith(SopCommonConst.tag_space)) {
|
|
|
+ }else if(obj_id.startsWith(CommonConstant.tag_space)) {
|
|
|
spaceIdInContents.add(obj_id);
|
|
|
}
|
|
|
}
|
|
@@ -1168,26 +1170,26 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
for(int i=0; i<objectArray.size(); i++){
|
|
|
objectItem = objectArray.getJSONObject(i);
|
|
|
objectId = objectItem.getString("id");
|
|
|
- floor_sequence_id = objectItem.getJSONObject(SopCommonConst.info_name_datas).getString("FloorSequenceID");
|
|
|
- if(objectId.startsWith(SopCommonConst.tag_build)){
|
|
|
+ floor_sequence_id = objectItem.getJSONObject(CommonConstant.info_name_datas).getString("FloorSequenceID");
|
|
|
+ if(objectId.startsWith(CommonConstant.tag_build)){
|
|
|
//建筑
|
|
|
- buildMap.put(objectId, objectItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_build));
|
|
|
- }else if(objectId.startsWith(SopCommonConst.tag_floor)){
|
|
|
+ buildMap.put(objectId, objectItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_build));
|
|
|
+ }else if(objectId.startsWith(CommonConstant.tag_floor)){
|
|
|
//楼层
|
|
|
- //buildId = StringUtil.transferId(objectId, SopCommonConst.tag_build);
|
|
|
+ //buildId = StringUtil.transferId(objectId, CommonConstant.tag_build);
|
|
|
buildId = floorId_location.get(objectId) == null ? null : floorId_location.get(objectId).get("building");
|
|
|
mapValues = relBuildStepObjectMap.get(buildId);
|
|
|
mapValues = mapValues == null ? new JSONArray() : mapValues;
|
|
|
mapValues.add(objectId);
|
|
|
relBuildStepObjectMap.put(buildId, mapValues);
|
|
|
- floorMap.put(objectId, objectItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_floor));
|
|
|
+ floorMap.put(objectId, objectItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_floor));
|
|
|
floorSequenceMap.put(objectId, floor_sequence_id);
|
|
|
- }else if(objectId.startsWith(SopCommonConst.tag_space)){
|
|
|
+ }else if(objectId.startsWith(CommonConstant.tag_space)){
|
|
|
//空间
|
|
|
- //floorId = StringUtil.transferId(objectId, SopCommonConst.tag_floor);
|
|
|
+ //floorId = StringUtil.transferId(objectId, CommonConstant.tag_floor);
|
|
|
floorId = spaceId_location.get(objectId) == null ? null : spaceId_location.get(objectId).get("floor");
|
|
|
if(null != floorId && floorId.endsWith("000")){
|
|
|
- //buildId = StringUtil.transferId(objectId, SopCommonConst.tag_build);
|
|
|
+ //buildId = StringUtil.transferId(objectId, CommonConstant.tag_build);
|
|
|
buildId = spaceId_location.get(objectId) == null ? null : spaceId_location.get(objectId).get("building");
|
|
|
mapValues = relBuildStepObjectMap.get(buildId);
|
|
|
mapValues = mapValues == null ? new JSONArray() : mapValues;
|
|
@@ -1199,7 +1201,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
mapValues.add(objectId);
|
|
|
relFloorSpaceMap.put(floorId, mapValues);
|
|
|
}
|
|
|
- spaceMap.put(objectId, objectItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_space));
|
|
|
+ spaceMap.put(objectId, objectItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_space));
|
|
|
}
|
|
|
}
|
|
|
String stepObjectId, spaceId;
|
|
@@ -1215,7 +1217,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
for(int i=0; i<relStepObjects.size(); i++){
|
|
|
stepObjectId = relStepObjects.getString(i);
|
|
|
buildStepObject = new JSONObject();
|
|
|
- if(stepObjectId.startsWith(SopCommonConst.tag_floor)){
|
|
|
+ if(stepObjectId.startsWith(CommonConstant.tag_floor)){
|
|
|
//楼层
|
|
|
spaces = new JSONArray();
|
|
|
relSpaces = relFloorSpaceMap.getOrDefault(stepObjectId, new JSONArray());
|
|
@@ -1382,13 +1384,13 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
// 查询关系请求参数对象
|
|
|
params.clear();
|
|
|
// 项目下的 设备-空间 图实例id
|
|
|
- String graphIdOfEquipAndSPace = graphCache.getGraphIdByProjectIdAndGraph(projectId, SopCommonConst.graph_type_equip_in_space);
|
|
|
+ String graphIdOfEquipAndSPace = graphCache.getGraphIdByProjectIdAndGraph(projectId, CommonConstant.graph_type_equip_in_space);
|
|
|
|
|
|
if(!StringUtil.isNull(graphIdOfEquipAndSPace)) {
|
|
|
if(needBackParents) {
|
|
|
criteria.clear();
|
|
|
criteria.put("graph_id", graphIdOfEquipAndSPace);
|
|
|
- criteria.put("rel_type", SopCommonConst.relation_type_equip_in_space);
|
|
|
+ criteria.put("rel_type", CommonConstant.relation_type_equip_in_space);
|
|
|
if(!StringUtil.isNull(spaceId)){
|
|
|
criteria.put("to_id", spaceId);
|
|
|
}
|
|
@@ -1399,12 +1401,12 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
|
|
|
if(resultStr.contains("success")){
|
|
|
// resultStr 设备与空间关系查询的结果集
|
|
|
- eqid_spid_map = getRelationMap(resultStr, SopCommonConst.relation_from_id, SopCommonConst.relation_to_id);
|
|
|
+ eqid_spid_map = getRelationMap(resultStr, CommonConstant.relation_from_id, CommonConstant.relation_to_id);
|
|
|
}
|
|
|
}else if(!StringUtil.isNull(spaceId)) {
|
|
|
criteria.clear();
|
|
|
criteria.put("graph_id", graphIdOfEquipAndSPace);
|
|
|
- criteria.put("rel_type", SopCommonConst.relation_type_equip_in_space);
|
|
|
+ criteria.put("rel_type", CommonConstant.relation_type_equip_in_space);
|
|
|
criteria.put("to_id", spaceId);
|
|
|
params.put("criteria", criteria);
|
|
|
params.put("projectId", projectId);
|
|
@@ -1413,7 +1415,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
|
|
|
if(resultStr.contains("success")){
|
|
|
// resultStr 设备与空间关系查询的结果集
|
|
|
- eqid_spid_map = getRelationMap(resultStr, SopCommonConst.relation_from_id, SopCommonConst.relation_to_id);
|
|
|
+ eqid_spid_map = getRelationMap(resultStr, CommonConstant.relation_from_id, CommonConstant.relation_to_id);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1424,12 +1426,12 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
Map<String, String> eqid_syid_map = new HashMap<>();
|
|
|
// ------------------- 查询设备和系统关系 start---------------------- //
|
|
|
//项目下的设备-系统图实例id
|
|
|
- String graphIdOfEquipAndSystem = graphCache.getGraphIdByProjectIdAndGraph(projectId, SopCommonConst.graph_type_system_contain_equip);
|
|
|
+ String graphIdOfEquipAndSystem = graphCache.getGraphIdByProjectIdAndGraph(projectId, CommonConstant.graph_type_system_contain_equip);
|
|
|
if(!StringUtil.isNull(graphIdOfEquipAndSystem)){
|
|
|
if(needBackParents) {
|
|
|
criteria.clear();
|
|
|
criteria.put("graph_id", graphIdOfEquipAndSystem);
|
|
|
- criteria.put("rel_type", SopCommonConst.relation_type_system_contain_equip);
|
|
|
+ criteria.put("rel_type", CommonConstant.relation_type_system_contain_equip);
|
|
|
if(!StringUtil.isNull(systemId)){
|
|
|
criteria.put("from_id", systemId);
|
|
|
}
|
|
@@ -1441,12 +1443,12 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
|
|
|
if(resultStr.contains("success")){
|
|
|
// resultStr 设备与系统关系查询的结果集
|
|
|
- eqid_syid_map = getRelationMap(resultStr, SopCommonConst.relation_to_id, SopCommonConst.relation_from_id);
|
|
|
+ eqid_syid_map = getRelationMap(resultStr, CommonConstant.relation_to_id, CommonConstant.relation_from_id);
|
|
|
}
|
|
|
}else if(!StringUtil.isNull(systemId)) {
|
|
|
criteria.clear();
|
|
|
criteria.put("graph_id", graphIdOfEquipAndSystem);
|
|
|
- criteria.put("rel_type", SopCommonConst.relation_type_system_contain_equip);
|
|
|
+ criteria.put("rel_type", CommonConstant.relation_type_system_contain_equip);
|
|
|
criteria.put("from_id", systemId);
|
|
|
params.clear();
|
|
|
params.put("criteria", criteria);
|
|
@@ -1456,7 +1458,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
|
|
|
if(resultStr.contains("success")){
|
|
|
// resultStr 设备与系统关系查询的结果集
|
|
|
- eqid_syid_map = getRelationMap(resultStr, SopCommonConst.relation_to_id, SopCommonConst.relation_from_id);
|
|
|
+ eqid_syid_map = getRelationMap(resultStr, CommonConstant.relation_to_id, CommonConstant.relation_from_id);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1581,7 +1583,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
relSystemName = objectIdNameMap.get(relSystemId);
|
|
|
// 专业编码
|
|
|
domainId = syid_domaincode_map.get(relSystemId);
|
|
|
- domainName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, domainId);
|
|
|
+ domainName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, domainId);
|
|
|
if (domainId != null) {
|
|
|
parentIds.add(domainId);
|
|
|
}
|
|
@@ -1606,8 +1608,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
equip.put("parents", parents);
|
|
|
}
|
|
|
equip.put("obj_id", equipId);
|
|
|
- equip.put("obj_name", equipItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_name_equip));
|
|
|
- equip.put("obj_code", equipItem.getJSONObject(SopCommonConst.info_name_datas).getString(SopCommonConst.info_name_local_id_equip));
|
|
|
+ equip.put("obj_name", equipItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_name_equip));
|
|
|
+ equip.put("obj_code", equipItem.getJSONObject(CommonConstant.info_name_datas).getString(CommonConstant.info_name_local_id_equip));
|
|
|
equips.add(equip);
|
|
|
}
|
|
|
resultStr = ToolsUtil.successJsonMsg(equips);
|
|
@@ -1737,7 +1739,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
info = new JSONObject();
|
|
|
parents = new JSONArray();
|
|
|
infoType = infoItem.getString("type");
|
|
|
- if(SopCommonConst.tag_equip.equals(infoType)){
|
|
|
+ if(CommonConstant.tag_equip.equals(infoType)){
|
|
|
//设备大类信息点
|
|
|
parents = new JSONArray();
|
|
|
infoPoint = new JSONObject();
|
|
@@ -1746,7 +1748,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
parentIds = new JSONArray();
|
|
|
parentNames = new JSONArray();
|
|
|
parentId = infoItem.getString("major");
|
|
|
- parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
|
|
|
+ parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
|
|
|
if(!StringUtil.isNull(parentId, parentName)) {
|
|
|
parentIds.add(parentId);
|
|
|
parentNames.add(parentName);
|
|
@@ -1770,7 +1772,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
info.put("obj_type", "equip_class");
|
|
|
info.put("parents", parents);
|
|
|
info.put("info_point", infoPoint);
|
|
|
- }else if(SopCommonConst.tag_system.equals(infoType)){
|
|
|
+ }else if(CommonConstant.tag_system.equals(infoType)){
|
|
|
//系统大类信息点
|
|
|
parents = new JSONArray();
|
|
|
infoPoint = new JSONObject();
|
|
@@ -1779,7 +1781,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
parentIds = new JSONArray();
|
|
|
parentNames = new JSONArray();
|
|
|
parentId = infoItem.getString("major");
|
|
|
- parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
|
|
|
+ parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
|
|
|
if(!StringUtil.isNull(parentId, parentName)) {
|
|
|
parentIds.add(parentId);
|
|
|
parentNames.add(parentName);
|
|
@@ -1797,7 +1799,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
info.put("obj_type", "system_class");
|
|
|
info.put("parents", parents);
|
|
|
info.put("info_point", infoPoint);
|
|
|
- }else if(SopCommonConst.tag_equip_object.equals(infoType)){
|
|
|
+ }else if(CommonConstant.tag_equip_object.equals(infoType)){
|
|
|
//设备对象信息点
|
|
|
parents = new JSONArray();
|
|
|
infoPoint = new JSONObject();
|
|
@@ -1808,7 +1810,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
parentIds = new JSONArray();
|
|
|
parentNames = new JSONArray();
|
|
|
parentId = infoItem.getString("major");
|
|
|
- parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
|
|
|
+ parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
|
|
|
if (!StringUtil.isNull(parentId, parentName)) {
|
|
|
parentIds.add(parentId);
|
|
|
parentNames.add(parentName);
|
|
@@ -1850,7 +1852,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
parents.add(parent);
|
|
|
|
|
|
//处理信息点
|
|
|
- infoPoint.put("id", "equip_" + getEquipOrSystemCodeFromId(infoItem.getString("eqObj"), SopCommonConst.tag_dict_equip, dataPlatBasePath) + "_" + infoItem.getString("info"));
|
|
|
+ infoPoint.put("id", "equip_" + getEquipOrSystemCodeFromId(infoItem.getString("eqObj"), CommonConstant.tag_dict_equip, dataPlatBasePath) + "_" + infoItem.getString("info"));
|
|
|
infoPoint.put("code", infoItem.getString("info"));
|
|
|
infoPoint.put("name", infoItem.getString("infoName"));
|
|
|
|
|
@@ -1859,7 +1861,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
info.put("obj_type", "equip");
|
|
|
info.put("parents", parents);
|
|
|
info.put("info_point", infoPoint);
|
|
|
- }else if(SopCommonConst.tag_system_object.equals(infoType)){
|
|
|
+ }else if(CommonConstant.tag_system_object.equals(infoType)){
|
|
|
//系统对象信息点
|
|
|
parents = new JSONArray();
|
|
|
infoPoint = new JSONObject();
|
|
@@ -1868,7 +1870,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
parentIds = new JSONArray();
|
|
|
parentNames = new JSONArray();
|
|
|
parentId = infoItem.getString("major");
|
|
|
- parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
|
|
|
+ parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
|
|
|
if(!StringUtil.isNull(parentId, parentName)) {
|
|
|
parentIds.add(parentId);
|
|
|
parentNames.add(parentName);
|
|
@@ -1890,7 +1892,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
parent.put("parent_names", parentNames);
|
|
|
parents.add(parent);
|
|
|
//处理信息点
|
|
|
- infoPoint.put("id", "system_" + getEquipOrSystemCodeFromId(infoItem.getString("sysObj"), SopCommonConst.tag_dict_sytstem, dataPlatBasePath) + "_" + infoItem.getString("info"));
|
|
|
+ infoPoint.put("id", "system_" + getEquipOrSystemCodeFromId(infoItem.getString("sysObj"), CommonConstant.tag_dict_sytstem, dataPlatBasePath) + "_" + infoItem.getString("info"));
|
|
|
infoPoint.put("code", infoItem.getString("info"));
|
|
|
infoPoint.put("name", infoItem.getString("infoName"));
|
|
|
|
|
@@ -1901,7 +1903,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
info.put("info_point", infoPoint);
|
|
|
}
|
|
|
if(info.containsKey("info_point")
|
|
|
- && infoPointCache.isShowInApp(info.getJSONObject("info_point").getString("id"), infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ && infoPointCache.isShowInApp(info.getJSONObject("info_point").getString("id"), infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
infos.add(info);
|
|
|
}
|
|
|
}
|
|
@@ -1945,7 +1947,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
if(!StringUtil.isNull(keyword)){
|
|
|
keywords = keyword.split(" ");
|
|
|
}
|
|
|
- String systemType = getEquipOrSystemCodeFromId(systemId, SopCommonConst.tag_dict_sytstem, dataPlatBasePath);
|
|
|
+ String systemType = getEquipOrSystemCodeFromId(systemId, CommonConstant.tag_dict_sytstem, dataPlatBasePath);
|
|
|
String url = getDataPlatDictPath(DataRequestPathUtil.dataPlat_infoPoint_special, systemType);
|
|
|
// String infoStr = httpGetRequest(url);
|
|
|
String infoStr = httpPostRequestDataPlatform(url,"{}");
|
|
@@ -1959,9 +1961,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
- baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
+ baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -1974,11 +1976,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "system"+"_" +systemType+"_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
info.put("unit", infoItem.getString("unit"));
|
|
|
info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
|
|
|
info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
|
|
@@ -2000,7 +2002,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
if(!StringUtil.isNull(keyword)){
|
|
|
keywords = keyword.split(" ");
|
|
|
}
|
|
|
- String equipType = getEquipOrSystemCodeFromId(equipId, SopCommonConst.tag_dict_equip, dataPlatBasePath);
|
|
|
+ String equipType = getEquipOrSystemCodeFromId(equipId, CommonConstant.tag_dict_equip, dataPlatBasePath);
|
|
|
String url = getDataPlatDictPath(DataRequestPathUtil.dataPlat_infoPoint_special, equipType);
|
|
|
// String infoStr = httpGetRequest(url);
|
|
|
String infoStr = httpPostRequestDataPlatform(url,"{}");
|
|
@@ -2014,9 +2016,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
- baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
+ baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -2029,11 +2031,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "equip"+"_" +equipType+"_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
info.put("unit", infoItem.getString("unit"));
|
|
|
info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
|
|
|
info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
|
|
@@ -2067,9 +2069,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
- baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
+ baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -2082,11 +2084,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "system"+"_" +systemType+"_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
info.put("unit", infoItem.getString("unit"));
|
|
|
info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
|
|
|
info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
|
|
@@ -2121,9 +2123,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
- baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
+ baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -2136,11 +2138,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "shaft"+"_" +type+"_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
info.put("unit", infoItem.getString("unit"));
|
|
|
info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
|
|
|
info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
|
|
@@ -2175,9 +2177,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
- baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
+ baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -2190,11 +2192,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "build_0_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
info.put("unit", infoItem.getString("unit"));
|
|
|
info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
|
|
|
info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
|
|
@@ -2228,9 +2230,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
- baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
+ baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -2243,11 +2245,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "floor"+"_0_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
info.put("unit", infoItem.getString("unit"));
|
|
|
info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
|
|
|
if ("FloorIdentity".equals(code)) {
|
|
@@ -2282,8 +2284,8 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -2296,11 +2298,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "space_0_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
infos.add(info);
|
|
|
}
|
|
|
}
|
|
@@ -2330,9 +2332,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
- baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
+ baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -2345,11 +2347,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "space_0_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
info.put("unit", infoItem.getString("unit"));
|
|
|
info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
|
|
|
if ("RoomFuncType".equals(code) || "ProjRoomFuncType".equals(code)) {
|
|
@@ -2388,9 +2390,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infos = new JSONArray();
|
|
|
for(int i=0; i<infoArray.size(); i++){
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
- code = infoItem.getString(SopCommonConst.info_name_info_point_code);
|
|
|
- name = infoItem.getString(SopCommonConst.info_name_info_point_name);
|
|
|
- baseCmpt = infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt);
|
|
|
+ code = infoItem.getString(CommonConstant.info_name_info_point_code);
|
|
|
+ name = infoItem.getString(CommonConstant.info_name_info_point_name);
|
|
|
+ baseCmpt = infoItem.getString(CommonConstant.info_name_info_point_baseCmpt);
|
|
|
boolean flag = true;
|
|
|
if(keywords != null){
|
|
|
for(String key : keywords){
|
|
@@ -2403,11 +2405,11 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
continue;
|
|
|
}
|
|
|
id = "equip"+"_" +equipType+"_"+code;
|
|
|
- if(infoPointCache.isShowInApp(id, infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ if(infoPointCache.isShowInApp(id, infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
info = new JSONObject();
|
|
|
info.put("id", id);
|
|
|
info.put("code", code);
|
|
|
- info.put("name", infoItem.getString(SopCommonConst.info_name_info_point_name));
|
|
|
+ info.put("name", infoItem.getString(CommonConstant.info_name_info_point_name));
|
|
|
info.put("unit", infoItem.getString("unit"));
|
|
|
info.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(baseCmpt));
|
|
|
info.put("cmpt_data", getInfoPointCmptData(infoItem.get("dataSource"), info.getString("name"), cmptDataMap ));
|
|
@@ -2517,21 +2519,21 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
results = resultJson.getJSONArray("Content");
|
|
|
for(int i=0; i<results.size(); i++){
|
|
|
result = results.getJSONObject(i);
|
|
|
- infoDatas = result.getJSONObject(SopCommonConst.info_name_datas);
|
|
|
- if(infoDatas.containsKey(SopCommonConst.info_name_local_name_project)){
|
|
|
- localName = infoDatas.getString(SopCommonConst.info_name_local_name_project);
|
|
|
- }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_build)){
|
|
|
- localName = infoDatas.getString(SopCommonConst.info_name_local_name_build);
|
|
|
- }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_floor)){
|
|
|
- localName = infoDatas.getString(SopCommonConst.info_name_local_name_floor);
|
|
|
- }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_space)){
|
|
|
- localName = infoDatas.getString(SopCommonConst.info_name_local_name_space);
|
|
|
- }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_equip)){
|
|
|
- localName = infoDatas.getString(SopCommonConst.info_name_local_name_equip);
|
|
|
- }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_system)){
|
|
|
- localName = infoDatas.getString(SopCommonConst.info_name_local_name_system);
|
|
|
- }else if(infoDatas.containsKey(SopCommonConst.info_name_local_name_shaft)){
|
|
|
- localName = infoDatas.getString(SopCommonConst.info_name_local_name_shaft);
|
|
|
+ infoDatas = result.getJSONObject(CommonConstant.info_name_datas);
|
|
|
+ if(infoDatas.containsKey(CommonConstant.info_name_local_name_project)){
|
|
|
+ localName = infoDatas.getString(CommonConstant.info_name_local_name_project);
|
|
|
+ }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_build)){
|
|
|
+ localName = infoDatas.getString(CommonConstant.info_name_local_name_build);
|
|
|
+ }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_floor)){
|
|
|
+ localName = infoDatas.getString(CommonConstant.info_name_local_name_floor);
|
|
|
+ }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_space)){
|
|
|
+ localName = infoDatas.getString(CommonConstant.info_name_local_name_space);
|
|
|
+ }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_equip)){
|
|
|
+ localName = infoDatas.getString(CommonConstant.info_name_local_name_equip);
|
|
|
+ }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_system)){
|
|
|
+ localName = infoDatas.getString(CommonConstant.info_name_local_name_system);
|
|
|
+ }else if(infoDatas.containsKey(CommonConstant.info_name_local_name_shaft)){
|
|
|
+ localName = infoDatas.getString(CommonConstant.info_name_local_name_shaft);
|
|
|
}
|
|
|
idNameMap.put(result.getString("id"), localName);
|
|
|
}
|
|
@@ -2585,7 +2587,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
array = array == null ? new JSONArray() : array;
|
|
|
for(int i=0; i<array.size(); i++){
|
|
|
JSONObject item = array.getJSONObject(i);
|
|
|
- map.put(item.getString("id"), item.getJSONObject(SopCommonConst.info_name_datas).getString(localName));
|
|
|
+ map.put(item.getString("id"), item.getJSONObject(CommonConstant.info_name_datas).getString(localName));
|
|
|
}
|
|
|
return map;
|
|
|
}
|
|
@@ -3394,7 +3396,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
String objId = clazz.getString("obj_id");
|
|
|
String objType = clazz.getString("obj_type");
|
|
|
boolean containScopeFlag = false;
|
|
|
- if (SopCommonConst.data_type_equip_class.equals(objType) && !StringUtil.isEmptyList(clazz, "space_scope")) {
|
|
|
+ if (CommonConstant.data_type_equip_class.equals(objType) && !StringUtil.isEmptyList(clazz, "space_scope")) {
|
|
|
JSONObject spaceClazz = clazz.getJSONArray("space_scope").getJSONObject(0);
|
|
|
containScopeFlag = true;
|
|
|
objId = spaceClazz.getString("obj_id");
|
|
@@ -3444,7 +3446,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
JSONObject equip = (JSONObject) object;
|
|
|
id2equip.put(equip.getString("obj_id"), equip);
|
|
|
}
|
|
|
- String graphId = graphCache.getGraphIdByProjectIdAndGraph(projectId, SopCommonConst.graph_type_equip_in_space);
|
|
|
+ String graphId = graphCache.getGraphIdByProjectIdAndGraph(projectId, CommonConstant.graph_type_equip_in_space);
|
|
|
for (Object object : spaceObjs) {
|
|
|
JSONObject space = (JSONObject) object;
|
|
|
String spaceId = space.getString("obj_id");
|
|
@@ -3468,9 +3470,9 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
}
|
|
|
|
|
|
private JSONArray querySpaceOrEquipByType(String projectId, String id , String type) throws Exception {
|
|
|
- if (SopCommonConst.data_type_equip_class.equals(type)) {
|
|
|
+ if (CommonConstant.data_type_equip_class.equals(type)) {
|
|
|
return queryEquipByType(projectId, id);
|
|
|
- }else if (SopCommonConst.data_type_space_class.equals(type)) {
|
|
|
+ }else if (CommonConstant.data_type_space_class.equals(type)) {
|
|
|
return querySpaceByType(projectId, id);
|
|
|
}
|
|
|
return new JSONArray();
|
|
@@ -4054,7 +4056,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
infoItem = infoArray.getJSONObject(i);
|
|
|
info = new JSONObject();
|
|
|
infoType = infoItem.getString("type");
|
|
|
- if(SopCommonConst.tag_equip.equals(infoType)){
|
|
|
+ if(CommonConstant.tag_equip.equals(infoType)){
|
|
|
//设备大类信息点
|
|
|
parents = new JSONArray();
|
|
|
infoPoint = new JSONObject();
|
|
@@ -4063,7 +4065,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
parentIds = new JSONArray();
|
|
|
parentNames = new JSONArray();
|
|
|
parentId = infoItem.getString("major");
|
|
|
- parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
|
|
|
+ parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
|
|
|
if(!StringUtil.isNull(parentId, parentName)) {
|
|
|
parentIds.add(parentId);
|
|
|
parentNames.add(parentName);
|
|
@@ -4089,7 +4091,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
info.put("obj_type", "equip_class");
|
|
|
info.put("parents", parents);
|
|
|
info.put("info_point", infoPoint);
|
|
|
- }else if(SopCommonConst.tag_system.equals(infoType)){
|
|
|
+ }else if(CommonConstant.tag_system.equals(infoType)){
|
|
|
//系统大类信息点
|
|
|
parents = new JSONArray();
|
|
|
infoPoint = new JSONObject();
|
|
@@ -4098,7 +4100,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
parentIds = new JSONArray();
|
|
|
parentNames = new JSONArray();
|
|
|
parentId = infoItem.getString("major");
|
|
|
- parentName = dictionaryCache.getNameByTypeCode(SopCommonConst.dict_type_object_domain, parentId);
|
|
|
+ parentName = dictionaryCache.getNameByTypeCode(CommonConstant.dict_type_object_domain, parentId);
|
|
|
if(!StringUtil.isNull(parentId, parentName)) {
|
|
|
parentIds.add(parentId);
|
|
|
parentNames.add(parentName);
|
|
@@ -4121,7 +4123,7 @@ public class ObjectServiceImpl extends BaseService implements IObjectService {
|
|
|
info.put("info_point", infoPoint);
|
|
|
}
|
|
|
if(info.containsKey("info_point")
|
|
|
- && infoPointCache.isShowInApp(info.getJSONObject("info_point").getString("id"), infoItem.getString(SopCommonConst.info_name_info_point_baseCmpt))){
|
|
|
+ && infoPointCache.isShowInApp(info.getJSONObject("info_point").getString("id"), infoItem.getString(CommonConstant.info_name_info_point_baseCmpt))){
|
|
|
infoPoint = info.getJSONObject("info_point");
|
|
|
infoPoint.put("cmpt", componentRelationCache.getAppComponentCodeByBaseCmptCode(infoItem.getString("inputMode")));
|
|
|
}
|