소스 검색

feature(主客体属性关联关系开发): 主客体属性关联关系开发

主客体属性关联关系开发
mazq 4 년 전
부모
커밋
7de3c74381

+ 44 - 2
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/attr/controller/AttrController.java

@@ -1,8 +1,13 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.attr.controller;
 package com.dragoninfo.dcuc.authweb.restcontroller.attr.controller;
 
 
+import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.auth.auth.dto.attr.AttrAcceptDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.attr.AttrAcceptDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.attr.AttrRelAcceptDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.attr.RelSearchDTO;
 import com.dragoninfo.dcuc.auth.auth.facade.attr.IAttrFacade;
 import com.dragoninfo.dcuc.auth.auth.facade.attr.IAttrFacade;
 import com.dragoninfo.dcuc.authweb.restcontroller.attr.vo.AttrAcceptVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.attr.vo.AttrAcceptVo;
+import com.dragoninfo.dcuc.authweb.restcontroller.attr.vo.AttrRelAcceptVo;
+import com.dragoninfo.dcuc.authweb.restcontroller.attr.vo.RelSearchVo;
 import com.dragoninfo.dcuc.authweb.util.VersionUtils;
 import com.dragoninfo.dcuc.authweb.util.VersionUtils;
 import com.dragoninfo.duceap.core.response.Result;
 import com.dragoninfo.duceap.core.response.Result;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
@@ -12,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import java.util.List;
 import java.util.List;
@@ -50,7 +56,7 @@ public class AttrController {
             @ApiImplicitParam(name = "parentId", value = "parentId属性父类id"),
             @ApiImplicitParam(name = "parentId", value = "parentId属性父类id"),
             @ApiImplicitParam(name = "attrType", value = "属性类别  SUB:主体属性 OBJ:客体属性")
             @ApiImplicitParam(name = "attrType", value = "属性类别  SUB:主体属性 OBJ:客体属性")
     })
     })
-    @PostMapping(value = "deleteByParentId")
+    @GetMapping(value = "deleteByParentId")
     public Result deleteByParentId(@RequestParam("parentId") String parentId, @RequestParam("attrType") String attrType) {
     public Result deleteByParentId(@RequestParam("parentId") String parentId, @RequestParam("attrType") String attrType) {
         Boolean b = attrFacade.deleteByParentId(parentId,attrType);
         Boolean b = attrFacade.deleteByParentId(parentId,attrType);
         if (b) {
         if (b) {
@@ -65,11 +71,47 @@ public class AttrController {
             @ApiImplicitParam(name = "attrBelongType", value = "parentId属性父类id"),
             @ApiImplicitParam(name = "attrBelongType", value = "parentId属性父类id"),
             @ApiImplicitParam(name = "attrType", value = "属性类别  SUB:主体属性 OBJ:客体属性")
             @ApiImplicitParam(name = "attrType", value = "属性类别  SUB:主体属性 OBJ:客体属性")
     })
     })
-    @PostMapping(value = "getAttrTreeList")
+    @GetMapping(value = "getAttrTreeList")
     public Result getAttrTreeList(@RequestParam("attrBelongType") String attrBelongType, @RequestParam("attrType") String attrType) {
     public Result getAttrTreeList(@RequestParam("attrBelongType") String attrBelongType, @RequestParam("attrType") String attrType) {
          List<AttrAcceptDTO> list = attrFacade.getAttrTreeList(attrBelongType,attrType);
          List<AttrAcceptDTO> list = attrFacade.getAttrTreeList(attrBelongType,attrType);
          return Result.success(list);
          return Result.success(list);
     }
     }
 
 
+    @ApiOperation(value = "属性关联主客体关系添加")
+    @ApiImplicitParam(name = "attrRelAcceptVo", value = "主客体-属性关联关系添加对象")
+    @PostMapping(value = "attrRelAdd")
+    public Result attrRelAdd(@RequestBody AttrRelAcceptVo vo) {
+        AttrRelAcceptDTO dto = new AttrRelAcceptDTO();
+        BeanUtils.copyProperties(vo,dto);
+        Boolean b = attrFacade.relAdd(dto);
+        if (b) {
+            return Result.success();
+        } else {
+            return Result.fail();
+        }
+    }
+
+    @ApiOperation(value = "查询属性关联的id集合")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "attrId", value = "parentId属性父类id"),
+            @ApiImplicitParam(name = "attrType", value = "属性类别  SUB:主体属性 OBJ:客体属性"),
+            @ApiImplicitParam(name = "attrBelongType", value = "属性所属的主客体类别  USER:人员 ORG:机构 APP:应用")
+    })
+    @GetMapping(value = "attrRelToIds")
+    public Result<List<String>> attrRelToIds(@RequestParam("attrId") String attrId,
+                                 @RequestParam("attrType") String attrType,
+                                 @RequestParam("attrBelongType") String attrBelongType) {
+       List<String> relIds = attrFacade.attrRelToIds(attrId, attrType, attrBelongType);
+       return Result.success(relIds);
+    }
 
 
+    @ApiOperation(value = "查询属性关联的应用列表")
+    @ApiImplicitParam(name = "RelSearchVo", value = "RelSearchVo 主客体属性关联列表查询")
+    @PostMapping(value = "relAppPage")
+    public Result relAppPage(@RequestBody RelSearchVo vo) {
+        RelSearchDTO dto = new RelSearchDTO();
+        BeanUtils.copyProperties(vo, dto);
+        Page<ApplyInfo> page = attrFacade.relAppPage(dto);
+        return Result.success(page);
+    }
 }
 }

