Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
c674d45b
Commit
c674d45b
authored
Aug 18, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 智能出题 下载文件异常
parent
e84a45eb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
ExaminationServiceImpl.java
...om/poc/writing/aggregate/impl/ExaminationServiceImpl.java
+6
-4
ExaminationRestImpl.java
...ava/cn/com/poc/writing/rest/impl/ExaminationRestImpl.java
+1
-1
No files found.
src/main/java/cn/com/poc/writing/aggregate/impl/ExaminationServiceImpl.java
View file @
c674d45b
...
...
@@ -273,6 +273,10 @@ public class ExaminationServiceImpl implements ExaminationService {
* @return
*/
private
File
buildExaminationFile
(
BizExaminationEntity
examinationEntity
)
{
// 遍历试卷题目,写入试卷
List
<
ExaminationDetail
>
examinationDetails
=
JsonUtils
.
deSerialize
(
examinationEntity
.
getExaminationDetail
(),
new
TypeReference
<
List
<
ExaminationDetail
>>()
{
}.
getType
());
try
(
XWPFDocument
document
=
new
XWPFDocument
())
{
// 写入标题
XWPFParagraph
titleParagraph
=
document
.
createParagraph
();
...
...
@@ -288,12 +292,10 @@ public class ExaminationServiceImpl implements ExaminationService {
detailParagraph
.
setAlignment
(
ParagraphAlignment
.
CENTER
);
detailParagraph
.
setVerticalAlignment
(
TextAlignment
.
CENTER
);
XWPFRun
detailParagraphRun
=
detailParagraph
.
createRun
();
detailParagraphRun
.
setText
(
"总分: "
+
examinationEntity
.
getTotalScore
()
+
"分 难度级别:"
+
examinationEntity
.
getLevel
()
+
"
适用岗位: "
+
examinationEntity
.
getPositions
());
detailParagraphRun
.
setText
(
"总分: "
+
examinationEntity
.
getTotalScore
()
+
"分 难度级别:"
+
examinationEntity
.
getLevel
()
+
"
总题数: "
+
examinationDetails
.
size
());
detailParagraphRun
.
addBreak
();
// 遍历试卷题目,写入试卷
List
<
ExaminationDetail
>
examinationDetails
=
JsonUtils
.
deSerialize
(
examinationEntity
.
getExaminationDetail
(),
new
TypeReference
<
List
<
ExaminationDetail
>>()
{
}.
getType
());
//问题
for
(
int
i
=
0
;
i
<
examinationDetails
.
size
();
i
++)
{
ExaminationDetail
examinationDetail
=
examinationDetails
.
get
(
i
);
...
...
src/main/java/cn/com/poc/writing/rest/impl/ExaminationRestImpl.java
View file @
c674d45b
...
...
@@ -48,7 +48,7 @@ public class ExaminationRestImpl implements ExaminationRest {
Assert
.
notBlank
(
generateExaminationDto
.
getLanguage
());
Assert
.
notBlank
(
generateExaminationDto
.
getTitle
());
Assert
.
notBlank
(
generateExaminationDto
.
getLevel
());
Assert
.
notBlank
(
generateExaminationDto
.
getPositions
());
//
Assert.notBlank(generateExaminationDto.getPositions());
Assert
.
notEmpty
(
generateExaminationDto
.
getQuestionType
());
Assert
.
notNull
(
generateExaminationDto
.
getN
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment