|
|
|
@ -22,14 +22,12 @@ import cn.jyjz.xiaoyao.common.mybatisplus.util.SearchQueryFormat;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
|
|
|
|
|
import com.alanpoi.common.util.StringUtils;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
import org.flowable.ui.common.model.RemoteUser;
|
|
|
|
|
import org.flowable.ui.common.service.idm.RemoteIdmService;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -63,6 +61,8 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
@Resource
|
|
|
|
|
private SeqManageService seqManageService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private OcrTaskchildPictureService ocrTaskchildPictureService;
|
|
|
|
|
// /**
|
|
|
|
|
// * 查询我的待办任务
|
|
|
|
|
// * @return
|
|
|
|
@ -132,6 +132,75 @@ public class FlowTaskController extends BaseController {
|
|
|
|
|
Boolean flag = flowTaskService.complete(taskVO,request);
|
|
|
|
|
return flag?ResultVoUtil.success():ResultVoUtil.error();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量任务审批
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation(value="任务审批", notes="任务审批")
|
|
|
|
|
@PostMapping("/completeBatchFlow")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo completeBatch(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("审批失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (StringUtils.isNotBlank(smg.toString()))?ResultVoUtil.error(smg.toString()):ResultVoUtil.success();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("/listhistore")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public ResultVo listhistore(PageUtils vo, Model model, HttpServletRequest request){
|
|
|
|
|