Skip to content

Commit

Permalink
feat/默认关闭rocketmq依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
freestylefly committed Jul 22, 2024
1 parent f9564c6 commit c5733c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
8 changes: 4 additions & 4 deletions pmhub-modules/pmhub-project/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@
</dependency>

<!--Rocketmq-消息提醒,注意:如果不需要此模块,请自行注释,否则项目无法启动-->
<dependency>
<groupId>com.laigeoffer.pmhub-cloud</groupId>
<artifactId>pmhub-base-notice</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.laigeoffer.pmhub-cloud</groupId>-->
<!-- <artifactId>pmhub-base-notice</artifactId>-->
<!-- </dependency>-->

</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.laigeoffer.pmhub.base.core.enums.ProjectStatusEnum;
import com.laigeoffer.pmhub.base.core.utils.StringUtils;
import com.laigeoffer.pmhub.base.notice.domain.dto.TaskOvertimeRemindDTO;
import com.laigeoffer.pmhub.base.notice.utils.OAUtils;
import com.laigeoffer.pmhub.base.notice.utils.RocketMqUtils;
import com.laigeoffer.pmhub.base.notice.utils.SsoUrlUtils;
import com.laigeoffer.pmhub.project.domain.ProjectTaskNotify;
import com.laigeoffer.pmhub.project.domain.vo.project.task.TaskNotifyDTO;
import com.laigeoffer.pmhub.project.mapper.ProjectTaskMapper;
Expand All @@ -18,16 +14,11 @@
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.Collections;
import java.util.List;

import static com.laigeoffer.pmhub.base.notice.utils.MessageUtils.*;
import static com.laigeoffer.pmhub.base.notice.utils.SsoUrlUtils.ssoPath;


/**
* 任务已逾期提醒
Expand Down Expand Up @@ -61,20 +52,20 @@ public void taskNotify() {
ProjectTaskNotify projectTaskNotify = projectTaskNotifyMapper.selectOne(qw);
// 如果数据库不存在记录则就进行消息通知及插入数据库
if (projectTaskNotify == null) {
// 进行逾期任务消息提醒
TaskOvertimeRemindDTO taskOvertimeRemindDTO = new TaskOvertimeRemindDTO();
// 设置发送用户
taskOvertimeRemindDTO.setUserIds(Collections.singletonList(taskNotifyDTO.getUserWxName()));
// 设置任务详情页
String url = SsoUrlUtils.ssoCreate(appid, agentid, host + path + ssoPath + URLEncoder.encode(host + "/pmhub-project/my-task/info?taskId=" + taskNotifyDTO.getTaskId()));
taskOvertimeRemindDTO.setDetailUrl(url);
// 设置任务名称
taskOvertimeRemindDTO.setTaskName(taskNotifyDTO.getTaskName());
taskOvertimeRemindDTO.setOaTitle("任务已逾期提醒");
taskOvertimeRemindDTO.setOaContext("您的任务【" + taskNotifyDTO.getTaskName() + "】已经逾期,请及时处理!");
taskOvertimeRemindDTO.setUserName(taskNotifyDTO.getUserName());
taskOvertimeRemindDTO.setLinkUrl(OAUtils.ssoCreate(host + "/pmhub-project/my-task/info?taskId=" + taskNotifyDTO.getTaskId()));
RocketMqUtils.push2Wx(taskOvertimeRemindDTO);
// 进行逾期任务消息提醒(需要使用MQ请开启这段注释)
// TaskOvertimeRemindDTO taskOvertimeRemindDTO = new TaskOvertimeRemindDTO();
// // 设置发送用户
// taskOvertimeRemindDTO.setUserIds(Collections.singletonList(taskNotifyDTO.getUserWxName()));
// // 设置任务详情页
// String url = SsoUrlUtils.ssoCreate(appid, agentid, host + path + ssoPath + URLEncoder.encode(host + "/pmhub-project/my-task/info?taskId=" + taskNotifyDTO.getTaskId()));
// taskOvertimeRemindDTO.setDetailUrl(url);
// // 设置任务名称
// taskOvertimeRemindDTO.setTaskName(taskNotifyDTO.getTaskName());
// taskOvertimeRemindDTO.setOaTitle("任务已逾期提醒");
// taskOvertimeRemindDTO.setOaContext("您的任务【" + taskNotifyDTO.getTaskName() + "】已经逾期,请及时处理!");
// taskOvertimeRemindDTO.setUserName(taskNotifyDTO.getUserName());
// taskOvertimeRemindDTO.setLinkUrl(OAUtils.ssoCreate(host + "/pmhub-project/my-task/info?taskId=" + taskNotifyDTO.getTaskId()));
// RocketMqUtils.push2Wx(taskOvertimeRemindDTO);

// 插入记录
ProjectTaskNotify ptn = new ProjectTaskNotify();
Expand Down

0 comments on commit c5733c3

Please sign in to comment.