@ -122,6 +122,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
private SysOrganizationFeign sysOrganizationFeign ;
@Resource
private FlowableService flowableService ;
public ResultBean < UserAndOrgPath > getNextNodeUserSidsOfCreate ( BusinessVariables bv ) {
ResultBean rb = ResultBean . fireFail ( ) ;
String orgSidPath = bv . getOrgSidPath ( ) ;
@ -137,6 +138,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
}
return getNextUserSids ( rb , orgSidPath , o ) ;
}
public ResultBean < UserAndOrgPath > getNextUserSids ( ResultBean rb , String orgSidPath , Object o ) {
UserAndOrgPath mapParam = new UserAndOrgPath ( ) ;
JSONArray jsonArray = JSONArray . parseArray ( JSON . toJSONString ( o ) ) ;
@ -166,6 +168,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
mapParam . setOrgPath ( nextNodeOrgPathSids_ ) ;
return rb . success ( ) . setData ( mapParam ) ;
}
public ResultBean getProcessCirculationNodesByMap ( BusinessVariables bv ) {
log . info ( "bv" ) ;
String modelId = null ;
@ -368,12 +371,40 @@ 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 ( ) ) ) {
String type = comment . getType ( ) ;
FlowCommentDto build = FlowCommentDto . builder ( ) . type ( type ) . comment ( comment . getFullMessage ( ) ) . build ( ) ;
// 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 ) ;
}
@ -528,7 +559,8 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
// taskQuery.taskCreatedAfter(DateUtils.dateStrConvertDate(paramMap.get("startDate").toString(), "yyyy-MM-dd"));
}
if ( paramMap . get ( "endDate" ) ! = null & & StringUtils . isNotBlank ( paramMap . get ( "endDate" ) . toString ( ) ) ) {
LocalDateTime localDateTime = LocalDateTime . ofInstant ( Instant . ofEpochMilli ( DateUtils . dateStrConvertDate ( paramMap . get ( "endDate" ) . toString ( ) , "yyyy-MM-dd" ) . getTime ( ) ) , ZoneId . systemDefault ( ) ) ; ;
LocalDateTime localDateTime = LocalDateTime . ofInstant ( Instant . ofEpochMilli ( DateUtils . dateStrConvertDate ( paramMap . get ( "endDate" ) . toString ( ) , "yyyy-MM-dd" ) . getTime ( ) ) , ZoneId . systemDefault ( ) ) ;
;
LocalDateTime endOfDay = localDateTime . with ( LocalTime . MAX ) ;
taskQuery . taskCreatedBefore ( Date . from ( endOfDay . atZone ( ZoneId . systemDefault ( ) ) . toInstant ( ) ) ) ;
// taskQuery.taskCreatedBefore(DateUtils.dateStrConvertDate(paramMap.get("endDate").toString(), "yyyy-MM-dd"));
@ -821,6 +853,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
ResultBean < Page < FlowTaskDto > > rb = new ResultBean < Page < FlowTaskDto > > ( ) ;
return rb . success ( ) . setData ( page ) ;
}
/ * *
* 已办任务列表
*
@ -1199,6 +1232,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
public ResultBean < List < LatestTaskVo > > taskReject ( FlowTaskVo flowTaskVo ) {
return taskReject_ ( flowTaskVo , false ) ;
}
/ * *
* 驳回任务
*
@ -1472,6 +1506,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
}
return historicActivityInstance . getTaskId ( ) ;
}
public ResultBean < List < LatestTaskVo > > revokeProcess ( FlowTaskVo flowTaskVo , int j ) {
HistoricTaskInstance historicTaskInstance = historyService . createHistoricTaskInstanceQuery ( ) . taskId ( flowTaskVo . getTaskId ( ) ) . singleResult ( ) ;
Execution execution = runtimeService . createExecutionQuery ( ) . executionId ( historicTaskInstance . getExecutionId ( ) ) . singleResult ( ) ;
@ -1536,6 +1571,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
return listResultBean ;
}
}
public ResultBean < List < LatestTaskVo > > revokeProcess ( FlowTaskVo flowTaskVo ) {
return revokeProcess ( flowTaskVo , 0 ) ;
}
@ -1866,6 +1902,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
List < BusinessTaskParam > fields = taskQueryPagerQuery . getParams ( ) . getFields ( ) ;
return businessFinishedList ( userSid , fields , current , size ) ;
}
public ResultBean < Page < FlowTaskDto > > businessDoneListNewForApp ( String userSid , PagerQuery < BusinessTaskQuery > taskQueryPagerQuery ) {
int size = Integer . valueOf ( taskQueryPagerQuery . getSize ( ) + "" ) ;
int current = Integer . valueOf ( taskQueryPagerQuery . getCurrent ( ) + "" ) ;
@ -1926,7 +1963,8 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
Object candidateGroups = jsonObject . get ( "candidateGroups" ) ;
map . put ( "candidateGroups" , candidateGroups ) ;
endTask = false ;
map . put ( "endTask" , endTask ) ; }
map . put ( "endTask" , endTask ) ;
}
}
if ( endTask ) {
map . put ( "name" , "结束" ) ;
@ -1937,6 +1975,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
list . add ( map ) ;
return rb . setData ( list ) ;
}
public ResultBean getPreviousNodesForReject ( BusinessVariables bv ) {
String modelId = null ;
if ( bv . getModelId ( ) ! = null ) {
@ -2009,8 +2048,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
}
}
TaskQuery or = taskQuery . active ( )
. includeProcessVariables ( )
;
. includeProcessVariables ( ) ;
if ( StringUtils . isNotBlank ( orgPath ) ) {
/* or.taskVariableValueLike("orgPath", "%" + orgPath + "%");*/
}
@ -2032,7 +2070,8 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
// taskQuery.taskCreatedAfter(DateUtils.dateStrConvertDate(paramMap.get("startDate").toString(), "yyyy-MM-dd"));
}
if ( paramMap . get ( "endDate" ) ! = null & & StringUtils . isNotBlank ( paramMap . get ( "endDate" ) . toString ( ) ) ) {
LocalDateTime localDateTime = LocalDateTime . ofInstant ( Instant . ofEpochMilli ( DateUtils . dateStrConvertDate ( paramMap . get ( "endDate" ) . toString ( ) , "yyyy-MM-dd" ) . getTime ( ) ) , ZoneId . systemDefault ( ) ) ; ;
LocalDateTime localDateTime = LocalDateTime . ofInstant ( Instant . ofEpochMilli ( DateUtils . dateStrConvertDate ( paramMap . get ( "endDate" ) . toString ( ) , "yyyy-MM-dd" ) . getTime ( ) ) , ZoneId . systemDefault ( ) ) ;
;
LocalDateTime endOfDay = localDateTime . with ( LocalTime . MAX ) ;
taskQuery . taskCreatedBefore ( Date . from ( endOfDay . atZone ( ZoneId . systemDefault ( ) ) . toInstant ( ) ) ) ;
// taskQuery.taskCreatedBefore(DateUtils.dateStrConvertDate(paramMap.get("endDate").toString(), "yyyy-MM-dd"));