deason 4 lat temu
rodzic
commit
0a064268ca
99 zmienionych plików z 0 dodań i 10616 usunięć
  1. 0 30
      assembly.xml
  2. 0 96
      pom.xml
  3. 0 98
      src/main/java/cn/com/qmth/dp/examcloud/oe/Task.java
  4. 0 50
      src/main/java/cn/com/qmth/dp/examcloud/oe/Tianji2App.java
  5. 0 91
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Course.java
  6. 0 87
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/CourseProperty.java
  7. 0 87
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/ExamPaper.java
  8. 0 248
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/ExtractConfig.java
  9. 0 34
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/IdBase.java
  10. 0 105
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/MongoBaseEntity.java
  11. 0 249
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Paper.java
  12. 0 112
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/PaperDetail.java
  13. 0 312
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/PaperDetailUnit.java
  14. 0 78
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Property.java
  15. 0 62
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/QuesOption.java
  16. 0 70
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/QuesProperty.java
  17. 0 67
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/QuesResource.java
  18. 0 436
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Question.java
  19. 0 119
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/QuestionAudio.java
  20. 0 72
      src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Specialty.java
  21. 0 23
      src/main/java/cn/com/qmth/dp/examcloud/oe/enums/question/ExtractPolicy.java
  22. 0 32
      src/main/java/cn/com/qmth/dp/examcloud/oe/enums/question/PaperStatus.java
  23. 0 44
      src/main/java/cn/com/qmth/dp/examcloud/oe/enums/question/PaperType.java
  24. 0 77
      src/main/java/cn/com/qmth/dp/examcloud/oe/enums/question/QuesStructType.java
  25. 0 58
      src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ColumnSetting.java
  26. 0 31
      src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ExcelProperty.java
  27. 0 76
      src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ExcelUtils.java
  28. 0 93
      src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ExcelWriter.java
  29. 0 44
      src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ExportUtils.java
  30. 0 165
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/cut_exam_offline_data/CutExamOfflineDataService.java
  31. 0 191
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_abnormal_boolquestion/ExportAbnormalBoolQuestionCountService.java
  32. 0 79
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_abnormal_boolquestion/RetDto.java
  33. 0 64
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_data/ExportData.java
  34. 0 443
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/ExportExamStudentScore.java
  35. 0 93
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/vo/ExamQuestionVO.java
  36. 0 44
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/vo/ExamRecordQuestionVO.java
  37. 0 192
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/vo/ExamStudentVO.java
  38. 0 83
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/vo/ScoreVO.java
  39. 0 13
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_questions_count/ExportQuesConsumer.java
  40. 0 15
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_questions_count/ExportQuesProducer.java
  41. 0 190
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_questions_count/ExportQuestionsCountService.java
  42. 0 47
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_questions_count/RetDto.java
  43. 0 187
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_continued_count/GetStudentContinutedCountService.java
  44. 0 174
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_by_identity_number/GetStduentAnswerByIdentityNumberService.java
  45. 0 1
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_by_identity_number/package-info.java
  46. 0 14
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_by_identity_number/query_exam_record_data_1.sql
  47. 0 297
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/GetStduentAnswerDetailService.java
  48. 0 15
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/query_exam_record_data_1.sql
  49. 0 16
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/query_exam_record_data_2.sql
  50. 0 8
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/query_exam_student_info.sql
  51. 0 134
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_one_question_answer/GetStduentOneAnswerService.java
  52. 0 188
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/import_data/ImportData.java
  53. 0 2
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/import_data/delete_data.sql
  54. 0 12
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/import_data/insert_data.sql
  55. 0 182
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/load_question_cache/LoadQuestionsCacheService.java
  56. 0 18
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/load_question_cache/TrustAllTrustManager.java
  57. 0 399
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/FixCorrectAnswerAndResetScoreService.java
  58. 0 344
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/ResetScoreService.java
  59. 0 196
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamQuestionEntity.java
  60. 0 141
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamRecordDataEntity.java
  61. 0 68
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamRecordQuestionsEntity.java
  62. 0 105
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamScoreEntity.java
  63. 0 15
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExchangeBean.java
  64. 0 24
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/OuterGetQuestionAnswerReq.java
  65. 0 27
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/OuterGetQuestionAnswerResp.java
  66. 0 31
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/exchange/EnterpriseRequest.java
  67. 0 44
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/exchange/EnterpriseResponse.java
  68. 0 16
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/exchange/JsonSerializable.java
  69. 0 58
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/util/FormFilePart.java
  70. 0 328
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/util/OKHttpUtil.java
  71. 0 156
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/util/QmthUtil.java
  72. 0 650
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/UpdateQuestionScoreService.java
  73. 0 56
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultPaperBean.java
  74. 0 56
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionGroupBean.java
  75. 0 107
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionStructureWrapperBean.java
  76. 0 67
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionUnitWrapperBean.java
  77. 0 43
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/ExamRecordPaperStructBean.java
  78. 0 59
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/OuterGetPaperStructReq.java
  79. 0 27
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/OuterGetPaperStructResp.java
  80. 0 59
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/FixStudentAnswer.java
  81. 0 171
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/FixStudentAnswerService.java
  82. 0 240
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/FixStudentAnswerThread.java
  83. 0 195
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/entity/ExamQuestionEntity.java
  84. 0 55
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/entity/ExamRecordEntity.java
  85. 0 62
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/entity/ExamRecordQuestionsEntity.java
  86. 0 15
      src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/entity/FixAnswerType.java
  87. 0 103
      src/main/java/cn/com/qmth/dp/examcloud/oe/multithread/Basket.java
  88. 0 73
      src/main/java/cn/com/qmth/dp/examcloud/oe/multithread/Consumer.java
  89. 0 10
      src/main/java/cn/com/qmth/dp/examcloud/oe/multithread/EndObject.java
  90. 0 147
      src/main/java/cn/com/qmth/dp/examcloud/oe/multithread/Producer.java
  91. 0 61
      src/main/resources/application.properties
  92. 0 1
      src/main/resources/classpath.location
  93. 0 57
      src/main/resources/log4j2.xml
  94. 0 14
      src/main/resources/sql/export_data/export_data.sql
  95. 0 14
      src/main/resources/sql/get_student_one_question_answer/query_exam_record_data.sql
  96. 0 87
      src/main/resources/temp.txt
  97. 0 315
      src/main/resources/temp1.txt
  98. 0 33
      src/main/resources/upyun.xml
  99. 0 39
      src/test/java/cn/com/qmth/dp/examcloud/oe/test/ExportTest.java

+ 0 - 30
assembly.xml

@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-	<id>distribution</id>
-	<formats>
-		<format>zip</format>
-	</formats>
-	<fileSets>
-		<fileSet>
-			<directory>${project.basedir}/src/main/resources</directory>
-			<outputDirectory>/config</outputDirectory>
-		</fileSet>
-		<fileSet>
-			<directory>${project.basedir}/shell</directory>
-			<excludes>
-				<exclude>start.args</exclude>
-				<exclude>start.vmoptions</exclude>
-			</excludes>
-			<outputDirectory>/</outputDirectory>
-			<fileMode>0777</fileMode>
-		</fileSet>
-	</fileSets>
-	<dependencySets>
-		<dependencySet>
-			<useProjectArtifact>true</useProjectArtifact>
-			<outputDirectory>lib</outputDirectory>
-			<scope>runtime</scope>
-		</dependencySet>
-	</dependencySets>
-</assembly>

+ 0 - 96
pom.xml

