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 eede23cb
authored
Feb 08, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '20211125' of D:\code\subsidy with conflicts.
1 parent
d0c69bbb
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
75 additions
and
20 deletions
src/main/java/com/subsidy/controller/AdministerController.java
src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java
src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
src/main/java/com/subsidy/service/AdministerService.java
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
src/main/java/com/subsidy/util/ExcelFormatUtils.java
src/main/java/com/subsidy/util/excel/ExcelUtil.java
src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java
src/main/resources/application.properties
src/main/resources/mapper/VodPlayHistoryMapper.xml
src/main/java/com/subsidy/controller/AdministerController.java
View file @
eede23c
...
@@ -202,13 +202,18 @@ public class AdministerController {
...
@@ -202,13 +202,18 @@ public class AdministerController {
administerService
.
export
(
classDetailDTO
);
administerService
.
export
(
classDetailDTO
);
}
}
@PostMapping
(
"memberStudy"
)
@ApiOperation
(
"学员学习日志 pageSize pageNum classId memberId"
)
public
ResponseVO
memberStudy
(
@RequestBody
MemberStudyLogDTO
memberStudyLogDTO
){
return
ResponseData
.
generateCreatedResponse
(
0
,
administerService
.
memberStudy
(
memberStudyLogDTO
));
}
@PostMapping
(
"memberStudyLog"
)
@PostMapping
(
"memberStudyLog"
)
@ApiOperation
(
"学员学习日志 classId memberId"
)
@ApiOperation
(
"学员学习日志 classId memberId"
)
public
void
memberStudyLog
(
@RequestBody
MemberStudyLogDTO
memberStudyLogDTO
)
throws
Exception
{
public
void
memberStudyLog
(
@RequestBody
MemberStudyLogDTO
memberStudyLogDTO
)
throws
Exception
{
administerService
.
memberStudyLog
(
memberStudyLogDTO
);
administerService
.
memberStudyLog
(
memberStudyLogDTO
);
}
}
@PostMapping
(
"importMember"
)
@PostMapping
(
"importMember"
)
@ApiOperation
(
"导入学生 {companyId 公司id file}"
)
@ApiOperation
(
"导入学生 {companyId 公司id file}"
)
public
ResponseVO
importMember
(
Long
companyId
,
@RequestParam
(
"file"
)
MultipartFile
file
){
public
ResponseVO
importMember
(
Long
companyId
,
@RequestParam
(
"file"
)
MultipartFile
file
){
...
...
src/main/java/com/subsidy/dto/administer/MemberStudyLogDTO.java
View file @
eede23c
...
@@ -9,4 +9,8 @@ public class MemberStudyLogDTO {
...
@@ -9,4 +9,8 @@ public class MemberStudyLogDTO {
private
Long
classId
;
private
Long
classId
;
private
Integer
pageSize
;
private
Integer
pageNum
;
}
}
src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java
View file @
eede23c
...
@@ -63,6 +63,11 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
...
@@ -63,6 +63,11 @@ public interface VodPlayHistoryMapper extends BaseMapper<VodPlayHistoryDO> {
List
<
ContentVodNewVO
>
memberRecentPlay
(
Long
classId
,
Long
memberId
);
List
<
ContentVodNewVO
>
memberRecentPlay
(
Long
classId
,
Long
memberId
);
/**
/**
* 查看某个成员某个课程的学习日志--分页
*/
IPage
<
MemberStudyLogVO
>
memberStudy
(
IPage
iPage
,
Long
classId
,
Long
memberId
);
/**
* 查看某个成员某个课程的学习日志
* 查看某个成员某个课程的学习日志
*/
*/
List
<
MemberStudyLogVO
>
memberStudyLog
(
Long
classId
,
Long
memberId
);
List
<
MemberStudyLogVO
>
memberStudyLog
(
Long
classId
,
Long
memberId
);
...
...
src/main/java/com/subsidy/service/AdministerService.java
View file @
eede23c
...
@@ -70,6 +70,8 @@ public interface AdministerService extends IService<AdministerDO> {
...
@@ -70,6 +70,8 @@ public interface AdministerService extends IService<AdministerDO> {
void
export
(
ClassDetailDTO
classDetailDTO
)
throws
Exception
;
void
export
(
ClassDetailDTO
classDetailDTO
)
throws
Exception
;
IPage
memberStudy
(
MemberStudyLogDTO
memberStudyLogDTO
);
void
memberStudyLog
(
MemberStudyLogDTO
memberStudyLogDTO
)
throws
Exception
;
void
memberStudyLog
(
MemberStudyLogDTO
memberStudyLogDTO
)
throws
Exception
;
String
importMember
(
Long
companyId
,
MultipartFile
multipartFile
);
String
importMember
(
Long
companyId
,
MultipartFile
multipartFile
);
...
...
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
eede23c
...
@@ -1223,6 +1223,17 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
...
@@ -1223,6 +1223,17 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
}
}
public
IPage
memberStudy
(
MemberStudyLogDTO
memberStudyLogDTO
){
Page
pager
=
new
Page
(
memberStudyLogDTO
.
getPageNum
(),
memberStudyLogDTO
.
getPageSize
());
IPage
iPage
=
vodPlayHistoryMapper
.
memberStudy
(
pager
,
memberStudyLogDTO
.
getClassId
(),
memberStudyLogDTO
.
getMemberId
());
List
<
MemberStudyLogVO
>
memberStudyLogVOS
=
iPage
.
getRecords
();
for
(
MemberStudyLogVO
memberStudyLogVO
:
memberStudyLogVOS
)
{
memberStudyLogVO
.
setPlayLength
(
MathUtil
.
secToTime
(
Integer
.
valueOf
(
memberStudyLogVO
.
getPlayLength
())));
memberStudyLogVO
.
setTotalLength
(
MathUtil
.
secToTime
(
Integer
.
valueOf
(
memberStudyLogVO
.
getTotalLength
())));
}
return
iPage
;
}
public
void
memberStudyLog
(
MemberStudyLogDTO
memberStudyLogDTO
)
throws
Exception
{
public
void
memberStudyLog
(
MemberStudyLogDTO
memberStudyLogDTO
)
throws
Exception
{
...
...
src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java
View file @
eede23c
...
@@ -84,11 +84,6 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
...
@@ -84,11 +84,6 @@ public class SignInRecordServiceImpl extends ServiceImpl<SignInRecordMapper, Sig
List
<
ClassDictDO
>
classDictDOS
=
classMemberMappingMapper
.
getMemberClass
(
signInRecordDO
.
getMemberId
());
List
<
ClassDictDO
>
classDictDOS
=
classMemberMappingMapper
.
getMemberClass
(
signInRecordDO
.
getMemberId
());
for
(
ClassDictDO
classDictDO
:
classDictDOS
)
{
for
(
ClassDictDO
classDictDO
:
classDictDOS
)
{
Set
<
String
>
set
=
redisUtil
.
scan
(
RedisPrefixConstant
.
SUBSIDY_SIGN_INFO_PREFIX
+
signInRecordDO
.
getMemberId
()
+
":classId:"
+
classDictDO
.
getId
()
+
":"
+
DateFormatUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
)+
":*"
);
if
(
set
.
size
()
>
0
)
{
redisUtil
.
del
(
set
);
}
redisUtil
.
set
(
RedisPrefixConstant
.
SUBSIDY_SIGN_INFO_PREFIX
+
signInRecordDO
.
getMemberId
()
+
":classId:"
+
classDictDO
.
getId
()
+
":"
+
DateFormatUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
)
+
":"
+
System
.
currentTimeMillis
(),
null
);
redisUtil
.
set
(
RedisPrefixConstant
.
SUBSIDY_SIGN_INFO_PREFIX
+
signInRecordDO
.
getMemberId
()
+
":classId:"
+
classDictDO
.
getId
()
+
":"
+
DateFormatUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
)
+
":"
+
System
.
currentTimeMillis
(),
null
);
}
}
...
...
src/main/java/com/subsidy/util/ExcelFormatUtils.java
View file @
eede23c
...
@@ -14,6 +14,6 @@ public class ExcelFormatUtils {
...
@@ -14,6 +14,6 @@ public class ExcelFormatUtils {
public
static
final
List
<
String
>
answersList
=
Arrays
.
asList
(
"序号"
,
"提问"
,
"答疑"
,
"提问时间"
,
"提问成员"
,
"答疑时间"
);
public
static
final
List
<
String
>
answersList
=
Arrays
.
asList
(
"序号"
,
"提问"
,
"答疑"
,
"提问时间"
,
"提问成员"
,
"答疑时间"
);
public
static
final
List
<
String
>
studyLogList
=
Arrays
.
asList
(
"开始时间"
,
"结束时间"
,
"
操作对象"
,
"类型"
,
"平台
"
,
"学习时长"
,
"累计有效时长"
);
public
static
final
List
<
String
>
studyLogList
=
Arrays
.
asList
(
"开始时间"
,
"结束时间"
,
"
课程"
,
"类型
"
,
"学习时长"
,
"累计有效时长"
);
}
}
src/main/java/com/subsidy/util/excel/ExcelUtil.java
View file @
eede23c
...
@@ -1159,13 +1159,13 @@ public class ExcelUtil {
...
@@ -1159,13 +1159,13 @@ public class ExcelUtil {
}
}
//第二行
//第二行
int
[]
secondWidth
=
new
int
[
7
];
int
[]
secondWidth
=
new
int
[
6
];
// 产生表格标题行,以及设置列宽
// 产生表格标题行,以及设置列宽
String
[]
secondHead
=
new
String
[
7
];
String
[]
secondHead
=
new
String
[
6
];
List
<
String
>
secondList
=
Arrays
.
asList
(
"学员姓名"
,
memberDO
.
getUserName
(),
"性别:"
+
memberDO
.
getGender
(),
"身份证号"
,
memberDO
.
getIdCard
(),
"手机号"
,
memberDO
.
getTelephone
());
List
<
String
>
secondList
=
Arrays
.
asList
(
"学员姓名"
,
memberDO
.
getUserName
(),
"性别:"
+
memberDO
.
getGender
(),
"身份证号"
,
memberDO
.
getIdCard
(),
"手机号"
,
memberDO
.
getTelephone
());
ii
=
0
;
ii
=
0
;
for
(
int
i
=
0
;
i
<
7
;
i
++)
{
for
(
int
i
=
0
;
i
<
6
;
i
++)
{
secondHead
[
ii
]
=
secondList
.
get
(
i
);
secondHead
[
ii
]
=
secondList
.
get
(
i
);
int
bytes
=
secondList
.
get
(
i
).
getBytes
().
length
;
int
bytes
=
secondList
.
get
(
i
).
getBytes
().
length
;
secondWidth
[
ii
]
=
bytes
<
minBytes
?
minBytes
:
bytes
;
secondWidth
[
ii
]
=
bytes
<
minBytes
?
minBytes
:
bytes
;
...
@@ -1238,13 +1238,9 @@ public class ExcelUtil {
...
@@ -1238,13 +1238,9 @@ public class ExcelUtil {
newCell
=
dataRow
.
createCell
(
4
);
newCell
=
dataRow
.
createCell
(
4
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
memberStudyLogVO
.
getPlatForm
());
newCell
=
dataRow
.
createCell
(
5
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
memberStudyLogVO
.
getPlayLength
());
newCell
.
setCellValue
(
memberStudyLogVO
.
getPlayLength
());
newCell
=
dataRow
.
createCell
(
6
);
newCell
=
dataRow
.
createCell
(
5
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
memberStudyLogVO
.
getTotalLength
());
newCell
.
setCellValue
(
memberStudyLogVO
.
getTotalLength
());
...
...
src/main/java/com/subsidy/vo/administer/MemberStudyLogVO.java
View file @
eede23c
...
@@ -13,8 +13,6 @@ public class MemberStudyLogVO {
...
@@ -13,8 +13,6 @@ public class MemberStudyLogVO {
private
String
studyType
;
private
String
studyType
;
private
String
platForm
;
private
String
playLength
;
private
String
playLength
;
private
String
totalLength
;
private
String
totalLength
;
...
...
src/main/resources/application.properties
View file @
eede23c
# 环境配置
# 环境配置
spring.profiles.active
=
prod
spring.profiles.active
=
dev
# 端口号
# 端口号
spring.server.port
=
2345
9
spring.server.port
=
2345
7
#嵌入tomcat配置
#嵌入tomcat配置
#和CPU数
#和CPU数
spring.server.acceptorThreadCount
=
600
spring.server.acceptorThreadCount
=
600
...
...
src/main/resources/mapper/VodPlayHistoryMapper.xml
View file @
eede23c
...
@@ -243,6 +243,46 @@ FROM
...
@@ -243,6 +243,46 @@ FROM
AND t2.class_id = #{classId}
AND t2.class_id = #{classId}
</select>
</select>
<select
id=
"memberStudy"
resultType=
"com.subsidy.vo.administer.MemberStudyLogVO"
>
SELECT
DATE_SUB( t1.create_date, INTERVAL t1.play_length SECOND ) AS startDate,
t1.create_date AS endDate,
t1.vod_name,
'视频学习' AS studyType,
t1.play_length,
IF
( t2.total_length
<
= t1.vod_length, t2.total_length, t1.vod_length ) AS total_length
FROM
(
SELECT
t.vod_id,
t.create_date,
t2.vod_name,
t.play_length,
t2.vod_length
FROM
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.class_id = #{classId}
AND t.member_id = #{memberId}
) t1
LEFT JOIN (
SELECT
t.vod_id,
sum( t.play_length ) AS total_length
FROM
vod_play_history t
LEFT JOIN vod_dict t2 ON t.vod_id = t2.id
WHERE
t.class_id = #{classId}
AND t.member_id = #{memberId}
GROUP BY
t.vod_id
) t2 ON t1.vod_id = t2.vod_id
ORDER BY
t1.create_date DESC
</select>
<select
id=
"memberStudyLog"
resultType=
"com.subsidy.vo.administer.MemberStudyLogVO"
>
<select
id=
"memberStudyLog"
resultType=
"com.subsidy.vo.administer.MemberStudyLogVO"
>
SELECT
SELECT
...
@@ -250,7 +290,6 @@ FROM
...
@@ -250,7 +290,6 @@ FROM
t1.create_date AS endDate,
t1.create_date AS endDate,
t1.vod_name,
t1.vod_name,
'视频学习' AS studyType,
'视频学习' AS studyType,
'有课互联系统' as platForm,
t1.play_length,
t1.play_length,
IF
IF
( t2.total_length
<
= t1.vod_length, t2.total_length, t1.vod_length ) AS total_length
( t2.total_length
<
= t1.vod_length, t2.total_length, t1.vod_length ) AS total_length
...
...
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