Browse Source

合并重复代码

lijie 3 years ago
parent
commit
0aab939597

+ 1 - 1
src/main/java/com/persagy/proxy/adm/service/impl/AbstractAdmBaseServiceImpl.java

@@ -95,7 +95,7 @@ public class AbstractAdmBaseServiceImpl<T> implements IAdmBaseService<T> {
      * Update By lijie 2021/10/28 20:23
      */
     protected void processDmpCriteria(QueryCriteria dmpRequest) {
-        // 空方法,防止子类重写
+        // 空方法,需要时子类重写
     }
 
     /**

+ 0 - 1
src/main/java/com/persagy/proxy/object/service/IAdmEquipmentService.java

@@ -50,7 +50,6 @@ public interface IAdmEquipmentService extends IAdmBaseService<AdmEquipment> {
      * @param vos
      */
     void ensureSpecialValues(InstanceUrlParam context, List<AdmEquipment> vos);
-    void processDmpCriteria(QueryCriteria dmpRequest);
     /***
      * Description: 将原来重写的doQuery方法改为该方法,用于使用钩子方法调整查询参数
      * @param admQueryCriteria : 请求参数

+ 0 - 34
src/main/java/com/persagy/proxy/object/service/impl/AdmEquipmentServiceImpl.java

@@ -193,40 +193,6 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
         }
     }
 
-    /**
-     * 设备按照楼层id建筑id查询
-     * @param dmpRequest : 中台查询参数
-     */
-    @Override
-    public void processDmpCriteria(QueryCriteria dmpRequest) {
-        ObjectNode criteria = dmpRequest.getCriteria();
-        if (null==criteria){
-            return;
-        }
-        if (criteria.has("floorId") && criteria.has("buildingId")){
-            // 有建筑id过滤
-            ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-            ObjectNode relationFrom = objectMapper.createObjectNode();
-            relationFrom.put("graphCode", GraphCodeEnum.MechInArch.name());
-            relationFrom.put("relCode", RelCodeEnum.Eq2Fl.name());
-            relationFrom.set("objTo",criteria.get("floorId"));
-            criteria.set("relationFrom",relationFrom);
-            criteria.remove("floorId");
-            criteria.remove("buildingId");
-            return;
-        }
-        if (criteria.has("buildingId")){
-            // 有建筑id过滤
-            ObjectMapper objectMapper = SpringHelper.getBean(ObjectMapper.class);
-            ObjectNode relationFrom = objectMapper.createObjectNode();
-            relationFrom.put("graphCode", GraphCodeEnum.MechInArch.name());
-            relationFrom.put("relCode", RelCodeEnum.Eq2Bd.name());
-            relationFrom.set("objTo",criteria.get("buildingId"));
-            criteria.set("relationFrom",relationFrom);
-            criteria.remove("buildingId");
-        }
-    }
-
     private DmpResult<List<ObjRelationDTO>> queryRelation(InstanceUrlParam context, Map<String, AdmEquipment> voMap){
         QueryCriteria dmpRequest = new QueryCriteria();
         ObjectNode criteria = JsonNodeFactory.instance.objectNode();