@@ -1,96 +0,0 @@
-<?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-         xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>examcloud-oe-tool</artifactId>
-    <version>v4.0.1-RELEASE</version>
-    <packaging>jar</packaging>
-
-    <parent>
-        <groupId>cn.com.qmth.examcloud</groupId>
-        <artifactId>examcloud-parent</artifactId>
-        <version>v4.0.1-RELEASE</version>
-    </parent>
-
-    <properties>
-        <!-- 云平台版本 -->
-        <examcloud.version>v4.0.1-RELEASE</examcloud.version>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>cn.com.qmth.examcloud</groupId>
-            <artifactId>examcloud-web</artifactId>
-            <version>${examcloud.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.cloud</groupId>
-                    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>cn.com.qmth.examcloud</groupId>
-            <artifactId>examcloud-support</artifactId>
-            <version>${examcloud.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-mongodb</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-logging</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <mainClass>cn.com.qmth.dp.examcloud.oe.Tianji2App</mainClass>
-                            <addClasspath>true</addClasspath>
-                            <classpathPrefix>./</classpathPrefix>
-                        </manifest>
-                        <manifestEntries>
-                            <Class-Path>../config/</Class-Path>
-                        </manifestEntries>
-                    </archive>
-                    <excludes>
-                        <exclude>*.sql</exclude>
-                        <exclude>*.properties</exclude>
-                        <exclude>*.xml</exclude>
-                        <exclude>classpath.location</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <finalName>examcloud-oe-tool</finalName>
-                    <descriptors>
-                        <descriptor>assembly.xml</descriptor>
-                    </descriptors>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>make-assembly</id>
-                        <phase>install</phase>
-                        <goals>
-                            <goal>assembly</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

+ 0 - 98
src/main/java/cn/com/qmth/dp/examcloud/oe/Task.java

@@ -1,98 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe;
-
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
-import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
-import cn.com.qmth.examcloud.web.upyun.UpYunPathInfo;
-import cn.com.qmth.examcloud.web.upyun.UpyunPathEnvironmentInfo;
-import cn.com.qmth.examcloud.web.upyun.UpyunService;
-import com.mongodb.client.FindIterable;
-import com.mongodb.client.MongoCollection;
-import com.mongodb.client.MongoCursor;
-import org.apache.commons.lang3.RandomUtils;
-import org.bson.Document;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Component;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 任务
- *
- * @author WANGWEI
- * @date 2019年9月6日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Component
-public class Task {
-
-    private static ExamCloudLog log = ExamCloudLogFactory.getLog(Task.class);
-
-    /**
-     * 方法注释
-     *
-     * @author WANGWEI
-     */
-    public void start() {
-        try {
-            // ResetScoreService bean1 = SpringContextHolder.getBean(ResetScoreService.class);
-            // bean1.start();
-
-            // Long examId = PropertiesUtil.getLong("getContiuedCount.examId", 0L);
-            // GetStudentContinutedCountService bean = SpringContextHolder.getBean(GetStudentContinutedCountService.class);
-            // bean.start(examId);
-
-            // GetStduentAnswerDetailService bean = SpringContextHolder.getBean(GetStduentAnswerDetailService.class);
-            // bean.start(1627L, "000004");
-
-            // UpdateQuestionScoreService  bean = SpringContextHolder.getBean(UpdateQuestionScoreService.class);
-            // bean.start();
-
-            // LoadQuestionsCacheService bean = SpringContextHolder.getBean(LoadQuestionsCacheService.class);
-            // bean.start();
-        } catch (Exception e) {
-            log.error("unexpected", e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * 连接测试
-     *
-     * @author WANGWEI
-     */
-    public static void test() {
-
-        UpyunService upyunService = SpringContextHolder.getBean(UpyunService.class);
-        UpyunPathEnvironmentInfo env = new UpyunPathEnvironmentInfo();
-        env.setFileSuffix(".jpg");
-        env.setRootOrgId(String.valueOf(RandomUtils.nextLong()));
-        UpYunPathInfo upYunPathInfo = upyunService.writeFile("test", env,
-                new File("D:/Temp/111111X.jpg"), true);
-        System.out.println("upYunPathInfo: " + JsonUtil.toPrettyJson(upYunPathInfo));
-
-        JdbcTemplate jdbcTemplate = SpringContextHolder.getBean(JdbcTemplate.class);
-        List<Map<String, Object>> list = jdbcTemplate.queryForList("SELECT now() FROM dual");
-        System.out.println(JsonUtil.toJson(list));
-
-        MongoTemplate mongoTemplate = SpringContextHolder.getBean(MongoTemplate.class);
-        String dbName = mongoTemplate.getDb().getName();
-        System.out.println("mongo.db=" + dbName);
-        MongoCollection<Document> collection = mongoTemplate.getCollection("examRecordQuestions");
-        Document filter = new Document();
-        filter.append("examRecordDataId", 101373L);
-        FindIterable<Document> iterable = collection.find(filter);
-        MongoCursor<Document> iterator = iterable.iterator();
-        while (iterator.hasNext()) {
-            Document next = iterator.next();
-
-            System.out.println("_id=" + next.getObjectId("_id"));
-            System.out.println(JsonUtil.toPrettyJson(next));
-        }
-    }
-
-}

+ 0 - 50
src/main/java/cn/com/qmth/dp/examcloud/oe/Tianji2App.java

@@ -1,50 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe;
-
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
-import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
-import cn.com.qmth.examcloud.web.upyun.UpyunSiteManager;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.EnableAsync;
-
-/**
- * 启动类
- *
- * @author WANGWEI
- * @date 2019年3月29日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@SpringBootApplication
-@Configuration
-@EnableAsync
-@ComponentScan(basePackages = {"cn.com.qmth"})
-public class Tianji2App {
-
-    static {
-        System.setProperty("hibernate.dialect.storage_engine", "innodb");
-        PropertiesUtil.loadFromResource("application.properties");
-        PropertyHolder.loadFromResource("application.properties");
-    }
-
-    /**
-     * main
-     *
-     * @param args
-     * @author WANGWEI
-     */
-    public static void main(String[] args) {
-        SpringApplication.run(Tianji2App.class, args);
-
-        // UpyunSiteManager.initSite();
-        // UpyunSiteManager.initClient();
-
-        Task task = SpringContextHolder.getBean(Task.class);
-        task.start();
-    }
-
-}

+ 0 - 91
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Course.java

@@ -1,91 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-/**
- * Created by songyue on 16/12/26.
- */
-public class Course extends IdBase {
-
-    private String code;
-
-    private String name;
-
-    private String orgId;
-
-    private String level;
-
-    private String createTime;
-
-    private String updateTime;
-
-    private String enable;
-
-    public Course() {
-
-    }
-
-    public Course(String name, String code) {
-        this.name = name;
-        this.code = code;
-    }
-
-    public Course(String enable) {
-        this.enable = enable;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(String orgId) {
-        this.orgId = orgId;
-    }
-
-    public String getLevel() {
-        return level;
-    }
-
-    public void setLevel(String level) {
-        this.level = level;
-    }
-
-    public String getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(String createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(String updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public String getEnable() {
-        return enable;
-    }
-
-    public void setEnable(String enable) {
-        this.enable = enable;
-    }
-
-}

+ 0 - 87
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/CourseProperty.java

@@ -1,87 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.util.Date;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * @author weiwenhai
- * @describle 课程属性
- * @date 2017.11.2
- */
-public class CourseProperty extends IdBase {
-    @NotNull
-    private Long orgId;
-
-    @NotNull
-    private Long courseId;
-
-    private String courseCode;
-
-    private String courseName;
-
-    @NotNull
-    private String name;
-
-    private Boolean enable;
-
-    private Date updateTime;//更新时间
-
-
-    public Long getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(Long orgId) {
-        this.orgId = orgId;
-    }
-
-    public Long getCourseId() {
-        return courseId;
-    }
-
-    public void setCourseId(Long courseId) {
-        this.courseId = courseId;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-}

+ 0 - 87
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/ExamPaper.java

@@ -1,87 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import org.springframework.data.mongodb.core.mapping.DBRef;
-
-/**
- * @author chenken
- * @date 2017年7月14日 上午9:34:16
- * @company QMTH
- * @description 调卷规则关联试卷
- */
-public class ExamPaper extends IdBase {
-    /**
-     * 考试ID
-     */
-    private Long examId;
-    /**
-     * 课程代码
-     */
-    private String courseCode;
-    /**
-     * 试卷类型
-     */
-    private String groupCode;
-    /**
-     * 关联试卷
-     */
-    @DBRef
-    private Paper paper;
-    /**
-     * 抽取试卷次数
-     */
-    private Integer extractCount;
-    /**
-     * 抽取权重比例
-     * 整数类型 例如:70%  数据库里存70
-     */
-    private Integer weight;
-
-    public Long getExamId() {
-        return examId;
-    }
-
-    public void setExamId(Long examId) {
-        this.examId = examId;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public String getGroupCode() {
-        return groupCode;
-    }
-
-    public void setGroupCode(String groupCode) {
-        this.groupCode = groupCode;
-    }
-
-    public Integer getExtractCount() {
-        return extractCount;
-    }
-
-    public void setExtractCount(Integer extractCount) {
-        this.extractCount = extractCount;
-    }
-
-    public Integer getWeight() {
-        return weight;
-    }
-
-    public void setWeight(Integer weight) {
-        this.weight = weight;
-    }
-
-    public Paper getPaper() {
-        return paper;
-    }
-
-    public void setPaper(Paper paper) {
-        this.paper = paper;
-    }
-
-}

+ 0 - 248
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/ExtractConfig.java

@@ -1,248 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.util.List;
-import java.util.Map;
-
-import cn.com.qmth.dp.examcloud.oe.enums.question.ExtractPolicy;
-
-/**
- * 调卷规则
- *
- * @author chenken
- */
-public class ExtractConfig extends MongoBaseEntity {
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = -2723715817328472562L;
-	/**
-     * 考试ID
-     */
-    private Long examId;
-    /**
-     * 考试类型
-     * 网络考试
-     * 传统考试
-     */
-    private String examType;
-    /**
-     * 考试名称
-     */
-    private String examName;
-    /**
-     * 课程名称
-     */
-    private String courseName;
-    /**
-     * 课程代码
-     */
-    private String courseCode;
-
-    private Course course;
-    /**
-     * 调卷类型
-     * 成套调用
-     * 重组调用
-     */
-    private String callType;
-    /**
-     * 是否生成 1:生成 0:没生成
-     * 生成预览卷
-     */
-    private Short ifFinish;
-    /**
-     * 已经生成的试卷ID Map
-     * 数据结构:
-     * {
-     * "A":"0001",
-     * "B":"0002"
-     * }
-     * A 类型下生成的paperId为 0001
-     * B 类型下生成的paperId为 0002
-     */
-    private Map<String, String> finishedPaperIdMap;
-    /**
-     * 抽取试卷对象集合
-     */
-    private List<ExamPaper> examPaperList;
-    /**
-     * 小题乱序
-     * 1:乱序
-     * 0:不乱序
-     */
-    private Short scrambling_the_question_order;
-    /**
-     * 选项乱序
-     * 1:乱序
-     * 0:不乱序
-     */
-    private Short scrambling_the_option_order;
-
-    /**
-     * 抽卷规则
-     */
-    private ExtractPolicy policy;
-    /**
-     * 类型参数
-     */
-    private Map<String, Object> params;
-    /**
-     * 机构ID
-     */
-    private String orgId;
-
-    private String orgName;
-
-    public ExtractConfig() {
-
-    }
-
-    public ExtractConfig(String id) {
-        this.id = id;
-    }
-
-    public ExtractConfig(Long exam_id, String course_code) {
-        this.examId = exam_id;
-        this.courseCode = course_code;
-    }
-
-    public Long getExamId() {
-        return examId;
-    }
-
-    public void setExamId(Long examId) {
-        this.examId = examId;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public ExtractPolicy getPolicy() {
-        return policy;
-    }
-
-    public void setPolicy(ExtractPolicy policy) {
-        this.policy = policy;
-    }
-
-    public String getExamType() {
-        return examType;
-    }
-
-    public void setExamType(String examType) {
-        this.examType = examType;
-    }
-
-    public String getExamName() {
-        return examName;
-    }
-
-    public void setExamName(String examName) {
-        this.examName = examName;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public String getCallType() {
-        return callType;
-    }
-
-    public void setCallType(String callType) {
-        this.callType = callType;
-    }
-
-    public Short getIfFinish() {
-        return ifFinish;
-    }
-
-    public void setIfFinish(Short ifFinish) {
-        if (ifFinish == null) {
-            this.ifFinish = 0;
-        } else {
-            this.ifFinish = ifFinish;
-        }
-    }
-
-    public Map<String, Object> getParams() {
-        return params;
-    }
-
-    public void setParams(Map<String, Object> params) {
-        this.params = params;
-    }
-
-    public String getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(String orgId) {
-        this.orgId = orgId;
-    }
-
-    public List<ExamPaper> getExamPaperList() {
-        return examPaperList;
-    }
-
-    public void setExamPaperList(List<ExamPaper> examPaperList) {
-        this.examPaperList = examPaperList;
-    }
-
-    public Short getScrambling_the_question_order() {
-        return scrambling_the_question_order;
-    }
-
-    public void setScrambling_the_question_order(Short scrambling_the_question_order) {
-        if (scrambling_the_question_order == null) {
-            this.scrambling_the_question_order = 0;
-        } else {
-            this.scrambling_the_question_order = scrambling_the_question_order;
-        }
-    }
-
-    public Short getScrambling_the_option_order() {
-        return scrambling_the_option_order;
-    }
-
-    public void setScrambling_the_option_order(Short scrambling_the_option_order) {
-        if (scrambling_the_option_order == null) {
-            this.scrambling_the_option_order = 0;
-        } else {
-            this.scrambling_the_option_order = scrambling_the_option_order;
-        }
-    }
-
-    public Map<String, String> getFinishedPaperIdMap() {
-        return finishedPaperIdMap;
-    }
-
-    public void setFinishedPaperIdMap(Map<String, String> finishedPaperIdMap) {
-        this.finishedPaperIdMap = finishedPaperIdMap;
-    }
-
-    public String getOrgName() {
-        return orgName;
-    }
-
-    public void setOrgName(String orgName) {
-        this.orgName = orgName;
-    }
-
-    public Course getCourse() {
-        return course;
-    }
-
-    public void setCourse(Course course) {
-        this.course = course;
-    }
-}

+ 0 - 34
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/IdBase.java

@@ -1,34 +0,0 @@
-/*
- * *************************************************
- * Copyright (c) 2019 QMTH. All Rights Reserved.
- * Created by Deason on 2019-05-05 14:12:35.
- * *************************************************
- */
-
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import org.springframework.data.annotation.Id;
-
-import java.io.Serializable;
-
-/**
- * Mongo Object ID
- *
- * @author: fengdesheng
- * @since: 2019/5/5
- */
-public abstract class IdBase implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    @Id
-    protected String id;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-}

+ 0 - 105
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/MongoBaseEntity.java

@@ -1,105 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.util.Date;
-
-import javax.persistence.Column;
-import javax.persistence.EntityListeners;
-import javax.persistence.Id;
-import javax.persistence.MappedSuperclass;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import org.springframework.data.annotation.CreatedBy;
-import org.springframework.data.annotation.CreatedDate;
-import org.springframework.data.annotation.LastModifiedBy;
-import org.springframework.data.annotation.LastModifiedDate;
-import org.springframework.data.jpa.domain.support.AuditingEntityListener;
-
-import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
-
-@MappedSuperclass
-@EntityListeners(AuditingEntityListener.class)
-public abstract class MongoBaseEntity implements JsonSerializable {
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -3471392332225060352L;
-	
-    @Id
-    protected String id;
-
-	/**
-	 * 更新时间
-	 */
-	@LastModifiedDate
-	@Column(nullable = true)
-	@Temporal(TemporalType.TIMESTAMP)
-	private Date updateDate;
-
-	/**
-	 * 创建时间
-	 */
-	@CreatedDate
-	@Column(nullable = true, updatable = false)
-	@Temporal(TemporalType.TIMESTAMP)
-	private Date creationDate;
-	
-	/**
-	 * 创建人id
-	 */
-	@CreatedBy
-	@Column(nullable = true, updatable = false)
-	private Long creationBy;
-	
-	
-	/**
-	 * 更新人id
-	 */
-	@LastModifiedBy
-	@Column(nullable = true)
-	private Long updateBy;
-
-	public Date getUpdateDate() {
-		return updateDate;
-	}
-
-	public void setUpdateDate(Date updateDate) {
-		this.updateDate = updateDate;
-	}
-
-	public Date getCreationDate() {
-		return creationDate;
-	}
-
-	public void setCreationDate(Date creationDate) {
-		this.creationDate = creationDate;
-	}
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public Long getCreationBy() {
-		return creationBy;
-	}
-
-	public void setCreationBy(Long creationBy) {
-		this.creationBy = creationBy;
-	}
-
-	public Long getUpdateBy() {
-		return updateBy;
-	}
-
-	public void setUpdateBy(Long updateBy) {
-		this.updateBy = updateBy;
-	}
-
-
-	
-}

+ 0 - 249
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Paper.java

@@ -1,249 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Map;
-
-import org.springframework.data.mongodb.core.index.Indexed;
-
-import cn.com.qmth.dp.examcloud.oe.enums.question.PaperStatus;
-import cn.com.qmth.dp.examcloud.oe.enums.question.PaperType;
-import cn.com.qmth.examcloud.api.commons.enums.CourseLevel;
-
-/**
- * @author songyue
- */
-public class Paper extends MongoBaseEntity {
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = -8681575737341326402L;
-
-	@Indexed(unique = true)
-    private String name;// 试卷名称
-
-    private String title;// 试卷标题
-
-    private Double totalScore;// 试卷总分
-
-    private String creator;// 创建人id
-
-    private Integer paperDetailCount;// 大题数量
-
-    private Integer unitCount;// 小题数量
-
-    private String createTime;// 创建时间
-
-    private String lastModifyName;// 最后修改人名称
-
-    private String word;// 原始试卷word
-
-    private String html;// 原始试卷html
-
-    private PaperStatus paperStatus;// 试卷状态(待审核、通过、不通过)
-
-    private PaperType paperType;// 试卷类型(导入、组卷)
-
-    @Deprecated
-    private String courseNo;
-
-    @Deprecated
-    private String courseName;
-
-    private Course course;
-
-    private CourseLevel level;
-
-    private String orgId;
-
-    private Map<String, String> params;// 导入试卷属性
-
-    private Specialty specialty;
-
-    private Double difficultyDegree; //难度系数
-
-    private String sameName; //相同大题名 0:不合并,1:合并
-
-    private String examRemark;//考试说明
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public Double getTotalScore() {
-        return totalScore;
-    }
-
-    public void setTotalScore(Double totalScore) {
-        this.totalScore = totalScore;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public Integer getPaperDetailCount() {
-        return paperDetailCount;
-    }
-
-    public void setPaperDetailCount(Integer paperDetailCount) {
-        this.paperDetailCount = paperDetailCount;
-    }
-
-    public String getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(String createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getLastModifyName() {
-        return lastModifyName;
-    }
-
-    public void setLastModifyName(String lastModifyName) {
-        this.lastModifyName = lastModifyName;
-    }
-
-    public String getWord() {
-        return word;
-    }
-
-    public void setWord(String word) {
-        this.word = word;
-    }
-
-    public String getHtml() {
-        return html;
-    }
-
-    public void setHtml(String html) {
-        this.html = html;
-    }
-
-    public PaperStatus getPaperStatus() {
-        return paperStatus;
-    }
-
-    public void setPaperStatus(PaperStatus paperStatus) {
-        this.paperStatus = paperStatus;
-    }
-
-    public PaperType getPaperType() {
-        return paperType;
-    }
-
-    public void setPaperType(PaperType paperType) {
-        this.paperType = paperType;
-    }
-
-    public Map<String, String> getParams() {
-        return params;
-    }
-
-    public void setParams(Map<String, String> params) {
-        this.params = params;
-    }
-
-    public String getCourseNo() {
-        return courseNo;
-    }
-
-    public void setCourseNo(String courseNo) {
-        this.courseNo = courseNo;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public Integer getUnitCount() {
-        return unitCount;
-    }
-
-    public void setUnitCount(Integer unitCount) {
-        this.unitCount = unitCount;
-    }
-
-    public String getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(String orgId) {
-        this.orgId = orgId;
-    }
-
-    public Paper() {
-        this.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());;
-    }
-
-    public CourseLevel getLevel() {
-        return level;
-    }
-
-    public void setLevel(CourseLevel level) {
-        this.level = level;
-    }
-
-    public Course getCourse() {
-        return course;
-    }
-
-    public void setCourse(Course course) {
-        this.course = course;
-    }
-
-    public Specialty getSpecialty() {
-        return specialty;
-    }
-
-    public void setSpecialty(Specialty specialty) {
-        this.specialty = specialty;
-    }
-
-    public Double getDifficultyDegree() {
-        return difficultyDegree;
-    }
-
-    public void setDifficultyDegree(Double difficultyDegree) {
-        this.difficultyDegree = difficultyDegree;
-    }
-
-    public String getSameName() {
-        return sameName;
-    }
-
-    public void setSameName(String sameName) {
-        this.sameName = sameName;
-    }
-
-    public String getExamRemark() {
-        return examRemark;
-    }
-
-    public void setExamRemark(String examRemark) {
-        this.examRemark = examRemark;
-    }
-
-}

+ 0 - 112
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/PaperDetail.java

@@ -1,112 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import org.springframework.data.mongodb.core.mapping.DBRef;
-
-public class PaperDetail extends MongoBaseEntity implements Comparable<PaperDetail> {
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = -8021835042074266092L;
-
-	@DBRef(lazy = false)
-    private Paper paper;// 关联的试卷
-
-    private Integer number;// 大题序号
-
-    private String name;// 大题名称
-
-    private String title;// 大题描述
-
-    private Double score;// 大题分数
-
-    private Integer unitCount;// 大题下的小题数量
-
-    private String creator;// 创建人id
-
-    private String createTime;// 创建时间
-
-    public Paper getPaper() {
-        return paper;
-    }
-
-    public void setPaper(Paper paper) {
-        this.paper = paper;
-    }
-
-    public Integer getNumber() {
-        return number;
-    }
-
-    public void setNumber(Integer number) {
-        this.number = number;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Double getScore() {
-        return score;
-    }
-
-    public void setScore(Double score) {
-        this.score = score;
-    }
-
-    public Integer getUnitCount() {
-        return unitCount;
-    }
-
-    public void setUnitCount(Integer unitCount) {
-        this.unitCount = unitCount;
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(String createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    public PaperDetail() {
-
-    }
-
-    @Override
-    public int compareTo(PaperDetail paperDetail) {
-        if (paperDetail != null) {
-            if (this.getNumber() == null) return -1;
-            if (paperDetail.getNumber() == null) return 1;
-            if (this.getNumber() > paperDetail.getNumber()) {
-                return 1;
-            } else if (this.getNumber() < paperDetail.getNumber()) {
-                return -1;
-            } else {
-                return 0;
-            }
-        }
-        return -1;
-    }
-
-}

+ 0 - 312
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/PaperDetailUnit.java

@@ -1,312 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.math.BigDecimal;
-import java.math.RoundingMode;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.springframework.data.mongodb.core.mapping.DBRef;
-
-import cn.com.qmth.dp.examcloud.oe.enums.question.PaperType;
-import cn.com.qmth.dp.examcloud.oe.enums.question.QuesStructType;
-
-public class PaperDetailUnit extends MongoBaseEntity implements Comparable<PaperDetailUnit> {
-
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = 266448283780973578L;
-
-	@DBRef(lazy = false)
-    private Paper paper;// 关联的试卷
-
-    private Integer number;// 小题序号
-
-    private Double score;// 小题分数
-
-    private List<Double> subScoreList;// 对应套题的情况下,各子题的分数分布
-
-    @DBRef(lazy = false)
-    private PaperDetail paperDetail;// 关联的大题
-
-    private QuesStructType questionType;// 小题类型
-
-    @DBRef(lazy = false)
-    private Question question;// 关联试题
-
-    /**
-     * 选择题下option的排序,按照number排序 一般:4,2,3,1 套题下的选择题:1,2,3,4;2,3,4,1;3,2,1,4
-     * 题与题之间按分号";"分隔
-     */
-    private String optionOrder;
-
-    private String creator;// 创建人id
-
-    private String createTime;// 创建时间
-
-    private PaperType paperType;
-
-    /**
-     * 作答限时 K12
-     */
-    private Long timeLimit;
-
-    public PaperDetailUnit() {
-    }
-
-    public PaperDetailUnit(Paper paper, PaperDetail paperDetail, Question question) {
-        this.paper = paper;
-        this.questionType = question.getQuestionType();
-        this.question = question;
-        this.createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
-        this.paperDetail = paperDetail;
-        this.score = 0d;
-    }
-
-    public Paper getPaper() {
-        return paper;
-    }
-
-    public void setPaper(Paper paper) {
-        this.paper = paper;
-    }
-
-    public Integer getNumber() {
-        return number;
-    }
-
-    public void setNumber(Integer number) {
-        this.number = number;
-    }
-
-    public Double getScore() {
-        return score;
-    }
-
-    public void setScore(Double score) {
-        this.score = score;
-        // 非套题或试题未设置时,不做额外处理
-        if (questionType != QuesStructType.NESTED_ANSWER_QUESTION || question == null) {
-            return;
-        }
-        // 当前分数设置为空时,同时设置子题分数为空
-        if (score == null) {
-            subScoreList = null;
-            return;
-        }
-        // 总分与子题分数之和相同,则不做额外处理
-        if (subScoreList != null && subScoreList.size() > 0 && getSubScoreSum() == score) {
-            return;
-        }
-        // 根据试题与总分设置情况重置子题分数
-        if (question.getSubQuestions() != null) {
-            initSubScoreList(score, question.getSubQuestions());
-        }
-    }
-
-    public PaperDetail getPaperDetail() {
-        return paperDetail;
-    }
-
-    public void setPaperDetail(PaperDetail paperDetail) {
-        this.paperDetail = paperDetail;
-    }
-
-    public QuesStructType getQuestionType() {
-        return questionType;
-    }
-
-    public void setQuestionType(QuesStructType questionType) {
-        this.questionType = questionType;
-    }
-
-    public Question getQuestion() {
-        return question;
-    }
-
-    public void setQuestion(Question question) {
-        this.question = question;
-        // 非套题或总分未设置时,不做额外处理
-        if (questionType != QuesStructType.NESTED_ANSWER_QUESTION || score == null) {
-            return;
-        }
-        // 当前试题或子题列表为空时,同时设置子题分数为空
-        if (question == null || question.getSubQuestions() == null) {
-            subScoreList = null;
-            return;
-        }
-        // 当前试题子题数量与子题分数数量相同,不做额外处理
-        if (subScoreList != null && subScoreList.size() == question.getSubQuestions().size()) {
-            return;
-        }
-        // 根据试题与总分设置情况重置子题分数
-        initSubScoreList(score, question.getSubQuestions());
-    }
-
-    public String getCreator() {
-        return creator;
-    }
-
-    public void setCreator(String creator) {
-        this.creator = creator;
-    }
-
-    public String getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(String createTime) {
-        this.createTime = createTime;
-    }
-
-    public List<Double> getSubScoreList() {
-        return subScoreList;
-    }
-
-    public String getOptionOrder() {
-        return optionOrder;
-    }
-
-    public void setOptionOrder(String optionOrder) {
-        this.optionOrder = optionOrder;
-    }
-
-    public PaperType getPaperType() {
-        return paperType;
-    }
-
-    public void setPaperType(PaperType paperType) {
-        if (paper != null) {
-            this.paperType = paper.getPaperType();
-        } else {
-            this.paperType = paperType;
-        }
-    }
-
-    public void setSubScoreList(List<Double> subScoreList) {
-        this.subScoreList = subScoreList;
-        if (subScoreList != null) {
-            double totalScore = 0;
-            for (Double score : subScoreList) {
-                if (score == null) {
-                    score = 0d;
-                }
-                totalScore += score;
-            }
-            this.score = formatDouble(totalScore);
-        }
-    }
-
-    public void setSubScoreListNew(List<Double> subScoreList) {
-        this.subScoreList = subScoreList;
-    }
-    public static double formatDouble(double number) {
-        BigDecimal formatNumber = BigDecimal.valueOf(number);
-        return formatNumber.setScale(2, RoundingMode.HALF_UP).doubleValue();
-    }
-    public Long getTimeLimit() {
-        return timeLimit;
-    }
-
-    public void setTimeLimit(Long timeLimit) {
-        this.timeLimit = timeLimit;
-    }
-
-    @Override
-    public int compareTo(PaperDetailUnit unit) {
-        /*if (unit != null) {
-            if (this.getQuestionType().getId() > unit.getQuestionType().getId()) {
-                return 1;
-            } else if (this.getQuestionType().getId() == unit.getQuestionType().getId()) {
-                return 0;
-            }
-        }*/
-        if (unit != null) {
-            if (this.getNumber() == null) return -1;
-            if (unit.getNumber() == null) return 1;
-            if (this.getNumber() > unit.getNumber()) {
-                return 1;
-            } else if (this.getNumber() < unit.getNumber()) {
-                return -1;
-            } else {
-                return 0;
-            }
-        }
-        return -1;
-    }
-
-    /**
-     * 根据预设总分自动拆解套题子题的分数分布 目前采取均分后累加到最后一题的做法
-     *
-     * @param totalScore
-     * @param questionList
-     */
-    private void initSubScoreList(double totalScore, List<Question> questionList) {
-        List<Double> scoreList = new ArrayList<>();
-        int count = questionList.size();
-        if (count > 0) {
-            int baseScore = (int) (totalScore / count);
-            double leftScore = totalScore;
-            for (int i = 0; i < count; i++) {
-                scoreList.add((double) baseScore);
-                leftScore -= baseScore;
-            }
-            if (leftScore > 0) {
-                scoreList.set(count - 1, baseScore + leftScore);
-            }
-            this.subScoreList = scoreList;
-        }
-    }
-
-    private double getSubScoreSum() {
-        double totalScore = 0;
-        if (subScoreList != null) {
-            for (Double score : subScoreList) {
-                totalScore += score;
-            }
-        }
-        return formatDouble(totalScore);
-    }
-
-    public int getDetailNumber() {
-        return this.paperDetail.getNumber();
-    }
-
-    public String getDetailId() {
-        return this.paperDetail.getId();
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result
-                + ((question == null) ? 0 : question.getId().hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        PaperDetailUnit other = (PaperDetailUnit) obj;
-        if (question == null) {
-            if (other.question != null) {
-                return false;
-            }
-        } else if (!question.getId().equals(other.question.getId())) {
-            return false;
-        }
-        return true;
-    }
-
-}

+ 0 - 78
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Property.java

@@ -1,78 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import javax.validation.constraints.NotNull;
-
-/**
- * @author weiwenhai
- * @describle 属性
- * @date 2017.11.6
- */
-public class Property extends IdBase {
-    public static final String ROOT_PARENT_ID = "0";
-
-    @NotNull
-    private Long orgId;
-
-    @NotNull
-    private String coursePropertyId;
-
-    @NotNull
-    private String parentId;
-
-    @NotNull
-    private String name;
-
-    @NotNull
-    private Integer number;//序号
-
-    private String remark;
-
-    public Long getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(Long orgId) {
-        this.orgId = orgId;
-    }
-
-    public String getCoursePropertyId() {
-        return coursePropertyId;
-    }
-
-    public void setCoursePropertyId(String coursePropertyId) {
-        this.coursePropertyId = coursePropertyId;
-    }
-
-    public String getParentId() {
-        return parentId;
-    }
-
-    public void setParentId(String parentId) {
-        this.parentId = parentId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Integer getNumber() {
-        return number;
-    }
-
-    public void setNumber(Integer number) {
-        this.number = number;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-}

+ 0 - 62
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/QuesOption.java

@@ -1,62 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.io.Serializable;
-
-/**
- * Created by songyue on 16/12/27.
- */
-public class QuesOption implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 选项编号 在第一次导入或者新建题目时初始化, 初始化之后不可改变
-     */
-    private String number;
-
-    private String optionBody;// 选项内容
-
-    private String optionBodyWord;// 选项word
-
-
-    /**
-     * 是否是正确答案 1:是 0:否
-     */
-    private short isCorrect;
-
-    public String getNumber() {
-        return number;
-    }
-
-    public void setNumber(String number) {
-        this.number = number;
-    }
-
-    public String getOptionBody() {
-        return optionBody;
-    }
-
-    public void setOptionBody(String optionBody) {
-        this.optionBody = optionBody;
-    }
-
-    public String getOptionBodyWord() {
-        return optionBodyWord;
-    }
-
-    public void setOptionBodyWord(String optionBodyWord) {
-        this.optionBodyWord = optionBodyWord;
-    }
-
-    public QuesOption() {
-    }
-
-    public short getIsCorrect() {
-        return isCorrect;
-    }
-
-    public void setIsCorrect(short isCorrect) {
-        this.isCorrect = isCorrect;
-    }
-
-}

+ 0 - 70
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/QuesProperty.java

@@ -1,70 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-public class QuesProperty extends IdBase {
-
-    private String coursePropertyName;//课程属性名
-
-    private Property firstProperty;//一级属性
-
-    private Property secondProperty;//二级属性
-
-    public QuesProperty() {
-
-    }
-
-    public QuesProperty(Property firstProperty, Property secondProperty, CourseProperty courseProperty) {
-        this.firstProperty = firstProperty;
-        this.secondProperty = secondProperty;
-        this.coursePropertyName = courseProperty.getName();
-    }
-
-    public Property getFirstProperty() {
-        return firstProperty;
-    }
-
-    public void setFirstProperty(Property firstProperty) {
-        this.firstProperty = firstProperty;
-    }
-
-    public Property getSecondProperty() {
-        return secondProperty;
-    }
-
-    public void setSecondProperty(Property secondProperty) {
-        this.secondProperty = secondProperty;
-    }
-
-    public String getCoursePropertyName() {
-        return coursePropertyName;
-    }
-
-    public void setCoursePropertyName(String coursePropertyName) {
-        this.coursePropertyName = coursePropertyName;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((id == null) ? 0 : id.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        QuesProperty other = (QuesProperty) obj;
-        if (id == null) {
-            if (other.id != null)
-                return false;
-        } else if (!id.equals(other.id))
-            return false;
-        return true;
-    }
-
-}

+ 0 - 67
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/QuesResource.java

@@ -1,67 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import org.bson.types.ObjectId;
-
-import java.io.Serializable;
-
-/**
- * Created by songyue on 16/12/27.
- */
-public class QuesResource implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private String resourceNo;//资源编号
-
-    private String resourceType;//资源类型(题干、答案等)
-
-    private String fileType;//文件类型(png、gif)
-
-    private int sort;//排序
-
-    private ObjectId fileId;//GridFs中存储地址
-
-    public String getResourceNo() {
-        return resourceNo;
-    }
-
-    public void setResourceNo(String resourceNo) {
-        this.resourceNo = resourceNo;
-    }
-
-    public String getResourceType() {
-        return resourceType;
-    }
-
-    public void setResourceType(String resourceType) {
-        this.resourceType = resourceType;
-    }
-
-    public int getSort() {
-        return sort;
-    }
-
-    public void setSort(int sort) {
-        this.sort = sort;
-    }
-
-    public String getFileType() {
-        return fileType;
-    }
-
-    public void setFileType(String fileType) {
-        this.fileType = fileType;
-    }
-
-    public ObjectId getFileId() {
-        return fileId;
-    }
-
-    public void setFileId(ObjectId fileId) {
-        this.fileId = fileId;
-    }
-
-    public QuesResource() {
-
-    }
-
-}

+ 0 - 436
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Question.java

@@ -1,436 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.data.annotation.Transient;
-
-import cn.com.qmth.dp.examcloud.oe.enums.question.QuesStructType;
-import cn.com.qmth.examcloud.question.commons.core.question.AnswerType;
-
-/**
- * Created by songyue on 16/12/27.
- */
-public class Question extends MongoBaseEntity {
-
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = 448493904015571457L;
-
-	private String quesBody;// 题干,默认为html
-
-    private String quesBodyWord;// 题干word
-
-    /**
-     * 试题wordpkg对象序列化数据
-     */
-    // private byte[] quesPkg;
-
-    /**
-     * 试题pkg路径Id
-     */
-    private String quesPkgPathId;
-
-    private String quesAnswer;// 答案,默认为html
-
-    private String quesAnswerWord;// 答案word
-
-    private String quesAnswerAnalysis;// 答案解析,默认为html
-
-    private String quesAnswerAnalysisWord;// 答案word解析
-
-    private List<QuesOption> quesOptions;// 试题选项
-    
-    private String quesOptionsWord;//试题选项word解析
-
-    private List<QuesResource> quesResource;// 试题resource(试题资源库集合,适用于多媒体介质试题)
-
-    private QuesStructType questionType;// 试题结构类型
-
-    private String createTime;// 创建时间
-
-    private String updateTime;// 更新时间
-
-    private List<Question> subQuestions;// 子题目,用于套题
-
-    private Double score;// 预设分值
-
-    @Deprecated
-    private String courseNo;// 课程CODE
-
-    @Deprecated
-    private String courseName;// 课程名称
-
-    @Deprecated
-    private String courseLevel;// 课程层次
-
-    @Deprecated
-    private String courseMajor;// 课程专业
-
-    private Course course;
-
-    private String orgId; // 机构ID
-
-    private Map<String, String> quesParams;// 试题属性
-
-    /**
-     * 是否包含音频
-     */
-    private Boolean hasAudio;
-
-    private List<QuestionAudio> questionAudios;
-
-    private String quesName;// 来源大题
-
-    private Integer number;
-
-    private Specialty specialty;
-
-    /*
-     * 作答类型
-     */
-    private AnswerType answerType;
-
-    /**
-     * 试题属性
-     */
-    private List<QuesProperty> quesProperties;// 关联多组属性
-
-    private Double difficultyDegree; // 难度系数
-
-    private Boolean publicity; // 公开度
-
-    private String difficulty;// 难度
-
-    private List<String> propertyGroup;// 试题属性组合(蓝图组卷使用)
-
-    /**
-     * 试题标签,用于K12做查询条件
-     */
-    private Map<String, String> properties;
-
-    /**
-     * 是否脱离试卷存在,如果为true,是K12的导入题
-     */
-    private Boolean isolated;
-
-    @Transient
-    private List<QuestionAudio> audioList;// 音频列表(复制试卷使用,不存数据)
-
-    public void addAudio(QuestionAudio audio) {
-        if (audioList == null) {
-            audioList = new ArrayList<>();
-        }
-        audioList.add(audio);
-    }
-
-    public List<QuestionAudio> getAudioList() {
-        return audioList;
-    }
-
-    public void setAudioList(List<QuestionAudio> audioList) {
-        this.audioList = audioList;
-    }
-
-    public String getQuesBody() {
-        return quesBody;
-    }
-
-    public void setQuesBody(String quesBody) {
-        this.quesBody = quesBody;
-    }
-
-    public String getQuesBodyWord() {
-        return quesBodyWord;
-    }
-
-    public void setQuesBodyWord(String quesBodyWord) {
-        this.quesBodyWord = quesBodyWord;
-    }
-
-    public String getQuesAnswer() {
-        return quesAnswer;
-    }
-
-    public void setQuesAnswer(String quesAnswer) {
-        this.quesAnswer = quesAnswer;
-    }
-
-    public String getQuesAnswerWord() {
-        return quesAnswerWord;
-    }
-
-    public void setQuesAnswerWord(String quesAnswerWord) {
-        this.quesAnswerWord = quesAnswerWord;
-    }
-
-    public String getQuesAnswerAnalysis() {
-        return quesAnswerAnalysis;
-    }
-
-    public void setQuesAnswerAnalysis(String quesAnswerAnalysis) {
-        this.quesAnswerAnalysis = quesAnswerAnalysis;
-    }
-
-    public String getQuesAnswerAnalysisWord() {
-        return quesAnswerAnalysisWord;
-    }
-
-    public void setQuesAnswerAnalysisWord(String quesAnswerAnalysisWord) {
-        this.quesAnswerAnalysisWord = quesAnswerAnalysisWord;
-    }
-
-    public List<QuesOption> getQuesOptions() {
-        return quesOptions;
-    }
-
-    public void setQuesOptions(List<QuesOption> quesOptions) {
-        this.quesOptions = quesOptions;
-    }
-
-    public List<QuesResource> getQuesResource() {
-        return quesResource;
-    }
-
-    public void setQuesResource(List<QuesResource> quesResource) {
-        this.quesResource = quesResource;
-    }
-
-    public QuesStructType getQuestionType() {
-        return questionType;
-    }
-
-    public void setQuestionType(QuesStructType questionType) {
-        this.questionType = questionType;
-    }
-
-    public String getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(String createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(String updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public List<Question> getSubQuestions() {
-        return subQuestions;
-    }
-
-    public void setSubQuestions(List<Question> subQuestions) {
-        this.subQuestions = subQuestions;
-    }
-
-    public Map<String, String> getQuesParams() {
-        return quesParams;
-    }
-
-    public void setQuesParams(Map<String, String> quesParams) {
-        this.quesParams = quesParams;
-    }
-
-    // public byte[] getQuesPkg() {
-    // return quesPkg;
-    // }
-    //
-    // public WordprocessingMLPackage getPkgObj() {
-    // if (this.quesPkg != null && this.quesPkg.length > 0) {
-    // return DocxProcessUtil.getPkg(this.quesPkg);
-    // } else {
-    // return null;
-    // }
-    //
-    // }
-    //
-    // public void setQuesPkg(byte[] quesPkg) {
-    // this.quesPkg = quesPkg;
-    // }
-
-    public Double getScore() {
-        return score;
-    }
-
-    public void setScore(Double score) {
-        this.score = score;
-    }
-
-    public String getCourseNo() {
-        return courseNo;
-    }
-
-    public void setCourseNo(String courseNo) {
-        this.courseNo = courseNo;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public String getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(String orgId) {
-        this.orgId = orgId;
-    }
-
-    public String getCourseLevel() {
-        return courseLevel;
-    }
-
-    public void setCourseLevel(String courseLevel) {
-        this.courseLevel = courseLevel;
-    }
-
-    public String getCourseMajor() {
-        return courseMajor;
-    }
-
-    public void setCourseMajor(String courseMajor) {
-        this.courseMajor = courseMajor;
-    }
-
-    public Boolean getHasAudio() {
-        return hasAudio;
-    }
-
-    public void setHasAudio(Boolean hasAudio) {
-        this.hasAudio = hasAudio;
-    }
-
-    public List<QuestionAudio> getQuestionAudios() {
-        return questionAudios;
-    }
-
-    public void setQuestionAudios(List<QuestionAudio> questionAudios) {
-        this.questionAudios = questionAudios;
-    }
-
-    public Course getCourse() {
-        return course;
-    }
-
-    public void setCourse(Course course) {
-        this.course = course;
-    }
-
-    public String getQuesName() {
-        return quesName;
-    }
-
-    public void setQuesName(String quesName) {
-        this.quesName = quesName;
-    }
-
-    public Integer getNumber() {
-        return number;
-    }
-
-    public void setNumber(Integer number) {
-        this.number = number;
-    }
-
-    public Specialty getSpecialty() {
-        return specialty;
-    }
-
-    public void setSpecialty(Specialty specialty) {
-        this.specialty = specialty;
-    }
-
-    public String getQuesPkgPathId() {
-        return quesPkgPathId;
-    }
-
-    public void setQuesPkgPathId(String quesPkgPathId) {
-        this.quesPkgPathId = quesPkgPathId;
-    }
-
-    public Boolean getPublicity() {
-        return publicity;
-    }
-
-    public void setPublicity(Boolean publicity) {
-        this.publicity = publicity;
-    }
-
-    public List<QuesProperty> getQuesProperties() {
-        return quesProperties;
-    }
-
-    public void setQuesProperties(List<QuesProperty> quesProperties) {
-        this.quesProperties = quesProperties;
-    }
-
-    public Double getDifficultyDegree() {
-        return difficultyDegree;
-    }
-
-    public void setDifficultyDegree(Double difficultyDegree) {
-        this.difficultyDegree = difficultyDegree;
-    }
-
-    public String getDifficulty() {
-        return difficulty;
-    }
-
-    public void setDifficulty(String difficulty) {
-        this.difficulty = difficulty;
-    }
-
-    public List<String> getPropertyGroup() {
-        return propertyGroup;
-    }
-
-    public void setPropertyGroup(List<String> propertyGroup) {
-        this.propertyGroup = propertyGroup;
-    }
-
-    public Map<String, String> getProperties() {
-        return properties;
-    }
-
-    public void setProperties(Map<String, String> properties) {
-        this.properties = properties;
-    }
-
-    public Boolean getIsolated() {
-        return isolated;
-    }
-
-    public void setIsolated(Boolean isolated) {
-        this.isolated = isolated;
-    }
-
-    public AnswerType getAnswerType() {
-        return answerType;
-    }
-
-    public void setAnswerType(AnswerType answerType) {
-        this.answerType = answerType;
-    }
-
-    
-    public String getQuesOptionsWord() {
-        return quesOptionsWord;
-    }
-
-    
-    public void setQuesOptionsWord(String quesOptionsWord) {
-        this.quesOptionsWord = quesOptionsWord;
-    }
-
-}

+ 0 - 119
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/QuestionAudio.java

@@ -1,119 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.util.Date;
-
-import org.apache.commons.lang3.StringUtils;
-
-/**
- * @author chenken
- * @date 2017年8月1日 上午10:56:23
- * @company QMTH
- * @description QuestionAudio.java
- */
-public class QuestionAudio extends MongoBaseEntity {
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = 6995367410867753147L;
-
-	/**
-     * 试题ID
-     */
-    private String questionId;
-
-    /**
-     * 题干OR选项
-     private AudioPositionType audioPositionType;
-
-     */
-    /**
-     * 文件名称
-     */
-    private String fileName;
-    /**
-     * 文件后缀
-     */
-    private String fileSuffixes;
-    /**
-     * 存放路径
-     */
-    private String fileUrl;
-    /**
-     * 创建时间
-     */
-    private Date createTime;
-    /**
-     * 创建人
-     */
-    private String createUser;
-
-    public QuestionAudio() {
-
-    }
-
-    public QuestionAudio(String questionId, String fileName, String fileUrl) {
-        this.questionId = questionId;
-        this.fileName = fileName;
-        if (StringUtils.isNotBlank(fileName)) {
-            this.fileSuffixes = fileName.substring(fileName.indexOf(".") + 1, fileName.length());
-        }
-        this.fileUrl = fileUrl;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getQuestionId() {
-        return questionId;
-    }
-
-    public void setQuestionId(String questionId) {
-        this.questionId = questionId;
-    }
-
-    public String getFileName() {
-        return fileName;
-    }
-
-    public void setFileName(String fileName) {
-        this.fileName = fileName;
-    }
-
-    public String getFileUrl() {
-        return fileUrl;
-    }
-
-    public void setFileUrl(String fileUrl) {
-        this.fileUrl = fileUrl;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public String getCreateUser() {
-        return createUser;
-    }
-
-    public void setCreateUser(String createUser) {
-        this.createUser = createUser;
-    }
-
-    public String getFileSuffixes() {
-        return fileSuffixes;
-    }
-
-    public void setFileSuffixes(String fileSuffixes) {
-        this.fileSuffixes = fileSuffixes;
-    }
-
-}

+ 0 - 72
src/main/java/cn/com/qmth/dp/examcloud/oe/entity/question/Specialty.java

@@ -1,72 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.entity.question;
-
-import java.util.Date;
-
-/**
- * @author weiwenhai
- * @date 2017.10.25
- * @describle 题库 专业    同步基础信息的
- */
-public class Specialty extends IdBase {
-
-    private String code;
-
-    private String name;
-
-    private Long orgId;
-
-    private Date createTime;
-
-    private Date updateTime;
-
-    private Boolean enable;
-
-    public String getCode() {
-        return code;
-    }
-
-    public void setCode(String code) {
-        this.code = code;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Long getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(Long orgId) {
-        this.orgId = orgId;
-    }
-
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(Date updateTime) {
-        this.updateTime = updateTime;
-    }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-}

+ 0 - 23
src/main/java/cn/com/qmth/dp/examcloud/oe/enums/question/ExtractPolicy.java

@@ -1,23 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.enums.question;
-
-public enum ExtractPolicy {
-
-    RANDOM_POLICY("RANDOM_PAPER", "随机抽卷");
-
-    private String key;
-    private String value;
-
-    ExtractPolicy(String key, String value) {
-        this.key = key;
-        this.value = value;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-}

+ 0 - 32
src/main/java/cn/com/qmth/dp/examcloud/oe/enums/question/PaperStatus.java

@@ -1,32 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.enums.question;
-
-/**
- * Created by songyue on 17/3/15.
- */
-public enum PaperStatus {
-
-    DRAFT(1L, "待审核"),
-    PASS(2L, "通过"),
-    NOPASS(3L, "不通过");
-
-    private Long id;
-    private String name;
-
-    PaperStatus(Long id, String name) {
-        this.id = id;
-        this.name = name;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String toString() {
-        return getName();
-    }
-
-}

+ 0 - 44
src/main/java/cn/com/qmth/dp/examcloud/oe/enums/question/PaperType.java

@@ -1,44 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.enums.question;
-
-/**
- * Created by songyue on 17/3/15.
- */
-public enum PaperType {
-    /**
-     * 导入
-     */
-    IMPORT(1L, "导入"),
-    /**
-     * 组卷
-     */
-    GENERATE(2L, "组卷"),
-    /**
-     * 调卷规则预览卷
-     */
-    PREVIEW(3L, "调卷规则预览卷"),
-    /**
-     * 考生考卷
-     */
-    STUDENT_EXAM(4L, "考生考卷");
-
-    private Long id;
-    private String name;
-
-    PaperType(Long id, String name) {
-        this.id = id;
-        this.name = name;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String toString() {
-        return getName();
-    }
-
-}

+ 0 - 77
src/main/java/cn/com/qmth/dp/examcloud/oe/enums/question/QuesStructType.java

@@ -1,77 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.enums.question;
-
-public enum QuesStructType {
-
-    /**
-     * 单选
-     */
-    SINGLE_ANSWER_QUESTION(1L, "单选", true, false),
-    /**
-     * 多选
-     */
-    MULTIPLE_ANSWER_QUESTION(2L, "多选", true, false),
-    /**
-     * 判断
-     */
-    BOOL_ANSWER_QUESTION(3L, "判断", true, false),
-    /**
-     * 填空
-     */
-    FILL_BLANK_QUESTION(4L, "填空", false, false),
-    /**
-     * 问答
-     */
-    TEXT_ANSWER_QUESTION(5L, "问答", false, false),
-    /**
-     * 套题
-     */
-    NESTED_ANSWER_QUESTION(6L, "套题", false, true);
-
-    private Long id;
-    private String name;
-    private boolean objective;//是否是客观题
-    private boolean combline;//是否是组合题
-
-    QuesStructType(Long id, String name, boolean objective, boolean combline) {
-        this.id = id;
-        this.name = name;
-        this.objective = objective;
-        this.combline = combline;
-    }
-
-    /**
-     * 通过ID获取试题类型
-     *
-     * @param id
-     * @return
-     */
-    public static QuesStructType getQuesStructTypeById(Long id) {
-        for (QuesStructType type : QuesStructType.values()) {
-            if (id.equals(type.getId())) {
-                return type;
-            }
-        }
-        return null;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public boolean isObjective() {
-        return objective;
-    }
-
-    public boolean isCombline() {
-        return combline;
-    }
-
-    public String toString() {
-        return getName();
-    }
-
-}

+ 0 - 58
src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ColumnSetting.java

@@ -1,58 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.excel;
-
-public class ColumnSetting implements Comparable<ColumnSetting> {
-
-    private String header;
-    private String getMethodName;
-    private int width;
-    private int index;
-
-    public ColumnSetting(String header, String getMethodName, int width, int index) {
-        this.header = header;
-        this.getMethodName = getMethodName;
-        this.width = width;
-        this.index = index;
-    }
-
-    public String getHeader() {
-        return header;
-    }
-
-    public void setHeader(String header) {
-        this.header = header;
-    }
-
-    public String getGetMethodName() {
-        return getMethodName;
-    }
-
-    public void setGetMethodName(String getMethodName) {
-        this.getMethodName = getMethodName;
-    }
-
-    public int getWidth() {
-        return width;
-    }
-
-    public void setWidth(int width) {
-        this.width = width;
-    }
-
-    public int getIndex() {
-        return index;
-    }
-
-    public void setIndex(int index) {
-        this.index = index;
-    }
-
-
-    @Override
-    public int compareTo(ColumnSetting columnSetting) {
-        if (index < columnSetting.getIndex())
-            return - 1 ;
-        if (index > columnSetting.getIndex())
-            return 1 ;
-        return 0 ;
-    }
-}

+ 0 - 31
src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ExcelProperty.java

@@ -1,31 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.excel;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target(ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ExcelProperty {
-	/**
-	 * 导出时列名
-	 */
-    String name() default "";
-    
-	/**
-	 * 导出时列宽
-	 */
-    int width() default 0;
-	/**
-	 * 排序
-	 */
-    int index();
-    /**
-     * 类型
-     * 0:导入(读excel)
-     * 1:导出(写excel)
-     * 2:导入&导出
-     */
-    int type() default 2;
-}

+ 0 - 76
src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ExcelUtils.java

@@ -1,76 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.excel;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-public abstract class ExcelUtils {
-
-	private Class<?> dataClass;
-	private List<ColumnSetting> columnSettings;
-
-	public ExcelUtils(Class<?> dataClass) {
-		this.dataClass = dataClass;
-		this.columnSettings = getColumnSettings(dataClass);
-	}
-
-	public Class<?> getDataClass() {
-		return dataClass;
-	}
-
-	public void setDataClass(Class<?> dataClass) {
-		this.dataClass = dataClass;
-	}
-
-	public List<ColumnSetting> getColumnSettings() {
-		return columnSettings;
-	}
-
-	public void setColumnSettings(List<ColumnSetting> columnSettings) {
-		this.columnSettings = columnSettings;
-	}
-
-	/**
-	 * 提取ExcelProperty注解类的字段信息
-	 * 
-	 * @param dataClass 需要解析 写入excel的数据类型
-	 * @return
-	 */
-	protected List<ColumnSetting> getColumnSettings(Class<?> dataClass) {
-		List<ColumnSetting> columnSettings = new ArrayList<>();
-		// 先在方法上找ExcelProperty注解
-		Method[] methods = dataClass.getDeclaredMethods();
-		for (Method method : methods) {
-			ExcelProperty exportProperty = method.getAnnotation(ExcelProperty.class);
-			if (exportProperty != null && exportProperty.name().trim().length() > 0) {
-				ColumnSetting columnSetting = new ColumnSetting(exportProperty.name(), method.getName(),
-						exportProperty.width(), exportProperty.index());
-				columnSettings.add(columnSetting);
-			}
-		}
-		// 如果方法上找不到注解,再到属性上找
-		if (columnSettings.size() == 0) {
-			Field[] fields = dataClass.getDeclaredFields();
-			for (Field field : fields) {
-				ExcelProperty exportProperty = field.getAnnotation(ExcelProperty.class);
-				if (exportProperty != null && exportProperty.name().trim().length() > 0) {
-					ColumnSetting columnSetting = new ColumnSetting(exportProperty.name(),
-							"get" + toUpperCaseFirstOne(field.getName()), exportProperty.width(),
-							exportProperty.index());
-					columnSettings.add(columnSetting);
-				}
-			}
-		}
-		Collections.sort(columnSettings);
-		return columnSettings;
-	}
-
-	private static String toUpperCaseFirstOne(String s) {
-		if (Character.isUpperCase(s.charAt(0)))
-			return s;
-		else
-			return (new StringBuilder()).append(Character.toUpperCase(s.charAt(0))).append(s.substring(1)).toString();
-	}
-}

+ 0 - 93
src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ExcelWriter.java

@@ -1,93 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.excel;
-
-import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.FillPatternType;
-import org.apache.poi.ss.usermodel.Row;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.xssf.usermodel.XSSFCellStyle;
-import org.apache.poi.xssf.usermodel.XSSFColor;
-import org.apache.poi.xssf.usermodel.XSSFRichTextString;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-
-import java.awt.Color;
-import java.io.OutputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.List;
-
-public class ExcelWriter extends ExcelUtils {
-
-	private XSSFWorkbook workbook;// 工作簿
-
-	private Sheet sheet; // 工作表
-
-	private Row row = null;// 创建一行
-
-	private Cell cell = null;
-
-	private XSSFCellStyle style;
-
-	private XSSFCellStyle style2;
-
-	public ExcelWriter(Class<?> dataClass, String sheetName) {
-		super(dataClass);
-		// 声明一个工作薄
-		// workbook = new SXSSFWorkbook(100);//使用该方法会有权限问题
-		workbook = new XSSFWorkbook();
-		// 生成一个表格
-		sheet = workbook.createSheet(sheetName);
-		// 设置表格默认列宽度为15个字节
-		sheet.setDefaultColumnWidth((short) 15);
-	}
-
-	private List<ColumnSetting> createColumnSettings() {
-		List<ColumnSetting> columnSettings = this.getColumnSettings();
-		// 产生表格标题行
-		row = sheet.createRow(0);
-		for (short i = 0; i < columnSettings.size(); i++) {
-			cell = row.createCell(i);
-			style = workbook.createCellStyle();
-			style.setFillForegroundColor(new XSSFColor(new Color(227, 239, 217)));
-			style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
-			cell.setCellStyle(style);
-			XSSFRichTextString text = new XSSFRichTextString(columnSettings.get(i).getHeader());
-			cell.setCellValue(text);
-			if (columnSettings.get(i).getWidth() > 0) {
-				sheet.setColumnWidth(i, columnSettings.get(i).getWidth() * 256);
-			}
-		}
-		return columnSettings;
-	}
-
-	/**
-	 * 写入excel
-	 *
-	 * @param dataset 数据集合
-	 * @param out     输出流
-	 * @throws SecurityException
-	 * @throws NoSuchMethodException
-	 * @throws InvocationTargetException
-	 * @throws IllegalArgumentException
-	 * @throws IllegalAccessException
-	 */
-	public void write(Collection<?> dataset, OutputStream out) throws Exception {
-		List<ColumnSetting> columnSettings = this.createColumnSettings();
-		int index = 0;
-		for (Object obj : dataset) {
-			index++;
-			row = sheet.createRow(index);// 创建行
-			// 利用反射,根据javabean属性的先后顺序,动态调用getXxx()方法得到属性值
-			for (short i = 0; i < columnSettings.size(); i++) {
-				cell = row.createCell(i);// 创建列
-				cell.setCellStyle(style2);
-				String methodName = columnSettings.get(i).getGetMethodName();
-				Method method = this.getDataClass().getMethod(methodName, new Class[] {});
-				Object value = method.invoke(obj, new Object[] {});
-				cell.setCellValue(value == null ? "" : value.toString());
-			}
-		}
-		workbook.write(out);
-	}
-
-}

+ 0 - 44
src/main/java/cn/com/qmth/dp/examcloud/oe/excel/ExportUtils.java

@@ -1,44 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.excel;
-
-import java.io.OutputStream;
-import java.net.URLEncoder;
-import java.util.Collection;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/*
- * excel导出工具
- */
-public class ExportUtils {
-
-	private static final Logger log = LoggerFactory.getLogger(ExportUtils.class);
-	
-    private static final String DEFALUT_CONTENT_TYPE = "application/vnd.ms-excel";
-
-    private static final String DEFALUT_EXT = ".xlsx";
-
-    public static void exportEXCEL(String fileName,Class<?> dataClass,
-                             Collection<?> dataset,HttpServletResponse response) throws Exception {
-    	log.debug("导出Excel开始...");
-        response.setHeader("Content-Disposition","inline;filename="+URLEncoder.encode(fileName, "UTF-8")+DEFALUT_EXT);
-        response.setContentType(DEFALUT_CONTENT_TYPE);
-        ServletOutputStream outputStream = response.getOutputStream();
-    	
-        ExcelWriter excelExporter = new ExcelWriter(dataClass,"sheet1");
-        excelExporter.write(dataset,outputStream);
-        outputStream.flush();
-        outputStream.close();
-        log.debug("导出Excel结束");
-    }
-    
-    public static void makeExcel(Class<?> dataClass,Collection<?> dataset,OutputStream outputStream ) throws Exception {
-		log.debug("生成Excel开始...");
-		ExcelWriter excelExporter = new ExcelWriter(dataClass,"sheet1");
-		excelExporter.write(dataset,outputStream);
-		log.debug("生成Excel结束");
-	}
-}

+ 0 - 165
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/cut_exam_offline_data/CutExamOfflineDataService.java

@@ -1,165 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.cut_exam_offline_data;
-
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
-import org.apache.poi.ss.formula.functions.Count;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.*;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/*
- * @Description 切割离线文件的旧数据,上线时,一次性使用,不能重复执行
- * @Author lideyin
- * @Date 2020/9/11 10:51
- * @Version 1.0
- */
-@Service
-public class CutExamOfflineDataService {
-    private static ExamCloudLog log = ExamCloudLogFactory.getLog(CutExamOfflineDataService.class);
-
-    @Autowired
-    JdbcTemplate jdbcTemplate;
-    BlockingQueue workQueue = new ArrayBlockingQueue(1000);
-    //批次数量
-    static Integer BATCH_NUMBER = 500;
-    CountDownLatch countDownLatch;
-
-    @Async
-    public void start() {
-        String sql = "select exam_record_data_id,offline_file_name,offline_file_url,update_time " +
-                "from ec_oe_exam_record_4_marking where offline_file_name is not null";
-
-        try {
-            //校验本程序是否为第一次执行,是则执行,否则抛错
-            Integer targetCount = jdbcTemplate.queryForObject(
-                    "select count(*) from ec_oe_exam_record_file_answer", Integer.class);
-            if (targetCount.intValue() > 0) {
-                log.error(String.format("[CutExamOfflineDataService] 本程序不允许重复执行!若要重复执行,请确保ec_oe_exam_record_file_answer表中无数据,当前共有%s条数据",targetCount));
-                return;
-            }
-
-            //总行数
-            Integer totalCount = jdbcTemplate.queryForObject(
-                    "select count(*) from ec_oe_exam_record_4_marking where offline_file_name is not null", Integer.class);
-            //总执行批次数
-            Integer totalBatchCount = totalCount % BATCH_NUMBER == 0
-                    ? totalCount / BATCH_NUMBER
-                    : (totalCount / BATCH_NUMBER + 1);
-            //初始化countDownLatch
-            countDownLatch = new CountDownLatch(totalBatchCount);
-
-            Connection connection = jdbcTemplate.getDataSource().getConnection();
-            //流式读取数据
-            PreparedStatement ps = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
-                    ResultSet.CONCUR_READ_ONLY);
-            ps.setFetchSize(Integer.MIN_VALUE);
-            log.info("[CutExamOfflineDataService] 开始流式读取数据....");
-            ResultSet rs = ps.executeQuery(sql);
-
-            int count = 0;
-            final AtomicInteger batchCount = new AtomicInteger(0);
-            //待插入的数据
-            List<Object[]> dataList = new ArrayList<>();
-
-            ThreadPoolExecutor executor =
-                    new ThreadPoolExecutor(4, 4, 30, TimeUnit.SECONDS, workQueue);
-            while (rs.next()) {
-                Long examRecordDataId = rs.getLong("exam_record_data_id");
-                String offlineFileName = rs.getString("offline_file_name");
-                String offlineFileUrl = rs.getString("offline_file_url");
-                String updateTime = rs.getString("update_time");
-                String creationTime = updateTime;
-                String originalFileName = offlineFileName;
-
-                String fileType = "";
-                //格式不正确的数据直接跳过
-                if (offlineFileName.indexOf(".") == -1) {
-                    String errMsg = String.format("[CutExamOfflineDataService] examRecordDataId=%s的数据有误,无扩展名.offlineFileName=%s",
-                            examRecordDataId, offlineFileName);
-                    System.out.println(errMsg);
-                    log.error(errMsg);
-                    continue;
-                }
-                fileType = offlineFileName.substring(offlineFileName.indexOf(".") + 1);
-                String suffix = fileType;
-
-                dataList.add(new Object[]
-                        {examRecordDataId, offlineFileName, originalFileName,
-                                offlineFileUrl, fileType, suffix, creationTime, updateTime});
-                count++;
-
-//                log.info("[CutExamOfflineDataService]. count=" + count);
-
-
-                //每500条数据执行一次批量插入操作
-                if (count % BATCH_NUMBER == 0) {
-                    List<Object[]> finalDataList = new ArrayList<>();
-                    finalDataList.addAll(dataList);
-                    executor.execute(new Runnable() {
-                        @Override
-                        public void run() {
-                            batchAddOfflineData(finalDataList);
-                            batchCount.incrementAndGet();
-                            log.info(String.format("[CutExamOfflineDataService] 共%s个批次,执行第%s 批次数据操作",totalBatchCount, batchCount));
-                            countDownLatch.countDown();
-                        }
-                    });
-
-                    dataList = new ArrayList<>();
-                }
-            }
-            log.info(String.format("[CutExamOfflineDataService] 数据遍历完成,多线程插入数据中...共计%s条数据,共需执行%s个批次的插入动作", count, totalBatchCount));
-
-            //剩下的最后一批次的数据单独执行
-            if (dataList.size() > 0) {
-
-                List<Object[]> finalDataList = new ArrayList<>();
-                finalDataList.addAll(dataList);
-                executor.execute(new Runnable() {
-                    @Override
-                    public void run() {
-                        batchAddOfflineData(finalDataList);
-                        batchCount.incrementAndGet();
-                        log.info(String.format("[CutExamOfflineDataService]  共%s个批次,执行第%s 批次数据操作",totalBatchCount, batchCount));
-                        countDownLatch.countDown();
-                    }
-                });
-
-            }
-            executor.shutdown();
-            log.info("[CutExamOfflineDataService] waiting child thread...........");
-            countDownLatch.await();
-            log.info("[CutExamOfflineDataService] all is over...........");
-        } catch (SQLException e) {
-            log.error("[CutExamOfflineDataService] 执行过程中出现异常",e);
-            throw new RuntimeException(e);
-        } catch (InterruptedException e) {
-            log.error("[CutExamOfflineDataService] 执行过程中出现异常",e);
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * 批量添加离线文件数据
-     *
-     * @param batchArgs
-     */
-    private void batchAddOfflineData(List<Object[]> batchArgs) {
-        String strSql = "INSERT INTO ec_oe_exam_record_file_answer " +
-                "(exam_record_data_id,file_name,original_file_name,file_url,file_type,suffix,creation_time,update_time) " +
-                "VALUES (?,?,?,?,?,?,?,?)";
-        jdbcTemplate.batchUpdate(strSql, batchArgs);
-    }
-
-
-}

+ 0 - 191
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_abnormal_boolquestion/ExportAbnormalBoolQuestionCountService.java

@@ -1,191 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.export_abnormal_boolquestion;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.bson.types.ObjectId;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.stereotype.Service;
-
-import cn.com.qmth.dp.examcloud.oe.entity.question.Paper;
-import cn.com.qmth.dp.examcloud.oe.entity.question.PaperDetail;
-import cn.com.qmth.dp.examcloud.oe.entity.question.PaperDetailUnit;
-import cn.com.qmth.dp.examcloud.oe.entity.question.Question;
-import cn.com.qmth.dp.examcloud.oe.excel.ExportUtils;
-
-/**
- * 错误的判断题小题数量
- * 
- * @author chenken
- *
- */
-@Service
-public class ExportAbnormalBoolQuestionCountService {
-	private static Map<String, String> orgMap = new HashMap<String, String>();
-	static {
-		orgMap.put("0", "启明泰和");
-		orgMap.put("1", "石油大学(北京)");
-		orgMap.put("115", "测试");
-		orgMap.put("135", "山东大学");
-		orgMap.put("136", "电子科技大学");
-		orgMap.put("137", "陕西师范大学");
-		orgMap.put("302", "天津大学");
-		orgMap.put("303", "测试大学");
-		orgMap.put("371", "西安交通大学");
-		orgMap.put("372", "武汉理工大学");
-		orgMap.put("718", "西南交通大学");
-		orgMap.put("1065", "华中科技大学");
-		orgMap.put("1226", "河南优特");
-		orgMap.put("1251", "湖北交通职业技术学院");
-		orgMap.put("1252", "武汉软件工程职业学院");
-		orgMap.put("1256", "华南师范大学");
-		orgMap.put("1347", "华中师范大学");
-		orgMap.put("1348", "福建师范大学");
-		orgMap.put("1350", "优特教育");
-		orgMap.put("1353", "奥鹏教育");
-		orgMap.put("1384", "西南财经大学");
-		orgMap.put("1385", "北京师范大学");
-		orgMap.put("1387", "中国地质大学(北京)");
-		orgMap.put("1388", "北京开放大学");
-		orgMap.put("1394", "西安电子科技大学");
-		orgMap.put("1407", "重庆大学");
-		orgMap.put("1408", "中国医科大学(奥鹏)");
-		orgMap.put("1562", "北京交通大学(奥鹏)");
-		orgMap.put("1627", "中国地质大学(武汉)");
-		orgMap.put("1680", "南开大学(奥鹏)");
-		orgMap.put("1681", "东北师范大学(奥鹏)");
-		orgMap.put("1734", "北京航空航天大学(奥鹏)");
-		orgMap.put("1745", "中国石油大学(华东)");
-		orgMap.put("1759", "教务平台(全日制)");
-		orgMap.put("1769", "地质大学(武汉)入学");
-		orgMap.put("1775", "演示-ACC");
-		orgMap.put("16197", "河南应用技术职业学院");
-		orgMap.put("16198", "中国地质大学(北京)入学");
-		orgMap.put("16358", "武汉第二轻工业学校");
-		orgMap.put("16575", "印刷机构");
-		orgMap.put("16801", "启明内考");
-		orgMap.put("16816", "华东师范大学");
-		orgMap.put("16915", "中南大学");
-		orgMap.put("16923", "IPECC-PS小学");
-		orgMap.put("16924", "IEPCC-JHS中学");
-		orgMap.put("17068", "广东开放大学");
-		orgMap.put("17129", "郑州市第四中学");
-		orgMap.put("17141", "好学优课");
-		orgMap.put("17144", "河南汇龙");
-		orgMap.put("17172", "中央音乐学院");
-		orgMap.put("17196", "江汉大学");
-		orgMap.put("17202", "武汉大学");
-		orgMap.put("17332", "华南理工大学-继教院");
-		orgMap.put("17349", "华南理工大学-本科");
-		orgMap.put("17351", "云南开放大学");
-		orgMap.put("17354", "湖北美术学院");
-		orgMap.put("17421", "河南财经政法大学");
-		orgMap.put("17426", "北京学测教育科技有限公司");
-		orgMap.put("17430", "华东师大国际合作交流中心");
-		orgMap.put("17439", "齐鲁医药学院");
-		orgMap.put("17440", "华中师范大学教务处");
-		orgMap.put("17441", "中央美术学院");
-		orgMap.put("17457", "青岛滨海学院");
-		orgMap.put("17458", "山东协和学院");
-		orgMap.put("17459", "齐鲁师范学院");
-		orgMap.put("17504", "潍坊理工学院");
-		orgMap.put("17506", "赣州职业技术学院");
-		orgMap.put("17510", "山东管理学院");
-		orgMap.put("17511", "山东现代学院");
-		orgMap.put("17512", "青岛港湾职业技术学院");
-		orgMap.put("17538", "潍坊医学院");
-		orgMap.put("17542", "北京邮电大学");
-		orgMap.put("17672", "中央民族大学");
-		orgMap.put("17673", "河南大学");
-		orgMap.put("17674", "北京语言大学");
-		orgMap.put("17682", "大连交通大学");
-		orgMap.put("17710", "中国艺术研究院");
-		orgMap.put("17781", "深圳第三职业技术学校");
-		orgMap.put("17782", "上海大学");
-		orgMap.put("17796", "中国社会科学院大学");
-		orgMap.put("17797", "西安交通大学入学考试");
-		orgMap.put("17798", "福建师范大学-学位");
-		orgMap.put("17808", "福建师范课程");
-		orgMap.put("17810", "华中师范大学心理学院");
-		orgMap.put("17905", "华中师范大学城环学院");
-		orgMap.put("17913", "深圳第三职业技术学校-入学");
-		orgMap.put("17919", "启明_测试");
-		orgMap.put("17933", "中央美术学院附属中等美术学校(央美附中)");
-		orgMap.put("18000", "南京大学网院");
-		orgMap.put("18005", "上海大学美术学院");
-		orgMap.put("18011", "齐鲁医药学院继续教育中心");
-		orgMap.put("18108", "四川农业大学");
-		orgMap.put("18410", "清华大学美术学院");
-		orgMap.put("18414", "四川农业大学wj");
-		orgMap.put("18417", "安徽邮电职业技术学院");
-		orgMap.put("18420", "中央美术学院继续教育学院");
-		orgMap.put("18428", "北京奥鹏远程教育中心有限公司");
-		orgMap.put("18462", "河南济源职业技术学院");
-
-	}
-	@Autowired
-	MongoTemplate mongoTemplate;
-
-	public void start() {
-		Date start = new Date();
-		Query query = new Query();
-		query.addCriteria(Criteria.where("questionType").is("BOOL_ANSWER_QUESTION").and("quesAnswer").exists(true).nin("正确","错误","","<p></p>"));
-		List<Question> quess=mongoTemplate.find(query, Question.class, "question");
-		if (quess != null && quess.size() > 0) {
-			List<RetDto> ret = new ArrayList<RetDto>();
-			System.out.println("total:" + quess.size());
-			int index = 0;
-			for (Question ques : quess) {
-				index++;
-				System.out.println("index:" + index);
-				RetDto dto=new RetDto(ques.getOrgId(), ques.getCourse().getName(), ques.getCourse().getCode(), ques.getQuesAnswer());
-				Query query2 = new Query();
-				query2.addCriteria(Criteria.where("question.$id").is(new ObjectId(ques.getId())));
-				PaperDetailUnit u=mongoTemplate.findOne(query2, PaperDetailUnit.class, "paperDetailUnit");
-				dto.setNumber(u.getNumber());
-				dto.setPaperName(u.getPaper().getName());
-				dto.setQuesName(u.getPaperDetail().getName());
-				dto.setOrgName(orgMap.get(ques.getOrgId()));
-				ret.add(dto);
-			}
-			FileOutputStream fos = null;
-			try {
-				File file = new File("d:/ret.xlsx");
-				if (file.exists()) {
-					file.delete();
-				}
-				file.createNewFile();
-				fos = new FileOutputStream(file);
-				ExportUtils.makeExcel(RetDto.class, ret, fos);
-			} catch (Exception e) {
-				e.printStackTrace();
-			} finally {
-				if (fos != null) {
-					try {
-						fos.close();
-					} catch (IOException e) {
-						// TODO Auto-generated catch block
-						e.printStackTrace();
-					}
-				}
-			}
-		}else {
-			System.out.println("total:0");
-		}
-		Date end = new Date();
-		System.out.println("*****************end:" + ((end.getTime() - start.getTime()) / (1000 * 60)) + "分钟");
-	}
-
-
-}

+ 0 - 79
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_abnormal_boolquestion/RetDto.java

@@ -1,79 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.export_abnormal_boolquestion;
-
-import cn.com.qmth.dp.examcloud.oe.excel.ExcelProperty;
-
-public class RetDto {
-	@ExcelProperty(name = "学校ID", width = 40, index = 1)
-	private String orgId;
-	@ExcelProperty(name = "学校名称", width = 40, index = 2)
-	private String orgName;
-	@ExcelProperty(name = "课程名称", width = 40, index = 3)
-	private String courseName;
-	@ExcelProperty(name = "课程代码", width = 40, index = 4)
-	private String courseCode;
-	@ExcelProperty(name = "试卷名称", width = 40, index = 5)
-	private String paperName;
-	@ExcelProperty(name = "大题名称", width = 40, index = 6)
-	private String quesName;
-	@ExcelProperty(name = "小题号", width = 40, index = 7)
-	private Integer number;
-	@ExcelProperty(name = "答案内容", width = 40, index = 8)
-	private String answer;
-	public String getCourseName() {
-		return courseName;
-	}
-	public void setCourseName(String courseName) {
-		this.courseName = courseName;
-	}
-	public String getCourseCode() {
-		return courseCode;
-	}
-	public void setCourseCode(String courseCode) {
-		this.courseCode = courseCode;
-	}
-	public String getQuesName() {
-		return quesName;
-	}
-	public void setQuesName(String quesName) {
-		this.quesName = quesName;
-	}
-	public String getOrgId() {
-		return orgId;
-	}
-	public void setOrgId(String orgId) {
-		this.orgId = orgId;
-	}
-	public String getOrgName() {
-		return orgName;
-	}
-	public void setOrgName(String orgName) {
-		this.orgName = orgName;
-	}
-	public String getPaperName() {
-		return paperName;
-	}
-	public void setPaperName(String paperName) {
-		this.paperName = paperName;
-	}
-	public RetDto(String orgId, String courseName, String courseCode, String answer) {
-		super();
-		this.orgId = orgId;
-		this.courseName = courseName;
-		this.courseCode = courseCode;
-		this.answer = answer;
-	}
-	public Integer getNumber() {
-		return number;
-	}
-	public void setNumber(Integer number) {
-		this.number = number;
-	}
-	public String getAnswer() {
-		return answer;
-	}
-	public void setAnswer(String answer) {
-		this.answer = answer;
-	}
-	
-	
-}

+ 0 - 64
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_data/ExportData.java

@@ -1,64 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.export_data;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Component;
-
-import com.google.common.collect.Maps;
-
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
-import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.commons.util.ResourceLoader;
-
-@Component
-public class ExportData {
-
-	private static ExamCloudLog log = ExamCloudLogFactory.getLog(ExportData.class);
-
-	private static ExamCloudLog resultlog = ExamCloudLogFactory.getLog("RESULT_LOGGER");
-
-	@Autowired
-	JdbcTemplate jdbcTemplate;
-
-	public void start() {
-		String sql = ResourceLoader.getResource("sql/export_data/export_data.sql");
-
-		try {
-			Connection connection = jdbcTemplate.getDataSource().getConnection();
-
-			PreparedStatement ps = connection.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
-					ResultSet.CONCUR_READ_ONLY);
-			ps.setFetchSize(Integer.MIN_VALUE);
-			ResultSet rs = ps.executeQuery(sql);
-
-			int count = 0;
-			while (rs.next()) {
-				Map<String, Object> map = Maps.newHashMap();
-				ResultSetMetaData metaData = rs.getMetaData();
-				int columnCount = metaData.getColumnCount();
-				for (int i = 0; i < columnCount; i++) {
-					String columnName = metaData.getColumnName(i + 1);
-					Object columnValue = rs.getObject(i + 1);
-					map.put(columnName, columnValue);
-				}
-
-				count++;
-				log.info("[ExportData]. count=" + count);
-				resultlog.info(JsonUtil.toJson(map));
-
-			}
-		} catch (SQLException e) {
-			throw new RuntimeException(e);
-		}
-
-	}
-
-}

+ 0 - 443
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/ExportExamStudentScore.java

@@ -1,443 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score;
-
-import cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo.ExamQuestionVO;
-import cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo.ExamRecordQuestionVO;
-import cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo.ExamStudentVO;
-import cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo.ScoreVO;
-import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.assertj.core.util.Lists;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Component;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * 导出 - 小题分
- */
-@Component
-public class ExportExamStudentScore {
-
-    private static Logger log = LoggerFactory.getLogger(ExportExamStudentScore.class);
-
-    private static final Long MARKING_TYPE_KEY = 24L;// 阅卷方式KEY
-
-    @Autowired
-    private JdbcTemplate jdbcTemplate;
-
-    @Autowired
-    private MongoTemplate mongoTemplate;
-
-    public void start() {
-        /*
-            待导出的“考试 <课程...课程>”列表
-            Map : <examId, <courseId...courseId>
-            示例1:<1L, 不指定任何课程时,则默认导所有课程>
-            示例2:<1L, 指定某些课程时,则只导指定的课程>
-         */
-        HashMap<Long, List<Long>> examMaps = new HashMap<>();
-
-        // examMaps.put(1L, Lists.list(1L, 2L, 3L));
-        // examMaps.put(2L, Lists.list());
-
-        this.export(examMaps);
-    }
-
-    private void export(HashMap<Long, List<Long>> examMaps) {
-        Map<Long, String> orgNameMaps = new HashMap<>(), courseNameMaps = new HashMap<>();
-
-        log.info("Total size is " + examMaps.size());
-
-        int count = 1;
-        for (Map.Entry<Long, List<Long>> entry : examMaps.entrySet()) {
-            log.info((count++) + "===> export starting, examId = " + entry.getKey());
-
-            // 获取考试下待导的课程
-            List<Long> examCourseIds;
-            if (CollectionUtils.isEmpty(entry.getValue())) {
-                // 导考试下全部课程
-                examCourseIds = this.queryExamCourseIds(entry.getKey());
-            } else {
-                // 导考试下指定课程
-                examCourseIds = entry.getValue();
-            }
-
-            log.info("---> examCourseIds size is " + examCourseIds.size());
-
-            // 获取考试的阅卷方式
-            String markingType = this.queryExamMarkingType(entry.getKey(), MARKING_TYPE_KEY);
-            log.info("---> markingType is " + markingType);
-
-            String examName = this.queryExamName(entry.getKey());
-
-            for (Long courseId : examCourseIds) {
-                // 按考试的每个课程依次导出
-                this.export(entry.getKey(), examName, courseId, markingType, orgNameMaps, courseNameMaps);
-            }
-
-            log.info("===> export finished, examId = " + entry.getKey() + "\n");
-        }
-    }
-
-    private void export(Long examId, String examName, Long courseId, String markingType, Map<Long, String> orgNameMaps, Map<Long, String> courseNameMaps) {
-        List<ExamStudentVO> examStudents = this.queryExamStudents(examId, courseId);
-        log.info(String.format("---> examId = %s, courseId = %s, examStudentSize = %s", examId, courseId, examStudents.size()));
-
-        boolean hasDynamicExcelHeaderSetting = false;
-        List<String> dynamicExcelHeaders = new ArrayList<>();// Excel动态列
-        List<String> defaultDynamicColumnValues = new ArrayList<>();// Excel动态列默认值
-        String paperStructKey = "";// 试卷结构关键值
-
-        int index = 0;
-        for (ExamStudentVO examStudent : examStudents) {
-            log.debug((++index) + "---> examStudentId is " + examStudent.getExamStudentId());
-
-            if (!orgNameMaps.containsKey(examStudent.getOrgId())) {
-                String orgName = this.queryOrgName(examStudent.getOrgId());
-                orgNameMaps.put(examStudent.getOrgId(), orgName);
-            }
-
-            if (!courseNameMaps.containsKey(examStudent.getCourseId())) {
-                String courseName = this.queryCourseName(examStudent.getCourseId());
-                courseNameMaps.put(examStudent.getCourseId(), courseName);
-            }
-
-            // 设置学习中心名称、课程名称
-            examStudent.setOrgName(orgNameMaps.get(examStudent.getOrgId()));
-            examStudent.setCourseName(courseNameMaps.get(examStudent.getCourseId()));
-
-            // 成绩默认值
-            examStudent.setObjectiveScore(0d);
-            examStudent.setSubjectiveScore(0d);
-            examStudent.setTotalScore(0d);
-
-            if (!examStudent.getFinished()) {
-                // 跳过缺考的情况
-                continue;
-            }
-
-            // 获取考试记录
-            List<Map<String, Object>> examRecordDataList = this.queryExamRecordDataList(examId, courseId, examStudent.getExamStudentId());
-            if (CollectionUtils.isEmpty(examRecordDataList)) {
-                // 跳过暂无有效考试记录的情况
-                continue;
-            }
-
-            Long okExamRecordDataId;
-            if (examRecordDataList.size() == 1) {
-                // 只有一条考试记录情况
-                okExamRecordDataId = (Long) examRecordDataList.get(0).get("id");
-
-                // 获取考试记录对应的成绩
-                ScoreVO okScore = this.queryExamScore(okExamRecordDataId);
-                examStudent.setObjectiveScore(okScore.getObjectiveScore());
-                examStudent.setSubjectiveScore(okScore.getSubjectiveScore());
-                examStudent.setTotalScore(okScore.getTotalScore());
-
-                // System.out.println("base_paper_id = " + examRecordDataList.get(0).get("base_paper_id"));
-                // db.getCollection('paper').find({_id:ObjectId("5ed67e2bc68d4c520320b5b7")})
-            } else {
-                // 多条考试记录情况
-                List<ScoreVO> scores = new ArrayList<>();
-                for (Map<String, Object> examRecordData : examRecordDataList) {
-                    Long examRecordDataId = (Long) examRecordData.get("id");
-                    // 分别获取考试记录对应的成绩
-                    ScoreVO score = this.queryExamScore(examRecordDataId);
-                    scores.add(score);
-                }
-
-                ScoreVO okScore;
-                if (markingType.equals("ALL") || markingType.equals("OBJECT_SCORE_MAX")) {
-                    // 全部评阅规则 或 客观分最高规则:取总分最高
-                    okScore = scores.stream()
-                            .sorted((obj1, obj2) -> obj2.getTotalScore().compareTo(obj1.getTotalScore()))
-                            .collect(Collectors.toList())
-                            .get(0);
-                } else {
-                    // 否则:取最后一次的成绩
-                    okScore = scores.stream()
-                            .sorted((obj1, obj2) -> obj2.getId().compareTo(obj1.getId()))
-                            .collect(Collectors.toList())
-                            .get(0);
-                }
-
-                okExamRecordDataId = okScore.getExamRecordDataId();
-                examStudent.setObjectiveScore(okScore.getObjectiveScore());
-                examStudent.setSubjectiveScore(okScore.getSubjectiveScore());
-                examStudent.setTotalScore(okScore.getTotalScore());
-            }
-
-            // 获取试题作答记录
-            ExamRecordQuestionVO questions = this.queryExamRecordQuestions(okExamRecordDataId);
-            if (questions == null || CollectionUtils.isEmpty(questions.getExamQuestionEntities())) {
-                continue;
-            }
-
-            List<ExamQuestionVO> examQuestionEntities = questions.getExamQuestionEntities();
-
-            if (!hasDynamicExcelHeaderSetting) {
-                for (ExamQuestionVO question : examQuestionEntities) {
-                    String questionType = this.convertQuestionType(question.getQuestionType());
-
-                    if ("SINGLE_CHOICE".equals(question.getQuestionType()) || "MULTIPLE_CHOICE".equals(question.getQuestionType()) || "TRUE_OR_FALSE".equals(question.getQuestionType())) {
-                        dynamicExcelHeaders.add(String.format("%s%s-%s作答", questionType, question.getMainNumber(), question.getOrder()));
-                        defaultDynamicColumnValues.add("");
-
-                        dynamicExcelHeaders.add(String.format("%s%s-%s得分", questionType, question.getMainNumber(), question.getOrder()));
-                        defaultDynamicColumnValues.add("0");
-                    } else {
-                        // 主观题不设置“作答”列
-                        dynamicExcelHeaders.add(String.format("%s%s-%s得分", questionType, question.getMainNumber(), question.getOrder()));
-                        defaultDynamicColumnValues.add("0");
-                    }
-
-                    hasDynamicExcelHeaderSetting = true;
-
-                    paperStructKey += (question.getOrder() + question.getQuestionType());
-                }
-            }
-
-            String curPaperStructKey = "";// 当前试卷结构关键值
-            List<String> curDynamicColumnValues = new ArrayList<>();// Excel动态列当前值
-            for (ExamQuestionVO question : examQuestionEntities) {
-                if ("SINGLE_CHOICE".equals(question.getQuestionType()) || "MULTIPLE_CHOICE".equals(question.getQuestionType()) || "TRUE_OR_FALSE".equals(question.getQuestionType())) {
-                    if ("TRUE_OR_FALSE".equals(question.getQuestionType())) {
-                        curDynamicColumnValues.add(this.convertTrueFalse(question.getStudentAnswer()));
-                    } else {
-                        curDynamicColumnValues.add(this.convertChar(question.getStudentAnswer()));
-                    }
-
-                    // 注:客观题得分,目前只能通过比较作答答案是否一致来确定得分
-                    String correctAnswer = question.getCorrectAnswer() != null ? question.getCorrectAnswer() : "";
-                    String studentAnswer = question.getStudentAnswer() != null ? question.getStudentAnswer() : "";
-                    if (correctAnswer.equals(studentAnswer)) {
-                        curDynamicColumnValues.add(question.getQuestionScore() != null ? question.getQuestionScore().toString() : "0");
-                    } else {
-                        curDynamicColumnValues.add("0");
-                    }
-                } else {
-                    curDynamicColumnValues.add(question.getStudentScore() != null ? question.getStudentScore().toString() : "0");
-                }
-
-                curPaperStructKey += (question.getOrder() + question.getQuestionType());
-            }
-
-            if (!curPaperStructKey.equals(paperStructKey)) {
-                String msg = String.format("考生之间存在试卷结构不一致的情况!%s-%s-%s-", examId, courseId, examStudent.getExamStudentId());
-                log.warn(msg);
-                continue;
-                // throw new StatusException("500", msg);
-            }
-
-            examStudent.setDetails(curDynamicColumnValues);
-        }
-
-        // 补全缺失的作答区
-        for (ExamStudentVO examStudent : examStudents) {
-            if (CollectionUtils.isNotEmpty(examStudent.getDetails())) {
-                continue;
-            }
-            examStudent.setDetails(defaultDynamicColumnValues);
-        }
-
-        List<String> fixedExcelHeaders = Lists.newArrayList("学习中心", "课程代码", "课程名称", "层次", "是否缺考", "身份证号", "学号", "姓名", "年级", "专业", "客观总分", "主观总分", "总分");
-        fixedExcelHeaders.addAll(dynamicExcelHeaders);
-
-        this.toExcel(examId, examName, courseId, examStudents, fixedExcelHeaders);
-
-        examStudents.clear();
-    }
-
-    private void toExcel(Long examId, String examName, Long courseId, List<ExamStudentVO> examStudents, List<String> excelHeaders) {
-        // 处理Excel
-        List<Object[]> excelRows = new ArrayList<>();
-
-        if (CollectionUtils.isNotEmpty(examStudents)) {
-            for (ExamStudentVO vo : examStudents) {
-                List<Object> rowValues = Lists.newArrayList(vo.getOrgName(), vo.getCourseCode(), vo.getCourseName(),
-                        vo.getCourseLevel(), vo.getFinished() ? "否" : "是", vo.getIdentityNumber(),
-                        vo.getStudentCode(), vo.getStudentName(), vo.getGrade(), vo.getSpecialtyName(),
-                        vo.getObjectiveScore().toString(), vo.getSubjectiveScore().toString(),
-                        vo.getTotalScore().toString());
-
-                if (CollectionUtils.isNotEmpty(vo.getDetails())) {
-                    rowValues.addAll(vo.getDetails());
-                }
-
-                excelRows.add(rowValues.toArray(new Object[rowValues.size()]));
-            }
-        }
-
-        Class<String>[] excelTypes = new Class[excelHeaders.size()];
-        for (int n = 0; n < excelHeaders.size(); n++) {
-            excelTypes[n] = String.class;
-        }
-
-        final String filePath = String.format("/home/admin/project/oe/%s_%s/exam_student_score_%s.xlsx", examId, examName, courseId);
-        ExcelWriter.write(excelHeaders.toArray(new String[excelHeaders.size()]), excelTypes, excelRows, new File(filePath));
-    }
-
-    private String queryOrgName(Long orgId) {
-        final String querySql = String.format("select name from ec_b_org where id = %s", orgId);
-        try {
-            return jdbcTemplate.queryForObject(querySql, String.class);
-        } catch (EmptyResultDataAccessException e) {
-            return "";
-        }
-    }
-
-    private String queryExamName(Long examId) {
-        final String querySql = String.format("select name from ec_e_exam where id = %s", examId);
-        try {
-            return jdbcTemplate.queryForObject(querySql, String.class);
-        } catch (EmptyResultDataAccessException e) {
-            return "";
-        }
-    }
-
-    private String queryCourseName(Long courseId) {
-        final String querySql = String.format("select name from ec_b_course where id = %s", courseId);
-        try {
-            return jdbcTemplate.queryForObject(querySql, String.class);
-        } catch (EmptyResultDataAccessException e) {
-            return "";
-        }
-    }
-
-    private List<Long> queryExamCourseIds(Long examId) {
-        final String querySql = String.format("select distinct course_id from ec_oe_exam_student where exam_id = %s and enable = 1", examId);
-        return jdbcTemplate.queryForList(querySql, Long.class);
-    }
-
-    private List<ExamStudentVO> queryExamStudents(Long examId, Long courseId) {
-        final String columns = "exam_student_id,student_code,student_name,identity_number,org_id,course_id,course_code,course_level,grade,specialty_name,finished";
-        final String querySql = String.format("select %s from ec_oe_exam_student where exam_id = %s and course_id = %s and enable = 1", columns, examId, courseId);
-        return jdbcTemplate.query(querySql, new BeanPropertyRowMapper(ExamStudentVO.class));
-    }
-
-    private String queryExamMarkingType(Long examId, Long markingTypeKey) {
-        final String querySql = String.format("select value from ec_e_exam_prop where exam_id = %s and key_id = %s", examId, markingTypeKey);
-        try {
-            String result = jdbcTemplate.queryForObject(querySql, String.class);
-            return StringUtils.isNoneBlank(result) ? result.trim() : "ALL";
-        } catch (EmptyResultDataAccessException e) {
-            return "ALL";// 默认值
-        }
-    }
-
-    private List<Map<String, Object>> queryExamRecordDataList(Long examId, Long courseId, Long examStudentId) {
-        final String columns = "id,exam_record_status,is_illegality,is_warn,is_audit,base_paper_id";
-        final String querySql = String.format("select %s from ec_oe_exam_record_data where exam_id = %s and course_id = %s and exam_student_id = %s", columns, examId, courseId, examStudentId);
-        List<Map<String, Object>> result = jdbcTemplate.queryForList(querySql);
-
-        List<Map<String, Object>> okList = new ArrayList<>();
-        if (CollectionUtils.isNotEmpty(result)) {
-            for (Map<String, Object> row : result) {
-                // 过滤考试记录状态情况
-                String examRecordStatus = (String) row.get("exam_record_status");
-                if (!"EXAM_END".equals(examRecordStatus) && !"EXAM_OVERDUE".equals(examRecordStatus)) {
-                    continue;
-                }
-
-                Boolean isIllegality = (Boolean) row.get("is_illegality");// 是否违纪
-                Boolean isWarn = (Boolean) row.get("is_warn");// 是否警告
-                Boolean isAudit = (Boolean) row.get("is_audit");// 是否被审核过
-
-                // 没有违纪的 且 (没有警告 或 有警告已审核通过的),则有效
-                if (!isIllegality && (!isWarn || (isWarn && isAudit))) {
-                    okList.add(row);
-                }
-            }
-        }
-
-        return okList;
-    }
-
-    private ScoreVO queryExamScore(Long examRecordDataId) {
-        final String querySql = String.format("select id,objective_score,subjective_score,total_score from ec_oe_exam_score where exam_record_data_id = %s", examRecordDataId);
-        List<ScoreVO> result = jdbcTemplate.query(querySql, new BeanPropertyRowMapper(ScoreVO.class));
-
-        ScoreVO score;
-        if (CollectionUtils.isNotEmpty(result)) {
-            score = result.get(0);
-        } else {
-            score = new ScoreVO();
-        }
-
-        // 默认值
-        score.setExamRecordDataId(examRecordDataId);
-        score.setObjectiveScore(score.getObjectiveScore() != null ? score.getObjectiveScore() : 0d);
-        score.setSubjectiveScore(score.getSubjectiveScore() != null ? score.getSubjectiveScore() : 0d);
-        score.setTotalScore(score.getTotalScore() != null ? score.getTotalScore() : 0d);
-
-        return score;
-    }
-
-    private ExamRecordQuestionVO queryExamRecordQuestions(Long examRecordDataId) {
-        Query query = new Query();
-        query.addCriteria(Criteria.where("examRecordDataId").is(examRecordDataId));
-        List<ExamRecordQuestionVO> result = mongoTemplate.find(query, ExamRecordQuestionVO.class, "examRecordQuestions");
-        if (CollectionUtils.isNotEmpty(result)) {
-            return result.get(0);
-        }
-        return null;
-    }
-
-    private String convertQuestionType(String type) {
-        switch (type) {
-            case "SINGLE_CHOICE":
-                return "单选题";
-            case "MULTIPLE_CHOICE":
-                return "多选题";
-            case "FILL_UP":
-                return "填空题";
-            case "TRUE_OR_FALSE":
-                return "判断题";
-            case "ESSAY":
-                return "问答题";
-            default:
-                return "";
-        }
-    }
-
-    private String convertChar(String value) {
-        if (StringUtils.isBlank(value)) {
-            return "";
-        }
-        return value.replaceAll("0", "A")
-                .replaceAll("1", "B")
-                .replaceAll("2", "C")
-                .replaceAll("3", "D")
-                .replaceAll("4", "E")
-                .replaceAll("5", "F")
-                .replaceAll("6", "G")
-                .replaceAll("7", "H")
-                .replaceAll("8", "I")
-                .replaceAll("9", "J");
-    }
-
-    private String convertTrueFalse(String value) {
-        if ("1".equals(value)) {
-            return "对";
-        } else if ("0".equals(value)) {
-            return "错";
-        } else {
-            return "";
-        }
-    }
-
-}

+ 0 - 93
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/vo/ExamQuestionVO.java

@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2020 QMTH All Rights Reserved.
- * Created by Deason on 2020-03-11 10:29:32
- */
-
-package cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo;
-
-import java.io.Serializable;
-
-public class ExamQuestionVO implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private String id;
-
-    private String questionType;
-
-    private Integer mainNumber;
-
-    private Integer order;
-
-    private String correctAnswer;
-
-    private String studentAnswer;
-
-    private Double questionScore;
-
-    private Double studentScore;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getQuestionType() {
-        return questionType;
-    }
-
-    public void setQuestionType(String questionType) {
-        this.questionType = questionType;
-    }
-
-    public Integer getMainNumber() {
-        return mainNumber;
-    }
-
-    public void setMainNumber(Integer mainNumber) {
-        this.mainNumber = mainNumber;
-    }
-
-    public Integer getOrder() {
-        return order;
-    }
-
-    public void setOrder(Integer order) {
-        this.order = order;
-    }
-
-    public String getCorrectAnswer() {
-        return correctAnswer;
-    }
-
-    public void setCorrectAnswer(String correctAnswer) {
-        this.correctAnswer = correctAnswer;
-    }
-
-    public String getStudentAnswer() {
-        return studentAnswer;
-    }
-
-    public void setStudentAnswer(String studentAnswer) {
-        this.studentAnswer = studentAnswer;
-    }
-
-    public Double getQuestionScore() {
-        return questionScore;
-    }
-
-    public void setQuestionScore(Double questionScore) {
-        this.questionScore = questionScore;
-    }
-
-    public Double getStudentScore() {
-        return studentScore;
-    }
-
-    public void setStudentScore(Double studentScore) {
-        this.studentScore = studentScore;
-    }
-}

+ 0 - 44
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/vo/ExamRecordQuestionVO.java

@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2020 QMTH All Rights Reserved.
- * Created by Deason on 2020-03-11 10:29:32
- */
-
-package cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo;
-
-import java.io.Serializable;
-import java.util.List;
-
-public class ExamRecordQuestionVO implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private String id;
-
-    private String examRecordDataId;
-
-    private List<ExamQuestionVO> examQuestionEntities;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getExamRecordDataId() {
-        return examRecordDataId;
-    }
-
-    public void setExamRecordDataId(String examRecordDataId) {
-        this.examRecordDataId = examRecordDataId;
-    }
-
-    public List<ExamQuestionVO> getExamQuestionEntities() {
-        return examQuestionEntities;
-    }
-
-    public void setExamQuestionEntities(List<ExamQuestionVO> examQuestionEntities) {
-        this.examQuestionEntities = examQuestionEntities;
-    }
-}

+ 0 - 192
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/vo/ExamStudentVO.java

@@ -1,192 +0,0 @@
-/*
- * Copyright (c) 2020 QMTH All Rights Reserved.
- * Created by Deason on 2020-03-11 10:29:32
- */
-
-package cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ExamStudentVO implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private Long examStudentId;//考生ID
-
-    private Long orgId;//学习中心ID
-
-    private String orgName;//学习中心名称
-
-    private Long courseId;//课程ID
-
-    private String courseCode;//课程代码
-
-    private String courseName;//课程名称
-
-    private String courseLevel;//课程层次
-
-    private Boolean finished;//是否缺考
-
-    private String identityNumber;//身份证号
-
-    private String studentCode;//学号
-
-    private String studentName;//姓名
-
-    private String grade;//年级
-
-    private String specialtyName;//专业
-
-    private Double objectiveScore;//客观总分
-
-    private Double subjectiveScore;//主观总分
-
-    private Double totalScore;//总分
-
-    private List<String> details;//作答明细
-
-    public void addDetail(String detail) {
-        if (this.details == null) {
-            this.details = new ArrayList<>();
-        }
-        this.details.add(detail);
-    }
-
-    public Long getExamStudentId() {
-        return examStudentId;
-    }
-
-    public void setExamStudentId(Long examStudentId) {
-        this.examStudentId = examStudentId;
-    }
-
-    public Long getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(Long orgId) {
-        this.orgId = orgId;
-    }
-
-    public String getOrgName() {
-        return orgName;
-    }
-
-    public void setOrgName(String orgName) {
-        this.orgName = orgName;
-    }
-
-    public Long getCourseId() {
-        return courseId;
-    }
-
-    public void setCourseId(Long courseId) {
-        this.courseId = courseId;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public String getCourseName() {
-        return courseName;
-    }
-
-    public void setCourseName(String courseName) {
-        this.courseName = courseName;
-    }
-
-    public String getCourseLevel() {
-        return courseLevel;
-    }
-
-    public void setCourseLevel(String courseLevel) {
-        this.courseLevel = courseLevel;
-    }
-
-    public Boolean getFinished() {
-        return finished;
-    }
-
-    public void setFinished(Boolean finished) {
-        this.finished = finished;
-    }
-
-    public String getIdentityNumber() {
-        return identityNumber;
-    }
-
-    public void setIdentityNumber(String identityNumber) {
-        this.identityNumber = identityNumber;
-    }
-
-    public String getStudentCode() {
-        return studentCode;
-    }
-
-    public void setStudentCode(String studentCode) {
-        this.studentCode = studentCode;
-    }
-
-    public String getStudentName() {
-        return studentName;
-    }
-
-    public void setStudentName(String studentName) {
-        this.studentName = studentName;
-    }
-
-    public String getGrade() {
-        return grade;
-    }
-
-    public void setGrade(String grade) {
-        this.grade = grade;
-    }
-
-    public String getSpecialtyName() {
-        return specialtyName;
-    }
-
-    public void setSpecialtyName(String specialtyName) {
-        this.specialtyName = specialtyName;
-    }
-
-    public Double getObjectiveScore() {
-        return objectiveScore;
-    }
-
-    public void setObjectiveScore(Double objectiveScore) {
-        this.objectiveScore = objectiveScore;
-    }
-
-    public Double getSubjectiveScore() {
-        return subjectiveScore;
-    }
-
-    public void setSubjectiveScore(Double subjectiveScore) {
-        this.subjectiveScore = subjectiveScore;
-    }
-
-    public Double getTotalScore() {
-        return totalScore;
-    }
-
-    public void setTotalScore(Double totalScore) {
-        this.totalScore = totalScore;
-    }
-
-    public List<String> getDetails() {
-        return details;
-    }
-
-    public void setDetails(List<String> details) {
-        this.details = details;
-    }
-}

+ 0 - 83
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_exam_student_score/vo/ScoreVO.java

@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2020 QMTH All Rights Reserved.
- * Created by Deason on 2020-03-11 10:29:32
- */
-
-package cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo;
-
-import java.io.Serializable;
-
-public class ScoreVO implements Serializable {
-
-    private static final long serialVersionUID = 1L;
-
-    private Long id;
-
-    private Long examRecordDataId;
-
-    private Double objectiveScore;
-
-    private Double subjectiveScore;
-
-    private Double totalScore;
-
-    private Double objectiveAccuracy;
-
-    private Double succPercent;
-
-    public Double getObjectiveAccuracy() {
-        return objectiveAccuracy;
-    }
-
-    public void setObjectiveAccuracy(Double objectiveAccuracy) {
-        this.objectiveAccuracy = objectiveAccuracy;
-    }
-
-    public Double getSuccPercent() {
-        return succPercent;
-    }
-
-    public void setSuccPercent(Double succPercent) {
-        this.succPercent = succPercent;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getExamRecordDataId() {
-        return examRecordDataId;
-    }
-
-    public void setExamRecordDataId(Long examRecordDataId) {
-        this.examRecordDataId = examRecordDataId;
-    }
-
-    public Double getObjectiveScore() {
-        return objectiveScore;
-    }
-
-    public void setObjectiveScore(Double objectiveScore) {
-        this.objectiveScore = objectiveScore;
-    }
-
-    public Double getSubjectiveScore() {
-        return subjectiveScore;
-    }
-
-    public void setSubjectiveScore(Double subjectiveScore) {
-        this.subjectiveScore = subjectiveScore;
-    }
-
-    public Double getTotalScore() {
-        return totalScore;
-    }
-
-    public void setTotalScore(Double totalScore) {
-        this.totalScore = totalScore;
-    }
-}

+ 0 - 13
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_questions_count/ExportQuesConsumer.java

@@ -1,13 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.export_questions_count;
-
-import cn.com.qmth.dp.examcloud.oe.multithread.Consumer;
-
-public class ExportQuesConsumer extends Consumer {
-
-	@Override
-	public void consume(Object t) {
-		// TODO Auto-generated method stub
-		
-	}
-
-}

+ 0 - 15
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_questions_count/ExportQuesProducer.java

@@ -1,15 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.export_questions_count;
-
-import java.util.Map;
-
-import cn.com.qmth.dp.examcloud.oe.multithread.Producer;
-
-public class ExportQuesProducer extends Producer {
-
-	@Override
-	protected void produce(Map<String, Object> param) throws Exception {
-		// TODO Auto-generated method stub
-
-	}
-
-}

+ 0 - 190
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_questions_count/ExportQuestionsCountService.java

@@ -1,190 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.export_questions_count;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.stereotype.Service;
-
-import cn.com.qmth.dp.examcloud.oe.entity.question.Paper;
-import cn.com.qmth.dp.examcloud.oe.entity.question.PaperDetail;
-import cn.com.qmth.dp.examcloud.oe.excel.ExportUtils;
-
-/**大题下小题数量
- * @author chenken
- *
- */
-@Service
-public class ExportQuestionsCountService {
-
-	@Autowired
-	MongoTemplate mongoTemplate;
-
-	public void start() {
-		Date start=new Date();
-		Query query = new Query();
-		query.addCriteria(Criteria.where("orgId").is("1627").and("paperType").is("GENERATE"));
-		List<Paper> ps = mongoTemplate.find(query, Paper.class, "paper");
-		if (ps != null&&ps.size()>0) {
-			List<String> course= readCourseCode();
-			Map<String, String> courseMap = course.stream().collect(Collectors.toMap(a -> a, a -> a,(k1,k2)->k1));
-			List<Paper> psRet=new ArrayList<>();
-			for (Paper paper : ps) {
-				if(paper.getName().indexOf("2019题源")!=-1&&courseMap.get(paper.getCourseNo())!=null) {
-					psRet.add(paper);
-				}
-			}
-			if (psRet != null&&psRet.size()>0) {
-				Map<String,RetDto> map=new HashMap<>();
-				System.out.println("total:" + psRet.size());
-				int index = 0;
-				for (Paper paper : psRet) {
-					index++;
-					System.out.println("index:" + index);
-					String cName=paper.getCourseName();
-					String cCode=paper.getCourseNo();
-					Query query2 = new Query();
-					query2.addCriteria(Criteria.where("paper.$id").is(paper.getId()));
-//					query2.addCriteria(Criteria.where("paper.$id").is(new ObjectId(paper.getId())));
-					List<PaperDetail> ds = mongoTemplate.find(query2, PaperDetail.class, "paperDetail");
-					if (ds != null&&ds.size()>0) {
-						for (PaperDetail detail : ds) {
-							String qName=detail.getName();
-							Integer count=detail.getUnitCount();
-							String key=cCode+"_"+qName;
-							RetDto dto=map.get(key);
-							if(dto==null) {
-								dto=new RetDto(cName, cCode, qName,0);
-								map.put(key, dto);
-							}
-							dto.setCount(dto.getCount()+count);
-						}
-					}
-				}
-				
-				List<RetDto> ret= new ArrayList<RetDto>();
-				for(RetDto tem:map.values()) {
-					ret.add(tem);
-				}
-				Collections.sort(ret, new Comparator<RetDto>() {
-					@Override
-					public int compare(RetDto o1, RetDto o2) {
-						String c1 = o1.getCourseCode();
-						String c2 = o2.getCourseCode();
-						return c1.compareTo(c2);
-					}
-	
-				});
-				FileOutputStream fos=null;
-				try {
-					File file = new File("d:/ret.xlsx");
-					if(file.exists()) {
-						file.delete();
-					}
-					file.createNewFile();
-					fos = new FileOutputStream(file);
-					ExportUtils.makeExcel(RetDto.class, ret, fos);
-				} catch (Exception e) {
-					e.printStackTrace();
-				} finally {
-					if(fos!=null) {
-						try {
-							fos.close();
-						} catch (IOException e) {
-							// TODO Auto-generated catch block
-							e.printStackTrace();
-						}
-					}
-				}
-			}else {
-				System.out.println("total:" + 0);
-			}
-		}else {
-			System.out.println("total:" + 0);
-		}
-		
-		Date end=new Date();
-		System.out.println("*****************end:" +((end.getTime()-start.getTime())/(1000*60))+"分钟");
-	}
-	
-	private List<String> readCourseCode() {
-		List<String> list = new ArrayList<String>();
-		XSSFWorkbook wb = null;
-		try {
-			wb = new XSSFWorkbook("d:\\CourseCode.xlsx");
-			XSSFSheet sheet = wb.getSheetAt(0);
-			int rows = sheet.getLastRowNum();
-			for (int i = 1; i <= rows; i++) {
-				XSSFRow row = sheet.getRow(i);
-				list.add(row.getCell(1).getStringCellValue());
-			}
-		} catch (IOException e) {
-			e.printStackTrace();
-		} finally {
-			if (wb != null) {
-				try {
-					wb.close();
-				} catch (IOException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				}
-			}
-		}
-		return list;
-	}
-
-//	public static void main(String[] args) {
-//		List<RetDto> ret= new ArrayList<RetDto>();
-//		ret.add(new RetDto("cName1", "cCode1", "qName1",21));
-//		ret.add(new RetDto("cName2", "cCode2", "qName2",22));
-//		ret.add(new RetDto("cName3", "cCode3", "qName3",23));
-//		ret.add(new RetDto("cName4", "cCode4", "qName4",24));
-//		ret.add(new RetDto("cName5", "cCode7", "qName5",25));
-//		ret.add(new RetDto("cName1", "cCode1", "qName2",21));
-//		Collections.sort(ret, new Comparator<RetDto>() {
-//			@Override
-//			public int compare(RetDto o1, RetDto o2) {
-//				String c1 = o1.getCourseCode();
-//				String c2 = o2.getCourseCode();
-//				return c1.compareTo(c2);
-//			}
-//
-//		});
-//		FileOutputStream fos=null;
-//		try {
-//			File file = new File("d:/ret.xlsx");
-//			if(file.exists()) {
-//				file.delete();
-//			}
-//			file.createNewFile();
-//			fos = new FileOutputStream(file);
-//			ExportUtils.makeExcel(RetDto.class, ret, fos);
-//		} catch (Exception e) {
-//			e.printStackTrace();
-//		} finally {
-//			if(fos!=null) {
-//				try {
-//					fos.close();
-//				} catch (IOException e) {
-//					// TODO Auto-generated catch block
-//					e.printStackTrace();
-//				}
-//			}
-//		}
-//	}
-}

+ 0 - 47
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/export_questions_count/RetDto.java

@@ -1,47 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.export_questions_count;
-
-import cn.com.qmth.dp.examcloud.oe.excel.ExcelProperty;
-
-public class RetDto {
-	@ExcelProperty(name = "课程名称", width = 40, index = 1)
-	private String courseName;
-	@ExcelProperty(name = "课程代码", width = 40, index = 2)
-	private String courseCode;
-	@ExcelProperty(name = "大题名称", width = 40, index = 3)
-	private String quesName;
-	@ExcelProperty(name = "小题数量", width = 40, index = 3)
-	private int count=0;
-	public String getCourseName() {
-		return courseName;
-	}
-	public void setCourseName(String courseName) {
-		this.courseName = courseName;
-	}
-	public String getCourseCode() {
-		return courseCode;
-	}
-	public void setCourseCode(String courseCode) {
-		this.courseCode = courseCode;
-	}
-	public String getQuesName() {
-		return quesName;
-	}
-	public void setQuesName(String quesName) {
-		this.quesName = quesName;
-	}
-	public int getCount() {
-		return count;
-	}
-	public void setCount(int count) {
-		this.count = count;
-	}
-	public RetDto(String courseName, String courseCode, String quesName, int count) {
-		super();
-		this.courseName = courseName;
-		this.courseCode = courseCode;
-		this.quesName = quesName;
-		this.count = count;
-	}
-	
-	
-}

+ 0 - 187
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_continued_count/GetStudentContinutedCountService.java

@@ -1,187 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.get_continued_count;
-
-import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
-import cn.com.qmth.examcloud.support.examing.ExamRecordData;
-import cn.com.qmth.examcloud.web.redis.RedisClient;
-import com.google.common.collect.Lists;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Service;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @Description 获取考生断点次数
- * @Author lideyin
- * @Date 2020/7/7 11:17
- * @Version 1.0
- */
-@Service
-public class GetStudentContinutedCountService {
-
-    @Autowired
-    JdbcTemplate jdbcTemplate;
-
-    @Autowired
-    MongoTemplate mongoTemplate;
-
-    @Autowired
-    RedisTemplate<String, Object> redisTemplate;
-    @Autowired
-    RedisClient redisClient;
-
-    public void start(Long examId) throws Exception {
-        System.out.println("开始初始化数据...");
-        List<Map<String, Object>> examStudentList = getExamStudentList(examId);
-
-        //已同步的考试记录数据
-        Map<Long, Integer> syncedDataMap = getFinalExamRecordContinuedCountList(examId);
-
-        System.out.println("初始化数据完成,准备导出数据...");
-        int stuTotal = examStudentList.size();
-        int i = 0;
-        for (Map<String, Object> map : examStudentList) {
-            i++;
-            Long ss = System.currentTimeMillis();
-            System.out.println("stuTotal: " + stuTotal + "; count: " + i);
-            Long examRecordDataId = (Long) map.get("exam_record_data_id");
-            String examRecordDataKey = String.format("OE_ERD:%s", examRecordDataId);
-            Long st = System.currentTimeMillis();
-//            Object oData = redisTemplate.opsForValue().get(examRecordDataKey);
-            ExamRecordData erd = redisClient.get(examRecordDataKey,ExamRecordData.class);
-            System.out.println(String.format("%s:.1.redis中取数据耗时:%s ms",i,(System.currentTimeMillis()-st)));
-
-            //缓存中有数据则从缓存中取数据,没有则从数据库中取
-            if (erd != null) {
-                Integer continuedCount = erd.getContinuedCount();
-                if (continuedCount == null) {
-                    continuedCount = 0;
-                }
-                map.put("continued_count", continuedCount);
-            }
-            //从正式库中取数据
-            else {
-
-                st = System.currentTimeMillis();
-                Integer continuedCount = syncedDataMap.get(examRecordDataId);
-                System.out.println(String.format("%s:.2.map中取断点数耗时:%s ms",i,(System.currentTimeMillis()-st)));
-
-                //从已同步的缓存 中找不到则再从库中实时取,
-                if (null == continuedCount) {
-                    map.put("continued_count", getFinalContinuedCount(examRecordDataId));
-                }
-                //直接从已同步的缓存中取
-                else {
-                    st = System.currentTimeMillis();
-                    map.put("continued_count", continuedCount);
-                    System.out.println(String.format("%s:.3.结果map中放数据耗时:%s ms",i,(System.currentTimeMillis()-st)));
-                }
-            }
-        }
-
-        System.out.println("准备导出数据完成,开始导出...");
-
-        List<Object[]> datas = Lists.newArrayList();
-        int total = examStudentList.size();
-        int count = 0;
-        for (Map<String, Object> cur : examStudentList) {
-            count++;
-            System.out.println("total: " + total + "; count: " + count);
-            String student_name = String.valueOf(cur.get("student_name"));
-            String student_code = String.valueOf(cur.get("student_code"));
-            String identity_number = String.valueOf(cur.get("identity_number"));
-            String exam_record_data_id = String.valueOf(cur.get("exam_record_data_id"));
-            String start_time = String.valueOf(cur.get("start_time"));
-            String course_code = String.valueOf(cur.get("course_code"));
-            String course_name = String.valueOf(cur.get("course_name"));
-            String continued_count = String.valueOf(cur.get("continued_count"));
-
-
-            Object[] row = new Object[]{student_name, student_code, identity_number,
-                    exam_record_data_id, start_time, course_code, course_name, continued_count};
-
-            datas.add(row);
-        }
-
-
-        String filePath = PropertiesUtil.getString("file.export.path", "/home/admin")+ "/student-continuedCount-" + examId + ".xlsx";
-
-        final String[] EXCEL_HEADER = new String[]{"姓名", "学号", "身份证号",
-                "考试记录id", "开考时间", "课程代码", "课程名称", "断点次数"};
-
-        ExcelWriter.write(EXCEL_HEADER, new Class[]
-
-                {
-                        String.class, String.class, String.class, String.class,
-                        String.class, String.class, String.class, String.class
-                }, datas, new
-
-                File(filePath));
-
-        System.out.println("OVER !   examId=" + examId);
-    }
-
-    private List<Map<String, Object>> getExamStudentList(Long examId) {
-        String sql = "select  " +
-                "t2.student_name,t2.student_code,t2.identity_number,t1.id as exam_record_data_id, t1.start_time, " +
-                "t2.course_code,t3.`name` as course_name " +
-                "from ec_oes_exam_record_data t1 " +
-                "inner join ec_oe_exam_student t2 on t1.exam_student_id=t2.exam_student_id " +
-                "inner join ec_b_course t3 on t1.course_id=t3.id " +
-                "where t1.exam_id=?";
-        Object[] args = new Object[]{examId};
-        return jdbcTemplate.queryForList(sql, args);
-    }
-
-    /**
-     * 获取已同步的考试下的所有断点次数
-     *
-     * @param examId
-     * @return
-     */
-    private Map<Long, Integer> getFinalExamRecordContinuedCountList(Long examId) {
-        String sql = "select t2.cache_id, t1.continued_count from ec_oe_exam_record_data t1\n" +
-                "inner join ec_oe_exam_record_data_sync t2 on t1.id=t2.db_id\n" +
-                "where t1.exam_id=?";
-        Object[] args = new Object[]{examId};
-        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql, args);
-        if (null == mapList || mapList.isEmpty()) {
-            return new HashMap<>();
-        }
-
-        Map<Long, Integer> resultMap = new HashMap<>();
-        for (Map<String, Object> map : mapList) {
-            Integer continued_count = map.get("continued_count") == null
-                    ? 0
-                    : Integer.valueOf(map.get("continued_count").toString());
-            resultMap.put(Long.valueOf(map.get("cache_id").toString()), continued_count);
-        }
-
-        return resultMap;
-    }
-
-    /**
-     * 获取已同步的考试下的所有断点次数
-     *
-     * @param cacheId
-     * @return
-     */
-    private Integer getFinalContinuedCount(Long cacheId) {
-        String sql = "select t1.continued_count from ec_oe_exam_record_data t1\n" +
-                "inner join ec_oe_exam_record_data_sync t2 on t1.id=t2.db_id\n" +
-                "where t1.cache_id=?";
-        Object[] args = new Object[]{cacheId};
-        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql, args);
-        if (null == mapList || mapList.isEmpty()) {
-            return 0;
-        }
-
-        return Integer.valueOf(mapList.get(0).get("continued_count").toString());
-    }
-}

+ 0 - 174
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_by_identity_number/GetStduentAnswerByIdentityNumberService.java

@@ -1,174 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.get_student_answer_by_identity_number;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.bson.Document;
-import org.jsoup.Jsoup;
-import org.jsoup.safety.Whitelist;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.DataAccessException;
-import org.springframework.data.mongodb.core.DocumentCallbackHandler;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import com.google.common.collect.Lists;
-import com.mongodb.MongoException;
-
-import cn.com.qmth.examcloud.commons.helpers.ObjectHolder;
-import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
-import cn.com.qmth.examcloud.commons.util.ResourceLoader;
-
-/**
- * 获取一个考生的作答明细
- *
- * @author WANGWEI
- * @date 2019年7月11日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Service
-public class GetStduentAnswerByIdentityNumberService {
-
-	@Autowired
-	JdbcTemplate jdbcTemplate;
-
-	@Autowired
-	MongoTemplate mongoTemplate;
-
-	private int sqlIndex = 1;
-
-	// @Async
-	public void start(Long examId, String courseCode, String identityNumber) throws Exception {
-		String packageName = this.getClass().getPackage().getName();
-		String packagePath = packageName.replaceAll("\\.", "/");
-		String sql = ResourceLoader
-				.getResource(packagePath + "/query_exam_record_data_" + sqlIndex + ".sql");
-		Object[] args = new Object[]{examId, courseCode, identityNumber};
-		List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, args);
-
-		List<Long> examRecordDataIdList = Lists.newArrayList();
-
-		for (Map<String, Object> map : result) {
-			Long examRecordDataId = (Long) map.get("EXAM_RECORD_DATA_ID");
-			String curIdentityNumber = (String) map.get("IDENTITY_NUMBER");
-			String curCourseCode = (String) map.get("CODE");
-
-			if (!curCourseCode.equals(courseCode)) {
-				throw new RuntimeException("unexpected exception. courseCode=" + courseCode);
-			}
-
-			if (!curIdentityNumber.equals(identityNumber)) {
-				throw new RuntimeException("unexpected exception. courseCode=" + courseCode);
-			}
-
-			examRecordDataIdList.add(examRecordDataId);
-		}
-
-		List<Object[]> datas = Lists.newArrayList();
-
-		for (Long cur : examRecordDataIdList) {
-
-			List<Document> answers = getAnswers(cur);
-
-			for (Document doc : answers) {
-				Integer order = doc.getInteger("order");
-				Double studentScore = doc.getDouble("studentScore");
-				String questionId = doc.getString("questionId");
-				String studentAnswer = doc.getString("studentAnswer");
-				String questionType = doc.getString("questionType");
-
-				if (null == order) {
-					throw new RuntimeException("order is null. examRecordDataId=" + cur);
-				}
-
-				if (null == questionType) {
-					throw new RuntimeException(
-							"questionType is null. examRecordDataId=" + cur + "; order=" + order);
-				}
-
-				if (null == studentScore) {
-					// 无作答时,0分
-					if (StringUtils.isBlank(studentAnswer)) {
-						studentScore = 0D;
-					}
-				}
-
-				if (null != studentAnswer && !studentAnswer.contains("<img")) {
-					studentAnswer = Jsoup.clean(studentAnswer, Whitelist.simpleText());
-				}
-
-				if (null != studentAnswer) {
-					if (questionType.equals("SINGLE_CHOICE")
-							|| questionType.equals("MULTIPLE_CHOICE")) {
-						studentAnswer = studentAnswer.replaceAll("0", "A");
-						studentAnswer = studentAnswer.replaceAll("1", "B");
-						studentAnswer = studentAnswer.replaceAll("2", "C");
-						studentAnswer = studentAnswer.replaceAll("3", "D");
-						studentAnswer = studentAnswer.replaceAll("4", "E");
-						studentAnswer = studentAnswer.replaceAll("5", "F");
-						studentAnswer = studentAnswer.replaceAll("6", "G");
-						studentAnswer = studentAnswer.replaceAll("7", "H");
-						studentAnswer = studentAnswer.replaceAll("8", "I");
-					}
-				}
-
-				Object[] row = new Object[]{identityNumber, courseCode, String.valueOf(cur),
-						String.valueOf(order), questionId, studentAnswer,
-						null != studentScore ? String.valueOf(studentScore) : null};
-
-				datas.add(row);
-			}
-
-		}
-
-		String filePath = "D:/Temp/answers-" + examId + "-" + courseCode + "-" + identityNumber
-				+ ".xlsx";
-
-		final String[] EXCEL_HEADER = new String[]{"身份证号码", "课程代码", "考试记录ID", "题号", "题目ID", "答案",
-				"分数"};
-
-		ExcelWriter
-				.write(EXCEL_HEADER,
-						new Class[]{String.class, String.class, String.class, String.class,
-								String.class, String.class, String.class},
-						datas, new File(filePath));
-
-		System.out.println("OVER !   identityNumber=" + identityNumber);
-	}
-
-	/**
-	 * 获取作答
-	 *
-	 * @author WANGWEI
-	 * @param examRecordDataId
-	 * @return
-	 */
-	private List<Document> getAnswers(Long examRecordDataId) {
-		Query query = Query.query(Criteria.where("examRecordDataId").is(examRecordDataId));
-		final ObjectHolder<List<Document>> answersHolder = new ObjectHolder<List<Document>>(null);
-		mongoTemplate.executeQuery(query, "examRecordQuestions", new DocumentCallbackHandler() {
-
-			@SuppressWarnings("unchecked")
-			@Override
-			public void processDocument(Document document)
-					throws MongoException, DataAccessException {
-				List<Document> answers = (List<Document>) document.get("examQuestionEntities");
-				answersHolder.set(answers);
-			}
-		});
-
-		List<Document> answers = answersHolder.get();
-		return answers;
-	}
-
-	public void setSqlIndex(int sqlIndex) {
-		this.sqlIndex = sqlIndex;
-	}
-
-}

+ 0 - 1
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_by_identity_number/package-info.java

@@ -1 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.get_student_answer_by_identity_number;

+ 0 - 14
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_by_identity_number/query_exam_record_data_1.sql

@@ -1,14 +0,0 @@
-SELECT
-	t1.identity_number,
-	t2.id AS exam_record_data_id,
-	t4.`code` 
-FROM
-	ec_oe_exam_record t1
-	LEFT JOIN ec_oe_exam_record_data t2 ON t1.id = t2.exam_record_id
-	LEFT JOIN ec_b_course t4 ON t4.id = t1.course_id 
-WHERE
-	(( t2.is_warn = 0 ) OR ( t2.is_warn = 1 AND t2.is_audit = 1 ) ) 
-	AND t2.exam_record_status != 'EXAM_INVALID' 
-	AND t1.exam_id = ? 
-	AND t4.`code` = ?
-	AND t1.identity_number = ?

+ 0 - 297
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/GetStduentAnswerDetailService.java

@@ -1,297 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.get_student_answer_detail;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.bson.Document;
-import org.jsoup.Jsoup;
-import org.jsoup.safety.Whitelist;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.DataAccessException;
-import org.springframework.data.mongodb.core.DocumentCallbackHandler;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.common.collect.Sets;
-import com.mongodb.MongoException;
-
-import cn.com.qmth.examcloud.commons.helpers.ObjectHolder;
-import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
-import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.commons.util.ResourceLoader;
-
-/**
- * 获取考生作答明细
- *
- * @author WANGWEI
- * @date 2019年7月11日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Service
-public class GetStduentAnswerDetailService {
-
-	@Autowired
-	JdbcTemplate jdbcTemplate;
-
-	@Autowired
-	MongoTemplate mongoTemplate;
-
-	private int sqlIndex = 1;
-
-	private boolean mustHaveScore = false;
-
-	public void start(Long examId, String... courseCodeLIst) throws Exception {
-		for (String courseCode : courseCodeLIst) {
-			start(examId, courseCode);
-		}
-	}
-
-	@Async
-	public void start(Long examId, String courseCode) throws Exception {
-		String packageName = this.getClass().getPackage().getName();
-		String packagePath = packageName.replaceAll("\\.", "/");
-
-		// cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/query_exam_record_data_1.sql
-		// String sql = ResourceLoader.getResource(packagePath + "/query_exam_record_data_" + sqlIndex + ".sql");
-
-		String sql="SELECT " +
-				"t1.identity_number, " +
-				" t1.id AS exam_record_data_id, " +
-				"t3.total_score as score, " +
-				"t4.`code`  " +
-				"FROM " +
-				"ec_oe_exam_record_data t1 " +
-				"LEFT JOIN ec_oe_exam_score t3 ON t3.exam_record_data_id =  t1.id " +
-				"LEFT JOIN ec_b_course t4 ON t4.id = t1.course_id  " +
-				"WHERE " +
-				"((  t1.is_warn = 0 ) OR (  t1.is_warn = 1 AND  t1.is_audit = 1 ) )  " +
-				"AND  t1.exam_record_status != 'EXAM_INVALID'  " +
-				"AND t1.exam_id = ?  " +
-				"AND t4.`code` = ?";
-		Object[] args = new Object[]{examId, courseCode};
-		List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, args);
-
-		Map<String, Double> maxScoreOf = Maps.newHashMap();
-		Map<String, Long> examRecordDataIdOf = Maps.newHashMap();
-		Map<Long, String> identityNumberOf = Maps.newHashMap();
-
-		for (Map<String, Object> map : result) {
-			Long examRecordDataId = (Long) map.get("EXAM_RECORD_DATA_ID");
-			Double score = (Double) map.get("SCORE");
-			String identityNumber = (String) map.get("IDENTITY_NUMBER");
-			String curCourseCode = (String) map.get("CODE");
-
-			if (null == score) {
-				throw new RuntimeException("score is null. examRecordDataId=" + examRecordDataId);
-			}
-
-			if (!curCourseCode.equals(courseCode)) {
-				throw new RuntimeException("unexpected exception. courseCode=" + courseCode);
-			}
-
-			identityNumberOf.put(examRecordDataId, identityNumber);
-
-			Double maxScore = maxScoreOf.get(identityNumber);
-			if (null == maxScore || maxScore <= score) {
-				examRecordDataIdOf.put(identityNumber, examRecordDataId);
-				maxScoreOf.put(identityNumber, score);
-			}
-		}
-
-		List<Long> examRecordDataIdList = new ArrayList<>(examRecordDataIdOf.values());
-
-		List<Object[]> datas = Lists.newArrayList();
-
-		List<Object[]> noStudentScoreList = Lists.newArrayList();
-
-		int total = examRecordDataIdList.size();
-		int count = 0;
-		for (Long cur : examRecordDataIdList) {
-			count++;
-			System.out.println("total: " + total + "; count: " + count);
-
-			List<Document> answers = getAnswers(cur);
-
-			String identityNumber = identityNumberOf.get(cur);
-
-			for (Document doc : answers) {
-				Integer order = doc.getInteger("order");
-				Double studentScore = doc.getDouble("studentScore");
-				Double questionScore = doc.getDouble("questionScore");
-				String questionId = doc.getString("questionId");
-				String studentAnswer = doc.getString("studentAnswer");
-				String correctAnswer = doc.getString("correctAnswer");
-				String questionType = doc.getString("questionType");
-
-				if (null == order) {
-					throw new RuntimeException("order is null. examRecordDataId=" + cur);
-				}
-
-				if (null == questionType) {
-					throw new RuntimeException(
-							"questionType is null. examRecordDataId=" + cur + "; order=" + order);
-				}
-
-				if (null == studentScore) {
-					// 无作答时,0分
-					if (StringUtils.isBlank(studentAnswer)) {
-						studentScore = 0D;
-					}
-					// 计算分数
-					else {
-
-						if (null == questionScore) {
-							throw new RuntimeException("questionScore is null. examRecordDataId="
-									+ cur + ";courseCode=" + courseCode + ";order=" + order);
-						}
-
-						// 客观题
-						if (questionType.equals("SINGLE_CHOICE")
-								|| questionType.equals("MULTIPLE_CHOICE")
-								|| questionType.equals("TRUE_OR_FALSE")) {
-
-							// 无正确答案时
-							if (StringUtils.isBlank(correctAnswer)) {
-								noStudentScoreList.add(new Object[]{cur, courseCode, order});
-								studentScore = null;
-							}
-							// 有正确答案时
-							else {
-								if (correctAnswer.equals(studentAnswer)) {
-									studentScore = questionScore;
-								} else {
-									studentScore = 0D;
-								}
-							}
-
-						}
-						// 主观题
-						else if (questionType.equals("FILL_UP") || questionType.equals("ESSAY")) {
-							noStudentScoreList.add(new Object[]{cur, courseCode, order});
-							studentScore = null;
-						} else {
-							throw new RuntimeException("unknow questionType. questionType="
-									+ questionType + "; examRecordDataId=" + cur + ";courseCode="
-									+ courseCode + ";order=" + order);
-						}
-
-					}
-				}
-
-				if (null != studentAnswer && !studentAnswer.contains("<img")) {
-					studentAnswer = Jsoup.clean(studentAnswer, Whitelist.simpleText());
-				}
-
-				//TEMP TODO 用完即删除
-//				if (null != studentAnswer) {
-//					if (questionType.equals("SINGLE_CHOICE")
-//							|| questionType.equals("MULTIPLE_CHOICE")) {
-//						studentAnswer = studentAnswer.replaceAll("0", "A");
-//						studentAnswer = studentAnswer.replaceAll("1", "B");
-//						studentAnswer = studentAnswer.replaceAll("2", "C");
-//						studentAnswer = studentAnswer.replaceAll("3", "D");
-//						studentAnswer = studentAnswer.replaceAll("4", "E");
-//						studentAnswer = studentAnswer.replaceAll("5", "F");
-//						studentAnswer = studentAnswer.replaceAll("6", "G");
-//						studentAnswer = studentAnswer.replaceAll("7", "H");
-//						studentAnswer = studentAnswer.replaceAll("8", "I");
-//					}
-//				}
-
-				Object[] row = new Object[]{identityNumber, courseCode, String.valueOf(order),
-						questionId, studentAnswer, String.valueOf(studentScore)};
-
-				datas.add(row);
-			}
-
-		}
-
-		if (CollectionUtils.isNotEmpty(noStudentScoreList)) {
-			System.out.println("无分数 ============>");
-			Set<Long> examRecordDataIdSet = Sets.newHashSet();
-			for (Object[] objects : noStudentScoreList) {
-				examRecordDataIdSet.add((Long) objects[0]);
-				System.out.println(JsonUtil.toJson(objects));
-			}
-
-//			String sql4QueryExamStudentInfo = ResourceLoader
-//					.getResource(packagePath + "/query_exam_student_info.sql");
-			String sql4QueryExamStudentInfo=
-					"SELECT t1.student_name, t1.identity_number, " +
-					"( SELECT x.`code` FROM ec_b_course x WHERE x.id = t1.course_id ) AS course_code  " +
-					"FROM " +
-					" ec_oe_exam_record_data t1 " +
-					"WHERE " +
-					"t1.id IN ($$)";
-
-			String ids = StringUtils.join(examRecordDataIdSet, ",");
-			sql4QueryExamStudentInfo = sql4QueryExamStudentInfo.replace("$$", ids);
-
-			List<Map<String, Object>> studentInfoList = jdbcTemplate
-					.queryForList(sql4QueryExamStudentInfo);
-
-			for (Map<String, Object> curStudent : studentInfoList) {
-				System.out.println(JsonUtil.toJson(curStudent));
-			}
-
-			if (mustHaveScore) {
-				throw new RuntimeException("无分数");
-			}
-		}
-
-		String filePath = "D:/Temp/answers-detail-" + examId + "-" + courseCode + ".xlsx";
-
-		final String[] EXCEL_HEADER = new String[]{"身份证号码", "课程代码", "题号(跟蓝图里面的题号或者题目ID是对应的)",
-				"题目ID", "答案", "分数"};
-
-		ExcelWriter.write(EXCEL_HEADER, new Class[]{String.class, String.class, String.class,
-				String.class, String.class, String.class}, datas, new File(filePath));
-
-		System.out.println("OVER !   courseCode=" + courseCode);
-	}
-
-	/**
-	 * 获取作答
-	 *
-	 * @author WANGWEI
-	 * @param examRecordDataId
-	 * @return
-	 */
-	private List<Document> getAnswers(Long examRecordDataId) {
-		Query query = Query.query(Criteria.where("examRecordDataId").is(examRecordDataId));
-		final ObjectHolder<List<Document>> answersHolder = new ObjectHolder<List<Document>>(null);
-		mongoTemplate.executeQuery(query, "examRecordQuestions", new DocumentCallbackHandler() {
-
-			@SuppressWarnings("unchecked")
-			@Override
-			public void processDocument(Document document)
-					throws MongoException, DataAccessException {
-				List<Document> answers = (List<Document>) document.get("examQuestionEntities");
-				answersHolder.set(answers);
-			}
-		});
-
-		List<Document> answers = answersHolder.get();
-		return answers;
-	}
-
-	public void setSqlIndex(int sqlIndex) {
-		this.sqlIndex = sqlIndex;
-	}
-
-	public void setMustHaveScore(boolean mustHaveScore) {
-		this.mustHaveScore = mustHaveScore;
-	}
-
-}

+ 0 - 15
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/query_exam_record_data_1.sql

@@ -1,15 +0,0 @@
-SELECT
-	t1.identity_number,
-	t2.id AS exam_record_data_id,
-	t3.total_score as score,
-	t4.`code` 
-FROM
-	ec_oe_exam_record t1
-	LEFT JOIN ec_oe_exam_record_data t2 ON t1.id = t2.exam_record_id
-	LEFT JOIN ec_oe_exam_score t3 ON t3.exam_record_data_id = t2.id
-	LEFT JOIN ec_b_course t4 ON t4.id = t1.course_id 
-WHERE
-	(( t2.is_warn = 0 ) OR ( t2.is_warn = 1 AND t2.is_audit = 1 ) ) 
-	AND t2.exam_record_status != 'EXAM_INVALID' 
-	AND t1.exam_id = ? 
-	AND t4.`code` = ?

+ 0 - 16
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/query_exam_record_data_2.sql

@@ -1,16 +0,0 @@
-SELECT
-	t1.identity_number,
-	t2.id AS exam_record_data_id,
-	t3.total_score as score,
-	t4.`code` 
-FROM
-	ec_oe_exam_record t1
-	LEFT JOIN ec_oe_exam_record_data t2 ON t1.id = t2.exam_record_id
-	LEFT JOIN ec_oe_exam_score t3 ON t3.exam_record_data_id = t2.id
-	LEFT JOIN ec_b_course t4 ON t4.id = t1.course_id 
-	LEFT JOIN ec_m_student_paper t5 ON t5.exam_record_data_id = t2.id
-WHERE
-	t5.id is not null
-	AND t5.student_paper_status != 0 	
-	AND t1.exam_id = ? 
-	AND t4.`code` = ?

+ 0 - 8
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_answer_detail/query_exam_student_info.sql

@@ -1,8 +0,0 @@
-SELECT t1.student_name, t1.identity_number,
-( SELECT x.`code` FROM ec_b_course x WHERE x.id = t1.course_id ) AS course_code 
-FROM
-	ec_oe_exam_record t1,
-	ec_oe_exam_record_data t2 
-WHERE
-	t2.exam_record_id = t1.id 
-	AND t2.id IN ($$)

+ 0 - 134
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/get_student_one_question_answer/GetStduentOneAnswerService.java

@@ -1,134 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.get_student_one_question_answer;
-
-import cn.com.qmth.examcloud.commons.helpers.ObjectHolder;
-import cn.com.qmth.examcloud.commons.helpers.poi.ExcelWriter;
-import com.google.common.collect.Lists;
-import com.mongodb.MongoException;
-import org.bson.Document;
-import org.jsoup.Jsoup;
-import org.jsoup.safety.Whitelist;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.DataAccessException;
-import org.springframework.data.mongodb.core.DocumentCallbackHandler;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Service;
-
-import java.io.File;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 导出 - 考生作答结果(带手机号)
- */
-@Service
-public class GetStduentOneAnswerService {
-
-    @Autowired
-    JdbcTemplate jdbcTemplate;
-
-    @Autowired
-    MongoTemplate mongoTemplate;
-
-    public void start(Long examId, int questionOrder, String... courseCodeLIst) throws Exception {
-        for (String courseCode : courseCodeLIst) {
-            start(examId, questionOrder, courseCode);
-        }
-    }
-
-    // @Async
-    public void start(Long examId, int questionOrder, String courseCode) throws Exception {
-        StringBuilder sql = new StringBuilder();
-        sql.append("SELECT r.id AS exam_record_data_id, r.exam_id, stu.`name` AS student_name,");
-        sql.append(" r.student_code, r.identity_number, c.`code` AS course_code");
-        sql.append(" FROM ec_oe_exam_record_data r");
-        sql.append(" LEFT JOIN ec_b_course c ON c.id = r.course_id");
-        sql.append(" LEFT JOIN ec_b_student stu ON stu.id = r.student_id");
-        sql.append(" WHERE r.exam_id = ? AND c.`code` = ?");
-
-        Object[] args = new Object[]{examId, courseCode};
-        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql.toString(), args);
-
-        List<Object[]> datas = Lists.newArrayList();
-        int total = result.size();
-        int count = 0;
-
-        for (Map<String, Object> map : result) {
-            Long examRecordDataId = (Long) map.get("EXAM_RECORD_DATA_ID");
-            String studentName = (String) map.get("STUDENT_NAME");
-            String studentCode = (String) map.get("STUDENT_CODE");
-            String curCourseCode = (String) map.get("COURSE_CODE");
-            if (!curCourseCode.equals(courseCode)) {
-                throw new RuntimeException("unexpected exception. courseCode=" + courseCode);
-            }
-
-            count++;
-            System.out.println("total: " + total + "; count: " + count);
-
-            List<Document> answers = getAnswers(examRecordDataId);
-
-            for (Document doc : answers) {
-                Integer order = doc.getInteger("order");
-                String studentAnswer = doc.getString("studentAnswer");
-
-                if (null == order) {
-                    throw new RuntimeException("order is null. examRecordDataId=" + examRecordDataId);
-                }
-
-                if (!order.equals(questionOrder)) {
-                    continue;
-                }
-
-                if (null != studentAnswer && !studentAnswer.contains("<img")) {
-                    studentAnswer = Jsoup.clean(studentAnswer, Whitelist.simpleText());
-                }
-
-                Object[] row = new Object[]{String.valueOf(examId), courseCode, studentName,
-                        studentCode, studentAnswer};
-
-                datas.add(row);
-                break;
-            }
-
-        }
-
-        String filePath = "/home/admin/project/oe/one-answer-" + examId + "-" + courseCode + ".xlsx";
-
-        final String[] EXCEL_HEADER = new String[]{"考试批次ID", "课程代码", "学生姓名", "学号",
-                "第" + questionOrder + "题作答"};
-
-        ExcelWriter.write(EXCEL_HEADER,
-                new Class[]{String.class, String.class, String.class, String.class, String.class},
-                datas, new File(filePath));
-
-        System.out.println("OVER !   courseCode=" + courseCode);
-    }
-
-    /**
-     * 获取作答
-     *
-     * @param examRecordDataId
-     * @return
-     * @author WANGWEI
-     */
-    private List<Document> getAnswers(Long examRecordDataId) {
-        Query query = Query.query(Criteria.where("examRecordDataId").is(examRecordDataId));
-        final ObjectHolder<List<Document>> answersHolder = new ObjectHolder<List<Document>>(null);
-        mongoTemplate.executeQuery(query, "examRecordQuestions", new DocumentCallbackHandler() {
-
-            @SuppressWarnings("unchecked")
-            @Override
-            public void processDocument(Document document)
-                    throws MongoException, DataAccessException {
-                List<Document> answers = (List<Document>) document.get("examQuestionEntities");
-                answersHolder.set(answers);
-            }
-        });
-
-        List<Document> answers = answersHolder.get();
-        return answers;
-    }
-
-}

+ 0 - 188
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/import_data/ImportData.java

@@ -1,188 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.import_data;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.springframework.stereotype.Component;
-
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-
-import cn.com.qmth.examcloud.commons.helpers.Counter;
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
-import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
-import cn.com.qmth.examcloud.commons.util.DBUtil;
-import cn.com.qmth.examcloud.commons.util.DateUtil;
-import cn.com.qmth.examcloud.commons.util.DateUtil.DatePatterns;
-import cn.com.qmth.examcloud.commons.util.PathUtil;
-import cn.com.qmth.examcloud.commons.util.ResourceLoader;
-import cn.com.qmth.examcloud.commons.util.Util;
-
-@Component
-public class ImportData {
-
-	private static ExamCloudLog log = ExamCloudLogFactory.getLog(ImportData.class);
-
-	public void start(String dirPath) {
-
-		new Thread(new Runnable() {
-			@Override
-			public void run() {
-				Counter counter = new Counter(0, Long.MAX_VALUE);
-				while (true) {
-					File dir = new File(dirPath);
-
-					File[] fileArr = dir.listFiles();
-
-					for (File file : fileArr) {
-						processFile(counter, file);
-					}
-
-					Util.sleep(60);
-				}
-
-			}
-		}).start();
-	}
-
-	private void processFile(Counter counter, File file) {
-
-		String packageName = this.getClass().getPackage().getName();
-		String packagePath = packageName.replaceAll("\\.", "/");
-		String insertSql = ResourceLoader.getResource(packagePath + "/insert_data.sql");
-		String deleteSql = ResourceLoader.getResource(packagePath + "/delete_data.sql");
-
-		BufferedReader br = null;
-		InputStreamReader reader = null;
-
-		boolean hasError = false;
-		try {
-			reader = new InputStreamReader(new FileInputStream(file), "UTF-8");
-			br = new BufferedReader(reader);
-
-			Connection ds2Conn = DBUtil.getConnection("ds2");
-
-			String line = null;
-			while (null != (line = br.readLine())) {
-				Object[] deleteParams = null;
-				Object[] columValues = null;
-				try {
-					columValues = toColumValues(line);
-					deleteParams = getDeleteParams(columValues);
-				} catch (Exception e) {
-					log.error("[DataImport]. ErrorLine: " + line, e);
-					continue;
-				}
-
-				try {
-					delete(ds2Conn, deleteSql, deleteParams);
-				} catch (Exception e) {
-					hasError = true;
-					log.error("[DataImport]. DeleteError: " + line, e);
-				}
-
-				try {
-					insert(ds2Conn, insertSql, columValues);
-					counter.next();
-					log.info("[DataImport]. count=" + counter.get());
-				} catch (Exception e) {
-					hasError = true;
-					log.error("[DataImport]. InsertError: " + line, e);
-				}
-
-			}
-
-		} catch (Exception e) {
-			hasError = true;
-			log.error("[DataImport]. unexpected", e);
-		} finally {
-			IOUtils.closeQuietly(br);
-			IOUtils.closeQuietly(reader);
-		}
-
-		if (!hasError) {
-			try {
-				FileUtils.forceDelete(file);
-			} catch (IOException e) {
-				log.error("[DataImport]. fail to delete file. path="
-						+ PathUtil.getCanonicalPath(file), e);
-			}
-		}
-
-	}
-
-	private void insert(Connection ds2Conn, String insertSql, Object[] columValues)
-			throws SQLException {
-
-		while (!ds2Conn.isValid(1)) {
-			ds2Conn = DBUtil.getConnection("ds2");
-		}
-
-		PreparedStatement ps2 = null;
-		try {
-			ps2 = ds2Conn.prepareStatement(insertSql);
-			for (int i = 0; i < columValues.length; i++) {
-				ps2.setObject(i + 1, columValues[i]);
-			}
-			ps2.execute();
-		} finally {
-			DBUtil.close(ps2);
-		}
-
-	}
-
-	private void delete(Connection ds2Conn, String deleteSql, Object[] params) throws SQLException {
-
-		while (!ds2Conn.isValid(1)) {
-			ds2Conn = DBUtil.getConnection("ds2");
-		}
-
-		PreparedStatement ps2 = null;
-		try {
-			ps2 = ds2Conn.prepareStatement(deleteSql);
-			for (int i = 0; i < params.length; i++) {
-				ps2.setObject(i + 1, params[i]);
-			}
-			ps2.execute();
-		} finally {
-			DBUtil.close(ps2);
-		}
-
-	}
-
-	private Object[] toColumValues(String str) {
-		JsonObject jsonObj = JsonParser.parseString(str).getAsJsonObject();
-
-		Object[] arr = new Object[9];
-
-		arr[0] = jsonObj.get("id").getAsLong();
-		arr[1] = jsonObj.get("root_org_id").getAsLong();
-		arr[2] = jsonObj.get("exam_student_id").getAsLong();
-		arr[3] = jsonObj.get("exam_record_data_id").getAsLong();
-		arr[4] = jsonObj.get("photo_path").getAsString();
-		arr[5] = jsonObj.get("file_url").getAsString();
-		arr[6] = jsonObj.get("face_compare_result").getAsString();
-		arr[7] = DateUtil.parse(jsonObj.get("creation_time").getAsString(),
-				DatePatterns.CHINA_DEFAULT);
-		if (!jsonObj.get("used_time").isJsonNull()) {
-			arr[8] = jsonObj.get("used_time").getAsLong();
-		}
-
-		return arr;
-	}
-
-	private Object[] getDeleteParams(Object[] columValues) {
-		Object[] arr = new Object[1];
-		arr[0] = columValues[0];
-		return arr;
-	}
-
-}

+ 0 - 2
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/import_data/delete_data.sql

@@ -1,2 +0,0 @@
-delete from `student_face_result_2` 
-where  id = ?

+ 0 - 12
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/import_data/insert_data.sql

@@ -1,12 +0,0 @@
-INSERT INTO `student_face_result_2` 
-( `id`,
-`root_org_id`, 
-`exam_student_id`,
-`exam_record_data_id`,
-`photo_path`,
-`file_url`,
-`face_compare_result`, 
-`creation_time`,
-`used_time` )
-VALUES
-	( ?, ?, ?, ?, ?, ?, ?, ?, ? )

+ 0 - 182
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/load_question_cache/LoadQuestionsCacheService.java

@@ -1,182 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.load_question_cache;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.io.IOUtils;
-import org.springframework.stereotype.Service;
-
-import com.alibaba.fastjson.JSON;
-import com.google.common.collect.Maps;
-
-import cn.com.qmth.dp.examcloud.oe.entity.question.ExtractConfig;
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util.OKHttpUtil;
-import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.commons.util.HttpMethod;
-import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.question.commons.core.paper.DefaultQuestionGroup;
-import cn.com.qmth.examcloud.question.commons.core.paper.DefaultQuestionStructureWrapper;
-import cn.com.qmth.examcloud.question.commons.core.question.DefaultQuestionUnit;
-import cn.com.qmth.examcloud.question.commons.core.question.QuestionType;
-import cn.com.qmth.examcloud.support.cache.bean.BasePaperCacheBean;
-import cn.com.qmth.examcloud.support.cache.bean.ExtractConfigCacheBean;
-import cn.com.qmth.examcloud.support.cache.bean.ExtractConfigDetailCacheBean;
-import cn.com.qmth.examcloud.support.cache.bean.ExtractConfigPaperCacheBean;
-import cn.com.qmth.examcloud.support.cache.bean.QuestionCacheBean;
-import okhttp3.Response;
-
-/**
- * 加载题库缓存
- * 修改参数后直接run
- * 
- * @author chenken
- *
- */
-@Service
-public class LoadQuestionsCacheService {
-	
-	//变动参数
-	private final static String examId="14";
-	
-	private final static String key = "U_C_0_6";
-
-	private final static String token = "848cc9362be84796b902f9991a1c6629";
-	
-	private final static String domain="https://192.168.10.39/api/ecs_ques/";
-	
-	
-	
-	private final static String url1=domain+"cache-load/extract-config-list";
-	
-	private final static String url2=domain+"cache-load/extract-config-cache";
-	
-	private final static String url3=domain+"cache-load/extract-config-paper-cache";
-	
-//	private final static String url4=domain+"cache-load/base-paper-cache";
-	
-	private final static String url5=domain+"cache-load/question-cache";
-	
-	private final static String url6=domain+"cache-load/question-answer-cache";
-	
-
-	public static void main(String[] args) {
-		start();
-	}
-	public static void start() {
-		Map<String, String> params1 = Maps.newHashMap();
-		params1.put("examId", examId);
-		List<ExtractConfig> ecs=getListData(url1, params1, ExtractConfig.class);
-		if(CollectionUtils.isEmpty(ecs)) {
-			return;
-		}
-		System.out.println("考试名称:"+ecs.get(0).getExamName());
-		System.out.println("--课程数:"+ecs.size());
-		for(ExtractConfig ec:ecs) {
-			Map<String, String> params2 = Maps.newHashMap();
-			params2.put("examId", examId);
-			params2.put("courseCode", ec.getCourseCode());
-			//课程
-			ExtractConfigCacheBean ecCache=getObjectData(url2, params2, ExtractConfigCacheBean.class);
-			System.out.println("----课程code:"+ec.getCourseCode());
-			if(ecCache!=null&&CollectionUtils.isNotEmpty(ecCache.getDetails())) {
-				for(ExtractConfigDetailCacheBean ecdCache:ecCache.getDetails()) {
-					Map<String, String> params3 = Maps.newHashMap();
-					params3.put("examId", examId);
-					params3.put("courseCode", ec.getCourseCode());
-					params3.put("groupCode", ecdCache.getGroupCode());
-					params3.put("paperId", ecdCache.getPaperId());
-					//试卷
-					ExtractConfigPaperCacheBean paper=getObjectData(url3, params3, ExtractConfigPaperCacheBean.class);
-					System.out.println("------试卷名:"+paper.getDefaultPaper().getName());
-					Map<String, String> params4 = Maps.newHashMap();
-					params4.put("paperId", ecdCache.getPaperId());
-					//原卷 阅卷用
-//					BasePaperCacheBean bpCache=getObjectData(url4, params4, BasePaperCacheBean.class);
-					
-					
-					if(paper!=null&&CollectionUtils.isNotEmpty(paper.getDefaultPaper().getQuestionGroupList())) {
-						for(DefaultQuestionGroup dqg:paper.getDefaultPaper().getQuestionGroupList()) {
-							if(CollectionUtils.isNotEmpty(dqg.getQuestionWrapperList())) {
-								for(DefaultQuestionStructureWrapper dqsw:dqg.getQuestionWrapperList()) {
-									Map<String, String> params5 = Maps.newHashMap();
-									params5.put("examId", examId);
-									params5.put("courseCode", ec.getCourseCode());
-									params5.put("groupCode", ecdCache.getGroupCode());
-									params5.put("questionId", dqsw.getQuestionId());
-									//小题
-									QuestionCacheBean qCache=getObjectData(url5, params5, QuestionCacheBean.class);
-									if(isObjective(qCache)) {
-										Map<String, String> params6 = Maps.newHashMap();
-										params6.put("questionId", dqsw.getQuestionId());
-										//答案
-										getObjectData(url6, params6, BasePaperCacheBean.class);
-									}
-								}
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-	
-	private static boolean isObjective(QuestionCacheBean ques) {
-		if(CollectionUtils.isNotEmpty(ques.getDefaultQuestion().getMasterVersion().getQuestionUnitList())){
-			for(DefaultQuestionUnit qu:ques.getDefaultQuestion().getMasterVersion().getQuestionUnitList()) {
-				if(QuestionType.SINGLE_CHOICE.equals(qu.getQuestionType())
-						||QuestionType.MULTIPLE_CHOICE.equals(qu.getQuestionType())
-						||QuestionType.TRUE_OR_FALSE.equals(qu.getQuestionType())) {
-					return true;
-				}
-			}
-		}
-		return false;
-	}
-
-	private static <T> T getObjectData(String url, Map<String, String> params, Class<T> responseType) {
-		Map<String, String> headers = Maps.newHashMap();
-		headers.put("key", key);
-		headers.put("token", token);
-		Response resp = null;
-		try {
-			resp = OKHttpUtil.call(HttpMethod.POST, url, headers, params);
-			if (resp.code() == 200) {
-				String resultJson = resp.body().string();
-				T res = JsonUtil.fromJson(resultJson, responseType);
-				return res;
-			} else {
-				throw new StatusException("500", resp.body().string());
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw new StatusException("500", e.getMessage(), e);
-		} finally {
-			IOUtils.closeQuietly(resp);
-		}
-	}
-	
-	private static <T> List<T> getListData(String url, Map<String, String> params, Class<T> responseType) {
-		Map<String, String> headers = Maps.newHashMap();
-		headers.put("key", key);
-		headers.put("token", token);
-		Response resp = null;
-		try {
-			resp = OKHttpUtil.call(HttpMethod.POST, url, headers, params);
-			if (resp.code() == 200) {
-				String resultJson = resp.body().string();
-				List<T> res = JSON.parseArray(resultJson, responseType);
-				return res;
-			} else {
-				throw new StatusException("500", resp.body().string());
-			}
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			throw new StatusException("500", e.getMessage(), e);
-		} finally {
-			IOUtils.closeQuietly(resp);
-		}
-	}
-}

+ 0 - 18
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/load_question_cache/TrustAllTrustManager.java

@@ -1,18 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.load_question_cache;
-
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-
-import javax.net.ssl.X509TrustManager;
-
-public class TrustAllTrustManager implements X509TrustManager {
-    @Override public void checkClientTrusted(X509Certificate[] chain, String authType)
-            throws CertificateException {
-    }
-    @Override public void checkServerTrusted(X509Certificate[] chain, String authType)
-            throws CertificateException {
-    }
-    @Override public X509Certificate[] getAcceptedIssuers() {
-        return new X509Certificate[0];
-    }
-}

+ 0 - 399
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/FixCorrectAnswerAndResetScoreService.java

@@ -1,399 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity.*;
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util.OKHttpUtil;
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util.QmthUtil;
-import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.commons.util.HttpMethod;
-import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
-import com.mongodb.client.result.UpdateResult;
-import com.mysql.cj.util.StringUtils;
-import okhttp3.Response;
-import org.apache.commons.io.IOUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.data.mongodb.core.query.Update;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.io.*;
-import java.text.DecimalFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * @Description 更新标准答案,并重新计算分数
- * @Author lideyin
- * @Date 2020/4/25 12:52
- * @Version 1.0
- */
-@Service
-public class FixCorrectAnswerAndResetScoreService {
-
-    @Autowired
-    JdbcTemplate jdbcTemplate;
-
-    @Autowired
-    MongoTemplate mongoTemplate;
-
-    // @Async
-    public void start() {
-        String absolutePath= PropertiesUtil.getString("fixAnswer.data.path");
-//        ClassPathResource classPathResource = new ClassPathResource("temp1.txt");
-        FileInputStream fis=null;
-        InputStreamReader isr = null;
-        BufferedReader br = null;
-
-        try {
-            fis = new FileInputStream(new File(absolutePath));
-            isr = new InputStreamReader(fis);
-            br = new BufferedReader(isr);
-            String strExamIdAndCourseCode = "";
-            while ((strExamIdAndCourseCode = br.readLine()) != null) {
-                Long examId = Long.valueOf(strExamIdAndCourseCode.split(",")[0]);
-                String courseCode = strExamIdAndCourseCode.split(",")[1];
-                System.out.println(String.format("examId:%s,courseCode:%s", examId, courseCode));
-                run(examId,courseCode);
-                Thread.sleep(10);
-                //19,"03013750"
-            }
-
-        } catch (IOException e) {
-            e.printStackTrace();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        } finally {
-            if (br != null) {
-                try {
-                    br.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (isr != null) {
-                try {
-                    isr.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-
-    }
-
-    public void run(long examId, String courseCode) {
-        List<ExamRecordDataEntity> examRecordDataList = queryExamRecordDataList(examId, courseCode);
-
-        if (examRecordDataList.isEmpty()) {
-            throw new StatusException("100001", "找不到对应的考试记录");
-        }
-
-        //首先更新mongo中的作答记录
-        modifyMongoQuestionAnswer(examRecordDataList);
-
-        //重新计算分数并保存
-        modifyDbScore(examRecordDataList);
-
-        System.out.println("999.all is over.....");
-    }
-
-    private void modifyDbScore(List<ExamRecordDataEntity> examRecordDataList) {
-        Set<Long> examStudentIdSet = new HashSet<>();
-        int effectiveNum = 0;//有效数量
-        //按考试记录更新分数表
-        for (ExamRecordDataEntity record : examRecordDataList) {
-            Query query = new Query();
-            query.addCriteria(Criteria.where("_id").is(record.getExamRecordQuestionsId()));
-            ExamRecordQuestionsEntity erq = mongoTemplate.findOne(query, ExamRecordQuestionsEntity.class, "examRecordQuestions");
-            if (erq == null) continue;
-
-            List<ExamQuestionEntity> objectiveQuesList = erq.getExamQuestionEntities().stream()
-                    .filter(p -> isObjectiveQues(p.getQuestionType())).collect(Collectors.toList());
-
-            double objectiveScore = calcTotalObjectiveScore(objectiveQuesList);
-            double objectiveAccuracy = calcTotalObjectiveAccuracy(objectiveQuesList);
-
-            updateExamScore(objectiveScore, objectiveAccuracy, record.getId());
-            System.out.println(String.format("2.更新第%d条分数成功---examRecordDataId=%s", ++effectiveNum, record.getId()));
-            examStudentIdSet.add(record.getExamStudentId());
-        }
-
-        int esNum = 0;
-        //按考生id,删除考生最终分数表(此表如果不存在数据,获取时,系统会重新计算)
-        for (Long estId : examStudentIdSet) {
-            deleteFinalScore(estId);
-            System.out.println(String.format("3.删除第%d条最终分数成功---examStudentId=%s", ++esNum, estId));
-        }
-
-    }
-
-    private void deleteFinalScore(Long estId) {
-        String strSql = String.format("delete from ec_oe_exam_student_final_score where exam_student_id=%d ", estId);
-
-        jdbcTemplate.execute(strSql);
-    }
-
-    /**
-     * 计算客观题总分
-     *
-     * @param objectiveQuesList
-     * @return
-     */
-    private double calcTotalObjectiveScore(List<ExamQuestionEntity> objectiveQuesList) {
-        double totalObjectiveScore = 0d;//客观题总分
-
-        for (ExamQuestionEntity eq : objectiveQuesList) {
-            if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
-                    && !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
-                    && eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
-                totalObjectiveScore += eq.getQuestionScore();
-            }
-        }
-
-        return totalObjectiveScore;
-    }
-
-    /**
-     * 计算客观题正确率
-     *
-     * @param objectiveQuesList
-     * @return
-     */
-    private double calcTotalObjectiveAccuracy(List<ExamQuestionEntity> objectiveQuesList) {
-        double correctNum = 0d;
-        double totalNum = 0d;
-        for (ExamQuestionEntity eq : objectiveQuesList) {
-            if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
-                    && !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
-                    && eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
-                correctNum += 1;
-            }
-            totalNum += 1;
-        }
-
-        if (totalNum == 0) {
-            return 0;
-        }
-
-        return Double.valueOf(new DecimalFormat("#.00").format(correctNum * 100D / totalNum));
-    }
-
-    /**
-     * 更新考试作答记录
-     *
-     * @param examRecordDataList
-     */
-    private void modifyMongoQuestionAnswer(List<ExamRecordDataEntity> examRecordDataList) {
-        int rubbishNum = 0;
-        int effectiveNum = 0;//有效数量
-        for (ExamRecordDataEntity record : examRecordDataList) {
-            try {
-                String examRecordQuestionsId = record.getExamRecordQuestionsId();
-                Query query = new Query();
-                query.addCriteria(Criteria.where("_id").is(examRecordQuestionsId));
-                ExamRecordQuestionsEntity erq = mongoTemplate.findOne(query, ExamRecordQuestionsEntity.class, "examRecordQuestions");
-
-                if (erq == null) {
-                    System.out.println(String.format("发现%d条垃圾数据:examRecordDataId=%s", ++rubbishNum, record.getId()));
-                    continue;//垃圾数据
-                }
-
-                List<ExamQuestionEntity> examQuestionList = erq.getExamQuestionEntities();
-
-                //所有客观题的试题id集合
-                List<String> questionIdList = examQuestionList.stream()
-                        .filter(p -> isObjectiveQues(p.getQuestionType()))
-                        .map(ExamQuestionEntity::getQuestionId)
-                        .collect(Collectors.toList());
-
-
-                for (String quesId : questionIdList) {
-                    //最小维度的小题单元集合
-                    List<ExamQuestionEntity> questionUnitList = examQuestionList.stream()
-                            .filter(p -> p.getQuestionId().equals(quesId))
-                            .sorted((o1, o2) -> o1.getOrder().intValue() - o2.getOrder().intValue())
-                            .collect(Collectors.toList());
-                    //根据题目id获取正确答案集合
-                    List<String> rightAnswerList = getRightAnswerList(quesId);
-
-                    if (rightAnswerList == null) {
-                        throw new StatusException("102003", String.format("找不到quesId=%s的答案数据", quesId));
-                    }
-
-                    //循环保存所有小题单元
-                    for (int i = 0; i < questionUnitList.size(); i++) {
-                        String rightAnswer = rightAnswerList.get(i);
-                        ExamQuestionEntity curQues = questionUnitList.get(i);
-                        String curCorrectAnswer =curQues.getCorrectAnswer();
-
-                        //只有无答案,或者有答案,答案不一致的才更新
-                        if (StringUtils.isNullOrEmpty(curCorrectAnswer)
-                                || (!StringUtils.isNullOrEmpty(curCorrectAnswer) && !curCorrectAnswer.equals(rightAnswer))) {
-                            updatePartialQuestionAnswer(examRecordQuestionsId, curQues.getOrder(),
-                                    rightAnswer, calcStudentUnitScore(rightAnswer, curQues));
-                        }
-
-                    }
-                }
-                System.out.println(String.format("1.更新第%d条作答记录成功---examRecordDataId=%s", ++effectiveNum, record.getId()));
-            } catch (Exception e) {
-                System.out.println(String.format("1.更新第%d条作答记录失败---examRecordDataId=%s", ++effectiveNum, record.getId()));
-                throw new StatusException("100002", e.getMessage(), e);
-            }
-        }
-    }
-
-    /**
-     * 计算学生的小题得分
-     *
-     * @param rightAnswer
-     * @param curQues
-     * @return
-     */
-    private Double calcStudentUnitScore(String rightAnswer, ExamQuestionEntity curQues) {
-        String studentAnswer = curQues.getStudentAnswer();
-        Double studentUnitScore = 0D;
-        if (!StringUtils.isNullOrEmpty(rightAnswer)
-                && !(StringUtils.isNullOrEmpty(studentAnswer))
-                && rightAnswer.equals(studentAnswer)) {
-            studentUnitScore = curQues.getQuestionScore();
-        }
-        return studentUnitScore;
-    }
-
-    /**
-     * 获取题目正式答案
-     *
-     * @param quesId
-     * @return
-     */
-    private List<String> getRightAnswerList(String quesId) {
-//        if (1 == 1) {
-//            List<String> list = new ArrayList<>();
-//            list.add("2");
-//            list.add("2");
-//            list.add("2");
-//            list.add("2");
-//            list.add("2");
-//            list.add("2");
-//            return list;
-//        }
-
-        OuterGetQuestionAnswerReq reqBody = new OuterGetQuestionAnswerReq();
-        reqBody.setQuestionId(quesId);
-
-        String url = QmthUtil.buildUrl("/api/exchange/outer/question/getQuestionAnswer");
-        Response resp = null;
-        try {
-            resp = OKHttpUtil.call(HttpMethod.POST, url, QmthUtil.getSecurityHeaders(),
-                    JsonUtil.toJson(reqBody));
-            if (resp.code() == 200) {
-                String resultJson = resp.body().string();
-                OuterGetQuestionAnswerResp outerGetQuestionAnswerResp = JsonUtil.fromJson(resultJson, OuterGetQuestionAnswerResp.class);
-
-                return outerGetQuestionAnswerResp.getAnswerList();
-
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new StatusException("102002", e.getMessage(), e);
-        } finally {
-            IOUtils.closeQuietly(resp);
-        }
-        return null;
-    }
-
-    /**
-     * 是否为客观题
-     *
-     * @param questionType
-     * @return
-     */
-    private boolean isObjectiveQues(String questionType) {
-        return "SINGLE_CHOICE".equals(questionType)
-                || "MULTIPLE_CHOICE".equals(questionType)
-                || "TRUE_OR_FALSE".equals(questionType);
-    }
-
-    private List<ExamRecordDataEntity> queryExamRecordDataList(Long examId, String courseCode) {
-        String strSql = String.format("SELECT " +
-                "t1.`id`, " +
-                "t1.`exam_student_id`, " +
-                "t1.exam_record_questions_id " +
-                "FROM " +
-                "ec_oe_exam_record_data t1 " +
-                "INNER JOIN ec_b_course t2 ON t1.course_id = t2.id " +
-                "WHERE " +
-                "t1.exam_id = %d " +
-                "AND t2.`code` ='%s' ", examId, courseCode);
-
-        java.util.List<Map<String, Object>> mapList = jdbcTemplate.queryForList(strSql);
-        java.util.List<ExamRecordDataEntity> resultList = new ArrayList<>();
-        for (Map<String, Object> map : mapList) {
-            ExamRecordDataEntity entity = new ExamRecordDataEntity();
-            if (map.get("id") != null) {
-                entity.setId(Long.valueOf(map.get("id").toString()));
-            }
-
-            if (map.get("exam_student_id") != null) {
-                entity.setExamStudentId(Long.valueOf(map.get("exam_student_id").toString()));
-            }
-
-            if (map.get("exam_record_questions_id") != null) {
-                entity.setExamRecordQuestionsId(map.get("exam_record_questions_id").toString());
-            }
-            resultList.add(entity);
-        }
-        return resultList;
-    }
-
-    private void updateExamScore(double objectiveScore, double objectiveAccuracy,
-                                 Long examRecordDataId) {
-        String strSql = String.format("UPDATE ec_oe_exam_score " +
-                "SET objective_score = %s, " +
-                "objective_accuracy = %s, " +
-                "total_score = objective_score+ IFNULL(subjective_score,0) " +
-                "WHERE " +
-                "exam_record_data_id = %d  ", objectiveScore, objectiveAccuracy, examRecordDataId);
-
-        jdbcTemplate.execute(strSql);
-    }
-
-    /**
-     * 更新学生作答的部分数据
-     *
-     * @param examRecordQuestionsId
-     * @param order
-     * @param newAnswer
-     * @param studentScore
-     * @return
-     */
-    public long updatePartialQuestionAnswer(String examRecordQuestionsId, Integer order, String newAnswer, Double studentScore) {
-        // 查询相应的题目
-        Query query = Query.query(Criteria.where("_id").is(examRecordQuestionsId)
-                .and("examQuestionEntities.order").is(order));
-        Update update = new Update();
-        update.set("examQuestionEntities.$.correctAnswer", newAnswer);
-        update.set("examQuestionEntities.$.studentScore", studentScore);
-
-        UpdateResult upResult = mongoTemplate.updateFirst(query, update, "examRecordQuestions");
-        return upResult.getMatchedCount();
-    }
-
-}

+ 0 - 344
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/ResetScoreService.java

@@ -1,344 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer;
-
-import cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo.ExamStudentVO;
-import cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.vo.ScoreVO;
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity.ExamRecordDataEntity;
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
-import org.apache.commons.collections.CollectionUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.dao.EmptyResultDataAccessException;
-import org.springframework.jdbc.core.BeanPropertyRowMapper;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-/**
- * @Description 重新计算分数
- * @Author lideyin
- * @Date 2020/4/25 12:52
- * @Version 1.0
- */
-@Service
-public class ResetScoreService {
-
-    @Autowired
-    JdbcTemplate jdbcTemplate;
-
-    private static final Long MARKING_TYPE_KEY = 24L;// 阅卷方式KEY
-
-    // @Async
-    public void start() {
-        String absolutePath = PropertiesUtil.getString("fixAnswer.data.path");
-//        ClassPathResource classPathResource = new ClassPathResource("temp1.txt");
-        FileInputStream fis = null;
-        InputStreamReader isr = null;
-        BufferedReader br = null;
-
-        try {
-            fis = new FileInputStream(new File(absolutePath));
-            isr = new InputStreamReader(fis);
-            br = new BufferedReader(isr);
-            String strExamIdAndCourseCode = "";
-            while ((strExamIdAndCourseCode = br.readLine()) != null) {
-                Long examId = Long.valueOf(strExamIdAndCourseCode.split(",")[0]);
-                Long courseId = Long.valueOf(strExamIdAndCourseCode.split(",")[1]);
-
-                run(examId, courseId);
-
-                Thread.sleep(10);
-                //19,"03013750"
-            }
-
-            System.out.println("999.all is over.....");
-
-        } catch (IOException e) {
-            e.printStackTrace();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        } finally {
-            if (br != null) {
-                try {
-                    br.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (isr != null) {
-                try {
-                    isr.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-
-    }
-
-    public void run(long examId, Long courseId) {
-        //考试下所有考试记录
-        List<ExamRecordDataEntity> allExamRecordDataList = queryExamRecordDataList(examId, courseId);
-
-        //取正式有效的考试记录数据
-        List<ExamRecordDataEntity> effectiveExamRecordDataList =
-                allExamRecordDataList.stream()
-                        .filter(p -> !p.getIllegality() && (!p.getWarn() || (p.getWarn() && p.getAudit())))
-                        .collect(Collectors.toList());
-
-        //当前考试课程下的所有的课程id
-        List<ExamStudentVO> examStudentList = queryExamStudents(examId, courseId);
-
-        // 获取考试的阅卷方式
-        String markingType = this.queryExamMarkingType(examId, MARKING_TYPE_KEY);
-        double objectiveScore = 0;
-        double subjectiveScore = 0;
-        double objectiveAccuracy = 0;
-        double successPercent = 0;
-        double totalScore = 0;
-
-        int esTotalNum = examStudentList.size();
-        int esIndex = 0;
-        for (ExamStudentVO esVo : examStudentList) {
-            esIndex++;
-            
-            Long esId = esVo.getExamStudentId();
-            System.out.println(String.format("[examId_stuId_total]:%s_%s_total---start---共%s个考生,当前正在执行第%s条...",
-                    examId, esId,esTotalNum, esIndex));
-            //如果当前考生的考试成绩已存在则直接跳过
-            if (existsFinalScore(esId)) {
-                System.out.println(String.format("[examId_stuId_total]:%s_%s_total---exist---共%s个考生,当前正在执行第%s条...",
-                        examId, esId,esTotalNum, esIndex));
-                continue;
-            }
-
-            //当前考生的所有考试记录
-            List<ExamRecordDataEntity> curEstRecordList = effectiveExamRecordDataList.stream().filter(p -> p.getExamStudentId().equals(esId)).collect(Collectors.toList());
-
-            if (curEstRecordList == null || curEstRecordList.isEmpty()) {
-                System.out.println(String.format("[examId_stuId_total]:%s_%s_total---warn---共%s个考生,当前正在执行第%s条...",
-                        examId, esId,esTotalNum, esIndex));
-                continue;//缺考考生数据不处理
-            }
-
-            //最终有效的分数
-            ScoreVO effectiveScore;
-            if (curEstRecordList.size() == 1) {
-                // 只有一条考试记录情况
-                Long okExamRecordDataId = curEstRecordList.get(0).getId();
-
-                // 获取考试记录对应的成绩
-                effectiveScore = this.queryExamScore(okExamRecordDataId);
-
-            } else{
-                // 多条考试记录情况
-                List<ScoreVO> scores = new ArrayList<>();
-                for (ExamRecordDataEntity examRecordData : effectiveExamRecordDataList) {
-                    Long examRecordDataId = examRecordData.getId();
-                    // 分别获取考试记录对应的成绩
-                    ScoreVO score = this.queryExamScore(examRecordDataId);
-                    scores.add(score);
-                }
-
-                if (markingType.equals("ALL") || markingType.equals("OBJECT_SCORE_MAX")) {
-                    // 全部评阅规则 或 客观分最高规则:取总分最高
-                    effectiveScore = scores.stream()
-                            .sorted((obj1, obj2) -> obj2.getTotalScore().compareTo(obj1.getTotalScore()))
-                            .collect(Collectors.toList())
-                            .get(0);
-                } else {
-                    // 否则:取最后一次的成绩
-                    effectiveScore = scores.stream()
-                            .sorted((obj1, obj2) -> obj2.getId().compareTo(obj1.getId()))
-                            .collect(Collectors.toList())
-                            .get(0);
-                }
-            }
-
-            objectiveScore = effectiveScore.getObjectiveScore();
-            subjectiveScore = effectiveScore.getSubjectiveScore();
-            objectiveAccuracy = effectiveScore.getObjectiveAccuracy();
-            successPercent = effectiveScore.getSuccPercent();
-            totalScore = effectiveScore.getTotalScore();
-
-            //再次判断数据是否已存在
-            if (!existsFinalScore(esId)) {
-                insertFinalScore(effectiveScore.getExamRecordDataId(), esId, objectiveScore, objectiveAccuracy, subjectiveScore, successPercent, totalScore);
-
-                System.out.println(String.format("[examId_stuId_total]:%s_%s_total---success---共%s个考生,当前正在执行第%s条...",
-                        examId, esId,esTotalNum, esIndex));
-            }
-        }
-
-    }
-
-    /**
-     * 插入最终分数
-     * @param examRecordDataId
-     * @param esId
-     * @param objectiveScore
-     * @param objectiveAccuracy
-     * @param subjectiveScore
-     * @param successPercent
-     * @param totalScore
-     */
-    private void insertFinalScore(Long examRecordDataId, Long esId, double objectiveScore, double objectiveAccuracy,
-                                  double subjectiveScore, double successPercent, double totalScore) {
-        String strSql = String.format("INSERT INTO `ec_oe_exam_student_final_score` " +
-                "( `creation_time`, `update_time`, `exam_record_data_id`, `exam_student_id`, " +
-                "`objective_accuracy`, `objective_score`, `subjective_score`, `succ_percent`, `total_score` ) " +
-                "VALUES " +
-                " ( NOW(), NOW(), %d, %d, " +
-                "%s, %s, %s, %s, %s ) ", examRecordDataId, esId, objectiveAccuracy, objectiveScore, subjectiveScore, successPercent, totalScore);
-
-        jdbcTemplate.execute(strSql);
-    }
-
-    /**
-     * 是否存在最终分数
-      * @param estId
-     * @return
-     */
-    private boolean existsFinalScore(Long estId) {
-        String strSql = String.format("select 1 from ec_oe_exam_student_final_score where exam_student_id=%d ", estId);
-
-        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(strSql);
-
-        return !(mapList == null || mapList.isEmpty());
-    }
-
-    /**
-     * 查询考试记录
-     * @param examId
-     * @param courseId
-     * @return
-     */
-    private List<ExamRecordDataEntity> queryExamRecordDataList(Long examId, Long courseId) {
-        String strSql = String.format("SELECT " +
-                "t1.`id`, " +
-                "t1.`exam_student_id`, " +
-                "t1.`course_id`, " +
-                "t1.`is_illegality`, " +
-                "t1.`is_warn`, " +
-                "t1.`is_audit`, " +
-                "t1.exam_record_questions_id " +
-                "FROM " +
-                "ec_oe_exam_record_data t1 " +
-                "WHERE " +
-                "t1.exam_id = %d " +
-                "AND t1.`course_id` =%d ", examId, courseId);
-
-        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(strSql);
-        List<ExamRecordDataEntity> resultList = new ArrayList<>();
-        for (Map<String, Object> map : mapList) {
-            ExamRecordDataEntity entity = new ExamRecordDataEntity();
-            if (map.get("id") != null) {
-                entity.setId(Long.valueOf(map.get("id").toString()));
-            }
-
-            if (map.get("exam_student_id") != null) {
-                entity.setExamStudentId(Long.valueOf(map.get("exam_student_id").toString()));
-            }
-
-            if (map.get("exam_record_questions_id") != null) {
-                entity.setExamRecordQuestionsId(map.get("exam_record_questions_id").toString());
-            }
-
-            if (map.get("course_id") != null) {
-                entity.setCourseId(Long.valueOf(map.get("course_id").toString()));
-            }
-
-            if (map.get("is_illegality") != null) {
-                entity.setIllegality(Boolean.valueOf(map.get("is_illegality").toString()));
-            } else {
-                entity.setIllegality(false);
-            }
-
-            if (map.get("is_warn") != null) {
-                entity.setWarn(Boolean.valueOf(map.get("is_warn").toString()));
-            } else {
-                entity.setWarn(false);
-            }
-
-            if (map.get("is_audit") != null) {
-                entity.setAudit(Boolean.valueOf(map.get("is_audit").toString()));
-            } else {
-                entity.setAudit(false);
-            }
-
-            resultList.add(entity);
-        }
-        return resultList;
-    }
-
-
-    /**
-     * 查询考试下所有考生
-     * @param examId
-     * @param courseId
-     * @return
-     */
-    private List<ExamStudentVO> queryExamStudents(Long examId, Long courseId) {
-        final String columns = "exam_student_id,student_code,student_name,identity_number,org_id,course_id,course_code,course_level,grade,specialty_name,finished";
-        final String querySql = String.format("select %s from ec_oe_exam_student where exam_id = %s and course_id = %s and enable = 1", columns, examId, courseId);
-        return jdbcTemplate.query(querySql, new BeanPropertyRowMapper(ExamStudentVO.class));
-    }
-
-    /**
-     * 查询考试的阅卷类型
-     * @param examId
-     * @param markingTypeKey
-     * @return
-     */
-    private String queryExamMarkingType(Long examId, Long markingTypeKey) {
-        final String querySql = String.format("select value from ec_e_exam_prop where exam_id = %s and key_id = %s", examId, markingTypeKey);
-        try {
-            String result = jdbcTemplate.queryForObject(querySql, String.class);
-            return org.apache.commons.lang3.StringUtils.isNoneBlank(result) ? result.trim() : "ALL";
-        } catch (EmptyResultDataAccessException e) {
-            return "ALL";// 默认值
-        }
-    }
-
-    /**
-     * 查询考试分数
-     * @param examRecordDataId
-     * @return
-     */
-    private ScoreVO queryExamScore(Long examRecordDataId) {
-        final String querySql = String.format("select id,objective_score,subjective_score,total_score,objective_accuracy,succ_percent,total_score from ec_oe_exam_score where exam_record_data_id = %s", examRecordDataId);
-        List<ScoreVO> result = jdbcTemplate.query(querySql, new BeanPropertyRowMapper(ScoreVO.class));
-
-        ScoreVO score;
-        if (CollectionUtils.isNotEmpty(result)) {
-            score = result.get(0);
-        } else {
-            score = new ScoreVO();
-        }
-
-        // 默认值
-        score.setExamRecordDataId(examRecordDataId);
-        score.setObjectiveScore(score.getObjectiveScore() != null ? score.getObjectiveScore() : 0d);
-        score.setSubjectiveScore(score.getSubjectiveScore() != null ? score.getSubjectiveScore() : 0d);
-        score.setTotalScore(score.getTotalScore() != null ? score.getTotalScore() : 0d);
-        score.setObjectiveAccuracy(score.getObjectiveAccuracy() != null ? score.getObjectiveAccuracy() : 0d);
-        score.setSuccPercent(score.getSuccPercent() != null ? score.getSuccPercent() : 0d);
-
-        return score;
-    }
-
-}

+ 0 - 196
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamQuestionEntity.java

@@ -1,196 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity;
-
-import java.io.Serializable;
-
-/**
- * 考生作答明细
- */
-public class ExamQuestionEntity implements Serializable{
-
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = -6141069483774400912L;
-	
-	private String id;
-	/**
-	 * 考试记录Data Id
-	 */
-    private Long examRecordDataId;
-    /**
-     * 大题号
-     */
-    private Integer mainNumber;
-    /**
-     * 原题ID
-     */
-    private String questionId;
-    /**
-     * 顺序
-     */
-    private Integer order;
-    /**
-     * 小题分数
-     */
-    private Double questionScore;
-    /**
-     * 小题类型
-     */
-    private String questionType;
-    /**
-     * 标准答案
-     */
-    private String correctAnswer;
-    /**
-     * 考生作答
-     */
-    private String studentAnswer;
-    /**
-     * 学生小题得分
-     */
-    private Double studentScore;
-    /**
-     * 是否作答
-     */
-    private Boolean isAnswer;
-    /**
-     * 是否标记
-     */
-    private Boolean isSign;
-    
-    /**
-	 * 选项排序值
-	 */
-	private Integer[] optionPermutation;
-	
-	/**
-	 * 音频播放次数
-	 */
-	private String audioPlayTimes;
-	/**
-	 * 题目作答类型
-	 */
-	private String answerType;
-    
-	public ExamQuestionEntity() {}
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public Long getExamRecordDataId() {
-		return examRecordDataId;
-	}
-
-	public void setExamRecordDataId(Long examRecordDataId) {
-		this.examRecordDataId = examRecordDataId;
-	}
-
-	public Integer getMainNumber() {
-		return mainNumber;
-	}
-
-	public void setMainNumber(Integer mainNumber) {
-		this.mainNumber = mainNumber;
-	}
-
-	public String getQuestionId() {
-		return questionId;
-	}
-
-	public void setQuestionId(String questionId) {
-		this.questionId = questionId;
-	}
-
-	public Integer getOrder() {
-		return order;
-	}
-
-	public void setOrder(Integer order) {
-		this.order = order;
-	}
-
-	public Double getQuestionScore() {
-		return questionScore;
-	}
-
-	public void setQuestionScore(Double questionScore) {
-		this.questionScore = questionScore;
-	}
-
-	public String getQuestionType() {
-		return questionType;
-	}
-
-	public void setQuestionType(String questionType) {
-		this.questionType = questionType;
-	}
-
-	public String getCorrectAnswer() {
-		return correctAnswer;
-	}
-
-	public void setCorrectAnswer(String correctAnswer) {
-		this.correctAnswer = correctAnswer;
-	}
-
-	public String getStudentAnswer() {
-		return studentAnswer;
-	}
-
-	public void setStudentAnswer(String studentAnswer) {
-		this.studentAnswer = studentAnswer;
-	}
-
-	public Double getStudentScore() {
-		return studentScore;
-	}
-
-	public void setStudentScore(Double studentScore) {
-		this.studentScore = studentScore;
-	}
-
-	public Boolean getAnswer() {
-		return isAnswer;
-	}
-
-	public void setAnswer(Boolean answer) {
-		isAnswer = answer;
-	}
-
-	public Boolean getSign() {
-		return isSign;
-	}
-
-	public void setSign(Boolean sign) {
-		isSign = sign;
-	}
-
-	public Integer[] getOptionPermutation() {
-		return optionPermutation;
-	}
-
-	public void setOptionPermutation(Integer[] optionPermutation) {
-		this.optionPermutation = optionPermutation;
-	}
-
-	public String getAudioPlayTimes() {
-		return audioPlayTimes;
-	}
-
-	public void setAudioPlayTimes(String audioPlayTimes) {
-		this.audioPlayTimes = audioPlayTimes;
-	}
-
-	public String getAnswerType() {
-		return answerType;
-	}
-
-	public void setAnswerType(String answerType) {
-		this.answerType = answerType;
-	}
-}

+ 0 - 141
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamRecordDataEntity.java

@@ -1,141 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity;
-
-import javax.persistence.Column;
-import java.io.Serializable;
-
-/**
- * @Description 考试记录实体
- * @Author lideyin
- * @Date 2020/4/25 13:23
- * @Version 1.0
- */
-public class ExamRecordDataEntity implements Serializable {
-
-    /**
-     * 主键
-     */
-    private Long id;
-
-    /**
-     * 考试作答记录id
-     */
-    private String examRecordQuestionsId;
-
-    /**
-     * 考生id
-     */
-    private Long examStudentId;
-
-    /**
-     * 课程id
-     */
-    private Long courseId;
-
-    /**
-     * 是否异常数据
-     */
-    private Boolean isWarn;
-    /**
-     * 是否被审核过
-     */
-    private Boolean isAudit;
-    /**
-     * 是否违纪
-     */
-    private Boolean isIllegality;
-
-    /**
-     * 试卷结构id
-     */
-    private String paperStructId;
-
-    /**
-     * 试卷类型
-     */
-    private String paperType;
-
-    /**
-     * 试卷id
-     */
-    private String basePaperId;
-
-    public Boolean getWarn() {
-        return isWarn;
-    }
-
-    public void setWarn(Boolean warn) {
-        isWarn = warn;
-    }
-
-    public Boolean getAudit() {
-        return isAudit;
-    }
-
-    public void setAudit(Boolean audit) {
-        isAudit = audit;
-    }
-
-    public Boolean getIllegality() {
-        return isIllegality;
-    }
-
-    public void setIllegality(Boolean illegality) {
-        isIllegality = illegality;
-    }
-
-    public Long getCourseId() {
-        return courseId;
-    }
-
-    public void setCourseId(Long courseId) {
-        this.courseId = courseId;
-    }
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public String getExamRecordQuestionsId() {
-        return examRecordQuestionsId;
-    }
-
-    public void setExamRecordQuestionsId(String examRecordQuestionsId) {
-        this.examRecordQuestionsId = examRecordQuestionsId;
-    }
-
-    public Long getExamStudentId() {
-        return examStudentId;
-    }
-
-    public void setExamStudentId(Long examStudentId) {
-        this.examStudentId = examStudentId;
-    }
-
-    public String getPaperStructId() {
-        return paperStructId;
-    }
-
-    public void setPaperStructId(String paperStructId) {
-        this.paperStructId = paperStructId;
-    }
-
-    public String getPaperType() {
-        return paperType;
-    }
-
-    public void setPaperType(String paperType) {
-        this.paperType = paperType;
-    }
-
-    public String getBasePaperId() {
-        return basePaperId;
-    }
-
-    public void setBasePaperId(String basePaperId) {
-        this.basePaperId = basePaperId;
-    }
-}

+ 0 - 68
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamRecordQuestionsEntity.java

@@ -1,68 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @Description 考生作答集合
- * @Author lideyin
- * @Date 2020/4/25 14:14
- * @Version 1.0
- */
-public class ExamRecordQuestionsEntity implements Serializable {
-    private static final long serialVersionUID = -1688201571728312142L;
-
-    private String id;
-
-    private Long examRecordDataId;
-
-    private Date creationTime;
-
-    private List<ExamQuestionEntity> examQuestionEntities;
-    
-    /**
-	 * 题目作答类型
-	 */
-	private String answerType;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public Long getExamRecordDataId() {
-        return examRecordDataId;
-    }
-
-    public void setExamRecordDataId(Long examRecordDataId) {
-        this.examRecordDataId = examRecordDataId;
-    }
-
-    public Date getCreationTime() {
-        return creationTime;
-    }
-
-    public void setCreationTime(Date creationTime) {
-        this.creationTime = creationTime;
-    }
-
-    public List<ExamQuestionEntity> getExamQuestionEntities() {
-        return examQuestionEntities;
-    }
-
-    public void setExamQuestionEntities(List<ExamQuestionEntity> examQuestionEntities) {
-        this.examQuestionEntities = examQuestionEntities;
-    }
-
-    public String getAnswerType() {
-        return answerType;
-    }
-
-    public void setAnswerType(String answerType) {
-        this.answerType = answerType;
-    }
-}

+ 0 - 105
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExamScoreEntity.java

@@ -1,105 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity;
-
-import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
-import cn.com.qmth.examcloud.web.jpa.JpaEntity;
-import org.hibernate.annotations.DynamicInsert;
-
-import javax.persistence.*;
-
-/**
- * @Description 考试分数实体
- * @Author lideyin
- * @Date 2020/4/25 15:37
- * @Version 1.0
- */
-public class ExamScoreEntity implements JsonSerializable {
-
-    private Long id;
-
-    /**
-     * 考试记录
-     */
-    private Long examRecordDataId;
-
-    /**
-     * 总分
-     */
-    private Double totalScore;
-
-    /**
-     * 客观题得分总分
-     */
-    private Double objectiveScore;
-
-    /**
-     * 客观题答对的比率
-     * (客观题答对的题数/客观题总题数)*100  取2位小数
-     */
-    private Double objectiveAccuracy;
-
-    /**
-     * 主观题得分总分
-     */
-    private Double subjectiveScore;
-
-    /**
-     * 答题正确率
-     */
-    private Double succPercent;
-
-    public Long getId() {
-        return id;
-    }
-
-    public void setId(Long id) {
-        this.id = id;
-    }
-
-    public Long getExamRecordDataId() {
-        return examRecordDataId;
-    }
-
-    public void setExamRecordDataId(Long examRecordDataId) {
-        this.examRecordDataId = examRecordDataId;
-    }
-
-    public Double getTotalScore() {
-        return totalScore;
-    }
-
-    public void setTotalScore(Double totalScore) {
-        this.totalScore = totalScore;
-    }
-
-    public Double getObjectiveScore() {
-        return objectiveScore;
-    }
-
-    public void setObjectiveScore(Double objectiveScore) {
-        this.objectiveScore = objectiveScore;
-    }
-
-    public Double getObjectiveAccuracy() {
-        return objectiveAccuracy;
-    }
-
-    public void setObjectiveAccuracy(Double objectiveAccuracy) {
-        this.objectiveAccuracy = objectiveAccuracy;
-    }
-
-    public Double getSubjectiveScore() {
-        return subjectiveScore;
-    }
-
-    public void setSubjectiveScore(Double subjectiveScore) {
-        this.subjectiveScore = subjectiveScore;
-    }
-
-    public Double getSuccPercent() {
-        return succPercent;
-    }
-
-    public void setSuccPercent(Double succPercent) {
-        this.succPercent = succPercent;
-    }
-}

+ 0 - 15
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/ExchangeBean.java

@@ -1,15 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.exchange.JsonSerializable;
-
-/**
- * bean 基类
- * 
- * @author WANGWEI
- *
- */
-public abstract class ExchangeBean implements JsonSerializable {
-
-	private static final long serialVersionUID = 3913250969569367810L;
-
-}

+ 0 - 24
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/OuterGetQuestionAnswerReq.java

@@ -1,24 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.exchange.EnterpriseRequest;
-
-/**
- * @Description 获取试题答案请求类
- * @Author lideyin
- * @Date 2020/3/30 15:25
- * @Version 1.0
- */
-public class OuterGetQuestionAnswerReq extends EnterpriseRequest {
-
-    private static final long serialVersionUID = 8303860788475413215L;
-
-    private String questionId;
-
-    public String getQuestionId() {
-        return questionId;
-    }
-
-    public void setQuestionId(String questionId) {
-        this.questionId = questionId;
-    }
-}

+ 0 - 27
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/entity/OuterGetQuestionAnswerResp.java

@@ -1,27 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.exchange.EnterpriseResponse;
-
-import java.util.List;
-
-/**
- * @Description 获取题目作答
- * @Author lideyin
- * @Date 2020/4/25 18:56
- * @Version 1.0
- */
-public class OuterGetQuestionAnswerResp extends EnterpriseResponse {
-
-	private static final long serialVersionUID = 8290190579593586203L;
-
-	//答案集合
-	private List<String> answerList;
-
-	public List<String> getAnswerList() {
-		return answerList;
-	}
-
-	public void setAnswerList(List<String> answerList) {
-		this.answerList = answerList;
-	}
-}

+ 0 - 31
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/exchange/EnterpriseRequest.java

@@ -1,31 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.exchange;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity.ExchangeBean;
-
-/**
- * 请求体基类
- * 
- * @author WANGWEI
- *
- */
-public abstract class EnterpriseRequest extends ExchangeBean {
-
-	private static final long serialVersionUID = 6465330136225230063L;
-
-	/**
-	 * 数据执行状态
-	 */
-	@Deprecated
-	private String des;
-
-	@Deprecated
-	public String getDes() {
-		return des;
-	}
-
-	@Deprecated
-	public void setDes(String des) {
-		this.des = des;
-	}
-
-}

+ 0 - 44
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/exchange/EnterpriseResponse.java

@@ -1,44 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.exchange;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity.ExchangeBean;
-
-/**
- * 响应体基类
- * 
- * @author WANGWEI
- *
- */
-public abstract class EnterpriseResponse extends ExchangeBean {
-
-	private static final long serialVersionUID = 1755304211766414171L;
-
-	/**
-	 * 耗时(毫秒)
-	 */
-	private Long cost;
-
-	/**
-	 * 数据执行状态
-	 */
-	@Deprecated
-	private String des;
-
-	public Long getCost() {
-		return cost;
-	}
-
-	public void setCost(Long cost) {
-		this.cost = cost;
-	}
-
-	@Deprecated
-	public String getDes() {
-		return des;
-	}
-
-	@Deprecated
-	public void setDes(String des) {
-		this.des = des;
-	}
-
-}

+ 0 - 16
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/exchange/JsonSerializable.java

@@ -1,16 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.exchange;
-
-import java.io.Serializable;
-
-/**
- * 可序列化为JSON<br>
- * <p>
- * 严重警告: 此接口为标识接口,禁止添加属性和方法. by wangwei
- * </p>
- * 
- * @author WANGWEI
- *
- */
-public interface JsonSerializable extends Serializable {
-
-}

+ 0 - 58
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/util/FormFilePart.java

@@ -1,58 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util;
-
-import java.io.File;
-
-/**
- * 表单文件参数
- *
- * @author WANGWEI
- * @date 2019年5月9日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class FormFilePart {
-
-	private String paramName;
-
-	private String filename;
-
-	private File file;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param paramName
-	 * @param filename
-	 * @param file
-	 */
-	public FormFilePart(String paramName, String filename, File file) {
-		super();
-		this.paramName = paramName;
-		this.filename = filename;
-		this.file = file;
-	}
-
-	public String getParamName() {
-		return paramName;
-	}
-
-	public void setParamName(String paramName) {
-		this.paramName = paramName;
-	}
-
-	public String getFilename() {
-		return filename;
-	}
-
-	public void setFilename(String filename) {
-		this.filename = filename;
-	}
-
-	public File getFile() {
-		return file;
-	}
-
-	public void setFile(File file) {
-		this.file = file;
-	}
-
-}

+ 0 - 328
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/util/OKHttpUtil.java

@@ -1,328 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util;
-
-import java.io.IOException;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.TimeUnit;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.TrustManager;
-
-import org.apache.commons.collections.CollectionUtils;
-
-import cn.com.qmth.dp.examcloud.oe.modules.load_question_cache.TrustAllTrustManager;
-import cn.com.qmth.examcloud.commons.util.HttpMethod;
-import okhttp3.FormBody;
-import okhttp3.MediaType;
-import okhttp3.MultipartBody;
-import okhttp3.OkHttpClient;
-import okhttp3.Request;
-import okhttp3.Request.Builder;
-import okhttp3.RequestBody;
-import okhttp3.Response;
-
-/**
- * OKHttp
- *
- * @author WANGWEI
- * @date 2018年9月6日
- * @Copyright (c) 2018-2020 WANGWEI [QQ:522080330] All Rights Reserved.
- */
-public class OKHttpUtil {
-
-//	private static final Logger LOG = LoggerFactory.getLogger(OKHttpUtil.class);
-
-	public static final class MediaTypes {
-
-		public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
-	}
-
-	/**
-	 * 请求体构建器
-	 *
-	 * @author WANGWEI
-	 * @date 2019年4月10日
-	 * @Copyright (c) 2018-2020 WANGWEI [QQ:522080330] All Rights Reserved.
-	 */
-	public static interface RequestBodyBuilder {
-		RequestBody build();
-	}
-
-	/**
-	 * json请求体构建器
-	 *
-	 * @author WANGWEI
-	 * @date 2019年4月10日
-	 * @Copyright (c) 2018-2020 WANGWEI [QQ:522080330] All Rights Reserved.
-	 */
-	public static final class JsonBodyBuilder implements RequestBodyBuilder {
-
-		private String json;
-
-		public JsonBodyBuilder(String json) {
-			super();
-			this.json = json;
-		}
-
-		@Override
-		public RequestBody build() {
-			return RequestBody.create(MediaTypes.JSON, json);
-		}
-
-		@Override
-		public String toString() {
-			return json;
-		}
-	}
-
-	private static OkHttpClient okHttpClient;
-
-	static {
-		SSLContext sslContext = null;
-		try {
-			sslContext = SSLContext.getInstance("TLS");
-			sslContext.init(null, new TrustManager[]{new TrustAllTrustManager()}, null);
-		} catch (KeyManagementException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (NoSuchAlgorithmException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		okHttpClient = new OkHttpClient.Builder().connectTimeout(60, TimeUnit.SECONDS)
-				.readTimeout(60, TimeUnit.SECONDS).sslSocketFactory(sslContext.getSocketFactory(), new TrustAllTrustManager()).hostnameVerifier(new HostnameVerifier() {
-					
-					@Override
-					public boolean verify(String hostname, SSLSession session) {
-						return true;
-					}
-				}).build();
-	}
-
-	public static OkHttpClient getOkHttpClient() {
-		return okHttpClient;
-	}
-
-	/**
-	 * 发送请求 (带json请求体)
-	 *
-	 * @author WANGWEI
-	 * @param httpMethod
-	 * @param url
-	 * @param headers
-	 * @param jsonBody
-	 * @return
-	 */
-	public static Response call(HttpMethod httpMethod, String url, Map<String, String> headers,
-								String jsonBody) {
-		return call(httpMethod, url, headers, new JsonBodyBuilder(jsonBody));
-	}
-
-	/**
-	 * 发送请求 (带请求体)
-	 *
-	 * @author WANGWEI
-	 * @param httpMethod
-	 * @param url
-	 * @param headers
-	 * @param requestBodyBuilder
-	 * @return
-	 */
-	public static Response call(HttpMethod httpMethod, String url, Map<String, String> headers,
-			RequestBodyBuilder requestBodyBuilder) {
-
-		/*LOG.info("[okhttp3] new call: " + httpMethod + " " + url);
-		LOG.info("[okhttp3] headers: " + JsonUtil.toJson(headers));
-		LOG.info("[okhttp3] body: " + requestBodyBuilder);*/
-
-		Builder builder = null;
-		if (httpMethod.equals(HttpMethod.POST)) {
-			builder = new Builder().url(url).post(requestBodyBuilder.build());
-		} else if (httpMethod.equals(HttpMethod.PUT)) {
-			builder = new Builder().url(url).put(requestBodyBuilder.build());
-		} else if (httpMethod.equals(HttpMethod.DELETE)) {
-			builder = new Builder().url(url).delete(requestBodyBuilder.build());
-		}
-
-		if (null != headers && 0 != headers.size()) {
-			for (Entry<String, String> entry : headers.entrySet()) {
-				builder.addHeader(entry.getKey(), entry.getValue());
-			}
-		}
-
-		Request request = builder.build();
-
-		Response response = null;
-		try {
-			response = okHttpClient.newCall(request).execute();
-			return response;
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * 发送请求
-	 *
-	 * @author WANGWEI
-	 * @param httpMethod
-	 * @param url
-	 * @return
-	 */
-	public static Response call(HttpMethod httpMethod, String url) {
-		return call(httpMethod, url, null);
-	}
-
-	/**
-	 * 发送请求
-	 *
-	 * @author WANGWEI
-	 * @param httpMethod
-	 * @param url
-	 * @param headers
-	 * @return
-	 */
-	public static Response call(HttpMethod httpMethod, String url, Map<String, String> headers) {
-
-//		LOG.info("[okhttp3] new call: " + httpMethod + " " + url);
-//		LOG.info("[okhttp3] headers: " + JsonUtil.toJson(headers));
-
-		Builder builder = null;
-		if (httpMethod.equals(HttpMethod.GET)) {
-			builder = new Builder().url(url);
-		} else if (httpMethod.equals(HttpMethod.POST)) {
-			builder = new Builder().url(url).post(new FormBody.Builder().build());
-		} else if (httpMethod.equals(HttpMethod.PUT)) {
-			builder = new Builder().url(url).put(new FormBody.Builder().build());
-		} else if (httpMethod.equals(HttpMethod.DELETE)) {
-			builder = new Builder().url(url).delete(new FormBody.Builder().build());
-		}
-
-		if (null != headers && 0 != headers.size()) {
-			for (Entry<String, String> entry : headers.entrySet()) {
-				builder.addHeader(entry.getKey(), entry.getValue());
-			}
-		}
-
-		Request request = builder.build();
-
-		Response response = null;
-		try {
-			response = okHttpClient.newCall(request).execute();
-			return response;
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * 发送请求 (表单)
-	 *
-	 * @author WANGWEI
-	 * @param httpMethod
-	 * @param url
-	 * @param headers
-	 * @param params
-	 * @return
-	 */
-	public static Response call(HttpMethod httpMethod, String url, Map<String, String> headers,
-			Map<String, String> params) {
-
-//		LOG.info("[okhttp3] new call: " + httpMethod + " " + url);
-//		LOG.info("[okhttp3] headers: " + JsonUtil.toJson(headers));
-//		LOG.info("[okhttp3] params: " + JsonUtil.toJson(params));
-
-		FormBody.Builder formBody = new FormBody.Builder();
-
-		if (null != params && 0 != params.size()) {
-			for (Entry<String, String> entry : params.entrySet()) {
-				formBody.add(entry.getKey(), entry.getValue());
-			}
-		}
-
-		Builder builder = null;
-		if (httpMethod.equals(HttpMethod.POST)) {
-			builder = new Builder().url(url).post(formBody.build());
-		} else if (httpMethod.equals(HttpMethod.PUT)) {
-			builder = new Builder().url(url).put(formBody.build());
-		} else if (httpMethod.equals(HttpMethod.DELETE)) {
-			builder = new Builder().url(url).delete(formBody.build());
-		}
-
-		if (null != headers && 0 != headers.size()) {
-			for (Entry<String, String> entry : headers.entrySet()) {
-				builder.addHeader(entry.getKey(), entry.getValue());
-			}
-		}
-
-		Request request = builder.build();
-
-		Response response = null;
-		try {
-			response = okHttpClient.newCall(request).execute();
-			return response;
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * 发送请求 (包含文件表单)
-	 *
-	 * @author WANGWEI
-	 * @param httpMethod
-	 * @param url
-	 * @param headers
-	 * @param params
-	 * @param formFilePartList
-	 * @return
-	 */
-	public static Response call(HttpMethod httpMethod, String url, Map<String, String> headers,
-			Map<String, String> params, List<FormFilePart> formFilePartList) {
-
-//		LOG.info("[okhttp3] new call: " + httpMethod + " " + url);
-//		LOG.info("[okhttp3] headers: " + JsonUtil.toJson(headers));
-//		LOG.info("[okhttp3] params: " + JsonUtil.toJson(params));
-
-		MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder()
-				.setType(MultipartBody.ALTERNATIVE);
-
-		if (null != params) {
-			for (Entry<String, String> entry : params.entrySet()) {
-				multipartBodyBuilder.addFormDataPart(entry.getKey(), entry.getValue());
-			}
-		}
-
-		if (CollectionUtils.isNotEmpty(formFilePartList)) {
-			MediaType type = MediaType.parse("application/octet-stream");
-			for (FormFilePart part : formFilePartList) {
-				RequestBody fileBody = RequestBody.create(type, part.getFile());
-				multipartBodyBuilder.addFormDataPart(part.getParamName(), part.getFilename(),
-						fileBody);
-			}
-		}
-
-		Builder builder = new Builder().url(url).post(multipartBodyBuilder.build());
-		if (null != headers && 0 != headers.size()) {
-			for (Entry<String, String> entry : headers.entrySet()) {
-				builder.addHeader(entry.getKey(), entry.getValue());
-			}
-		}
-
-		Request request = builder.build();
-
-		Response response = null;
-		try {
-			response = okHttpClient.newCall(request).execute();
-			return response;
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-	}
-
-}

+ 0 - 156
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_correct_answer/util/QmthUtil.java

@@ -1,156 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util;
-
-import cn.com.qmth.examcloud.commons.util.ByteUtil;
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
-import cn.com.qmth.examcloud.commons.util.SHA256;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 启明泰和-接口安全工具
- *
- * @author WANGWEI
- * @date 2018年11月23日
- * @Copyright (c) 2018-2020 WANGWEI [QQ:522080330] All Rights Reserved.
- */
-public class QmthUtil {
-
-	/**
-	 * 获取安全请求头信息
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	public static Map<String, String> getSecurityHeaders() {
-
-		long timestamp = System.currentTimeMillis();
-		String rootOrgId = String.valueOf(getRootOrgId());
-		String appId = PropertiesUtil.getString("qmth.appId");
-		String secretKey = PropertiesUtil.getString("qmth.secretKey");
-
-		StringBuilder sb = new StringBuilder();
-		sb.append(rootOrgId).append(appId).append(timestamp).append(secretKey);
-
-		byte[] bytes = SHA256.encode(sb.toString());
-		String accessToken = ByteUtil.toHexAscii(bytes);
-
-		Map<String, String> headers = new HashMap<String, String>();
-
-		headers.put("rootOrgId", String.valueOf(rootOrgId));
-		headers.put("timestamp", String.valueOf(timestamp));
-		headers.put("appId", appId);
-		headers.put("access_token", accessToken);
-
-		return headers;
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	public static Long getRootOrgId() {
-		Long rootOrgId = PropertiesUtil.getLong("qmth.rootOrgId", -1L);
-		return rootOrgId;
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 */
-	public static String buildCommonUserAccessUrl(String loginName) {
-		String rootOrgId = String.valueOf(getRootOrgId());
-		long timestamp = System.currentTimeMillis();
-		String appId =  PropertiesUtil.getString("qmth.appId");
-		String secretKey =  PropertiesUtil.getString("qmth.secretKey");
-		String accessUrl =  PropertiesUtil.getString("qmth.commonUserAccessUrl");
-
-		StringBuilder sb = new StringBuilder();
-		sb.append(loginName).append(rootOrgId).append(appId).append(timestamp).append(secretKey);
-
-		byte[] bytes = SHA256.encode(sb.toString());
-		String accessToken = ByteUtil.toHexAscii(bytes);
-
-		StringBuilder params = new StringBuilder();
-		params.append("loginName").append("=").append(urlEncode(loginName));
-		params.append("&").append("orgId").append("=").append(rootOrgId);
-		params.append("&").append("appId").append("=").append(appId);
-		params.append("&").append("timestamp").append("=").append(timestamp);
-		params.append("&").append("token").append("=").append(accessToken);
-
-		return accessUrl + "?" + params.toString();
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 */
-	public static String buildStudentAccessUrl(String accountType, String accountValue) {
-		String rootOrgId = String.valueOf(getRootOrgId());
-		long timestamp = System.currentTimeMillis();
-		String appId =  PropertiesUtil.getString("qmth.appId");
-		String secretKey =  PropertiesUtil.getString("qmth.secretKey");
-		String accessUrl =  PropertiesUtil.getString("qmth.studentAccessUrl");
-
-		StringBuilder sb = new StringBuilder();
-		sb.append(accountType).append(accountValue).append(rootOrgId).append(appId)
-				.append(timestamp).append(secretKey);
-
-		byte[] bytes = SHA256.encode(sb.toString());
-		String accessToken = ByteUtil.toHexAscii(bytes);
-
-		StringBuilder params = new StringBuilder();
-		params.append("accountType").append("=").append(urlEncode(accountType));
-		params.append("&").append("accountValue").append("=").append(urlEncode(accountValue));
-		params.append("&").append("rootOrgId").append("=").append(rootOrgId);
-		params.append("&").append("appId").append("=").append(appId);
-		params.append("&").append("timestamp").append("=").append(timestamp);
-		params.append("&").append("token").append("=").append(accessToken);
-
-		return accessUrl + "?" + params.toString();
-	}
-
-	/**
-	 * 方法注释
-	 *
-	 * @author WANGWEI
-	 * @param s
-	 * @return
-	 */
-	private static String urlEncode(String s) {
-		try {
-			return URLEncoder.encode(s, "UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * 构建URL
-	 *
-	 * @author WANGWEI
-	 * @param uri
-	 * @return
-	 */
-	public static String buildUrl(String uri) {
-		String host =  PropertiesUtil.getString("qmth.server.host");
-		String port =  PropertiesUtil.getString("qmth.server.port");
-		StringBuilder sb = new StringBuilder();
-
-		sb.append("http://").append(host).append(":").append(port);
-
-		if (!uri.startsWith("/")) {
-			sb.append("/");
-		}
-		sb.append(uri);
-
-		return sb.toString();
-	}
-
-}

+ 0 - 650
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/UpdateQuestionScoreService.java

@@ -1,650 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_question_score;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.entity.*;
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util.OKHttpUtil;
-import cn.com.qmth.dp.examcloud.oe.modules.update_correct_answer.util.QmthUtil;
-import cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity.*;
-import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.commons.util.HttpMethod;
-import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
-import com.mongodb.client.result.UpdateResult;
-import com.mysql.cj.util.StringUtils;
-import okhttp3.Response;
-import org.apache.commons.io.IOUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.data.mongodb.core.query.Update;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Service;
-
-import java.io.*;
-import java.text.DecimalFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-
-/**
- * @Description 更新小题分数(涉及到分数重新计算,待阅卷表的数据重新更新)
- * @Author lideyin
- * @Date 2020/5/25 14:51
- * @Version 1.0
- */
-@Service
-public class UpdateQuestionScoreService {
-
-    @Autowired
-    JdbcTemplate jdbcTemplate;
-
-    @Autowired
-    MongoTemplate mongoTemplate;
-
-    //试卷结构本地缓存
-    private final Map<String, DefaultPaperBean> paperCacheMap = new HashMap<>();
-
-    //小题标准答案本地缓存
-    private final Map<String, List<String>> rightAnswerCacheMap = new HashMap<>();
-
-    //部分平面化的试卷结构缓存
-    private final Map<String, Map<String, Object>> partialFacetPaperCacheMap = new HashMap<>();
-
-    //没有标答的小题id
-    private Set<String> noAnswerQuestionIdSet = new HashSet<>();
-
-    @Async
-    public void start() {
-
-        String absolutePath = PropertiesUtil.getString("fixAnswer.data.path");
-//        ClassPathResource classPathResource = new ClassPathResource("temp1.txt");
-        FileInputStream fis = null;
-        InputStreamReader isr = null;
-        BufferedReader br = null;
-
-        try {
-            fis = new FileInputStream(new File(absolutePath));
-            isr = new InputStreamReader(fis);
-            br = new BufferedReader(isr);
-            String strExamIdAndCourseCode = "";
-            while ((strExamIdAndCourseCode = br.readLine()) != null) {
-                Long examId = Long.valueOf(strExamIdAndCourseCode.split(",")[0]);
-                String courseCode = strExamIdAndCourseCode.split(",")[1];
-                System.out.println(String.format("examId:%s,courseCode:%s", examId, courseCode));
-                run(examId, courseCode);
-                Thread.sleep(10);
-                //19,"03013750"
-            }
-
-        } catch (IOException e) {
-            e.printStackTrace();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        } finally {
-            if (br != null) {
-                try {
-                    br.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (isr != null) {
-                try {
-                    isr.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-
-            if (fis != null) {
-                try {
-                    fis.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-
-    }
-
-    public void run(long examId, String courseCode) {
-        List<ExamRecordDataEntity> examRecordDataList = queryExamRecordDataList(examId, courseCode);
-
-        if (examRecordDataList.isEmpty()) {
-            throw new StatusException("100001", "找不到对应的考试记录");
-        }
-
-        //首先更新mongo中的作答记录
-        modifyMongoQuestionScore(examRecordDataList, examId, courseCode);
-
-        //重新计算分数并保存
-        modifyDbScore(examRecordDataList);
-
-        //如果存在,则打印错误数据
-        printErrorDataIfExist();
-
-        System.out.println("999.all is over.....");
-    }
-
-    private void printErrorDataIfExist() {
-        if (noAnswerQuestionIdSet.size() > 0) {
-            for (String quesId : noAnswerQuestionIdSet)
-                System.out.println(String.format("找不到quesId=%s的标答数据", quesId));
-        }
-    }
-
-    private void modifyDbScore(List<ExamRecordDataEntity> examRecordDataList) {
-        Set<Long> examStudentIdSet = new HashSet<>();
-        int effectiveNum = 0;//有效数量
-        //按考试记录更新分数表
-        for (ExamRecordDataEntity record : examRecordDataList) {
-            Query query = new Query();
-            query.addCriteria(Criteria.where("_id").is(record.getExamRecordQuestionsId()));
-            ExamRecordQuestionsEntity erq = mongoTemplate.findOne(query, ExamRecordQuestionsEntity.class, "examRecordQuestions");
-            if (erq == null) continue;
-
-            List<ExamQuestionEntity> objectiveQuesList = erq.getExamQuestionEntities().stream()
-                    .filter(p -> isObjectiveQues(p.getQuestionType())).collect(Collectors.toList());
-
-            double objectiveScore = calcTotalObjectiveScore(objectiveQuesList);
-            double objectiveAccuracy = calcTotalObjectiveAccuracy(objectiveQuesList);
-
-            updateExamScore(objectiveScore, objectiveAccuracy, record.getId());
-            updateExamRecord4Marking(objectiveScore, record.getId());
-            System.out.println(String.format("2.更新第%d条分数成功---examRecordDataId=%s", ++effectiveNum, record.getId()));
-            examStudentIdSet.add(record.getExamStudentId());
-        }
-
-//        int esNum = 0;
-//        //按考生id,删除考生最终分数表(此表如果不存在数据,获取时,系统会重新计算)
-//        for (Long estId : examStudentIdSet) {
-//            deleteFinalScore(estId);
-//            System.out.println(String.format("3.删除第%d条最终分数成功---examStudentId=%s", ++esNum, estId));
-//        }
-
-    }
-
-    private void deleteFinalScore(Long estId) {
-        String strSql = String.format("delete from ec_oe_exam_student_final_score where exam_student_id=%d ", estId);
-
-        jdbcTemplate.execute(strSql);
-    }
-
-    /**
-     * 计算客观题总分
-     *
-     * @param objectiveQuesList
-     * @return
-     */
-    private double calcTotalObjectiveScore(List<ExamQuestionEntity> objectiveQuesList) {
-        double totalObjectiveScore = 0d;//客观题总分
-
-        for (ExamQuestionEntity eq : objectiveQuesList) {
-            if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
-                    && !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
-                    && eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
-                totalObjectiveScore += eq.getQuestionScore();
-            }
-        }
-
-        return totalObjectiveScore;
-    }
-
-    /**
-     * 计算客观题正确率
-     *
-     * @param objectiveQuesList
-     * @return
-     */
-    private double calcTotalObjectiveAccuracy(List<ExamQuestionEntity> objectiveQuesList) {
-        double correctNum = 0d;
-        double totalNum = 0d;
-        for (ExamQuestionEntity eq : objectiveQuesList) {
-            if (!StringUtils.isNullOrEmpty(eq.getStudentAnswer())
-                    && !StringUtils.isNullOrEmpty(eq.getCorrectAnswer())
-                    && eq.getStudentAnswer().equals(eq.getCorrectAnswer())) {
-                correctNum += 1;
-            }
-            totalNum += 1;
-        }
-
-        if (totalNum == 0) {
-            return 0;
-        }
-
-        return Double.valueOf(new DecimalFormat("#.00").format(correctNum * 100D / totalNum));
-    }
-
-    /**
-     * 更新作答记录中的小题分数
-     *
-     * @param examRecordDataList
-     */
-    private void modifyMongoQuestionScore(List<ExamRecordDataEntity> examRecordDataList, long examId, String courseCode) {
-        int rubbishNum = 0;
-        int effectiveNum = 0;//有效数量
-        int rubbishNum2 = 0;
-        int effectiveNum2 = 0;//有效数量
-        for (ExamRecordDataEntity record : examRecordDataList) {
-            //更新作答记录中的小题分数
-            try {
-                String examRecordQuestionsId = record.getExamRecordQuestionsId();
-                Query query = new Query();
-                query.addCriteria(Criteria.where("_id").is(examRecordQuestionsId));
-                //作答记录
-                ExamRecordQuestionsEntity erq = mongoTemplate.findOne(query, ExamRecordQuestionsEntity.class, "examRecordQuestions");
-
-                if (erq == null) {
-                    System.out.println(String.format("1.作答记录发现%d条垃圾数据:examRecordDataId=%s", ++rubbishNum, record.getId()));
-                    continue;//垃圾数据
-                }
-
-                List<ExamQuestionEntity> examQuestionList = erq.getExamQuestionEntities();
-
-                for (ExamQuestionEntity ques : examQuestionList) {
-                    String quesId = ques.getQuestionId();
-
-                    //最小维度的小题单元集合
-                    List<ExamQuestionEntity> questionUnitList = examQuestionList.stream()
-                            .filter(p -> p.getQuestionId().equals(quesId))
-                            .sorted((o1, o2) -> o1.getOrder().intValue() - o2.getOrder().intValue())
-                            .collect(Collectors.toList());
-                    //根据题目id获取标答集合
-                    List<String> rightAnswerList = getRightAnswerList(quesId);
-                    if (rightAnswerList == null) {
-                        noAnswerQuestionIdSet.add(quesId);
-                    }
-
-                    //根据题目id获取小题分集合
-                    List<Double> questionScoreList =
-                            getQuestionScoreList(quesId, examId, courseCode, record.getPaperType(), record.getBasePaperId());
-
-                    //循环保存所有小题单元
-                    for (int i = 0; i < questionUnitList.size(); i++) {
-                        Double questionScore = questionScoreList.get(i);
-                        //更新小题分数
-                        updateQuestionScore(examRecordQuestionsId, ques.getOrder(), questionScore);
-
-                        //如果为客观题重新算分并保存
-                        if (isObjectiveQues(ques.getQuestionType())) {
-                            String rightAnswer = rightAnswerList.get(i);
-                            if (!StringUtils.isNullOrEmpty(rightAnswer)) {
-                                ExamQuestionEntity curQues = questionUnitList.get(i);
-
-                                updatePartialQuestionAnswer(examRecordQuestionsId, curQues.getOrder(),
-                                        rightAnswer, calcStudentUnitScore(rightAnswer, curQues.getStudentAnswer(), questionScore));
-                            }
-                        }
-                    }
-                }
-                System.out.println(String.format("1.更新第%d条作答记录成功---examRecordDataId=%s", ++effectiveNum, record.getId()));
-            } catch (Exception e) {
-                System.out.println(String.format("1.更新第%d条作答记录失败---examRecordDataId=%s", ++effectiveNum, record.getId()));
-                throw new StatusException("100002", e.getMessage(), e);
-            }
-
-            //更新试卷结构中的小题分数
-            try {
-                String paperStructId = record.getPaperStructId();
-                Query query = new Query();
-                query.addCriteria(Criteria.where("_id").is(paperStructId));
-                //试卷结构
-                ExamRecordPaperStructBean paperStructBean = mongoTemplate.findOne(query, ExamRecordPaperStructBean.class, "examRecordPaperStruct");
-
-                if (paperStructBean == null) {
-                    System.out.println(String.format("1.2.试卷结构发现%d条垃圾数据:examRecordDataId=%s", ++rubbishNum2, record.getId()));
-                    continue;//垃圾数据
-                }
-
-                DefaultPaperBean defaultPaper = paperStructBean.getDefaultPaper();
-
-                //题组
-                List<DefaultQuestionGroupBean> questionGroupList = defaultPaper.getQuestionGroupList();
-                for (DefaultQuestionGroupBean group : questionGroupList) {
-                    //题包装器
-                    List<DefaultQuestionStructureWrapperBean> questionWrapperList = group.getQuestionWrapperList();
-                    for (DefaultQuestionStructureWrapperBean qw : questionWrapperList) {
-                        Map<String, Object> partialFacetPaper =
-                                getPartialFacetPaper(qw.getQuestionId(), examId, courseCode, record.getPaperType(), record.getBasePaperId());
-                        if (null != partialFacetPaper) {
-                            if (null != partialFacetPaper.get("groupScore")) {
-                                group.setGroupScore(Double.valueOf(partialFacetPaper.get("groupScore").toString()));
-                            }
-
-                            if (null != partialFacetPaper.get("questionWrapperScore")) {
-                                qw.setQuestionScore(Double.valueOf(partialFacetPaper.get("questionWrapperScore").toString()));
-                            }
-
-                            if (null != partialFacetPaper.get("questionUnitList")) {
-                                List<DefaultQuestionUnitWrapperBean> questionUnitList =
-                                        (List<DefaultQuestionUnitWrapperBean>) partialFacetPaper.get("questionUnitList");
-
-                                List<DefaultQuestionUnitWrapperBean> questionUnitWrapperList = qw.getQuestionUnitWrapperList();
-                                for (int i = 0; i < questionUnitWrapperList.size(); i++) {
-                                    questionUnitWrapperList.get(i).setQuestionScore(questionUnitList.get(i).getQuestionScore());
-                                }
-                            }
-
-                        }
-                    }
-
-                }
-
-                //更新修改后的试卷结构
-                mongoTemplate.save(paperStructBean, "examRecordPaperStruct");
-                System.out.println(String.format("1.2.更新第%d条试卷结构数据成功---examRecordDataId=%s,paperStructId=%s",
-                        ++effectiveNum2, record.getId(), record.getPaperStructId()));
-
-            } catch (Exception e) {
-                System.out.println(String.format("1.2.更新第%d条试卷结构数据失败---examRecordDataId=%s,paperStructId=%s",
-                        ++effectiveNum2, record.getId(), record.getPaperStructId()));
-                throw new StatusException("100003", e.getMessage(), e);
-            }
-
-        }
-    }
-
-    /**
-     * 获取当前考试id下的所有小题分集合
-     *
-     * @param questionId
-     * @param examId
-     * @param courseCode
-     * @param paperType
-     * @param basePaperId
-     * @return
-     */
-    private List<Double> getQuestionScoreList(String questionId, Long examId, String courseCode,
-                                              String paperType, String basePaperId) {
-
-        Map<String, Object> partialFacetPaper = getPartialFacetPaper(questionId, examId, courseCode, paperType, basePaperId);
-        if (null == partialFacetPaper) {
-            return null;
-        }
-
-        List<DefaultQuestionUnitWrapperBean> questionUnitList = (List<DefaultQuestionUnitWrapperBean>) partialFacetPaper.get("questionUnitList");
-
-        return questionUnitList.stream()
-                .map(DefaultQuestionUnitWrapperBean::getQuestionScore).collect(Collectors.toList());
-    }
-
-    /**
-     * 获取部分平面化的试卷信息
-     *
-     * @param questionId
-     * @param examId
-     * @param courseCode
-     * @param paperType
-     * @param basePaperId
-     * @return
-     */
-    private Map<String, Object> getPartialFacetPaper(String questionId, Long examId, String courseCode,
-                                                     String paperType, String basePaperId) {
-        String cacheKey = String.format("questionScore_%s", questionId);
-        if (partialFacetPaperCacheMap.containsKey(cacheKey)) {
-            return partialFacetPaperCacheMap.get(cacheKey);
-        }
-
-        DefaultPaperBean defaultPaper = getPaper(examId, courseCode, paperType, basePaperId);
-        if (null == defaultPaper) {
-            return null;
-        }
-
-        Map<String, Object> resultMap = new HashMap<>();
-        List<DefaultQuestionGroupBean> questionGroupList = defaultPaper.getQuestionGroupList();
-        for (DefaultQuestionGroupBean group : questionGroupList) {
-            List<DefaultQuestionStructureWrapperBean> questionWrapperList = group.getQuestionWrapperList();
-            for (DefaultQuestionStructureWrapperBean qw : questionWrapperList) {
-                if (qw.getQuestionId().equals(questionId)) {
-                    Map<String, Object> curQuestionMap = new HashMap<>();
-                    //当前试题id对应的题组分数
-                    curQuestionMap.put("groupScore", group.getGroupScore());
-                    //当前试题id对应的题包装器分数
-                    curQuestionMap.put("questionWrapperScore", qw.getQuestionScore());
-                    //当前试题id对应的题单元集合
-                    curQuestionMap.put("questionUnitList", qw.getQuestionUnitWrapperList());
-
-                    partialFacetPaperCacheMap.put(cacheKey, curQuestionMap);
-                    return curQuestionMap;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    private DefaultPaperBean getPaper(Long examId, String courseCode,
-                                      String paperType, String basePaperId) {
-        String cacheKey = String.format("paper_%s_%s_%s_%s", examId, courseCode, paperType, basePaperId);
-        if (paperCacheMap.containsKey(cacheKey)) {
-            return paperCacheMap.get(cacheKey);
-        }
-
-        OuterGetPaperStructReq reqBody = new OuterGetPaperStructReq();
-        reqBody.setBasePaperId(basePaperId);
-        reqBody.setCourseCode(courseCode);
-        reqBody.setExamId(examId);
-        reqBody.setPaperType(paperType);
-
-        String url = QmthUtil.buildUrl("/api/exchange/outer/question/getPaperStruct");
-        Response resp = null;
-        try {
-            resp = OKHttpUtil.call(HttpMethod.POST, url, QmthUtil.getSecurityHeaders(),
-                    JsonUtil.toJson(reqBody));
-            if (resp.code() == 200) {
-                String resultJson = resp.body().string();
-                OuterGetPaperStructResp outerGetQuestionAnswerResp = JsonUtil.fromJson(resultJson, OuterGetPaperStructResp.class);
-
-                DefaultPaperBean defaultPaper = outerGetQuestionAnswerResp.getDefaultPaper();
-                paperCacheMap.putIfAbsent(cacheKey, defaultPaper);
-
-                return defaultPaper;
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new StatusException("102002", e.getMessage(), e);
-        } finally {
-            IOUtils.closeQuietly(resp);
-        }
-        return null;
-    }
-
-    /**
-     * 计算学生的小题得分
-     *
-     * @param rightAnswer
-     * @param studentAnswer
-     * @param questionScore
-     * @return
-     */
-    private Double calcStudentUnitScore(String rightAnswer, String studentAnswer, Double questionScore) {
-        Double studentUnitScore = 0D;
-        if (!StringUtils.isNullOrEmpty(rightAnswer)
-                && !(StringUtils.isNullOrEmpty(studentAnswer))
-                && rightAnswer.equals(studentAnswer)) {
-            studentUnitScore = questionScore;
-        }
-        return studentUnitScore;
-    }
-
-    /**
-     * 获取题目正确答案
-     *
-     * @param quesId
-     * @return
-     */
-    private List<String> getRightAnswerList(String quesId) {
-//        if (1 == 1) {
-//            List<String> list = new ArrayList<>();
-//            list.add("2");
-//            list.add("2");
-//            list.add("2");
-//            list.add("2");
-//            list.add("2");
-//            list.add("2");
-//            return list;
-//        }
-
-        if (rightAnswerCacheMap.containsKey(quesId)) {
-            return rightAnswerCacheMap.get(quesId);
-        }
-
-        OuterGetQuestionAnswerReq reqBody = new OuterGetQuestionAnswerReq();
-        reqBody.setQuestionId(quesId);
-
-        String url = QmthUtil.buildUrl("/api/exchange/outer/question/getQuestionAnswer");
-        Response resp = null;
-        try {
-            resp = OKHttpUtil.call(HttpMethod.POST, url, QmthUtil.getSecurityHeaders(),
-                    JsonUtil.toJson(reqBody));
-            if (resp.code() == 200) {
-                String resultJson = resp.body().string();
-                OuterGetQuestionAnswerResp outerGetQuestionAnswerResp = JsonUtil.fromJson(resultJson, OuterGetQuestionAnswerResp.class);
-
-                rightAnswerCacheMap.putIfAbsent(quesId, outerGetQuestionAnswerResp.getAnswerList());
-                return outerGetQuestionAnswerResp.getAnswerList();
-
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new StatusException("102002", e.getMessage(), e);
-        } finally {
-            IOUtils.closeQuietly(resp);
-        }
-        return null;
-    }
-
-    /**
-     * 是否为客观题
-     *
-     * @param questionType
-     * @return
-     */
-    private boolean isObjectiveQues(String questionType) {
-        return "SINGLE_CHOICE".equals(questionType)
-                || "MULTIPLE_CHOICE".equals(questionType)
-                || "TRUE_OR_FALSE".equals(questionType);
-    }
-
-    private List<ExamRecordDataEntity> queryExamRecordDataList(Long examId, String courseCode) {
-        String strSql = String.format("SELECT " +
-                "t1.`id`, " +
-                "t1.`exam_student_id`, " +
-                "t1.`paper_struct_id`, " +
-                "t1.`paper_type`, " +
-                "t1.`base_paper_id`, " +
-                "t1.exam_record_questions_id " +
-                "FROM " +
-                "ec_oe_exam_record_data t1 " +
-                "INNER JOIN ec_b_course t2 ON t1.course_id = t2.id " +
-                "WHERE " +
-                "t1.exam_id = %d " +
-                "AND t2.`code` ='%s' ", examId, courseCode);
-
-        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(strSql);
-        List<ExamRecordDataEntity> resultList = new ArrayList<>();
-        for (Map<String, Object> map : mapList) {
-            ExamRecordDataEntity entity = new ExamRecordDataEntity();
-            if (map.get("id") != null) {
-                entity.setId(Long.valueOf(map.get("id").toString()));
-            }
-
-            if (map.get("exam_student_id") != null) {
-                entity.setExamStudentId(Long.valueOf(map.get("exam_student_id").toString()));
-            }
-
-            if (map.get("exam_record_questions_id") != null) {
-                entity.setExamRecordQuestionsId(map.get("exam_record_questions_id").toString());
-            }
-
-            if (map.get("paper_struct_id") != null) {
-                entity.setPaperStructId(map.get("paper_struct_id").toString());
-            }
-
-            if (map.get("paper_type") != null) {
-                entity.setPaperType(map.get("paper_type").toString());
-            }
-
-            if (map.get("base_paper_id") != null) {
-                entity.setBasePaperId(map.get("base_paper_id").toString());
-            }
-            resultList.add(entity);
-        }
-        return resultList;
-    }
-
-    private void updateExamScore(double objectiveScore, double objectiveAccuracy,
-                                 Long examRecordDataId) {
-        String strSql = String.format("UPDATE ec_oe_exam_score " +
-                "SET objective_score = %s, " +
-                "objective_accuracy = %s, " +
-                "total_score = objective_score+ IFNULL(subjective_score,0) " +
-                "WHERE " +
-                "exam_record_data_id = %d  ", objectiveScore, objectiveAccuracy, examRecordDataId);
-
-        jdbcTemplate.execute(strSql);
-    }
-
-    private void updateExamRecord4Marking(double objectiveScore, Long examRecordDataId) {
-        String strSql = String.format("UPDATE ec_oe_exam_record_4_marking " +
-                "SET objective_score = %s " +
-                "WHERE " +
-                " exam_record_data_id = %s ", objectiveScore, examRecordDataId);
-
-        jdbcTemplate.execute(strSql);
-    }
-
-    /**
-     * 更新小题分数
-     *
-     * @param examRecordQuestionsId
-     * @param order
-     * @param newQuestionScore
-     * @return
-     */
-    public long updateQuestionScore(String examRecordQuestionsId, Integer order, Double newQuestionScore) {
-        // 查询相应的题目
-        Query query = Query.query(Criteria.where("_id").is(examRecordQuestionsId)
-                .and("examQuestionEntities.order").is(order));
-        Update update = new Update();
-        update.set("examQuestionEntities.$.questionScore", newQuestionScore);
-
-        UpdateResult upResult = mongoTemplate.updateFirst(query, update, "examRecordQuestions");
-        long res = upResult.getMatchedCount();
-
-        System.out.println(String.format("更新作答记录中小题分数成功effectNum=%s,id=%s,order=%s,newQuestionScore=%s",
-                res, examRecordQuestionsId, order, newQuestionScore));
-        return res;
-    }
-
-    /**
-     * 更新学生作答的部分数据
-     *
-     * @param examRecordQuestionsId
-     * @param order
-     * @param newAnswer
-     * @param studentScore
-     * @return
-     */
-    public long updatePartialQuestionAnswer(String examRecordQuestionsId, Integer order, String newAnswer, Double studentScore) {
-        // 查询相应的题目
-        Query query = Query.query(Criteria.where("_id").is(examRecordQuestionsId)
-                .and("examQuestionEntities.order").is(order));
-        Update update = new Update();
-        update.set("examQuestionEntities.$.correctAnswer", newAnswer);
-        update.set("examQuestionEntities.$.studentScore", studentScore);
-
-        UpdateResult upResult = mongoTemplate.updateFirst(query, update, "examRecordQuestions");
-        long res = upResult.getMatchedCount();
-
-        System.out.println(String.format("更新作答记录中学生分数成功effectNum=%s,id=%s,order=%s,studentScore=%s,correctAnswer=%s",
-                res, examRecordQuestionsId, order, studentScore, newAnswer));
-        return res;
-    }
-
-
-}

+ 0 - 56
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultPaperBean.java

@@ -1,56 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 试卷结构
- *
- * @author WANGWEI
- * @date 2018年8月15日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class DefaultPaperBean implements Serializable {
-
-	private static final long serialVersionUID = -5979287118960427883L;
-
-	/**
-	 * 试卷名称
-	 */
-	private String name;
-
-	/**
-	 * 是否全是客观题
-	 */
-	private Boolean fullyObjective;
-
-	/**
-	 * 分组集合
-	 */
-	private List<DefaultQuestionGroupBean> questionGroupList;
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-
-	public Boolean getFullyObjective() {
-		return fullyObjective;
-	}
-
-	public void setFullyObjective(Boolean fullyObjective) {
-		this.fullyObjective = fullyObjective;
-	}
-
-	public List<DefaultQuestionGroupBean> getQuestionGroupList() {
-		return questionGroupList;
-	}
-
-	public void setQuestionGroupList(List<DefaultQuestionGroupBean> questionGroupList) {
-		this.questionGroupList = questionGroupList;
-	}
-
-}

+ 0 - 56
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionGroupBean.java

@@ -1,56 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 题分组集合
- *
- * @author WANGWEI
- * @date 2018年8月15日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class DefaultQuestionGroupBean implements Serializable {
-
-	private static final long serialVersionUID = 2149814711274942645L;
-
-	/**
-	 * 题组名称
-	 */
-	private String groupName;
-
-	/**
-	 * 题包装器集合<br>
-	 */
-	private List<DefaultQuestionStructureWrapperBean> questionWrapperList;
-
-	/**
-	 * 题组总分
-	 */
-	private Double groupScore;
-
-	public String getGroupName() {
-		return groupName;
-	}
-
-	public void setGroupName(String groupName) {
-		this.groupName = groupName;
-	}
-
-	public List<DefaultQuestionStructureWrapperBean> getQuestionWrapperList() {
-		return questionWrapperList;
-	}
-
-	public void setQuestionWrapperList(List<DefaultQuestionStructureWrapperBean> questionWrapperList) {
-		this.questionWrapperList = questionWrapperList;
-	}
-
-	public Double getGroupScore() {
-		return groupScore;
-	}
-
-	public void setGroupScore(Double groupScore) {
-		this.groupScore = groupScore;
-	}
-
-}

+ 0 - 107
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionStructureWrapperBean.java

@@ -1,107 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * 题结构包装器
- *
- * @author WANGWEI
- * @date 2018年8月15日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class DefaultQuestionStructureWrapperBean implements Serializable {
-
-	private static final long serialVersionUID = 8423916951155451548L;
-
-	/**
-	 * 题ID
-	 */
-	private String questionId;
-
-	/**
-	 * 版本号
-	 */
-	private String version;
-
-	/**
-	 * 题分数
-	 */
-	private Double questionScore;
-
-	/**
-	 * 限制播放次数
-	 */
-	private Integer limitedPlayTimes;
-
-	/**
-	 * 已播放次数
-	 */
-	private Integer playedTimes;
-
-	/**
-	 * 作答限时
-	 */
-	private Long timeLimit;
-
-	/**
-	 * 题单元包装器
-	 */
-	private List<DefaultQuestionUnitWrapperBean> questionUnitWrapperList;
-
-	public String getQuestionId() {
-		return questionId;
-	}
-
-	public void setQuestionId(String questionId) {
-		this.questionId = questionId;
-	}
-
-	public String getVersion() {
-		return version;
-	}
-
-	public void setVersion(String version) {
-		this.version = version;
-	}
-
-	public Double getQuestionScore() {
-		return questionScore;
-	}
-
-	public void setQuestionScore(Double questionScore) {
-		this.questionScore = questionScore;
-	}
-
-	public Integer getLimitedPlayTimes() {
-		return limitedPlayTimes;
-	}
-
-	public void setLimitedPlayTimes(Integer limitedPlayTimes) {
-		this.limitedPlayTimes = limitedPlayTimes;
-	}
-
-	public Integer getPlayedTimes() {
-		return playedTimes;
-	}
-
-	public void setPlayedTimes(Integer playedTimes) {
-		this.playedTimes = playedTimes;
-	}
-
-	public Long getTimeLimit() {
-		return timeLimit;
-	}
-
-	public void setTimeLimit(Long timeLimit) {
-		this.timeLimit = timeLimit;
-	}
-
-	public List<DefaultQuestionUnitWrapperBean> getQuestionUnitWrapperList() {
-		return questionUnitWrapperList;
-	}
-
-	public void setQuestionUnitWrapperList(List<DefaultQuestionUnitWrapperBean> questionUnitWrapperList) {
-		this.questionUnitWrapperList = questionUnitWrapperList;
-	}
-}

+ 0 - 67
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/DefaultQuestionUnitWrapperBean.java

@@ -1,67 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
-
-import java.io.Serializable;
-
-/**
- * 题单元包装器
- *
- * @author WANGWEI
- * @date 2018年8月16日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class DefaultQuestionUnitWrapperBean implements Serializable {
-
-	private static final long serialVersionUID = 7584275153456817959L;
-
-	/**
-	 * 选项排序值
-	 */
-	private Integer[] optionPermutation;
-
-	/**
-	 * 题分数
-	 */
-	private Double questionScore;
-
-	/**
-	 * 题型
-	 */
-	private String questionType;
-
-	/**
-	 * 作答类型
-	 */
-	private String answerType;
-
-	public Integer[] getOptionPermutation() {
-		return optionPermutation;
-	}
-
-	public void setOptionPermutation(Integer[] optionPermutation) {
-		this.optionPermutation = optionPermutation;
-	}
-
-	public Double getQuestionScore() {
-		return questionScore;
-	}
-
-	public void setQuestionScore(Double questionScore) {
-		this.questionScore = questionScore;
-	}
-
-	public String getQuestionType() {
-		return questionType;
-	}
-
-	public void setQuestionType(String questionType) {
-		this.questionType = questionType;
-	}
-
-	public String getAnswerType() {
-		return answerType;
-	}
-
-	public void setAnswerType(String answerType) {
-		this.answerType = answerType;
-	}
-}

+ 0 - 43
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/ExamRecordPaperStructBean.java

@@ -1,43 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
-
-import org.springframework.data.mongodb.core.mapping.Document;
-
-import javax.persistence.Id;
-import java.io.Serializable;
-
-/**
- *
- * @author  	chenken
- * @date    	2018年8月27日 下午3:26:27
- * @company 	QMTH
- * @description ExamRecordPaper.java
- */
-@Document(collection="examRecordPaperStruct")
-public class ExamRecordPaperStructBean implements Serializable{
-
-	/**
-	 *
-	 */
-	private static final long serialVersionUID = -4672132535133881321L;
-
-	@Id
-	private String id;
-
-	private DefaultPaperBean defaultPaper;
-
-	public String getId() {
-		return id;
-	}
-
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	public DefaultPaperBean getDefaultPaper() {
-		return defaultPaper;
-	}
-
-	public void setDefaultPaper(DefaultPaperBean defaultPaper) {
-		this.defaultPaper = defaultPaper;
-	}
-}

+ 0 - 59
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/OuterGetPaperStructReq.java

@@ -1,59 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
-
-import cn.com.qmth.examcloud.api.commons.exchange.EnterpriseRequest;
-import io.swagger.annotations.ApiModelProperty;
-
-/**
- * @Description 获取试卷结构
- * @Author lideyin
- * @Date 2020/5/25 15:56
- * @Version 1.0
- */
-public class OuterGetPaperStructReq extends EnterpriseRequest {
-
-    private static final long serialVersionUID = -8374755306658040184L;
-
-    @ApiModelProperty(value = "考试id", example = "123", required = true)
-    private Long examId;
-
-    @ApiModelProperty(value = "课程code", example = "123", required = true)
-    private String courseCode;
-
-    @ApiModelProperty(value = "卷型", example = "123", required = true)
-    private String paperType;
-
-    @ApiModelProperty(value = "原始试卷id", example = "123", required = true)
-    private String basePaperId;
-
-    public Long getExamId() {
-        return examId;
-    }
-
-    public void setExamId(Long examId) {
-        this.examId = examId;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public String getPaperType() {
-        return paperType;
-    }
-
-    public void setPaperType(String paperType) {
-        this.paperType = paperType;
-    }
-
-    public String getBasePaperId() {
-        return basePaperId;
-    }
-
-    public void setBasePaperId(String basePaperId) {
-        this.basePaperId = basePaperId;
-    }
-}

+ 0 - 27
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_question_score/entity/OuterGetPaperStructResp.java

@@ -1,27 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_question_score.entity;
-
-import cn.com.qmth.examcloud.api.commons.exchange.EnterpriseResponse;
-
-/**
- * @Description 获取试卷结构
- * @Author lideyin
- * @Date 2020/5/25 15:40
- * @Version 1.0
- */
-public class OuterGetPaperStructResp extends EnterpriseResponse {
-
-    private static final long serialVersionUID = 8290190579593586203L;
-
-    /**
-     * 试卷结构
-     */
-    private DefaultPaperBean defaultPaper;
-
-    public DefaultPaperBean getDefaultPaper() {
-        return defaultPaper;
-    }
-
-    public void setDefaultPaper(DefaultPaperBean defaultPaper) {
-        this.defaultPaper = defaultPaper;
-    }
-}

+ 0 - 59
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/FixStudentAnswer.java

@@ -1,59 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_student_answer;
-
-import java.io.FileNotFoundException;
-import java.io.UnsupportedEncodingException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_student_answer.entity.FixAnswerType;
-import cn.com.qmth.examcloud.web.support.SpringContextHolder;
-
-/**
- * 执行图片处理逻辑
- */
-@Service
-public class FixStudentAnswer {
-
-	private static final Logger log = LoggerFactory.getLogger(FixStudentAnswer.class);
-
-	/**
-	 * 修复图片
-	 */
-	public void startFixPicAnswer(Long examId, String courseCode, int order) {
-		FixStudentAnswerService service = SpringContextHolder
-				.getBean(FixStudentAnswerService.class);
-		String srcPicFileDirectory = "D:/Temp/srcPic";
-		try {
-			service.fixStudentAnswer(srcPicFileDirectory, examId, courseCode, order,
-					FixAnswerType.PICTURE);
-		} catch (FileNotFoundException e) {
-			e.printStackTrace();
-			log.error("FileNotFoundException", e);
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-			log.error("UnsupportedEncodingException", e);
-		} catch (Exception e) {
-			log.error("UnkonwnException ", e);
-		}
-	}
-
-	public void startFixAudioAnswer(Long examId, String courseCode, int order) {
-		FixStudentAnswerService service = SpringContextHolder
-				.getBean(FixStudentAnswerService.class);
-		String srcPicFileDirectory = "D:/Temp/srcAudio";
-		try {
-			service.fixStudentAnswer(srcPicFileDirectory, examId, courseCode, order,
-					FixAnswerType.AUDIO);
-		} catch (FileNotFoundException e) {
-			e.printStackTrace();
-			log.error("FileNotFoundException", e);
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-			log.error("UnsupportedEncodingException", e);
-		} catch (Exception e) {
-			log.error("UnkonwnException ", e);
-		}
-	}
-}

+ 0 - 171
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/FixStudentAnswerService.java

@@ -1,171 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_student_answer;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.apache.commons.collections.CollectionUtils;
-import org.apache.commons.lang3.RegExUtils;
-import org.assertj.core.util.Sets;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.stereotype.Service;
-
-import com.google.common.collect.Lists;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_student_answer.entity.FixAnswerType;
-import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.commons.helpers.Counter;
-import cn.com.qmth.examcloud.commons.util.JsonUtil;
-import cn.com.qmth.examcloud.commons.util.Util;
-import cn.com.qmth.examcloud.web.upyun.UpyunService;
-
-/**
- * @Description 修复学生作答
- * @Author THINKPAD
- * @Date 2019/7/8 10:16
- * @Version 1.0
- */
-@Service
-public class FixStudentAnswerService {
-
-	@Autowired
-	JdbcTemplate jdbcTemplate;
-
-	@Autowired
-	MongoTemplate mongoTemplate;
-
-	@Autowired
-	UpyunService upyunService;
-
-	private static Counter counter = new Counter(0L, 1000000L);
-
-	public void fixStudentAnswer(String filePath, Long examId, String courseCode, Integer order,
-			FixAnswerType fixAnswerType)
-			throws FileNotFoundException, UnsupportedEncodingException {
-		if (fixAnswerType != FixAnswerType.AUDIO && fixAnswerType != FixAnswerType.PICTURE) {
-			throw new StatusException("100001", "修改的文件类型格式不正确");
-		}
-		// 错误提示
-		List<Map<String, Object>> failList = Lists.newArrayList();
-		File file = new File(filePath);
-
-		if (file.isDirectory()) {
-			String[] list = file.list();
-			// 循环查库
-			// 获取身份证键值对信息
-			Map<String, List<Map<String, Object>>> identityMap = getIdentityMap(filePath, list);
-
-			Set<String> keys = identityMap.keySet();
-			Set<String> tempKeys = Sets.newHashSet();
-			int index = 0;
-			int threadSize = 10;
-			int batchSize = keys.size() / threadSize + 1;
-			for (String key : keys) {
-				index++;
-				tempKeys.add(key);
-				if (index == batchSize) {
-					new FixStudentAnswerThread(jdbcTemplate, mongoTemplate, tempKeys, examId,
-							courseCode, failList, identityMap, order, fixAnswerType, upyunService,
-							counter).start();
-					index = 0;
-					tempKeys = Sets.newHashSet();
-				}
-			}
-
-			if (CollectionUtils.isNotEmpty(tempKeys)) {
-				new FixStudentAnswerThread(jdbcTemplate, mongoTemplate, tempKeys, examId,
-						courseCode, failList, identityMap, order, fixAnswerType, upyunService,
-						counter).start();
-			}
-
-		}
-
-		while (true) {
-			Util.sleep(5);
-			System.out.println("count: " + counter.get());
-			System.out.println("failList: \n" + JsonUtil.toPrettyJson(failList));
-		}
-
-	}
-
-	/**
-	 * 获取身份证和文件地址的对应关系
-	 * 
-	 * @param list
-	 * @return
-	 */
-	private Map<String, List<Map<String, Object>>> getIdentityMap(String filePath, String[] list) {
-		// 所有的图片
-		List<Map<String, Object>> fileMapList = new ArrayList<>();
-		for (String fileName : list) {
-			String fullFilePath = filePath + File.separator + fileName;
-			fileName = RegExUtils.replaceAll(fileName, "\\s+", "");
-			// 如果有-,则证明有多张图片
-			if (fileName.indexOf("-") != -1) {
-				String identityNumber = fileName.substring(0, fileName.indexOf("-"));
-				Map<String, Object> map = new HashMap<>();
-				map.put("identityNumber", identityNumber);
-				map.put("filePath", fullFilePath);
-				// 排序号
-				int sortOrder = 0;
-				if (fileName.indexOf("_") != -1) {
-					try {
-						sortOrder = Integer.parseInt(fileName.substring(fileName.indexOf("-") + 1,
-								fileName.indexOf("_")));
-					} catch (NumberFormatException e) {
-						e.printStackTrace();
-					}
-				} else {
-					try {
-						sortOrder = Integer.parseInt(fileName.substring(fileName.indexOf("-") + 1,
-								fileName.indexOf(".")));
-					} catch (NumberFormatException e) {
-						e.printStackTrace();
-					}
-				}
-				map.put("order", sortOrder);
-				fileMapList.add(map);
-			} else {
-				String identityNumber = "";
-				if (fileName.indexOf("_") > -1) {
-					identityNumber = fileName.substring(0, fileName.indexOf("_"));
-				} else {
-					identityNumber = fileName.substring(0, fileName.indexOf("."));
-				}
-				Map<String, Object> map = new HashMap<>();
-				map.put("identityNumber", identityNumber);
-				map.put("filePath", fullFilePath);
-				map.put("order", 0);
-				fileMapList.add(map);
-			}
-		}
-		Map<String, List<Map<String, Object>>> resultMap = new HashMap<>();
-		for (Map<String, Object> fm : fileMapList) {
-			List<Map<String, Object>> mapList = fileMapList.stream()
-					.filter(p -> p.get("identityNumber").equals(fm.get("identityNumber")))
-					.collect(Collectors.toList());
-			// 对文件进行排序
-			Collections.sort(mapList, new Comparator<Map<String, Object>>() {
-				public int compare(Map<String, Object> o1, Map<String, Object> o2) {
-					int map1value = Integer.parseInt(o1.get("order").toString());
-					int map2value = Integer.parseInt(o2.get("order").toString());
-					return map1value - map2value;
-				}
-			});
-			if (resultMap.get(fm.get("identityNumber")) == null) {
-				resultMap.put(fm.get("identityNumber").toString(), mapList);
-			}
-		}
-		return resultMap;
-	}
-}

+ 0 - 240
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/FixStudentAnswerThread.java

@@ -1,240 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_student_answer;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.springframework.data.mongodb.core.MongoTemplate;
-import org.springframework.data.mongodb.core.query.Criteria;
-import org.springframework.data.mongodb.core.query.Query;
-import org.springframework.data.mongodb.core.query.Update;
-import org.springframework.jdbc.core.JdbcTemplate;
-
-import com.mongodb.client.result.UpdateResult;
-
-import cn.com.qmth.dp.examcloud.oe.modules.update_student_answer.entity.ExamRecordEntity;
-import cn.com.qmth.dp.examcloud.oe.modules.update_student_answer.entity.FixAnswerType;
-import cn.com.qmth.examcloud.commons.helpers.Counter;
-import cn.com.qmth.examcloud.web.upyun.UpYunPathInfo;
-import cn.com.qmth.examcloud.web.upyun.UpyunPathEnvironmentInfo;
-import cn.com.qmth.examcloud.web.upyun.UpyunService;
-
-/**
- * @Description TODO
- * @Author THINKPAD
- * @Date 2019/7/8 19:51
- * @Version 1.0
- */
-public class FixStudentAnswerThread extends Thread {
-	private Set<String> identityKeys;
-
-	JdbcTemplate jdbcTemplate;
-
-	MongoTemplate mongoTemplate;
-
-	Long examId;
-
-	String courseCode;
-
-	List<Map<String, Object>> failList;
-
-	Map<String, List<Map<String, Object>>> identityMap;
-
-	Integer order;
-
-	FixAnswerType fixAnswerType;
-
-	UpyunService upyunService;
-
-	Counter counter;
-
-	public FixStudentAnswerThread(JdbcTemplate jdbcTemplate, MongoTemplate mongoTemplate,
-			Set<String> identityKeys, Long examId, String courseCode,
-			List<Map<String, Object>> failList, Map<String, List<Map<String, Object>>> identityMap,
-			Integer order, FixAnswerType fixAnswerType, UpyunService upyunService,
-			Counter counter) {
-		this.identityKeys = identityKeys;
-		this.jdbcTemplate = jdbcTemplate;
-		this.mongoTemplate = mongoTemplate;
-		this.examId = examId;
-		this.courseCode = courseCode;
-		this.failList = failList;
-		this.identityMap = identityMap;
-		this.order = order;
-		this.fixAnswerType = fixAnswerType;
-		this.upyunService = upyunService;
-		this.counter = counter;
-	}
-
-	@Override
-	public void run() {
-		// 改成多线程
-		for (String identityNumber : identityKeys) {
-			List<ExamRecordEntity> recordList = getExamRecordList(examId, courseCode,
-					identityNumber);
-			// 学生的考试记录(一个学生可能有多次考试)
-			List<ExamRecordEntity> examRecords = getExamRecordListByIdentityNumber(identityNumber,
-					recordList);
-			if (examRecords == null || examRecords.isEmpty()) {
-				logErr(identityNumber, "找不到身份证号为:" + identityNumber + "的考试记录数据", failList);
-				continue;
-			}
-			for (ExamRecordEntity examRecord : examRecords) {
-				// 考试记录id
-				Long examRecordDataId = examRecord.getExamRecordDataId();
-				// 学生id
-				Long studnetId = examRecord.getStudentId();
-				// 如果没有找到考试记录id
-				try {
-					String newAnswer = "";
-					// 第一步,上传又拍云(多个文件的话,一个个追加)
-					// 当前学生的文件集合
-					List<Map<String, Object>> fileByIdnetityNumberList = identityMap
-							.get(identityNumber);
-					for (Map<String, Object> m : fileByIdnetityNumberList) {
-						this.counter.next();
-						UpyunPathEnvironmentInfo env = new UpyunPathEnvironmentInfo();
-						env.setUserId(studnetId.toString());
-						env.setExt1(examRecordDataId.toString());
-						env.setExt2(order.toString());
-						env.setFileSuffix(getFileSuffix(fixAnswerType));
-
-						String tempFilePath = m.get("filePath").toString();
-						String fullFilePath = tempFilePath;
-						System.out.println("正在上传文件:" + fullFilePath);
-						UpYunPathInfo upYunPathInfo = upyunService.writeFile(
-								getSiteId(fixAnswerType), env, new File(fullFilePath), true);
-						// 上传U盘云的完整地址
-						String upYunFileUrl = upYunPathInfo.getUrl();
-
-						newAnswer += buildFileAnswer(fixAnswerType, upYunFileUrl) + ",";
-					}
-					if (newAnswer.indexOf(",") > -1) {
-						newAnswer = newAnswer.substring(0, newAnswer.lastIndexOf(","));
-					}
-					// 第二步,更新答案
-					long res = updateAnswer(examRecordDataId, order, newAnswer);
-					if (res < 1) {
-						logErr(identityNumber, "更新答案失败", failList);
-						System.out.println("[Fail]:身份证号:" + identityNumber + ",考试记录id:"
-								+ examRecordDataId + ",答案更新失败");
-					} else {
-						System.out.println("[Success]:身份证号:" + identityNumber + ",考试记录id:"
-								+ examRecordDataId + ",答案更新成功");
-					}
-				} catch (Exception e) {
-					logErr(identityNumber, e.getMessage(), failList);
-					continue;
-				}
-			}
-		}
-	}
-
-	private String getFileSuffix(FixAnswerType fixAnswerType) {
-		if (fixAnswerType == FixAnswerType.PICTURE) {
-			return ".jpg";
-		} else {
-			return ".mp3";
-		}
-	}
-
-	public List<ExamRecordEntity> getExamRecordList(Long examId, String courseCode,
-			String identityNumber) {
-		String strSql = "select erd.id as examRecordDataId,er.exam_id as examId, "
-				+ "er.identity_number as identityNumber,c.`code` as courseCode,er.student_id as studentId "
-				+ "from ec_oe_exam_record er "
-				+ "inner join ec_oe_exam_record_data erd on er.id=erd.exam_record_id "
-				+ "inner join ec_b_course c on er.course_id=c.id " + "where er.exam_id=" + examId
-				+ " and c.`code`='" + courseCode + "'" + " and er.identity_number='"
-				+ identityNumber + "'";
-
-		java.util.List<Map<String, Object>> mapList = jdbcTemplate.queryForList(strSql);
-		java.util.List<ExamRecordEntity> resultList = new ArrayList<ExamRecordEntity>();
-		for (Map<String, Object> map : mapList) {
-			ExamRecordEntity entity = new ExamRecordEntity();
-			if (map.get("courseCode") != null) {
-				entity.setCourseCode(map.get("courseCode").toString());
-			}
-			if (map.get("examId") != null) {
-				entity.setExamId(Long.parseLong(map.get("examId").toString()));
-			}
-			if (map.get("examRecordDataId") != null) {
-				entity.setExamRecordDataId(Long.parseLong(map.get("examRecordDataId").toString()));
-			}
-			if (map.get("identityNumber") != null) {
-				entity.setIdentityNumber(map.get("identityNumber").toString());
-			}
-			if (map.get("studentId") != null) {
-				entity.setStudentId(Long.parseLong(map.get("studentId").toString()));
-			}
-			resultList.add(entity);
-		}
-		return resultList;
-	}
-
-	// 根据身份证号获取考试记录id(同一个学生可能有多次考试)
-	private List<ExamRecordEntity> getExamRecordListByIdentityNumber(String identityNumber,
-			List<ExamRecordEntity> examRecordList) {
-		List<ExamRecordEntity> resultList = examRecordList.stream()
-				.filter(record -> record.getIdentityNumber().equals(identityNumber))
-				.collect(Collectors.toList());
-		return resultList;
-	}
-
-	private String getSiteId(FixAnswerType fixAnswerType) {
-		if (fixAnswerType == FixAnswerType.PICTURE) {
-			return "photoAnswer";
-		} else {
-			return "audioAnswer";
-		}
-	}
-
-	/**
-	 * 更新指定试题的答案
-	 *
-	 * @param examRecordDataId
-	 * @param order
-	 * @param newAnswer
-	 * @return
-	 */
-	public long updateAnswer(Long examRecordDataId, Integer order, String newAnswer) {
-		// 查询相应的题目
-		Query query = Query.query(Criteria.where("examRecordDataId").is(examRecordDataId)
-				.and("examQuestionEntities.order").is(order));
-		Update update = Update.update("examQuestionEntities.$.studentAnswer", newAnswer);
-		UpdateResult upResult = mongoTemplate.updateFirst(query, update, "examRecordQuestions");
-		return upResult.getMatchedCount();
-	}
-
-	/**
-	 * 构建文件格式
-	 *
-	 * @param fileUrl
-	 * @return
-	 */
-	private String buildFileAnswer(FixAnswerType fixAnswerType, String fileUrl) {
-		if (fixAnswerType == FixAnswerType.PICTURE) {
-			StringBuilder sb = new StringBuilder();
-
-			sb.append("<div class='photo-answers-block'>");
-			sb.append("<a href='" + fileUrl + "' target='_blank' >");
-			sb.append("<img class='photo-answer' src='" + fileUrl + "!/both/200x200' />");
-			sb.append("</a>");
-			sb.append("</div>");
-			return sb.toString();
-		} else {
-			return fileUrl;
-		}
-	}
-
-	private void logErr(String identityNumber, String errMsg, List<Map<String, Object>> failList) {
-		Map<String, Object> errMap = new HashMap<>();
-		errMap.put("identityNumber", identityNumber);
-		errMap.put("err", errMsg);
-		failList.add(errMap);
-	}
-}

+ 0 - 195
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/entity/ExamQuestionEntity.java

@@ -1,195 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_student_answer.entity;
-
-import java.io.Serializable;
-
-import cn.com.qmth.examcloud.question.commons.core.question.QuestionType;
-
-/**
- * @author chenken
- * @date 2018/8/17 10:18
- * @company QMTH
- * @description 考生单题作答记录
- */
-//@Document(collection="examRecordQuestion")
-public class ExamQuestionEntity implements Serializable{
-
-    /**
-	 * 
-	 */
-	private static final long serialVersionUID = -6141069483774400912L;
-	
-//	@Id
-	private String id;
-	/**
-	 * 考试记录Data Id
-	 */
-    private Long examRecordDataId;
-    /**
-     * 大题号
-     */
-    private Integer mainNumber;
-    /**
-     * 原题ID
-     */
-    private String questionId;
-    /**
-     * 顺序
-     */
-    private Integer order;
-    /**
-     * 小题分数
-     */
-    private Double questionScore;
-    /**
-     * 小题类型
-     */
-    private QuestionType questionType;
-    /**
-     * 标准答案
-     */
-    private String correctAnswer;
-    /**
-     * 考生作答
-     */
-    private String studentAnswer;
-    /**
-     * 学生小题得分
-     */
-    private Double studentScore;
-    /**
-     * 是否作答
-     */
-    private Boolean isAnswer;
-    /**
-     * 是否标记
-     */
-    private Boolean isSign;
-    
-    /**
-	 * 选项排序值
-	 */
-	private Integer[] optionPermutation;
-	
-	/**
-	 * 音频播放次数
-	 */
-	private String audioPlayTimes;
-    
-	public ExamQuestionEntity() {}
-	
-	public String getId() {
-		return id;
-	}
-	public void setId(String id) {
-		this.id = id;
-	}
-	public Long getExamRecordDataId() {
-		return examRecordDataId;
-	}
-	public void setExamRecordDataId(Long examRecordDataId) {
-		this.examRecordDataId = examRecordDataId;
-	}
-	public Integer getMainNumber() {
-		return mainNumber;
-	}
-	/**
-	 * 设置 大题号
-	 * @param mainNumber
-	 */
-	public void setMainNumber(Integer mainNumber) {
-		this.mainNumber = mainNumber;
-	}
-	public String getQuestionId() {
-		return questionId;
-	}
-	/**
-	 * 设置题库试题ID
-	 * @param questionId
-	 */
-	public void setQuestionId(String questionId) {
-		this.questionId = questionId;
-	}
-	public Integer getOrder() {
-		return order;
-	}
-	/**
-	 * 设置小题号
-	 * @param order
-	 */
-	public void setOrder(Integer order) {
-		this.order = order;
-	}
-	public String getStudentAnswer() {
-		return studentAnswer;
-	}
-	public void setStudentAnswer(String studentAnswer) {
-		this.studentAnswer = studentAnswer;
-	}
-	public Double getStudentScore() {
-		return studentScore;
-	}
-	/**
-	 * 设置考生得分
-	 * @param studentScore
-	 */
-	public void setStudentScore(Double studentScore) {
-		this.studentScore = studentScore;
-	}
-	public Double getQuestionScore() {
-		return questionScore;
-	}
-	/**
-	 * 设置试题分数
-	 * @param questionScore
-	 */
-	public void setQuestionScore(Double questionScore) {
-		this.questionScore = questionScore;
-	}
-	public QuestionType getQuestionType() {
-		return questionType;
-	}
-	/**
-	 * 设置题型
-	 * @param questionType
-	 */
-	public void setQuestionType(QuestionType questionType) {
-		this.questionType = questionType;
-	}
-	public Boolean getIsAnswer() {
-		return isAnswer;
-	}
-	public void setIsAnswer(Boolean isAnswer) {
-		this.isAnswer = isAnswer;
-	}
-	public Boolean getIsSign() {
-		return isSign;
-	}
-	public void setIsSign(Boolean isSign) {
-		this.isSign = isSign;
-	}
-
-	public String getCorrectAnswer() {
-		return correctAnswer;
-	}
-
-	public void setCorrectAnswer(String correctAnswer) {
-		this.correctAnswer = correctAnswer;
-	}
-
-	public Integer[] getOptionPermutation() {
-		return optionPermutation;
-	}
-
-	public void setOptionPermutation(Integer[] optionPermutation) {
-		this.optionPermutation = optionPermutation;
-	}
-
-	public String getAudioPlayTimes() {
-		return audioPlayTimes;
-	}
-
-	public void setAudioPlayTimes(String audioPlayTimes) {
-		this.audioPlayTimes = audioPlayTimes;
-	}
-	
-}

+ 0 - 55
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/entity/ExamRecordEntity.java

@@ -1,55 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_student_answer.entity;
-
-/**
- * @Description TODO
- * @Author THINKPAD
- * @Date 2019/7/8 11:33
- * @Version 1.0
- */
-public class ExamRecordEntity {
-    private Long examId;
-    private String courseCode;
-    private Long examRecordDataId;
-    private String identityNumber;
-    private Long studentId;
-
-    public Long getExamId() {
-        return examId;
-    }
-
-    public void setExamId(Long examId) {
-        this.examId = examId;
-    }
-
-    public String getCourseCode() {
-        return courseCode;
-    }
-
-    public void setCourseCode(String courseCode) {
-        this.courseCode = courseCode;
-    }
-
-    public Long getExamRecordDataId() {
-        return examRecordDataId;
-    }
-
-    public void setExamRecordDataId(Long examRecordDataId) {
-        this.examRecordDataId = examRecordDataId;
-    }
-
-    public String getIdentityNumber() {
-        return identityNumber;
-    }
-
-    public void setIdentityNumber(String identityNumber) {
-        this.identityNumber = identityNumber;
-    }
-
-    public Long getStudentId() {
-        return studentId;
-    }
-
-    public void setStudentId(Long studentId) {
-        this.studentId = studentId;
-    }
-}

+ 0 - 62
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/entity/ExamRecordQuestionsEntity.java

@@ -1,62 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_student_answer.entity;
-
-//import org.springframework.data.mongodb.core.mapping.Document;
-
-//import javax.persistence.Id;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.List;
-
-/**
- * @author chenken
- * @date 2018年9月3日 上午10:46:06
- * @company QMTH
- * @description 考试作答试题集合
- */
-//@Document(collection = "examRecordQuestions")
-public class ExamRecordQuestionsEntity implements Serializable {
-    private static final long serialVersionUID = -1688201571728312142L;
-
-//    @Id
-    private String id;
-
-    private Long examRecordDataId;
-
-    private Date creationTime;
-
-    private List<ExamQuestionEntity> examQuestionEntities;
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public Long getExamRecordDataId() {
-        return examRecordDataId;
-    }
-
-    public Date getCreationTime() {
-        return creationTime;
-    }
-
-    public void setCreationTime(Date creationTime) {
-        this.creationTime = creationTime;
-    }
-
-    public void setExamRecordDataId(Long examRecordDataId) {
-        this.examRecordDataId = examRecordDataId;
-    }
-
-    public List<ExamQuestionEntity> getExamQuestionEntities() {
-        return examQuestionEntities;
-    }
-
-    public void setExamQuestionEntities(
-            List<ExamQuestionEntity> examQuestionEntities) {
-        this.examQuestionEntities = examQuestionEntities;
-    }
-
-}

+ 0 - 15
src/main/java/cn/com/qmth/dp/examcloud/oe/modules/update_student_answer/entity/FixAnswerType.java

@@ -1,15 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.modules.update_student_answer.entity;
-
-/**
- * 修复答案的类型
- */
-public enum FixAnswerType {
-    /**
-     * 图片
-     */
-    PICTURE,
-    /**
-     * 音频
-     */
-    AUDIO
-}

+ 0 - 103
src/main/java/cn/com/qmth/dp/examcloud/oe/multithread/Basket.java

@@ -1,103 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.multithread;
-
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import cn.com.qmth.examcloud.commons.exception.StatusException;
-
-public  class  Basket {
-	private static final Logger logger = LoggerFactory.getLogger(Basket.class);
-	/**
-	 * 数据阻塞队列
-	 */
-	private BlockingQueue<Object> queue;
-	
-	/**
-	 * 多线程计数器,子线程都结束后主线程才继续执行
-	 */
-	private CountDownLatch endGate;
-	
-	/**
-	 * 消费者数量
-	 */
-	private int consumerCount;
-	
-	
-	/**
-	 * 判断线程执行是否有出错,生产者、消费者出错都需要修改此值为true
-	 */
-	private boolean isExcuteError = false;
-	
-	
-	public Basket(int consumerCount) {
-		this.consumerCount=consumerCount;
-		queue = new ArrayBlockingQueue<Object>(consumerCount*2);
-		endGate = new CountDownLatch(consumerCount);
-	}
-
-	/**
-	 * 生产数据,不采用put方法防止消费线程全部异常后生产线程阻塞
-	 * @param value
-	 * @throws InterruptedException
-	 */
-	protected void offer(final Object value) throws InterruptedException {
-		if(isExcuteError) {
-			logger.error("**********************offer isExcuteError threadId:"+Thread.currentThread().getId());
-			throw new StatusException("1000001","线程异常");
-		}else {
-			boolean ret=queue.offer(value, 1, TimeUnit.MINUTES);
-			if(!ret) {
-				logger.info("**********************offer time out threadId:"+Thread.currentThread().getId()+value);
-				this.offer(value);
-			}
-		}
-	}
-	/**
-	 * 消费数据,不采用take方法防止生产线程全部异常后消费线程阻塞
-	 * @return
-	 * @throws InterruptedException
-	 */
-	protected Object consume() throws InterruptedException {
-		if(isExcuteError) {
-			logger.error("**********************poll isExcuteError  threadId:"+Thread.currentThread().getId());
-			return new EndObject();
-		}else {
-			Object ob=queue.poll(1, TimeUnit.MINUTES);
-			if(ob==null) {
-				logger.info("**********************poll time out  threadId:"+Thread.currentThread().getId());
-				return this.consume();
-			}else {
-				return ob;
-			}
-		}
-	}
-	
-	protected void await() throws InterruptedException {
-		endGate.await();
-	}
-	protected void countDown() {
-		endGate.countDown();
-	}
-
-	protected boolean isExcuteError() {
-		return isExcuteError;
-	}
-
-	protected void setExcuteError(boolean isExcuteError) {
-		this.isExcuteError = isExcuteError;
-	}
-
-	protected int getConsumerCount() {
-		return consumerCount;
-	}
-
-	protected void setConsumerCount(int consumerCount) {
-		this.consumerCount = consumerCount;
-	}
-
-}

+ 0 - 73
src/main/java/cn/com/qmth/dp/examcloud/oe/multithread/Consumer.java

@@ -1,73 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.multithread;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.logging.log4j.ThreadContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import cn.com.qmth.dp.examcloud.oe.modules.export_questions_count.RetDto;
-
-public abstract class Consumer<T>  extends Thread{
-	private static final Logger logger = LoggerFactory.getLogger(Consumer.class);
-	private Basket basket;
-	
-	private Map<String,RetDto> ret;
-	
-	private String traceId;
-	
-	public Consumer() {
-	}
-	@Override
-	public void run() {
-		ret=new HashMap<>();
-		logger.info("*******************Consumer:"+Thread.currentThread().getId()+" start");
-		try {
-			while (true) {
-				//先判断是否有异常结束
-				if(basket.isExcuteError()) {
-					break;
-				}
-				//取消费数据
-				Object o= basket.consume();
-				//判断消费数据是否是结束
-				if(o instanceof EndObject) {
-					break;
-				}
-				@SuppressWarnings("unchecked")
-				T t=(T)o;
-				logger.info("*******************Consumer:"+Thread.currentThread().getId()+" consume");
-				//消费数据实现
-				consume(t);
-			}
-		} catch (Exception e) {
-			basket.setExcuteError(true);
-			logger.error("消费线程处理出错",e);
-		}finally {
-			basket.countDown();
-			logger.info("*******************Consumer:"+Thread.currentThread().getId()+" stop");
-			ThreadContext.clearAll();
-		}
-	}
-	public abstract void consume(T t);
-	public Basket getBasket() {
-		return basket;
-	}
-	public void setBasket(Basket basket) {
-		this.basket = basket;
-	}
-	public String getTraceId() {
-		return traceId;
-	}
-	public void setTraceId(String traceId) {
-		this.traceId = traceId;
-	}
-	public Map<String, RetDto> getRet() {
-		return ret;
-	}
-	public void setRet(Map<String, RetDto> ret) {
-		this.ret = ret;
-	}
-	
-}

+ 0 - 10
src/main/java/cn/com/qmth/dp/examcloud/oe/multithread/EndObject.java

@@ -1,10 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.multithread;
-
-/**
- * 消费结束标识对象
- * @author xiatian
- *
- */
-public class EndObject {
-
-}

+ 0 - 147
src/main/java/cn/com/qmth/dp/examcloud/oe/multithread/Producer.java

@@ -1,147 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.multithread;
-
-import java.util.List;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import cn.com.qmth.examcloud.commons.exception.StatusException;
-
-public abstract class Producer {
-	private static final Logger logger = LoggerFactory.getLogger(Producer.class);
-	private Basket basket;
-	
-	private List<Consumer<?>> consumers;
-	
-	/**
-	 * 业务参数
-	 */
-	private Map<String, Object> param;
-	
-	/**
-	 * 消费线程class
-	 */
-	private Class<? extends Consumer<?>> consumer;
-	/**
-	 * 	处理开始方法
-	 * @param consumer 消费线程class
-	 * @param consumerCount 消费线程数
-	 * @param param 生产者业务参数
-	 * @throws InstantiationException
-	 * @throws IllegalAccessException
-	 */
-	public void startDispose(Class<? extends Consumer<?>> consumer, int consumerCount,Map<String, Object> param)
-			throws InstantiationException, IllegalAccessException {
-		Basket basket = new Basket(consumerCount);
-		this.basket = basket;
-		this.consumer = consumer;
-		this.param=param;
-		//启动消费者
-		startConsumer();
-		//开始处理
-		dispose();
-	}
-
-	private void dispose() {
-		try {
-			logger.info("*******************Producer:开始处理");
-			// 生产数据
-			produce(param);
-			logger.info("*******************Producer:生产结束");
-			// 发送生产结束信息
-			endConsumer();
-			logger.info("*******************Producer:成功发送生产结束信息");
-			// 等待子线程结束
-			logger.info("*******************Producer:等待消费线程结束");
-			await();
-			logger.info("*******************Producer:消费线程已结束");
-			// 判断子线程是否正常结束
-			if (basket.isExcuteError()) {
-				throw new StatusException("1000001", "处理失败,线程异常");
-			}
-			logger.info("*******************Producer:结束处理");
-		} catch (StatusException e) {
-			// 获取异常时发送异常结束信息
-			endConsumerAsError();
-			throw e;
-		} catch (Exception e) {
-			// 获取异常时发送异常结束信息
-			endConsumerAsError();
-			throw new StatusException("1000002", "处理失败", e);
-		}
-	}
-
-	/**
-	 * 启动消费者
-	 * 
-	 * @param consumer
-	 * @throws InstantiationException
-	 * @throws IllegalAccessException
-	 */
-	private void startConsumer() throws InstantiationException, IllegalAccessException {
-		int count = basket.getConsumerCount();
-		for (int i = 0; i < count; i++) {
-			Consumer<?> co = (Consumer<?>) consumer.newInstance();
-			co.setBasket(basket);
-			consumers.add(co);
-			co.start();
-		}
-
-	}
-
-	/**
-	 * 出异常后修改标识
-	 * 
-	 */
-	private void endConsumerAsError() {
-		basket.setExcuteError(true);
-	}
-
-	/**
-	 * 正常结束消费者
-	 * 
-	 * @throws InterruptedException
-	 */
-	private void endConsumer() throws InterruptedException {
-		int count = basket.getConsumerCount();
-		EndObject eo = new EndObject();
-		for (int i = 0; i < count; i++) {
-			basket.offer(eo);
-		}
-
-	}
-
-	/**
-	 * 生产数据
-	 * 
-	 * @param ob
-	 * @throws InterruptedException
-	 */
-	protected void offer(Object ob) throws InterruptedException {
-		synchronized (basket) {
-			basket.offer(ob);
-		}
-	}
-
-	/**
-	 * 等待所有消费者结束
-	 * 
-	 * @throws InterruptedException
-	 */
-	private void await() throws InterruptedException {
-		basket.await();
-	}
-
-	protected abstract void produce(Map<String, Object> param) throws Exception;
-
-	public List<Consumer<?>> getConsumers() {
-		return consumers;
-	}
-
-	public void setConsumers(List<Consumer<?>> consumers) {
-		this.consumers = consumers;
-	}
-
-	
-}

+ 0 - 61
src/main/resources/application.properties

@@ -1,61 +0,0 @@
-#mvc
-server.port=2008
-spring.application.name=EXAMCLOUD-OE-TOOL
-spring.main.allow-bean-definition-overriding=true
-spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
-spring.jackson.time-zone=GMT+8
-
-#datasource
-dsurl.host=qmth-db1.mysql.rds.aliyuncs.com
-dsurl.port=3306
-dsurl.database=exam_cloud
-spring.datasource.username=exam_cloud_view
-spring.datasource.password=dldkfs-596zcv-WslCv5
-spring.datasource.url=jdbc:mysql://${dsurl.host}:${dsurl.port}/${dsurl.database}?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2b8&rewriteBatchedStatements=true
-spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
-spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
-spring.jpa.hibernate.ddl-auto=validate
-
-#druid
-spring.datasource.druid.initial-size=5
-spring.datasource.druid.max-active=15
-spring.datasource.druid.min-idle=5
-spring.datasource.druid.max-wait=2000
-spring.datasource.druid.validation-query=SELECT 1
-spring.datasource.druid.validation-query-timeout=2000
-spring.datasource.druid.test-on-borrow=false
-spring.datasource.druid.test-on-return=false
-spring.datasource.druid.test-while-idle=true
-
-#mongodb
-mguri.hostAndPortGroup=dds-wz93958e4b3d8b141100.mongodb.rds.aliyuncs.com:3717
-mguri.username=reader
-mguri.password=vqd2uq-5zuxcm-ge4fn3
-mguri.database=admin
-spring.data.mongodb.uri=mongodb://${mguri.username}:${mguri.password}@${mguri.hostAndPortGroup}/${mguri.database}
-spring.data.mongodb.grid-fs-database=examcloud-core-oe
-spring.data.mongodb.database=examcloud-core-oe
-
-#redis test env
-spring.redis.host=qmth-redis3.redis.rds.aliyuncs.com
-spring.redis.port=6379
-spring.redis.database=0
-spring.redis.password=jkhm45-UO8rFc-q2Eb90
-
-#exchange
-qmth.rootOrgId=17196
-qmth.secretKey=lkjfjnioeweJI9IOnifasfe
-qmth.appId=jhun
-qmth.server.host=ecs.qmth.com.cn
-qmth.server.port=8007
-
-#fixParam's path
-fixAnswer.data.path=/home/admin/project/temp1.txt
-
-#获取断点续考的考试id
-getContiuedCount.examId=19
-#通用文件导出目录
-file.export.path=D:/Temp
-
-
-

+ 0 - 1
src/main/resources/classpath.location

@@ -1 +0,0 @@
-classpath 定位文件

+ 0 - 57
src/main/resources/log4j2.xml

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Configuration status="WARN" monitorInterval="30">
-
-	<Properties>
-		<Property name="commonLevel" value="${sys:log.commonLevel}" />
-		<Property name="logDir" value="${sys:logDir}" />
-	</Properties>
-
-	<Appenders>
-		<Console name="Console" target="SYSTEM_OUT">
-			<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} | %clr{%level} | %clr{%c{1.1}:%L}{cyan} | %X{TRACE_ID} %m%n" />
-		</Console>
-		<!-- debug 日志 -->
-		<RollingFile name="DEBUG_APPENDER" fileName="./logs/debug/debug.log" filePattern="./logs/debug/debug-%d{yyyy.MM.dd.HH}-%i.log">
-			<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} | %clr{%level} | %clr{%c{1.1}:%L}{cyan} | %X{TRACE_ID} %m%n" />
-			<Policies>
-				<TimeBasedTriggeringPolicy interval="1" />
-				<SizeBasedTriggeringPolicy size="100 MB" />
-			</Policies>
-			<DefaultRolloverStrategy max="10000">
-				<Delete basePath="./logs/debug" maxDepth="1">
-					<IfFileName glob="debug-*.log">
-						<IfAccumulatedFileSize exceeds="2 GB" />
-					</IfFileName>
-				</Delete>
-			</DefaultRolloverStrategy>
-		</RollingFile>
-		<!-- result -->
-		<RollingFile name="RESULT_APPENDER" filePattern="./logs/result/result-%i.txt">
-			<PatternLayout pattern="%m%n" />
-			<Policies>
-				<SizeBasedTriggeringPolicy size="512 MB" />
-			</Policies>
-		</RollingFile>
-	</Appenders>
-
-	<Loggers>
-
-		<Logger name="cn.com.qmth" level="INFO" additivity="false">
-			<AppenderRef ref="DEBUG_APPENDER" />
-			<AppenderRef ref="Console" />
-		</Logger>
-
-		<Logger name="RESULT_LOGGER" level="DEBUG" additivity="false">
-			<AppenderRef ref="RESULT_APPENDER" />
-		</Logger>
-
-		<Logger name="org.quartz.core" level="ERROR" />
-
-		<Root level="ERROR">
-			<AppenderRef ref="Console" />
-			<AppenderRef ref="DEBUG_APPENDER" />
-		</Root>
-
-	</Loggers>
-
-</Configuration>

+ 0 - 14
src/main/resources/sql/export_data/export_data.sql

@@ -1,14 +0,0 @@
-SELECT
-	t1.id AS exam_record_data_id,
-	t1.exam_id,
-	t5.`name` AS student_name,
-	t1.student_code,
-	t1.identity_number,
-	t4.`code` AS course_code 
-FROM
-	ec_oe_exam_record_data t1
-	LEFT JOIN ec_b_course t4 ON t4.id = t1.course_id
-	LEFT JOIN ec_b_student t5 ON t5.id = t1.student_id 
-WHERE
-	t1.exam_id = 741 
-	AND t4.`code` = '01'

+ 0 - 14
src/main/resources/sql/get_student_one_question_answer/query_exam_record_data.sql

@@ -1,14 +0,0 @@
-SELECT
-	t1.id AS exam_record_data_id,
-	t1.exam_id,
-	t5.`name` AS student_name,
-	t1.student_code,
-	t1.identity_number,
-	t4.`code` AS course_code 
-FROM
-	ec_oe_exam_record_data t1
-	LEFT JOIN ec_b_course t4 ON t4.id = t1.course_id
-	LEFT JOIN ec_b_student t5 ON t5.id = t1.student_id 
-WHERE
-	t1.exam_id = ? 
-	AND t4.`code` = ?

+ 0 - 87
src/main/resources/temp.txt

@@ -1,87 +0,0 @@
-INSERT INTO ec_oe_exam_record_data (
-  id,
-  root_org_id,
-  org_id,
-  exam_id,
-  exam_type,
-  course_id,
-  course_level,
-  exam_student_id,
-  student_id,
-  student_code,
-  student_name,
-  identity_number,
-  base_paper_id,
-  paper_struct_id,
-  paper_type,
-  exam_record_questions_id,
-  exam_record_status,
-  start_time,
-  used_exam_time,
-  is_illegality,
-  is_warn,
-  is_audit,
-  is_reexamine,
-  is_continued,
-  continued_count,
-  is_exceed,
-  is_all_objective_paper,
-  clean_time,
-  end_time,
-  exam_order,
-  baidu_face_liveness_success_percent,
-  face_failed_count,
-  face_landmark_val,
-  face_stranger_count,
-  face_success_count,
-  face_success_percent,
-  face_total_count,
-  face_verify_result,
-  info_collector,
-  creation_time,
-  update_time
-)
-VALUES
-	(
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	?,
-	? 
-	)

+ 0 - 315
src/main/resources/temp1.txt

@@ -1,315 +0,0 @@
-1225,80000012
-1225,80000006
-1225,80000011
-1225,80000001
-1225,90000003
-1225,80003030
-1225,82721003
-1225,82721002
-1225,82721005
-1225,82722006
-1225,82722008
-1225,82722007
-1225,82721004
-1225,82722005
-1225,81422003
-1225,81422006
-1225,81422005
-1225,82721001
-1225,81921001
-1225,81421002
-1225,81422001
-1225,81921002
-1225,81421004
-1225,81421001
-1225,81422004
-1225,81421005
-1225,81421003
-1225,81422002
-1225,81921003
-1225,81922001
-1225,81922015
-1225,81921004
-1225,81921005
-1225,81922005
-1225,81922002
-1225,81922008
-1225,81922014
-1225,90000004
-1225,82622007
-1225,82622009
-1225,90522003
-1225,91323003
-1225,91322004
-1225,91322001
-1225,82621003
-1225,90522001
-1225,81411001
-1225,82621005
-1225,81412005
-1225,82622001
-1225,81411003
-1225,91323007
-1225,81411004
-1225,91323005
-1225,81411002
-1225,90522005
-1225,82621002
-1225,91322005
-1225,82621006
-1225,82621004
-1225,82621001
-1225,81511002
-1225,81511003
-1225,81511001
-1225,81411005
-1225,80311005
-1225,81412001
-1225,80311002
-1225,91923005
-1225,80311003
-1225,80311001
-1225,80922006
-1225,91922005
-1225,80311004
-1225,80911001
-1225,80912001
-1225,91922002
-1225,80911003
-1225,80911002
-1225,80921002
-1225,81512002
-1225,80921001
-1225,81512004
-1225,81511004
-1225,81511005
-1225,80921003
-1225,91722001
-1225,91722005
-1225,81911003
-1225,81911002
-1225,91722002
-1225,81911004
-1225,81911005
-1225,81912011
-1225,91722004
-1225,90822004
-1225,80811004
-1225,91723002
-1225,81111002
-1225,80211002
-1225,81111003
-1225,90822005
-1225,80811003
-1225,80211003
-1225,80211004
-1225,80212006
-1225,80211001
-1225,80921004
-1225,80911005
-1225,80911004
-1225,91313005
-1225,80811002
-1225,81111001
-1225,80912003
-1225,92223007
-1225,91312005
-1225,90822001
-1225,80811001
-1225,91312002
-1225,82011001
-1225,80921005
-1225,92523009
-1225,91312001
-1225,91312003
-1225,91313002
-1225,91312004
-1225,80811005
-1225,91313003
-1225,80411003
-1225,80812005
-1225,81911001
-1225,81912010
-1225,92223002
-1225,92223006
-1225,81912001
-1225,81912004
-1225,100108
-1225,80411001
-1225,80812009
-1225,80411002
-1225,80412002
-1225,80412006
-1225,80412009
-1225,80412007
-1225,80411004
-1225,300101
-1225,80411005
-1225,81111005
-1225,81111004
-1225,91122005
-1225,90512004
-1225,210301
-1225,92523004
-1225,90512001
-1225,81912016
-1225,80212003
-1225,80211006
-1225,80212007
-1225,92223008
-1225,80211005
-1225,91713007
-1225,81711001
-1225,92222006
-1225,82012002
-1225,90512002
-1225,91213005
-1225,90412005
-1225,81711002
-1225,81811001
-1225,81811003
-1225,81611001
-1225,81711004
-1225,81112008
-1225,90412004
-1225,81711003
-1225,90422005
-1225,90412001
-1225,92222007
-1225,91712002
-1225,91212004
-1225,91212005
-1225,90412003
-1225,82011003
-1225,82011002
-1225,91712003
-1225,92222003
-1225,90422004
-1225,91212003
-1225,91712001
-1225,91212001
-1225,81811006
-1225,90813009
-1225,90422003
-1225,81811005
-1225,81712007
-1225,92522003
-1225,81712006
-1225,81712001
-1225,90122006
-1225,82011005
-1225,82011004
-1225,92222005
-1225,90213006
-1225,81711005
-1225,90122004
-1225,81811004
-1225,90213004
-1225,81712002
-1225,90212005
-1225,90212001
-1225,90122005
-1225,90312006
-1225,80611004
-1225,81712005
-1225,81711006
-1225,90122001
-1225,81712004
-1225,90222003
-1225,80611001
-1225,90212004
-1225,90222005
-1225,80611005
-1225,91412005
-1225,90812004
-1225,91412004
-1225,90812002
-1225,80612001
-1225,90812003
-1225,90112002
-1225,90312003
-1225,90312005
-1225,90223004
-1225,90812005
-1225,91413001
-1225,80612003
-1225,92922004
-1225,90312004
-1225,90313002
-1225,90222002
-1225,80611003
-1225,90112004
-1225,90122009
-1225,80611002
-1225,82012003
-1225,90222001
-1225,90313001
-1225,90112003
-1225,90112005
-1225,92922001
-1225,91412002
-1225,92213003
-1225,90122008
-1225,92213005
-1225,90112006
-1225,90122007
-1225,90112001
-1225,92212002
-1225,92213006
-1225,92212005
-1225,92922005
-1225,82411001
-1225,90112007
-1225,80711002
-1225,91413006
-1225,80612006
-1225,82411002
-1225,80111001
-1225,82411003
-1225,91022006
-1225,82412001
-1225,80711001
-1225,82412005
-1225,81612002
-1225,80711003
-1225,82211005
-1225,81611005
-1225,90912007
-1225,81612004
-1225,81611004
-1225,90912006
-1225,92922002
-1225,80712009
-1225,91623003
-1225,80111004
-1225,80111005
-1225,80712003
-1225,82411005
-1225,80111002
-1225,80111003
-1225,80711005
-1225,81611003
-1225,82411004
-1225,80111006
-1225,81611002
-1225,80711004
-1225,91622005
-1225,82412003
-1225,82412002
-1225,80712002
-1225,91112002
-1225,91112005
-1225,80512001
-1225,91112003
-1225,90912009
-1225,80511004
-1225,80511005
-1225,82211001
-1225,82211002
-1225,82412008
-1225,82412007
-1225,91112001
-1225,82311004
-1225,82311005
-1225,82311002
-1225,82312008

+ 0 - 33
src/main/resources/upyun.xml

@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<sites>
-
-	<site>
-		<!--ID -->
-		<id>test</id>
-		<!--名称 -->
-		<name>测试照片</name>
-		<!--又拍云账户ID标识 -->
-		<upyunId>1</upyunId>
-		<!--文件大小限制(IO流限制) -->
-		<maxSize>1M</maxSize>
-		<!--又拍云存储路径 -->
-		<path>/test/${rootOrgId}/${timeMillis}${fileSuffix}</path>
-	</site>
-
-	<site>
-		<id>photoAnswer</id>
-		<name>学生作答照片</name>
-		<upyunId>1</upyunId>
-		<maxSize>1M</maxSize>
-		<path>/oe-answer-file/${userId}/${ext1}/${ext2}/${userId}_${ext1}_${ext2}_${timeMillis}${fileSuffix}</path>
-	</site>
-
-	<site>
-		<id>audioAnswer</id>
-		<name>学生作答音频</name>
-		<upyunId>1</upyunId>
-		<maxSize>1M</maxSize>
-		<path>/oe-answer-file/${userId}/${ext1}/${ext2}/${userId}_${ext1}_${ext2}_${timeMillis}${fileSuffix}</path>
-	</site>
-
-</sites>

+ 0 - 39
src/test/java/cn/com/qmth/dp/examcloud/oe/test/ExportTest.java

@@ -1,39 +0,0 @@
-package cn.com.qmth.dp.examcloud.oe.test;
-
-import cn.com.qmth.dp.examcloud.oe.Tianji2App;
-import cn.com.qmth.dp.examcloud.oe.modules.export_exam_student_score.ExportExamStudentScore;
-import cn.com.qmth.dp.examcloud.oe.modules.get_student_answer_detail.GetStduentAnswerDetailService;
-import cn.com.qmth.dp.examcloud.oe.modules.get_student_one_question_answer.GetStduentOneAnswerService;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = Tianji2App.class)
-public class ExportTest {
-
-    @Autowired
-    private ExportExamStudentScore exportExamStudentScore;
-
-    @Autowired
-    private GetStduentOneAnswerService studentOneAnswerService;
-
-    @Autowired
-    private GetStduentAnswerDetailService studentAnswerDetailService;
-
-    @Test
-    public void exportTest() throws Exception {
-        // 导出 - 小题分
-        exportExamStudentScore.start();
-
-        // 导出 - 考生作答结果(带手机号)
-        // studentOneAnswerService.start(1213L, 1, "01");
-        // studentOneAnswerService.start(1213L, 1, "28");
-
-        // 导出 - 考生得分明细
-        // studentAnswerDetailService.start(1606L, "410901031");
-    }
-
-}