@@ -1,6 +1,8 @@ | |||||
package com.ningdatech.pmapi.sys.manage; | package com.ningdatech.pmapi.sys.manage; | ||||
import cn.hutool.core.bean.BeanUtil; | 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.conditions.query.LambdaQueryWrapper; | ||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; | import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 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.req.NotifyListReq; | ||||
import com.ningdatech.pmapi.sys.model.vo.NotifyVO; | import com.ningdatech.pmapi.sys.model.vo.NotifyVO; | ||||
import com.ningdatech.pmapi.sys.service.INotifyService; | import com.ningdatech.pmapi.sys.service.INotifyService; | ||||
import com.ningdatech.pmapi.todocenter.constant.WorkNoticeContant; | |||||
import com.ningdatech.pmapi.user.util.LoginUserUtil; | import com.ningdatech.pmapi.user.util.LoginUserUtil; | ||||
import lombok.RequiredArgsConstructor; | import lombok.RequiredArgsConstructor; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
@@ -46,7 +49,18 @@ public class NotifyManage { | |||||
return PageVo.empty(); | return PageVo.empty(); | ||||
} | } | ||||
List<NotifyVO> list = page.getRecords().stream() | 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()); | .collect(Collectors.toList()); | ||||
return PageVo.of(list,page.getTotal()); | return PageVo.of(list,page.getTotal()); | ||||
} | } | ||||
@@ -36,9 +36,6 @@ public class Notify implements Serializable { | |||||
@ApiModelProperty("内容") | @ApiModelProperty("内容") | ||||
private String content; | private String content; | ||||
@ApiModelProperty("实例id") | |||||
private String instanceId; | |||||
@ApiModelProperty("是否已读") | @ApiModelProperty("是否已读") | ||||
private Boolean readed; | private Boolean readed; | ||||
@@ -51,6 +48,7 @@ public class Notify implements Serializable { | |||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
private LocalDateTime createTime; | private LocalDateTime createTime; | ||||
@ApiModelProperty("其他业务信息") | |||||
private String extraInfo; | private String extraInfo; | ||||
} | } |
@@ -54,6 +54,12 @@ public class NotifyVO implements Serializable { | |||||
@ApiModelProperty("创建时间") | @ApiModelProperty("创建时间") | ||||
private LocalDateTime createTime; | private LocalDateTime createTime; | ||||
@ApiModelProperty("项目ID") | |||||
private Long projectId; | |||||
@ApiModelProperty("会议ID") | |||||
private Long meetingId; | |||||
public String getTypeName(){ | public String getTypeName(){ | ||||
if(Objects.nonNull(this.type)){ | if(Objects.nonNull(this.type)){ | ||||
return MsgTypeEnum.getDescByName(this.type); | return MsgTypeEnum.getDescByName(this.type); | ||||
@@ -16,5 +16,9 @@ public interface WorkNoticeContant { | |||||
public final String REVIEW_MEETING_TEMPLATE = "【%s】已完成专家抽取,请及时处理。"; | public final String REVIEW_MEETING_TEMPLATE = "【%s】已完成专家抽取,请及时处理。"; | ||||
public final String WARNING_ALERT_TEMPLATE = "【%s】的【%s】待您审核,已停留2小时,请及时处理。"; | 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"; | |||||
} | } |
@@ -33,6 +33,7 @@ import com.ningdatech.pmapi.sys.model.entity.Notify; | |||||
import com.ningdatech.pmapi.sys.service.INotifyService; | import com.ningdatech.pmapi.sys.service.INotifyService; | ||||
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo; | ||||
import com.ningdatech.pmapi.todocenter.constant.TodoCenterContant; | 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.service.StatisticsService; | ||||
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils; | ||||
import com.ningdatech.pmapi.todocenter.utils.PdfUtils; | import com.ningdatech.pmapi.todocenter.utils.PdfUtils; | ||||
@@ -354,10 +355,14 @@ public class HandlerManage { | |||||
Notify notify = new Notify(); | Notify notify = new Notify(); | ||||
notify.setTitle(AUDIT_WORK_TITLE); | notify.setTitle(AUDIT_WORK_TITLE); | ||||
notify.setUserId(userId); | notify.setUserId(userId); | ||||
notify.setInstanceId(project.getInstCode()); | |||||
notify.setContent(msg); | notify.setContent(msg); | ||||
notify.setReaded(Boolean.FALSE); | notify.setReaded(Boolean.FALSE); | ||||
notify.setCreateTime(LocalDateTime.now()); | 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; | return notify; | ||||
} | } | ||||
@@ -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; | |||||
} |