|
@@ -1,5 +1,6 @@
|
|
|
package com.qmth.eds.service.impl;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.eds.bean.dto.ExamSyncTotalDownloadDto;
|
|
@@ -15,6 +16,12 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.time.Instant;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -37,11 +44,17 @@ public class BasicMessageServiceImpl extends ServiceImpl<BasicMessageMapper, Bas
|
|
|
|
|
|
@Override
|
|
|
public void sendTeachDataChangeNotice(Long schoolId, Long semesterId, Long examTypeId) {
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
+ String currentDate = LocalDate.now().format(formatter);
|
|
|
List<ExamSyncTotalDownloadDto> examSyncTotalDownloadDtos = examSyncTotalService.listDownloadRecordInfos(schoolId, semesterId, examTypeId);
|
|
|
if (!examSyncTotalDownloadDtos.isEmpty()) {
|
|
|
for (ExamSyncTotalDownloadDto examSyncTotalDownloadDto : examSyncTotalDownloadDtos) {
|
|
|
- // todo 参数拼接
|
|
|
- String variableParams = "{}";
|
|
|
+ // 短信参数
|
|
|
+ Map<String, String> map = new HashMap<>();
|
|
|
+ map.put("userName", examSyncTotalDownloadDto.getUserName());
|
|
|
+ map.put("schoolName", examSyncTotalDownloadDto.getSchoolName());
|
|
|
+ map.put("currentDate", currentDate);
|
|
|
+ String variableParams = JSONObject.toJSONString(map);
|
|
|
String remark = "下载的文件有变动,请重新下载";
|
|
|
saveMessageSendLog(schoolId, examSyncTotalDownloadDto.getUserId(), examSyncTotalDownloadDto.getUserName(), examSyncTotalDownloadDto.getMobileNumber(), variableParams, MessageEnum.NOTICE_OF_TEACH_DATA_CHANGE, examSyncTotalDownloadDto.getId(), remark);
|
|
|
}
|