|
@@ -757,6 +757,14 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
// flowExample.setDefinitionNodeId(jumpNode.getId());
|
|
|
// flowExample.setHandleUserId(context.getJumpHandleUserId());
|
|
|
flowExample.setStatus(context.getFlowStatus().getKey());
|
|
|
+
|
|
|
+ //赋值流程结束时间
|
|
|
+ if (context.getFlowStatus() == FlowStatusEnum.PASS ||
|
|
|
+ context.getFlowStatus() == FlowStatusEnum.REJECT ||
|
|
|
+ context.getFlowStatus() == FlowStatusEnum.CANCELLATION) {
|
|
|
+ flowExample.setEndTime(new Date());
|
|
|
+ }
|
|
|
+
|
|
|
boolean updateFlag = flowExampleService.updateById(flowExample);
|
|
|
if (!updateFlag) {
|
|
|
throw new ServiceException("流程已被处理");
|
|
@@ -985,12 +993,12 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
flowResult.setUserId(dynamicUserIdsStr);
|
|
|
return flowResult;
|
|
|
case DEPT_MANAGER:
|
|
|
- Long deptId ;
|
|
|
- if(ObjectUtil.isEmpty(node.getJumpCondition())){
|
|
|
+ Long deptId;
|
|
|
+ if (ObjectUtil.isEmpty(node.getJumpCondition())) {
|
|
|
//没表达式取发起人部门
|
|
|
SysUser createUser = sysUserService.getById(FlowThreadLocalUtil.getFlowCreateUser());
|
|
|
deptId = createUser.getDeptId();
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//有表达式取表达式部门
|
|
|
Expression exp = AviatorEvaluator.compile(node.getJumpCondition());
|
|
|
Object execute = exp.execute(FlowThreadLocalUtil.getTemplateData());
|
|
@@ -1016,28 +1024,28 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
.eq(SysUserIdentity::getDeptId, sysDept1.getDeptId())
|
|
|
.eq(SysUserIdentity::getIdentity, node.getHandleObjectId())
|
|
|
);
|
|
|
- String identityName ;
|
|
|
- switch (node.getHandleObjectId()){
|
|
|
- case "10":
|
|
|
- identityName = "员工";
|
|
|
- break;
|
|
|
- case "15":
|
|
|
- identityName = "组长";
|
|
|
+ String identityName;
|
|
|
+ switch (node.getHandleObjectId()) {
|
|
|
+ case "10":
|
|
|
+ identityName = "员工";
|
|
|
+ break;
|
|
|
+ case "15":
|
|
|
+ identityName = "组长";
|
|
|
break;
|
|
|
- case "20":
|
|
|
- identityName = "主管";
|
|
|
+ case "20":
|
|
|
+ identityName = "主管";
|
|
|
break;
|
|
|
- case "30":
|
|
|
- identityName = "经理";
|
|
|
+ case "30":
|
|
|
+ identityName = "经理";
|
|
|
break;
|
|
|
- case "40":
|
|
|
- identityName = "总监";
|
|
|
+ case "40":
|
|
|
+ identityName = "总监";
|
|
|
break;
|
|
|
default:
|
|
|
identityName = "未知职级";
|
|
|
}
|
|
|
if (identityList.size() == 0) {
|
|
|
- throw new ServiceException(StrUtil.format("流程节点处理人异常:部门无部门{}!",identityName));
|
|
|
+ throw new ServiceException(StrUtil.format("流程节点处理人异常:部门无部门{}!", identityName));
|
|
|
}
|
|
|
List<Long> userIds = identityList.stream().map(SysUserIdentity::getUserId).collect(Collectors.toList());
|
|
|
List<SysUser> identityUserList = sysUserService.list(Wrappers.<SysUser>lambdaQuery().in(SysUser::getUserId, userIds));
|
|
@@ -1098,7 +1106,8 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
pushUserIds.add(Long.valueOf(s));
|
|
|
}
|
|
|
}
|
|
|
- title = "您有一条新的待审批事项,请及时处理。";
|
|
|
+ FlowExample flowExample = flowExampleService.getById(flowId);
|
|
|
+ title = StrUtil.format("您有一条新的待审批事项,【{}】,请及时处理。", flowExample.getTitle());
|
|
|
}
|
|
|
|
|
|
for (Long pushUserId : pushUserIds) {
|
|
@@ -1159,7 +1168,7 @@ public class FlowProcessServiceImpl implements FlowProcessService {
|
|
|
}
|
|
|
// 如果下一节点不为结束节点
|
|
|
else {
|
|
|
- String title = "您有一条新的待审批事项,请及时处理。";
|
|
|
+ String title = StrUtil.format("您有一条新的待审批事项,【{}】,请及时处理。", flowExample.getTitle());
|
|
|
for (Long userId : jumpHandleUserIdList) {
|
|
|
PushParam pushParam = new PushParam();
|
|
|
pushParam.setUserId(userId);
|