Browse Source

保存系统通知

master
CMM 1 year ago
parent
commit
327a5e2348
2 changed files with 39 additions and 8 deletions
  1. +10
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/staging/enums/MsgTypeEnum.java
  2. +29
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java

+ 10
- 7
pmapi/src/main/java/com/ningdatech/pmapi/staging/enums/MsgTypeEnum.java View File

@@ -17,21 +17,24 @@ import java.util.Objects;
@NoArgsConstructor
public enum MsgTypeEnum {
/**
* 消息类型 项目评审
* 消息类型
*/
PROJECT_REVIEW,
/**
* 异常告警
* 项目审核
*/
WARING,
PROJECT_REVIEW(1,"项目审核"),
/**
* 预警提醒
*/
WARING(2,"预警提醒"),
/**
* 专家评审
*/
EXPERT_REVIEW,
EXPERT_REVIEW(3,"专家评审"),
/**
* 专家会议
* 评审会议
*/
REVIEW_MEETING;
REVIEW_MEETING(4,"评审会议");

private Integer code;
private String desc;


+ 29
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -51,6 +51,8 @@ import com.ningdatech.pmapi.signature.service.ICompanySignatureService;
import com.ningdatech.pmapi.staging.enums.MsgTypeEnum;
import com.ningdatech.pmapi.staging.service.INdWorkNoticeStagingService;
import com.ningdatech.pmapi.staging.service.IProjectStagingService;
import com.ningdatech.pmapi.sys.model.entity.Notify;
import com.ningdatech.pmapi.sys.service.INotifyService;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.todocenter.enumeration.IsOrNotEnum;
import com.ningdatech.pmapi.todocenter.model.dto.AdjustHandleDTO;
@@ -144,8 +146,8 @@ public class TodoCenterManage {
private final PdfUtils pdfUtils;
private final FileService fileService;
private final ICompanySignatureService companySignatureService;

private final StatisticsService statisticsService;
private final INotifyService notifyService;

/**
* 待办中心待我处理项目列表查询
@@ -370,6 +372,8 @@ public class TodoCenterManage {
WorkNoticeInfo passWorkNoticeInfo2 = getSendWorkNoticeInfo(startUserInfo);
String passMsg2 = String.format(PASS_MSG_TEMPLATE2, projectName, processDefinitionName);
passWorkNoticeInfo2.setMsg(passMsg2);
// 放入系统通知表中,保存记录
assemblyAuditNotify(userId, declaredProject, passMsg2);
// 放入工作通知暂存表中,通过扫表异步发送
workNoticeStagingService.addByWorkNotice(passWorkNoticeInfo2, MsgTypeEnum.PROJECT_REVIEW);
} else {
@@ -382,6 +386,8 @@ public class TodoCenterManage {
WorkNoticeInfo sendWorkNoticeInfo = getSendWorkNoticeInfo(auditUserInfo);
String msg = String.format(PASS_MSG_TEMPLATE, sendWorkNoticeInfo.getOrganizationName(), projectName);
sendWorkNoticeInfo.setMsg(msg);
// 放入系统通知表中,保存记录
assemblyAuditNotify(userId, declaredProject, msg);
// 放入工作通知暂存表中,通过扫表异步发送
workNoticeStagingService.addByWorkNotice(sendWorkNoticeInfo, MsgTypeEnum.PROJECT_REVIEW);
}
@@ -397,6 +403,8 @@ public class TodoCenterManage {
WorkNoticeInfo rejectWorkNoticeInfo = getSendWorkNoticeInfo(startUserInfo);
String rejectMsg = String.format(REJECT_MSG_TEMPLATE, projectName, processDefinitionName);
rejectWorkNoticeInfo.setMsg(rejectMsg);
// 放入系统通知表中,保存记录
assemblyAuditNotify(userId, declaredProject, rejectMsg);
// 放入工作通知暂存表中,通过扫表异步发送
workNoticeStagingService.addByWorkNotice(rejectWorkNoticeInfo, MsgTypeEnum.PROJECT_REVIEW);
break;
@@ -409,6 +417,8 @@ public class TodoCenterManage {
WorkNoticeInfo backWorkNoticeInfo = getSendWorkNoticeInfo(startUserInfo);
String backMsg = String.format(BACK_MSG_TEMPLATE, projectName, processDefinitionName);
backWorkNoticeInfo.setMsg(backMsg);
// 放入系统通知表中,保存记录
assemblyAuditNotify(userId, declaredProject, backMsg);
// 放入工作通知暂存表中,通过扫表异步发送
workNoticeStagingService.addByWorkNotice(backWorkNoticeInfo, MsgTypeEnum.PROJECT_REVIEW);
break;
@@ -474,6 +484,24 @@ public class TodoCenterManage {
}

/**
* 装配项目审核工作通知
* @param userId
* @param project
* @param msg
*/
private void assemblyAuditNotify(Long userId, Project project, String msg) {
Notify notify = new Notify();
notify.setTitle(msg);
notify.setUserId(userId);
notify.setType(MsgTypeEnum.PROJECT_REVIEW.name());
notify.setInstanceId(project.getInstCode());
notify.setContent(msg);
notify.setReaded(Boolean.FALSE);
notify.setCreateTime(LocalDateTime.now());
notifyService.save(notify);
}

/**
* 调用IRS接口,获取盖章后的pdf文件,上传到OSS,并保存文件ID到项目库中
* @param req
* @param declaredProject


Loading…
Cancel
Save