|
|
|
@ -16,8 +16,6 @@ import cn.jyjz.xiaoyao.common.base.util.requestFormat.SearchQuery;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVo;
|
|
|
|
|
import cn.jyjz.xiaoyao.common.base.vo.ResultVoUtil;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataDao.FlowableccMybatisDao;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataDao.IHisFlowableActinstDao;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataDao.IRunFlowableActinstDao;
|
|
|
|
|
import cn.jyjz.flowable.domain.dto.HistoricTaskInstanceDto;
|
|
|
|
|
import cn.jyjz.flowable.factory.FlowServiceFactory;
|
|
|
|
|
import cn.jyjz.flowable.service.IFlowTaskService;
|
|
|
|
@ -32,11 +30,11 @@ import cn.jyjz.xiaoyao.common.base.vo.UserToken;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Category;
|
|
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Flowablecc;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.dataobject.Userdistionary;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.service.*;
|
|
|
|
|
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.FlowUnionVo;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.RepeatedContentVo;
|
|
|
|
|
import cn.jyjz.xiaoyao.oa.from.vo.RepeatedTaskVo;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.dataobject.*;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.service.*;
|
|
|
|
|
import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting;
|
|
|
|
@ -107,7 +105,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
@Resource
|
|
|
|
|
private DepartmentService departmentService;
|
|
|
|
|
@Resource
|
|
|
|
|
private IHisFlowableActinstDao hisFlowableActinstDao;
|
|
|
|
|
private OcrCheckDescribeHisService ocrCheckDescribeHisService;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private OcrUsersearchService ocrUsersearchService;
|
|
|
|
@ -117,6 +115,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private IOcrMsgService ocrMsgService;
|
|
|
|
|
@Resource
|
|
|
|
|
private UserdistionaryService userdistionaryService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void myTodoTaskList(PageUtils vo, HttpServletRequest request) {
|
|
|
|
@ -434,6 +434,84 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UserTask getNextTasks(String processDefinitionId) {
|
|
|
|
|
//流程实例id
|
|
|
|
|
//String processInstanceId = "5b945750-81db-11e9-a576-1a73f8e23adc";
|
|
|
|
|
|
|
|
|
|
// 获取流程定义
|
|
|
|
|
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
|
|
|
|
|
.processDefinitionId(processDefinitionId)
|
|
|
|
|
.singleResult();
|
|
|
|
|
|
|
|
|
|
// 获取BpmnModel
|
|
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinition.getId());
|
|
|
|
|
|
|
|
|
|
// 获取所有的FlowElement,包括开始事件、结束事件、用户任务等
|
|
|
|
|
List<FlowElement> flowElements = (List<FlowElement>) bpmnModel.getMainProcess().getFlowElements();
|
|
|
|
|
|
|
|
|
|
// 遍历FlowElement
|
|
|
|
|
for (FlowElement targetFlowElement : flowElements) {
|
|
|
|
|
//用户任务
|
|
|
|
|
if (targetFlowElement instanceof UserTask) {
|
|
|
|
|
UserTask userTask = (UserTask) targetFlowElement;
|
|
|
|
|
return userTask;
|
|
|
|
|
} else if (targetFlowElement instanceof ExclusiveGateway) {
|
|
|
|
|
setExclusiveGateway(targetFlowElement);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public UserTask getNextTasks(Task task) {
|
|
|
|
|
|
|
|
|
|
//获取流程发布Id信息
|
|
|
|
|
String definitionId = runtimeService.createProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult().getProcessDefinitionId();
|
|
|
|
|
|
|
|
|
|
//获取bpm对象
|
|
|
|
|
BpmnModel bpmnModel = repositoryService.getBpmnModel(definitionId);
|
|
|
|
|
|
|
|
|
|
//传节点定义key 获取当前节点
|
|
|
|
|
FlowNode flowNode = (FlowNode) bpmnModel.getFlowElement(task.getTaskDefinitionKey());
|
|
|
|
|
|
|
|
|
|
//输出连线
|
|
|
|
|
List<SequenceFlow> outgoingFlows = flowNode.getOutgoingFlows();
|
|
|
|
|
|
|
|
|
|
//遍历返回下一个节点信息
|
|
|
|
|
for (SequenceFlow outgoingFlow : outgoingFlows) {
|
|
|
|
|
//类型自己判断
|
|
|
|
|
FlowElement targetFlowElement = outgoingFlow.getTargetFlowElement();
|
|
|
|
|
//用户任务
|
|
|
|
|
if (targetFlowElement instanceof UserTask) {
|
|
|
|
|
UserTask userTask = (UserTask) targetFlowElement;
|
|
|
|
|
return userTask;
|
|
|
|
|
} else if (targetFlowElement instanceof ExclusiveGateway) {
|
|
|
|
|
setExclusiveGateway(targetFlowElement);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setExclusiveGateway(FlowElement targetFlow) {
|
|
|
|
|
//排他网关,获取连线信息
|
|
|
|
|
List<SequenceFlow> targetFlows = ((ExclusiveGateway) targetFlow).getOutgoingFlows();
|
|
|
|
|
for (SequenceFlow sequenceFlow : targetFlows) {
|
|
|
|
|
//目标节点信息
|
|
|
|
|
FlowElement targetFlowElement = sequenceFlow.getTargetFlowElement();
|
|
|
|
|
if (targetFlowElement instanceof UserTask) {
|
|
|
|
|
// do something
|
|
|
|
|
} else if (targetFlowElement instanceof EndEvent) {
|
|
|
|
|
// do something
|
|
|
|
|
} else if (targetFlowElement instanceof ServiceTask) {
|
|
|
|
|
// do something
|
|
|
|
|
} else if (targetFlowElement instanceof ExclusiveGateway) {
|
|
|
|
|
//递归寻找
|
|
|
|
|
setExclusiveGateway(targetFlowElement);
|
|
|
|
|
} else if (targetFlowElement instanceof SubProcess) {
|
|
|
|
|
// do something
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 完成任务
|
|
|
|
|
*/
|
|
|
|
@ -481,6 +559,20 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
*/
|
|
|
|
|
private void disposeSucceedTask(Task task, ProcessDefinition processDefinition, Map<String, Object> variables,
|
|
|
|
|
OcrTaskchildPicture model, String formId, UserToken userToken, FlowApprove approve, String deptid) throws Exception {
|
|
|
|
|
|
|
|
|
|
//获取下一个节点
|
|
|
|
|
UserTask userTask = this.getNextTasks(task);
|
|
|
|
|
if (null != userTask) {
|
|
|
|
|
MultiInstanceLoopCharacteristics multiInstance = userTask.getLoopCharacteristics();
|
|
|
|
|
// 会签节点
|
|
|
|
|
if (Objects.nonNull(multiInstance)) {
|
|
|
|
|
List<String> loginnames = this.getAssignee(userTask, model.getCreateuser());
|
|
|
|
|
if (null != loginnames && !loginnames.isEmpty()) {
|
|
|
|
|
variables.put("persons", loginnames);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//进入下一个节点
|
|
|
|
|
taskService.complete(task.getId(), variables);
|
|
|
|
|
updateAssignee(task.getProcessInstanceId(), task.getProcessDefinitionId(), processDefinition, deptid);
|
|
|
|
@ -491,16 +583,17 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
OcrTaskchildPicture childPicture = ocrTaskchildPictureService.getById(Long.parseLong(formId));
|
|
|
|
|
Task taskData = null;
|
|
|
|
|
if (null != taskList && !taskList.isEmpty()) {
|
|
|
|
|
taskData = taskList.get(0);
|
|
|
|
|
if (taskList.size() > 1) {
|
|
|
|
|
List<String> taskIds = taskList.stream().map(Task::getId).collect(Collectors.toList());
|
|
|
|
|
List<String> taskNames = taskList.stream().map(Task::getName).collect(Collectors.toList());
|
|
|
|
|
childPicture.setTaskId(String.join(",", taskIds));
|
|
|
|
|
childPicture.setTaskname(String.join(",", taskNames));
|
|
|
|
|
}else{
|
|
|
|
|
taskData = taskList.get(0);
|
|
|
|
|
} else {
|
|
|
|
|
childPicture.setTaskId(taskData.getId());
|
|
|
|
|
childPicture.setTaskname(taskData.getName());
|
|
|
|
|
}
|
|
|
|
|
taskData = taskList.get(0);
|
|
|
|
|
}
|
|
|
|
|
if (ObjectUtils.isEmpty(taskData)) {
|
|
|
|
|
model.setFinishtime(System.currentTimeMillis());
|
|
|
|
@ -512,8 +605,9 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
//判断节点上的描述字段,是否伟finale_judgment,如果是,记录到终审表中,如果终审表已经存在,不再重复记录
|
|
|
|
|
if (StringUtils.isNotBlank(taskData.getDescription()) && taskData.getDescription().equals(SystemConstantsOa.OA_TASK_COMPLETE_FINALE_FORM)) {
|
|
|
|
|
childPicture.setIsFinal(1);
|
|
|
|
|
User user = userService.findByLoginname(formData.getAssignee());
|
|
|
|
|
userFinalService.save(user.getId().toString(), formId);
|
|
|
|
|
String[] split = formData.getAssignee().split(",");
|
|
|
|
|
List<cn.jyjz.xiaoyao.common.base.vo.User> userList = userTokenService.findByLoginNameList(split);
|
|
|
|
|
userFinalService.save(userList, formId);
|
|
|
|
|
}
|
|
|
|
|
this.sendMsg(childPicture, userToken);
|
|
|
|
|
|
|
|
|
@ -688,6 +782,49 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
return activeActivityIds;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取候选用户或者审批组的用户信息集合
|
|
|
|
|
*
|
|
|
|
|
* @param userTask 当前审批节点
|
|
|
|
|
* @param loginname 流程发起人
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public List<String> getAssignee(UserTask userTask, String loginname) {
|
|
|
|
|
if (null != userTask.getCandidateUsers() && userTask.getCandidateUsers().size() > 1) {
|
|
|
|
|
//获取候选用户集合
|
|
|
|
|
List<String> loginnames = userTask.getCandidateUsers();
|
|
|
|
|
//顺序设置审批用户
|
|
|
|
|
return loginnames;
|
|
|
|
|
} else {
|
|
|
|
|
//得到候选组
|
|
|
|
|
List<String> candidateGroups = userTask.getCandidateGroups();
|
|
|
|
|
if (null != candidateGroups && !candidateGroups.isEmpty()) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<User> listusers = new ArrayList<>();
|
|
|
|
|
for (String groupid : candidateGroups) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//排除不在同一个公司的人员
|
|
|
|
|
List<Userdistionary> userdistionaryList = userdistionaryService.selectListByCandidateid(groupid, loginname);
|
|
|
|
|
|
|
|
|
|
List<Long> listuserid = userdistionaryList.stream().map(Userdistionary::getUserid).collect(Collectors.toList());
|
|
|
|
|
if (null != listuserid && !listuserid.isEmpty()) {
|
|
|
|
|
listusers.addAll(this.userService.selectUserById(listuserid));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (null != listusers && !listusers.isEmpty()) {
|
|
|
|
|
List<String> loginnames = listusers.stream().map(User::getLoginname).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
return loginnames;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设置当前审批节点的审批人
|
|
|
|
|
* 目前只多候选组和多个候选人起作用
|
|
|
|
@ -703,6 +840,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
|
|
|
|
|
//记录审批人信息
|
|
|
|
|
StringBuffer assignee = new StringBuffer();
|
|
|
|
|
int taskIndex = 0;
|
|
|
|
|
for (Task task : taskList) {
|
|
|
|
|
|
|
|
|
|
//传节点定义key获取当前节点
|
|
|
|
@ -710,33 +848,75 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
if (flowElement instanceof UserTask && StringUtils.isBlank(task.getAssignee())) {
|
|
|
|
|
UserTask userTask = (UserTask) flowElement;
|
|
|
|
|
|
|
|
|
|
//如果审批不存在,需要在候选组中查询
|
|
|
|
|
if (StringUtils.isBlank(userTask.getAssignee())) {
|
|
|
|
|
//得到候选人
|
|
|
|
|
List<String> candidateUsers = userTask.getCandidateUsers();
|
|
|
|
|
if (null != candidateUsers && !candidateUsers.isEmpty()) {
|
|
|
|
|
Random rand = new Random();
|
|
|
|
|
taskService.claim(task.getId(), candidateUsers.get(rand.nextInt(candidateUsers.size())));
|
|
|
|
|
}
|
|
|
|
|
MultiInstanceLoopCharacteristics multiInstance = userTask.getLoopCharacteristics();
|
|
|
|
|
// 会签节点
|
|
|
|
|
if (Objects.nonNull(multiInstance)) {
|
|
|
|
|
if (null != userTask.getCandidateUsers() && userTask.getCandidateUsers().size() > 1) {
|
|
|
|
|
//获取候选用户集合
|
|
|
|
|
List<String> loginnames = userTask.getCandidateUsers();
|
|
|
|
|
//顺序设置审批用户
|
|
|
|
|
taskService.setAssignee(task.getId(), loginnames.get(taskIndex));
|
|
|
|
|
} else {
|
|
|
|
|
//得到候选组
|
|
|
|
|
List<String> candidateGroups = userTask.getCandidateGroups();
|
|
|
|
|
if (null != candidateGroups && !candidateGroups.isEmpty()) {
|
|
|
|
|
flowTaskCompleteVO = new FlowTaskCompleteVO();
|
|
|
|
|
flowTaskCompleteVO.setTaskId(task.getId());
|
|
|
|
|
|
|
|
|
|
List<User> listusers = new ArrayList<>();
|
|
|
|
|
for (String groupid : candidateGroups) {
|
|
|
|
|
//获取发起人员信息
|
|
|
|
|
HistoricProcessInstance hi = historyService.createHistoricProcessInstanceQuery()
|
|
|
|
|
.processInstanceId(processInstanceId)
|
|
|
|
|
.singleResult();
|
|
|
|
|
//发起人员登录账号
|
|
|
|
|
String startUserId = hi.getStartUserId();
|
|
|
|
|
|
|
|
|
|
//排除不在同一个公司的人员
|
|
|
|
|
List<Userdistionary> userdistionaryList = userdistionaryService.selectListByCandidateid(groupid, startUserId);
|
|
|
|
|
|
|
|
|
|
List<Long> listuserid = userdistionaryList.stream().map(Userdistionary::getUserid).collect(Collectors.toList());
|
|
|
|
|
listusers.addAll(this.userService.selectUserById(listuserid));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (null != listusers && !listusers.isEmpty()) {
|
|
|
|
|
List<String> loginnames = listusers.stream().map(User::getLoginname).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
//得到候选组
|
|
|
|
|
List<String> candidateGroups = userTask.getCandidateGroups();
|
|
|
|
|
if (null != candidateGroups && !candidateGroups.isEmpty()) {
|
|
|
|
|
String loginuser = null;
|
|
|
|
|
for (String groupid : candidateGroups) {
|
|
|
|
|
//获取发起人员信息
|
|
|
|
|
HistoricProcessInstance hi = historyService.createHistoricProcessInstanceQuery()
|
|
|
|
|
.processInstanceId(processInstanceId)
|
|
|
|
|
.singleResult();
|
|
|
|
|
//发起人员登录账号
|
|
|
|
|
String startUserId = hi.getStartUserId();
|
|
|
|
|
//通过候选组主键,查询审批人员信息,并自动拾取
|
|
|
|
|
loginuser = candidateuserService.getClaimUser(startUserId, groupid, deptid);
|
|
|
|
|
if (StringUtils.isNotBlank(loginuser)) {
|
|
|
|
|
taskService.claim(task.getId(), loginuser);
|
|
|
|
|
//顺序设置审批用户
|
|
|
|
|
taskService.setAssignee(task.getId(), loginnames.get(taskIndex));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
taskIndex++;
|
|
|
|
|
} else {
|
|
|
|
|
//如果审批不存在,需要在候选组中查询
|
|
|
|
|
if (StringUtils.isBlank(userTask.getAssignee())) {
|
|
|
|
|
//得到候选人
|
|
|
|
|
List<String> candidateUsers = userTask.getCandidateUsers();
|
|
|
|
|
if (null != candidateUsers && !candidateUsers.isEmpty()) {
|
|
|
|
|
Random rand = new Random();
|
|
|
|
|
taskService.claim(task.getId(), candidateUsers.get(rand.nextInt(candidateUsers.size())));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//得到候选组
|
|
|
|
|
List<String> candidateGroups = userTask.getCandidateGroups();
|
|
|
|
|
if (null != candidateGroups && !candidateGroups.isEmpty()) {
|
|
|
|
|
String loginuser = null;
|
|
|
|
|
for (String groupid : candidateGroups) {
|
|
|
|
|
//获取发起人员信息
|
|
|
|
|
HistoricProcessInstance hi = historyService.createHistoricProcessInstanceQuery()
|
|
|
|
|
.processInstanceId(processInstanceId)
|
|
|
|
|
.singleResult();
|
|
|
|
|
//发起人员登录账号
|
|
|
|
|
String startUserId = hi.getStartUserId();
|
|
|
|
|
//通过候选组主键,查询审批人员信息,并自动拾取
|
|
|
|
|
loginuser = candidateuserService.getClaimUser(startUserId, groupid, deptid);
|
|
|
|
|
if (StringUtils.isNotBlank(loginuser)) {
|
|
|
|
|
taskService.claim(task.getId(), loginuser);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -994,9 +1174,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
*
|
|
|
|
|
* @param query 搜索条件
|
|
|
|
|
* @param pageUtils 分页参数
|
|
|
|
|
* @param user
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
public void getFinalProcessInstances(Map<String, Object> query, PageUtils<OcrTaskchildPicture> pageUtils) {
|
|
|
|
|
public void getFinalProcessInstances(Map<String, Object> query, PageUtils<OcrTaskchildPicture> pageUtils, User user) {
|
|
|
|
|
ParamterPage paramterPage = new ParamterPage();
|
|
|
|
|
paramterPage.setStart((pageUtils.getCurrPage() - 1) * pageUtils.getPageSize());
|
|
|
|
|
paramterPage.setPagesize(pageUtils.getPageSize());
|
|
|
|
@ -1104,7 +1285,18 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
// taskchildPicture.setTransferRecords(historicTaskInstanceDtos);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
for (OcrTaskchildPicture ocrTaskchildPicture : list) {
|
|
|
|
|
String assignee = ocrTaskchildPicture.getAssignee();
|
|
|
|
|
if (assignee.contains(",")) {
|
|
|
|
|
String[] split = assignee.split(",");
|
|
|
|
|
for (int i = 0; i < split.length; i++) {
|
|
|
|
|
if (user.getLoginname().equals(split[i])) {
|
|
|
|
|
String[] taskIds = ocrTaskchildPicture.getTaskId().split(",");
|
|
|
|
|
ocrTaskchildPicture.setTaskId(taskIds[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pageUtils.setTotalCount(count.intValue());
|
|
|
|
|
pageUtils.setList(list);
|
|
|
|
|
}
|
|
|
|
@ -1191,7 +1383,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
for (FlowUnionVo flowUnionVo : list) {
|
|
|
|
|
|
|
|
|
|
if (flowUnionVo.getStates() != null) {
|
|
|
|
|
String stateText;
|
|
|
|
|
String stateText = "";
|
|
|
|
|
switch (flowUnionVo.getStates()) {
|
|
|
|
|
case 1:
|
|
|
|
|
stateText = "撤销";
|
|
|
|
@ -1200,13 +1392,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
stateText = "审批中";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
stateText = "审批通过";
|
|
|
|
|
stateText = "通过";
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
stateText = "审批未通过";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
stateText = "未知状态";
|
|
|
|
|
stateText = "不通过";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// 将中文状态赋值给 flowUnionVo 的状态属性
|
|
|
|
@ -1372,13 +1561,24 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
|
|
|
|
|
//补充历史状态名称,检查补充节点信息
|
|
|
|
|
for (OcrTaskchildPictureAppro ocrTaskchildPictureAppro : list) {
|
|
|
|
|
String assignee = ocrTaskchildPictureAppro.getAssignee();
|
|
|
|
|
//审批节点 当前如果没有历史操作,则将当前节点赋值到历史审批节点中.
|
|
|
|
|
if (StringUtils.isBlank(ocrTaskchildPictureAppro.getTasknamehis())) {
|
|
|
|
|
ocrTaskchildPictureAppro.setTasknamehis(ocrTaskchildPictureAppro.getTaskname());
|
|
|
|
|
}else{
|
|
|
|
|
if (assignee.contains(",")) {
|
|
|
|
|
String[] split = assignee.split(",");
|
|
|
|
|
for (int i = 0; i < split.length; i++) {
|
|
|
|
|
if (user.getLoginname().equals(split[i])) {
|
|
|
|
|
String[] taskIds = ocrTaskchildPictureAppro.getTasknamehis().split(",");
|
|
|
|
|
ocrTaskchildPictureAppro.setTasknamehis(taskIds[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ocrTaskchildPictureAppro.getStatshis() != null) {
|
|
|
|
|
String stateText;
|
|
|
|
|
String stateText = "";
|
|
|
|
|
switch (ocrTaskchildPictureAppro.getStatshis()) {
|
|
|
|
|
case 1:
|
|
|
|
|
stateText = "待审批";
|
|
|
|
@ -1389,9 +1589,6 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
case 3:
|
|
|
|
|
stateText = "不通过";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
stateText = "未知状态";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
// 将中文状态赋值给 flowUnionVo 的状态属性
|
|
|
|
|
ocrTaskchildPictureAppro.setStatshisText(stateText);
|
|
|
|
@ -1424,7 +1621,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
ocrTaskchildPictureApproVo.setProjectName(one.getFromprojectname());//项目名称
|
|
|
|
|
ocrTaskchildPictureApproVo.setCustomerLevel(one.getFromCustomerLevel());//客户级别
|
|
|
|
|
ocrTaskchildPictureApproVo.setReleaseArea(one.getFromCity());//拜访城市
|
|
|
|
|
ocrTaskchildPictureApproVo.setTaskIndex(one.getTaskNodeIndex()==null?"1":one.getTaskNodeIndex());
|
|
|
|
|
ocrTaskchildPictureApproVo.setTaskIndex(one.getTaskNodeIndex() == null ? one.getTasknode() : one.getTaskNodeIndex());
|
|
|
|
|
|
|
|
|
|
listNew.add(ocrTaskchildPictureApproVo);
|
|
|
|
|
}
|
|
|
|
@ -1758,29 +1955,58 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultVo repetitionTask() {
|
|
|
|
|
List<RepeatedContentVo> repeatedContentVoList = flowableccMybatisDao.repetitionTask();
|
|
|
|
|
public ResultVo repetitionTask(Integer type) {
|
|
|
|
|
List<RepeatedContentVo> repeatedContentVoList = flowableccMybatisDao.repetitionTask(type);
|
|
|
|
|
List<String> formIdsToUpdate = new ArrayList<>();
|
|
|
|
|
if (repeatedContentVoList.size() > 0 && repeatedContentVoList.get(0).getRepeatedTaskList().size() > 0) {
|
|
|
|
|
String formIds = repeatedContentVoList.get(0).getRepeatedTaskList().get(0).getFormId();
|
|
|
|
|
String[] formIdsArray = formIds.split(",");
|
|
|
|
|
for (String formId : formIdsArray) {
|
|
|
|
|
formIdsToUpdate.add(formId.trim()); // 去除字符串首尾的空格并添加到集合中
|
|
|
|
|
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(repeatedContentVoList)) {
|
|
|
|
|
List<OcrCheckDescribeHis> checkDescribeHis = new ArrayList<>();
|
|
|
|
|
for (RepeatedContentVo contentVo : repeatedContentVoList) {
|
|
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(contentVo.getPictureIds())) {
|
|
|
|
|
String[] pictureIds = contentVo.getPictureIds().split(",");
|
|
|
|
|
formIdsToUpdate.addAll(Arrays.asList(pictureIds));
|
|
|
|
|
List<OcrCheckDescribeHis> list = ocrCheckDescribeHisService.list(new LambdaQueryWrapper<OcrCheckDescribeHis>().in(OcrCheckDescribeHis::getPictureId, pictureIds));
|
|
|
|
|
Map<String, List<OcrCheckDescribeHis>> resultMap = new HashMap<>();
|
|
|
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
|
|
|
resultMap = list.stream().collect(Collectors.groupingBy(OcrCheckDescribeHis::getPictureId));
|
|
|
|
|
}
|
|
|
|
|
for (String pictureId : pictureIds) {
|
|
|
|
|
Set<String> set = new HashSet<>();
|
|
|
|
|
OcrCheckDescribeHis describeHis;
|
|
|
|
|
List<OcrCheckDescribeHis> ocrCheckDescribeHis = resultMap.get(pictureId);
|
|
|
|
|
if (!CollectionUtils.isEmpty(ocrCheckDescribeHis)) {
|
|
|
|
|
describeHis = ocrCheckDescribeHis.get(0);
|
|
|
|
|
String[] split = describeHis.getCheckResult().split(",");
|
|
|
|
|
set.addAll(Arrays.asList(split));
|
|
|
|
|
} else {
|
|
|
|
|
describeHis = new OcrCheckDescribeHis();
|
|
|
|
|
}
|
|
|
|
|
set.addAll(Arrays.asList(pictureIds));
|
|
|
|
|
set.remove(pictureId);
|
|
|
|
|
describeHis.setDescribe(contentVo.getContent());
|
|
|
|
|
describeHis.setPictureId(pictureId);
|
|
|
|
|
describeHis.setCheckResult(String.join(",", set));
|
|
|
|
|
checkDescribeHis.add(describeHis);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
ocrCheckDescribeHisService.saveOrUpdateBatch(checkDescribeHis);
|
|
|
|
|
UpdateWrapper<OcrTaskchildPicture> updateWrapper = new UpdateWrapper<>();
|
|
|
|
|
updateWrapper.in("PICTUREID", formIdsToUpdate)
|
|
|
|
|
.eq("is_repeated_nodules", 0);
|
|
|
|
|
OcrTaskchildPicture updateEntity = new OcrTaskchildPicture();
|
|
|
|
|
updateEntity.setIsRepeatedNodules(1);
|
|
|
|
|
ocrTaskchildPictureService.update(updateEntity, updateWrapper);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return ResultVoUtil.success(repeatedContentVoList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize) {
|
|
|
|
|
public Page<OcrTaskchildPicture> repetitionTaskList(Integer pageNo, Integer pageSize, Integer type) {
|
|
|
|
|
Page<OcrTaskchildPicture> page = new Page<>(pageNo, pageSize);
|
|
|
|
|
Page<OcrTaskchildPicture> result = flowableccMybatisDao.repetitionTaskList(page);
|
|
|
|
|
Page<OcrTaskchildPicture> result = flowableccMybatisDao.repetitionTaskList(page, type);
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|