|
@@ -1,24 +1,23 @@
|
|
package com.dragoninfo.dcuc.authweb.restcontroller.selfauth.controller;
|
|
package com.dragoninfo.dcuc.authweb.restcontroller.selfauth.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
-import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthApplyDTO;
|
|
|
|
-import com.dragoninfo.dcuc.auth.auth.dto.AppFunAuthResultDTO;
|
|
|
|
|
|
+import com.dragoninfo.dcuc.auth.auth.dto.*;
|
|
|
|
+import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowSourceEnum;
|
|
import com.dragoninfo.dcuc.auth.auth.facade.IFunAuthResultFacade;
|
|
import com.dragoninfo.dcuc.auth.auth.facade.IFunAuthResultFacade;
|
|
-import com.dragoninfo.dcuc.auth.auth.facade.ISelfAuthApplyFacade;
|
|
|
|
-import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.AppFunAuthApplyVo;
|
|
|
|
-import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.AppFunAuthResultVo;
|
|
|
|
|
|
+import com.dragoninfo.dcuc.auth.auth.facade.IAuthApplyFacade;
|
|
|
|
+import com.dragoninfo.dcuc.authweb.restcontroller.selfauth.vo.*;
|
|
import com.dragoninfo.duceap.core.response.Result;
|
|
import com.dragoninfo.duceap.core.response.Result;
|
|
import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
|
|
import com.dragonsoft.duceap.core.search.Searchable;
|
|
import com.dragonsoft.duceap.core.search.Searchable;
|
|
|
|
+import com.dragonsoft.duceap.core.search.enums.SearchOperator;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
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.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -34,11 +33,45 @@ import java.util.stream.Collectors;
|
|
public class SelfAuthAppLyController {
|
|
public class SelfAuthAppLyController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
- ISelfAuthApplyFacade selfAuthApplyFacade;
|
|
|
|
|
|
+ IAuthApplyFacade selfAuthApplyFacade;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
IFunAuthResultFacade appFunResultFacade;
|
|
IFunAuthResultFacade appFunResultFacade;
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "权限申请单列表")
|
|
|
|
+ @ApiImplicitParam(name = "searchable", value = "searchable 查询条件flowTitle like; applyType eq ;" +
|
|
|
|
+ "createTime ge (大于等于); createTime le (小于等于)时间格式:yyyy-MM-dd")
|
|
|
|
+ @PostMapping(value = "authApplySearch")
|
|
|
|
+ public Result<List<WorkFlowViewVo>> authApplySearch(Searchable searchable) {
|
|
|
|
+ if(null == searchable) {
|
|
|
|
+ searchable = Searchable.newSearchable();
|
|
|
|
+ }
|
|
|
|
+ searchable.addSearchFilter("applySource", SearchOperator.eq, WorkFlowSourceEnum.SELF_AUTH_APPLY.getValue());
|
|
|
|
+ Page<WorkFlowViewDTO> dtoPage = selfAuthApplyFacade.authApplySearch(searchable.toSearchDTO());
|
|
|
|
+ List<WorkFlowViewVo> viewVos = dtoPage.getContent().stream().map(item -> {
|
|
|
|
+ WorkFlowViewVo viewVo = new WorkFlowViewVo();
|
|
|
|
+ BeanUtils.copyProperties(item, viewVo);
|
|
|
|
+ return viewVo;
|
|
|
|
+ }).collect(Collectors.toList());
|
|
|
|
+ return Result.success(dtoPage.getTotalElements(), viewVos);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "权限申请单撤销")
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "工单主键")
|
|
|
|
+ @GetMapping(value = "authApplyCancel")
|
|
|
|
+ public Result authApplyCancel(@RequestParam("id") String id) {
|
|
|
|
+ selfAuthApplyFacade.authApplyCancel(id);
|
|
|
|
+ return Result.success();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "权限申请单删除")
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "工单主键")
|
|
|
|
+ @DeleteMapping(value = "authApplyDelete")
|
|
|
|
+ public Result authApplyDelete(@RequestParam("id") String id) {
|
|
|
|
+ selfAuthApplyFacade.authApplyDelete(id);
|
|
|
|
+ return Result.success();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
@ApiOperation(value = "应用功能授权申请保存")
|
|
@ApiOperation(value = "应用功能授权申请保存")
|
|
@PostMapping(value = "funApplySave")
|
|
@PostMapping(value = "funApplySave")
|
|
@@ -57,6 +90,31 @@ public class SelfAuthAppLyController {
|
|
return JSON.parseObject(jsonString, AppFunAuthApplyDTO.class);
|
|
return JSON.parseObject(jsonString, AppFunAuthApplyDTO.class);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "应用功能权限申请详情")
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "工单主键"),
|
|
|
|
+ @ApiImplicitParam(name = "needFlowInfo", value = "needFlowInfo 是否需要查询工作流相关信息")
|
|
|
|
+ })
|
|
|
|
+ @GetMapping(value = "funApplyDetail")
|
|
|
|
+ public Result<FunApplyDetailVo> funApplyDetail(@RequestParam("id") String id,
|
|
|
|
+ @RequestParam(value = "needFlowInfo", required = false) Boolean needFlowInfo) {
|
|
|
|
+ if(null == needFlowInfo) {
|
|
|
|
+ needFlowInfo = false;
|
|
|
|
+ }
|
|
|
|
+ FunApplyDetailDTO detailDTO = selfAuthApplyFacade.funApplyDetail(id, needFlowInfo);
|
|
|
|
+ FunApplyDetailVo detailVo = new FunApplyDetailVo();
|
|
|
|
+ BeanUtils.copyProperties(detailDTO, detailVo);
|
|
|
|
+ return Result.success(detailVo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "应用功能权限申请修改")
|
|
|
|
+ @PostMapping(value = "funApplyUpdate")
|
|
|
|
+ public Result funApplyUpdate(@RequestBody AppFunApplyUpdateVo vo){
|
|
|
|
+ AppFunApplyUpdateDTO updateDTO = new AppFunApplyUpdateDTO();
|
|
|
|
+ BeanUtils.copyProperties(vo, updateDTO);
|
|
|
|
+ selfAuthApplyFacade.funApplyUpdate(updateDTO);
|
|
|
|
+ return Result.success();
|
|
|
|
+ }
|
|
|
|
|
|
@ApiOperation(value = "应用功能权限结果列表")
|
|
@ApiOperation(value = "应用功能权限结果列表")
|
|
@ApiImplicitParam(name = "searchable", value = "searchable 查询条件")
|
|
@ApiImplicitParam(name = "searchable", value = "searchable 查询条件")
|