|
@@ -16,9 +16,9 @@ import com.dragoninfo.dcuc.auth.sub.enumresource.JobTypeEnum;
|
|
|
import com.dragoninfo.dcuc.auth.sub.facade.IAuthUserInfoFacade;
|
|
|
import com.dragoninfo.dcuc.auth.sub.facade.IUserCenterApiFacade;
|
|
|
import com.dragoninfo.dcuc.auth.sub.vo.LabelVO;
|
|
|
-import com.dragoninfo.dcuc.authweb.restcontroller.auth.vo.StaffAssignAuthInfoVo;
|
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.auth.vo.StaffOperateVo;
|
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.auth.vo.StaffRoleOperateVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.auth.vo.UserRoleAuthInfoVo;
|
|
|
import com.dragoninfo.dcuc.duceap.enums.UserTypeEnum;
|
|
|
import com.dragoninfo.dcuc.duceap.facade.ICodeListResourceFacade;
|
|
|
import com.dragoninfo.duceap.core.response.Result;
|
|
@@ -30,7 +30,6 @@ import com.dragonsoft.duceap.base.utils.UserContextUtils;
|
|
|
import com.dragonsoft.duceap.commons.util.string.StringUtils;
|
|
|
import com.dragonsoft.duceap.core.search.Searchable;
|
|
|
import com.dragonsoft.duceap.core.search.enums.SearchOperator;
|
|
|
-import com.dragonsoft.duceap.web.annotation.Permission;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -160,29 +159,29 @@ public class RoleAuthInfoController {
|
|
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 人员视图-角色已勾选
|
|
|
- * @param userId 用户Id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "人员视图-角色已勾选")
|
|
|
- @ApiImplicitParam(name = "userId", value = "用户id(orgId必须)",required = true)
|
|
|
- @GetMapping(value = "/roleChecked")
|
|
|
- public Result<List<StaffAssignAuthInfoVo>> getRoleChecked(@RequestParam(value = "userId", required = false) String userId) {
|
|
|
- if (StringUtils.isEmpty(userId)) {
|
|
|
- return Result.success(new ArrayList());
|
|
|
- }
|
|
|
- Searchable searchable = Searchable.newSearchable();
|
|
|
- searchable.addSearchFilter("staffId",SearchOperator.eq,userId);
|
|
|
- List<StaffAssignAuthInfo> staffAssignAuthInfoList = staffAssignAuthInfoFacade.findForList(searchable.toSearchDTO());
|
|
|
- List<StaffAssignAuthInfoVo> vos = new ArrayList<>();
|
|
|
- for (StaffAssignAuthInfo source : staffAssignAuthInfoList) {
|
|
|
- StaffAssignAuthInfoVo vo = new StaffAssignAuthInfoVo();
|
|
|
- BeanUtils.copyProperties(source,vo);
|
|
|
- vos.add(vo);
|
|
|
- }
|
|
|
- return Result.success(vos);
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 人员视图-角色已勾选
|
|
|
+// * @param userId 用户Id
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @ApiOperation(value = "人员视图-角色已勾选")
|
|
|
+// @ApiImplicitParam(name = "userId", value = "用户id(orgId必须)",required = true)
|
|
|
+// @GetMapping(value = "/roleChecked")
|
|
|
+// public Result<List<StaffAssignAuthInfoVo>> getRoleChecked(@RequestParam(value = "userId", required = false) String userId) {
|
|
|
+// if (StringUtils.isEmpty(userId)) {
|
|
|
+// return Result.success(new ArrayList());
|
|
|
+// }
|
|
|
+// Searchable searchable = Searchable.newSearchable();
|
|
|
+// searchable.addSearchFilter("staffId",SearchOperator.eq,userId);
|
|
|
+// List<StaffAssignAuthInfo> staffAssignAuthInfoList = staffAssignAuthInfoFacade.findForList(searchable.toSearchDTO());
|
|
|
+// List<StaffAssignAuthInfoVo> vos = new ArrayList<>();
|
|
|
+// for (StaffAssignAuthInfo source : staffAssignAuthInfoList) {
|
|
|
+// StaffAssignAuthInfoVo vo = new StaffAssignAuthInfoVo();
|
|
|
+// BeanUtils.copyProperties(source,vo);
|
|
|
+// vos.add(vo);
|
|
|
+// }
|
|
|
+// return Result.success(vos);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -287,7 +286,6 @@ public class RoleAuthInfoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "角色视图保存")
|
|
|
- @Permission(value = "auth_mge_config")
|
|
|
@PostMapping(value = "/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
public Result saveRole(@RequestBody StaffRoleOperateVo staffRoleOperateVo) {
|
|
|
RoleAuthDto dto=new RoleAuthDto();
|
|
@@ -309,8 +307,7 @@ public class RoleAuthInfoController {
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "人员视图保存")
|
|
|
- @Permission(value = "auth_mge_config")
|
|
|
- @PostMapping (value = "/staff", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
+ @PostMapping (value = "/staff")
|
|
|
public Result saveStaff(@RequestBody StaffOperateVo staffOperateVo) {
|
|
|
String userId = staffOperateVo.getUserId();
|
|
|
String saveIds = JSON.toJSONString(staffOperateVo.getSaveIds());
|
|
@@ -328,36 +325,22 @@ public class RoleAuthInfoController {
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- @ApiOperation(value = "获取角色视图勾选人员,获取人员视图勾选角色",
|
|
|
- notes = "type表示获取类型,获取类型:role获取勾选人员 其他:获取勾选角色。type=role时appId, roleId, orgId")
|
|
|
+ @ApiOperation(value = "获取角色视图勾选人员id")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "type", value = "获取类型:role获取勾选人员 其他:获取勾选角色"),
|
|
|
- @ApiImplicitParam(name = "appId", value = "应用id",required = true),
|
|
|
@ApiImplicitParam(name = "orgId", value = "机构id", required = true),
|
|
|
- @ApiImplicitParam(name = "roleId", value = "角色id"),
|
|
|
- @ApiImplicitParam(name = "staffId", value = "人员id")
|
|
|
+ @ApiImplicitParam(name = "roleId", value = "角色id")
|
|
|
})
|
|
|
@GetMapping(value = "/checked")
|
|
|
- public Result<List<StaffAssignAuthInfoVo>> getCheckedStaff(@RequestParam(value = "type", required = true) String type,
|
|
|
- @RequestParam(value = "appId", required = true) String appId,
|
|
|
- @RequestParam(value = "orgId", required = false) String orgId,
|
|
|
- @RequestParam(value = "roleId", required = false) String roleId,
|
|
|
- @RequestParam(value = "staffId", required = false) String staffId) {
|
|
|
- List<StaffAssignAuthInfo> staffAssignAuthInfoList;
|
|
|
- if (type.equals("role")) {
|
|
|
- //获取勾选人员
|
|
|
- staffAssignAuthInfoList = iRoleAuthInfoFacade.getStaff(appId, roleId, orgId);
|
|
|
- } else {
|
|
|
- //获取勾选角色
|
|
|
- staffAssignAuthInfoList = iRoleAuthInfoFacade.getRole(appId, staffId);
|
|
|
- }
|
|
|
- List<StaffAssignAuthInfoVo> vos = new ArrayList<>();
|
|
|
- for (StaffAssignAuthInfo source : staffAssignAuthInfoList) {
|
|
|
- StaffAssignAuthInfoVo vo = new StaffAssignAuthInfoVo();
|
|
|
- BeanUtils.copyProperties(source,vo);
|
|
|
- vos.add(vo);
|
|
|
- }
|
|
|
- return Result.success(vos);
|
|
|
+ public Result getCheckedStaff(@RequestParam(value = "orgId", required = false) String orgId,
|
|
|
+ @RequestParam(value = "roleId", required = false) String roleId) {
|
|
|
+ List<StaffAssignAuthInfo> list = iRoleAuthInfoFacade.getStaff(roleId, orgId);
|
|
|
+ List<UserRoleAuthInfoVo> collect = list.stream().map(e -> {
|
|
|
+ UserRoleAuthInfoVo authInfoVo = new UserRoleAuthInfoVo();
|
|
|
+ authInfoVo.setId(e.getStaffId());
|
|
|
+ authInfoVo.setActiveTime(e.getActiveTime());
|
|
|
+ return authInfoVo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return Result.success(collect);
|
|
|
}
|
|
|
|
|
|
}
|