Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1d098f37
authored
Mar 03, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉了redis
1 parent
c06779f7
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
53 additions
and
33 deletions
src/main/java/com/subsidy/common/constant/SmsCode.java
src/main/java/com/subsidy/jobs/CourseNotificationJob.java
src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java
src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java
src/main/java/com/subsidy/util/SMSUtils.java
src/main/java/com/subsidy/vo/member/StudyPageVO.java
src/main/resources/code.properties
src/main/resources/mapper/ExerciseDoneResultMapper.xml
src/main/resources/mapper/MemberMapper.xml
src/main/resources/mapper/VodPlayHistoryMapper.xml
src/main/java/com/subsidy/common/constant/SmsCode.java
View file @
1d098f3
...
@@ -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_228
017725
"
,
"开课通知"
),
CLASS_START
(
"SMS_228
137810
"
,
"开课通知"
),
ALL
(
"SMS_228137810"
,
"全部成员"
),
ALL
(
"SMS_228137810"
,
"全部成员"
),
NOT_SIGNED_IN
(
"SMS_234409992"
,
"未签到成员"
),
NOT_SIGNED_IN
(
"SMS_234409992"
,
"未签到成员"
),
UNFINISHED
(
"SMS_234414789"
,
"未完课成员"
);
UNFINISHED
(
"SMS_234414789"
,
"未完课成员"
);
...
...
src/main/java/com/subsidy/jobs/CourseNotificationJob.java
View file @
1d098f3
...
@@ -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
);
}
}
}
}
...
...
src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java
View file @
1d098f3
...
@@ -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
);
/**
/**
* 汇总 查看课程通过情况
* 汇总 查看课程通过情况
...
...
src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
View file @
1d098f3
...
@@ -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
);
///**
///**
// * 查看某个班级的学习记录
// * 查看某个班级的学习记录
...
...
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
1d098f3
...
@@ -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"
);
}
/**
/**
...
...
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
View file @
1d098f3
...
@@ -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
()){
...
...
src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java
View file @
1d098f3
...
@@ -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
);
}
}
...
...
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
1d098f3
...
@@ -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
);
...
...
src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java
View file @
1d098f3
...
@@ -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
);
...
...
src/main/java/com/subsidy/util/SMSUtils.java
View file @
1d098f3
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
;
}
}
...
...
src/main/java/com/subsidy/vo/member/StudyPageVO.java
View file @
1d098f3
...
@@ -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
;
...
...
src/main/resources/code.properties
View file @
1d098f3
...
@@ -54,3 +54,4 @@ meishu.code-message[12001]=该职级已存在
...
@@ -54,3 +54,4 @@ meishu.code-message[12001]=该职级已存在
meishu.code-message[13001]=已达到当日最大时长
meishu.code-message[13001]=已达到当日最大时长
src/main/resources/mapper/ExerciseDoneResultMapper.xml
View file @
1d098f3
...
@@ -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,
...
...
src/main/resources/mapper/MemberMapper.xml
View file @
1d098f3
...
@@ -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>
...
...
src/main/resources/mapper/VodPlayHistoryMapper.xml
View file @
1d098f3
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment