@ -459,7 +459,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 , approve . getDeptid ( ) ) ;
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 ) ;
@ -480,26 +480,35 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
* 处 理 审 批 成 功 任 务
* 处 理 审 批 成 功 任 务
* /
* /
private void disposeSucceedTask ( Task task , ProcessDefinition processDefinition , Map < String , Object > variables ,
private void disposeSucceedTask ( Task task , ProcessDefinition processDefinition , Map < String , Object > variables ,
OcrTaskchildPicture model , String formId , UserToken userToken , FlowApprove approve , String deptid ) throws Exception {
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 , deptid ) ;
updateAssignee ( task . getProcessInstanceId ( ) , task . getProcessDefinitionId ( ) , processDefinition , deptid ) ;
Department department = departmentService . getOne ( new LambdaQueryWrapper < Department > ( ) . eq ( Department : : getDeptno , deptid ) ) ;
Department department = departmentService . getOne ( new LambdaQueryWrapper < Department > ( ) . eq ( Department : : getDeptno , deptid ) ) ;
IFormCustomService iFormCustomService = SpringUtils . getBean ( department . getServicename ( ) ) ;
IFormCustomService iFormCustomService = SpringUtils . getBean ( department . getServicename ( ) ) ;
FlowModelVO formData = iFormCustomService . getForm ( formId ) ;
FlowModelVO formData = iFormCustomService . getForm ( formId ) ;
List < Task > taskList = this . nowRunTask ( formData . getProcessInstanceId ( ) , formData . getProcessdefinitionid ( ) ) ;
List < Task > taskList = this . nowRunTask ( formData . getProcessInstanceId ( ) , formData . getProcessdefinitionid ( ) ) ;
OcrTaskchildPicture childPicture = ocrTaskchildPictureService . getById ( Long . parseLong ( formId ) ) ;
Task taskData = null ;
Task taskData = null ;
if ( null ! = taskList & & ! taskList . isEmpty ( ) ) {
if ( null ! = taskList & & ! taskList . isEmpty ( ) ) {
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 {
childPicture . setTaskId ( taskData . getId ( ) ) ;
childPicture . setTaskname ( taskData . getName ( ) ) ;
}
taskData = taskList . get ( 0 ) ;
taskData = taskList . get ( 0 ) ;
}
}
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 ) ;
OcrPicture picture = ocrPictureService . getById ( model . getPictureid ( ) ) ;
OcrPicture picture = ocrPictureService . getById ( model . getPictureid ( ) ) ;
ocrTaskchildPictureService . sendFlowTaskResult ( childPicture , picture , approve ) ;
ocrTaskchildPictureService . sendFlowTaskResult ( childPicture , picture , approve ) ;
} else {
} else {
childPicture . setTaskNode ( taskData . getDescription ( ) ) ;
//判断节点上的描述字段, 是否伟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 ) ;
childPicture . setIsFinal ( 1 ) ;
@ -507,8 +516,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
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 . setTaskname ( taskData . getName ( ) ) ;
}
}
ocrTaskchildPictureService . updateById ( childPicture ) ;
ocrTaskchildPictureService . updateById ( childPicture ) ;
//增加未查看记录
//增加未查看记录
@ -594,10 +602,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
* @param processDefinition
* @param processDefinition
* /
* /
public void updateAssignee ( String processInstanceId , String processDefinitionId , ProcessDefinition
public void updateAssignee ( String processInstanceId , String processDefinitionId , ProcessDefinition
processDefinition , String deptid ) {
processDefinition , String deptid ) {
//如果是多个候选人或者是候选组,做任务拾取
//如果是多个候选人或者是候选组,做任务拾取
FlowTaskCompleteVO flowTaskCompleteVO = updateNowTaskAssignee ( processInstanceId , processDefinitionId , deptid ) ;
FlowTaskCompleteVO flowTaskCompleteVO = updateNowTaskAssignee ( processInstanceId , processDefinitionId , deptid ) ;
if ( null ! = flowTaskCompleteVO ) {
if ( null ! = flowTaskCompleteVO ) {
@ -686,7 +694,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
*
*
* @param processInstanceId
* @param processInstanceId
* /
* /
public FlowTaskCompleteVO updateNowTaskAssignee ( String processInstanceId , String processDefinitionId , String deptid ) {
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 ) ;
@ -723,7 +731,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
//发起人员登录账号
//发起人员登录账号
String startUserId = hi . getStartUserId ( ) ;
String startUserId = hi . getStartUserId ( ) ;
//通过候选组主键,查询审批人员信息,并自动拾取
//通过候选组主键,查询审批人员信息,并自动拾取
loginuser = candidateuserService . getClaimUser ( startUserId , groupid , deptid ) ;
loginuser = candidateuserService . getClaimUser ( startUserId , groupid , deptid ) ;
if ( StringUtils . isNotBlank ( loginuser ) ) {
if ( StringUtils . isNotBlank ( loginuser ) ) {
taskService . claim ( task . getId ( ) , loginuser ) ;
taskService . claim ( task . getId ( ) , loginuser ) ;
}
}
@ -1501,6 +1509,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
ocrTaskchildPictureApproVo . setProjectName ( one . getFromprojectname ( ) ) ; //项目名称
ocrTaskchildPictureApproVo . setProjectName ( one . getFromprojectname ( ) ) ; //项目名称
ocrTaskchildPictureApproVo . setCustomerLevel ( one . getFromCustomerLevel ( ) ) ; //客户级别
ocrTaskchildPictureApproVo . setCustomerLevel ( one . getFromCustomerLevel ( ) ) ; //客户级别
ocrTaskchildPictureApproVo . setReleaseArea ( one . getFromCity ( ) ) ; //拜访城市
ocrTaskchildPictureApproVo . setReleaseArea ( one . getFromCity ( ) ) ; //拜访城市
ocrTaskchildPictureApproVo . setTaskIndex ( one . getTaskIndex ( ) = = null ? "1" : one . getTaskIndex ( ) ) ;
listNew . add ( ocrTaskchildPictureApproVo ) ;
listNew . add ( ocrTaskchildPictureApproVo ) ;
}
}
@ -1780,7 +1789,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
}
public ResultVo removeTask ( String fromid , String taskid , String deptid ) {
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 ) ) ;
@ -1799,7 +1808,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 ( ) , deptid ) ;
ocrTaskchildPicture . getCreateuser ( ) , ocrTaskchildPicture . getId ( ) . toString ( ) , category . getServicename ( ) , deptid ) ;
if ( isStart ) {
if ( isStart ) {
ResultVoUtil . success ( ) ;
ResultVoUtil . success ( ) ;
@ -1819,7 +1828,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 ( ) , deptid ) ;
ocrTaskchildPicture . getCreateuser ( ) , ocrTaskchildPicture . getId ( ) . toString ( ) , category . getServicename ( ) , deptid ) ;
if ( isStart ) {
if ( isStart ) {
ResultVoUtil . success ( ) ;
ResultVoUtil . success ( ) ;