浏览代码

Merge remote-tracking branch 'origin/develop' into develop

lijie 3 年之前
父节点
当前提交
dfe611f9d0

+ 6 - 11
src/main/java/com/persagy/proxy/object/controller/AdmSystemController.java

@@ -32,6 +32,7 @@ import com.persagy.proxy.adm.utils.AdmQueryCriteriaHelper;
 import com.persagy.proxy.adm.utils.ObjectNameUtil;
 import com.persagy.proxy.common.entity.RelationDTO;
 import com.persagy.proxy.object.model.*;
+import com.persagy.proxy.object.service.IAdmEquipmentService;
 import com.persagy.proxy.object.service.IAdmProjectService;
 import com.persagy.proxy.object.service.IAdmSystemService;
 import com.persagy.proxy.report.model.SystemPointExcel;
@@ -65,6 +66,8 @@ public class AdmSystemController {
     private IAdmRelationService relationService;
     @Autowired
     private IAdmProjectService projectService;
+    @Autowired
+    private IAdmEquipmentService equipmentService;
 
     /**
      * 统计
@@ -277,18 +280,10 @@ public class AdmSystemController {
      */
     @PostMapping("/un-sys-equip")
     public AdmResponse queryUnEquip( @NotNull @QueryParam("sysId") String sysId,
-                                     @RequestBody AdmQueryCriteria request) throws Exception {
-        //AdmResponse admResponse = queryObjectByType(sysId,request,"Sy2Eq","MechSubset", AdmEquipment.OBJ_TYPE);
-        ObjectNode relationTo = JsonNodeFactory.instance.objectNode();
-        relationTo.put("objFrom", sysId);
-        relationTo.put("relCode", "Sy2Eq");
-        relationTo.put("graphCode", "MechSubset");
-        relationTo.put("$bindFlag", false);
-        request.setRelationTo(relationTo);
+                                     @RequestBody AdmQueryCriteria request) {
         request.setName(AdmEquipment.OBJ_TYPE);
-        QueryCriteria queryCriteriaObj = AdmQueryCriteriaHelper.toDmpCriteria(request);
-        List<ObjectNode> obj = DigitalObjectFacade.query(AdmContextUtil.toDmpContext().getGroupCode(),AdmContextUtil.toDmpContext().getProjectId(), AdmContextUtil.toDmpContext().getAppId(), null, queryCriteriaObj);
-        return AdmResponse.success(obj,request);
+        request.resetRelationCond(false, "MechSubset", "Sy2Eq", sysId, false);
+        return equipmentService.doQuery(AdmContextUtil.toDmpContext(), request, AdmEquipment.class);
     }
 
 

+ 6 - 3
src/main/java/com/persagy/proxy/object/service/impl/AdmEquipmentServiceImpl.java

@@ -112,7 +112,10 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
     @Override
     public List<AdmEquipment> doUpdate(InstanceUrlParam context, Class<AdmEquipment> clazz, List<AdmEquipment> voList) {
         processFloorRelations(context, voList, false);
-        return super.doUpdate(context, clazz, voList);
+        List<AdmEquipment> equipmentList = super.doUpdate(context, clazz, voList);
+        // 处理关系标记
+        processRelationType(equipmentList);
+        return equipmentList;
     }
 
     @Override
@@ -413,11 +416,11 @@ public class AdmEquipmentServiceImpl extends AbstractAdmBaseServiceImpl<AdmEquip
 
     @Override
     public void processRelationType(List<AdmEquipment> vos) {
-        admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
+       /* admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
                 CollUtil.newArrayList(
                         AdmRelationTypeEnum.PE2BD,
                         AdmRelationTypeEnum.PE2FL,
                         AdmRelationTypeEnum.PE2SH,
-                        AdmRelationTypeEnum.PE2SP),null);
+                        AdmRelationTypeEnum.PE2SP),null);*/
     }
 }

+ 3 - 2
src/main/java/com/persagy/proxy/object/service/impl/AdmFloorServiceImpl.java

@@ -94,15 +94,16 @@ public class AdmFloorServiceImpl extends AbstractAdmBaseServiceImpl<AdmFloor> im
          listtype.add("pe2fl")
          */
         admRelCalService.calcRelation(AdmContextUtil.toDmpContext(),
+                //暂不支持资产的关系计算
                 CollUtil.newArrayList(
                         AdmRelationTypeEnum.SH2BD,
                         AdmRelationTypeEnum.BD2SP,
                         AdmRelationTypeEnum.FL2SP,
                         AdmRelationTypeEnum.SYEQ2BD,
                         AdmRelationTypeEnum.SY2FL,
-                        AdmRelationTypeEnum.EQ2FL,
+                        AdmRelationTypeEnum.EQ2FL/*,
                         AdmRelationTypeEnum.PE2BD,
-                        AdmRelationTypeEnum.PE2FL
+                        AdmRelationTypeEnum.PE2FL*/
                 ),
                 null);
     }