AdmSpaceServiceImpl.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. package com.persagy.proxy.adm.service.impl;
  2. import cn.hutool.core.collection.CollUtil;
  3. import cn.hutool.core.util.StrUtil;
  4. import cn.hutool.json.JSONUtil;
  5. import com.alibaba.fastjson.JSONArray;
  6. import com.alibaba.fastjson.JSONObject;
  7. import com.fasterxml.jackson.core.JsonProcessingException;
  8. import com.fasterxml.jackson.databind.ObjectMapper;
  9. import com.fasterxml.jackson.databind.node.ArrayNode;
  10. import com.fasterxml.jackson.databind.node.JsonNodeFactory;
  11. import com.fasterxml.jackson.databind.node.ObjectNode;
  12. import com.persagy.dmp.basic.model.QueryCriteria;
  13. import com.persagy.dmp.common.model.entity.BaseEntity;
  14. import com.persagy.dmp.define.entity.ObjectTypeDefine;
  15. import com.persagy.proxy.adm.model.*;
  16. import com.persagy.proxy.adm.request.AdmResponse;
  17. import com.persagy.proxy.adm.service.IAdmSpaceService;
  18. import com.persagy.proxy.adm.utils.AdmQueryCriteriaHelper;
  19. import com.persagy.proxy.common.client.DmpRwdClient;
  20. import com.persagy.proxy.common.entity.DmpResult;
  21. import com.persagy.proxy.common.entity.InstanceUrlParam;
  22. import com.persagy.proxy.common.entity.ObjRelationDTO;
  23. import lombok.extern.slf4j.Slf4j;
  24. import org.springframework.beans.factory.annotation.Autowired;
  25. import org.springframework.stereotype.Service;
  26. import java.util.*;
  27. import java.util.stream.Collectors;
  28. /**
  29. * ADM 空间 实现类
  30. * @author lvxy
  31. * @date 2021/8/18
  32. */
  33. @Slf4j
  34. @Service
  35. public class AdmSpaceServiceImpl extends AbstractAdmBaseServiceImpl<AdmSpace> implements IAdmSpaceService {
  36. @Autowired
  37. private DmpRwdClient rwdClient;
  38. @Autowired
  39. private ObjectMapper objectMapper;
  40. @Override
  41. public List<AdmSpace> doInsertExt(InstanceUrlParam context, Class<AdmSpace> clazz, List<AdmSpace> voList) {
  42. Map<String, AdmSpace> spaceIdMap = CollUtil.fieldValueMap(voList, BaseEntity.PROP_ID);
  43. //key spid, value floorId
  44. Map<String, String> spId2FlId_map = voList.stream().filter(admSpace -> StrUtil.isNotEmpty(admSpace.getFloorId())).collect(Collectors.toMap(AdmSpace::getId,AdmSpace::getFloorId));
  45. //查询空间中floorId 对应的floor
  46. DmpResult<JSONArray> floors = queryFloorsByFloorIds(context, spId2FlId_map.values());
  47. ArrayList<AdmFloor> floorList = CollUtil.newArrayList(JSONUtil.toList(floors.getData().toString(),AdmFloor.class));
  48. //space.height = floor.infos.height
  49. List<AdmSpace> vos = processHeight(spaceIdMap, floorList, spId2FlId_map);
  50. //插入空间
  51. List<AdmSpace> vosR = doInsert(context, clazz, vos);
  52. //添加绑定关系
  53. DmpResult<List<ObjRelationDTO>> dmpResult = processRelations(context, vosR);
  54. //处理关系标记
  55. //TODO 处理关系标记
  56. //processRelationType();
  57. return doInsert(context, clazz, vosR);
  58. }
  59. @Override
  60. public AdmResponse doQueryType(InstanceUrlParam context, AdmDCSQueryRequest request) {
  61. //查询定义类型
  62. ObjectNode criteriaEq = JsonNodeFactory.instance.objectNode();
  63. criteriaEq.put("parentCode", "space");
  64. DmpResult<JSONArray> resultDef = queryDefineType(context, criteriaEq);
  65. List<JSONObject> defineList = null;
  66. if(resultDef.getResult().equals(DmpResult.SUCCESS)){
  67. defineList = JSONUtil.toList(resultDef.getData().toString(), JSONObject.class);
  68. //获取实际空间对象的数量
  69. //根据classCode floorId 查询查询实际存在的空间
  70. assembleDefineTypes(context, defineList, request.getFloorId());
  71. // 设置返回值
  72. AdmResponse response = AdmResponse.success(defineList);
  73. Long total = resultDef.getCount() == null ? null : resultDef.getCount().longValue();
  74. response.setTotal(total);
  75. return response;
  76. }else{
  77. return null;
  78. }
  79. }
  80. @Override
  81. public AdmResponse doQuerySpaces(InstanceUrlParam context, AdmDCSQueryRequest request) {
  82. QueryCriteria dmpRequest = AdmQueryCriteriaHelper.toDmpCriteria(request);
  83. //查询的时候,floorId,buildingId 按照空间对象的自定义信息点处理
  84. //TODO 这个ifelse判断是原来的代码实现,写此方法实现的时候不清楚实际业务,保留原来的判断,之后了解业务再根据业务调整
  85. DmpResult<JSONArray> dmpResult = new DmpResult<>();
  86. List spaceArray = new ArrayList();
  87. List<String> zoneTypeList = StrUtil.isNotEmpty(request.getZoneType()) ? CollUtil.newArrayList(request.getZoneType()) : request.getZoneTypeList();
  88. if(StrUtil.isNotEmpty(request.getBuildingId()) && StrUtil.isNotEmpty(request.getFloorId()) && !request.getFloorId().equals("isnull")){
  89. querySpaceByFl(dmpRequest,context, spaceArray, zoneTypeList, request.getFloorId(), "Fl2Sp");
  90. }else if(StrUtil.isNotEmpty(request.getBuildingId()) && StrUtil.isNotEmpty(request.getFloorId()) && request.getFloorId().equals("isnull")){
  91. QueryCriteria queryFloor = ensureQueryCommParm(dmpRequest,context, Arrays.asList("floor"), AdmFloor.OBJ_TYPE);
  92. ObjectNode criteriaFl = queryFloor.getCriteria();
  93. criteriaFl.put("buildingId", request.getBuildingId());
  94. queryFloor.setCriteria(criteriaFl);
  95. DmpResult<JSONArray> dmpResultFloors = queryObj(context, queryFloor);
  96. List<AdmFloor> floorList = JSONUtil.toList(JSONUtil.toJsonStr(dmpResultFloors.getData()), AdmFloor.class);
  97. Map<String, AdmFloor> floorMap = CollUtil.fieldValueMap(floorList, BaseEntity.PROP_ID);
  98. if(CollUtil.isNotEmpty(floorMap)){
  99. QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest, context, zoneTypeList, AdmSpace.OBJ_TYPE);
  100. ObjectNode criteriaPe = queryCriteria.getCriteria();
  101. JSONArray jsonArray = new JSONArray();
  102. floorMap.keySet().forEach(floorId -> jsonArray.add(floorId));
  103. criteriaPe.putPOJO("floorId", jsonArray);
  104. queryCriteria.setCriteria(criteriaPe);
  105. dmpResult = queryObj(context, queryCriteria);
  106. if(CollUtil.isNotEmpty(dmpResult.getData())){
  107. spaceArray.addAll(dmpResult.getData());
  108. }
  109. querySpaceByFl(dmpRequest, context, spaceArray, zoneTypeList, request.getBuildingId(), "Bd2Sp");
  110. }
  111. }else if(StrUtil.isNotEmpty(request.getBuildingId()) && StrUtil.isEmpty(request.getFloorId()) && !request.getBuildingId().equals("isnull")){
  112. querySpaceByFl(dmpRequest,context, spaceArray, zoneTypeList, request.getBuildingId(), "Bd2Sp");
  113. }else if(StrUtil.isNotEmpty(request.getBuildingId()) && StrUtil.isEmpty(request.getFloorId()) && request.getBuildingId().equals("isnull")){
  114. //未明确建筑
  115. QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest, context, zoneTypeList, "space");
  116. ObjectNode criteriaPe = queryCriteria.getCriteria();
  117. JSONObject isnull = new JSONObject();
  118. isnull.put("$null", true);
  119. criteriaPe.putPOJO("buildingId", isnull);
  120. queryCriteria.setCriteria(criteriaPe);
  121. dmpResult = queryObj(context, queryCriteria);
  122. if(CollUtil.isNotEmpty(dmpResult.getData())){
  123. spaceArray.addAll(dmpResult.getData());
  124. }
  125. }else if(StrUtil.isEmpty(request.getBuildingId()) && StrUtil.isEmpty(request.getFloorId())){
  126. QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest, context, zoneTypeList, "space");
  127. ObjectNode criteriaPe = queryCriteria.getCriteria();
  128. JSONObject isnull = new JSONObject();
  129. isnull.put("$null", false);
  130. criteriaPe.putPOJO("floorId", isnull);
  131. queryCriteria.setCriteria(criteriaPe);
  132. dmpResult = queryObj(context, queryCriteria);
  133. if(CollUtil.isNotEmpty(dmpResult.getData())){
  134. spaceArray.addAll(dmpResult.getData());
  135. }
  136. }
  137. //处理查询结果转化为目标返回值
  138. List<JSONObject> jsonObjects = new ArrayList<JSONObject>();
  139. if(CollUtil.isNotEmpty(spaceArray)){
  140. List<AdmSpace> spaceList = JSONUtil.toList(JSONUtil.toJsonStr(spaceArray), AdmSpace.class);
  141. Map<String, AdmSpace> admSpaceMap = CollUtil.fieldValueMap(spaceList, BaseEntity.PROP_ID);
  142. admSpaceMap.values().stream().forEach(admSpace -> {
  143. JSONObject jsonObject = new JSONObject();
  144. jsonObject.put("zoneType", admSpace.getClassCode());
  145. jsonObject.put("floorId", admSpace.getFloorId());
  146. jsonObjects.add(jsonObject);
  147. });
  148. }
  149. AdmResponse admResponse = new AdmResponse();
  150. admResponse.setContent(jsonObjects);
  151. admResponse.setTotal(jsonObjects.size()*1l);
  152. admResponse.setPageSize(request.getPageSize());
  153. admResponse.setPageNumber(request.getPageNumber());
  154. return admResponse;
  155. }
  156. /**
  157. * 根据信息点查询空间
  158. * @param context
  159. * @param spaceArray
  160. * @param zoneTypeList
  161. * @param objFrom flooIds / bulidingIds
  162. * @param relCode
  163. */
  164. private void querySpaceByFl(QueryCriteria dmpRequest, InstanceUrlParam context, List spaceArray, List<String> zoneTypeList, String objFrom, String relCode){
  165. QueryCriteria queryCriteria = ensureQueryCommParm(dmpRequest,context, zoneTypeList, AdmSpace.OBJ_TYPE);
  166. addRelationTo(queryCriteria,objFrom,relCode);
  167. DmpResult<JSONArray> dmpResult = queryObj(context, queryCriteria);
  168. if(CollUtil.isNotEmpty(dmpResult.getData())){
  169. spaceArray.addAll(dmpResult.getData());
  170. }
  171. }
  172. /**
  173. * 空间的类型是根据项目自定义的
  174. * 参见中心
  175. * @Select("SELECT s.object_type as type,d.name FROM zone_space_base s
  176. * LEFT JOIN dict.dict_space_project d ON s.object_type = d.id WHERE s.project_id = #{projectId} AND d.project_id = #{projectId}
  177. * GROUP BY object_type, d.name")
  178. * @param context
  179. * @return
  180. */
  181. @Override
  182. public List<JSONObject> doQuerySpaceTypes(InstanceUrlParam context) {
  183. //根据项目id查询空间类型
  184. Map<String, String> codeNameMap = queryProjectDefineType(context);
  185. if(CollUtil.isNotEmpty(codeNameMap)){
  186. //查询object
  187. JSONArray demObjs = queryAndDealObjs(context, codeNameMap.keySet());
  188. if(CollUtil.isNotEmpty(demObjs)){
  189. List<AdmSpace> spaceList = JSONArray.parseArray(JSONUtil.toJsonStr(demObjs), AdmSpace.class);
  190. Set<String> classCodes = spaceList.stream().map(space -> space.getClassCode()).collect(Collectors.toSet());
  191. if(CollUtil.isNotEmpty(classCodes)){
  192. codeNameMap.keySet().removeIf(code -> !classCodes.contains(code));
  193. }
  194. }
  195. }
  196. if(CollUtil.isNotEmpty(codeNameMap)){
  197. List<JSONObject> list = new ArrayList<>(codeNameMap.size());
  198. codeNameMap.keySet().stream().forEach(code ->{
  199. JSONObject jsonObject = new JSONObject();
  200. jsonObject.put("name",codeNameMap.get(code));
  201. jsonObject.put("code",code);
  202. list.add(jsonObject);
  203. });
  204. return list;
  205. }else{
  206. return null;
  207. }
  208. }
  209. private DmpResult<JSONArray> queryObj(InstanceUrlParam context, QueryCriteria criteriaObject){
  210. JSONObject paraPe = null;
  211. try {
  212. String paraStr = objectMapper.writeValueAsString(criteriaObject);
  213. paraPe = JSONObject.parseObject(paraStr);
  214. } catch (JsonProcessingException e) {
  215. throw new RuntimeException("转换查询条件出错:" + e.getMessage());
  216. }
  217. return rwdClient.queryObject(context, paraPe);
  218. }
  219. private QueryCriteria ensureQueryCommParm(QueryCriteria dmpRequest, InstanceUrlParam context, Collection<String> classCodes, String objType){
  220. ObjectNode criteriaEq = JsonNodeFactory.instance.objectNode();
  221. if(CollUtil.isNotEmpty(classCodes)){
  222. ArrayNode array = criteriaEq.putObject("classCode").putArray("$in");
  223. classCodes.forEach(code -> array.add(code));
  224. }
  225. criteriaEq.put("objType", objType);
  226. dmpRequest.setCriteria(criteriaEq);
  227. return dmpRequest;
  228. }
  229. private JSONArray queryAndDealObjs(InstanceUrlParam context, Set<String> codes){
  230. QueryCriteria criteriaObject = ensureQueryCommParm(new QueryCriteria(), context, codes,AdmSpace.OBJ_TYPE);
  231. criteriaObject.setSize(50L);
  232. DmpResult<JSONArray> dmpResult = queryObj(context, criteriaObject);
  233. if(CollUtil.isEmpty(dmpResult.getData())){
  234. return null;
  235. }
  236. JSONArray demObjs = dmpResult.getData();
  237. if(dmpResult.getCount() > criteriaObject.getSize()){
  238. for(int page = 2; page < dmpResult.getCount()/criteriaObject.getSize()+1; page++){
  239. criteriaObject.setPage(page*1L);
  240. demObjs.addAll(queryObj(context, criteriaObject).getData());
  241. }
  242. }
  243. return demObjs;
  244. }
  245. private Map<String, String> queryProjectDefineType(InstanceUrlParam context){
  246. Map<String, String> codeNameMap = null;
  247. ObjectNode criteriaEq = JsonNodeFactory.instance.objectNode();
  248. criteriaEq.put("projectId", context.getProjectId());
  249. criteriaEq.put("objType", AdmSpace.OBJ_TYPE);
  250. DmpResult<JSONArray> resultDef = queryDefineType(context, criteriaEq);
  251. if(resultDef.getResult().equals(DmpResult.SUCCESS) && CollUtil.isNotEmpty(resultDef.getData())){
  252. List<ObjectTypeDefine> defineList = JSONUtil.toList(resultDef.getData().toString(), ObjectTypeDefine.class);
  253. codeNameMap = defineList.stream().collect(Collectors.toMap(ObjectTypeDefine::getCode, ObjectTypeDefine::getName, (k1,k2)->k1));
  254. }
  255. return codeNameMap;
  256. }
  257. /**
  258. * 查询空间flooId对应的infos中height存在的 flool
  259. * @param context
  260. * @param floolIds
  261. * @return
  262. */
  263. private DmpResult<JSONArray> queryFloorsByFloorIds(InstanceUrlParam context, Collection<String> floolIds){
  264. QueryCriteria queryCriteria = ensureQueryCommParm(new QueryCriteria(),context, CollUtil.newArrayList("floor"),"floor");
  265. ObjectNode criteriaPe = queryCriteria.getCriteria();
  266. if(CollUtil.isNotEmpty(floolIds)){
  267. ArrayNode array = criteriaPe.putObject("id").putArray("$in");
  268. floolIds.forEach(floorId -> array.add(floorId));
  269. }
  270. JSONObject height = new JSONObject();
  271. height.put("$gt", 0f);
  272. criteriaPe.putPOJO("height", height);
  273. queryCriteria.setCriteria(criteriaPe);
  274. queryCriteria.setWithoutCount(true);
  275. return queryObj(context, queryCriteria);
  276. }
  277. /**
  278. * space.height = floor.infos.height
  279. * @param spaceIdMap
  280. * @param floorList
  281. * @param spId2FlId_map
  282. * @return
  283. */
  284. private List<AdmSpace> processHeight(Map<String, AdmSpace> spaceIdMap, List<AdmFloor> floorList, Map<String, String> spId2FlId_map){
  285. Map<String, String> newMap = spId2FlId_map.entrySet().stream().collect(Collectors.toMap(entry -> entry.getValue(), entry -> entry.getKey()));
  286. floorList.forEach(admFloor -> {
  287. if(CollUtil.isNotEmpty(admFloor.getInfos())){
  288. Float height = (Float) admFloor.getInfos().get("height");
  289. AdmSpace admSpace = spaceIdMap.get(newMap.get(admFloor.getId()));
  290. admSpace.setHeight(height);
  291. }
  292. });
  293. return (List<AdmSpace>) spaceIdMap.values();
  294. }
  295. /**
  296. * 添加绑定关系
  297. */
  298. private DmpResult<List<ObjRelationDTO>> processRelations(InstanceUrlParam context, List<AdmSpace> vosR){
  299. if(CollUtil.isNotEmpty(vosR)){
  300. JSONArray jsonArray = new JSONArray();
  301. vosR.forEach(admSpace -> {
  302. JSONObject requestData = new JSONObject();
  303. if (StrUtil.isNotEmpty(admSpace.getBuildingId())) {
  304. addXParam("Bd2Sp", admSpace.getBuildingId(), admSpace.getId(), requestData);
  305. addCommParam(context, requestData);
  306. jsonArray.add(requestData);
  307. }
  308. if (StrUtil.isNotEmpty(admSpace.getFloorId())) {
  309. addXParam("Fl2Sp", admSpace.getFloorId(), admSpace.getId(), requestData);
  310. addCommParam(context, requestData);
  311. jsonArray.add(requestData);
  312. }
  313. });
  314. DmpResult<List<ObjRelationDTO>> dmpResult = rwdClient.createObjRelations(context,jsonArray);
  315. return dmpResult;
  316. }else{
  317. return null;
  318. }
  319. }
  320. private JSONObject addXParam(String relCode, String masterObjType, String slaveObjType, JSONObject requestData){
  321. requestData.put("relCode", "Bd2Sp");
  322. requestData.put("masterObjType", masterObjType);
  323. requestData.put("slaveObjType", slaveObjType);
  324. return requestData;
  325. }
  326. private JSONObject addCommParam(InstanceUrlParam context, JSONObject requestData){
  327. requestData.put("sign", 1);
  328. requestData.put("graphCode", context.getGroupCode());
  329. requestData.put("projectId", context.getProjectId());
  330. return requestData;
  331. }
  332. /**
  333. * TODO 处理关系标记
  334. */
  335. private void processRelationType(InstanceUrlParam context, List<AdmSpace> vosR){
  336. String[] relationTypes = {"sp2sp_SpaceNeighborhood_5", "sp2sp_TrafficNetwork_1", "sp2sp_ConvectionNetwork_1", "sp2sp_RadiationNetwork_1"};
  337. List<String> listtype = Arrays.asList(relationTypes);
  338. JSONArray jsonArray = new JSONArray();
  339. listtype.forEach(type -> {
  340. JSONObject relationProjectCal = new JSONObject();
  341. addCommParam(context, relationProjectCal);
  342. //relationProjectCal.put("");
  343. });
  344. String relationType = "eq2sp_in";
  345. /**
  346. * val relationType = relationTypeProjectservice.select(SFilter.eq("projectId", projectId!!), SFilter.eq("relationType", "eq2sp_in"),SFilter.eq("zoneType", zoneSpace.classCode!!)).entity()
  347. * if (relationType!=null){
  348. * relationType.computationalState = 2
  349. * relationTypeProjectservice.update(relationType)
  350. * }
  351. */
  352. }
  353. /**
  354. * 清楚和空间关联的数据
  355. */
  356. private void deleteRelation(InstanceUrlParam context, String relCode, String ObjType){
  357. }
  358. /**
  359. * 转换为目标实体,并增加属性
  360. */
  361. private void assembleDefineTypes(InstanceUrlParam context, List<JSONObject> defineList, String floorId){
  362. boolean needCount = true;
  363. defineList.stream().forEach(defineType -> {
  364. //查询空间数量
  365. int count = needCount ? countSpace(context, defineType.getString("code"), floorId) : 0;
  366. //处理单个对象
  367. assembleDefineObj(defineType, count, context.getProjectId());
  368. });
  369. }
  370. /**
  371. * 单个转换为目标实体,并增加属性
  372. */
  373. private void assembleDefineObj(JSONObject defineType, int count, String projectId){
  374. defineType.put("count", count);
  375. defineType.put("projectId", projectId);
  376. defineType.remove("aliasName");
  377. defineType.remove("aliasCode");
  378. defineType.remove("valid");
  379. defineType.remove("objType");
  380. defineType.remove("groupCode");
  381. defineType.remove("parentCode");
  382. defineType.remove("id");
  383. }
  384. private void addRelationTo(QueryCriteria rwdQueryCriteria, String objFrom, String relCode){
  385. ObjectNode relationTO = JsonNodeFactory.instance.objectNode();
  386. relationTO.put("relCode", relCode);
  387. relationTO.put("objFrom", objFrom);
  388. ObjectNode criteria = rwdQueryCriteria.getCriteria();
  389. criteria.putPOJO("relationTo", relationTO);
  390. rwdQueryCriteria.setCriteria(criteria);
  391. }
  392. private void addRelationFrom(QueryCriteria rwdQueryCriteria, String objTo, String relCode){
  393. ObjectNode relationFrom = JsonNodeFactory.instance.objectNode();
  394. if(StrUtil.isNotEmpty(objTo)){
  395. relationFrom.put("objTo", objTo);
  396. }
  397. ObjectNode criteria = rwdQueryCriteria.getCriteria();
  398. criteria.putPOJO("relationFrom", relationFrom);
  399. rwdQueryCriteria.setCriteria(criteria);
  400. }
  401. /**
  402. * 查询存在空间的数量
  403. * @param context
  404. * @param classCode
  405. * @param objFrom
  406. * @return
  407. */
  408. private int countSpace(InstanceUrlParam context, String classCode, String objFrom){
  409. QueryCriteria queryCriteria = ensureQueryCommParm(new QueryCriteria(), context, CollUtil.newArrayList(classCode),"space");
  410. addRelationTo(queryCriteria, objFrom,"Fl2Sp");
  411. queryCriteria.setOnlyCount(true);
  412. DmpResult<JSONArray> dmpResult = queryObj(context, queryCriteria);
  413. return dmpResult.getCount();
  414. }
  415. private DmpResult<JSONArray> queryDefineType(InstanceUrlParam context, ObjectNode criteriaEq){
  416. QueryCriteria criteriaObject = new QueryCriteria();
  417. criteriaObject.setCriteria(criteriaEq);
  418. JSONObject paraPe = null;
  419. try {
  420. String paraStr = objectMapper.writeValueAsString(criteriaObject);
  421. paraPe = JSONObject.parseObject(paraStr);
  422. } catch (JsonProcessingException e) {
  423. throw new RuntimeException("查询公共定义的空间类型,转换查询条件出错:" + e.getMessage());
  424. }
  425. return rwdClient.queryDefClass(context, paraPe);
  426. }
  427. }