Merge branch 'dev'

This commit is contained in:
wangliwen 2022-10-18 17:22:45 +08:00
commit 4245d1c782
1 changed files with 12 additions and 39 deletions

View File

@ -194,6 +194,8 @@ public class ActivitiNoticeAspect {
Integer type = 12; Integer type = 12;
if ("能力申请流程".equals(activitiNoticeOperation.process())) { if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 0; type = 0;
//进度通知您发起的+资源名称+申请已通过+审核部门已审核部门+审核下一节点为+审核部门+审核
content = "【进度通知】您发起的" + resourceName + "申请已被" + userDTO.getDeptName() + "" + userDTO.getRealName() + "审核,审核结果为:" + finalResult;
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) { } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type = 2; type = 2;
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) { } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
@ -299,11 +301,15 @@ public class ActivitiNoticeAspect {
String finalResult = result; String finalResult = result;
CompletableFuture.runAsync(() -> { // 发起人 CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
String content = "【通知】" + userDTO.getRealName() + ",您发起的 " + resourceName + " " + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; String content = "【通知】" + userDTO.getRealName() + ",您发起的 " + resourceName + " " + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult;
SysNoticeDTO dto = new SysNoticeDTO(); SysNoticeDTO dto = new SysNoticeDTO();
Integer type = 10; Integer type = 10;
if ("能力申请流程".equals(activitiNoticeOperation.process())) { if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 0; type = 0;
//审核结束通知通知内容审核完成通知您发起的+资源名称+申请已完成审核请登录UCS我的申请查看详情
content = "【审核完成通知】您发起的" + resourceName + "申请已完成审核请登录UCS“我的申请”查看详情。" + "审核结果为:" + finalResult;
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) { } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type = 2; type = 2;
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) { } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
@ -327,45 +333,6 @@ public class ActivitiNoticeAspect {
dto.setFrom("通知"); dto.setFrom("通知");
dto.setApplyState(0); dto.setApplyState(0);
sysNoticeService.save(dto); sysNoticeService.save(dto);
}, EXECUTOR).thenRunAsync(() -> {
LOGGER.error("大数据局名称:{}", bigDateDeptName);
SysDeptDTO deptDTO = sysDeptService.getByName(bigDateDeptName);
LOGGER.error("deptDTOId:{}", deptDTO.getId());
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
LOGGER.error("roleDTOId:{}", roleDTO.getId());
Optional<SysUserDTO> userDTO = Optional.ofNullable(sysUserService.getByDeptIdAndRoleId(deptDTO.getId(), roleDTO.getId()));
userDTO.ifPresent(user -> {
SysUserDTO creatorDTO = sysUserService.get(Long.valueOf(finalCreator));
SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(2);
dto.setTitle("流程结束系统通知");
String content = "【通知】" + user.getRealName() + "," + creatorDTO.getRealName() + "发起的" + activitiNoticeOperation.process() + " 已完成,审核结果为:" + finalResult;
Integer type = 10;
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 1;
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type = 3;
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
type = 5;
} else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
type = 7;
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type = 9;
}
dto.setType(type);
dto.setContent(content); // 通知内容
dto.setReceiverType(1);
dto.setReceiverTypeIds(userDTO.get().getId().toString());
dto.setStatus(NoticeStatusEnum.SEND.value());
dto.setSenderName("流程系统");
dto.setSenderDate(new Date());
dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date());
dto.setFrom("通知");
dto.setApplyId(execution.getProcessInstanceId());
dto.setApplyState(1);
sysNoticeService.save(dto);
});
}, EXECUTOR); }, EXECUTOR);
} catch (Exception exception) { } catch (Exception exception) {
LOGGER.error("发送通知消息异常", exception); LOGGER.error("发送通知消息异常", exception);
@ -443,6 +410,8 @@ public class ActivitiNoticeAspect {
Integer type = 10; Integer type = 10;
if ("能力申请流程".equals(activitiNoticeOperation.process())) { if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 0; type = 0;
//进度通知您发起的+资源名称+申请已通过+审核部门已审核部门+审核下一节点为+审核部门+审核
content = "【进度通知】您发起的" + resourceName + "申请正在由" + assignee.getDeptName() + "" + assignee.getRealName() + "审核,请耐心等待";
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) { } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type = 2; type = 2;
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) { } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
@ -472,10 +441,14 @@ public class ActivitiNoticeAspect {
}, EXECUTOR).thenRunAsync(() -> { // 审批者 }, EXECUTOR).thenRunAsync(() -> { // 审批者
try { try {
SysUserDTO owner = sysUserService.get(Long.valueOf(finalCreator)); SysUserDTO owner = sysUserService.get(Long.valueOf(finalCreator));
String content = "【通知】" + owner.getRealName() + "发起的流程" + resourceName + activitiNoticeOperation.process() + " 已进入审核节点:" + activitiNoticeOperation.value() + ";当前审核人指派为您"; String content = "【通知】" + owner.getRealName() + "发起的流程" + resourceName + activitiNoticeOperation.process() + " 已进入审核节点:" + activitiNoticeOperation.value() + ";当前审核人指派为您";
Integer type = 10; Integer type = 10;
if ("能力申请流程".equals(activitiNoticeOperation.process())) { if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 1; type = 1;
//待办通知通知的是流程当前审核人通知内容[待办通知]申请部门+申请人+提出资源名称+申请请进入UCS后台管理系统进行审核
content = "【待办通知】" + owner.getDeptName() + owner.getRealName() + "提出 ”" + resourceName + " ”+申请请进入UCS后台管理系统进行审核。";
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) { } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type = 3; type = 3;
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) { } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {