|
|
|
@ -2,10 +2,10 @@ package cn.jyjz.flowable.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.jyjz.flowable.common.SystemConstantsOa;
|
|
|
|
import cn.jyjz.flowable.common.SystemConstantsOa;
|
|
|
|
import cn.jyjz.flowable.domain.dto.HistoricTaskInstanceDto;
|
|
|
|
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.service.IFlowTaskService;
|
|
|
|
import cn.jyjz.flowable.utils.PageUtils;
|
|
|
|
import cn.jyjz.flowable.utils.PageUtils;
|
|
|
|
import cn.jyjz.flowable.utils.SysConstant;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.abase.service.SeqManageService;
|
|
|
|
import cn.jyjz.xiaoyao.abase.service.SeqManageService;
|
|
|
|
import cn.jyjz.xiaoyao.admin.dataobject.User;
|
|
|
|
import cn.jyjz.xiaoyao.admin.dataobject.User;
|
|
|
|
import cn.jyjz.xiaoyao.admin.service.UserService;
|
|
|
|
import cn.jyjz.xiaoyao.admin.service.UserService;
|
|
|
|
@ -15,51 +15,51 @@ import cn.jyjz.xiaoyao.common.base.param.ParamterPage;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.service.UserTokenService;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.util.RequestBaseUtil;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQuery;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQuery;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQueryForm;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
|
|
|
import cn.jyjz.xiaoyao.common.mybatisplus.util.SearchQueryFormat;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Userapprove;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.service.UserapproveService;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.service.UserapproveService;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.RepeatedTaskVo;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrUsersearch;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrUsersearchchild;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrSearchmanagerService;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrUsersearchService;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrUsersearchchildService;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.vo.OcrTaskChildPictureVo;
|
|
|
|
import com.alanpoi.common.util.StringUtils;
|
|
|
|
import com.alanpoi.common.util.StringUtils;
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
import org.flowable.ui.common.model.RemoteUser;
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
import org.flowable.ui.common.service.idm.RemoteIdmService;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.http.MediaType;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
@Api(tags="ocr_流程接口")
|
|
|
|
@Api(tags = "ocr_流程接口")
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/flow/task")
|
|
|
|
@RequestMapping("/flow/task")
|
|
|
|
public class FlowTaskController extends BaseController {
|
|
|
|
public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
IFlowTaskService flowTaskService;
|
|
|
|
IFlowTaskService flowTaskService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private UserTokenService userTokenService;
|
|
|
|
private UserTokenService userTokenService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private UserService userService;
|
|
|
|
private UserService userService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
@ -71,7 +71,7 @@ public class FlowTaskController extends BaseController {
|
|
|
|
private OcrTaskchildPictureService ocrTaskchildPictureService;
|
|
|
|
private OcrTaskchildPictureService ocrTaskchildPictureService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private UserapproveService userapproveService;
|
|
|
|
private OcrUsersearchchildService usersearchchildService;
|
|
|
|
// /**
|
|
|
|
// /**
|
|
|
|
// * 查询我的待办任务
|
|
|
|
// * 查询我的待办任务
|
|
|
|
// * @return
|
|
|
|
// * @return
|
|
|
|
@ -86,13 +86,14 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查看过程流程图
|
|
|
|
* 查看过程流程图
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param processId
|
|
|
|
* @param processId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
* @throws Exception
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/flowImg",produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
@GetMapping(value = "/flowImg", produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public byte[] flowImg(@RequestParam("processId") String processId) throws Exception{
|
|
|
|
public byte[] flowImg(@RequestParam("processId") String processId) throws Exception {
|
|
|
|
InputStream diagram = flowTaskService.diagram(processId);
|
|
|
|
InputStream diagram = flowTaskService.diagram(processId);
|
|
|
|
byte[] bytes = new byte[diagram.available()];
|
|
|
|
byte[] bytes = new byte[diagram.available()];
|
|
|
|
diagram.read(bytes);
|
|
|
|
diagram.read(bytes);
|
|
|
|
@ -101,30 +102,32 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查看已办流程图
|
|
|
|
* 查看已办流程图
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param processId
|
|
|
|
* @param processId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
* @throws Exception
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping(value = "/myFlowImg",produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
@GetMapping(value = "/myFlowImg", produces = MediaType.IMAGE_PNG_VALUE)
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public byte[] myFlowImg(@RequestParam("processId") String processId, HttpServletRequest request) throws Exception{
|
|
|
|
public byte[] myFlowImg(@RequestParam("processId") String processId, HttpServletRequest request) throws Exception {
|
|
|
|
InputStream diagram = flowTaskService.myDiagram(processId,request);
|
|
|
|
InputStream diagram = flowTaskService.myDiagram(processId, request);
|
|
|
|
byte[] bytes = new byte[diagram.available()];
|
|
|
|
byte[] bytes = new byte[diagram.available()];
|
|
|
|
diagram.read(bytes);
|
|
|
|
diagram.read(bytes);
|
|
|
|
return bytes;
|
|
|
|
return bytes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查看表单主键
|
|
|
|
* 查看表单主键
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@PostMapping("/viewFormid")
|
|
|
|
@PostMapping("/viewFormid")
|
|
|
|
@ResponseBody
|
|
|
|
@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);
|
|
|
|
Category category = flowTaskService.viewForm(processId, request);
|
|
|
|
if(null != category){
|
|
|
|
if (null != category) {
|
|
|
|
return ResultVoUtil.success(category);
|
|
|
|
return ResultVoUtil.success(category);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVoUtil.error();
|
|
|
|
return ResultVoUtil.error();
|
|
|
|
@ -132,127 +135,90 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 完成任务
|
|
|
|
* 完成任务
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="任务审批", notes="任务审批")
|
|
|
|
@ApiOperation(value = "任务审批", notes = "任务审批")
|
|
|
|
@PostMapping("/completeFlow")
|
|
|
|
@PostMapping("/completeFlow")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo complete(FlowTaskVO taskVO,HttpServletRequest request){
|
|
|
|
public ResultVo complete(@RequestBody FlowApprove approve, HttpServletRequest request) {
|
|
|
|
Boolean flag = flowTaskService.complete(taskVO,request);
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
return flag?ResultVoUtil.success():ResultVoUtil.error();
|
|
|
|
Integer flag = flowTaskService.complete(approve, userToken, Arrays.asList(approve.getFlowTaskInfoList().get(0).getFormId()));
|
|
|
|
|
|
|
|
return flag > 0 ? ResultVoUtil.success() : ResultVoUtil.error();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 批量任务审批
|
|
|
|
* 批量任务审批
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="任务审批", notes="任务审批")
|
|
|
|
@ApiOperation(value = "任务审批", notes = "任务审批")
|
|
|
|
@PostMapping("/completeBatchFlow")
|
|
|
|
@PostMapping("/completeBatchFlow")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo completeBatch(HttpServletRequest request){
|
|
|
|
public ResultVo completeBatch(@RequestBody FlowApprove approve, HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
|
|
|
|
|
|
|
//任务ID
|
|
|
|
//任务ID
|
|
|
|
String[] taskId = request.getParameterValues("taskId");
|
|
|
|
List<FlowTaskInfo> flowTaskInfoList = approve.getFlowTaskInfoList();
|
|
|
|
//审批的任务主键
|
|
|
|
if (CollectionUtils.isNotEmpty(flowTaskInfoList)) {
|
|
|
|
String[] formid = request.getParameterValues("formid");
|
|
|
|
List<String> formIdList = flowTaskInfoList.stream().map(FlowTaskInfo::getFormId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
//判断当前任务审批人是否一致
|
|
|
|
String[] taskname = request.getParameterValues("taskname");
|
|
|
|
List<String> formIds = ocrTaskchildPictureService.validateAssignee(formIdList, userToken);
|
|
|
|
|
|
|
|
// 判断当前任务是否审批完毕
|
|
|
|
//是否同意,true:同意,false:拒绝
|
|
|
|
if (CollectionUtils.isNotEmpty(formIds)) {
|
|
|
|
boolean approvd = Boolean.valueOf(request.getParameter("approvd"));
|
|
|
|
Integer success = flowTaskService.complete(approve, userToken, formIds);
|
|
|
|
|
|
|
|
return ResultVoUtil.success("审批成功" + success + "条," + "无权审核" + (flowTaskInfoList.size() - success) + "条", "");
|
|
|
|
//审批意见")
|
|
|
|
|
|
|
|
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("审批失败");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ResultVoUtil.success("审核成功0条," + "无权审核" + flowTaskInfoList.size() + "条", "");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (StringUtils.isNotBlank(smg.toString()))?ResultVoUtil.error(smg.toString()):ResultVoUtil.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/listhistore")
|
|
|
|
@GetMapping("/listhistore")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo listhistore(PageUtils vo, Model model, HttpServletRequest request){
|
|
|
|
public ResultVo listhistore(PageUtils vo, Model model, HttpServletRequest request) {
|
|
|
|
String processInstanceId = request.getParameter("processInstanceId");
|
|
|
|
String processInstanceId = request.getParameter("processInstanceId");
|
|
|
|
List<HistoricTaskInstanceDto> list = flowTaskService.listHistoriceTask(processInstanceId);
|
|
|
|
List<HistoricTaskInstanceDto> list = flowTaskService.listHistoriceTask(processInstanceId);
|
|
|
|
return ResultVoUtil.success(list);
|
|
|
|
return ResultVoUtil.success(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 我的已办
|
|
|
|
* 我的已办
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/finishedList")
|
|
|
|
@GetMapping("/finishedList")
|
|
|
|
@ResponseBody
|
|
|
|
@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);
|
|
|
|
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);
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(), pageUtils);
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
searchQuery.addEqual("approveUserid",user.getId().toString());
|
|
|
|
searchQuery.addEqual("approveUserid", user.getId().toString());
|
|
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(), pageUtils);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 我的发起
|
|
|
|
* 我的发起
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="待办任务", notes="待办任务")
|
|
|
|
@ApiOperation(value = "待办任务", notes = "待办任务")
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@GetMapping("/listdata")
|
|
|
|
@GetMapping("/listdata")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo<FlowUnionVo> listdata(PageUtils<FlowUnionVo> pageUtils, HttpServletRequest request){
|
|
|
|
public ResultVo<FlowUnionVo> listdata(PageUtils<FlowUnionVo> pageUtils, HttpServletRequest request) {
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request,"search_");
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
|
|
|
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
String taskid = request.getParameter("taskid");
|
|
|
|
String taskid = request.getParameter("taskid");
|
|
|
|
@ -262,91 +228,99 @@ public class FlowTaskController extends BaseController {
|
|
|
|
String fromuserid = request.getParameter("fromuserid");
|
|
|
|
String fromuserid = request.getParameter("fromuserid");
|
|
|
|
String fromplanid = request.getParameter("fromplanid");
|
|
|
|
String fromplanid = request.getParameter("fromplanid");
|
|
|
|
|
|
|
|
|
|
|
|
if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) {
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(taskid)){
|
|
|
|
if (StringUtils.isNotBlank(taskid)) {
|
|
|
|
searchQuery.addEqual("taskid",taskid);
|
|
|
|
searchQuery.addEqual("taskid", taskid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(taskname)){
|
|
|
|
if (StringUtils.isNotBlank(taskname)) {
|
|
|
|
searchQuery.addLike("taskname",taskname);
|
|
|
|
searchQuery.addLike("taskname", taskname);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(states)){
|
|
|
|
if (StringUtils.isNotBlank(states)) {
|
|
|
|
searchQuery.addEqual("states",states);
|
|
|
|
searchQuery.addEqual("states", states);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(fromprojectid)){
|
|
|
|
if (StringUtils.isNotBlank(fromprojectid)) {
|
|
|
|
searchQuery.addEqual("fromprojectid",fromprojectid);
|
|
|
|
searchQuery.addEqual("fromprojectid", fromprojectid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(fromuserid)){
|
|
|
|
if (StringUtils.isNotBlank(fromuserid)) {
|
|
|
|
searchQuery.addEqual("fromuserid",fromuserid);
|
|
|
|
searchQuery.addEqual("fromuserid", fromuserid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(fromplanid)){
|
|
|
|
if (StringUtils.isNotBlank(fromplanid)) {
|
|
|
|
searchQuery.addEqual("fromplanid",fromplanid);
|
|
|
|
searchQuery.addEqual("fromplanid", fromplanid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
// List<Userapprove> userApprove = userapproveService.list(new LambdaQueryWrapper<Userapprove>().eq(Userapprove::getUserid, user.getId()));
|
|
|
|
// 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());
|
|
|
|
// List<String> collect = userApprove.stream().map(Userapprove::getFormid).map(Object::toString).collect(Collectors.toList());
|
|
|
|
// searchQuery.addIn("formid",collect);
|
|
|
|
// searchQuery.addIn("formid",collect);
|
|
|
|
if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){
|
|
|
|
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
|
|
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(), pageUtils);
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
String assigneeId = request.getParameter("assigneeId");
|
|
|
|
String assigneeId = request.getParameter("assigneeId");
|
|
|
|
//如果assigneeId 为空查询发起流程,否则查询待办流程
|
|
|
|
//如果assigneeId 为空查询发起流程,否则查询待办流程
|
|
|
|
if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
|
|
|
|
if (StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())) {
|
|
|
|
searchQuery.addEqual("assignee",user.getLoginname());
|
|
|
|
searchQuery.addEqual("assignee", user.getLoginname());
|
|
|
|
searchQuery.addEqual("states",SystemConstantsOa.OA_STATUS_TYPE_ING.toString());
|
|
|
|
searchQuery.addEqual("states", SystemConstantsOa.OA_STATUS_TYPE_ING.toString());
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
searchQuery.addEqual("createuser",user.getLoginname());
|
|
|
|
searchQuery.addEqual("createuser", user.getLoginname());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
searchQuery.addEqual("tenantid",tenantId);
|
|
|
|
searchQuery.addEqual("tenantid", tenantId);
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
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();
|
|
|
|
List list = pageUtils.getList();
|
|
|
|
if(null != list && !list.isEmpty()){
|
|
|
|
if (null != list && !list.isEmpty()) {
|
|
|
|
int count = list.size();
|
|
|
|
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 flowUnionVo = (FlowUnionVo) list.get(i);
|
|
|
|
//flowUnionVo.setView(userViewApproeService.haveByFromid(flowUnionVo.getFormid().toString()));
|
|
|
|
//flowUnionVo.setView(userViewApproeService.haveByFromid(flowUnionVo.getFormid().toString()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 我的任务
|
|
|
|
* 我的任务
|
|
|
|
* 查询我的待办、已经办理任务
|
|
|
|
* 查询我的待办、已经办理任务
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="我的任务", notes="查询我的待办、已经办理任务")
|
|
|
|
@ApiOperation(value = "我的任务", notes = "查询我的待办、已经办理任务")
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@GetMapping("/listalldata")
|
|
|
|
@GetMapping("/listalldata")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo listAlldata(PageUtils pageUtils, HttpServletRequest request){
|
|
|
|
public ResultVo listAlldata(PageUtils pageUtils, HttpServletRequest request) {
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request,"search_");
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
|
|
|
|
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
|
|
|
|
|
|
|
|
if(org.apache.commons.lang3.StringUtils.isBlank(tenantId)){
|
|
|
|
String taskName = request.getParameter("keyword");
|
|
|
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isBlank(tenantId)) {
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(taskName)) {
|
|
|
|
|
|
|
|
searchQuery.addLike("fromtaskname", taskName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取用户预设检索条件id
|
|
|
|
|
|
|
|
String userSearchId = request.getParameter("userSearchId");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
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);
|
|
|
|
flowTaskService.getMyProcessInstances(searchQuery.getQuery(),pageUtils);
|
|
|
|
} else {
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyProcessInstances(user, tenantId, searchQuery.getQuery(), pageUtils,userSearchId);
|
|
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyProcessInstances(user,tenantId,searchQuery.getQuery(),pageUtils);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//待办信息,增加是否查看标记
|
|
|
|
//待办信息,增加是否查看标记
|
|
|
|
// if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
|
|
|
|
// if(StringUtils.isNotBlank(assigneeId) && assigneeId.equals(user.getId().toString())){
|
|
|
|
//
|
|
|
|
//
|
|
|
|
@ -360,73 +334,198 @@ public class FlowTaskController extends BaseController {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void disSearchQuery(SearchQuery query, OcrUsersearchchild userSearch) {
|
|
|
|
|
|
|
|
if (userSearch.getSearchtype().equals("eq")) {
|
|
|
|
|
|
|
|
if (userSearch.getSearchvalue().contains(",")) {
|
|
|
|
|
|
|
|
String[] userIds = userSearch.getSearchvalue().split(",");
|
|
|
|
|
|
|
|
List<String> arrayData = Arrays.asList(userIds);
|
|
|
|
|
|
|
|
query.addIn(userSearch.getSearchfield(), arrayData);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
query.addEqual(userSearch.getSearchfield(), userSearch.getSearchvalue());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (userSearch.getSearchtype().equals("noteq")) {
|
|
|
|
|
|
|
|
if (userSearch.getSearchvalue().contains(",")) {
|
|
|
|
|
|
|
|
String[] userIds = userSearch.getSearchvalue().split(",");
|
|
|
|
|
|
|
|
List<String> arrayData = Arrays.asList(userIds);
|
|
|
|
|
|
|
|
query.addNotIn(userSearch.getSearchfield(), arrayData);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
query.addNotEqual(userSearch.getSearchfield(), userSearch.getSearchvalue());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 终审列表
|
|
|
|
* 终审列表
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="我的终审列表", notes="我的终审列表")
|
|
|
|
@ApiOperation(value = "我的终审列表", notes = "我的终审列表")
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@GetMapping("/listfinal")
|
|
|
|
@GetMapping("/listfinal")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo<OcrTaskchildPicture> listFinalData(PageUtils<OcrTaskchildPicture> pageUtils,
|
|
|
|
public ResultVo<OcrTaskchildPicture> listFinalData(PageUtils<OcrTaskchildPicture> pageUtils,
|
|
|
|
@RequestParam(name="search_fromuserid", defaultValue="",required = false) String searchFromuserid,
|
|
|
|
@RequestParam(name = "izupuser", defaultValue = "", required = false) String izupuser,
|
|
|
|
@RequestParam(name="search_fromprojectid", defaultValue="",required = false) String searchFromprojectid,
|
|
|
|
@RequestParam(name = "taskName", defaultValue = "", required = false) String taskName,
|
|
|
|
@RequestParam(name="search_fromplanid", defaultValue="",required = false) String searchFromplanid,
|
|
|
|
@RequestParam(name = "izproject", defaultValue = "", required = false) String izproject,
|
|
|
|
@RequestParam(name="search_states", defaultValue="",required = false) String searchStates,
|
|
|
|
@RequestParam(name = "izplan", defaultValue = "", required = false) String izplan,
|
|
|
|
@RequestParam(name="search_fromsourceid", defaultValue="",required = false) String searchFromsourceid,
|
|
|
|
@RequestParam(name = "izstatus", defaultValue = "", required = false) String izstatus,
|
|
|
|
@RequestParam(name="fromuptime_start", defaultValue="",required = false) BigDecimal fromuptimeStart,
|
|
|
|
@RequestParam(name = "iztaskrrom", defaultValue = "", required = false) String iztaskrrom,
|
|
|
|
@RequestParam(name="fromuptime_end", defaultValue="",required = false) BigDecimal fromuptimeEnd,
|
|
|
|
@RequestParam(name = "izuptime", defaultValue = "", required = false) String izuptime,
|
|
|
|
HttpServletRequest request){
|
|
|
|
HttpServletRequest request) {
|
|
|
|
SearchQuery searchQuery = new SearchQuery();
|
|
|
|
SearchQuery searchQuery = new SearchQuery();
|
|
|
|
if(org.springframework.util.StringUtils.hasText(searchFromuserid)){
|
|
|
|
if (org.springframework.util.StringUtils.hasText(izupuser)) {
|
|
|
|
searchQuery.addEqual("fromuserid",searchFromuserid);
|
|
|
|
// searchQuery.addEqual("fromuserid",izupuser);
|
|
|
|
|
|
|
|
if (izupuser.contains(",")) {
|
|
|
|
|
|
|
|
String[] userIds = izupuser.split(",");
|
|
|
|
|
|
|
|
List<String> arrayData = Arrays.asList(userIds);
|
|
|
|
|
|
|
|
searchQuery.addIn("fromuserid", arrayData);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
searchQuery.addEqual("fromuserid", izupuser);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(taskName)){
|
|
|
|
|
|
|
|
searchQuery.addLike("fromtaskname",taskName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(org.springframework.util.StringUtils.hasText(searchFromprojectid)){
|
|
|
|
if (org.springframework.util.StringUtils.hasText(izproject)) {
|
|
|
|
searchQuery.addEqual("fromprojectid",searchFromprojectid);
|
|
|
|
if (izproject.contains(",")) {
|
|
|
|
|
|
|
|
String[] projectIds = izproject.split(","); // 以逗号拆分字符串
|
|
|
|
|
|
|
|
List<String> arrayData = Arrays.asList(projectIds);
|
|
|
|
|
|
|
|
SearchQueryForm searchQueryForm = new SearchQueryForm();
|
|
|
|
|
|
|
|
searchQuery.addIn("fromprojectname", arrayData);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
searchQuery.addEqual("fromprojectname", izproject);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(org.springframework.util.StringUtils.hasText(searchFromplanid)){
|
|
|
|
if (org.springframework.util.StringUtils.hasText(izplan)) {
|
|
|
|
searchQuery.addEqual("fromplanid",searchFromplanid);
|
|
|
|
if (izplan.contains(",")) {
|
|
|
|
|
|
|
|
String[] planIds = izplan.split(","); // 以逗号拆分字符串
|
|
|
|
|
|
|
|
List<String> arrayData = Arrays.asList(planIds);
|
|
|
|
|
|
|
|
SearchQueryForm searchQueryForm = new SearchQueryForm();
|
|
|
|
|
|
|
|
searchQuery.addIn("fromplanid", arrayData);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
searchQuery.addEqual("fromplanid", izplan);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(org.springframework.util.StringUtils.hasText(searchStates)){
|
|
|
|
if (org.springframework.util.StringUtils.hasText(izstatus)) {
|
|
|
|
searchQuery.addEqual("states",searchStates);
|
|
|
|
if (izstatus.contains(",")) {
|
|
|
|
|
|
|
|
String[] statusIds = izstatus.split(","); // 以逗号拆分字符串
|
|
|
|
|
|
|
|
List<String> arrayData = Arrays.asList(statusIds);
|
|
|
|
|
|
|
|
SearchQueryForm searchQueryForm = new SearchQueryForm();
|
|
|
|
|
|
|
|
searchQuery.addIn("states", arrayData);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
searchQuery.addEqual("states", izstatus);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(org.springframework.util.StringUtils.hasText(searchFromsourceid)){
|
|
|
|
if (org.springframework.util.StringUtils.hasText(iztaskrrom)) {
|
|
|
|
searchQuery.addEqual("fromsourceid",searchFromsourceid);
|
|
|
|
if (iztaskrrom.contains(",")) {
|
|
|
|
|
|
|
|
String[] taskrromIds = iztaskrrom.split(","); // 以逗号拆分字符串
|
|
|
|
|
|
|
|
List<String> arrayData = Arrays.asList(taskrromIds);
|
|
|
|
|
|
|
|
SearchQueryForm searchQueryForm = new SearchQueryForm();
|
|
|
|
|
|
|
|
searchQuery.addIn("fromsourceid", arrayData);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
searchQuery.addEqual("fromsourceid", iztaskrrom);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (org.springframework.util.StringUtils.hasText(izuptime)) {
|
|
|
|
|
|
|
|
String[] dateRange = izuptime.split("-");
|
|
|
|
|
|
|
|
if (dateRange.length == 2) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
SimpleDateFormat sdfInput = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 解析开始时间
|
|
|
|
|
|
|
|
Long startTimeStamp = sdfInput.parse(dateRange[0].trim() + " 00:00:00").getTime();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 解析结束时间
|
|
|
|
|
|
|
|
Long endTimeStamp = sdfInput.parse(dateRange[1].trim() + " 23:59:59").getTime();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果开始时间不为空,则将其放入查询条件中
|
|
|
|
|
|
|
|
if (startTimeStamp != null) {
|
|
|
|
|
|
|
|
searchQuery.addGreater("createdateStart", startTimeStamp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 如果结束时间不为空,则将其放入查询条件中
|
|
|
|
|
|
|
|
if (endTimeStamp != null) {
|
|
|
|
|
|
|
|
searchQuery.addLess("createdateEnd", endTimeStamp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
|
|
|
// 处理日期解析异常
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
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("租户主键不能为空");
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
if(user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))){
|
|
|
|
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
|
|
|
|
}else{
|
|
|
|
} else {
|
|
|
|
searchQuery.addEqual("thisLoginUserid",user.getId().toString());
|
|
|
|
searchQuery.addEqual("thisLoginUserid", user.getId().toString());
|
|
|
|
searchQuery.addEqual("tenantid",tenantId);
|
|
|
|
searchQuery.addEqual("tenantid", tenantId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String searchId = request.getParameter("searchId");
|
|
|
|
|
|
|
|
|
|
|
|
Map<String,Object> query = searchQuery.getQuery();
|
|
|
|
if (StringUtils.isNotBlank(searchId)) {
|
|
|
|
if(fromuptimeStart != null){
|
|
|
|
List<OcrUsersearchchild> list = usersearchchildService.list(new LambdaQueryWrapper<OcrUsersearchchild>().eq(OcrUsersearchchild::getUsersearchid, searchId).orderByAsc(OcrUsersearchchild::getOrderNum));
|
|
|
|
query.put("fromuptimeStart",fromuptimeStart);
|
|
|
|
for (OcrUsersearchchild userSearch : list) {
|
|
|
|
}
|
|
|
|
disSearchQuery(searchQuery, userSearch);
|
|
|
|
if(fromuptimeEnd != null) {
|
|
|
|
}
|
|
|
|
query.put("fromuptimeEnd", fromuptimeEnd);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
flowTaskService.getFinalProcessInstances(query,pageUtils);
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> query = searchQuery.getQuery();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flowTaskService.getFinalProcessInstances(query, pageUtils);
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 终审列表(高级检索)
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@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),
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
@GetMapping(value = "/listfinalAdvanced")
|
|
|
|
|
|
|
|
public ResultVo<IPage<OcrTaskchildPicture>> queryPageByUserSearchId(
|
|
|
|
|
|
|
|
@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)) {
|
|
|
|
|
|
|
|
return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取用户预设检索条件id
|
|
|
|
|
|
|
|
String userSearchId = req.getParameter("userSearchId");
|
|
|
|
|
|
|
|
IPage<OcrTaskchildPicture> pageList = flowTaskService.queryPageByUserSearchId(pageNo, pageSize, userSearchId);
|
|
|
|
|
|
|
|
return ResultVoUtil.success(pageList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 我的发起
|
|
|
|
* 我的发起
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
* (CATEGORYID)流程类型为必填项
|
|
|
|
* (CATEGORYID)流程类型为必填项
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/listdataall")
|
|
|
|
@GetMapping("/listdataall")
|
|
|
|
@ -436,11 +535,11 @@ public class FlowTaskController extends BaseController {
|
|
|
|
List<FlowUnionVo> flowUnionVoList = null;
|
|
|
|
List<FlowUnionVo> flowUnionVoList = null;
|
|
|
|
String categoryid = request.getParameter("categoryid");
|
|
|
|
String categoryid = request.getParameter("categoryid");
|
|
|
|
String buessinessno = request.getParameter("buessinessno");
|
|
|
|
String buessinessno = request.getParameter("buessinessno");
|
|
|
|
|
|
|
|
|
|
|
|
//业务表id
|
|
|
|
//业务表id
|
|
|
|
String formid = request.getParameter("viewformid");
|
|
|
|
String formid = request.getParameter("viewformid");
|
|
|
|
if (StringUtils.isNotBlank(categoryid)) {
|
|
|
|
if (StringUtils.isNotBlank(categoryid)) {
|
|
|
|
|
|
|
|
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
User user = this.userService.getSessionUser(request);
|
|
|
|
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
|
|
|
|
if (user.isUserIsSys(xiaoyaoConfig.getWebconfig().getSysLoginUser().split(","))) {
|
|
|
|
flowUnionVoList = flowTaskService.getMyProcessInstances(searchQuery.getQuery());
|
|
|
|
flowUnionVoList = flowTaskService.getMyProcessInstances(searchQuery.getQuery());
|
|
|
|
@ -448,116 +547,142 @@ public class FlowTaskController extends BaseController {
|
|
|
|
searchQuery.addEqual("createuser", user.getLoginname());
|
|
|
|
searchQuery.addEqual("createuser", user.getLoginname());
|
|
|
|
//流程类型,对应流程类型表(OA_CATEGORY_T)的id
|
|
|
|
//流程类型,对应流程类型表(OA_CATEGORY_T)的id
|
|
|
|
searchQuery.addEqual("categoryid", categoryid);
|
|
|
|
searchQuery.addEqual("categoryid", categoryid);
|
|
|
|
if(StringUtils.isNotBlank(buessinessno)){
|
|
|
|
if (StringUtils.isNotBlank(buessinessno)) {
|
|
|
|
searchQuery.addEqual("buessinessno", buessinessno);
|
|
|
|
searchQuery.addEqual("buessinessno", buessinessno);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(StringUtils.isNotBlank(formid)){
|
|
|
|
if (StringUtils.isNotBlank(formid)) {
|
|
|
|
searchQuery.addEqual("id", formid);
|
|
|
|
searchQuery.addEqual("id", formid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchQuery.addEqual("states", SystemConstantsOa.OA_STATUS_TYPE_END.toString());
|
|
|
|
searchQuery.addEqual("states", SystemConstantsOa.OA_STATUS_TYPE_END.toString());
|
|
|
|
flowUnionVoList = flowTaskService.getMyProcessInstances(searchQuery.getQuery());
|
|
|
|
flowUnionVoList = flowTaskService.getMyProcessInstances(searchQuery.getQuery());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ResultVoUtil.success(flowUnionVoList);
|
|
|
|
return ResultVoUtil.success(flowUnionVoList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 抄送给我的
|
|
|
|
* 抄送给我的
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param pageUtils
|
|
|
|
* @param pageUtils
|
|
|
|
* @param request
|
|
|
|
* @param request
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/listdatacc")
|
|
|
|
@GetMapping("/listdatacc")
|
|
|
|
@ResponseBody
|
|
|
|
@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_");
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
Map<String, Object> query = searchQuery.getQuery();
|
|
|
|
Map<String, Object> query = searchQuery.getQuery();
|
|
|
|
|
|
|
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
|
|
|
|
|
|
|
flowTaskService.getMyListCc(query,userToken,paramterPage);
|
|
|
|
flowTaskService.getMyListCc(query, userToken, paramterPage);
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
return ResultVoUtil.success(pageUtils);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 抄送我的
|
|
|
|
* 抄送我的
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
* 查询我发起的已经完成的任务
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/mylistcc")
|
|
|
|
@GetMapping("/mylistcc")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo myListCc(ParamterPage paramterPage, HttpServletRequest request){
|
|
|
|
public ResultVo myListCc(ParamterPage paramterPage, HttpServletRequest request) {
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
SearchQuery searchQuery = this.getParametersStartingWithToSearchJson(request, "search_");
|
|
|
|
Map<String, Object> query = searchQuery.getQuery();
|
|
|
|
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 ResultVoUtil.success(flowableccIPage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 撤销流程
|
|
|
|
* 撤销流程
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@GetMapping("/cancelTask")
|
|
|
|
@GetMapping("/cancelTask")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo cancelTask(HttpServletRequest request){
|
|
|
|
public ResultVo cancelTask(HttpServletRequest request) {
|
|
|
|
String taskId = request.getParameter("taskId");
|
|
|
|
String taskId = request.getParameter("taskId");
|
|
|
|
String reason = request.getParameter("reason");
|
|
|
|
String reason = request.getParameter("reason");
|
|
|
|
flowTaskService.cancelTask(taskId,reason);
|
|
|
|
flowTaskService.cancelTask(taskId, reason);
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.success();
|
|
|
|
return ResultVoUtil.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 重置流程流程
|
|
|
|
* 重置流程流程
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="重置流程流程", notes="重置流程流程")
|
|
|
|
@ApiOperation(value = "重置流程流程", notes = "重置流程流程")
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
@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")
|
|
|
|
@GetMapping("/removeTask")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo removeTask(HttpServletRequest request){
|
|
|
|
public ResultVo removeTask(HttpServletRequest request) {
|
|
|
|
String fromid = request.getParameter("fromid");
|
|
|
|
String fromid = request.getParameter("fromid");
|
|
|
|
String taskid = request.getParameter("taskid");
|
|
|
|
String taskid = request.getParameter("taskid");
|
|
|
|
return flowTaskService.removeTask(fromid,taskid);
|
|
|
|
return flowTaskService.removeTask(fromid, taskid);
|
|
|
|
|
|
|
|
|
|
|
|
//return ResultVoUtil.success();
|
|
|
|
//return ResultVoUtil.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 审批历史记录
|
|
|
|
* 审批历史记录
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="重置流程流程", notes="重置流程流程")
|
|
|
|
@ApiOperation(value = "重置流程流程", notes = "重置流程流程")
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
@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")
|
|
|
|
@GetMapping("/historyTask")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo historyTask(HttpServletRequest request){
|
|
|
|
public ResultVo historyTask(HttpServletRequest request) {
|
|
|
|
String fromid = request.getParameter("fromid");
|
|
|
|
String fromid = request.getParameter("fromid");
|
|
|
|
String taskid = request.getParameter("buessinessno");
|
|
|
|
String taskid = request.getParameter("buessinessno");
|
|
|
|
return flowTaskService.removeTask(fromid,taskid);
|
|
|
|
return flowTaskService.removeTask(fromid, taskid);
|
|
|
|
|
|
|
|
|
|
|
|
//return ResultVoUtil.success();
|
|
|
|
//return ResultVoUtil.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 重复任务
|
|
|
|
* 重复任务
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ApiOperation(value="重复流程", notes="重复流程")
|
|
|
|
@ApiOperation(value = "重复流程", notes = "重复流程")
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParams({
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@GetMapping("/repetitionTask")
|
|
|
|
@GetMapping("/repetitionTask")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public ResultVo repetitionTask(HttpServletRequest request){
|
|
|
|
public ResultVo repetitionTask() {
|
|
|
|
return flowTaskService.repetitionTask();
|
|
|
|
return flowTaskService.repetitionTask();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 重复任务
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@ApiOperation(value = "重复流程", notes = "重复流程")
|
|
|
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
|
|
|
@ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
@GetMapping("/repetitionTaskList")
|
|
|
|
|
|
|
|
@ResponseBody
|
|
|
|
|
|
|
|
public ResultVo repetitionTaskList(@RequestParam(name = "pageNo") Integer pageNo,
|
|
|
|
|
|
|
|
@RequestParam(name = "pageSize") Integer pageSize) {
|
|
|
|
|
|
|
|
Page<OcrTaskchildPicture> result = flowTaskService.repetitionTaskList(pageNo, pageSize);
|
|
|
|
|
|
|
|
return ResultVoUtil.success(result);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|