Commit 5aa43a79 authored by 吴卿华's avatar 吴卿华

多选

parent 95f5a2fd
......@@ -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())){
......
......@@ -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>
......
......@@ -37,7 +37,6 @@
<!-- 依赖声明 -->
<dependencyManagement>
<dependencies>
<!-- SpringBoot的依赖配置-->
<dependency>
<groupId>org.springframework.boot</groupId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment