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 716cd459
authored
Oct 13, 2022
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
websocket上线了~~~
1 parent
73d94e0f
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
54 additions
and
12 deletions
src/main/java/com/subsidy/controller/AdministerController.java
src/main/java/com/subsidy/controller/ExerciseDictController.java
src/main/java/com/subsidy/dto/exercise/SubmitDTO.java
src/main/java/com/subsidy/model/ExerciseDoneResultDO.java
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.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/ExerciseTestVO.java
src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java
src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java
src/main/resources/application.properties
src/main/resources/mapper/ExerciseDoneResultMapper.xml
src/main/java/com/subsidy/controller/AdministerController.java
View file @
716cd45
...
...
@@ -240,7 +240,7 @@ public class AdministerController {
@PostMapping
(
"exportZip"
)
@ApiOperation
(
"下载压缩包 id 班级id"
)
@CrossOrigin
@LoginRequired
//
@LoginRequired
public
void
exportZip
(
@RequestBody
ClassDetailDTO
classDetailDTO
)
throws
Exception
{
administerService
.
export
(
classDetailDTO
);
}
...
...
src/main/java/com/subsidy/controller/ExerciseDictController.java
View file @
716cd45
...
...
@@ -59,7 +59,7 @@ public class ExerciseDictController {
}
@PostMapping
(
"submit"
)
@ApiOperation
(
"提交答案 {paperId 卷子id memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ]
length
:做题时长} "
)
@ApiOperation
(
"提交答案 {paperId 卷子id memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ]
startDate
:做题时长} "
)
@LoginRequired
@TimeRequired
@CachePut
(
value
=
"ResultData"
,
key
=
"'classId_'+#submitDTO.getClassId()"
)
...
...
src/main/java/com/subsidy/dto/exercise/SubmitDTO.java
View file @
716cd45
...
...
@@ -3,6 +3,8 @@ package com.subsidy.dto.exercise;
import
com.subsidy.vo.exercise.MemberExerciseVO
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
import
java.util.List
;
@Data
...
...
@@ -19,4 +21,6 @@ public class SubmitDTO {
private
Long
paperId
;
private
Integer
length
;
private
String
startDate
;
}
src/main/java/com/subsidy/model/ExerciseDoneResultDO.java
View file @
716cd45
...
...
@@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.annotation.TableId;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.time.LocalDateTime
;
/**
* <p>
* 学生课程习题完成情况
...
...
@@ -71,4 +73,8 @@ public class ExerciseDoneResultDO extends BaseModel {
*/
private
Integer
length
;
/**
* 做题开始时间
*/
private
String
startDate
;
}
src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java
View file @
716cd45
...
...
@@ -746,6 +746,8 @@ public class AdministerServiceImpl extends ServiceImpl<AdministerMapper, Adminis
//查看课程卷子
TestScoreInfoVO
testScoreInfoVO
=
exerciseDoneResultMapper
.
testScoreInfo
(
classDetailDTO
.
getPaperId
(),
exerciseTestVO
.
getId
(),
classDetailDTO
.
getId
());
exerciseTestVO
.
setPaperId
(
exerciseTestVO
.
getPaperId
());
exerciseTestVO
.
setStartDate
(
testScoreInfoVO
.
getStartDate
());
exerciseTestVO
.
setEndDate
(
testScoreInfoVO
.
getEndDate
());
if
(
null
!=
testScoreInfoVO
)
{
exerciseTestVO
.
setScore
(
testScoreInfoVO
.
getScore
());
exerciseTestVO
.
setResult
(
testScoreInfoVO
.
getResult
());
...
...
src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java
View file @
716cd45
...
...
@@ -89,6 +89,7 @@ public class ExerciseDictServiceImpl extends ServiceImpl<ExerciseDictMapper, Exe
exerciseDoneResultDO
.
setMemberId
(
submitDTO
.
getMemberId
());
exerciseDoneResultDO
.
setPaperId
(
submitDTO
.
getPaperId
());
exerciseDoneResultDO
.
setLength
(
submitDTO
.
getLength
());
exerciseDoneResultDO
.
setStartDate
(
submitDTO
.
getStartDate
());
int
score
=
MathUtil
.
intDivFloorPercent
(
rightCounts
,
memberExerciseVOS
.
size
());
exerciseDoneResultDO
.
setScore
(
score
);
exerciseDoneResultDO
.
setResult
(
score
>=
60
?
"合格"
:
"不合格"
);
...
...
src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java
View file @
716cd45
...
...
@@ -84,10 +84,10 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl<VodPlayHistoryMapper,
this
.
baseMapper
.
insert
(
vodPlayHistoryDO
);
}
throw
new
HttpException
(
13001
);
}
else
{
vodPlayHistoryDO
.
setPlayCount
(
1
);
this
.
baseMapper
.
insert
(
vodPlayHistoryDO
);
}
}
else
{
vodPlayHistoryDO
.
setPlayCount
(
1
);
this
.
baseMapper
.
insert
(
vodPlayHistoryDO
);
}
}
return
ConstantUtils
.
ADD_SUCCESS
;
...
...
src/main/java/com/subsidy/util/ExcelFormatUtils.java
View file @
716cd45
...
...
@@ -10,7 +10,7 @@ public class ExcelFormatUtils {
public
static
final
List
<
String
>
signList
=
Arrays
.
asList
(
"序号"
,
"成员名称"
,
"身份证号"
,
"联系方式"
,
"签到次数"
,
"签到时间"
,
"最近签到ip地址"
,
"最近签到设备型号"
);
public
static
final
List
<
String
>
scoreList
=
Arrays
.
asList
(
"序号"
,
"成员名称"
,
"身份证号码"
,
"联系方式"
,
"测试成绩"
,
"测试次数"
,
"总评价"
);
public
static
final
List
<
String
>
scoreList
=
Arrays
.
asList
(
"序号"
,
"成员名称"
,
"身份证号码"
,
"联系方式"
,
"测试成绩"
,
"测试次数"
,
"开始时间"
,
"结束时间"
,
"总评价"
);
public
static
final
List
<
String
>
answersList
=
Arrays
.
asList
(
"序号"
,
"提问"
,
"答疑"
,
"提问时间"
,
"提问成员"
,
"答疑时间"
);
...
...
src/main/java/com/subsidy/util/excel/ExcelUtil.java
View file @
716cd45
...
...
@@ -948,11 +948,11 @@ public class ExcelUtil {
//第三行 2
SXSSFRow
thirdRow
=
sheet
.
createRow
(
2
);
//第二行 rowIndex =1
CellRangeAddress
cellRangeAddress31
=
new
CellRangeAddress
(
2
,
2
,
0
,
3
);
CellRangeAddress
cellRangeAddress31
=
new
CellRangeAddress
(
2
,
2
,
0
,
4
);
sheet
.
addMergedRegion
(
cellRangeAddress31
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress31
,
sheet
,
workbook
);
//给合并过的单元格加边框
CellRangeAddress
cellRangeAddress32
=
new
CellRangeAddress
(
2
,
2
,
4
,
6
);
CellRangeAddress
cellRangeAddress32
=
new
CellRangeAddress
(
2
,
2
,
5
,
8
);
sheet
.
addMergedRegion
(
cellRangeAddress32
);
setBorderStyle
(
HSSFCellStyle
.
BORDER_THIN
,
cellRangeAddress32
,
sheet
,
workbook
);
//给合并过的单元格加边框
thirdRow
.
createCell
(
0
).
setCellValue
(
thirdHead
[
0
]);
...
...
@@ -1015,8 +1015,22 @@ public class ExcelUtil {
newCell
.
setCellValue
(
0
);
}
//次数
newCell
=
dataRow
.
createCell
(
6
);
newCell
.
setCellStyle
(
cellStyle
);
if
(
exerciseTestVO
.
getScore
()
!=
0
)
{
newCell
.
setCellValue
(
exerciseTestVO
.
getStartDate
());
}
//次数
newCell
=
dataRow
.
createCell
(
7
);
newCell
.
setCellStyle
(
cellStyle
);
if
(
exerciseTestVO
.
getScore
()
!=
0
)
{
newCell
.
setCellValue
(
exerciseTestVO
.
getEndDate
());
}
newCell
=
dataRow
.
createCell
(
8
);
newCell
.
setCellStyle
(
cellStyle
);
if
(
exerciseTestVO
.
getScore
()
>=
60
)
{
newCell
.
setCellValue
(
"合格"
);
}
else
{
...
...
src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java
View file @
716cd45
...
...
@@ -27,4 +27,9 @@ public class ExerciseTestVO {
private
Integer
count
;
private
Long
paperId
;
private
String
startDate
;
private
String
endDate
;
}
src/main/java/com/subsidy/vo/administer/GetMemberPapersVO.java
View file @
716cd45
...
...
@@ -19,6 +19,8 @@ public class GetMemberPapersVO {
private
String
result
;
private
String
startDate
;
private
String
createDate
;
}
src/main/java/com/subsidy/vo/done/TestScoreInfoVO.java
View file @
716cd45
...
...
@@ -13,4 +13,7 @@ public class TestScoreInfoVO {
private
String
result
;
private
String
startDate
;
private
String
endDate
;
}
src/main/resources/application.properties
View file @
716cd45
# 环境配置
spring.profiles.active
=
prod
spring.profiles.active
=
dev
#和CPU数
spring.server.acceptorThreadCount
=
600
spring.server.minSpareThreads
=
100
...
...
src/main/resources/mapper/ExerciseDoneResultMapper.xml
View file @
716cd45
...
...
@@ -30,7 +30,8 @@
total_counts,
score,
result,
create_date
create_date,
start_date
FROM
exercise_done_result t
WHERE
...
...
@@ -122,7 +123,9 @@
t1.paper_id,
t1.score,
t1.result,
t2.cnt
t2.cnt,
t1.startDate,
t1.endDate
FROM
(
SELECT
...
...
@@ -131,7 +134,9 @@
t.member_id,
t.score,
IF
( ( t.score )>= 60, '合格', '不合格' ) AS result
( ( t.score )>= 60, '合格', '不合格' ) AS result,
t.start_date startDate,
t.create_date as endDate
FROM
exercise_done_result t
LEFT JOIN paper_dict t2 ON t.paper_id = t2.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