@ -33,6 +33,8 @@ import cn.jyjz.xiaoyao.oa.from.dataobject.Flowablecc;
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.oa.from.vo.RepeatedContentVo ;
import cn.jyjz.xiaoyao.oa.from.vo.RepeatedTaskVo ;
import cn.jyjz.xiaoyao.ocr.dataobject.* ;
import cn.jyjz.xiaoyao.ocr.dataobject.* ;
import cn.jyjz.xiaoyao.ocr.service.* ;
import cn.jyjz.xiaoyao.ocr.service.* ;
import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting ;
import cn.jyjz.xiaoyao.ocr.util.SearchParaFormatting ;
@ -40,6 +42,7 @@ import cn.jyjz.xiaoyao.ocr.vo.OcrTaskchildPictureApproVo;
import com.alibaba.fastjson.JSONObject ;
import com.alibaba.fastjson.JSONObject ;
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.conditions.query.QueryWrapper ;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper ;
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 ;
@ -454,7 +457,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
variables . put ( "approvd" , approve . getResult ( ) ) ;
variables . put ( "approvd" , approve . getResult ( ) ) ;
OcrTaskchildPicture model = ocrTaskchildPictureService . getById ( Long . parseLong ( flowTaskInfo . getFormId ( ) ) ) ;
OcrTaskchildPicture model = ocrTaskchildPictureService . getById ( Long . parseLong ( flowTaskInfo . getFormId ( ) ) ) ;
if ( approve . getResult ( ) ) {
if ( approve . getResult ( ) ) {
disposeSucceedTask ( task , processDefinition , variables , model , flowTaskInfo . getFormId ( ) , userToken , approve );
disposeSucceedTask ( task , processDefinition , variables , model , flowTaskInfo . getFormId ( ) , userToken , approve ,approve . getDeptid ( ) );
} else {
} else {
disposeFailureTask ( task , flowTaskInfo . getFormId ( ) , variables , approve ) ;
disposeFailureTask ( task , flowTaskInfo . getFormId ( ) , variables , approve ) ;
@ -474,10 +477,11 @@ 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 ) throws Exception {
private void disposeSucceedTask ( Task task , ProcessDefinition processDefinition , Map < String , Object > variables ,
OcrTaskchildPicture model , String formId , UserToken userToken , FlowApprove approve , String deptid ) throws Exception {
//进入下一个节点
//进入下一个节点
taskService . complete ( task . getId ( ) , variables ) ;
taskService . complete ( task . getId ( ) , variables ) ;
updateAssignee ( task . getProcessInstanceId ( ) , task . getProcessDefinitionId ( ) , processDefinition );
updateAssignee ( task . getProcessInstanceId ( ) , task . getProcessDefinitionId ( ) , processDefinition ,deptid );
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 ( ) ) ;
@ -488,23 +492,24 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskData = taskList . get ( 0 ) ;
taskData = taskList . get ( 0 ) ;
}
}
OcrTaskchildPicture childPicture = ocrTaskchildPictureService . getById ( Long . parseLong ( formId ) ) ;
OcrTaskchildPicture childPicture = ocrTaskchildPictureService . getById ( Long . parseLong ( formId ) ) ;
childPicture . setTaskNode ( taskData . getDescription ( ) ) ;
if ( ObjectUtils . isEmpty ( taskData ) ) {
if ( ObjectUtils . isEmpty ( taskData ) ) {
model . setFinishtime ( System . currentTimeMillis ( ) ) ;
model . setFinishtime ( System . currentTimeMillis ( ) ) ;
model . setStates ( SystemConstantsOa . OA_STATUS_TYPE_END ) ;
model . setStates ( SystemConstantsOa . OA_STATUS_TYPE_END ) ;
ocrTaskchildPictureService . updateById ( model ) ;
OcrPicture picture = ocrPictureService . getById ( model . getPictureid ( ) ) ;
OcrPicture picture = ocrPictureService . getById ( model . getPictureid ( ) ) ;
ocrTaskchildPictureService . sendFlowTaskResult ( childPicture , picture , approve ) ;
ocrTaskchildPictureService . sendFlowTaskResult ( childPicture , picture , approve ) ;
} else {
} else {
//判断节点上的描述字段, 是否伟finale_judgment,如果是,记录到终审表中,如果终审表已经存在,不再重复记录
//判断节点上的描述字段, 是否伟finale_judgment,如果是,记录到终审表中,如果终审表已经存在,不再重复记录
if ( 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 ) ) {
childPicture . setIsFinal ( 1 ) ;
User user = userService . findByLoginname ( formData . getAssignee ( ) ) ;
User user = userService . findByLoginname ( formData . getAssignee ( ) ) ;
userFinalService . save ( user . getId ( ) . toString ( ) , formId ) ;
userFinalService . save ( user . getId ( ) . toString ( ) , formId ) ;
}
}
this . sendMsg ( childPicture , userToken ) ;
this . sendMsg ( childPicture , userToken ) ;
childPicture . setTaskId ( taskData . getId ( ) ) ;
childPicture . setTaskId ( taskData . getId ( ) ) ;
childPicture . setTaskname ( taskData . getName ( ) ) ;
childPicture . setTaskname ( taskData . getName ( ) ) ;
ocrTaskchildPictureService . updateById ( childPicture ) ;
}
}
ocrTaskchildPictureService . updateById ( childPicture ) ;
//增加未查看记录
//增加未查看记录
userViewApproeService . saveUserViewApproe ( formData . getAssignee ( ) , formData . getFormid ( ) . toString ( ) , formData . getTenantid ( ) . toString ( ) ) ;
userViewApproeService . saveUserViewApproe ( formData . getAssignee ( ) , formData . getFormid ( ) . toString ( ) , formData . getTenantid ( ) . toString ( ) ) ;
@ -513,7 +518,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
/ * *
/ * *
* 处 理 失 败 任 务
* 处 理 失 败 任 务
* /
* /
private void disposeFailureTask ( Task task , String formId , Map < String , Object > variables , FlowApprove approve ) throws Exception {
private void disposeFailureTask ( Task task , String formId , Map < String , Object > variables , FlowApprove approve ) throws
Exception {
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 ( ) ;
@ -542,6 +548,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
executions . forEach ( execution - > executionIds . add ( execution . getId ( ) ) ) ;
executions . forEach ( execution - > executionIds . add ( execution . getId ( ) ) ) ;
OcrTaskchildPicture taskchildPicture = ocrTaskchildPictureService . getById ( Long . parseLong ( formId ) ) ;
OcrTaskchildPicture taskchildPicture = ocrTaskchildPictureService . getById ( Long . parseLong ( formId ) ) ;
taskchildPicture . setFinishtime ( System . currentTimeMillis ( ) ) ;
taskchildPicture . setFinishtime ( System . currentTimeMillis ( ) ) ;
taskchildPicture . setIsFinal ( 1 ) ;
ocrTaskchildPictureService . updateById ( taskchildPicture ) ;
ocrTaskchildPictureService . updateById ( taskchildPicture ) ;
OcrPicture picture = ocrPictureService . getById ( taskchildPicture . getPictureid ( ) ) ;
OcrPicture picture = ocrPictureService . getById ( taskchildPicture . getPictureid ( ) ) ;
ocrTaskchildPictureService . sendFlowTaskResult ( taskchildPicture , picture , approve ) ;
ocrTaskchildPictureService . sendFlowTaskResult ( taskchildPicture , picture , approve ) ;
@ -581,10 +588,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
*
*
* @param processDefinition
* @param processDefinition
* /
* /
public void updateAssignee ( String processInstanceId , String processDefinitionId , ProcessDefinition processDefinition ) {
public void updateAssignee ( String processInstanceId , String processDefinitionId , ProcessDefinition
processDefinition , String deptid ) {
//如果是多个候选人或者是候选组,做任务拾取
//如果是多个候选人或者是候选组,做任务拾取
FlowTaskCompleteVO flowTaskCompleteVO = updateNowTaskAssignee ( processInstanceId , processDefinitionId );
FlowTaskCompleteVO flowTaskCompleteVO = updateNowTaskAssignee ( processInstanceId , processDefinitionId ,deptid );
if ( null ! = flowTaskCompleteVO ) {
if ( null ! = flowTaskCompleteVO ) {
@ -673,7 +681,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 ,String deptid ) {
FlowTaskCompleteVO flowTaskCompleteVO = null ;
FlowTaskCompleteVO flowTaskCompleteVO = null ;
BpmnModel bpmnModel = repositoryService . getBpmnModel ( processDefinitionId ) ;
BpmnModel bpmnModel = repositoryService . getBpmnModel ( processDefinitionId ) ;
@ -710,7 +718,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
//发起人员登录账号
//发起人员登录账号
String startUserId = hi . getStartUserId ( ) ;
String startUserId = hi . getStartUserId ( ) ;
//通过候选组主键,查询审批人员信息,并自动拾取
//通过候选组主键,查询审批人员信息,并自动拾取
loginuser = candidateuserService . getClaimUser ( startUserId , groupid );
loginuser = candidateuserService . getClaimUser ( startUserId , groupid ,deptid );
if ( StringUtils . isNotBlank ( loginuser ) ) {
if ( StringUtils . isNotBlank ( loginuser ) ) {
taskService . claim ( task . getId ( ) , loginuser ) ;
taskService . claim ( task . getId ( ) , loginuser ) ;
}
}
@ -979,6 +987,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
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 ( ) ) ;
Page < OcrTaskchildPicture > page = new Page < > ( ) ;
if ( StringUtils . isNotBlank ( pageUtils . getSortname ( ) ) ) {
if ( StringUtils . isNotBlank ( pageUtils . getSortname ( ) ) ) {
paramterPage . setSortname ( pageUtils . getSortname ( ) ) ;
paramterPage . setSortname ( pageUtils . getSortname ( ) ) ;
@ -992,97 +1001,96 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
paramterPage . setSortorder ( "DESC" ) ;
paramterPage . setSortorder ( "DESC" ) ;
}
}
Long count = ocrTaskchildPictureService . listFinalCount ( query ) ;
query . put ( "page" , paramterPage ) ;
query . put ( "page" , paramterPage ) ;
Long count = ocrTaskchildPictureService . listFinalCount ( query ) ;
List < OcrTaskchildPicture > list = ocrTaskchildPictureService . listFinal ( query ) ;
List < OcrTaskchildPicture > list = ocrTaskchildPictureService . listFinal ( query ) ;
for ( OcrTaskchildPicture taskchildPicture : list ) {
// for (OcrTaskchildPicture taskchildPicture : list) {
//查询对应的流程分类
// //查询对应的流程分类
Category category = categoryService . selectDtoById ( taskchildPicture . getCategoryid ( ) ) ;
// Category category = categoryService.selectDtoById(taskchildPicture.getCategoryid());
taskchildPicture . setCategoryDto ( category ) ;
// taskchildPicture.setCategoryDto(category);
//
if ( StringUtils . isNotBlank ( taskchildPicture . getProcessdefinitionid ( ) ) ) {
// if (StringUtils.isNotBlank(taskchildPicture.getProcessdefinitionid())) {
//
List < Task > taskList = this . nowRunTask ( taskchildPicture . getProcessinstanceid ( ) , taskchildPicture . getProcessdefinitionid ( ) ) ;
// List<Task> taskList = this.nowRunTask(taskchildPicture.getProcessinstanceid(), taskchildPicture.getProcessdefinitionid());
if ( null ! = taskList & & ! taskList . isEmpty ( ) ) {
// if (null != taskList && !taskList.isEmpty()) {
taskchildPicture . setTaskId ( taskList . get ( 0 ) . getId ( ) ) ;
// taskchildPicture.setTaskId(taskList.get(0).getId());
//
Task tasknow = taskService . createTaskQuery ( ) . taskId ( taskchildPicture . getTaskId ( ) ) . singleResult ( ) ;
// Task tasknow = taskService.createTaskQuery().taskId(taskchildPicture.getTaskId()).singleResult();
BpmnModel bpmnModel = repositoryService . getBpmnModel ( tasknow . getProcessDefinitionId ( ) ) ;
// BpmnModel bpmnModel = repositoryService.getBpmnModel(tasknow.getProcessDefinitionId());
// 获取节点定义id
// // 获取节点定义id
String taskDefinitionKey = tasknow . getTaskDefinitionKey ( ) ;
// String taskDefinitionKey = tasknow.getTaskDefinitionKey();
// 根据节点定义id获取节点元素
// // 根据节点定义id获取节点元素
FlowElement flowElement = bpmnModel . getFlowElement ( taskDefinitionKey ) ;
// FlowElement flowElement = bpmnModel.getFlowElement(taskDefinitionKey);
if ( flowElement instanceof UserTask ) {
// if (flowElement instanceof UserTask) {
UserTask userTask = ( UserTask ) flowElement ;
// UserTask userTask = (UserTask) flowElement;
//
taskchildPicture . setDocumentation ( userTask . getDocumentation ( ) ) ;
// taskchildPicture.setDocumentation(userTask.getDocumentation());
}
// }
}
// }
//
//查询历史
// //查询历史
List < HistoricTaskInstanceDto > historicTaskInstanceDtos = new ArrayList < > ( ) ;
// List<HistoricTaskInstanceDto> historicTaskInstanceDtos = new ArrayList<>();
// 查询当前任务的流转信息
// // 查询当前任务的流转信息
List < HistoricTaskInstance > taskHiInstances = historyService . createHistoricTaskInstanceQuery ( )
// List<HistoricTaskInstance> taskHiInstances = historyService.createHistoricTaskInstanceQuery()
. processInstanceId ( taskchildPicture . getProcessinstanceid ( ) )
// .processInstanceId(taskchildPicture.getProcessinstanceid())
. includeProcessVariables ( )
// .includeProcessVariables()
. orderByHistoricTaskInstanceStartTime ( )
// .orderByHistoricTaskInstanceStartTime()
. asc ( )
// .asc()
. list ( ) ;
// .list();
for ( HistoricTaskInstance taskHiInstance : taskHiInstances ) {
// for (HistoricTaskInstance taskHiInstance : taskHiInstances) {
HistoricTaskInstanceDto dto = new HistoricTaskInstanceDto ( ) ;
// HistoricTaskInstanceDto dto = new HistoricTaskInstanceDto();
dto . setTaskId ( taskHiInstance . getId ( ) ) ;
// dto.setTaskId(taskHiInstance.getId());
dto . setTaskName ( taskHiInstance . getName ( ) ) ;
// dto.setTaskName(taskHiInstance.getName());
dto . setFinishTime ( taskHiInstance . getEndTime ( ) ) ;
// dto.setFinishTime(taskHiInstance.getEndTime());
if ( taskHiInstance . getDurationInMillis ( ) ! = null ) {
// if (taskHiInstance.getDurationInMillis() != null) {
dto . setDuration ( taskHiInstance . getDurationInMillis ( ) / 1000 + "秒" ) ;
// dto.setDuration(taskHiInstance.getDurationInMillis() / 1000 + "秒");
}
// }
dto . setTaskDefKey ( taskHiInstance . getTaskDefinitionKey ( ) ) ;
// dto.setTaskDefKey(taskHiInstance.getTaskDefinitionKey());
//
//Map<String,Object> variables = taskHiInstance.getTaskLocalVariables();
// //Map<String,Object> variables = taskHiInstance.getTaskLocalVariables();
//
Map < String , Object > variables = taskHiInstance . getProcessVariables ( ) ;
// Map<String, Object> variables = taskHiInstance.getProcessVariables();
//
if ( null ! = variables & & null ! = variables . get ( "approvd" ) ) {
// if (null != variables && null != variables.get("approvd")) {
dto . setState ( variables . get ( "approvd" ) . toString ( ) ) ;
// dto.setState(variables.get("approvd").toString());
}
// }
//
if ( StringUtils . isNotBlank ( taskHiInstance . getAssignee ( ) ) ) {
// if (StringUtils.isNotBlank(taskHiInstance.getAssignee())) {
if ( SystemConstantsOa . OA_TASK_SKIP_ASSIGINE . equals ( taskHiInstance . getAssignee ( ) ) ) {
// if (SystemConstantsOa.OA_TASK_SKIP_ASSIGINE.equals(taskHiInstance.getAssignee())) {
dto . setAssigneeName ( taskHiInstance . getAssignee ( ) ) ;
// dto.setAssigneeName(taskHiInstance.getAssignee());
} else {
// } else {
User user1 = userService . findByLoginname ( taskHiInstance . getAssignee ( ) ) ;
// User user1 = userService.findByLoginname(taskHiInstance.getAssignee());
//
dto . setAssigneeName ( user1 . getUsername ( ) ) ;
// dto.setAssigneeName(user1.getUsername());
}
// }
//
}
// }
//
BpmnModel bpmnModel = repositoryService . getBpmnModel ( taskchildPicture . getProcessdefinitionid ( ) ) ;
// BpmnModel bpmnModel = repositoryService.getBpmnModel(taskchildPicture.getProcessdefinitionid());
//
// // 根据节点定义id获取节点元素
// // // 根据节点定义id获取节点元素
FlowElement flowElement = bpmnModel . getFlowElement ( taskHiInstance . getTaskDefinitionKey ( ) ) ;
// FlowElement flowElement = bpmnModel.getFlowElement(taskHiInstance.getTaskDefinitionKey());
if ( flowElement instanceof UserTask ) {
// if (flowElement instanceof UserTask) {
UserTask userTask = ( UserTask ) flowElement ;
// UserTask userTask = (UserTask) flowElement;
//
taskchildPicture . setDocumentation ( userTask . getDocumentation ( ) ) ;
// taskchildPicture.setDocumentation(userTask.getDocumentation());
}
// }
// 还需要根据 HistoricTaskInstance 找到对应的 审批意见
// // 还需要根据 HistoricTaskInstance 找到对应的 审批意见
List < Comment > processInstanceComments = taskService . getProcessInstanceComments ( taskchildPicture . getProcessinstanceid ( ) ) ;
// List<Comment> processInstanceComments = taskService.getProcessInstanceComments(taskchildPicture.getProcessinstanceid());
for ( Comment comment : processInstanceComments ) {
// for (Comment comment : processInstanceComments) {
//
if ( comment . getTaskId ( ) . equals ( taskHiInstance . getId ( ) ) ) {
// if (comment.getTaskId().equals(taskHiInstance.getId())) {
// 审批意见
// // 审批意见
String fullMessage = comment . getFullMessage ( ) ;
// String fullMessage = comment.getFullMessage();
dto . setComment ( fullMessage ) ;
// dto.setComment(fullMessage);
}
// }
}
// }
historicTaskInstanceDtos . add ( dto ) ;
// historicTaskInstanceDtos.add(dto);
}
// }
taskchildPicture . setTransferRecords ( historicTaskInstanceDtos ) ;
// taskchildPicture.setTransferRecords(historicTaskInstanceDtos);
}
// }
}
// }
pageUtils . setTotalCount ( count . intValue ( ) ) ;
pageUtils . setTotalCount ( count . intValue ( ) ) ;
pageUtils . setList ( list ) ;
pageUtils . setList ( list ) ;
@ -1295,7 +1303,8 @@ 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 , String userSearchId ) {
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 ( ) ) ;
@ -1344,91 +1353,91 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskchildPicture . setPicture ( ocrPictureOne ) ;
taskchildPicture . setPicture ( ocrPictureOne ) ;
taskchildPicture . setFinishTime ( ocrPictureOne . getSubmitDateTimestamp ( ) ) ;
taskchildPicture . setFinishTime ( ocrPictureOne . getSubmitDateTimestamp ( ) ) ;
}
}
//
//查询对应的流程分类
// //查询对应的流程分类
Category category = categoryService . selectDtoById ( Long . parseLong ( 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())) {
//
List < Task > taskList = this . nowRunTask ( taskchildPicture . getProcessinstanceid ( ) , taskchildPicture . getProcessdefinitionid ( ) ) ;
// List<Task> taskList = this.nowRunTask(taskchildPicture.getProcessinstanceid(), taskchildPicture.getProcessdefinitionid());
if ( null ! = taskList & & ! taskList . isEmpty ( ) ) {
// if (null != taskList && !taskList.isEmpty()) {
taskchildPicture . setTaskId ( taskList . get ( 0 ) . getId ( ) ) ;
// taskchildPicture.setTaskId(taskList.get(0).getId());
//
Task tasknow = taskService . createTaskQuery ( ) . taskId ( taskchildPicture . getTaskId ( ) ) . singleResult ( ) ;
// Task tasknow = taskService.createTaskQuery().taskId(taskchildPicture.getTaskId()).singleResult();
BpmnModel bpmnModel = repositoryService . getBpmnModel ( tasknow . getProcessDefinitionId ( ) ) ;
// BpmnModel bpmnModel = repositoryService.getBpmnModel(tasknow.getProcessDefinitionId());
// 获取节点定义id
// // 获取节点定义id
String taskDefinitionKey = tasknow . getTaskDefinitionKey ( ) ;
// String taskDefinitionKey = tasknow.getTaskDefinitionKey();
// 根据节点定义id获取节点元素
// // 根据节点定义id获取节点元素
FlowElement flowElement = bpmnModel . getFlowElement ( taskDefinitionKey ) ;
// FlowElement flowElement = bpmnModel.getFlowElement(taskDefinitionKey);
if ( flowElement instanceof UserTask ) {
// if (flowElement instanceof UserTask) {
UserTask userTask = ( UserTask ) flowElement ;
// UserTask userTask = (UserTask) flowElement;
//
taskchildPicture . setDocumentation ( userTask . getDocumentation ( ) ) ;
// taskchildPicture.setDocumentation(userTask.getDocumentation());
}
// }
}
// }
//
//查询历史
// //查询历史
List < HistoricTaskInstanceDto > historicTaskInstanceDtos = new ArrayList < > ( ) ;
// List<HistoricTaskInstanceDto> historicTaskInstanceDtos = new ArrayList<>();
// 查询当前任务的流转信息
// // 查询当前任务的流转信息
List < HistoricTaskInstance > taskHiInstances = historyService . createHistoricTaskInstanceQuery ( )
// List<HistoricTaskInstance> taskHiInstances = historyService.createHistoricTaskInstanceQuery()
. processInstanceId ( taskchildPicture . getProcessinstanceid ( ) )
// .processInstanceId(taskchildPicture.getProcessinstanceid())
. includeProcessVariables ( )
// .includeProcessVariables()
. orderByHistoricTaskInstanceStartTime ( )
// .orderByHistoricTaskInstanceStartTime()
. asc ( )
// .asc()
. list ( ) ;
// .list();
for ( HistoricTaskInstance taskHiInstance : taskHiInstances ) {
// for (HistoricTaskInstance taskHiInstance : taskHiInstances) {
HistoricTaskInstanceDto dto = new HistoricTaskInstanceDto ( ) ;
// HistoricTaskInstanceDto dto = new HistoricTaskInstanceDto();
dto . setTaskId ( taskHiInstance . getId ( ) ) ;
// dto.setTaskId(taskHiInstance.getId());
dto . setTaskName ( taskHiInstance . getName ( ) ) ;
// dto.setTaskName(taskHiInstance.getName());
dto . setFinishTime ( taskHiInstance . getEndTime ( ) ) ;
// dto.setFinishTime(taskHiInstance.getEndTime());
if ( taskHiInstance . getDurationInMillis ( ) ! = null ) {
// if (taskHiInstance.getDurationInMillis() != null) {
dto . setDuration ( taskHiInstance . getDurationInMillis ( ) / 1000 + "秒" ) ;
// dto.setDuration(taskHiInstance.getDurationInMillis() / 1000 + "秒");
}
// }
dto . setTaskDefKey ( taskHiInstance . getTaskDefinitionKey ( ) ) ;
// dto.setTaskDefKey(taskHiInstance.getTaskDefinitionKey());
//
//Map<String,Object> variables = taskHiInstance.getTaskLocalVariables();
// //Map<String,Object> variables = taskHiInstance.getTaskLocalVariables();
//
Map < String , Object > variables = taskHiInstance . getProcessVariables ( ) ;
// Map<String, Object> variables = taskHiInstance.getProcessVariables();
//
if ( null ! = variables & & null ! = variables . get ( "approvd" ) ) {
// if (null != variables && null != variables.get("approvd")) {
dto . setState ( variables . get ( "approvd" ) . toString ( ) ) ;
// dto.setState(variables.get("approvd").toString());
}
// }
//
if ( StringUtils . isNotBlank ( taskHiInstance . getAssignee ( ) ) ) {
// if (StringUtils.isNotBlank(taskHiInstance.getAssignee())) {
if ( SystemConstantsOa . OA_TASK_SKIP_ASSIGINE . equals ( taskHiInstance . getAssignee ( ) ) ) {
// if (SystemConstantsOa.OA_TASK_SKIP_ASSIGINE.equals(taskHiInstance.getAssignee())) {
dto . setAssigneeName ( taskHiInstance . getAssignee ( ) ) ;
// dto.setAssigneeName(taskHiInstance.getAssignee());
} else {
// } else {
User user1 = userService . findByLoginname ( taskHiInstance . getAssignee ( ) ) ;
// User user1 = userService.findByLoginname(taskHiInstance.getAssignee());
//
dto . setAssigneeName ( user1 . getUsername ( ) ) ;
// dto.setAssigneeName(user1.getUsername());
}
// }
//
}
// }
//
BpmnModel bpmnModel = repositoryService . getBpmnModel ( taskchildPicture . getProcessdefinitionid ( ) ) ;
// BpmnModel bpmnModel = repositoryService.getBpmnModel(taskchildPicture.getProcessdefinitionid());
//
// // 根据节点定义id获取节点元素
// // // 根据节点定义id获取节点元素
FlowElement flowElement = bpmnModel . getFlowElement ( taskHiInstance . getTaskDefinitionKey ( ) ) ;
// FlowElement flowElement = bpmnModel.getFlowElement(taskHiInstance.getTaskDefinitionKey());
if ( flowElement instanceof UserTask ) {
// if (flowElement instanceof UserTask) {
UserTask userTask = ( UserTask ) flowElement ;
// UserTask userTask = (UserTask) flowElement;
//
taskchildPicture . setDocumentation ( userTask . getDocumentation ( ) ) ;
// taskchildPicture.setDocumentation(userTask.getDocumentation());
}
// }
// 还需要根据 HistoricTaskInstance 找到对应的 审批意见
// // 还需要根据 HistoricTaskInstance 找到对应的 审批意见
List < Comment > processInstanceComments = taskService . getProcessInstanceComments ( taskchildPicture . getProcessinstanceid ( ) ) ;
// List<Comment> processInstanceComments = taskService.getProcessInstanceComments(taskchildPicture.getProcessinstanceid());
for ( Comment comment : processInstanceComments ) {
// for (Comment comment : processInstanceComments) {
//
if ( comment . getTaskId ( ) . equals ( taskHiInstance . getId ( ) ) ) {
// if (comment.getTaskId().equals(taskHiInstance.getId())) {
// 审批意见
// // 审批意见
String fullMessage = comment . getFullMessage ( ) ;
// String fullMessage = comment.getFullMessage();
dto . setComment ( fullMessage ) ;
// dto.setComment(fullMessage);
}
// }
}
// }
historicTaskInstanceDtos . add ( dto ) ;
// historicTaskInstanceDtos.add(dto);
}
// }
taskchildPicture . setTransferRecords ( historicTaskInstanceDtos ) ;
// taskchildPicture.setTransferRecords(historicTaskInstanceDtos);
}
// }
}
}
pageUtils . setTotalCount ( count . intValue ( ) ) ;
pageUtils . setTotalCount ( count . intValue ( ) ) ;
@ -1502,7 +1511,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
* @param tenantId
* @param tenantId
* @param pageUtils
* @param pageUtils
* /
* /
public List < OcrTaskchildPictureAppro > getMyProcessInstancesNew ( User user , String tenantId , Map < String , Object > searchQuery , PageUtils pageUtils ) {
public List < OcrTaskchildPictureAppro > getMyProcessInstancesNew ( User user , String
tenantId , Map < String , Object > searchQuery , PageUtils pageUtils ) {
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 ( ) ) ;
@ -1647,7 +1657,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
*
*
* @return
* @return
* /
* /
public IPage < FlowUnionVo > getMyListCc ( Map < String , Object > query , UserToken userToken , ParamterPage paramterPage ) {
public IPage < FlowUnionVo > getMyListCc ( Map < String , Object > query , UserToken userToken , ParamterPage
paramterPage ) {
//查询抄送给当前用户的fromid集合
//查询抄送给当前用户的fromid集合
QueryWrapper queryWrapper = new QueryWrapper ( ) ;
QueryWrapper queryWrapper = new QueryWrapper ( ) ;
@ -1764,7 +1775,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
}
public ResultVo removeTask ( String fromid , String taskid ) {
public ResultVo removeTask ( String fromid , String taskid ,String deptid ) {
// 获取当前任务
// 获取当前任务
OcrTaskchildPicture ocrTaskchildPicture = this . ocrTaskchildPictureService . selectDtoById ( Long . parseLong ( fromid ) ) ;
OcrTaskchildPicture ocrTaskchildPicture = this . ocrTaskchildPictureService . selectDtoById ( Long . parseLong ( fromid ) ) ;
@ -1783,7 +1794,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
String historyProcessDefinitionId = terminatedInstances . get ( 0 ) . getProcessDefinitionId ( ) ;
String historyProcessDefinitionId = terminatedInstances . get ( 0 ) . getProcessDefinitionId ( ) ;
boolean isStart = iFlowInstanceService . startProcessInstanceById ( historyProcessDefinitionId , ocrTaskchildPicture . getCreateusername ( ) ,
boolean isStart = iFlowInstanceService . startProcessInstanceById ( historyProcessDefinitionId , ocrTaskchildPicture . getCreateusername ( ) ,
ocrTaskchildPicture . getCreateuser ( ) , ocrTaskchildPicture . getId ( ) . toString ( ) , category . getServicename ( ) );
ocrTaskchildPicture . getCreateuser ( ) , ocrTaskchildPicture . getId ( ) . toString ( ) , category . getServicename ( ) ,deptid );
if ( isStart ) {
if ( isStart ) {
ResultVoUtil . success ( ) ;
ResultVoUtil . success ( ) ;
@ -1803,7 +1814,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
Category category = this . categoryService . getById ( ocrTaskchildPicture . getCategoryid ( ) ) ;
Category category = this . categoryService . getById ( ocrTaskchildPicture . getCategoryid ( ) ) ;
boolean isStart = iFlowInstanceService . startProcessInstanceById ( task . getProcessDefinitionId ( ) , ocrTaskchildPicture . getCreateusername ( ) ,
boolean isStart = iFlowInstanceService . startProcessInstanceById ( task . getProcessDefinitionId ( ) , ocrTaskchildPicture . getCreateusername ( ) ,
ocrTaskchildPicture . getCreateuser ( ) , ocrTaskchildPicture . getId ( ) . toString ( ) , category . getServicename ( ) );
ocrTaskchildPicture . getCreateuser ( ) , ocrTaskchildPicture . getId ( ) . toString ( ) , category . getServicename ( ) ,deptid );
if ( isStart ) {
if ( isStart ) {
ResultVoUtil . success ( ) ;
ResultVoUtil . success ( ) ;
@ -1819,7 +1830,22 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
@Override
@Override
public ResultVo repetitionTask ( ) {
public ResultVo repetitionTask ( ) {
return ResultVoUtil . success ( flowableccMybatisDao . repetitionTask ( ) ) ;
List < RepeatedContentVo > repeatedContentVoList = flowableccMybatisDao . repetitionTask ( ) ;
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 ( ) ) ; // 去除字符串首尾的空格并添加到集合中
}
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
@Override
@ -1836,7 +1862,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
* @param usersearchchild
* @param usersearchchild
* @return
* @return
* /
* /
private QueryWrapper < OcrTaskchildPicture > formattingSearchChild ( QueryWrapper < OcrTaskchildPicture > queryWrapper , OcrUsersearchchild usersearchchild ) {
private QueryWrapper < OcrTaskchildPicture > formattingSearchChild
( QueryWrapper < OcrTaskchildPicture > queryWrapper , OcrUsersearchchild usersearchchild ) {
switch ( usersearchchild . getSearchRelationType ( ) ) {
switch ( usersearchchild . getSearchRelationType ( ) ) {
case "where" :
case "where" :
this . formattingSearchType ( queryWrapper , usersearchchild ) ;
this . formattingSearchType ( queryWrapper , usersearchchild ) ;
@ -1860,7 +1887,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
* @param usersearchchild
* @param usersearchchild
* @return
* @return
* /
* /
private QueryWrapper < OcrTaskchildPicture > formattingSearchType ( QueryWrapper < OcrTaskchildPicture > queryWrapper , OcrUsersearchchild usersearchchild ) {
private QueryWrapper < OcrTaskchildPicture > formattingSearchType
( QueryWrapper < OcrTaskchildPicture > queryWrapper , OcrUsersearchchild usersearchchild ) {
//查询类型 相等true 不相等fase
//查询类型 相等true 不相等fase
boolean queryType = "eq" . equals ( usersearchchild . getSearchtype ( ) ) ;
boolean queryType = "eq" . equals ( usersearchchild . getSearchtype ( ) ) ;