|
|
|
@ -1,12 +1,15 @@
|
|
|
|
package cn.jyjz.flowable.service.impl;
|
|
|
|
package cn.jyjz.flowable.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
import cn.jyjz.flowable.common.SystemConstantsOa;
|
|
|
|
import cn.jyjz.flowable.common.SystemConstantsOa;
|
|
|
|
import cn.jyjz.flowable.config.CustomProcessDiagramGenerator;
|
|
|
|
import cn.jyjz.flowable.config.CustomProcessDiagramGenerator;
|
|
|
|
import cn.jyjz.flowable.domain.vo.*;
|
|
|
|
import cn.jyjz.flowable.domain.vo.*;
|
|
|
|
|
|
|
|
import cn.jyjz.flowable.entity.FlowApprove;
|
|
|
|
|
|
|
|
import cn.jyjz.flowable.entity.FlowTaskInfo;
|
|
|
|
import cn.jyjz.flowable.service.IFlowInstanceService;
|
|
|
|
import cn.jyjz.flowable.service.IFlowInstanceService;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.language.SystemMessage;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.language.SystemMessage;
|
|
|
|
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.requestFormat.SearchQuery;
|
|
|
|
import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQuery;
|
|
|
|
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;
|
|
|
|
@ -27,18 +30,23 @@ import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Flowablecc;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Flowablecc;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.UserFinal;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.service.*;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.service.*;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPicture;
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.RepeatedTaskVo;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.OcrTaskchildPictureAppro;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.*;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.OcrTaskchildPictureService;
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.*;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.vo.OcrTaskChildPictureVo;
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.vo.OcrTaskchildPictureApproVo;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
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.core.toolkit.StringUtils;
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
import org.flowable.bpmn.constants.BpmnXMLConstants;
|
|
|
|
import org.flowable.bpmn.constants.BpmnXMLConstants;
|
|
|
|
import org.flowable.bpmn.model.*;
|
|
|
|
import org.flowable.bpmn.model.*;
|
|
|
|
import org.flowable.bpmn.model.Process;
|
|
|
|
import org.flowable.bpmn.model.Process;
|
|
|
|
@ -46,10 +54,8 @@ import org.flowable.engine.ProcessEngineConfiguration;
|
|
|
|
import org.flowable.engine.history.HistoricActivityInstance;
|
|
|
|
import org.flowable.engine.history.HistoricActivityInstance;
|
|
|
|
import org.flowable.engine.history.HistoricProcessInstance;
|
|
|
|
import org.flowable.engine.history.HistoricProcessInstance;
|
|
|
|
import org.flowable.engine.history.HistoricProcessInstanceQuery;
|
|
|
|
import org.flowable.engine.history.HistoricProcessInstanceQuery;
|
|
|
|
import org.flowable.engine.impl.persistence.entity.ActivityInstanceEntity;
|
|
|
|
|
|
|
|
import org.flowable.engine.impl.util.ExecutionGraphUtil;
|
|
|
|
import org.flowable.engine.impl.util.ExecutionGraphUtil;
|
|
|
|
import org.flowable.engine.repository.ProcessDefinition;
|
|
|
|
import org.flowable.engine.repository.ProcessDefinition;
|
|
|
|
import org.flowable.engine.runtime.ActivityInstance;
|
|
|
|
|
|
|
|
import org.flowable.engine.runtime.Execution;
|
|
|
|
import org.flowable.engine.runtime.Execution;
|
|
|
|
import org.flowable.engine.runtime.ProcessInstance;
|
|
|
|
import org.flowable.engine.runtime.ProcessInstance;
|
|
|
|
import org.flowable.engine.task.Comment;
|
|
|
|
import org.flowable.engine.task.Comment;
|
|
|
|
@ -62,7 +68,6 @@ import org.flowable.task.api.history.HistoricTaskInstance;
|
|
|
|
import org.flowable.task.api.history.HistoricTaskInstanceQuery;
|
|
|
|
import org.flowable.task.api.history.HistoricTaskInstanceQuery;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
|
|
@ -100,6 +105,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
private IRunFlowableActinstDao runFlowableActinstDao;
|
|
|
|
private IRunFlowableActinstDao runFlowableActinstDao;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private IHisFlowableActinstDao hisFlowableActinstDao;
|
|
|
|
private IHisFlowableActinstDao hisFlowableActinstDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private OcrUsersearchService ocrUsersearchService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private OcrPictureService ocrPictureService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private IOcrMsgService ocrMsgService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void myTodoTaskList(PageUtils vo, HttpServletRequest request) {
|
|
|
|
public void myTodoTaskList(PageUtils vo, HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
|
|
|
@ -304,6 +319,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
category.setFormid(busskey[1]);
|
|
|
|
category.setFormid(busskey[1]);
|
|
|
|
return category;
|
|
|
|
return category;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取已办流程过程图
|
|
|
|
* 获取已办流程过程图
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -419,98 +435,96 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
* 完成任务
|
|
|
|
* 完成任务
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Boolean complete(FlowTaskVO taskVO,HttpServletRequest request) {
|
|
|
|
public Integer complete(FlowApprove approve, UserToken userToken, List<String> formIds) {
|
|
|
|
|
|
|
|
Integer successCount = 0;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(approve.getFlowTaskInfoList())) {
|
|
|
|
|
|
|
|
List<FlowTaskInfo> flowTaskInfoList = approve.getFlowTaskInfoList();
|
|
|
|
|
|
|
|
for (FlowTaskInfo flowTaskInfo : flowTaskInfoList) {
|
|
|
|
|
|
|
|
if (!formIds.contains(flowTaskInfo.getFormId())) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
// 当前要处理的任务
|
|
|
|
// 当前要处理的任务
|
|
|
|
Task task = taskService.createTaskQuery().taskId(taskVO.getTaskId()).singleResult();
|
|
|
|
Task task = taskService.createTaskQuery().taskId(flowTaskInfo.getTaskId()).singleResult();
|
|
|
|
// 查询流程定义的信息
|
|
|
|
// 查询流程定义的信息
|
|
|
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
|
|
|
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
|
|
|
|
.processDefinitionId(task.getProcessDefinitionId())
|
|
|
|
.processDefinitionId(task.getProcessDefinitionId())
|
|
|
|
.singleResult();
|
|
|
|
.singleResult();
|
|
|
|
// 对任务添加对应的审批意见
|
|
|
|
// 对任务添加对应的审批意见
|
|
|
|
taskService.addComment(task.getId(),task.getProcessInstanceId(),taskVO.getTaskComment());
|
|
|
|
taskService.addComment(task.getId(), task.getProcessInstanceId(), approve.getComment());
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> variables = new HashMap<>();
|
|
|
|
Map<String, Object> variables = new HashMap<>();
|
|
|
|
if(null != taskVO.getTaskApprovd() && StringUtils.isNotBlank(taskVO.getTaskApprovd().toString())){
|
|
|
|
variables.put("approvd", approve.getResult());
|
|
|
|
variables.put("taskApprovd",taskVO.getTaskApprovd().intValue());
|
|
|
|
OcrTaskchildPicture model = ocrTaskchildPictureService.getById(Long.parseLong(flowTaskInfo.getFormId()));
|
|
|
|
}
|
|
|
|
if (approve.getResult()) {
|
|
|
|
variables.put("approvd",taskVO.getApprovd());
|
|
|
|
disposeSucceedTask(task, processDefinition, variables, model, flowTaskInfo.getFormId(), userToken);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
//只有同意,再进行候选人设置
|
|
|
|
disposeFailureTask(task, flowTaskInfo.getFormId(), variables);
|
|
|
|
if(taskVO.getApprovd()){
|
|
|
|
|
|
|
|
//进入下一个节点
|
|
|
|
|
|
|
|
taskService.complete(task.getId(),variables);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断是否存在表单二次提交
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(taskVO.getDocumentation()) && taskVO.getDocumentation().equals(SystemConstantsOa.OA_TASK_COMPLETE_FORM)){
|
|
|
|
|
|
|
|
//获取流程类型
|
|
|
|
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(category)){
|
|
|
|
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
|
|
|
|
//解析页面请求,并持久化
|
|
|
|
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 如果更新失败,需要撤销流程
|
|
|
|
|
|
|
|
if(null == iFormCustomService.editForm(request,taskVO.getFormid())){
|
|
|
|
|
|
|
|
//撤销审批
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
userapproveService.save(userToken, approve, task, flowTaskInfo.getFormId());
|
|
|
|
|
|
|
|
successCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//判断是否存在表单三次提交
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(taskVO.getDocumentation()) && taskVO.getDocumentation().equals(SystemConstantsOa.OA_TASK_COMPLETE_THREE_FORM)){
|
|
|
|
|
|
|
|
//获取流程类型
|
|
|
|
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
|
|
|
|
if(StringUtils.isNotBlank(category)){
|
|
|
|
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
|
|
|
|
//解析页面请求,并持久化
|
|
|
|
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 如果更新失败,需要撤销流程
|
|
|
|
|
|
|
|
if(null == iFormCustomService.editForm(request,taskVO.getFormid())){
|
|
|
|
|
|
|
|
//撤销审批
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//保存当前审批用户与业务表的关系
|
|
|
|
|
|
|
|
return successCount;
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
log.error("e={}", e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return successCount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
updateAssignee(task.getProcessInstanceId(),task.getProcessDefinitionId(),processDefinition);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 处理审批成功任务
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void disposeSucceedTask(Task task, ProcessDefinition processDefinition, Map<String, Object> variables, OcrTaskchildPicture model, String formId, UserToken userToken) {
|
|
|
|
|
|
|
|
//进入下一个节点
|
|
|
|
|
|
|
|
taskService.complete(task.getId(), variables);
|
|
|
|
|
|
|
|
updateAssignee(task.getProcessInstanceId(), task.getProcessDefinitionId(), processDefinition);
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
String category = processDefinition.getCategory();
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
Category categoryDto = this.categoryService.getCategory(category);
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
IFormCustomService iFormCustomService = SpringUtils.getBean(categoryDto.getServicename());
|
|
|
|
|
|
|
|
FlowModelVO formData = iFormCustomService.getForm(formId);
|
|
|
|
FlowModelVO formData = iFormCustomService.getForm(taskVO.getFormid());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Task> taskList = this.nowRunTask(formData.getProcessInstanceId(), formData.getProcessdefinitionid());
|
|
|
|
List<Task> taskList = this.nowRunTask(formData.getProcessInstanceId(), formData.getProcessdefinitionid());
|
|
|
|
Task taskData = null;
|
|
|
|
Task taskData = null;
|
|
|
|
if (null != taskList && !taskList.isEmpty()) {
|
|
|
|
if (null != taskList && !taskList.isEmpty()) {
|
|
|
|
taskData = taskList.get(0);
|
|
|
|
taskData = taskList.get(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(taskData)) {
|
|
|
|
|
|
|
|
model.setFinishtime(System.currentTimeMillis());
|
|
|
|
|
|
|
|
model.setStates(SystemConstantsOa.OA_STATUS_TYPE_END);
|
|
|
|
|
|
|
|
ocrTaskchildPictureService.updateById(model);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
//判断节点上的描述字段,是否伟finale_judgment,如果是,记录到终审表中,如果终审表已经存在,不再重复记录
|
|
|
|
//判断节点上的描述字段,是否伟finale_judgment,如果是,记录到终审表中,如果终审表已经存在,不再重复记录
|
|
|
|
if(null != taskData && StringUtils.isNotBlank(taskData.getDescription()) && taskData.getDescription().equals(SystemConstantsOa.OA_TASK_COMPLETE_FINALE_FORM)){
|
|
|
|
if (StringUtils.isNotBlank(taskData.getDescription()) && taskData.getDescription().equals(SystemConstantsOa.OA_TASK_COMPLETE_FINALE_FORM)) {
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
|
|
|
User user = userService.findByLoginname(formData.getAssignee());
|
|
|
|
User user = userService.findByLoginname(formData.getAssignee());
|
|
|
|
userFinalService.save(user.getId().toString(),taskVO.getFormid());
|
|
|
|
userFinalService.save(user.getId().toString(), formId);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
OcrTaskchildPicture childPicture = ocrTaskchildPictureService.getById(Long.parseLong(formId));
|
|
|
|
|
|
|
|
this.sendMsg(childPicture, userToken);
|
|
|
|
|
|
|
|
childPicture.setTaskId(taskData.getId());
|
|
|
|
|
|
|
|
childPicture.setTaskname(taskData.getName());
|
|
|
|
|
|
|
|
ocrTaskchildPictureService.updateById(childPicture);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//增加未查看记录
|
|
|
|
//增加未查看记录
|
|
|
|
userViewApproeService.saveUserViewApproe(formData.getAssignee(), formData.getFormid().toString(), formData.getTenantid().toString());
|
|
|
|
userViewApproeService.saveUserViewApproe(formData.getAssignee(), formData.getFormid().toString(), formData.getTenantid().toString());
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 处理失败任务
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private void disposeFailureTask(Task task, String formId, Map<String, Object> variables) {
|
|
|
|
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
|
|
|
|
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();
|
|
|
|
//我这里以 流程定义key(oa_category_t定义的关键字,逻辑唯一) + 业务表主键(请假表、调岗表等) + 业务表对应的servicename
|
|
|
|
//我这里以 流程定义key(oa_category_t定义的关键字,逻辑唯一) + 业务表主键(请假表、调岗表等) + 业务表对应的servicename
|
|
|
|
String businesskey = processInstance.getBusinessKey();
|
|
|
|
String businesskey = processInstance.getBusinessKey();
|
|
|
|
//3、修改业务表状态
|
|
|
|
//3、修改业务表状态
|
|
|
|
//判断业务key是否存在
|
|
|
|
//判断业务key是否存在
|
|
|
|
if (StringUtils.isNotBlank(businesskey)) {
|
|
|
|
if (StringUtils.isNotBlank(businesskey)) {
|
|
|
|
|
|
|
|
|
|
|
|
String assignee = "";
|
|
|
|
String assignee = "";
|
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
|
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());
|
|
|
|
//传节点定义key获取当前节点
|
|
|
|
//传节点定义key获取当前节点
|
|
|
|
FlowElement flowElement = bpmnModel.getFlowElement(task.getTaskDefinitionKey());
|
|
|
|
FlowElement flowElement = bpmnModel.getFlowElement(task.getTaskDefinitionKey());
|
|
|
|
if (flowElement instanceof UserTask) {
|
|
|
|
if (flowElement instanceof UserTask) {
|
|
|
|
UserTask userTask = (UserTask) flowElement;
|
|
|
|
UserTask userTask = (UserTask) flowElement;
|
|
|
|
|
|
|
|
|
|
|
|
//如果审批不存在,需要在候选组中查询
|
|
|
|
//如果审批不存在,需要在候选组中查询
|
|
|
|
if (StringUtils.isBlank(userTask.getAssignee())) {
|
|
|
|
if (StringUtils.isBlank(userTask.getAssignee())) {
|
|
|
|
assignee = userTask.getAssignee();
|
|
|
|
assignee = userTask.getAssignee();
|
|
|
|
@ -521,33 +535,47 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
//设置流程结束状态
|
|
|
|
//设置流程结束状态
|
|
|
|
iFormCustomService.endForm(busskey[1], SystemConstantsOa.OA_STATUS_TYPE_REFUSE, assignee, task.getProcessInstanceId(), task.getName());
|
|
|
|
iFormCustomService.endForm(busskey[1], SystemConstantsOa.OA_STATUS_TYPE_REFUSE, assignee, task.getProcessInstanceId(), task.getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//1、获取终止节点
|
|
|
|
//1、获取终止节点
|
|
|
|
List<EndEvent> endNodes = findEndFlowElement(task.getProcessDefinitionId());
|
|
|
|
List<EndEvent> endNodes = findEndFlowElement(task.getProcessDefinitionId());
|
|
|
|
String endId = endNodes.get(0).getId();
|
|
|
|
|
|
|
|
//2、执行终止
|
|
|
|
//2、执行终止
|
|
|
|
List<Execution> executions = runtimeService.createExecutionQuery().parentId(task.getProcessInstanceId()).list();
|
|
|
|
List<Execution> executions = runtimeService.createExecutionQuery().parentId(task.getProcessInstanceId()).list();
|
|
|
|
List<String> executionIds = new ArrayList<>();
|
|
|
|
List<String> executionIds = new ArrayList<>();
|
|
|
|
executions.forEach(execution -> executionIds.add(execution.getId()));
|
|
|
|
executions.forEach(execution -> executionIds.add(execution.getId()));
|
|
|
|
runtimeService.createChangeActivityStateBuilder().moveExecutionsToSingleActivityId(executionIds, endId).processVariables(variables).changeState();
|
|
|
|
OcrTaskchildPicture taskchildPicture = ocrTaskchildPictureService.getById(Long.parseLong(formId));
|
|
|
|
|
|
|
|
taskchildPicture.setFinishtime(System.currentTimeMillis());
|
|
|
|
}
|
|
|
|
ocrTaskchildPictureService.updateById(taskchildPicture);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
//发送消息
|
|
|
|
//保存当前审批用户与业务表的关系
|
|
|
|
public void sendMsg(OcrTaskchildPicture model, UserToken userToken) {
|
|
|
|
userapproveService.save(userToken.getUserid(),taskVO,task);
|
|
|
|
cn.jyjz.xiaoyao.common.base.vo.User byLoginname = userTokenService.findByLoginname(model.getAssignee());
|
|
|
|
|
|
|
|
OcrMsg msg = new OcrMsg();
|
|
|
|
|
|
|
|
msg.setCreateTime(System.currentTimeMillis());
|
|
|
|
return true;
|
|
|
|
msg.setSendTime(System.currentTimeMillis());
|
|
|
|
}catch (Exception e){
|
|
|
|
msg.setReceiveUserIds(byLoginname.getId().toString());
|
|
|
|
log.error("e={}",e);
|
|
|
|
msg.setTitile(model.getFromtaskname());
|
|
|
|
}
|
|
|
|
msg.setSender(Long.valueOf(userToken.getUserid()));
|
|
|
|
return false;
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
|
|
jsonObject.put("taskId", model.getFromtaskid());
|
|
|
|
|
|
|
|
jsonObject.put("nodeName", model.getTaskname());
|
|
|
|
|
|
|
|
jsonObject.put("states", 1);
|
|
|
|
|
|
|
|
jsonObject.put("sendUserId", userToken.getUserid());
|
|
|
|
|
|
|
|
jsonObject.put("sendUserName", userToken.getUsername());
|
|
|
|
|
|
|
|
jsonObject.put("sendTime", System.currentTimeMillis());
|
|
|
|
|
|
|
|
jsonObject.put("fromId", model.getId().toString());
|
|
|
|
|
|
|
|
jsonObject.put("taskName", model.getFromtaskname());
|
|
|
|
|
|
|
|
jsonObject.put("pictureId", model.getPictureid());
|
|
|
|
|
|
|
|
jsonObject.put("packageId", model.getPackageid());
|
|
|
|
|
|
|
|
msg.setBusJson(jsonObject.toJSONString());
|
|
|
|
|
|
|
|
msg.setCreateBy(Long.valueOf(userToken.getUserid()));
|
|
|
|
|
|
|
|
msg.setCreateTime(System.currentTimeMillis());
|
|
|
|
|
|
|
|
msg.setSendStatus("1");
|
|
|
|
|
|
|
|
ocrMsgService.save(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 更新当前节点处理人信息
|
|
|
|
* 更新当前节点处理人信息
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param processDefinition
|
|
|
|
* @param processDefinition
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void updateAssignee(String processInstanceId, String processDefinitionId, ProcessDefinition processDefinition) {
|
|
|
|
public void updateAssignee(String processInstanceId, String processDefinitionId, ProcessDefinition processDefinition) {
|
|
|
|
@ -568,11 +596,12 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
if (StringUtils.isNotBlank(businesskey)) {
|
|
|
|
if (StringUtils.isNotBlank(businesskey)) {
|
|
|
|
String[] busskey = businesskey.split(SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT);
|
|
|
|
String[] busskey = businesskey.split(SystemConstantsOa.OA_BUSSINESS_KEY_SPLIT);
|
|
|
|
iFormCustomService = SpringUtils.getBean(busskey[2]);
|
|
|
|
iFormCustomService = SpringUtils.getBean(busskey[2]);
|
|
|
|
iFormCustomService.updateForm(busskey[1],processDefinition.getDeploymentId(),processDefinition.getId(),flowTaskCompleteVO.getAssignee(),flowTaskCompleteVO.getTaskId(),processInstanceId,task.getName());
|
|
|
|
iFormCustomService.updateForm(busskey[1], processDefinition.getDeploymentId(), processDefinition.getId(), flowTaskCompleteVO.getAssignee(), flowTaskCompleteVO.getTaskId(), processInstanceId, task);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List findEndFlowElement(String processDefId) {
|
|
|
|
public List findEndFlowElement(String processDefId) {
|
|
|
|
Process mainProcess = repositoryService.getBpmnModel(processDefId).getMainProcess();
|
|
|
|
Process mainProcess = repositoryService.getBpmnModel(processDefId).getMainProcess();
|
|
|
|
Collection<FlowElement> list = mainProcess.getFlowElements();
|
|
|
|
Collection<FlowElement> list = mainProcess.getFlowElements();
|
|
|
|
@ -581,8 +610,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return list.stream().filter(f -> f instanceof EndEvent).collect(Collectors.toList());
|
|
|
|
return list.stream().filter(f -> f instanceof EndEvent).collect(Collectors.toList());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查看当前执行人列表
|
|
|
|
* 查看当前执行人列表
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param processInstanceId
|
|
|
|
* @param processInstanceId
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -636,6 +667,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 设置当前审批节点的审批人
|
|
|
|
* 设置当前审批节点的审批人
|
|
|
|
* 目前只多候选组和多个候选人起作用
|
|
|
|
* 目前只多候选组和多个候选人起作用
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param processInstanceId
|
|
|
|
* @param processInstanceId
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public FlowTaskCompleteVO updateNowTaskAssignee(String processInstanceId, String processDefinitionId) {
|
|
|
|
public FlowTaskCompleteVO updateNowTaskAssignee(String processInstanceId, String processDefinitionId) {
|
|
|
|
@ -703,6 +735,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return flowTaskCompleteVO;
|
|
|
|
return flowTaskCompleteVO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 设置当前审批节点的
|
|
|
|
* 设置当前审批节点的
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -713,8 +746,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
.list();
|
|
|
|
.list();
|
|
|
|
return taskList;
|
|
|
|
return taskList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取下一个节点审批人信息
|
|
|
|
* 获取下一个节点审批人信息
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param userTaskList
|
|
|
|
* @param userTaskList
|
|
|
|
* @param bpmnModel
|
|
|
|
* @param bpmnModel
|
|
|
|
* @param currentId
|
|
|
|
* @param currentId
|
|
|
|
@ -755,6 +790,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询我的已办信息
|
|
|
|
* 查询我的已办信息
|
|
|
|
|
|
|
|
*
|
|
|
|
* @param pageUtils
|
|
|
|
* @param pageUtils
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
@ -879,6 +915,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查看任务的流程记录
|
|
|
|
* 查看任务的流程记录
|
|
|
|
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public List<HistoricTaskInstanceDto> listHistoriceTask(String processInstanceId) {
|
|
|
|
public List<HistoricTaskInstanceDto> listHistoriceTask(String processInstanceId) {
|
|
|
|
@ -943,7 +980,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
if (StringUtils.isNotBlank(pageUtils.getSortname())) {
|
|
|
|
if (StringUtils.isNotBlank(pageUtils.getSortname())) {
|
|
|
|
paramterPage.setSortname(pageUtils.getSortname());
|
|
|
|
paramterPage.setSortname(pageUtils.getSortname());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
paramterPage.setSortname("CREATEDATE");
|
|
|
|
paramterPage.setSortname("submit_date_timestamp");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(pageUtils.getSortorder())) {
|
|
|
|
if (StringUtils.isNotBlank(pageUtils.getSortorder())) {
|
|
|
|
@ -1048,6 +1085,49 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
pageUtils.setList(list);
|
|
|
|
pageUtils.setList(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public IPage<OcrTaskchildPicture> queryPageByUserSearchId(Integer pageNo, Integer pageSize, String userSearchId) {
|
|
|
|
|
|
|
|
OcrUsersearch ocrUsersearch = ocrUsersearchService.selectByUserSearchId(userSearchId);
|
|
|
|
|
|
|
|
List<OcrUsersearchchild> ocrUsersearchchildList = ocrUsersearch.getOcrUsersearchchildList();
|
|
|
|
|
|
|
|
for (OcrUsersearchchild ocrUsersearchchild : ocrUsersearchchildList) {
|
|
|
|
|
|
|
|
String searchfield = ocrUsersearchchild.getSearchfield();
|
|
|
|
|
|
|
|
switch (searchfield) {
|
|
|
|
|
|
|
|
case "izupuser":
|
|
|
|
|
|
|
|
ocrUsersearchchild.setSearchfield("FROMUSERID");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "izproject":
|
|
|
|
|
|
|
|
ocrUsersearchchild.setSearchfield("FROMPROJECTID");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "izplan":
|
|
|
|
|
|
|
|
ocrUsersearchchild.setSearchfield("FROMPLANID");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "izstatus":
|
|
|
|
|
|
|
|
ocrUsersearchchild.setSearchfield("STATES");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "iztaskrrom":
|
|
|
|
|
|
|
|
ocrUsersearchchild.setSearchfield("FROMSOURCEID");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "izuptime":
|
|
|
|
|
|
|
|
ocrUsersearchchild.setSearchfield("FROMUPTIME");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ocrUsersearch.setOcrUsersearchchildList(ocrUsersearchchildList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
QueryWrapper<OcrTaskchildPicture> queryWrapper = new QueryWrapper();
|
|
|
|
|
|
|
|
for (OcrUsersearchchild usersearchchild : ocrUsersearch.getOcrUsersearchchildList()) {
|
|
|
|
|
|
|
|
this.formattingSearchChild(queryWrapper, usersearchchild);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//分页查询并组装子集数据
|
|
|
|
|
|
|
|
Page<OcrTaskchildPicture> page = new Page<>(pageNo, pageSize);
|
|
|
|
|
|
|
|
IPage<OcrTaskchildPicture> pageList = ocrTaskchildPictureService.page(page, queryWrapper);
|
|
|
|
|
|
|
|
return pageList;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询我发起的流程实例
|
|
|
|
* 查询我发起的流程实例
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -1086,6 +1166,32 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
// flowableccIPage.setRecords(list);
|
|
|
|
// flowableccIPage.setRecords(list);
|
|
|
|
for (FlowUnionVo flowUnionVo : list) {
|
|
|
|
for (FlowUnionVo flowUnionVo : list) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (flowUnionVo.getStates() != null) {
|
|
|
|
|
|
|
|
String stateText;
|
|
|
|
|
|
|
|
switch (flowUnionVo.getStates()) {
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
stateText = "撤销";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
stateText = "审批中";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
stateText = "审批通过";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
|
|
|
|
stateText = "审批未通过";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
stateText = "未知状态";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 将中文状态赋值给 flowUnionVo 的状态属性
|
|
|
|
|
|
|
|
flowUnionVo.setStatesText(stateText);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//暂定,后期会修改
|
|
|
|
|
|
|
|
flowUnionVo.setStatesText("审批中");
|
|
|
|
|
|
|
|
}
|
|
|
|
//查询对应的流程分类
|
|
|
|
//查询对应的流程分类
|
|
|
|
Category category = categoryService.selectDtoById(flowUnionVo.getCategoryid());
|
|
|
|
Category category = categoryService.selectDtoById(flowUnionVo.getCategoryid());
|
|
|
|
flowUnionVo.setCategoryDto(category);
|
|
|
|
flowUnionVo.setCategoryDto(category);
|
|
|
|
@ -1186,7 +1292,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
* @param tenantId
|
|
|
|
* @param tenantId
|
|
|
|
* @param pageUtils
|
|
|
|
* @param pageUtils
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public void getMyProcessInstances(User user,String tenantId,Map<String, Object> searchQuery, PageUtils pageUtils){
|
|
|
|
public void getMyProcessInstances(User user, String tenantId, Map<String, Object> searchQuery, PageUtils pageUtils, String userSearchId) {
|
|
|
|
ParamterPage paramterPage = new ParamterPage();
|
|
|
|
ParamterPage paramterPage = new ParamterPage();
|
|
|
|
paramterPage.setStart((pageUtils.getCurrPage() - 1) * pageUtils.getPageSize());
|
|
|
|
paramterPage.setStart((pageUtils.getCurrPage() - 1) * pageUtils.getPageSize());
|
|
|
|
paramterPage.setPagesize(pageUtils.getPageSize());
|
|
|
|
paramterPage.setPagesize(pageUtils.getPageSize());
|
|
|
|
@ -1211,14 +1317,33 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
query.put("searchassignee", user.getLoginname());
|
|
|
|
query.put("searchassignee", user.getLoginname());
|
|
|
|
query.putAll(searchQuery);
|
|
|
|
query.putAll(searchQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (!StringUtils.isBlank(userSearchId)) {
|
|
|
|
|
|
|
|
// OcrUsersearch ocrUsersearch = ocrUsersearchService.selectByUserSearchId(userSearchId);
|
|
|
|
|
|
|
|
// SearchQuery additionalQuery = new SearchQuery();
|
|
|
|
|
|
|
|
// for (OcrUsersearchchild usersearchchild : ocrUsersearch.getOcrUsersearchchildList()) {
|
|
|
|
|
|
|
|
// this.formattingSearchChild1(additionalQuery, usersearchchild);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// query.putAll(additionalQuery.getQuery());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
Long count = ocrTaskchildPictureService.listmytaskCount(query);
|
|
|
|
Long count = ocrTaskchildPictureService.listmytaskCount(query);
|
|
|
|
|
|
|
|
|
|
|
|
query.put("page", paramterPage);
|
|
|
|
query.put("page", paramterPage);
|
|
|
|
List<OcrTaskchildPictureAppro> list = ocrTaskchildPictureService.listmytask(query);
|
|
|
|
List<OcrTaskchildPictureAppro> list = ocrTaskchildPictureService.listmytask(query);
|
|
|
|
|
|
|
|
|
|
|
|
for (OcrTaskchildPictureAppro taskchildPicture : list) {
|
|
|
|
for (OcrTaskchildPictureAppro taskchildPicture : list) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (taskchildPicture.getPictureid() != null && !taskchildPicture.getPictureid().isEmpty()) {
|
|
|
|
|
|
|
|
Long pictureId = Long.parseLong(taskchildPicture.getPictureid());
|
|
|
|
|
|
|
|
LambdaQueryWrapper<OcrPicture> ocrPictureLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
|
|
|
ocrPictureLambdaQueryWrapper.eq(OcrPicture::getId, pictureId);
|
|
|
|
|
|
|
|
OcrPicture ocrPictureOne = ocrPictureService.getOne(ocrPictureLambdaQueryWrapper);
|
|
|
|
|
|
|
|
taskchildPicture.setFromUserName(ocrPictureOne.getField1());
|
|
|
|
|
|
|
|
taskchildPicture.setPicture(ocrPictureOne);
|
|
|
|
|
|
|
|
taskchildPicture.setFinishTime(ocrPictureOne.getSubmitDateTimestamp());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//查询对应的流程分类
|
|
|
|
//查询对应的流程分类
|
|
|
|
Category category = categoryService.selectDtoById(taskchildPicture.getCategoryid());
|
|
|
|
Category category = categoryService.selectDtoById(Long.parseLong(taskchildPicture.getCategoryid()));
|
|
|
|
taskchildPicture.setCategoryDto(category);
|
|
|
|
taskchildPicture.setCategoryDto(category);
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(taskchildPicture.getProcessdefinitionid())) {
|
|
|
|
if (StringUtils.isNotBlank(taskchildPicture.getProcessdefinitionid())) {
|
|
|
|
@ -1304,9 +1429,109 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pageUtils.setTotalCount(count.intValue());
|
|
|
|
pageUtils.setTotalCount(count.intValue());
|
|
|
|
pageUtils.setList(list);
|
|
|
|
|
|
|
|
|
|
|
|
//补充历史状态名称,检查补充节点信息
|
|
|
|
|
|
|
|
for (OcrTaskchildPictureAppro ocrTaskchildPictureAppro : list) {
|
|
|
|
|
|
|
|
//审批节点 当前如果没有历史操作,则将当前节点赋值到历史审批节点中.
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(ocrTaskchildPictureAppro.getTasknamehis())) {
|
|
|
|
|
|
|
|
ocrTaskchildPictureAppro.setTasknamehis(ocrTaskchildPictureAppro.getTaskname());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ocrTaskchildPictureAppro.getStatshis() != null) {
|
|
|
|
|
|
|
|
String stateText;
|
|
|
|
|
|
|
|
switch (ocrTaskchildPictureAppro.getStatshis()) {
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
stateText = "待审批";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
stateText = "通过";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
|
|
stateText = "不通过";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
stateText = "未知状态";
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 将中文状态赋值给 flowUnionVo 的状态属性
|
|
|
|
|
|
|
|
ocrTaskchildPictureAppro.setStatshisText(stateText);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//暂定,后期修改
|
|
|
|
|
|
|
|
ocrTaskchildPictureAppro.setStatshisText("待审批");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<OcrTaskchildPictureApproVo> listNew = new ArrayList<>();
|
|
|
|
|
|
|
|
for (OcrTaskchildPictureAppro one : list) {
|
|
|
|
|
|
|
|
OcrTaskchildPictureApproVo ocrTaskchildPictureApproVo = new OcrTaskchildPictureApproVo();
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setId(one.getId()); //任务id
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setFromtaskname(one.getFromtaskname()); //任务名称
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setStatshisText(one.getStatshisText()); //历史-审批状态中文
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setTasknamehis(one.getTasknamehis());//历史-审批节点名称
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setFinishTime(one.getFinishTime()); //完成时间
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setReleaseProvince(one.getPicture().getReleaseprovince()); //省份
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setFromprojectid(one.getFromprojectid()); //项目id
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setProductName(one.getPicture().getField9()); //产品
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setCategory(one.getCategory()); //类型
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setFromsourceid(one.getFromsourceid()); //原始任务id
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setCustomerType(one.getPicture().getField2()); //客户类型
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setCustomerName(one.getPicture().getField3()); //客户名称
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setItemCategory(one.getPicture().getField17());//项目类别
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setFromUserName(one.getFromUserName()); //提报人
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setManufacturer(one.getPicture().getField5()); //manufacturer
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setPackageid(one.getPackageid()); //任务包id
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setProjectName(one.getFromprojectname());//项目名称
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setCustomerLevel(one.getFromCustomerLevel());//客户级别
|
|
|
|
|
|
|
|
ocrTaskchildPictureApproVo.setReleaseArea(one.getFromCity());//拜访城市
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listNew.add(ocrTaskchildPictureApproVo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pageUtils.setList(listNew);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 查询我的待办、已经办理任务
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param user
|
|
|
|
|
|
|
|
* @param tenantId
|
|
|
|
|
|
|
|
* @param pageUtils
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public List<OcrTaskchildPictureAppro> getMyProcessInstancesNew(User user, String tenantId, Map<String, Object> searchQuery, PageUtils pageUtils) {
|
|
|
|
|
|
|
|
ParamterPage paramterPage = new ParamterPage();
|
|
|
|
|
|
|
|
paramterPage.setStart((pageUtils.getCurrPage() - 1) * pageUtils.getPageSize());
|
|
|
|
|
|
|
|
paramterPage.setPagesize(pageUtils.getPageSize());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(pageUtils.getSortname())) {
|
|
|
|
|
|
|
|
paramterPage.setSortname(pageUtils.getSortname());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
paramterPage.setSortname("CREATEDATE");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(pageUtils.getSortorder())) {
|
|
|
|
|
|
|
|
paramterPage.setSortorder(pageUtils.getSortorder());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
paramterPage.setSortorder("DESC");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, Object> query = new HashMap<>();
|
|
|
|
|
|
|
|
query.put("page", paramterPage);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.put("thisLoginUserid", user.getId().toString());
|
|
|
|
|
|
|
|
query.put("searchtenantid", tenantId);
|
|
|
|
|
|
|
|
//我的待办数据
|
|
|
|
|
|
|
|
query.put("searchassignee", user.getLoginname());
|
|
|
|
|
|
|
|
query.putAll(searchQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long count = ocrTaskchildPictureService.listmytaskCount(query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query.put("page", paramterPage);
|
|
|
|
|
|
|
|
List<OcrTaskchildPictureAppro> list = ocrTaskchildPictureService.listmytask(query);
|
|
|
|
|
|
|
|
return list;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询我发起的流程实例
|
|
|
|
* 查询我发起的流程实例
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -1413,6 +1638,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 抄送给我的
|
|
|
|
* 抄送给我的
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -1462,7 +1688,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询历史
|
|
|
|
//查询历史
|
|
|
|
List<HistoricTaskInstanceDto> historicTaskInstanceDtos = new ArrayList<>();
|
|
|
|
List<HistoricTaskInstanceDto> historicTaskInstanceDtos = new ArrayList<>();
|
|
|
|
// 查询当前任务的流转信息
|
|
|
|
// 查询当前任务的流转信息
|
|
|
|
@ -1509,6 +1734,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
flowableccIPage.setRecords(list);
|
|
|
|
flowableccIPage.setRecords(list);
|
|
|
|
return flowableccIPage;
|
|
|
|
return flowableccIPage;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void cancelTask(String taskId, String reason) {
|
|
|
|
public void cancelTask(String taskId, String reason) {
|
|
|
|
// 获取当前任务
|
|
|
|
// 获取当前任务
|
|
|
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
|
|
|
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
|
|
|
@ -1593,4 +1819,266 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
return ResultVoUtil.success(flowableccMybatisDao.repetitionTask());
|
|
|
|
return ResultVoUtil.success(flowableccMybatisDao.repetitionTask());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize) {
|
|
|
|
|
|
|
|
Page<OcrTaskchildPicture> page = new Page<>(pageNo, pageSize);
|
|
|
|
|
|
|
|
Page<OcrTaskchildPicture> result = flowableccMybatisDao.repetitionTaskList(page);
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 格式化筛选关系
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param queryWrapper
|
|
|
|
|
|
|
|
* @param usersearchchild
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private QueryWrapper<OcrTaskchildPicture> formattingSearchChild(QueryWrapper<OcrTaskchildPicture> queryWrapper, OcrUsersearchchild usersearchchild) {
|
|
|
|
|
|
|
|
switch (usersearchchild.getSearchRelationType()) {
|
|
|
|
|
|
|
|
case "where":
|
|
|
|
|
|
|
|
this.formattingSearchType(queryWrapper, usersearchchild);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "and":
|
|
|
|
|
|
|
|
queryWrapper.and(wrapper -> this.formattingSearchType(wrapper, usersearchchild));
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "or":
|
|
|
|
|
|
|
|
queryWrapper.or(wrapper -> this.formattingSearchType(wrapper, usersearchchild));
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return queryWrapper;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return queryWrapper;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 格式化查询类型
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param queryWrapper
|
|
|
|
|
|
|
|
* @param usersearchchild
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private QueryWrapper<OcrTaskchildPicture> formattingSearchType(QueryWrapper<OcrTaskchildPicture> queryWrapper, OcrUsersearchchild usersearchchild) {
|
|
|
|
|
|
|
|
//查询类型 相等true 不相等fase
|
|
|
|
|
|
|
|
boolean queryType = "eq".equals(usersearchchild.getSearchtype());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//1.获取检查数据,确定数据类型
|
|
|
|
|
|
|
|
String valueType = SearchParaFormatting.clickSearchValue(usersearchchild.getSearchvalue());
|
|
|
|
|
|
|
|
List<String> arrayData = null; //集合型数据
|
|
|
|
|
|
|
|
List<Integer> sectionInts = null; //纯数字区间型数据
|
|
|
|
|
|
|
|
String[] sections = null; //字符串区间型数据
|
|
|
|
|
|
|
|
DateTime beginTime = null; //日期时间区间型数据
|
|
|
|
|
|
|
|
DateTime endTime = null; //日期时间区间型数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//2.根据数据类型,解构数据
|
|
|
|
|
|
|
|
switch (valueType) {
|
|
|
|
|
|
|
|
case "array":
|
|
|
|
|
|
|
|
//处理多文件
|
|
|
|
|
|
|
|
String[] datas = usersearchchild.getSearchvalue().split(",");
|
|
|
|
|
|
|
|
arrayData = Arrays.asList(datas);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "section":
|
|
|
|
|
|
|
|
//格式化数据,仅在做区间的时候去除空格,其他地方不进行空格去除.
|
|
|
|
|
|
|
|
sections = usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-");
|
|
|
|
|
|
|
|
//校验是否纯数字,纯数字的话,要转成int,否则比对时会有问题
|
|
|
|
|
|
|
|
sectionInts = new ArrayList<>();
|
|
|
|
|
|
|
|
for (String data : sections) {
|
|
|
|
|
|
|
|
if (data.matches("\\d+")) {
|
|
|
|
|
|
|
|
sectionInts.add(Integer.parseInt(data));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "time":
|
|
|
|
|
|
|
|
//格式化时间数据
|
|
|
|
|
|
|
|
String[] times = usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-");
|
|
|
|
|
|
|
|
beginTime = DateUtil.parse(times[0], "yyyy/MM/dd");
|
|
|
|
|
|
|
|
endTime = DateUtil.parse(times[1], "yyyy/MM/dd");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//3.根据查询类型 组装查询条件 相等
|
|
|
|
|
|
|
|
switch (valueType) {
|
|
|
|
|
|
|
|
case "array":
|
|
|
|
|
|
|
|
//集合数据
|
|
|
|
|
|
|
|
//相等
|
|
|
|
|
|
|
|
if (queryType) {
|
|
|
|
|
|
|
|
queryWrapper.in(usersearchchild.getSearchfield(), arrayData);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//不相等
|
|
|
|
|
|
|
|
queryWrapper.notIn(usersearchchild.getSearchfield(), arrayData);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "section":
|
|
|
|
|
|
|
|
//数字区间查询
|
|
|
|
|
|
|
|
if (sectionInts != null && sectionInts.size() == 2) {
|
|
|
|
|
|
|
|
if (queryType) {
|
|
|
|
|
|
|
|
//相等
|
|
|
|
|
|
|
|
queryWrapper.between(usersearchchild.getSearchfield(), sectionInts.get(0), sectionInts.get(1));
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//不相等
|
|
|
|
|
|
|
|
queryWrapper.notBetween(usersearchchild.getSearchfield(), sectionInts.get(0), sectionInts.get(1));
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//字符串区间查询
|
|
|
|
|
|
|
|
if (queryType) {
|
|
|
|
|
|
|
|
//相等
|
|
|
|
|
|
|
|
queryWrapper.between(usersearchchild.getSearchfield(), sections[0], sections[1]);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//不相等
|
|
|
|
|
|
|
|
queryWrapper.notBetween(usersearchchild.getSearchfield(), sections[0], sections[1]);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case "time":
|
|
|
|
|
|
|
|
//时间区间数据
|
|
|
|
|
|
|
|
//相等
|
|
|
|
|
|
|
|
if (queryType) {
|
|
|
|
|
|
|
|
queryWrapper.between(usersearchchild.getSearchfield(), beginTime.getTime(), endTime.getTime());
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//不相等
|
|
|
|
|
|
|
|
queryWrapper.notBetween(usersearchchild.getSearchfield(), beginTime.getTime(), endTime.getTime());
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
if (queryType) {
|
|
|
|
|
|
|
|
queryWrapper.eq(usersearchchild.getSearchfield(), usersearchchild.getSearchvalue());
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
queryWrapper.ne(usersearchchild.getSearchfield(), usersearchchild.getSearchvalue());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return queryWrapper;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// private SearchQuery formattingSearchChild1(SearchQuery searchQuery, OcrUsersearchchild usersearchchild) {
|
|
|
|
|
|
|
|
// switch (usersearchchild.getSearchRelationType()) {
|
|
|
|
|
|
|
|
// case "where":
|
|
|
|
|
|
|
|
// // 添加 "where" 查询条件
|
|
|
|
|
|
|
|
// this.formattingSearchType1(searchQuery, usersearchchild);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case "and":
|
|
|
|
|
|
|
|
// // 添加 "and" 查询条件
|
|
|
|
|
|
|
|
// searchQuery.addRulesOp(usersearchchild.getSearchfield(),"and");
|
|
|
|
|
|
|
|
// SearchQuery andQuery = this.formattingSearchType1(searchQuery, usersearchchild);
|
|
|
|
|
|
|
|
// searchQuery.setSearchQuery(andQuery);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case "or":
|
|
|
|
|
|
|
|
// // 添加 "or" 查询条件
|
|
|
|
|
|
|
|
// searchQuery.addRulesOp(usersearchchild.getSearchfield(),"or");
|
|
|
|
|
|
|
|
// SearchQuery orQuery = this.formattingSearchType1(searchQuery, usersearchchild);
|
|
|
|
|
|
|
|
// searchQuery.setSearchQuery(orQuery);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// default:
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return searchQuery;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// private SearchQuery formattingSearchType1(SearchQuery searchQuery, OcrUsersearchchild usersearchchild) {
|
|
|
|
|
|
|
|
// //查询类型 相等true 不相等fase
|
|
|
|
|
|
|
|
// boolean queryType = "eq".equals(usersearchchild.getSearchtype());
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// // 1.获取检查数据,确定数据类型
|
|
|
|
|
|
|
|
// String valueType = SearchParaFormatting.clickSearchValue(usersearchchild.getSearchvalue());
|
|
|
|
|
|
|
|
// List<String> arrayData = null; //集合型数据
|
|
|
|
|
|
|
|
// List<Integer> sectionInts = null; //纯数字区间型数据
|
|
|
|
|
|
|
|
// String[] sections = null; //字符串区间型数据
|
|
|
|
|
|
|
|
// DateTime beginTime = null; //日期时间区间型数据
|
|
|
|
|
|
|
|
// DateTime endTime = null; //日期时间区间型数据
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// // 2.根据数据类型,解构数据
|
|
|
|
|
|
|
|
// switch (valueType) {
|
|
|
|
|
|
|
|
// case "array":
|
|
|
|
|
|
|
|
// //处理多文件
|
|
|
|
|
|
|
|
// String[] datas = usersearchchild.getSearchvalue().split(",");
|
|
|
|
|
|
|
|
// arrayData = Arrays.asList(datas);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case "section":
|
|
|
|
|
|
|
|
// //格式化数据,仅在做区间的时候去除空格,其他地方不进行空格去除.
|
|
|
|
|
|
|
|
// sections = usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-");
|
|
|
|
|
|
|
|
// //校验是否纯数字,纯数字的话,要转成int,否则比对时会有问题
|
|
|
|
|
|
|
|
// sectionInts = new ArrayList<>();
|
|
|
|
|
|
|
|
// for (String data : sections) {
|
|
|
|
|
|
|
|
// if (data.matches("\\d+")) {
|
|
|
|
|
|
|
|
// sectionInts.add(Integer.parseInt(data));
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case "time":
|
|
|
|
|
|
|
|
// //格式化时间数据
|
|
|
|
|
|
|
|
// String[] times = usersearchchild.getSearchvalue().trim().replaceAll("\\s+", "").split("-");
|
|
|
|
|
|
|
|
// beginTime = DateUtil.parse(times[0], "yyyy/MM/dd");
|
|
|
|
|
|
|
|
// endTime = DateUtil.parse(times[1], "yyyy/MM/dd");
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// default:
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// // 3.根据查询类型 组装查询条件 相等
|
|
|
|
|
|
|
|
// switch (valueType) {
|
|
|
|
|
|
|
|
// case "array":
|
|
|
|
|
|
|
|
// //集合数据
|
|
|
|
|
|
|
|
// //相等
|
|
|
|
|
|
|
|
// if (queryType) {
|
|
|
|
|
|
|
|
// searchQuery.addIn(usersearchchild.getSearchfield(), arrayData);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //不相等
|
|
|
|
|
|
|
|
// searchQuery.addNotIn(usersearchchild.getSearchfield(), arrayData);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// case "section":
|
|
|
|
|
|
|
|
// //数字区间查询
|
|
|
|
|
|
|
|
// if (sectionInts != null && sectionInts.size() == 2) {
|
|
|
|
|
|
|
|
// if (queryType) {
|
|
|
|
|
|
|
|
// //相等
|
|
|
|
|
|
|
|
// searchQuery.addGreaterEqual(usersearchchild.getSearchfield(), sectionInts.get(0));
|
|
|
|
|
|
|
|
// searchQuery.addLessEqual(usersearchchild.getSearchfield(), sectionInts.get(1));
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //不相等
|
|
|
|
|
|
|
|
// searchQuery.addLess(usersearchchild.getSearchfield(), sectionInts.get(0));
|
|
|
|
|
|
|
|
// searchQuery.addGreater(usersearchchild.getSearchfield(), sectionInts.get(1));
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// //字符串区间查询
|
|
|
|
|
|
|
|
// if (queryType) {
|
|
|
|
|
|
|
|
// //相等
|
|
|
|
|
|
|
|
// searchQuery.addGreaterEqual(usersearchchild.getSearchfield(), sections[0]);
|
|
|
|
|
|
|
|
// searchQuery.addLessEqual(usersearchchild.getSearchfield(), sections[1]);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //不相等
|
|
|
|
|
|
|
|
// searchQuery.addLess(usersearchchild.getSearchfield(), sections[0]);
|
|
|
|
|
|
|
|
// searchQuery.addGreater(usersearchchild.getSearchfield(), sections[1]);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// case "time":
|
|
|
|
|
|
|
|
// //时间区间数据
|
|
|
|
|
|
|
|
// //相等
|
|
|
|
|
|
|
|
// if (queryType) {
|
|
|
|
|
|
|
|
// searchQuery.addGreaterEqual(usersearchchild.getSearchfield(), beginTime);
|
|
|
|
|
|
|
|
// searchQuery.addLessEqual(usersearchchild.getSearchfield(), endTime);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //不相等
|
|
|
|
|
|
|
|
// searchQuery.addLess(usersearchchild.getSearchfield(), beginTime);
|
|
|
|
|
|
|
|
// searchQuery.addGreater(usersearchchild.getSearchfield(), endTime);
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// default:
|
|
|
|
|
|
|
|
// if (queryType) {
|
|
|
|
|
|
|
|
// searchQuery.addEqual(usersearchchild.getSearchfield(), usersearchchild.getSearchvalue());
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// searchQuery.addNotEqual(usersearchchild.getSearchfield(), usersearchchild.getSearchvalue());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return searchQuery;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|