|
@@ -1,6 +1,7 @@
|
|
package com.qmth.distributed.print.api;
|
|
package com.qmth.distributed.print.api;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.google.gson.reflect.TypeToken;
|
|
@@ -10,12 +11,17 @@ import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.distributed.print.business.bean.flow.CustomFlowDto;
|
|
import com.qmth.distributed.print.business.bean.flow.CustomFlowDto;
|
|
import com.qmth.distributed.print.business.bean.flow.CustomFlowSaveDto;
|
|
import com.qmth.distributed.print.business.bean.flow.CustomFlowSaveDto;
|
|
|
|
+import com.qmth.distributed.print.business.bean.params.CustomFlowParam;
|
|
|
|
+import com.qmth.distributed.print.business.bean.params.CustomFlowRenameParam;
|
|
import com.qmth.distributed.print.business.bean.params.FlowTaskApproveParam;
|
|
import com.qmth.distributed.print.business.bean.params.FlowTaskApproveParam;
|
|
-import com.qmth.distributed.print.business.bean.params.customFlowParam;
|
|
|
|
-import com.qmth.distributed.print.business.bean.result.*;
|
|
|
|
|
|
+import com.qmth.distributed.print.business.bean.result.FlowApproveListResult;
|
|
|
|
+import com.qmth.distributed.print.business.bean.result.FlowTaskResult;
|
|
|
|
+import com.qmth.distributed.print.business.bean.result.FlowViewResult;
|
|
|
|
+import com.qmth.distributed.print.business.bean.result.TaskInfoResult;
|
|
import com.qmth.distributed.print.business.entity.TFCustomFlow;
|
|
import com.qmth.distributed.print.business.entity.TFCustomFlow;
|
|
import com.qmth.distributed.print.business.entity.TFCustomFlowEntity;
|
|
import com.qmth.distributed.print.business.entity.TFCustomFlowEntity;
|
|
import com.qmth.distributed.print.business.entity.TFFlowApprove;
|
|
import com.qmth.distributed.print.business.entity.TFFlowApprove;
|
|
|
|
+import com.qmth.distributed.print.business.enums.TFCustomTypeEnum;
|
|
import com.qmth.distributed.print.business.service.ActivitiService;
|
|
import com.qmth.distributed.print.business.service.ActivitiService;
|
|
import com.qmth.distributed.print.business.service.TFCustomFlowEntityService;
|
|
import com.qmth.distributed.print.business.service.TFCustomFlowEntityService;
|
|
import com.qmth.distributed.print.business.service.TFCustomFlowService;
|
|
import com.qmth.distributed.print.business.service.TFCustomFlowService;
|
|
@@ -245,7 +251,7 @@ public class TFCustomFlowController {
|
|
@ApiOperation(value = "流程逻辑删除")
|
|
@ApiOperation(value = "流程逻辑删除")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
|
|
@RequestMapping(value = "/enable", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/enable", method = RequestMethod.POST)
|
|
- public Result enable(@Valid @RequestBody customFlowParam customFlowParam, BindingResult bindingResult) {
|
|
|
|
|
|
+ public Result enable(@Valid @RequestBody CustomFlowParam customFlowParam, BindingResult bindingResult) {
|
|
if (bindingResult.hasErrors()) {
|
|
if (bindingResult.hasErrors()) {
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
}
|
|
}
|
|
@@ -261,7 +267,7 @@ public class TFCustomFlowController {
|
|
return ResultUtil.ok(tfCustomFlowService.updateById(tfCustomFlow));
|
|
return ResultUtil.ok(tfCustomFlowService.updateById(tfCustomFlow));
|
|
}
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "查看审批流程")
|
|
|
|
|
|
+ @ApiOperation(value = "查看流程流程")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "审批流程信息", response = FlowViewResult.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "审批流程信息", response = FlowViewResult.class)})
|
|
@RequestMapping(value = "/view", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/view", method = RequestMethod.POST)
|
|
public Result view(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
|
|
public Result view(@ApiParam(value = "流程id", required = true) @RequestParam String flowId) {
|
|
@@ -271,7 +277,7 @@ public class TFCustomFlowController {
|
|
@ApiOperation(value = "流程审批记录逻辑删除")
|
|
@ApiOperation(value = "流程审批记录逻辑删除")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
|
|
@RequestMapping(value = "/approve/enable", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/approve/enable", method = RequestMethod.POST)
|
|
- public Result approveEnable(@Valid @RequestBody customFlowParam customFlowParam, BindingResult bindingResult) {
|
|
|
|
|
|
+ public Result approveEnable(@Valid @RequestBody CustomFlowParam customFlowParam, BindingResult bindingResult) {
|
|
if (bindingResult.hasErrors()) {
|
|
if (bindingResult.hasErrors()) {
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
}
|
|
}
|
|
@@ -304,25 +310,33 @@ public class TFCustomFlowController {
|
|
return ResultUtil.ok(activitiService.taskApproverExchange(userId, taskId));
|
|
return ResultUtil.ok(activitiService.taskApproverExchange(userId, taskId));
|
|
}
|
|
}
|
|
|
|
|
|
-// @ApiOperation(value = "获取转他人审批人")
|
|
|
|
-// @ApiResponses({@ApiResponse(code = 200, message = "流程节点审批人", response = FlowTaskApprovePeopleAllResult.class)})
|
|
|
|
-// @RequestMapping(value = "/task/approver/exchange/people", method = RequestMethod.POST)
|
|
|
|
-// public Result taskApproverExchangePeople(@ApiParam(value = "流程节点id", required = true) @RequestParam String taskId,
|
|
|
|
-// @ApiParam(value = "用户姓名", required = false) @RequestParam(required = false) String realName) {
|
|
|
|
-// return ResultUtil.ok(activitiService.taskApproverExchangePeople(taskId, realName));
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// @ApiOperation(value = "获取提交记录")
|
|
|
|
-// @ApiResponses({@ApiResponse(code = 200, message = "流程提交记录", response = FlowTaskApprovePeopleAllResult.class)})
|
|
|
|
-// @RequestMapping(value = "/task/approver/submit/list", method = RequestMethod.POST)
|
|
|
|
-// public Result taskApproverSubmitList(@ApiParam(value = "考试任务id", required = true) @RequestParam String examTaskId) {
|
|
|
|
-// return ResultUtil.ok(activitiService.taskApproverSubmitList(examTaskId));
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
@ApiOperation(value = "获取当前流程节点信息")
|
|
@ApiOperation(value = "获取当前流程节点信息")
|
|
@ApiResponses({@ApiResponse(code = 200, message = "当前流程节点信息", response = TaskInfoResult.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "当前流程节点信息", response = TaskInfoResult.class)})
|
|
@RequestMapping(value = "/task/info", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/task/info", method = RequestMethod.POST)
|
|
public Result taskInfo(@ApiParam(value = "流程节点id", required = true) @RequestParam String taskId) {
|
|
public Result taskInfo(@ApiParam(value = "流程节点id", required = true) @RequestParam String taskId) {
|
|
return ResultUtil.ok(activitiService.getTaskInfo(SystemConstant.convertIdToLong(taskId)));
|
|
return ResultUtil.ok(activitiService.getTaskInfo(SystemConstant.convertIdToLong(taskId)));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "重命名自定义流程名称")
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
|
|
|
|
+ @RequestMapping(value = "/rename", method = RequestMethod.POST)
|
|
|
|
+ public Result rename(@Valid @RequestBody CustomFlowRenameParam customFlowRenameParam, BindingResult bindingResult) {
|
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
|
+ return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
|
|
+ }
|
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
+ UpdateWrapper<TFCustomFlow> tfCustomFlowUpdateWrapper = new UpdateWrapper<>();
|
|
|
|
+ tfCustomFlowUpdateWrapper.lambda().eq(TFCustomFlow::getId, customFlowRenameParam.getId())
|
|
|
|
+ .set(TFCustomFlow::getName, customFlowRenameParam.getName())
|
|
|
|
+ .set(TFCustomFlow::getUpdateId, sysUser.getId())
|
|
|
|
+ .set(TFCustomFlow::getUpdateTime, System.currentTimeMillis());
|
|
|
|
+ return ResultUtil.ok(tfCustomFlowService.update(tfCustomFlowUpdateWrapper));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "根据流程类型获取流程节点")
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "当前流程节点信息", response = ResultUtil.class)})
|
|
|
|
+ @RequestMapping(value = "/get_flow_info_by_type", method = RequestMethod.POST)
|
|
|
|
+ public Result getFlowInfoByType(@ApiParam(value = "流程类型", required = true) @RequestParam TFCustomTypeEnum type) {
|
|
|
|
+ return ResultUtil.ok(activitiService.getFlowInfoByType(type));
|
|
|
|
+ }
|
|
}
|
|
}
|