+ 29 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/attr/vo/AttrRelAcceptVo.java

@@ -0,0 +1,29 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.attr.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author mazq
+ * @date 2021/5/24
+ */
+@Data
+@ApiModel(value = "主客体和属性关联关系添加Vo")
+public class AttrRelAcceptVo {
+
+    @ApiModelProperty(value = "属性id")
+    private String attrId;
+
+    @ApiModelProperty(value = "属性类别  SUB:主体属性 OBJ:客体属性")
+    private String attrType;
+
+    @ApiModelProperty(value = "属性所属的主客体类别  USER:人员 ORG:机构 APP:应用")
+    private String attrBelongType;
+
+    @ApiModelProperty(value = "主客体id集合")
+    private List<String> relIds;
+
+}

+ 35 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/attr/vo/RelSearchVo.java

@@ -0,0 +1,35 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.attr.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author mazq
+ * @date 2021/5/24
+ */
+@Data
+@ApiModel(value = "主客关联关系查询Vo")
+public class RelSearchVo {
+
+    @ApiModelProperty(value = "页码,从0开始")
+    private Integer page;
+
+    @ApiModelProperty(value = "页面数量")
+    private Integer size;
+
+    @ApiModelProperty(value = "属性id")
+    private String attrId;
+
+    @ApiModelProperty(value = "属性类别  SUB:主体属性 OBJ:客体属性")
+    private String attrType;
+
+    @ApiModelProperty(value = "属性所属的主客体类别  USER:人员 ORG:机构 APP:应用")
+    private String attrBelongType;
+
+    @ApiModelProperty(value = "主客体名称")
+    private String name;
+
+    @ApiModelProperty(value = "主客体标识  应用:应用code 机构:机构code 人员:人员身份证号")
+    private String code;
+}

+ 1 - 1
src/main/resources/application-mazq.yml

@@ -47,7 +47,7 @@ duceap:
     type: dcuc
     type: dcuc
     dcuc:
     dcuc:
       cas-server-url-prefix: http://192.168.10.2:8877/sso
       cas-server-url-prefix: http://192.168.10.2:8877/sso
-      server-name: 10.11.1.25:8871
+      server-name: 10.11.1.25:8871 10.11.0.233:8871
       ignore-pattern: '/js/*|/img/*|/css/*|/api/*|/*.png|/rest/*|/webSocket/*|/oauthLogin/*|/authorizationPage.html|/importAuthorizationFile.html|/license/LicenseManagerServlet|/authorizationFile/'
       ignore-pattern: '/js/*|/img/*|/css/*|/api/*|/*.png|/rest/*|/webSocket/*|/oauthLogin/*|/authorizationPage.html|/importAuthorizationFile.html|/license/LicenseManagerServlet|/authorizationFile/'
       app-code: QXXT0000000000000001
       app-code: QXXT0000000000000001
       api-url: http://10.254.11.203:8860/dcuc
       api-url: http://10.254.11.203:8860/dcuc