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 {
SIGN_IN
(
"SMS_234409992"
,
"签到通知"
),
TEST
(
"SMS_234414789"
,
"测试通知"
),
CLASS_START
(
"SMS_228
017725
"
,
"开课通知"
),
CLASS_START
(
"SMS_228
137810
"
,
"开课通知"
),
ALL
(
"SMS_228137810"
,
"全部成员"
),
NOT_SIGNED_IN
(
"SMS_234409992"
,
"未签到成员"
),
UNFINISHED
(
"SMS_234414789"
,
"未完课成员"
);
...
...
src/main/java/com/subsidy/jobs/CourseNotificationJob.java
View file @
1d098f3
...
...
@@ -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
);
}
}
...
...
src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java
View file @
1d098f3
...
...
@@ -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> {
/**
* 查看学生是否完成了某个视频
*/
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
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"
);
}
/**
...
...
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
View file @
1d098f3
...
...
@@ -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
()){
...
...
src/main/java/com/subsidy/service/impl/ClassNoticeServiceImpl.java
View file @
1d098f3
...
...
@@ -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
);
}
...
...
src/main/java/com/subsidy/service/impl/MemberServiceImpl.java
View file @
1d098f3
...
...
@@ -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
);
...
...
src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java
View file @
1d098f3
...
...
@@ -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
);
...
...
src/main/java/com/subsidy/util/SMSUtils.java
View file @
1d098f3
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
;
}
...
...
src/main/java/com/subsidy/vo/member/StudyPageVO.java
View file @
1d098f3
...
...
@@ -7,7 +7,7 @@ public class StudyPageVO {
private
Long
id
;
private
Integer
classId
;
private
Long
classId
;
private
String
courseName
;
...
...
src/main/resources/code.properties
View file @
1d098f3
...
...
@@ -54,3 +54,4 @@ meishu.code-message[12001]=该职级已存在
meishu.code-message[13001]=已达到当日最大时长
src/main/resources/mapper/ExerciseDoneResultMapper.xml
View file @
1d098f3
...
...
@@ -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,
...
...
src/main/resources/mapper/MemberMapper.xml
View file @
1d098f3
...
...
@@ -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>
...
...
src/main/resources/mapper/VodPlayHistoryMapper.xml
View file @
1d098f3
...
...
@@ -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>
...
...
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