Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
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
0
Merge Requests
0
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
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
5aa43a79
Commit
5aa43a79
authored
Jan 15, 2023
by
吴卿华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多选
parent
95f5a2fd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
TBankSubjectController.java
.../zehong/web/controller/system/TBankSubjectController.java
+8
-2
TBankSubjectMapper.xml
...m/src/main/resources/mapper/system/TBankSubjectMapper.xml
+3
-2
pom.xml
pom.xml
+0
-1
No files found.
danger-manage-admin/src/main/java/com/zehong/web/controller/system/TBankSubjectController.java
View file @
5aa43a79
...
...
@@ -149,13 +149,17 @@ public class TBankSubjectController extends BaseController
List
jsonArray
=
new
ArrayList
();
try
{
//判断题目 和答案不能为空
if
(!
StringUtils
.
isEmpty
(
row
.
getCell
(
0
).
toString
())&&!
StringUtils
.
isEmpty
(
row
.
getCell
(
9
).
toString
())){
if
(!
StringUtils
.
isEmpty
(
row
.
getCell
(
0
).
toString
())&&!
StringUtils
.
isEmpty
(
row
.
getCell
(
9
).
toString
())
&&!
StringUtils
.
isEmpty
(
row
.
getCell
(
10
).
toString
())){
successNum
++;
/**题库id*/
excelEntity
.
setBankId
(
bankId
);
/**题目*/
excelEntity
.
setTopicTitle
(
row
.
getCell
(
0
).
toString
());
/**选项*/
System
.
out
.
println
(
row
.
getCell
(
10
).
toString
());
/**题目类型*/
excelEntity
.
setTopicType
(
Integer
.
valueOf
(
row
.
getCell
(
10
).
toString
()));
/**题目*/
for
(
int
s
=
1
;
s
<=
8
;
s
++){
JSONObject
jsonObject
=
new
JSONObject
();
if
(!
StringUtils
.
isEmpty
(
row
.
getCell
(
s
).
toString
()))
{
...
...
@@ -164,6 +168,8 @@ public class TBankSubjectController extends BaseController
}
}
/**答案*/
excelEntity
.
setAnswer
(
row
.
getCell
(
9
).
toString
());
// if ("A".equals(row.getCell(9).toString())){
// excelEntity.setAnswer(0);
// }else if ("B".equals(row.getCell(9).toString())){
...
...
danger-manage-system/src/main/resources/mapper/system/TBankSubjectMapper.xml
View file @
5aa43a79
...
...
@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <if test="answer != null "> and answer = #{answer}</if>-->
<!-- <if test="datetime != null "> and datetime = #{datetime}</if>-->
</where>
group by subject_id desc
</select>
<select
id=
"selectTBankSubjectById"
parameterType=
"Long"
resultMap=
"TBankSubjectResult"
>
...
...
@@ -80,10 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--excel导入-->
<insert
id=
"insertBank"
>
insert into t_bank_subject (bank_id,topic_title,topic_option,answer,datetime)
insert into t_bank_subject (bank_id,topic_title,topic_option,answer,datetime
,topic_type
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator =
","
>
( #{item.bankId},#{item.topicTitle},#{item.topicOption},#{item.answer},#{item.datetime})
( #{item.bankId},#{item.topicTitle},#{item.topicOption},#{item.answer},#{item.datetime}
,#{item.topicType}
)
</foreach>
</insert>
...
...
pom.xml
View file @
5aa43a79
...
...
@@ -37,7 +37,6 @@
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
...
...
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