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 b7848432
authored
Mar 23, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2022.03.23 疫情备份
1 parent
9347a3c5
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
12 deletions
src/main/java/com/subsidy/controller/VodPlayHistoryController.java
src/main/java/com/subsidy/dto/vod/InsertHistoryNewDTO.java
src/main/java/com/subsidy/service/VodPlayHistoryService.java
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
src/main/resources/application.properties
src/main/resources/mapper/VodPlayHistoryMapper.xml
src/main/java/com/subsidy/controller/VodPlayHistoryController.java
View file @
b784843
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import
com.subsidy.common.ResponseData
;
import
com.subsidy.common.ResponseData
;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.common.ResponseVO
;
import
com.subsidy.common.interceptor.LoginRequired
;
import
com.subsidy.common.interceptor.LoginRequired
;
import
com.subsidy.dto.vod.InsertHistoryNewDTO
;
import
com.subsidy.dto.vod.RemainSecondsDTO
;
import
com.subsidy.dto.vod.RemainSecondsDTO
;
import
com.subsidy.dto.vod.SignDatePlaysDTO
;
import
com.subsidy.dto.vod.SignDatePlaysDTO
;
import
com.subsidy.model.VodPlayHistoryDO
;
import
com.subsidy.model.VodPlayHistoryDO
;
...
@@ -42,10 +43,10 @@ public class VodPlayHistoryController {
...
@@ -42,10 +43,10 @@ public class VodPlayHistoryController {
@RequestMapping
(
"insertHistoryNew"
)
@RequestMapping
(
"insertHistoryNew"
)
@ApiOperation
(
"记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点"
)
@ApiOperation
(
"记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点"
)
@LoginRequired
//
@LoginRequired
public
ResponseVO
insertHistoryNew
(
@RequestBody
String
param
){
public
ResponseVO
insertHistoryNew
(
@RequestBody
String
param
){
VodPlayHistoryDO
vodPlayHistoryDO
=
JSON
.
parseObject
(
param
,
VodPlayHistoryD
O
.
class
);
InsertHistoryNewDTO
insertHistoryNewDTO
=
JSON
.
parseObject
(
param
,
InsertHistoryNewDT
O
.
class
);
return
ResponseData
.
generateCreatedResponse
(
0
,
vodPlayHistoryService
.
insertHistoryNew
(
vodPlayHistoryD
O
));
return
ResponseData
.
generateCreatedResponse
(
0
,
vodPlayHistoryService
.
insertHistoryNew
(
insertHistoryNewDT
O
));
}
}
@PostMapping
(
"dataFix"
)
@PostMapping
(
"dataFix"
)
...
...
src/main/java/com/subsidy/dto/vod/InsertHistoryNewDTO.java
0 → 100644
View file @
b784843
package
com
.
subsidy
.
dto
.
vod
;
import
com.subsidy.model.VodPlayHistoryDO
;
import
lombok.Data
;
@Data
public
class
InsertHistoryNewDTO
extends
VodPlayHistoryDO
{
private
String
token
;
}
src/main/java/com/subsidy/service/VodPlayHistoryService.java
View file @
b784843
package
com
.
subsidy
.
service
;
package
com
.
subsidy
.
service
;
import
com.subsidy.dto.vod.InsertHistoryNewDTO
;
import
com.subsidy.dto.vod.RemainSecondsDTO
;
import
com.subsidy.dto.vod.RemainSecondsDTO
;
import
com.subsidy.dto.vod.SignDatePlaysDTO
;
import
com.subsidy.dto.vod.SignDatePlaysDTO
;
import
com.subsidy.dto.vod.FixDataTwoDTO
;
import
com.subsidy.dto.vod.FixDataTwoDTO
;
...
@@ -18,7 +19,7 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
...
@@ -18,7 +19,7 @@ public interface VodPlayHistoryService extends IService<VodPlayHistoryDO> {
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
);
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
);
String
insertHistoryNew
(
VodPlayHistoryDO
vodPlayHistoryD
O
);
String
insertHistoryNew
(
InsertHistoryNewDTO
insertHistoryNewDT
O
);
void
dataFix
(
SignDatePlaysDTO
dataFixDTO
);
void
dataFix
(
SignDatePlaysDTO
dataFixDTO
);
...
...
src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java
View file @
b784843
...
@@ -134,17 +134,17 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
...
@@ -134,17 +134,17 @@ public class ClassDictServiceImpl extends ServiceImpl<ClassDictMapper, ClassDict
if
(
null
!=
addClassDTO
.
getClassNoticeDOS
())
{
if
(
null
!=
addClassDTO
.
getClassNoticeDOS
())
{
List
<
ClassNoticeDO
>
classNoticeDOS
=
addClassDTO
.
getClassNoticeDOS
();
List
<
ClassNoticeDO
>
classNoticeDOS
=
addClassDTO
.
getClassNoticeDOS
();
for
(
ClassNoticeDO
classNoticeDO
:
classNoticeDOS
)
{
for
(
ClassNoticeDO
classNoticeDO
:
classNoticeDOS
)
{
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
);
}
}
classNoticeDO
.
setClassId
(
classDictDO
.
getId
());
classNoticeDO
.
setClassId
(
classDictDO
.
getId
());
//
classNoticeDO.setStatus(CourseNotification.UNSENT);
classNoticeDO
.
setStatus
(
CourseNotification
.
UNSENT
);
classNoticeMapper
.
insert
(
classNoticeDO
);
classNoticeMapper
.
insert
(
classNoticeDO
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"classId"
,
classNoticeDO
.
getClassId
());
params
.
put
(
"classId"
,
classNoticeDO
.
getClassId
());
params
.
put
(
"id"
,
classNoticeDO
.
getId
());
params
.
put
(
"id"
,
classNoticeDO
.
getId
());
String
name
=
classDictDO
.
getClassName
()
+
"-"
+
classNoticeDO
.
getNoticeType
()
+
"-"
+
classNoticeDO
.
getNoticeTime
();
String
name
=
classDictDO
.
getClassName
()
+
"-"
+
classNoticeDO
.
getNoticeType
()
+
"-"
+
classNoticeDO
.
getNoticeTime
();
quartzUtil
.
addSimpleJob
(
CourseNotificationJob
.
class
,
DateFormatUtil
.
parse
(
classNoticeDO
.
getNoticeTime
(),
"yyyy-MM-dd"
),
params
,
name
,
"CourseNotificationJob"
);
quartzUtil
.
addSimpleJob
(
CourseNotificationJob
.
class
,
DateFormatUtil
.
parse
(
classNoticeDO
.
getNoticeTime
(),
"yyyy-MM-dd
HH:mm:ss
"
),
params
,
name
,
"CourseNotificationJob"
);
}
}
}
}
...
...
src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java
View file @
b784843
...
@@ -152,6 +152,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
...
@@ -152,6 +152,7 @@ public class CompanyDictServiceImpl extends ServiceImpl<CompanyDictMapper, Compa
DepartmentDictDO
departmentDictDO
=
new
DepartmentDictDO
();
DepartmentDictDO
departmentDictDO
=
new
DepartmentDictDO
();
departmentDictDO
.
setCompanyId
(
companyDictDO
.
getId
());
departmentDictDO
.
setCompanyId
(
companyDictDO
.
getId
());
departmentDictDO
.
setDepartmentName
(
companyDictDO
.
getCompanyName
());
departmentDictDO
.
setDepartmentName
(
companyDictDO
.
getCompanyName
());
departmentDictDO
.
setFullName
(
companyDictDO
.
getCompanyName
());
//departmentDictDO.setParentId(1L);
//departmentDictDO.setParentId(1L);
departmentDictMapper
.
insert
(
departmentDictDO
);
departmentDictMapper
.
insert
(
departmentDictDO
);
...
...
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
b784843
...
@@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.subsidy.common.exception.HttpException
;
import
com.subsidy.common.exception.HttpException
;
import
com.subsidy.dto.vod.FixDataTwoDTO
;
import
com.subsidy.dto.vod.FixDataTwoDTO
;
import
com.subsidy.dto.vod.InsertHistoryNewDTO
;
import
com.subsidy.dto.vod.RemainSecondsDTO
;
import
com.subsidy.dto.vod.RemainSecondsDTO
;
import
com.subsidy.dto.vod.SignDatePlaysDTO
;
import
com.subsidy.dto.vod.SignDatePlaysDTO
;
import
com.subsidy.mapper.*
;
import
com.subsidy.mapper.*
;
import
com.subsidy.model.*
;
import
com.subsidy.model.*
;
import
com.subsidy.service.VodPlayHistoryService
;
import
com.subsidy.service.VodPlayHistoryService
;
import
com.subsidy.util.ConstantUtils
;
import
com.subsidy.util.ConstantUtils
;
import
com.subsidy.util.RedisUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -58,6 +62,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
...
@@ -58,6 +62,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
@Autowired
@Autowired
private
MemberMapper
memberMapper
;
private
MemberMapper
memberMapper
;
@Autowired
private
RedisUtil
redisUtil
;
public
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
)
{
public
String
insertHistory
(
VodPlayHistoryDO
vodPlayHistoryDO
)
{
MemberDO
memberDO
=
memberMapper
.
selectById
(
vodPlayHistoryDO
.
getMemberId
());
MemberDO
memberDO
=
memberMapper
.
selectById
(
vodPlayHistoryDO
.
getMemberId
());
//查看系统设定的时长
//查看系统设定的时长
...
@@ -82,7 +89,17 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
...
@@ -82,7 +89,17 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
return
ConstantUtils
.
ADD_SUCCESS
;
return
ConstantUtils
.
ADD_SUCCESS
;
}
}
public
String
insertHistoryNew
(
VodPlayHistoryDO
vodPlayHistoryDO
)
{
public
String
insertHistoryNew
(
InsertHistoryNewDTO
insertHistoryNewDTO
)
{
//对比redis上的token
String
token
=
redisUtil
.
get
(
"mobile_"
+
insertHistoryNewDTO
.
getMemberId
()).
toString
();
if
(!
insertHistoryNewDTO
.
getToken
().
equals
(
token
)){
throw
new
HttpException
(
1010
);
}
VodPlayHistoryDO
vodPlayHistoryDO
=
new
VodPlayHistoryDO
();
BeanUtils
.
copyProperties
(
insertHistoryNewDTO
,
vodPlayHistoryDO
);
MemberDO
memberDO
=
memberMapper
.
selectById
(
vodPlayHistoryDO
.
getMemberId
());
MemberDO
memberDO
=
memberMapper
.
selectById
(
vodPlayHistoryDO
.
getMemberId
());
//查看系统设定的时长
//查看系统设定的时长
ClassHourDictDO
classHourDictDO
=
classHourDictMapper
.
selectOne
(
new
QueryWrapper
<
ClassHourDictDO
>()
ClassHourDictDO
classHourDictDO
=
classHourDictMapper
.
selectOne
(
new
QueryWrapper
<
ClassHourDictDO
>()
...
...
src/main/resources/application.properties
View file @
b784843
# 环境配置
# 环境配置
spring.profiles.active
=
dev
spring.profiles.active
=
prod
# 端口号
# 端口号
spring.server.port
=
2345
7
spring.server.port
=
2345
9
#嵌入tomcat配置
#嵌入tomcat配置
#和CPU数
#和CPU数
spring.server.acceptorThreadCount
=
600
spring.server.acceptorThreadCount
=
600
...
...
src/main/resources/mapper/VodPlayHistoryMapper.xml
View file @
b784843
...
@@ -266,7 +266,8 @@
...
@@ -266,7 +266,8 @@
vod_play_history t
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
WHERE
t.class_id = #{classId}
t.delete_date is null
and t.class_id = #{classId}
AND t.member_id = #{memberId}
AND t.member_id = #{memberId}
) t1
) t1
LEFT JOIN (
LEFT JOIN (
...
@@ -277,7 +278,8 @@
...
@@ -277,7 +278,8 @@
vod_play_history t
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
WHERE
t.class_id = #{classId}
t.delete_date is null
and t.class_id = #{classId}
AND t.member_id = #{memberId}
AND t.member_id = #{memberId}
GROUP BY
GROUP BY
t.vod_id
t.vod_id
...
...
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