|
@@ -4,15 +4,11 @@ import com.dragoninfo.dcuc.app.entity.ApplyInfo;
|
|
|
import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.AppFunInfoDTO;
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.AppResourcesDto;
|
|
|
-import com.dragoninfo.dcuc.auth.auth.dto.ApprovalDto;
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.RoleApiDto;
|
|
|
-import com.dragoninfo.dcuc.auth.auth.facade.IApprovalFacade;
|
|
|
import com.dragoninfo.dcuc.auth.auth.facade.IRoleFacade;
|
|
|
import com.dragoninfo.dcuc.auth.power.facade.IAppFunInfoFacade;
|
|
|
-import com.dragoninfo.dcuc.auth.sub.dto.AuthUserDTO;
|
|
|
import com.dragoninfo.dcuc.auth.sub.facade.IAuthUserInfoFacade;
|
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v3.vo.AppFunInfoApiVo;
|
|
|
-import com.dragoninfo.dcuc.authweb.restcontroller.api.controller.pojo.FunAppovalParamVo;
|
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.controller.pojo.RoleApiParamVo;
|
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.api.controller.pojo.UpdataAppFunVO;
|
|
|
import com.dragoninfo.duceap.core.enums.ResultEnum;
|
|
@@ -48,8 +44,6 @@ public class AuthApiController {
|
|
|
@Autowired
|
|
|
private IRoleFacade roleFacade;
|
|
|
@Autowired
|
|
|
- private IApprovalFacade iApprovalFacade;
|
|
|
- @Autowired
|
|
|
private IApplyInfoFacade applyInfoFacade;
|
|
|
@Autowired
|
|
|
private IAppFunInfoFacade iAppFunInfoFacade;
|
|
@@ -95,61 +89,8 @@ public class AuthApiController {
|
|
|
return roleFacade.getRolesByAppCodeAndUserId(appCode, userId);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 动态授权申请
|
|
|
- *
|
|
|
- * @param appCode 应用代码
|
|
|
- * @param roleCode 角色代码
|
|
|
- * @param userIdCard 申请人身份证
|
|
|
- * @param approvalIdCard 审批人身份证
|
|
|
- * @param reason 申请事由
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "动态授权申请")
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "appCode", value = "应用代码", required = true
|
|
|
- , example = "11111"), @ApiImplicitParam(name = "roleCode", value = "角色代码", required = true
|
|
|
- , example = "11111"), @ApiImplicitParam(name = "userIdCard", value = "用户身份证号", required = true
|
|
|
- , example = "340111197810194754"), @ApiImplicitParam(name = "approvalIdCard", value = "审批人身份证", required = true
|
|
|
- , example = "340111197810194754"), @ApiImplicitParam(name = "reason", value = "申请事由", required = true
|
|
|
- , example = "340111197810194754")})
|
|
|
- @GetMapping(value = "/auth/apply")
|
|
|
- @ResponseBody
|
|
|
- public ResponseDTO proposer(
|
|
|
- @RequestParam(value = "appCode", required = true) String appCode,
|
|
|
- @RequestParam(value = "roleCode", required = true) String roleCode,
|
|
|
- @RequestParam(value = "userIdCard", required = true) String userIdCard,
|
|
|
- @RequestParam(value = "approvalIdCard", required = true) String approvalIdCard,
|
|
|
- @RequestParam(value = "reason", required = true) String reason) {
|
|
|
-// http://172.16.105.196:8888/dcuc/api/auth/apply?appCode=YHZX0000000000000001&roleCode=MANAGER_APP&userIdCard=000000000000000001&approvalIdCard=000000000000000001&reason=111
|
|
|
- return iApprovalFacade.authApply(appCode, roleCode, userIdCard, approvalIdCard, reason);
|
|
|
- }
|
|
|
|
|
|
- /**
|
|
|
- * 动态授权的角色功能获取
|
|
|
- *
|
|
|
- * @param appCode 应用代码
|
|
|
- * @param roleCode 角色代码
|
|
|
- * @param userIdCard 申请批人身份证
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "动态授权的角色功能获取")
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "appCode", value = "应用代码", required = true
|
|
|
- , example = "11111"), @ApiImplicitParam(name = "roleCode", value = "角色代码", required = true
|
|
|
- , example = "11111"), @ApiImplicitParam(name = "userIdCard", value = "用户身份证号", required = true
|
|
|
- , example = "340111197810194754")})
|
|
|
- @GetMapping(value = "/auth/applyResult")
|
|
|
- @ResponseBody
|
|
|
- public ResponseDTO getProposerFuns(
|
|
|
- @RequestParam(value = "appCode", required = true) String appCode,
|
|
|
- @RequestParam(value = "roleCode", required = true) String roleCode,
|
|
|
- @RequestParam(value = "userIdCard", required = true) String userIdCard) {
|
|
|
- ApprovalDto approvalDto = new ApprovalDto();
|
|
|
- approvalDto.setAppCode(appCode);
|
|
|
- approvalDto.setRoleCode(roleCode);
|
|
|
- approvalDto.setUserIdCard(userIdCard);
|
|
|
-// http://172.16.105.196:8888/dcuc/api/auth/applyResult?appCode=YHZX0000000000000001&roleCode=MANAGER_APP&userIdCard=000000000000000001
|
|
|
- return iApprovalFacade.applyResult(approvalDto);
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 1.1
|
|
@@ -232,41 +173,6 @@ public class AuthApiController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 1.4
|
|
|
- * 动态授权
|
|
|
- *
|
|
|
- * @param vo
|
|
|
- * @return
|
|
|
- */
|
|
|
- @ApiOperation(value = "动态授权")
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "FunAppovalParamVo", value = "动态授权")})
|
|
|
- @RequestMapping("/pushData")
|
|
|
- @ResponseBody
|
|
|
- public Result pushData(@RequestBody FunAppovalParamVo vo) {
|
|
|
- String appCode = vo.getAppCode();
|
|
|
- String roleCode = vo.getRoleCode();
|
|
|
- String userIdCard = vo.getProposerIdcard();
|
|
|
- String approvalIdCard = vo.getApprpvalIdcard();
|
|
|
- String reason = vo.getProposerReason();
|
|
|
- if (StringUtils.isEmpty(appCode) || StringUtils.isEmpty(roleCode)
|
|
|
- || StringUtils.isEmpty(approvalIdCard) || StringUtils.isEmpty(userIdCard)
|
|
|
- || StringUtils.isEmpty(vo.getVerifiy()) || StringUtils.isEmpty(vo.getProposerOrg())) {
|
|
|
- return Result.fail("必填参数不能为空");
|
|
|
- }
|
|
|
- AuthUserDTO proposerUserInfo = authUserInfoFacade.findByIdcard(userIdCard);
|
|
|
- if (proposerUserInfo == null || !proposerUserInfo.getOrgId().equals(vo.getProposerOrg())) {
|
|
|
- return Result.fail("申请人不存在或机构错误");
|
|
|
- }
|
|
|
- ResponseDTO responseDTO = iApprovalFacade.authApply(appCode, roleCode, userIdCard, approvalIdCard, reason);
|
|
|
- if (ResponseDTO.FAIL_CODE.equals(responseDTO.getStatusCode())) {
|
|
|
- return Result.fail(responseDTO.getMessage());
|
|
|
- }
|
|
|
- return Result.success();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 1.5
|
|
|
* 获取权限列表成功
|