@ -296,8 +296,9 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
List < HistoricActivityInstance > list = historyService
. createHistoricActivityInstanceQuery ( )
. processInstanceId ( procInsId )
. orderByHistoricActivityInstanceStartTime ( )
. desc ( ) . list ( ) ;
/ * . orderByHistoricActivityInstanceStartTime ( )
. desc ( ) . list ( ) ; * /
. list ( ) ;
Map < String , String > processInstance = processService . getProcessInstanceById ( procInsId ) ;
List < FlowTask > hisFlowList = new ArrayList < > ( ) ;
for ( HistoricActivityInstance histIns : list ) {
@ -354,11 +355,43 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
flowTask . setDuration ( histIns . getDurationInMillis ( ) = = null | | histIns . getDurationInMillis ( ) = = 0 ? null : FlowableUtils . getDate ( histIns . getDurationInMillis ( ) ) ) ;
// 获取意见评论内容
List < Comment > commentList = taskService . getProcessInstanceComments ( histIns . getProcessInstanceId ( ) ) ;
commentList . sort ( Comparator . comparing ( Comment : : getTime ) ) ;
commentList . forEach ( comment - > {
if ( histIns . getTaskId ( ) . equals ( comment . getTaskId ( ) ) ) {
/ * if ( histIns . getTaskId ( ) . equals ( comment . getTaskId ( ) ) ) {
String type = comment . getType ( ) ;
FlowCommentDto build = FlowCommentDto . builder ( ) . type ( type ) . comment ( comment . getFullMessage ( ) ) . build ( ) ;
flowTask . setComment ( build ) ;
} * /
if ( histIns . getTaskId ( ) . equals ( comment . getTaskId ( ) ) ) {
String type = comment . getType ( ) ;
// FlowCommentDto build = FlowCommentDto.builder().type(type).comment(comment.getFullMessage()).build();
FlowCommentDto build = flowableService . selectComment ( type , histIns . getTaskId ( ) , histIns . getProcessInstanceId ( ) , comment . getId ( ) ) ;
if ( "4" . equals ( type ) ) { //加签委派
FlowTask flowTask1 = new FlowTask ( ) ;
String userSid = comment . getUserId ( ) ;
ResultBean < SysUserVo > sysUserVoResultBean = sysUserFeign . fetchBySid ( userSid ) ;
String name = "" ;
String headImg = "" ;
if ( sysUserVoResultBean . getData ( ) ! = null ) {
name = sysUserVoResultBean . getData ( ) . getName ( ) ;
headImg = sysUserVoResultBean . getData ( ) . getHeadImage ( ) ;
}
flowTask1 . setTaskName ( "加签审批意见" ) ;
List < TaskUserInfo > ll = new ArrayList < > ( ) ;
TaskUserInfo taskUserInfo = new TaskUserInfo ( ) ;
taskUserInfo . setAssigneeName ( name ) ;
taskUserInfo . setAssigneeSid ( userSid ) ;
taskUserInfo . setAssigneeHeadImage ( fileUploadComponent . getUrlPrefix ( ) + headImg ) ;
ll . add ( taskUserInfo ) ;
build . setComment ( build . getComment ( ) ) ;
flowTask1 . setFinishTime ( comment . getTime ( ) ) ;
flowTask1 . setCreateTime ( comment . getTime ( ) ) ;
flowTask1 . setTaskUserInfos ( ll ) ;
flowTask1 . setComment ( build ) ;
hisFlowList . add ( flowTask1 ) ;
} else {
flowTask . setComment ( build ) ;
}
}
} ) ;
hisFlowList . add ( flowTask ) ;
@ -549,7 +582,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
if ( sysUserVoResultBean . getData ( ) ! = null ) {
flowTask . setStartUserSid ( sysUserVoResultBean . getData ( ) . getSid ( ) ) ;
flowTask . setStartUserName ( sysUserVoResultBean . getData ( ) . getName ( ) ) ;
String createOrgPath = ConstantUtils . getString ( flowTask . getProcessVariables ( ) , "createrOrgPath" , "" ) ;
/ * String createOrgPath = ConstantUtils . getString ( flowTask . getProcessVariables ( ) , "createrOrgPath" , "" ) ;
String ogrName = "" ;
if ( StringUtils . isNotBlank ( createOrgPath ) ) {
List < String > stringList = Arrays . asList ( createOrgPath . split ( "/" ) ) ;
@ -567,7 +600,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
}
} else {
flowTask . setStartDeptName ( sysUserVoResultBean . getData ( ) . getOrganizationName ( ) ) ;
}
} * /
}
ResultBean < SysUserVo > sysUserVoResultBean2 = sysUserFeign . fetchBySid ( userSid ) ;
flowTask . setAssigneeName ( sysUserVoResultBean2 . getData ( ) . getName ( ) ) ;
@ -782,7 +815,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
flowTask . setEndTime ( new Date ( end_time_t_l ) ) ;
}
flowTask . setProcessVariables ( historicTaskInstance . getProcessVariables ( ) ) ;
String createOrgPath = ConstantUtils . getString ( flowTask . getProcessVariables ( ) , "createrOrgPath" , "" ) ;
/ * String createOrgPath = ConstantUtils . getString ( flowTask . getProcessVariables ( ) , "createrOrgPath" , "" ) ;
String ogrName = "" ;
if ( StringUtils . isNotBlank ( createOrgPath ) ) {
List < String > stringList = Arrays . asList ( createOrgPath . split ( "/" ) ) ;
@ -811,7 +844,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
} else {
flowTask . setStartDeptName ( "" ) ;
}
}
} * /
hisTaskList . add ( flowTask ) ;
}
page . setTotal ( count ) ;