|
|
|
@ -3,6 +3,8 @@ package cn.jyjz.flowable.controller;
|
|
|
|
|
import cn.jyjz.flowable.common.SystemConstantsOa;
|
|
|
|
|
import cn.jyjz.flowable.domain.dto.HistoricTaskInstanceDto;
|
|
|
|
|
import cn.jyjz.flowable.domain.vo.FlowTaskVO;
|
|
|
|
|
import cn.jyjz.flowable.entity.FlowApprove;
|
|
|
|
|
import cn.jyjz.flowable.entity.FlowTaskInfo;
|
|
|
|
|
import cn.jyjz.flowable.service.IFlowTaskService;
|
|
|
|
|
import cn.jyjz.flowable.utils.PageUtils;
|
|
|
|
|
import cn.jyjz.flowable.utils.SysConstant;
|
|
|
|
@ -33,6 +35,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
|
import org.flowable.ui.common.model.RemoteUser;
|
|
|
|
|
import org.flowable.ui.common.service.idm.RemoteIdmService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -50,7 +53,7 @@ import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Api(tags="ocr_流程接口")
|
|
|
|
|
@Api(tags = "ocr_流程接口")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/flow/task")
|
|
|
|
|
public class FlowTaskController extends BaseController {
|
|
|
|
@ -87,13 +90,14 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查看过程流程图
|
|
|
|
|
*
|
|
|
|
|
* @param processId
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(value = "/flowImg",produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
|
@GetMapping(value = "/flowImg", produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public byte[] flowImg(@RequestParam("processId") String processId) throws Exception{
|
|
|
|
|
public byte[] flowImg(@RequestParam("processId") String processId) throws Exception {
|
|
|
|
|
InputStream diagram = flowTaskService.diagram(processId);
|
|
|
|
|
byte[] bytes = new byte[diagram.available()];
|
|
|
|
|
diagram.read(bytes);
|
|
|
|
@ -102,14 +106,15 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查看已办流程图
|
|
|
|
|
*
|
|
|
|
|
* @param processId
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(value = "/myFlowImg",produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
|
@GetMapping(value = "/myFlowImg", produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public byte[] myFlowImg(@RequestParam("processId") String processId, HttpServletRequest request) throws Exception{
|
|
|
|
|
InputStream diagram = flowTaskService.myDiagram(processId,request);
|
|
|
|
|
public byte[] myFlowImg(@RequestParam("processId") String processId, HttpServletRequest request) throws Exception {
|
|
|
|
|
InputStream diagram = flowTaskService.myDiagram(processId, request);
|
|
|
|
|
byte[] bytes = new byte[diagram.available()];
|
|
|
|
|
diagram.read(bytes);
|
|
|
|
|
return bytes;
|
|
|
|
@ -117,15 +122,16 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查看表单主键
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/viewFormid")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo viewFormid(@RequestParam("processId") String processId, HttpServletRequest request){
|
|
|
|
|
public ResultVo viewFormid(@RequestParam("processId") String processId, HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
|
//查询业务主键
|
|
|
|
|
Category category = flowTaskService.viewForm(processId,request);
|
|
|
|
|
if(null != category){
|
|
|
|
|
Category category = flowTaskService.viewForm(processId, request);
|
|
|
|
|
if (null != category) {
|
|
|
|
|
return ResultVoUtil.success(category);
|
|
|
|
|
}
|
|
|
|
|
return ResultVoUtil.error();
|
|
|
|
@ -133,125 +139,92 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 完成任务
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="任务审批", notes="任务审批")
|
|
|
|
|
@ApiOperation(value = "任务审批", notes = "任务审批")
|
|
|
|
|
@PostMapping("/completeFlow")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo complete(FlowTaskVO taskVO,HttpServletRequest request){
|
|
|
|
|
Boolean flag = flowTaskService.complete(taskVO,request);
|
|
|
|
|
return flag?ResultVoUtil.success():ResultVoUtil.error();
|
|
|
|
|
public ResultVo complete(@RequestBody FlowApprove approve, HttpServletRequest request) {
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
Boolean flag = flowTaskService.complete(approve, userToken);
|
|
|
|
|
return flag ? ResultVoUtil.success() : ResultVoUtil.error();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量任务审批
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="任务审批", notes="任务审批")
|
|
|
|
|
@ApiOperation(value = "任务审批", notes = "任务审批")
|
|
|
|
|
@PostMapping("/completeBatchFlow")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo completeBatch(HttpServletRequest request){
|
|
|
|
|
|
|
|
|
|
public ResultVo completeBatch(@RequestBody FlowApprove approve, HttpServletRequest request) {
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
|
|
|
|
|
//任务ID
|
|
|
|
|
String[] taskId = request.getParameterValues("taskId");
|
|
|
|
|
//审批的任务主键
|
|
|
|
|
String[] formid = request.getParameterValues("formid");
|
|
|
|
|
|
|
|
|
|
String[] taskname = request.getParameterValues("taskname");
|
|
|
|
|
|
|
|
|
|
//是否同意,true:同意,false:拒绝
|
|
|
|
|
boolean approvd = Boolean.valueOf(request.getParameter("approvd"));
|
|
|
|
|
|
|
|
|
|
//审批意见")
|
|
|
|
|
String taskComment = request.getParameter("taskComment");
|
|
|
|
|
//判断当前任务审批人是否一致
|
|
|
|
|
if(!this.ocrTaskchildPictureService.validateAssignee(formid,userToken)){
|
|
|
|
|
return ResultVoUtil.error("审批人不一致,请到任务审批中处理。");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO 判断当前任务是否审批完毕
|
|
|
|
|
if(!this.ocrTaskchildPictureService.validateApprove(formid)){
|
|
|
|
|
return ResultVoUtil.error("存在已经审批的任务。");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TODO 判断taskid是否为非法,空置、taskid是否存在
|
|
|
|
|
|
|
|
|
|
//判断当前任务是否存在历史任务--暂时不做,生成任务时直接保存历史任务的审批工具中
|
|
|
|
|
|
|
|
|
|
StringBuffer smg = new StringBuffer();
|
|
|
|
|
for(int i = 0;i < taskId.length;i++){
|
|
|
|
|
String ti = taskId[i];
|
|
|
|
|
String fi = formid[i];
|
|
|
|
|
FlowTaskVO taskVO = new FlowTaskVO();
|
|
|
|
|
taskVO.setTaskId(ti);
|
|
|
|
|
taskVO.setFormid(fi);
|
|
|
|
|
taskVO.setApprovd(approvd);
|
|
|
|
|
taskVO.setTaskComment(taskComment);
|
|
|
|
|
|
|
|
|
|
Boolean flag = flowTaskService.complete(taskVO,request);
|
|
|
|
|
|
|
|
|
|
if(!flag){
|
|
|
|
|
if(StringUtils.isNotBlank(smg.toString())){
|
|
|
|
|
smg.append(",");
|
|
|
|
|
smg.append(taskname[i]);
|
|
|
|
|
smg.append("审批失败");
|
|
|
|
|
}else{
|
|
|
|
|
smg.append(taskname[i]);
|
|
|
|
|
smg.append("审批失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<FlowTaskInfo> flowTaskInfoList = approve.getFlowTaskInfoList();
|
|
|
|
|
if (CollectionUtils.isNotEmpty(flowTaskInfoList)) {
|
|
|
|
|
List<String> formIdList = flowTaskInfoList.stream().map(FlowTaskInfo::getFormId).collect(Collectors.toList());
|
|
|
|
|
//判断当前任务审批人是否一致
|
|
|
|
|
if (!this.ocrTaskchildPictureService.validateAssignee(formIdList, userToken)) {
|
|
|
|
|
return ResultVoUtil.error("审批人不一致,请到任务审批中处理。");
|
|
|
|
|
}
|
|
|
|
|
// 判断当前任务是否审批完毕
|
|
|
|
|
if (!this.ocrTaskchildPictureService.validateApprove(formIdList)) {
|
|
|
|
|
return ResultVoUtil.error("存在已经审批的任务。");
|
|
|
|
|
}
|
|
|
|
|
Boolean flag = flowTaskService.complete(approve, userToken);
|
|
|
|
|
return flag ? ResultVoUtil.success("审批成功!") : ResultVoUtil.error("审批失败!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (StringUtils.isNotBlank(smg.toString()))?ResultVoUtil.error(smg.toString()):ResultVoUtil.success();
|
|
|
|
|
return ResultVoUtil.error("审批信息为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/listhistore")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo listhistore(PageUtils vo, Model model, HttpServletRequest request){
|
|
|
|
|
public ResultVo listhistore(PageUtils vo, Model model, HttpServletRequest request) {
|
|
|
|
|
String processInstanceId = request.getParameter("processInstanceId");
|
|
|
|
|
List<HistoricTaskInstanceDto> list = flowTaskService.listHistoriceTask(processInstanceId);
|
|
|
|
|
List<HistoricTaskInstanceDto> list = flowTaskService.listHistoriceTask(processInstanceId);
|
|
|
|
|
return ResultVoUtil.success(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 我的已办
|
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/finishedList")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo getFinishedList(PageUtils pageUtils, HttpServletRequest request){
|
|
|
|
|
public ResultVo getFinishedList(PageUtils pageUtils, HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request,"search_");
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
|
|
|
|
|
|
if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
|
}else{
|
|
|
|
|
searchQuery.addEqual("approveUserid",user.getId().toString());
|
|
|
|
|
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(), pageUtils);
|
|
|
|
|
} else {
|
|
|
|
|
searchQuery.addEqual("approveUserid", user.getId().toString());
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(), pageUtils);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 我的发起
|
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="待办任务", notes="待办任务")
|
|
|
|
|
@ApiOperation(value = "待办任务", notes = "待办任务")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
})
|
|
|
|
|
@GetMapping("/listdata")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo<FlowUnionVo> listdata(PageUtils<FlowUnionVo> pageUtils, HttpServletRequest request){
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request,"search_");
|
|
|
|
|
public ResultVo<FlowUnionVo> listdata(PageUtils<FlowUnionVo> pageUtils, HttpServletRequest request) {
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
|
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
@ -262,52 +235,52 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
String fromuserid = request.getParameter("fromuserid");
|
|
|
|
|
String fromplanid = request.getParameter("fromplanid");
|
|
|
|
|
|
|
|
|
|
if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) {
|
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(taskid)){
|
|
|
|
|
searchQuery.addEqual("taskid",taskid);
|
|
|
|
|
if (StringUtils.isNotBlank(taskid)) {
|
|
|
|
|
searchQuery.addEqual("taskid", taskid);
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(taskname)){
|
|
|
|
|
searchQuery.addLike("taskname",taskname);
|
|
|
|
|
if (StringUtils.isNotBlank(taskname)) {
|
|
|
|
|
searchQuery.addLike("taskname", taskname);
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(states)){
|
|
|
|
|
searchQuery.addEqual("states",states);
|
|
|
|
|
if (StringUtils.isNotBlank(states)) {
|
|
|
|
|
searchQuery.addEqual("states", states);
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(fromprojectid)){
|
|
|
|
|
searchQuery.addEqual("fromprojectid",fromprojectid);
|
|
|
|
|
if (StringUtils.isNotBlank(fromprojectid)) {
|
|
|
|
|
searchQuery.addEqual("fromprojectid", fromprojectid);
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(fromuserid)){
|
|
|
|
|
searchQuery.addEqual("fromuserid",fromuserid);
|
|
|
|
|
if (StringUtils.isNotBlank(fromuserid)) {
|
|
|
|
|
searchQuery.addEqual("fromuserid", fromuserid);
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(fromplanid)){
|
|
|
|
|
searchQuery.addEqual("fromplanid",fromplanid);
|
|
|
|
|
if (StringUtils.isNotBlank(fromplanid)) {
|
|
|
|
|
searchQuery.addEqual("fromplanid", fromplanid);
|
|
|
|
|
}
|
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
|
// List<Userapprove> userApprove = userapproveService.list(new LambdaQueryWrapper<Userapprove>().eq(Userapprove::getUserid, user.getId()));
|
|
|
|
|
// List<String> collect = userApprove.stream().map(Userapprove::getFormid).map(Object::toString).collect(Collectors.toList());
|
|
|
|
|
// searchQuery.addIn("formid",collect);
|
|
|
|
|
if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){
|
|
|
|
|
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
|
}else{
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(), pageUtils);
|
|
|
|
|
} else {
|
|
|
|
|
String assigneeId = request.getParameter("assigneeId");
|
|
|
|
|
//如果assigneeId 为空查询发起流程,否则查询待办流程
|
|
|
|
|
if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
|
|
|
|
|
searchQuery.addEqual("assignee",user.getLoginname());
|
|
|
|
|
searchQuery.addEqual("states",SystemConstantsOa.OA_STATUS_TYPE_ING.toString());
|
|
|
|
|
}else{
|
|
|
|
|
searchQuery.addEqual("createuser",user.getLoginname());
|
|
|
|
|
if (StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())) {
|
|
|
|
|
searchQuery.addEqual("assignee", user.getLoginname());
|
|
|
|
|
searchQuery.addEqual("states", SystemConstantsOa.OA_STATUS_TYPE_ING.toString());
|
|
|
|
|
} else {
|
|
|
|
|
searchQuery.addEqual("createuser", user.getLoginname());
|
|
|
|
|
}
|
|
|
|
|
searchQuery.addEqual("tenantid",tenantId);
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
|
searchQuery.addEqual("tenantid", tenantId);
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(), pageUtils);
|
|
|
|
|
//待办信息,增加是否查看标记
|
|
|
|
|
if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
|
|
|
|
|
if (StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())) {
|
|
|
|
|
|
|
|
|
|
List list = pageUtils.getList();
|
|
|
|
|
if(null != list && !list.isEmpty()){
|
|
|
|
|
if (null != list && !list.isEmpty()) {
|
|
|
|
|
int count = list.size();
|
|
|
|
|
for(int i = 0;i < count;i++){
|
|
|
|
|
for (int i = 0; i < count; i++) {
|
|
|
|
|
FlowUnionVo flowUnionVo = (FlowUnionVo) list.get(i);
|
|
|
|
|
//flowUnionVo.setView(userViewApproeService.haveByFromid(flowUnionVo.getFormid().toString()));
|
|
|
|
|
}
|
|
|
|
@ -318,34 +291,36 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 我的任务
|
|
|
|
|
* 查询我的待办、已经办理任务
|
|
|
|
|
* 查询我的待办、已经办理任务
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="我的任务", notes="查询我的待办、已经办理任务")
|
|
|
|
|
@ApiOperation(value = "我的任务", notes = "查询我的待办、已经办理任务")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
})
|
|
|
|
|
@GetMapping("/listalldata")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo listAlldata(PageUtils pageUtils, HttpServletRequest request){
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request,"search_");
|
|
|
|
|
public ResultVo listAlldata(PageUtils pageUtils, HttpServletRequest request) {
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
|
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
|
|
|
|
|
|
if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) {
|
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
|
if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){
|
|
|
|
|
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
|
}else{
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(), pageUtils);
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyProcessInstances(user,tenantId,searchQuery.getQuery(),pageUtils);
|
|
|
|
|
flowTaskService.getMyProcessInstances(user, tenantId, searchQuery.getQuery(), pageUtils);
|
|
|
|
|
|
|
|
|
|
//待办信息,增加是否查看标记
|
|
|
|
|
// if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
|
|
|
|
@ -368,24 +343,25 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 终审列表
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="我的终审列表", notes="我的终审列表")
|
|
|
|
|
@ApiOperation(value = "我的终审列表", notes = "我的终审列表")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
})
|
|
|
|
|
@GetMapping("/listfinal")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo<OcrTaskchildPicture> listFinalData(PageUtils<OcrTaskchildPicture> pageUtils,
|
|
|
|
|
@RequestParam(name="izupuser", defaultValue="",required = false) String izupuser,
|
|
|
|
|
@RequestParam(name="izproject", defaultValue="",required = false) String izproject,
|
|
|
|
|
@RequestParam(name="izplan", defaultValue="",required = false) String izplan,
|
|
|
|
|
@RequestParam(name="izstatus", defaultValue="",required = false) String izstatus,
|
|
|
|
|
@RequestParam(name="iztaskrrom", defaultValue="",required = false) String iztaskrrom,
|
|
|
|
|
@RequestParam(name="izuptime", defaultValue="",required = false) String izuptime,
|
|
|
|
|
HttpServletRequest request){
|
|
|
|
|
@RequestParam(name = "izupuser", defaultValue = "", required = false) String izupuser,
|
|
|
|
|
@RequestParam(name = "izproject", defaultValue = "", required = false) String izproject,
|
|
|
|
|
@RequestParam(name = "izplan", defaultValue = "", required = false) String izplan,
|
|
|
|
|
@RequestParam(name = "izstatus", defaultValue = "", required = false) String izstatus,
|
|
|
|
|
@RequestParam(name = "iztaskrrom", defaultValue = "", required = false) String iztaskrrom,
|
|
|
|
|
@RequestParam(name = "izuptime", defaultValue = "", required = false) String izuptime,
|
|
|
|
|
HttpServletRequest request) {
|
|
|
|
|
SearchQuery searchQuery = new SearchQuery();
|
|
|
|
|
if(org.springframework.util.StringUtils.hasText(izupuser)){
|
|
|
|
|
if (org.springframework.util.StringUtils.hasText(izupuser)) {
|
|
|
|
|
// searchQuery.addEqual("fromuserid",izupuser);
|
|
|
|
|
if (izupuser.contains(",")) {
|
|
|
|
|
String[] userIds = izupuser.split(",");
|
|
|
|
@ -435,7 +411,7 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
searchQuery.addEqual("fromsourceid", iztaskrrom);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(org.springframework.util.StringUtils.hasText(izuptime)) {
|
|
|
|
|
if (org.springframework.util.StringUtils.hasText(izuptime)) {
|
|
|
|
|
String[] dateRange = izuptime.split("-");
|
|
|
|
|
if (dateRange.length == 2) {
|
|
|
|
|
try {
|
|
|
|
@ -448,12 +424,12 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
Long endTimeStamp = sdfInput.parse(dateRange[1].trim()).getTime();
|
|
|
|
|
|
|
|
|
|
// 如果开始时间不为空,则将其放入查询条件中
|
|
|
|
|
if (startTimeStamp!=null) {
|
|
|
|
|
searchQuery.addGreater("createdateStart",startTimeStamp);
|
|
|
|
|
if (startTimeStamp != null) {
|
|
|
|
|
searchQuery.addGreater("createdateStart", startTimeStamp);
|
|
|
|
|
}
|
|
|
|
|
// 如果结束时间不为空,则将其放入查询条件中
|
|
|
|
|
if (endTimeStamp!=null) {
|
|
|
|
|
searchQuery.addLess("createdateEnd",endTimeStamp);
|
|
|
|
|
if (endTimeStamp != null) {
|
|
|
|
|
searchQuery.addLess("createdateEnd", endTimeStamp);
|
|
|
|
|
}
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
// 处理日期解析异常
|
|
|
|
@ -464,58 +440,58 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
|
|
|
|
|
|
if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) {
|
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
|
}
|
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
|
if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){
|
|
|
|
|
}else{
|
|
|
|
|
searchQuery.addEqual("thisLoginUserid",user.getId().toString());
|
|
|
|
|
searchQuery.addEqual("tenantid",tenantId);
|
|
|
|
|
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
|
|
|
|
|
} else {
|
|
|
|
|
searchQuery.addEqual("thisLoginUserid", user.getId().toString());
|
|
|
|
|
searchQuery.addEqual("tenantid", tenantId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String,Object> query = searchQuery.getQuery();
|
|
|
|
|
Map<String, Object> query = searchQuery.getQuery();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flowTaskService.getFinalProcessInstances(query,pageUtils);
|
|
|
|
|
flowTaskService.getFinalProcessInstances(query, pageUtils);
|
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
/**
|
|
|
|
|
* 终审列表(高级检索)
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="图片分页列表查询-根据用户预设检索条件查询", notes="")
|
|
|
|
|
@ApiOperation(value = "图片分页列表查询-根据用户预设检索条件查询", notes = "")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
@ApiImplicitParam(paramType = "path",name = "userSearchId", value = "预设检索条件id", required = true),
|
|
|
|
|
@ApiImplicitParam(paramType = "path", name = "userSearchId", value = "预设检索条件id", required = true),
|
|
|
|
|
})
|
|
|
|
|
@GetMapping(value = "/listfinalAdvanced")
|
|
|
|
|
public ResultVo<IPage<OcrTaskchildPicture>> queryPageByUserSearchId(
|
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
|
|
HttpServletRequest req) {
|
|
|
|
|
|
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
|
String tenantId = req.getHeader("X-Tenant-Id");
|
|
|
|
|
if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) {
|
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取用户预设检索条件id
|
|
|
|
|
String userSearchId = req.getParameter("userSearchId");
|
|
|
|
|
IPage<OcrTaskchildPicture> pageList = flowTaskService.queryPageByUserSearchId(pageNo,pageSize,userSearchId);
|
|
|
|
|
IPage<OcrTaskchildPicture> pageList = flowTaskService.queryPageByUserSearchId(pageNo, pageSize, userSearchId);
|
|
|
|
|
return ResultVoUtil.success(pageList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 我的发起
|
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
* (CATEGORYID)流程类型为必填项
|
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
* (CATEGORYID)流程类型为必填项
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/listdataall")
|
|
|
|
@ -537,10 +513,10 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
searchQuery.addEqual("createuser", user.getLoginname());
|
|
|
|
|
//流程类型,对应流程类型表(OA_CATEGORY_T)的id
|
|
|
|
|
searchQuery.addEqual("categoryid", categoryid);
|
|
|
|
|
if(StringUtils.isNotBlank(buessinessno)){
|
|
|
|
|
if (StringUtils.isNotBlank(buessinessno)) {
|
|
|
|
|
searchQuery.addEqual("buessinessno", buessinessno);
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(formid)){
|
|
|
|
|
if (StringUtils.isNotBlank(formid)) {
|
|
|
|
|
searchQuery.addEqual("id", formid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -551,116 +527,126 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
return ResultVoUtil.success(flowUnionVoList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 抄送给我的
|
|
|
|
|
*
|
|
|
|
|
* @param pageUtils
|
|
|
|
|
* @param request
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/listdatacc")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo listdatacc(ParamterPage paramterPage,PageUtils pageUtils, HttpServletRequest request){
|
|
|
|
|
public ResultVo listdatacc(ParamterPage paramterPage, PageUtils pageUtils, HttpServletRequest request) {
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
Map<String, Object> query = searchQuery.getQuery();
|
|
|
|
|
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyListCc(query,userToken,paramterPage);
|
|
|
|
|
flowTaskService.getMyListCc(query, userToken, paramterPage);
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 抄送我的
|
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/mylistcc")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo myListCc(ParamterPage paramterPage, HttpServletRequest request){
|
|
|
|
|
public ResultVo myListCc(ParamterPage paramterPage, HttpServletRequest request) {
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
Map<String, Object> query = searchQuery.getQuery();
|
|
|
|
|
IPage<FlowUnionVo> flowableccIPage = flowTaskService.getMyListCc(query,userToken,paramterPage);
|
|
|
|
|
IPage<FlowUnionVo> flowableccIPage = flowTaskService.getMyListCc(query, userToken, paramterPage);
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.success(flowableccIPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 撤销流程
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/cancelTask")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo cancelTask(HttpServletRequest request){
|
|
|
|
|
public ResultVo cancelTask(HttpServletRequest request) {
|
|
|
|
|
String taskId = request.getParameter("taskId");
|
|
|
|
|
String reason = request.getParameter("reason");
|
|
|
|
|
flowTaskService.cancelTask(taskId,reason);
|
|
|
|
|
flowTaskService.cancelTask(taskId, reason);
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 重置流程流程
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="重置流程流程", notes="重置流程流程")
|
|
|
|
|
@ApiOperation(value = "重置流程流程", notes = "重置流程流程")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
@ApiImplicitParam(paramType = "path",name = "fromid", value = "任务表主键", required = true)
|
|
|
|
|
@ApiImplicitParam(paramType = "path", name = "fromid", value = "任务表主键", required = true)
|
|
|
|
|
})
|
|
|
|
|
@GetMapping("/removeTask")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo removeTask(HttpServletRequest request){
|
|
|
|
|
public ResultVo removeTask(HttpServletRequest request) {
|
|
|
|
|
String fromid = request.getParameter("fromid");
|
|
|
|
|
String taskid = request.getParameter("taskid");
|
|
|
|
|
return flowTaskService.removeTask(fromid,taskid);
|
|
|
|
|
return flowTaskService.removeTask(fromid, taskid);
|
|
|
|
|
|
|
|
|
|
//return ResultVoUtil.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 审批历史记录
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="重置流程流程", notes="重置流程流程")
|
|
|
|
|
@ApiOperation(value = "重置流程流程", notes = "重置流程流程")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
@ApiImplicitParam(paramType = "path",name = "buessinessno", value = "业务编码", required = true)
|
|
|
|
|
@ApiImplicitParam(paramType = "path", name = "buessinessno", value = "业务编码", required = true)
|
|
|
|
|
})
|
|
|
|
|
@GetMapping("/historyTask")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo historyTask(HttpServletRequest request){
|
|
|
|
|
public ResultVo historyTask(HttpServletRequest request) {
|
|
|
|
|
String fromid = request.getParameter("fromid");
|
|
|
|
|
String taskid = request.getParameter("buessinessno");
|
|
|
|
|
return flowTaskService.removeTask(fromid,taskid);
|
|
|
|
|
return flowTaskService.removeTask(fromid, taskid);
|
|
|
|
|
|
|
|
|
|
//return ResultVoUtil.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 重复任务
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="重复流程", notes="重复流程")
|
|
|
|
|
@ApiOperation(value = "重复流程", notes = "重复流程")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
})
|
|
|
|
|
@GetMapping("/repetitionTask")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo repetitionTask(){
|
|
|
|
|
public ResultVo repetitionTask() {
|
|
|
|
|
return flowTaskService.repetitionTask();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 重复任务
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="重复流程", notes="重复流程")
|
|
|
|
|
@ApiOperation(value = "重复流程", notes = "重复流程")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
})
|
|
|
|
|
@GetMapping("/repetitionTaskList")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo repetitionTaskList(){
|
|
|
|
|
public ResultVo repetitionTaskList() {
|
|
|
|
|
return flowTaskService.repetitionTaskList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|