Merge branch 'dev'

This commit is contained in:
wangliwen 2022-10-11 17:45:19 +08:00
commit 55e85e86f0
5 changed files with 25 additions and 19 deletions

View File

@ -190,7 +190,8 @@ public class ActivitiNoticeAspect {
CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
String content = "【通知】" + userDTO.getRealName() + ",您发起的" + resourceName + " " + activitiNoticeOperation.process() + " " + activitiNoticeOperation.value() + " 节点" + finalResult;
Integer type = 10;
SysNoticeDTO dto = new SysNoticeDTO();
Integer type = 12;
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 0;
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
@ -202,8 +203,8 @@ public class ActivitiNoticeAspect {
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type = 8;
}
SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(type);
dto.setApplyId(delegateTask.getExecution().getProcessInstanceId());
dto.setTitle("流程节点系统通知");
dto.setContent(content); // 通知内容
dto.setReceiverType(1);
@ -214,9 +215,6 @@ public class ActivitiNoticeAspect {
dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date());
dto.setFrom("通知");
if (tAbilityApplicationDTOList != null) {
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
}
dto.setApplyState(0);
sysNoticeService.save(dto);
}, EXECUTOR);
@ -302,6 +300,7 @@ public class ActivitiNoticeAspect {
CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
String content = "【通知】" + userDTO.getRealName() + ",您发起的 " + resourceName + " " + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult;
SysNoticeDTO dto = new SysNoticeDTO();
Integer type = 10;
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 0;
@ -314,8 +313,8 @@ public class ActivitiNoticeAspect {
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type = 8;
}
SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(type);
dto.setApplyId(execution.getProcessInstanceId());
dto.setTitle("流程结束系统通知");
dto.setContent(content); // 通知内容
dto.setReceiverType(1);
@ -326,9 +325,6 @@ public class ActivitiNoticeAspect {
dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date());
dto.setFrom("通知");
if (tAbilityApplicationDTOList != null) {
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
}
dto.setApplyState(0);
sysNoticeService.save(dto);
}, EXECUTOR).thenRunAsync(() -> {
@ -443,6 +439,7 @@ public class ActivitiNoticeAspect {
LOGGER.error("审核人:{}", assignee.getId());
String content = "【通知】您发起的流程 " + resourceName + activitiNoticeOperation.process() + " 当前审核节点为:" + activitiNoticeOperation.value() + ";当前审核部门为:\"" + assignee.getDeptName() + "\";审核负责人\"" + assignee.getRealName() + "\"";
LOGGER.info("通知内容:{}", content);
SysNoticeDTO dto = new SysNoticeDTO();
Integer type = 10;
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type = 0;
@ -455,8 +452,8 @@ public class ActivitiNoticeAspect {
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type = 8;
}
SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(type);
dto.setApplyId(delegateTask.getProcessInstanceId());
dto.setTitle("流程流转系统通知");
dto.setContent(content); // 通知内容
dto.setReceiverType(1);
@ -467,9 +464,6 @@ public class ActivitiNoticeAspect {
dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date());
dto.setFrom("通知");
if (tAbilityApplicationDTOList != null) {
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
}
dto.setApplyState(0);
sysNoticeService.save(dto);
} catch (Exception exception) {

View File

@ -102,7 +102,9 @@ public class TDemandCommentServiceImpl extends CrudServiceImpl<TDemandCommentDao
String content = "【评论】" + (sysUserDTO.isPresent() ? sysUserDTO.get().getRealName() : "") + " 您发起的需求 " + tDemandDataDTO.orElse(new TDemandDataDTO()).getDemandSubject()
+ " 有新的评论";
SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(2);
dto.setType(8);
dto.setApplyState(0);
dto.setApplyId(tDemandCommentDTO.getDemandDataDTO().getInstanceId());
dto.setTitle("需求评论系统通知");
dto.setContent(content); // 通知内容
dto.setReceiverType(1);

View File

@ -103,10 +103,12 @@ public class BookMeetingRoomController {
String content = "【通知】请审核" + dto.getName() + "发起的" + dto.getRoomName() +
"会议室申请";
SysNoticeDTO sysNoticeDTO = new SysNoticeDTO();
sysNoticeDTO.setType(2);
sysNoticeDTO.setTitle("会议室申请审核通知");
sysNoticeDTO.setContent(content); // 通知内容
sysNoticeDTO.setReceiverType(1);
sysNoticeDTO.setType(11);
sysNoticeDTO.setApplyId(dto.getRoomId().toString());
sysNoticeDTO.setApplyState(0);
// 根据roleId查询userId
List<Long> useIds = sysRoleUserService.getUserIdListByRoleId(Long.parseLong(defaultAssigneeRoleId));
if (useIds != null && useIds.size() > 0){
@ -127,7 +129,9 @@ public class BookMeetingRoomController {
String ownedContent = "【通知】您发起的" + dto.getRoomName() +
"会议室申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会议室管理员" ;
SysNoticeDTO ownedSysNoticeDTO = new SysNoticeDTO();
ownedSysNoticeDTO.setType(2);
ownedSysNoticeDTO.setType(10);
ownedSysNoticeDTO.setApplyState(0);
ownedSysNoticeDTO.setApplyId(dto.getId().toString());
ownedSysNoticeDTO.setTitle("会议室申请发起通知");
ownedSysNoticeDTO.setContent(ownedContent); // 通知内容
ownedSysNoticeDTO.setReceiverType(1);
@ -178,7 +182,9 @@ public class BookMeetingRoomController {
String content = "【通知】" + dto.getName() + ",您发起的" + dto.getRoomName() +
"会议室申请,审核结果为:" + state;
SysNoticeDTO sysNoticeDTO = new SysNoticeDTO();
sysNoticeDTO.setType(2);
sysNoticeDTO.setType(10);
sysNoticeDTO.setApplyState(1);
sysNoticeDTO.setApplyId(dto.getId().toString());
sysNoticeDTO.setTitle("会议室申请审核结果通知");
sysNoticeDTO.setContent(content); // 通知内容
sysNoticeDTO.setReceiverType(1);

View File

@ -20,7 +20,7 @@ public class SysNoticeDTO implements Serializable {
@ApiModelProperty(value = "id")
private Long id;
@ApiModelProperty(value = "通知类型 0申请前台 1申请后台 2上架前台 3上架后台 4下架前台 5下架后台 6需求前台 7需求后台 8评论前台 9评论后台 10其他")
@ApiModelProperty(value = "通知类型 0申请前台 1申请后台 2上架前台 3上架后台 4下架前台 5下架后台 6需求前台 7需求后台 8评论前台 9评论后台 10会议室前台 11会议室后台 12其他")
private Integer type;
@ApiModelProperty(value = "标题")
private String title;

View File

@ -27,6 +27,7 @@ import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.enums.SuperAdminEnum;
import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysUserService;
import io.swagger.annotations.Api;
@ -209,9 +210,12 @@ public class TAbilityApplicationController {
Map<String, Object> params = new HashMap<String, Object>() {
{
put("apply_flag", applyFlag); // 限定
put("user_id", user == null ? null : user.getId()); // 只出本人
}
};
// 非超级管理员只出本人
if(user.getSuperAdmin() == SuperAdminEnum.NO.value()){
params.put("user_id", user == null ? null : user.getId());
}
List<TAbilityApplicationDTO> applicationDTOS = tAbilityApplicationService.list(params);
Map<String, List<TAbilityApplicationDTO>> result = applicationDTOS.stream().collect(Collectors.groupingBy(t -> {
SysDeptDTO sysDeptDTO = t.getResourceOwnerDept();