lvxianyun 3 سال پیش
والد
کامیت
e56b660bb4
1فایلهای تغییر یافته به همراه15 افزوده شده و 17 حذف شده
  1. 15 17
      src/main/java/com/persagy/proxy/relation/controller/RelationSyInFlController.java

+ 15 - 17
src/main/java/com/persagy/proxy/relation/controller/RelationSyInFlController.java

@@ -90,29 +90,27 @@ public class RelationSyInFlController {
         if (StringUtils.isBlank(sysId) || CollectionUtils.isEmpty(floorIdList)) {
             //return AdmResponse.failure("必填项:sysId(系统id)、floorIdList(楼层Id)");
             //兼容adm历史逻辑,若楼层id为空时,返回success
-            if(CollectionUtils.isEmpty(floorIdList) && !StringUtils.isBlank(sysId)){
-                //需要解绑关系
-                AdmRelationTypeEnum sy2fl = AdmRelationTypeEnum.SY2FL;
-                String graphCode = sy2fl.getGraphCode();
-                String relCode = sy2fl.getRelCode();
-                QueryCriteria queryCriteria = new QueryCriteria();
-                ObjectNode criteria = JsonNodeFactory.instance.objectNode();
-                criteria.put("graphCode", graphCode);
-                criteria.put("relCode", relCode);
-                criteria.put("objFrom", sysId);
-                queryCriteria.setCriteria(criteria);
-                service.doDelete(AdmContextUtil.toDmpContext(), queryCriteria);
-
-                criteria.put("relCode", "Sy2Bd");
-                queryCriteria.setCriteria(criteria);
-                service.doDelete(AdmContextUtil.toDmpContext(), queryCriteria);
-            }
             return AdmResponse.success();
         }
+
         List<RelationDTO> voList = new ArrayList<>();
         AdmRelationTypeEnum sy2fl = AdmRelationTypeEnum.SY2FL;
         String graphCode = sy2fl.getGraphCode();
         String relCode = sy2fl.getRelCode();
+
+        //需要解绑关系
+        QueryCriteria queryCriteria = new QueryCriteria();
+        ObjectNode criteria = JsonNodeFactory.instance.objectNode();
+        criteria.put("graphCode", graphCode);
+        criteria.put("relCode", relCode);
+        criteria.put("objFrom", sysId);
+        queryCriteria.setCriteria(criteria);
+        service.doDelete(AdmContextUtil.toDmpContext(), queryCriteria);
+
+        criteria.put("relCode", "Sy2Bd");
+        queryCriteria.setCriteria(criteria);
+        service.doDelete(AdmContextUtil.toDmpContext(), queryCriteria);
+
         for (String floorId : floorIdList) {
             RelationDTO relation = new RelationDTO(null, graphCode, relCode, null, sysId, floorId);
             voList.add(relation);