Explorar el Código

工作通知修改

master
CMM hace 1 año
padre
commit
8fbaea5c08
Se han modificado 6 ficheros con 56 adiciones y 5 borrados
  1. +15
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java
  2. +1
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Notify.java
  3. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NotifyVO.java
  4. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeContant.java
  5. +6
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java
  6. +24
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/ProjectAuditMsgExtraDTO.java

+ 15
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NotifyManage.java Ver fichero

@@ -1,6 +1,8 @@
package com.ningdatech.pmapi.sys.manage;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -10,6 +12,7 @@ import com.ningdatech.pmapi.sys.model.entity.Notify;
import com.ningdatech.pmapi.sys.model.req.NotifyListReq;
import com.ningdatech.pmapi.sys.model.vo.NotifyVO;
import com.ningdatech.pmapi.sys.service.INotifyService;
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
@@ -46,7 +49,18 @@ public class NotifyManage {
return PageVo.empty();
}
List<NotifyVO> list = page.getRecords().stream()
.map(n -> BeanUtil.copyProperties(n,NotifyVO.class))
.map(n -> {
NotifyVO notifyVo = new NotifyVO();
BeanUtil.copyProperties(n,notifyVo);
JSONObject jsonObject = JSON.parseObject(n.getExtraInfo());
Long projectId = jsonObject.getLong(WorkNoticeContant.PROJECT_ID);
String instanceId = jsonObject.getString(WorkNoticeContant.INSTANCE_ID);
Long meetingId = jsonObject.getLong(WorkNoticeContant.MEETING_ID);
notifyVo.setProjectId(projectId);
notifyVo.setInstanceId(instanceId);
notifyVo.setMeetingId(meetingId);
return notifyVo;
})
.collect(Collectors.toList());
return PageVo.of(list,page.getTotal());
}


+ 1
- 3
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/entity/Notify.java Ver fichero

@@ -36,9 +36,6 @@ public class Notify implements Serializable {
@ApiModelProperty("内容")
private String content;

@ApiModelProperty("实例id")
private String instanceId;

@ApiModelProperty("是否已读")
private Boolean readed;

@@ -51,6 +48,7 @@ public class Notify implements Serializable {
@ApiModelProperty("创建时间")
private LocalDateTime createTime;

@ApiModelProperty("其他业务信息")
private String extraInfo;

}

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/sys/model/vo/NotifyVO.java Ver fichero

@@ -54,6 +54,12 @@ public class NotifyVO implements Serializable {
@ApiModelProperty("创建时间")
private LocalDateTime createTime;

@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("会议ID")
private Long meetingId;

public String getTypeName(){
if(Objects.nonNull(this.type)){
return MsgTypeEnum.getDescByName(this.type);


+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/constant/WorkNoticeContant.java Ver fichero

@@ -16,5 +16,9 @@ public interface WorkNoticeContant {
public final String REVIEW_MEETING_TEMPLATE = "【%s】已完成专家抽取,请及时处理。";
public final String WARNING_ALERT_TEMPLATE = "【%s】的【%s】待您审核,已停留2小时,请及时处理。";

public final String PROJECT_ID = "projectId";
public final String INSTANCE_ID = "instanceId";
public final String MEETING_ID = "meetingId";


}

+ 6
- 1
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/HandlerManage.java Ver fichero

@@ -33,6 +33,7 @@ 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.constant.TodoCenterContant;
import com.ningdatech.pmapi.todocenter.model.dto.ProjectAuditMsgExtraDTO;
import com.ningdatech.pmapi.todocenter.service.StatisticsService;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.ningdatech.pmapi.todocenter.utils.PdfUtils;
@@ -354,10 +355,14 @@ public class HandlerManage {
Notify notify = new Notify();
notify.setTitle(AUDIT_WORK_TITLE);
notify.setUserId(userId);
notify.setInstanceId(project.getInstCode());
notify.setContent(msg);
notify.setReaded(Boolean.FALSE);
notify.setCreateTime(LocalDateTime.now());
ProjectAuditMsgExtraDTO msgExtraDto = new ProjectAuditMsgExtraDTO();
msgExtraDto.setProjectId(project.getId());
msgExtraDto.setInstanceId(project.getInstCode());
String extraJson = JSON.toJSONString(msgExtraDto);
notify.setExtraInfo(extraJson);
return notify;
}



+ 24
- 0
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/model/dto/ProjectAuditMsgExtraDTO.java Ver fichero

@@ -0,0 +1,24 @@
package com.ningdatech.pmapi.todocenter.model.dto;

import com.ningdatech.pmapi.sys.model.dto.AbstractMsgExtraDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 项目审核工作通知信息实体
*
* @author CMM
* @since 2023/04/12 16:13
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProjectAuditMsgExtraDTO extends AbstractMsgExtraDTO {
@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("流程实例ID")
private String instanceId;
}

Cargando…
Cancelar
Guardar