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 c6096c21
authored
Dec 26, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人社局跑数据准备中
新加了个有效时长
1 parent
4897185f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
12 deletions
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
src/main/java/com/subsidy/util/ExcelFormatUtils.java
src/main/java/com/subsidy/util/MathUtil.java
src/main/java/com/subsidy/util/excel/ExcelUtil.java
src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java
src/main/resources/application.properties
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
c6096c2
...
...
@@ -473,16 +473,21 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//该学生完成了多少个
int
i
=
0
;
int
playLength
=
0
;
int
validLength
=
0
;
//该成员完成了几个视频
for
(
VodDictDO
vodDictDO
:
vodDictDOS
)
{
int
totalPlayLength
=
vodPlayHistoryMapper
.
memberVodTotalLength
(
classDetailDTO
.
getId
(),
classDetailVO
.
getId
(),
vodDictDO
.
getId
());
if
(
totalPlayLength
>=
vodDictDO
.
getVodLength
())
{
validLength
+=
vodDictDO
.
getVodLength
();
i
++;
}
else
{
validLength
+=
totalPlayLength
;
}
playLength
+=
totalPlayLength
;
}
//培训时长
classDetailVO
.
setTrainingLength
(
playLength
);
classDetailVO
.
setValidLength
(
MathUtil
.
floorSecond
(
validLength
));
//学生测试完成情况 多套卷子各返回最高成绩
List
<
GetMaxScoreVO
>
getMaxScoreVOS
=
exerciseDoneResultMapper
.
getMaxScore
(
classDictDO
.
getId
(),
classDetailVO
.
getId
());
...
...
@@ -529,6 +534,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
return
classDetailVOIPage
;
}
public
List
<
ClassDetailVO
>
exportClassDetail
(
ClassDetailDTO
classDetailDTO
)
throws
Exception
{
Page
pager
=
new
Page
(
1
,
-
1L
);
...
...
@@ -547,15 +553,20 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//该学生完成了多少个
int
i
=
0
;
int
playLength
=
0
;
int
validLength
=
0
;
//该成员完成了几个视频
for
(
VodDictDO
vodDictDO
:
vodDictDOS
)
{
int
totalPlayLength
=
vodPlayHistoryMapper
.
memberVodTotalLength
(
classDetailDTO
.
getId
(),
classDetailVO
.
getId
(),
vodDictDO
.
getId
());
if
(
totalPlayLength
>=
vodDictDO
.
getVodLength
())
{
i
++;
validLength
+=
vodDictDO
.
getVodLength
();
}
else
{
validLength
+=
totalPlayLength
;
}
playLength
+=
totalPlayLength
;
}
//课程进度
classDetailVO
.
setValidLength
(
MathUtil
.
floorSecond
(
validLength
));
classDetailVO
.
setClassProcess
(
i
+
"/"
+
vodDictDOS
.
size
());
//学生测试完成情况 多套卷子各返回最高成绩
...
...
@@ -1574,7 +1585,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet
.
addMergedRegion
(
cellRangeAddress21
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress21
,
sheet
,
workbook
);
//给合并过的单元格加边框
CellRangeAddress
cellRangeAddress22
=
new
CellRangeAddress
(
1
,
1
,
5
,
1
2
);
CellRangeAddress
cellRangeAddress22
=
new
CellRangeAddress
(
1
,
1
,
5
,
1
3
);
sheet
.
addMergedRegion
(
cellRangeAddress22
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress22
,
sheet
,
workbook
);
//给合并过的单元格加边框
...
...
@@ -1590,7 +1601,7 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
sheet
.
addMergedRegion
(
cellRangeAddress31
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress31
,
sheet
,
workbook
);
//给合并过的单元格加边框
CellRangeAddress
cellRangeAddress32
=
new
CellRangeAddress
(
2
,
2
,
5
,
1
2
);
CellRangeAddress
cellRangeAddress32
=
new
CellRangeAddress
(
2
,
2
,
5
,
1
3
);
sheet
.
addMergedRegion
(
cellRangeAddress32
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress32
,
sheet
,
workbook
);
//给合并过的单元格加边框
thirdRow
.
createCell
(
0
).
setCellValue
(
thirdHead
[
0
]);
...
...
@@ -1665,14 +1676,18 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
newCell
=
dataRow
.
createCell
(
10
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
classDetailVO
.
get
AskCounts
());
newCell
.
setCellValue
(
classDetailVO
.
get
ValidLength
());
newCell
=
dataRow
.
createCell
(
11
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
classDetailVO
.
get
Score
());
newCell
.
setCellValue
(
classDetailVO
.
get
AskCounts
());
newCell
=
dataRow
.
createCell
(
12
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
classDetailVO
.
getScore
());
newCell
=
dataRow
.
createCell
(
13
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
classDetailVO
.
getResult
());
rowIndex
++;
...
...
src/main/java/com/subsidy/util/ExcelFormatUtils.java
View file @
c6096c2
...
...
@@ -6,7 +6,7 @@ import java.util.List;
public
class
ExcelFormatUtils
{
public
static
final
List
<
String
>
memberList
=
Arrays
.
asList
(
"序号"
,
"成员名称"
,
"身份证号码"
,
"性别"
,
"账号"
,
"联系方式"
,
"签到次数"
,
"课程进度"
,
"学习时长(小时)"
,
"学习时长(分钟)"
,
"答疑数"
,
"测试成绩"
,
"总评价"
);
public
static
final
List
<
String
>
memberList
=
Arrays
.
asList
(
"序号"
,
"成员名称"
,
"身份证号码"
,
"性别"
,
"账号"
,
"联系方式"
,
"签到次数"
,
"课程进度"
,
"学习时长(小时)"
,
"学习时长(分钟)"
,
"累计有效学习时长"
,
"答疑数"
,
"测试成绩"
,
"总评价"
);
public
static
final
List
<
String
>
signList
=
Arrays
.
asList
(
"序号"
,
"成员名称"
,
"身份证号"
,
"联系方式"
,
"签到次数"
,
"签到时间"
,
"最近签到ip地址"
,
"最近签到设备型号"
);
...
...
src/main/java/com/subsidy/util/MathUtil.java
View file @
c6096c2
...
...
@@ -35,6 +35,11 @@ public class MathUtil {
return
String
.
valueOf
((
int
)
Math
.
ceil
((
double
)
length
/
60
));
}
//习题/视频 ==> 秒钟向下取整
public
static
String
floorSecond
(
int
length
)
{
return
String
.
valueOf
((
int
)
Math
.
ceil
((
double
)
length
/
60
));
}
//视频秒数处理
public
static
String
vodLength
(
int
i
)
{
if
(
i
>
60
)
{
...
...
src/main/java/com/subsidy/util/excel/ExcelUtil.java
View file @
c6096c2
...
...
@@ -493,7 +493,7 @@ public class ExcelUtil {
sheet
.
addMergedRegion
(
cellRangeAddress21
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress21
,
sheet
,
workbook
);
//给合并过的单元格加边框
CellRangeAddress
cellRangeAddress22
=
new
CellRangeAddress
(
1
,
1
,
5
,
1
2
);
CellRangeAddress
cellRangeAddress22
=
new
CellRangeAddress
(
1
,
1
,
5
,
1
3
);
sheet
.
addMergedRegion
(
cellRangeAddress22
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress22
,
sheet
,
workbook
);
//给合并过的单元格加边框
...
...
@@ -509,7 +509,7 @@ public class ExcelUtil {
sheet
.
addMergedRegion
(
cellRangeAddress31
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress31
,
sheet
,
workbook
);
//给合并过的单元格加边框
CellRangeAddress
cellRangeAddress32
=
new
CellRangeAddress
(
2
,
2
,
5
,
1
2
);
CellRangeAddress
cellRangeAddress32
=
new
CellRangeAddress
(
2
,
2
,
5
,
1
3
);
sheet
.
addMergedRegion
(
cellRangeAddress32
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress32
,
sheet
,
workbook
);
//给合并过的单元格加边框
thirdRow
.
createCell
(
0
).
setCellValue
(
thirdHead
[
0
]);
...
...
@@ -584,14 +584,18 @@ public class ExcelUtil {
newCell
=
dataRow
.
createCell
(
10
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
classDetailVO
.
get
AskCounts
());
newCell
.
setCellValue
(
classDetailVO
.
get
ValidLength
());
newCell
=
dataRow
.
createCell
(
11
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
classDetailVO
.
get
Score
());
newCell
.
setCellValue
(
classDetailVO
.
get
AskCounts
());
newCell
=
dataRow
.
createCell
(
12
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
classDetailVO
.
getScore
());
newCell
=
dataRow
.
createCell
(
13
);
newCell
.
setCellStyle
(
cellStyle
);
newCell
.
setCellValue
(
classDetailVO
.
getResult
());
rowIndex
++;
seq
++;
...
...
src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java
View file @
c6096c2
...
...
@@ -63,6 +63,9 @@ public class ClassDetailVO{
@ExcelColumn
(
col
=
9
,
value
=
"培训时长(分钟)"
)
private
String
trainingLengthMinute
;
@ExcelColumn
(
col
=
10
,
value
=
"累计有效学习时长"
)
private
String
validLength
;
/**
* 作对个数
*/
...
...
@@ -76,13 +79,13 @@ public class ClassDetailVO{
/**
* 评价测试
*/
@ExcelColumn
(
col
=
1
0
,
value
=
"评价测试"
)
@ExcelColumn
(
col
=
1
1
,
value
=
"评价测试"
)
private
String
score
;
/**
* 答疑个数
*/
@ExcelColumn
(
col
=
1
1
,
value
=
"答题数"
)
@ExcelColumn
(
col
=
1
2
,
value
=
"答题数"
)
private
Integer
askCounts
;
...
...
src/main/resources/application.properties
View file @
c6096c2
# 环境配置
spring.profiles.active
=
dev
spring.profiles.active
=
prod
#和CPU数
spring.server.acceptorThreadCount
=
600
spring.server.minSpareThreads
=
100
...
...
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