Commit 1d098f37 by 涂亚平

去掉了redis

1 parent c06779f7
......@@ -7,7 +7,7 @@ public enum SmsCode {
SIGN_IN("SMS_234409992", "签到通知"),
TEST("SMS_234414789", "测试通知"),
CLASS_START("SMS_228017725", "开课通知"),
CLASS_START("SMS_228137810", "开课通知"),
ALL("SMS_228137810", "全部成员"),
NOT_SIGNED_IN("SMS_234409992","未签到成员"),
UNFINISHED("SMS_234414789","未完课成员");
......
......@@ -52,14 +52,15 @@ public class CourseNotificationJob implements Job {
if(list != null && list.size() > 0) {
for (MemberDO memberDO : list) {
if(memberDO != null) {
Map<String, String> data = Arrays.stream(SmsCode.values()).collect(Collectors.toMap(SmsCode::getType, SmsCode::getCode));
String sms = "";
if(classNoticeDO.getNoticeType().equals(SmsCode.CLASS_START.getType())) {
sms = "{\"company\": \""+ cmInfo.getCompany() +"\", \"course\":\""+ cmInfo.getCourseName() +"\",\" startDate\": \""+ cmInfo.getStartDate()+"\", \"endDate\": \""+ cmInfo.getEndDate()+"\"}";
} else if(classNoticeDO.getNoticeType().equals(SmsCode.SIGN_IN.getType()) ||
classNoticeDO.getNoticeType().equals(SmsCode.TEST.getType())) {
sms = "{\"name\": \""+ cmInfo.getName() +"\", \"course\": \""+ cmInfo.getCourseName()+"\"}";
sms = "{\"company\":\""+ cmInfo.getCompany() +"\", \"course\":\""+ cmInfo.getCourseName() +"\", \"startDate\": \""+ cmInfo.getStartDate()+"\", \"endDate\": \""+ cmInfo.getEndDate()+"\"}";
} else if(classNoticeDO.getNoticeType().equals(SmsCode.SIGN_IN.getType())) {
sms = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}";
} else if(classNoticeDO.getNoticeType().equals(SmsCode.TEST.getType())) {
sms = "{ \"name\": \""+ cmInfo.getName() +"\", \"course\":\""+ cmInfo.getCourseName()+"\"}";
}
Map<String, String> data = Arrays.stream(SmsCode.values()).collect(Collectors.toMap(SmsCode::getType, SmsCode::getCode));
SMSUtils.sendNoticeSMS(data.get(classNoticeDO.getNoticeType()), memberDO.getTelephone(), sms);
}
}
......
......@@ -51,7 +51,7 @@ public interface ExerciseDoneResultMapper extends BaseMapper<ExerciseDoneResultD
/**
* 测试成绩 最高成绩 测试测试 总评价
*/
TestScoreInfoVO testScoreInfo(Long paperId, Long memberId);
TestScoreInfoVO testScoreInfo(Long paperId, Long memberId,Long classId);
/**
* 汇总 查看课程通过情况
......
......@@ -50,7 +50,7 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
/**
* 查看学生是否完成了某个视频
*/
int completeVodOrNot(Long memberId, Long vodId);
int completeVodOrNot(Long memberId, Long vodId,Long classId);
///**
// * 查看某个班级的学习记录
......
......@@ -743,7 +743,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
for (ExerciseTestVO exerciseTestVO : classSignVOS) {
//学生测试完成情况
TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId());
TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId(),classDetailDTO.getId());
exerciseTestVO.setPaperId(exerciseTestVO.getPaperId());
if (null != testScoreInfoVO) {
exerciseTestVO.setScore(testScoreInfoVO.getScore());
......@@ -773,7 +773,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) {
//学生测试完成情况
//查看课程卷子
TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId());
TestScoreInfoVO testScoreInfoVO = exerciseDoneResultMapper.testScoreInfo(classDetailDTO.getPaperId(), exerciseTestVO.getId(),classDetailDTO.getId());
exerciseTestVO.setPaperId(exerciseTestVO.getPaperId());
if (null != testScoreInfoVO) {
exerciseTestVO.setScore(testScoreInfoVO.getScore());
......@@ -1227,11 +1227,21 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
/**
* 测试成绩
*/
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
classDetailDTO.setFlag(false);
List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO);
testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
compressFileToZipStream(zipOutputStream, baos2, "test.xlsx");
//查看某个课程下有几个试卷
List<ExerciseDoneResultDO> exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper<ExerciseDoneResultDO>()
.lambda()
.eq(ExerciseDoneResultDO::getClassId,classDetailDTO.getId()));
for (int i = 0 ; i < exerciseDoneResultDOS.size();i++){
ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
classDetailDTO.setFlag(false);
classDetailDTO.setPaperId(exerciseDoneResultDOS.get(i).getPaperId());
List<ExerciseTestVO> exerciseTestVOS = exportExerciseTest(classDetailDTO);
testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2);
compressFileToZipStream(zipOutputStream, baos2, "test"+i+".xlsx");
}
/**
......
......@@ -223,7 +223,7 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
int completeNum = 0 ;
//查看每个视频的状态
for (VodDictDO vodDictDO : vodDictDOS){
int i = vodPlayHistoryMapper.completeVodOrNot(getClassBaseInfoDTO.getUserId(),vodDictDO.getId());
int i = vodPlayHistoryMapper.completeVodOrNot(getClassBaseInfoDTO.getUserId(),vodDictDO.getId(),getClassBaseInfoDTO.getId());
completeNum += i;
}
if (completeNum == vodDictDOS.size()){
......
......@@ -50,7 +50,7 @@ public class ClassNoticeServiceImpl extends ServiceImpl<ClassNoticeMapper, Class
@Transactional(rollbackFor = Exception.class)
@Override
public String addNotice(ClassNoticeDO classNoticeDO) {
if(DateFormatUtil.parse(classNoticeDO.getNoticeTime(),"yyyy-MM-dd").before(new Date())) {
if(DateFormatUtil.parse(classNoticeDO.getNoticeTime(),"yyyy-MM-dd HH").before(new Date())) {
throw new HttpException(70001);
}
......
......@@ -351,7 +351,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
.eq(SmsVerifyCodeDO::getVerifyCode, verifyCodeDTO.getVerifyCode())
.gt(SmsVerifyCodeDO::getCreateDate, LocalDateTime.now().minusMinutes(30L)));
if (null != smsCodeDO || !verifyCodeDTO.getVerifyCode().equals(smsCodeDO.getVerifyCode())) {
if (null == smsCodeDO || !verifyCodeDTO.getVerifyCode().equals(smsCodeDO.getVerifyCode())) {
OprMemDictDO oprMemDictDO = new OprMemDictDO();
oprMemDictDO.setUserId(memberDO.getId());
oprMemDictDO.setOprType("登录");
......@@ -505,7 +505,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, MemberDO> imple
//该成员完成了几个视频
for (VodDictDO vodDictDO : vodDictDOS) {
int completeVodOrNot = vodPlayHistoryMapper.completeVodOrNot(memberId, vodDictDO.getId());
int completeVodOrNot = vodPlayHistoryMapper.completeVodOrNot(memberId, vodDictDO.getId(),studyPageVO.getClassId());
i += completeVodOrNot;
}
studyPageVO.setDoneVods(i);
......
......@@ -47,9 +47,10 @@ public class SmsVerifyCodeServiceImpl extends ServiceImpl<SmsVerifyCodeMapper, S
String code = RandomUtil.getRandomCode(6);
smsUtils.send(sendVerifyCodeDTO.getTelephone(), code);
/**
* 验证码存在redis
*/
this.baseMapper.delete(new QueryWrapper<SmsVerifyCodeDO>()
.lambda()
.eq(SmsVerifyCodeDO::getTelephone,sendVerifyCodeDTO.getTelephone()));
//redisUtil.set(RedisPrefixConstant.SUBSIDY_TELEPHONE_PREFIX + sendVerifyCodeDTO.getTelephone(), code, 30 * 60);
SmsVerifyCodeDO smsCodeDO = new SmsVerifyCodeDO();
smsCodeDO.setVerifyCode(code);
......
package com.subsidy.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
......@@ -19,6 +21,8 @@ import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombi
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* 短信发送工具类
*/
......@@ -122,15 +126,17 @@ public class SMSUtils {
// }
request.putQueryParameter("TemplateParam",param);
CommonResponse response = null;
try
{
try {
response = client.getCommonResponse(request);
return ConstantUtils.SUCCESS_SEND_OUT;
} catch(
Exception e)
{
if(response != null) {
JSONObject data = JSON.parseObject(response.getData());
if(data.get("Code").equals("OK")) {
return ConstantUtils.SUCCESS_SEND_OUT;
}
throw new HttpException(1000, data.get("Message").toString());
}
return ConstantUtils.FAIL_SEND_OUT;
} catch(Exception e) {
e.printStackTrace();
return ConstantUtils.FAIL_SEND_OUT;
}
......
......@@ -7,7 +7,7 @@ public class StudyPageVO {
private Long id;
private Integer classId;
private Long classId;
private String courseName;
......
......@@ -54,3 +54,4 @@ meishu.code-message[12001]=该职级已存在
meishu.code-message[13001]=已达到当日最大时长
......@@ -131,6 +131,7 @@
t.delete_date IS NULL
AND t.member_id = #{memberId}
AND t.paper_id = #{paperId}
and t.class_id = #{classId}
GROUP BY
t.class_id,
t.paper_id,
......
......@@ -305,7 +305,7 @@
cmm.class_id = #{classId}
AND m.delete_date IS NULL
AND cmm.delete_date IS NULL
AND s.signInCount = 0
AND s.signInCount is null
GROUP BY
m.id
</select>
......
......@@ -126,7 +126,7 @@
WHERE
t.delete_date IS NULL
AND t.member_id = #{memberId}
and t.class_id = #{classId}
AND t.vod_id = #{vodId}
</select>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!