|
@@ -1,12 +1,35 @@
|
|
|
package com.dragoninfo.dcuc.authweb.restcontroller.selfauth.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
-import com.dragoninfo.dcuc.auth.auth.dto.*;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunApplyUpdateDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthApplyDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthResourceDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthResultDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.ApprovalSuggestionDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.FlowDefineInfoDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.FunApplyDetailDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessNodeDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessPicDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.ProcessStatusDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowDTO;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowPageViewDTO;
|
|
|
import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowSourceEnum;
|
|
|
+import com.dragoninfo.dcuc.auth.auth.facade.IAuthApplyActionFacade;
|
|
|
import com.dragoninfo.dcuc.auth.auth.facade.IAuthApplyFacade;
|
|
|
import com.dragoninfo.dcuc.auth.auth.facade.IFunAuthResultFacade;
|
|
|
import com.dragoninfo.dcuc.auth.auth.vo.RedListRiskLogVo;
|
|
|
-import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.*;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.AppFunApplyUpdateVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.AppFunAuthApplyVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.AppFunAuthResourceVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.AppFunAuthResultVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.ApprovalSuggestionVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.FlowDefineInfoVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.FunApplyDetailVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.ProcessNodeVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.ProcessPicVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.ProcessStatusVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.WorkFlowPageViewVo;
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.WorkFlowVo;
|
|
|
import com.dragoninfo.duceap.core.response.Result;
|
|
|
import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
|
|
|
import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
@@ -21,12 +44,21 @@ import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
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.DeleteMapping;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Calendar;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Optional;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* @author mazq
|
|
|
* @date 2021/7/7
|
|
@@ -39,6 +71,9 @@ public class SelfAuthAppLyController {
|
|
|
@Autowired
|
|
|
IAuthApplyFacade selfAuthApplyFacade;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ IAuthApplyActionFacade selfAuthApplyActionFacade;
|
|
|
+
|
|
|
@Autowired
|
|
|
IFunAuthResultFacade appFunResultFacade;
|
|
|
|
|
@@ -47,7 +82,7 @@ public class SelfAuthAppLyController {
|
|
|
"createTime ge (大于等于); createTime le (小于等于)时间格式:yyyy-MM-dd HH:mm:ss")
|
|
|
@PostMapping(value = "authApplySearch")
|
|
|
public Result<List<WorkFlowPageViewVo>> authApplySearch(Searchable searchable) {
|
|
|
- if(null == searchable) {
|
|
|
+ if (null == searchable) {
|
|
|
searchable = Searchable.newSearchable();
|
|
|
}
|
|
|
searchable.addSearchFilter("applySource", SearchOperator.eq, WorkFlowSourceEnum.SELF_AUTH_APPLY.getValue());
|
|
@@ -68,6 +103,30 @@ public class SelfAuthAppLyController {
|
|
|
return dealResult(status);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "权限申请单挂起")
|
|
|
+ @ApiImplicitParam(name = "id", value = "工作流审批单号")
|
|
|
+ @GetMapping(value = "authApplySuspend")
|
|
|
+ public Result authApplySuspend(@RequestParam("applyOrdNo") String applyOrdNo) {
|
|
|
+ ResponseStatus status = selfAuthApplyActionFacade.authApplySuspend(applyOrdNo);
|
|
|
+ return dealResult(status);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "权限申请单激活")
|
|
|
+ @ApiImplicitParam(name = "id", value = "工作流审批单号")
|
|
|
+ @GetMapping(value = "authApplyActivate")
|
|
|
+ public Result authApplyActivate(@RequestParam("applyOrdNo") String applyOrdNo) {
|
|
|
+ ResponseStatus status = selfAuthApplyActionFacade.authApplyActivate(applyOrdNo);
|
|
|
+ return dealResult(status);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "权限申请单终止")
|
|
|
+ @ApiImplicitParam(name = "id", value = "工作流审批单号")
|
|
|
+ @GetMapping(value = "authApplyStop")
|
|
|
+ public Result authApplyStop(@RequestParam("applyOrdNo") String applyOrdNo) {
|
|
|
+ ResponseStatus status = selfAuthApplyActionFacade.authApplyStop(applyOrdNo);
|
|
|
+ return dealResult(status);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "权限申请单删除")
|
|
|
@ApiImplicitParam(name = "applyOrdNo", value = "工作流审批单号")
|
|
|
@DeleteMapping(value = "authApplyDelete")
|
|
@@ -76,7 +135,6 @@ public class SelfAuthAppLyController {
|
|
|
return dealResult(status);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperation(value = "应用功能授权申请保存")
|
|
|
@PostMapping(value = "funApplySave")
|
|
|
public Result funApplySave(@RequestBody AppFunAuthApplyVo vo) {
|
|
@@ -98,7 +156,7 @@ public class SelfAuthAppLyController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private Date getEndTime(Date endTime) {
|
|
|
+ private static Date getEndTime(Date endTime) {
|
|
|
if (null != endTime) {
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(endTime);
|
|
@@ -118,7 +176,7 @@ public class SelfAuthAppLyController {
|
|
|
@GetMapping(value = "funApplyDetail")
|
|
|
public Result<FunApplyDetailVo> funApplyDetail(@RequestParam("applyOrdNo") String applyOrdNo,
|
|
|
@RequestParam(value = "needFlowInfo", required = false) Boolean needFlowInfo) {
|
|
|
- if(null == needFlowInfo) {
|
|
|
+ if (null == needFlowInfo) {
|
|
|
needFlowInfo = false;
|
|
|
}
|
|
|
FunApplyDetailDTO detailDTO = selfAuthApplyFacade.funApplyDetail(applyOrdNo, needFlowInfo);
|
|
@@ -143,13 +201,12 @@ public class SelfAuthAppLyController {
|
|
|
List<AppFunAuthResourceDTO> delResourceInfos = detailDTO.getDelResourceInfos();
|
|
|
List<AppFunAuthResourceVo> delVoList = Optional.ofNullable(delResourceInfos).orElse(new ArrayList<>())
|
|
|
.stream().map(item -> {
|
|
|
- AppFunAuthResourceVo resourceVo = new AppFunAuthResourceVo();
|
|
|
- BeanUtils.copyProperties(item, resourceVo);
|
|
|
- return resourceVo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
+ AppFunAuthResourceVo resourceVo = new AppFunAuthResourceVo();
|
|
|
+ BeanUtils.copyProperties(item, resourceVo);
|
|
|
+ return resourceVo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
detailVo.setDelResourceInfos(delVoList);
|
|
|
|
|
|
-
|
|
|
List<AppFunAuthResourceDTO> existResourceInfos = detailDTO.getExistResourceInfos();
|
|
|
List<AppFunAuthResourceVo> existVoList = Optional.ofNullable(existResourceInfos).orElse(new ArrayList<>())
|
|
|
.stream().map(item -> {
|
|
@@ -164,7 +221,7 @@ public class SelfAuthAppLyController {
|
|
|
|
|
|
@ApiOperation(value = "应用功能权限申请修改")
|
|
|
@PostMapping(value = "funApplyUpdate")
|
|
|
- public Result funApplyUpdate(@RequestBody AppFunApplyUpdateVo vo){
|
|
|
+ public Result funApplyUpdate(@RequestBody AppFunApplyUpdateVo vo) {
|
|
|
String jsonString = JSON.toJSONString(vo);
|
|
|
AppFunApplyUpdateDTO updateDTO = JSON.parseObject(jsonString, AppFunApplyUpdateDTO.class);
|
|
|
Date endTime = getEndTime(updateDTO.getEndTime());
|
|
@@ -176,14 +233,14 @@ public class SelfAuthAppLyController {
|
|
|
@ApiOperation(value = "应用功能权限结果列表")
|
|
|
@ApiImplicitParam(name = "searchable", value = "searchable 查询条件")
|
|
|
@PostMapping(value = "funAuthList")
|
|
|
- public Result<List<AppFunAuthResultVo>> funAuthList(Searchable searchable){
|
|
|
- List<AppFunAuthResultDTO> authResultList = appFunResultFacade.findList(searchable.toSearchDTO());
|
|
|
- List<AppFunAuthResultVo> resultVos = authResultList.stream().map(item -> {
|
|
|
+ public Result<List<AppFunAuthResultVo>> funAuthList(Searchable searchable) {
|
|
|
+ List<AppFunAuthResultDTO> authResultList = appFunResultFacade.findList(searchable.toSearchDTO());
|
|
|
+ List<AppFunAuthResultVo> resultVos = authResultList.stream().map(item -> {
|
|
|
AppFunAuthResultVo resultVo = new AppFunAuthResultVo();
|
|
|
BeanUtils.copyProperties(item, resultVo);
|
|
|
return resultVo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- return Result.success(resultVos);
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return Result.success(resultVos);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "获取申请人已被授权的功能id")
|
|
@@ -193,7 +250,7 @@ public class SelfAuthAppLyController {
|
|
|
})
|
|
|
@GetMapping(value = "userHasAuthFunIds")
|
|
|
public Result<List<String>> userHasAuthFunIds(@RequestParam("userId") String userId,
|
|
|
- @RequestParam(value = "appId" ,required = false) String appId) {
|
|
|
+ @RequestParam(value = "appId", required = false) String appId) {
|
|
|
List<String> funIds = appFunResultFacade.userHasAuthFunIds(userId, appId);
|
|
|
return Result.success(funIds);
|
|
|
}
|
|
@@ -201,7 +258,7 @@ public class SelfAuthAppLyController {
|
|
|
@ApiOperation(value = "查询审批流程意见")
|
|
|
@ApiImplicitParam(name = "applyOrdNo", value = "工作流审批单号")
|
|
|
@GetMapping(value = "approvalSuggestion")
|
|
|
- public Result<List<ApprovalSuggestionVo>> approvalSuggestion(@RequestParam(value = "applyOrdNo") String applyOrdNo){
|
|
|
+ public Result<List<ApprovalSuggestionVo>> approvalSuggestion(@RequestParam(value = "applyOrdNo") String applyOrdNo) {
|
|
|
List<ApprovalSuggestionDTO> dtoList = selfAuthApplyFacade.approvalSuggestion(applyOrdNo);
|
|
|
List<ApprovalSuggestionVo> collect = dtoList.stream().map(item -> {
|
|
|
ApprovalSuggestionVo suggestionVo = new ApprovalSuggestionVo();
|
|
@@ -255,7 +312,7 @@ public class SelfAuthAppLyController {
|
|
|
@GetMapping("flowDefineInfo")
|
|
|
public Result<FlowDefineInfoVo> getFlowDefineInfo(@RequestParam(value = "applyType") String applyType) {
|
|
|
ResponseDTO<FlowDefineInfoDTO> status = selfAuthApplyFacade.getFlowDefineInfo(applyType);
|
|
|
- if(!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
|
|
|
+ if (!ResponseStatus.SUCCESS_CODE.equals(status.getStatusCode())) {
|
|
|
return Result.fail(status.getStatusCode(), status.getMessage());
|
|
|
} else {
|
|
|
FlowDefineInfoDTO dto = (FlowDefineInfoDTO) status.getResult();
|