Commit 1d098f37 by 涂亚平

去掉了redis

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