diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java index 731a8ced..bea98aab 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java @@ -15,7 +15,6 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -29,11 +28,12 @@ import java.util.Map; /** * 流程的历史信息 + * * @author Jone */ @RestController @RequestMapping("/act/his") -@Api(tags="流程历史") +@Api(tags = "流程历史") public class HistoryController { @Autowired private ActHistoryService historyService; @@ -43,8 +43,8 @@ public class HistoryController { private SysUserService sysUserService; @GetMapping("getInstImage") - @ApiOperation(value ="获取流程活动图", produces="application/octet-stream") - @ApiImplicitParam(name = "processInstanceId", value = "流程实例ID", paramType = "query", dataType="String") + @ApiOperation(value = "获取流程活动图", produces = "application/octet-stream") + @ApiImplicitParam(name = "processInstanceId", value = "流程实例ID", paramType = "query", dataType = "String") // @RequiresPermissions("sys:his:all") public void getProcessInstanceDiagram(String processInstanceId, @ApiIgnore HttpServletResponse response) throws Exception { historyService.getProcessInstanceDiagram(processInstanceId, response); @@ -53,19 +53,19 @@ public class HistoryController { @GetMapping("getHistoryProcessInstancePage") @ApiOperation("历史流程实例列表") @ApiImplicitParams({ - @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , - @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , - @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "processDefinitionId", value = "流程定义ID", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "finishedBeginTime", value = "流程完成开始时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "finishedEndTime", value = "流程完成结束时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "startBeginTime", value = "流程启动开始时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "startEndTime", value = "流程启动结束时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "ended", value = "是否完成(true, false)", paramType = "query", dataType="String") + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "processDefinitionId", value = "流程定义ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "finishedBeginTime", value = "流程完成开始时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "finishedEndTime", value = "流程完成结束时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "startBeginTime", value = "流程启动开始时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "startEndTime", value = "流程启动结束时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "ended", value = "是否完成(true, false)", paramType = "query", dataType = "String") }) // @RequiresPermissions("sys:his:all") - public Result getHistoryProcessInstancePage(@ApiIgnore @RequestParam Map params){ + public Result getHistoryProcessInstancePage(@ApiIgnore @RequestParam Map params) { PageData page = historyService.getHistoryProcessInstancePage(params); return new Result().ok(page); } @@ -73,17 +73,17 @@ public class HistoryController { @GetMapping("getMyProcessInstancePage") @ApiOperation("我发起的流程") @ApiImplicitParams({ - @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , - @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , - @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "processDefinitionId", value = "流程定义ID", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "startBeginTime", value = "流程启动开始时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "startEndTime", value = "流程启动结束时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "ended", value = "是否接受(true:是,false:否)", paramType = "query", dataType="String") + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "processDefinitionId", value = "流程定义ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startBeginTime", value = "流程启动开始时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "startEndTime", value = "流程启动结束时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "ended", value = "是否接受(true:是,false:否)", paramType = "query", dataType = "String") }) // @RequiresPermissions("sys:his:all") - public Result getMyProcessInstancePage(@ApiIgnore @RequestParam Map params){ + public Result getMyProcessInstancePage(@ApiIgnore @RequestParam Map params) { PageData page = historyService.getMyProcessInstancePage(params); return new Result().ok(page); } @@ -91,27 +91,27 @@ public class HistoryController { @GetMapping("getMyHandledInstancePage") @ApiOperation("已办任务:根据登录账号查询用户已办任务") @ApiImplicitParams({ - @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") , - @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") , - @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "processDefinitionId", value = "流程定义ID", paramType = "query", dataType="String"), - @ApiImplicitParam(name = "startBeginTime", value = "流程启动开始时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "startEndTime", value = "流程启动结束时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "finishedBeginTime", value = "流程完成开始时间", paramType = "query", dataType="Date"), - @ApiImplicitParam(name = "finishedEndTime", value = "流程完成结束时间", paramType = "query", dataType="Date") + @ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), + @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "processDefinitionId", value = "流程定义ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startBeginTime", value = "流程启动开始时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "startEndTime", value = "流程启动结束时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "finishedBeginTime", value = "流程完成开始时间", paramType = "query", dataType = "Date"), + @ApiImplicitParam(name = "finishedEndTime", value = "流程完成结束时间", paramType = "query", dataType = "Date") }) // @RequiresPermissions("sys:his:all") - public Result getMyHandledInstancePage(@ApiIgnore @RequestParam Map params){ + public Result getMyHandledInstancePage(@ApiIgnore @RequestParam Map params) { PageData page = activitiService.getMyProcessInstancePage(params); - for(ProcessActivityDTO activityDTO : page.getList()){ - if(StringUtils.isNotEmpty(activityDTO.getStartUserId())){ + for (ProcessActivityDTO activityDTO : page.getList()) { + if (StringUtils.isNotEmpty(activityDTO.getStartUserId())) { SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getStartUserId())); - activityDTO.setStartUserName(userDTO.getRealName()); + activityDTO.setStartUserName(userDTO != null ? userDTO.getRealName() : ""); } - if(StringUtils.isNotEmpty(activityDTO.getAssignee())){ + if (StringUtils.isNotEmpty(activityDTO.getAssignee())) { SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getAssignee())); - activityDTO.setAssigneeName(userDTO.getRealName()); + activityDTO.setAssigneeName(userDTO != null ? userDTO.getRealName() : ""); } } return new Result().ok(page); @@ -120,10 +120,10 @@ public class HistoryController { @GetMapping("getTaskHandleDetailInfo") @ApiOperation("获取流程处理详情") @ApiImplicitParams({ - @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", dataType="String") + @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query", dataType = "String") }) // @RequiresPermissions("sys:his:all") - public Result getTaskHandleDetailInfo(String processInstanceId){ + public Result getTaskHandleDetailInfo(String processInstanceId) { List list = activitiService.getTaskHandleDetailInfo(processInstanceId); return new Result().ok(list); }