|
|
@ -9,15 +9,19 @@ import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMess |
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMsgSendResult; |
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtCorpConversationMsgSendResult; |
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtMessage; |
|
|
import com.github.tingyugetc520.ali.dingtalk.bean.message.DtMessage; |
|
|
import com.github.tingyugetc520.ali.dingtalk.error.DtErrorException; |
|
|
import com.github.tingyugetc520.ali.dingtalk.error.DtErrorException; |
|
|
|
|
|
import com.project.classicpaper.application.ClassicPaperSetApplicationService; |
|
|
|
|
|
import com.project.classicpaper.domain.service.ClassicPaperSetBaseService; |
|
|
import com.project.ding.config.DingProperties; |
|
|
import com.project.ding.config.DingProperties; |
|
|
import com.project.information.application.ProductLineApplicationService; |
|
|
import com.project.information.application.ProductLineApplicationService; |
|
|
import com.project.task.domain.dto.TaskDTO; |
|
|
import com.project.task.domain.dto.TaskDTO; |
|
|
import com.project.task.domain.entity.TaskEntity; |
|
|
import com.project.task.domain.entity.TaskEntity; |
|
|
import com.project.task.domain.entity.TaskUserEntity; |
|
|
import com.project.task.domain.entity.TaskUserEntity; |
|
|
|
|
|
import com.project.task.domain.enums.ExamModeEnum; |
|
|
import com.project.task.domain.enums.TaskUserStatusEnum; |
|
|
import com.project.task.domain.enums.TaskUserStatusEnum; |
|
|
import com.project.task.domain.service.NotifyTaskDomainService; |
|
|
import com.project.task.domain.service.NotifyTaskDomainService; |
|
|
import com.project.task.mapper.TaskMapper; |
|
|
import com.project.task.mapper.TaskMapper; |
|
|
import com.project.task.mapper.TaskUserMapper; |
|
|
import com.project.task.mapper.TaskUserMapper; |
|
|
|
|
|
import io.vavr.control.Try; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
@ -43,6 +47,9 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService { |
|
|
@Autowired |
|
|
@Autowired |
|
|
private DingProperties dingTalkProperties; |
|
|
private DingProperties dingTalkProperties; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ClassicPaperSetBaseService classicPaperSetBaseService; |
|
|
|
|
|
|
|
|
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); |
|
|
private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -91,10 +98,13 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService { |
|
|
|
|
|
|
|
|
//获取子产品线名称
|
|
|
//获取子产品线名称
|
|
|
String subLineName = productLineApplicationService.searchLineNameById(taskDTO.getSubLineId()); |
|
|
String subLineName = productLineApplicationService.searchLineNameById(taskDTO.getSubLineId()); |
|
|
|
|
|
String classicPaperSetName = Try.of(() -> classicPaperSetBaseService.getById(taskDTO.getClassicPaperSetId()).getName()) |
|
|
|
|
|
.getOrElse(""); |
|
|
StringBuilder markdown = new StringBuilder(); |
|
|
StringBuilder markdown = new StringBuilder(); |
|
|
markdown.append(String.format("### 【%s】已经<font color=#00b500>开始</font>,请按时完成\n\n" , taskDTO.getName())) |
|
|
markdown.append(String.format("### 【%s】已经<font color=#00b500>开始</font>,请按时完成\n\n" , taskDTO.getName())) |
|
|
.append(String.format("产品线:%s\n\n" , subLineName)) |
|
|
.append(ExamModeEnum.GENERATIVE.getValue().equals(taskDTO.getExamMode()) ? |
|
|
|
|
|
String.format("资料分类:%s\n\n" , subLineName) : |
|
|
|
|
|
String.format("套题名称:%s\n\n" , classicPaperSetName)) |
|
|
.append(String.format("开考时间:%s\n\n" ,sdf.format(taskDTO.getStartTime()))) |
|
|
.append(String.format("开考时间:%s\n\n" ,sdf.format(taskDTO.getStartTime()))) |
|
|
.append(String.format("截止时间:%s\n\n" , sdf.format(taskDTO.getEndTime()))) |
|
|
.append(String.format("截止时间:%s\n\n" , sdf.format(taskDTO.getEndTime()))) |
|
|
.append(String.format("注意事项:%s" , taskDTO.getNote())); |
|
|
.append(String.format("注意事项:%s" , taskDTO.getNote())); |
|
|
@ -140,10 +150,14 @@ public class NotifyTaskDomainServiceImpl implements NotifyTaskDomainService { |
|
|
|
|
|
|
|
|
//获取子产品线名称
|
|
|
//获取子产品线名称
|
|
|
String subLineName = productLineApplicationService.searchLineNameById(taskDTO.getSubLineId()); |
|
|
String subLineName = productLineApplicationService.searchLineNameById(taskDTO.getSubLineId()); |
|
|
|
|
|
String classicPaperSetName = Try.of(() -> classicPaperSetBaseService.getById(taskDTO.getClassicPaperSetId()).getName()) |
|
|
|
|
|
.getOrElse(""); |
|
|
|
|
|
|
|
|
StringBuilder markdown = new StringBuilder(); |
|
|
StringBuilder markdown = new StringBuilder(); |
|
|
markdown.append(String.format("### 【%s】即将<font color=#FF0000>结束</font>,请按时完成\n\n" , taskDTO.getName())) |
|
|
markdown.append(String.format("### 【%s】即将<font color=#FF0000>结束</font>,请按时完成\n\n" , taskDTO.getName())) |
|
|
.append(String.format("产品线:%s\n\n" , subLineName)) |
|
|
.append(ExamModeEnum.GENERATIVE.getValue().equals(taskDTO.getExamMode()) ? |
|
|
|
|
|
String.format("资料分类:%s\n\n" , subLineName) : |
|
|
|
|
|
String.format("套题名称:%s\n\n" , classicPaperSetName)) |
|
|
.append(String.format("开考时间:%s\n\n" ,sdf.format(taskDTO.getStartTime()))) |
|
|
.append(String.format("开考时间:%s\n\n" ,sdf.format(taskDTO.getStartTime()))) |
|
|
.append(String.format("截止时间:%s\n\n" , sdf.format(taskDTO.getEndTime()))) |
|
|
.append(String.format("截止时间:%s\n\n" , sdf.format(taskDTO.getEndTime()))) |
|
|
.append(String.format("注意事项:%s" , taskDTO.getNote())); |
|
|
.append(String.format("注意事项:%s" , taskDTO.getNote())); |
|
|
|