Forráskód Böngészése

Merge branch 'dev-api' into dev

tom 5 hónapja
szülő
commit
47fb7fa132
99 módosított fájl, 4465 hozzáadás és 1153 törlés
  1. 29 0
      ele6-catalyzer-ruoyi-vue/pom.xml
  2. 7 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/Main.java
  3. 8 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/Test2.java
  4. 11 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/AjaxResult.java
  5. 5 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseController.java
  6. 5 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseEntity.java
  7. 24 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseException.java
  8. 7 0
      ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/TableDataInfo.java
  9. 35 0
      pla-sim/01_SQL/02_table/sim_add_on_dept.sql
  10. 6 7
      pla-sim/01_SQL/02_table/sim_add_on_user.sql
  11. 72 2
      pla-sim/01_SQL/02_table/sim_fault.sql
  12. 5 5
      pla-sim/01_SQL/02_table/sim_major.sql
  13. 45 0
      pla-sim/01_SQL/02_table/sim_real_exam.sql
  14. 43 0
      pla-sim/01_SQL/02_table/sim_real_exam_collection.sql
  15. 32 0
      pla-sim/01_SQL/02_table/sim_real_exam_collection_dept.sql
  16. 39 0
      pla-sim/01_SQL/02_table/sim_real_exam_comp_request.sql
  17. 40 0
      pla-sim/01_SQL/02_table/sim_real_exam_fault.sql
  18. 51 0
      pla-sim/01_SQL/02_table/sim_seat.sql
  19. 14 7
      pla-sim/01_SQL/02_table/sim_sim.sql
  20. 4 4
      pla-sim/01_SQL/02_table/sim_sim_msg.sql
  21. 38 0
      pla-sim/01_SQL/02_table/sim_task.sql
  22. 3 3
      pla-sim/01_SQL/02_table/sim_task_fault.sql
  23. 324 186
      pla-sim/01_SQL/03_dev_backup/pla-chem-sim-dev-1.sql
  24. 2 0
      pom.xml
  25. 12 0
      ruoyi-admin/src/main/resources/application-sim.yml
  26. 6 0
      ruoyi-sim/pom.xml
  27. 78 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/config/SimConfig.java
  28. 0 11
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/AddOnDeptController.java
  29. 4 6
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/AddOnUserController.java
  30. 11 19
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/FaultController.java
  31. 2 2
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/MajorController.java
  32. 98 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCollectionController.java
  33. 98 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCollectionDeptController.java
  34. 98 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCompRequestController.java
  35. 98 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamController.java
  36. 98 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamFaultController.java
  37. 98 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/SeatController.java
  38. 2 2
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/SimController.java
  39. 2 2
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/SimMsgController.java
  40. 12 8
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TaskController.java
  41. 2 2
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TaskFaultController.java
  42. 2 2
      ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TeacherController.java
  43. 2 17
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/AddOnUser.java
  44. 54 5
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Fault.java
  45. 222 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExam.java
  46. 184 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCollection.java
  47. 67 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCollectionDept.java
  48. 119 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCompRequest.java
  49. 133 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamFault.java
  50. 86 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Seat.java
  51. 7 7
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Sim.java
  52. 9 10
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Task.java
  53. 6 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/TaskFault.java
  54. 15 4
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/vo/FaultTreeVo.java
  55. 26 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/domain/vo/TaskVo.java
  56. 1 1
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/AddOnUserMapper.java
  57. 61 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCollectionDeptMapper.java
  58. 61 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCollectionMapper.java
  59. 61 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCompRequestMapper.java
  60. 62 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamFaultMapper.java
  61. 61 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamMapper.java
  62. 62 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/SeatMapper.java
  63. 1 1
      ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/SimMapper.java
  64. 0 67
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/IAddOnDeptService.java
  65. 0 61
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/IAddOnUserService.java
  66. 0 72
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/IFaultService.java
  67. 0 61
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/IMajorService.java
  68. 0 61
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/ISimMsgService.java
  69. 0 61
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/ISimService.java
  70. 0 61
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/ITaskFaultService.java
  71. 0 77
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/ITaskService.java
  72. 1 14
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/AddOnDeptService.java
  73. 2 11
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/AddOnUserService.java
  74. 66 26
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/FaultService.java
  75. 21 10
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/IotService.java
  76. 1 8
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/MajorService.java
  77. 82 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCollectionDeptService.java
  78. 83 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCollectionService.java
  79. 83 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCompRequestService.java
  80. 83 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamFaultService.java
  81. 83 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamService.java
  82. 83 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SeatService.java
  83. 1 8
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SimMsgService.java
  84. 2 9
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SimService.java
  85. 2 4
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/StudentService.java
  86. 53 8
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskFaultService.java
  87. 196 0
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskService.java
  88. 0 136
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskServiceImpl.java
  89. 0 5
      ruoyi-sim/src/main/java/com/ruoyi/sim/service/my/MajorMyService.java
  90. 4 10
      ruoyi-sim/src/main/resources/mapper/sim/AddOnUserMapper.xml
  91. 14 0
      ruoyi-sim/src/main/resources/mapper/sim/FaultMapper.xml
  92. 146 0
      ruoyi-sim/src/main/resources/mapper/sim/RealExamCollection.xml
  93. 70 0
      ruoyi-sim/src/main/resources/mapper/sim/RealExamCollectionDeptMapper.xml
  94. 111 0
      ruoyi-sim/src/main/resources/mapper/sim/RealExamCompRequestMapper.xml
  95. 115 0
      ruoyi-sim/src/main/resources/mapper/sim/RealExamFaultMapper.xml
  96. 147 0
      ruoyi-sim/src/main/resources/mapper/sim/RealExamMapper.xml
  97. 97 0
      ruoyi-sim/src/main/resources/mapper/sim/SeatMapper.xml
  98. 46 70
      ruoyi-sim/src/main/resources/mapper/sim/SimMapper.xml
  99. 3 0
      ruoyi-sim/src/main/resources/mapper/sim/TaskMapper.xml

+ 29 - 0
ele6-catalyzer-ruoyi-vue/pom.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.ruoyi</groupId>
+        <artifactId>ruoyi</artifactId>
+        <version>3.8.8</version>
+    </parent>
+
+    <groupId>cn.ele6</groupId>
+    <artifactId>catalyzer-ruoyi-vue</artifactId>
+    <version>0.0.2-SNAPSHOT</version>
+
+    <dependencies>
+        <!-- ruoyi 通用工具-->
+        <dependency>
+            <groupId>com.ruoyi</groupId>
+            <artifactId>ruoyi-common</artifactId>
+        </dependency>
+    </dependencies>
+
+    <properties>
+        <maven.compiler.source>21</maven.compiler.source>
+        <maven.compiler.target>21</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+</project>

+ 7 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/Main.java

@@ -0,0 +1,7 @@
+package cn.ele6.catalyzer.ruoyi;
+
+public class Main {
+    public static void main(String[] args) {
+        System.out.println("Hello, World!");
+    }
+}

+ 8 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/Test2.java

@@ -0,0 +1,8 @@
+package cn.ele6.catalyzer.ruoyi;
+
+public class Test2 {
+
+    public String getTestString(){
+        return "test";
+    }
+}

+ 11 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/AjaxResult.java

@@ -0,0 +1,11 @@
+package cn.ele6.catalyzer.ruoyi.enhance;
+
+import java.io.Serializable;
+
+/**
+ * 泛型改造。
+ */
+public class AjaxResult extends com.ruoyi.common.core.domain.AjaxResult implements Serializable {
+
+
+}

+ 5 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseController.java

@@ -0,0 +1,5 @@
+package cn.ele6.catalyzer.ruoyi.enhance;
+
+public class BaseController extends com.ruoyi.common.core.controller.BaseController {
+
+}

+ 5 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseEntity.java

@@ -0,0 +1,5 @@
+package cn.ele6.catalyzer.ruoyi.enhance;
+
+public class BaseEntity extends com.ruoyi.common.core.domain.BaseEntity {
+
+}

+ 24 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/BaseException.java

@@ -0,0 +1,24 @@
+package cn.ele6.catalyzer.ruoyi.enhance;
+
+public class BaseException extends com.ruoyi.common.exception.base.BaseException {
+
+    public BaseException(String module, String code, Object[] args, String defaultMessage) {
+        super(module, code, args, defaultMessage);
+    }
+
+    public BaseException(String module, String code, Object[] args) {
+        super(module, code, args);
+    }
+
+    public BaseException(String module, String defaultMessage) {
+        super(module, defaultMessage);
+    }
+
+    public BaseException(String code, Object[] args) {
+        super(code, args);
+    }
+
+    public BaseException(String defaultMessage) {
+        super(defaultMessage);
+    }
+}

+ 7 - 0
ele6-catalyzer-ruoyi-vue/src/main/java/cn/ele6/catalyzer/ruoyi/enhance/TableDataInfo.java

@@ -0,0 +1,7 @@
+package cn.ele6.catalyzer.ruoyi.enhance;
+
+import java.io.Serializable;
+
+public class TableDataInfo extends com.ruoyi.common.core.page.TableDataInfo implements Serializable {
+
+}

+ 35 - 0
pla-sim/01_SQL/02_table/sim_add_on_dept.sql

@@ -0,0 +1,35 @@
+/*
+ Navicat Premium Dump SQL
+
+ Source Server         : qdhome.iot321.top-dev
+ Source Server Type    : MySQL
+ Source Server Version : 50740 (5.7.40-log)
+ Source Host           : qdhome.iot321.top:33103
+ Source Schema         : pla-chem-sim-dev-1
+
+ Target Server Type    : MySQL
+ Target Server Version : 50740 (5.7.40-log)
+ File Encoding         : 65001
+
+ Date: 15/12/2024 19:17:56
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_add_on_dept
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_add_on_dept`;
+CREATE TABLE `sim_add_on_dept`  (
+  `dept_id` bigint(20) NOT NULL COMMENT '班级ID/部门ID',
+  `major_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '专业ID',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`dept_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-部门附加表' ROW_FORMAT = DYNAMIC;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 6 - 7
pla-sim/01_SQL/02_table/sim_add_on_user.sql

@@ -1,17 +1,17 @@
 /*
  Navicat Premium Dump SQL
 
- Source Server         : qdhome.iot321.top
+ Source Server         : qdhome.iot321.top-dev
  Source Server Type    : MySQL
  Source Server Version : 50740 (5.7.40-log)
- Source Host           : qdhome.iot321.top:33003
+ Source Host           : qdhome.iot321.top:33103
  Source Schema         : pla-chem-sim-dev-1
 
  Target Server Type    : MySQL
  Target Server Version : 50740 (5.7.40-log)
  File Encoding         : 65001
 
- Date: 11/12/2024 00:40:48
+ Date: 15/12/2024 19:18:07
 */
 
 SET NAMES utf8mb4;
@@ -22,14 +22,13 @@ SET FOREIGN_KEY_CHECKS = 0;
 -- ----------------------------
 DROP TABLE IF EXISTS `sim_add_on_user`;
 CREATE TABLE `sim_add_on_user`  (
-  `user_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
-  `major_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '专业ID',
-  `createBy` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
+  `user_id` bigint(20) NOT NULL COMMENT '学员ID/教师ID/用户ID',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
   `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
   `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
   `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
   `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
   PRIMARY KEY (`user_id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-学员/教师/用户附加表' ROW_FORMAT = DYNAMIC;
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-学员/教师/用户附加表' ROW_FORMAT = DYNAMIC;
 
 SET FOREIGN_KEY_CHECKS = 1;

+ 72 - 2
pla-sim/01_SQL/02_table/sim_fault.sql

@@ -11,7 +11,7 @@
  Target Server Version : 50740 (5.7.40-log)
  File Encoding         : 65001
 
- Date: 13/12/2024 10:23:23
+ Date: 15/12/2024 19:22:09
 */
 
 SET NAMES utf8mb4;
@@ -23,10 +23,12 @@ SET FOREIGN_KEY_CHECKS = 0;
 DROP TABLE IF EXISTS `sim_fault`;
 CREATE TABLE `sim_fault`  (
   `fault_id` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '故障ID',
-  `parent_fault_id` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
+  `parent_fault_id` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '父故障ID',
   `sim_type` char(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '模拟器类型\r\n',
   `fault_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '故障类型:\r\n1:故障现象\r\n2:故障现象的可能原因\r\n3:故障部位\r\n4:故障部位的排除方法\r\n5:修复结论',
   `conflict_fault_id` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '互斥的故障ID',
+  `replace_part` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '是否是更换件 1:是 0:不是',
+  `replace_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更换件名称',
   `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '名称',
   `sim_msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '通信报文',
   `order_num` int(4) NULL DEFAULT NULL COMMENT '显示顺序',
@@ -38,4 +40,72 @@ CREATE TABLE `sim_fault`  (
   PRIMARY KEY (`fault_id`) USING BTREE
 ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-故障表' ROW_FORMAT = DYNAMIC;
 
+-- ----------------------------
+-- Records of sim_fault
+-- ----------------------------
+INSERT INTO `sim_fault` VALUES ('000100010000', '000000000000', '0001', '1', '', '0', NULL, '开机无响应', '', 1, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100010001', '000100010000', '0001', '3', '', '1', NULL, '1.电源开关', '', 1, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100010002', '000100010000', '0001', '3', '', '1', NULL, '2.DC/DC转换芯片', '', 2, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100020000', '000000000000', '0001', '1', '', '0', NULL, '开机后按抽气开关,微电机不工作', '', 2, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100020003', '000100020000', '0001', '3', '', '1', NULL, '3.微电机', '', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100020004', '000100020000', '0001', '3', '', '1', NULL, '4.Q2', '', 4, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100030000', '000000000000', '0001', '1', '', '0', NULL, '抽气流量不足', '', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100030005', '000100030000', '0001', '3', '', '1', NULL, '5.滤网', '', 5, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100030006', '000100030000', '0001', '3', '', '1', NULL, '6.调速电位器', '', 6, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100040000', '000000000000', '0001', '1', '', '0', NULL, '开机后按下加热开关,加热灯不亮,也未加热', '', 4, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100040007', '000100040000', '0001', '3', '', '1', NULL, '7.加热指示灯', '', 7, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100040008', '000100040000', '0001', '3', '', '1', NULL, '8.热敏开关', '', 8, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100050000', '000000000000', '0001', '1', '', '0', NULL, '不能正常工作', '', 5, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100050009', '000100050000', '0001', '3', '', '1', NULL, '9.外壳及零件', '', 9, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100060000', '000000000000', '0001', '1', '', '0', NULL, '电压低', '', 6, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100060010', '000100060000', '0001', '3', '', '1', NULL, '10.供电模块', '', 10, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100070000', '000000000000', '0001', '1', '', '0', NULL, '抽气指示灯不亮', '', 7, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000100070011', '000100070000', '0001', '3', '', '1', NULL, '11.抽气指示灯', '', 11, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200010000', '000000000000', '0002', '1', '', '0', NULL, '仪器无法开机', '', 1, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200010001', '000200010000', '0002', '3', '', '1', NULL, '1.薄膜开关FPC排线', '', 1, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200010002', '000200010000', '0002', '3', '', '1', NULL, '2.主控板开机电路', '', 2, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200020000', '000000000000', '0002', '1', '', '0', NULL, '蜂鸣器自检时,声音异常', '', 2, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200020003', '000200020000', '0002', '3', '', NULL, NULL, '3.蜂鸣器出声口', '', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200020004', '000200020000', '0002', '3', '', NULL, NULL, '4.接口接线板', '', 4, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200030000', '000000000000', '0002', '1', '', NULL, NULL, '仪器进入检测界面后,通入检测剂不报警', '', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200030005', '000200030000', '0002', '3', '', NULL, NULL, '5.检测剂', '', 5, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200030006', '000200030000', '0002', '3', '', NULL, NULL, '6.主控板信号采集电路', '', 6, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200040000', '000000000000', '0002', '1', '', NULL, NULL, '显示屏无显示', '', 4, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200040007', '000200040000', '0002', '3', '', NULL, NULL, '7.主控板显示屏供电电路', '', 7, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200040008', '000200040000', '0002', '3', '', NULL, NULL, '8.显示屏', '', 8, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200050000', '000000000000', '0002', '1', '', NULL, NULL, '长时间不进入“检测中”', '', 5, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200050009', '000200050000', '0002', '3', '', NULL, NULL, '9.干燥管', '', 9, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200050010', '000200050000', '0002', '3', '', NULL, NULL, '10.维护管', '', 10, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200060000', '000000000000', '0002', '1', '', NULL, NULL, '不能正常工作', '', 6, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200060011', '000200060000', '0002', '3', '', NULL, NULL, '11.外壳及零件', '', 11, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200070000', '000000000000', '0002', '1', '', NULL, NULL, '电压低', '', 7, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200070012', '000200070000', '0002', '3', '', NULL, NULL, '12.供电模块', '', 12, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200080000', '000000000000', '0002', '1', '', NULL, NULL, '无法开机', '', 8, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000200080001', '000200080000', '0002', '3', '', NULL, NULL, '13.DC/DC', '', 13, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300010000', '000000000000', '0003', '1', '', NULL, NULL, '仪器无法开机', '', 1, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300010001', '000300010000', '0003', '3', '', NULL, NULL, '1.FFC排线', '', 1, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300010002', '000300010000', '0003', '3', '', NULL, NULL, '2.汇总主控板', '', 2, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300020000', '000000000000', '0003', '1', '', NULL, NULL, '开机后,显示屏无显示', '', 2, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300020003', '000300020000', '0003', '3', '', NULL, NULL, '3.显控报警板', '', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300020004', '000300020000', '0003', '3', '', NULL, NULL, '4.显示屏', '', 4, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300030000', '000000000000', '0003', '1', '', NULL, NULL, '检测状态下模拟剂不报警', '', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300030005', '000300030000', '0003', '3', '', NULL, NULL, '5.汇总主控板信号采集电路', '', 5, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300030006', '000300030000', '0003', '3', '', NULL, NULL, '6.检测剂', '', 6, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300040000', '000000000000', '0003', '1', '', NULL, NULL, '长时间不能进入检测状态', '', 4, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300040007', '000300040000', '0003', '3', '', NULL, NULL, '7.干燥管', '', 7, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300040008', '000300040000', '0003', '3', '', NULL, NULL, '8.维护管', '', 8, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300050000', '000000000000', '0003', '1', '', NULL, NULL, '固液检测/气体检测模式切换失败', '', 5, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300050009', '000300050000', '0003', '3', '', NULL, NULL, '9.固液检测单元与主控板连接线', '', 9, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300050010', '000300050000', '0003', '3', '', NULL, NULL, '10.汇总主控板固液通信电路', '', 10, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300050011', '000300050000', '0003', '3', '', NULL, NULL, '11.切换按键', '', 11, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300060000', '000000000000', '0003', '1', '', NULL, NULL, '有毒有害气体检测模块不报警', '', 6, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300060012', '000300060000', '0003', '3', '', NULL, NULL, '12.高压驱动板与汇总主控板连接线', '', 12, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300060013', '000300060000', '0003', '3', '', NULL, NULL, '13.汇总主控板毒害模块通信电路', '', 13, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300070000', '000000000000', '0003', '1', '', NULL, NULL, '不能正常工作', '', 7, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300070014', '000300070000', '0003', '3', '', NULL, NULL, '14.外壳及零件', '', 14, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300080000', '000000000000', '0003', '1', '', NULL, NULL, '电压低', '', 8, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300080015', '000300080000', '0003', '3', '', NULL, NULL, '15.供电模块', '', 15, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300090000', '000000000000', '0003', '1', '', NULL, NULL, '无法开机', '', 9, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_fault` VALUES ('000300090016', '000300090000', '0003', '3', '', NULL, NULL, '16.DC/DC', '', 16, NULL, NULL, NULL, NULL, NULL);
+
 SET FOREIGN_KEY_CHECKS = 1;

+ 5 - 5
pla-sim/01_SQL/02_table/sim_major.sql

@@ -1,17 +1,17 @@
 /*
  Navicat Premium Dump SQL
 
- Source Server         : qdhome.iot321.top-test
+ Source Server         : qdhome.iot321.top-dev
  Source Server Type    : MySQL
  Source Server Version : 50740 (5.7.40-log)
- Source Host           : qdhome.iot321.top:33003
+ Source Host           : qdhome.iot321.top:33103
  Source Schema         : pla-chem-sim-dev-1
 
  Target Server Type    : MySQL
  Target Server Version : 50740 (5.7.40-log)
  File Encoding         : 65001
 
- Date: 11/12/2024 15:17:14
+ Date: 15/12/2024 19:22:38
 */
 
 SET NAMES utf8mb4;
@@ -22,7 +22,7 @@ SET FOREIGN_KEY_CHECKS = 0;
 -- ----------------------------
 DROP TABLE IF EXISTS `sim_major`;
 CREATE TABLE `sim_major`  (
-  `major_id` bigint(20) NOT NULL DEFAULT 0 AUTO_INCREMENT COMMENT '专业ID',
+  `major_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '专业ID',
   `major_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '专业名称',
   `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
   `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
@@ -30,6 +30,6 @@ CREATE TABLE `sim_major`  (
   `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
   `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
   PRIMARY KEY (`major_id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-专业表' ROW_FORMAT = DYNAMIC;
+) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-专业表' ROW_FORMAT = DYNAMIC;
 
 SET FOREIGN_KEY_CHECKS = 1;

+ 45 - 0
pla-sim/01_SQL/02_table/sim_real_exam.sql

@@ -0,0 +1,45 @@
+/*
+ Navicat Premium Dump SQL
+
+ Source Server         : qdhome.iot321.top-dev
+ Source Server Type    : MySQL
+ Source Server Version : 50740 (5.7.40-log)
+ Source Host           : qdhome.iot321.top:33103
+ Source Schema         : pla-chem-sim-dev-1
+
+ Target Server Type    : MySQL
+ Target Server Version : 50740 (5.7.40-log)
+ File Encoding         : 65001
+
+ Date: 15/12/2024 19:22:48
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_real_exam
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_real_exam`;
+CREATE TABLE `sim_real_exam`  (
+  `exam_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '考试ID',
+  `exam_collection_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '考试集合ID',
+  `user_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '学员ID/用户ID',
+  `seat_id` bigint(20) NOT NULL COMMENT '座ID',
+  `sim_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '模拟器ID',
+  `exam_status` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '考试状\r\n0:未登录\r\n1:已登录\r\n2:模拟器检查并下发ok\r\n3:答题中\r\n4:已交卷\r\n5:获取模拟成绩分析\r\n80:教师标记缺考\r\n81:登录未开始答题\r\n90:模拟器异常结束\r\n',
+  `total_score` int(3) NULL DEFAULT NULL COMMENT '总分:累加扣分和计算出总分',
+  `deduction_total_score` int(3) NULL DEFAULT NULL COMMENT '扣分总计,不计超时扣分',
+  `start_time` datetime NULL DEFAULT NULL COMMENT '考试实际开始时间(毫秒)',
+  `end_time` datetime NULL DEFAULT NULL COMMENT '考试实际结束时间(毫秒)',
+  `login_time` datetime NULL DEFAULT NULL COMMENT '登录时间',
+  `logout_time` datetime NULL DEFAULT NULL COMMENT '登出时间',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`exam_id`) USING BTREE
+) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-考试表' ROW_FORMAT = DYNAMIC;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 43 - 0
pla-sim/01_SQL/02_table/sim_real_exam_collection.sql

@@ -0,0 +1,43 @@
+/*
+ Navicat Premium Dump SQL
+
+ Source Server         : qdhome.iot321.top-dev
+ Source Server Type    : MySQL
+ Source Server Version : 50740 (5.7.40-log)
+ Source Host           : qdhome.iot321.top:33103
+ Source Schema         : pla-chem-sim-dev-1
+
+ Target Server Type    : MySQL
+ Target Server Version : 50740 (5.7.40-log)
+ File Encoding         : 65001
+
+ Date: 15/12/2024 19:22:55
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_real_exam_collection
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_real_exam_collection`;
+CREATE TABLE `sim_real_exam_collection`  (
+  `exam_collection_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '考试集合ID',
+  `sim_type` char(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模拟器类型',
+  `question_setting_method` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '出题方式:\r\n1 系统随机\r\n2 教师自选\r\n3 任务自选\r\n',
+  `exam_collection_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '考试类型\r\n1:练习\r\n2:自主练习\r\n3:考试',
+  `exam_collection_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '考试名称',
+  `task_id` bigint(20) NULL DEFAULT 0 COMMENT '任务ID',
+  `limit_duration` int(6) NULL DEFAULT NULL COMMENT '限制时长(分钟)',
+  `start_time` datetime NULL DEFAULT NULL COMMENT '考试开始时间(天)',
+  `end_time` datetime NULL DEFAULT NULL COMMENT '考试结束时间(天)',
+  `create_user_id` bigint(20) NULL DEFAULT 0 COMMENT '创建教师ID/用户ID',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`exam_collection_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-考试集合表' ROW_FORMAT = DYNAMIC;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 32 - 0
pla-sim/01_SQL/02_table/sim_real_exam_collection_dept.sql

@@ -0,0 +1,32 @@
+/*
+ Navicat Premium Dump SQL
+
+ Source Server         : qdhome.iot321.top-dev
+ Source Server Type    : MySQL
+ Source Server Version : 50740 (5.7.40-log)
+ Source Host           : qdhome.iot321.top:33103
+ Source Schema         : pla-chem-sim-dev-1
+
+ Target Server Type    : MySQL
+ Target Server Version : 50740 (5.7.40-log)
+ File Encoding         : 65001
+
+ Date: 15/12/2024 19:23:02
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_real_exam_collection_dept
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_real_exam_collection_dept`;
+CREATE TABLE `sim_real_exam_collection_dept`  (
+  `rel_id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `exam_collection_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '正式考试集合ID',
+  `dept_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '班级ID/部门ID',
+  `update_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
+  PRIMARY KEY (`rel_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-考试集合班级关联表' ROW_FORMAT = DYNAMIC;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 39 - 0
pla-sim/01_SQL/02_table/sim_real_exam_comp_request.sql

@@ -0,0 +1,39 @@
+/*
+ Navicat Premium Dump SQL
+
+ Source Server         : qdhome.iot321.top-dev
+ Source Server Type    : MySQL
+ Source Server Version : 50740 (5.7.40-log)
+ Source Host           : qdhome.iot321.top:33103
+ Source Schema         : pla-chem-sim-dev-1
+
+ Target Server Type    : MySQL
+ Target Server Version : 50740 (5.7.40-log)
+ File Encoding         : 65001
+
+ Date: 15/12/2024 19:23:07
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_real_exam_comp_request
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_real_exam_comp_request`;
+CREATE TABLE `sim_real_exam_comp_request`  (
+  `rel_id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `exam_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '考试ID',
+  `fault_id` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '故障ID',
+  `request_status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '状态\r\n1:已申请\r\n2:已处理\r\n3:已驳回',
+  `create_by_user_id` bigint(20) NULL DEFAULT 0 COMMENT '创建学员ID/用户ID',
+  `update_by_user_id` bigint(20) NULL DEFAULT 0 COMMENT '创建教师ID/用户ID',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`rel_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-考试更换件关联表' ROW_FORMAT = DYNAMIC;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 40 - 0
pla-sim/01_SQL/02_table/sim_real_exam_fault.sql

@@ -0,0 +1,40 @@
+/*
+ Navicat Premium Dump SQL
+
+ Source Server         : qdhome.iot321.top-dev
+ Source Server Type    : MySQL
+ Source Server Version : 50740 (5.7.40-log)
+ Source Host           : qdhome.iot321.top:33103
+ Source Schema         : pla-chem-sim-dev-1
+
+ Target Server Type    : MySQL
+ Target Server Version : 50740 (5.7.40-log)
+ File Encoding         : 65001
+
+ Date: 15/12/2024 19:23:15
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_real_exam_fault
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_real_exam_fault`;
+CREATE TABLE `sim_real_exam_fault`  (
+  `ref_id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `exam_id` bigint(20) NOT NULL COMMENT '考试ID',
+  `fault_id` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '故障ID',
+  `flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '7' COMMENT '7:未知\r\n1:选中\r\n0:没有选中',
+  `question_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '出题数值',
+  `answer_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '答题数值',
+  `minus` int(2) NULL DEFAULT 0 COMMENT '减分值 计正数',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`ref_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-考试故障关联表' ROW_FORMAT = DYNAMIC;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 51 - 0
pla-sim/01_SQL/02_table/sim_seat.sql

@@ -0,0 +1,51 @@
+/*
+ Navicat Premium Dump SQL
+
+ Source Server         : qdhome.iot321.top-dev
+ Source Server Type    : MySQL
+ Source Server Version : 50740 (5.7.40-log)
+ Source Host           : qdhome.iot321.top:33103
+ Source Schema         : pla-chem-sim-dev-1
+
+ Target Server Type    : MySQL
+ Target Server Version : 50740 (5.7.40-log)
+ File Encoding         : 65001
+
+ Date: 15/12/2024 19:23:27
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_seat
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_seat`;
+CREATE TABLE `sim_seat`  (
+  `seat_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '座ID',
+  `seat_num` int(4) NOT NULL DEFAULT 0 COMMENT '座号',
+  `seat_bind_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '绑定的IP地址',
+  `current_user_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '当前座上学员/用户ID',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`seat_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 11 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-座表' ROW_FORMAT = DYNAMIC;
+
+-- ----------------------------
+-- Records of sim_seat
+-- ----------------------------
+INSERT INTO `sim_seat` VALUES (1, 1, '192.168.1.101', 0, NULL, NULL, NULL, NULL, '座号1');
+INSERT INTO `sim_seat` VALUES (2, 2, '192.168.1.102', 0, NULL, NULL, NULL, NULL, '座号2');
+INSERT INTO `sim_seat` VALUES (3, 3, '192.168.1.103', 0, NULL, NULL, NULL, NULL, '座号3');
+INSERT INTO `sim_seat` VALUES (4, 4, '192.168.1.104', 0, NULL, NULL, NULL, NULL, '座号4');
+INSERT INTO `sim_seat` VALUES (5, 5, '192.168.1.105', 0, NULL, NULL, NULL, NULL, '座号5');
+INSERT INTO `sim_seat` VALUES (6, 6, '192.168.1.106', 0, NULL, NULL, NULL, NULL, '座号6');
+INSERT INTO `sim_seat` VALUES (7, 7, '192.168.1.107', 0, NULL, NULL, NULL, NULL, '座号7');
+INSERT INTO `sim_seat` VALUES (8, 8, '192.168.1.108', 0, NULL, NULL, NULL, NULL, '座号8');
+INSERT INTO `sim_seat` VALUES (9, 9, '192.168.1.109', 0, NULL, NULL, NULL, NULL, '座号9');
+INSERT INTO `sim_seat` VALUES (10, 10, '192.168.1.110', 0, NULL, NULL, NULL, NULL, '座号10');
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 14 - 7
pla-sim/01_SQL/02_table/sim_sim.sql

@@ -1,17 +1,17 @@
 /*
  Navicat Premium Dump SQL
 
- Source Server         : qdhome.iot321.top
+ Source Server         : qdhome.iot321.top-dev
  Source Server Type    : MySQL
  Source Server Version : 50740 (5.7.40-log)
- Source Host           : qdhome.iot321.top:33003
+ Source Host           : qdhome.iot321.top:33103
  Source Schema         : pla-chem-sim-dev-1
 
  Target Server Type    : MySQL
  Target Server Version : 50740 (5.7.40-log)
  File Encoding         : 65001
 
- Date: 11/12/2024 01:22:35
+ Date: 15/12/2024 19:23:37
 */
 
 SET NAMES utf8mb4;
@@ -24,15 +24,22 @@ DROP TABLE IF EXISTS `sim_sim`;
 CREATE TABLE `sim_sim`  (
   `sim_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '模拟器ID',
   `seat_id` bigint(20) NOT NULL COMMENT '座ID',
-  `sim_type` char(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '模拟器类型',
-  `state` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '模拟器在线 1:在线 2:离线 3:硬件故障异常',
-  `sim_sn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '模拟器序列号',
+  `sim_type` char(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '模拟器类型',
+  `sim_state` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '模拟器在线 1:在线 2:离线 3:硬件故障异常',
+  `sim_sn` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '模拟器序列号',
   `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
   `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
   `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
   `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
   `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
   PRIMARY KEY (`sim_id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-模拟器表' ROW_FORMAT = DYNAMIC;
+) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-模拟器表' ROW_FORMAT = DYNAMIC;
+
+-- ----------------------------
+-- Records of sim_sim
+-- ----------------------------
+INSERT INTO `sim_sim` VALUES (11, 1, '0001', '0', 'A0001', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_sim` VALUES (12, 2, '0001', '0', 'A0002', NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sim_sim` VALUES (13, 3, '0001', '0', 'A0003', NULL, NULL, NULL, NULL, NULL);
 
 SET FOREIGN_KEY_CHECKS = 1;

+ 4 - 4
pla-sim/01_SQL/02_table/sim_sim_msg.sql

@@ -1,17 +1,17 @@
 /*
  Navicat Premium Dump SQL
 
- Source Server         : qdhome.iot321.top
+ Source Server         : qdhome.iot321.top-dev
  Source Server Type    : MySQL
  Source Server Version : 50740 (5.7.40-log)
- Source Host           : qdhome.iot321.top:33003
+ Source Host           : qdhome.iot321.top:33103
  Source Schema         : pla-chem-sim-dev-1
 
  Target Server Type    : MySQL
  Target Server Version : 50740 (5.7.40-log)
  File Encoding         : 65001
 
- Date: 11/12/2024 02:31:16
+ Date: 15/12/2024 19:23:46
 */
 
 SET NAMES utf8mb4;
@@ -37,6 +37,6 @@ CREATE TABLE `sim_sim_msg`  (
   `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
   `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
   PRIMARY KEY (`sim_msg_id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-模拟器报文表' ROW_FORMAT = DYNAMIC;
+) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-模拟器报文表' ROW_FORMAT = DYNAMIC;
 
 SET FOREIGN_KEY_CHECKS = 1;

+ 38 - 0
pla-sim/01_SQL/02_table/sim_task.sql

@@ -0,0 +1,38 @@
+/*
+ Navicat Premium Dump SQL
+
+ Source Server         : qdhome.iot321.top-dev
+ Source Server Type    : MySQL
+ Source Server Version : 50740 (5.7.40-log)
+ Source Host           : qdhome.iot321.top:33103
+ Source Schema         : pla-chem-sim-dev-1
+
+ Target Server Type    : MySQL
+ Target Server Version : 50740 (5.7.40-log)
+ File Encoding         : 65001
+
+ Date: 16/12/2024 13:13:44
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_task
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_task`;
+CREATE TABLE `sim_task`  (
+  `task_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务ID',
+  `sim_type` char(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '模拟器型号',
+  `task_type` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务类型\r\n1:教师创建管理\r\n2:考试临时数据',
+  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '任务名称',
+  `create_by_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建教师ID/用户ID',
+  `create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者',
+  `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
+  `update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
+  `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
+  `remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
+  PRIMARY KEY (`task_id`) USING BTREE
+) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-任务表' ROW_FORMAT = DYNAMIC;
+
+SET FOREIGN_KEY_CHECKS = 1;

+ 3 - 3
pla-sim/01_SQL/02_table/sim_task_fault.sql

@@ -11,7 +11,7 @@
  Target Server Version : 50740 (5.7.40-log)
  File Encoding         : 65001
 
- Date: 13/12/2024 13:35:34
+ Date: 16/12/2024 15:01:06
 */
 
 SET NAMES utf8mb4;
@@ -26,8 +26,8 @@ CREATE TABLE `sim_task_fault`  (
   `task_id` bigint(20) NOT NULL,
   `fault_id` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
   `flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '7' COMMENT '7:未知\r\n1:选中\r\n0:没有选中',
-  `update_time` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
+  `update_time` datetime NULL DEFAULT NULL,
   PRIMARY KEY (`rel_id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-任务故障关联表' ROW_FORMAT = DYNAMIC;
+) ENGINE = InnoDB AUTO_INCREMENT = 70 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'sim-任务故障关联表' ROW_FORMAT = DYNAMIC;
 
 SET FOREIGN_KEY_CHECKS = 1;

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 324 - 186
pla-sim/01_SQL/03_dev_backup/pla-chem-sim-dev-1.sql


+ 2 - 0
pom.xml

@@ -198,7 +198,9 @@
         <module>ruoyi-quartz</module>
         <module>ruoyi-generator</module>
         <module>ruoyi-common</module>
+        <!-- sim追加二次开发 -->
         <module>ruoyi-sim</module>
+        <module>ele6-catalyzer-ruoyi-vue</module>
     </modules>
     <packaging>pom</packaging>
 

+ 12 - 0
ruoyi-admin/src/main/resources/application-sim.yml

@@ -0,0 +1,12 @@
+# sim自定义相关配置
+sim:
+  #
+  gatewayIp: 192.168.10.10
+  #
+  gatewayPort: 8080
+  #
+  gatewayTimeout: 250
+  #
+  gatewayReachableTimeout: 2000
+  #
+  selfExamDuration: 45

+ 6 - 0
ruoyi-sim/pom.xml

@@ -33,6 +33,12 @@
             <artifactId>ruoyi-system</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>cn.ele6</groupId>
+            <artifactId>catalyzer-ruoyi-vue</artifactId>
+            <version>0.0.2-SNAPSHOT</version>
+        </dependency>
+
         <!-- hutool -->
         <dependency>
             <groupId>cn.hutool</groupId>

+ 78 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/config/SimConfig.java

@@ -0,0 +1,78 @@
+package com.ruoyi.sim.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 本项目自定义配置类。
+ */
+@Configuration
+@ConfigurationProperties(prefix = "sim")
+public class SimConfig {
+
+    /**
+     * 模拟器的 网关ip。
+     */
+    private String gatewayIp;
+
+    /**
+     * 模拟器的 网关port。
+     */
+    private int gatewayPort;
+
+    /**
+     * 模拟器通信的 超时时间 ms。
+     */
+    private long gatewayTimeout;
+
+    /**
+     *
+     */
+    private int gatewayReachableTimeout;
+
+    /**
+     * 自主练习时长 minute。
+     */
+    private int selfExamDuration;
+
+
+    public String getGatewayIp() {
+        return gatewayIp;
+    }
+
+    public void setGatewayIp(String gatewayIp) {
+        this.gatewayIp = gatewayIp;
+    }
+
+    public int getGatewayPort() {
+        return gatewayPort;
+    }
+
+    public void setGatewayPort(int gatewayPort) {
+        this.gatewayPort = gatewayPort;
+    }
+
+    public long getGatewayTimeout() {
+        return gatewayTimeout;
+    }
+
+    public void setGatewayTimeout(long gatewayTimeout) {
+        this.gatewayTimeout = gatewayTimeout;
+    }
+
+    public int getGatewayReachableTimeout() {
+        return gatewayReachableTimeout;
+    }
+
+    public void setGatewayReachableTimeout(int gatewayReachableTimeout) {
+        this.gatewayReachableTimeout = gatewayReachableTimeout;
+    }
+
+    public int getSelfExamDuration() {
+        return selfExamDuration;
+    }
+
+    public void setSelfExamDuration(int selfExamDuration) {
+        this.selfExamDuration = selfExamDuration;
+    }
+}

+ 0 - 11
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/AddOnDeptController.java

@@ -1,19 +1,8 @@
 package com.ruoyi.sim.controller;
 
 import com.ruoyi.common.core.controller.BaseController;
-import com.ruoyi.common.core.domain.AjaxResult;
-import com.ruoyi.common.core.domain.entity.SysDept;
-import com.ruoyi.sim.service.IAddOnDeptService;
-import com.ruoyi.system.service.ISysDeptService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.List;
 
 @RestController
 //@RequestMapping("/sim/add-on-dept")

+ 4 - 6
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/AddOnUserController.java

@@ -3,6 +3,7 @@ package com.ruoyi.sim.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.sim.service.impl.AddOnUserService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -11,14 +12,11 @@ import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.sim.domain.AddOnUser;
-import com.ruoyi.sim.service.IAddOnUserService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
@@ -28,11 +26,11 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * @author tom
  * @date 2024-12-11
  */
-@RestController
-@RequestMapping("/sim/add_on_user")
+// @RestController
+// @RequestMapping("/sim/add_on_user")
 public class AddOnUserController extends BaseController {
     @Autowired
-    private IAddOnUserService addOnUserService;
+    private AddOnUserService addOnUserService;
 
     /**
      * 查询用户附加列表

+ 11 - 19
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/FaultController.java

@@ -3,13 +3,13 @@ package com.ruoyi.sim.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
-import com.ruoyi.sim.domain.vo.FaultTree;
+import com.ruoyi.sim.service.impl.FaultService;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -19,7 +19,6 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.sim.domain.Fault;
-import com.ruoyi.sim.service.IFaultService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
@@ -27,20 +26,19 @@ import com.ruoyi.common.core.page.TableDataInfo;
  * 故障Controller
  *
  * @author tom
- * @date 2024-12-13
+ * @date 2024-12-15
  */
 @RestController
 @RequestMapping("/sim/fault")
 public class FaultController extends BaseController {
     @Autowired
-    private IFaultService faultService;
+    private FaultService faultService;
 
     /**
      * 查询故障列表
      */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:list')")
+    @PreAuthorize("@ss.hasPermi('sim:fault:list')")
     @GetMapping("/list")
-    @ApiOperation("查询故障列表")
     public TableDataInfo list(Fault fault) {
         startPage();
         List<Fault> list = faultService.selectFaultList(fault);
@@ -62,7 +60,7 @@ public class FaultController extends BaseController {
     /**
      * 获取故障详细信息
      */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:query')")
+    @PreAuthorize("@ss.hasPermi('sim:fault:query')")
     @GetMapping(value = "/{faultId}")
     public AjaxResult getInfo(@PathVariable("faultId") String faultId) {
         return success(faultService.selectFaultByFaultId(faultId));
@@ -73,7 +71,7 @@ public class FaultController extends BaseController {
      */
     // @PreAuthorize("@ss.hasPermi('sim:fault:add')")
     @Log(title = "故障", businessType = BusinessType.INSERT)
-    @PostMapping
+    // @PostMapping
     public AjaxResult add(@RequestBody Fault fault) {
         return toAjax(faultService.insertFault(fault));
     }
@@ -101,16 +99,10 @@ public class FaultController extends BaseController {
     // -------------------------------- tom add  --------------------------------
     private static final Logger logger = LoggerFactory.getLogger(FaultController.class);
 
-    /**
-     * 查询故障列表
-     */
-    // @PreAuthorize("@ss.hasPermi('sim:fault:list')")
+    // @PreAuthorize("@ss.hasPermi('sim:fault:listAllTreeViaSimType')")
     @GetMapping("/listAllTreeViaSimType/{simType}")
-    @ApiOperation("通过模拟器类型,查询故障列表")
-    public TableDataInfo listAllTreeViaSimType(@PathVariable(value = "simType") String simType) {
-        Fault fault =new Fault();
-        fault.setSimType(simType);
-        List<FaultTree> list = faultService.selectFaultListAllTree(fault);
-        return getDataTable(list);
+    @ApiOperation("通过模拟器类型,查询故障列表。")
+    public AjaxResult listAllTreeViaSimType(@PathVariable(value = "simType") String simType) {
+        return faultService.selectAllTreeViaSimType(simType);
     }
 }

+ 2 - 2
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/MajorController.java

@@ -3,6 +3,7 @@ package com.ruoyi.sim.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.sim.service.impl.MajorService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -21,7 +22,6 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.sim.domain.Major;
-import com.ruoyi.sim.service.IMajorService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
@@ -36,7 +36,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 @Api("专业Controller")
 public class MajorController extends BaseController {
     @Autowired
-    private IMajorService majorService;
+    private MajorService majorService;
 
     /**
      * 查询专业列表

+ 98 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCollectionController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.sim.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.sim.service.impl.RealExamCollectionService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.sim.domain.RealExamCollection;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考试集合Controller
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+@RestController
+@RequestMapping("/sim/real-exam-collection")
+public class RealExamCollectionController extends BaseController {
+    @Autowired
+    private RealExamCollectionService realExamCollectionService;
+
+    /**
+     * 查询考试集合列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RealExamCollection realExamCollection) {
+        startPage();
+        List<RealExamCollection> list = realExamCollectionService.selectRealExamCollectionList(realExamCollection);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考试集合列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:export')")
+    @Log(title = "考试集合", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RealExamCollection realExamCollection) {
+        List<RealExamCollection> list = realExamCollectionService.selectRealExamCollectionList(realExamCollection);
+        ExcelUtil<RealExamCollection> util = new ExcelUtil<RealExamCollection>(RealExamCollection.class);
+        util.exportExcel(response, list, "考试集合数据");
+    }
+
+    /**
+     * 获取考试集合详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:query')")
+    @GetMapping(value = "/{examCollectionId}")
+    public AjaxResult getInfo(@PathVariable("examCollectionId") Long examCollectionId) {
+        return success(realExamCollectionService.selectRealExamCollectionByExamCollectionId(examCollectionId));
+    }
+
+    /**
+     * 新增考试集合
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:add')")
+    @Log(title = "考试集合", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RealExamCollection realExamCollection) {
+        return toAjax(realExamCollectionService.insertRealExamCollection(realExamCollection));
+    }
+
+    /**
+     * 修改考试集合
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:edit')")
+    @Log(title = "考试集合", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RealExamCollection realExamCollection) {
+        return toAjax(realExamCollectionService.updateRealExamCollection(realExamCollection));
+    }
+
+    /**
+     * 删除考试集合
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection:remove')")
+    @Log(title = "考试集合", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{examCollectionIds}")
+    public AjaxResult remove(@PathVariable Long[] examCollectionIds) {
+        return toAjax(realExamCollectionService.deleteRealExamCollectionByExamCollectionIds(examCollectionIds));
+    }
+}

+ 98 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCollectionDeptController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.sim.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.sim.service.impl.RealExamCollectionDeptService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.sim.domain.RealExamCollectionDept;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考试集合班级关联Controller
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+@RestController
+@RequestMapping("/sim/real-exam-collection-dept")
+public class RealExamCollectionDeptController extends BaseController {
+    @Autowired
+    private RealExamCollectionDeptService realExamCollectionDeptService;
+
+    /**
+     * 查询考试集合班级关联列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection-dept:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RealExamCollectionDept realExamCollectionDept) {
+        startPage();
+        List<RealExamCollectionDept> list = realExamCollectionDeptService.selectRealExamCollectionDeptList(realExamCollectionDept);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考试集合班级关联列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection-dept:export')")
+    @Log(title = "考试集合班级关联", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RealExamCollectionDept realExamCollectionDept) {
+        List<RealExamCollectionDept> list = realExamCollectionDeptService.selectRealExamCollectionDeptList(realExamCollectionDept);
+        ExcelUtil<RealExamCollectionDept> util = new ExcelUtil<RealExamCollectionDept>(RealExamCollectionDept.class);
+        util.exportExcel(response, list, "考试集合班级关联数据");
+    }
+
+    /**
+     * 获取考试集合班级关联详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection-dept:query')")
+    @GetMapping(value = "/{relId}")
+    public AjaxResult getInfo(@PathVariable("relId") Long relId) {
+        return success(realExamCollectionDeptService.selectRealExamCollectionDeptByRelId(relId));
+    }
+
+    /**
+     * 新增考试集合班级关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection-dept:add')")
+    @Log(title = "考试集合班级关联", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RealExamCollectionDept realExamCollectionDept) {
+        return toAjax(realExamCollectionDeptService.insertRealExamCollectionDept(realExamCollectionDept));
+    }
+
+    /**
+     * 修改考试集合班级关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection-dept:edit')")
+    @Log(title = "考试集合班级关联", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RealExamCollectionDept realExamCollectionDept) {
+        return toAjax(realExamCollectionDeptService.updateRealExamCollectionDept(realExamCollectionDept));
+    }
+
+    /**
+     * 删除考试集合班级关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-collection-dept:remove')")
+    @Log(title = "考试集合班级关联", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{relIds}")
+    public AjaxResult remove(@PathVariable Long[] relIds) {
+        return toAjax(realExamCollectionDeptService.deleteRealExamCollectionDeptByRelIds(relIds));
+    }
+}

+ 98 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamCompRequestController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.sim.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.sim.service.impl.RealExamCompRequestService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.sim.domain.RealExamCompRequest;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考试更换件关联Controller
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+@RestController
+@RequestMapping("/sim/real-exam-comp-request")
+public class RealExamCompRequestController extends BaseController {
+    @Autowired
+    private RealExamCompRequestService realExamCompRequestService;
+
+    /**
+     * 查询考试更换件关联列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RealExamCompRequest realExamCompRequest) {
+        startPage();
+        List<RealExamCompRequest> list = realExamCompRequestService.selectRealExamCompRequestList(realExamCompRequest);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考试更换件关联列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:export')")
+    @Log(title = "考试更换件关联", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RealExamCompRequest realExamCompRequest) {
+        List<RealExamCompRequest> list = realExamCompRequestService.selectRealExamCompRequestList(realExamCompRequest);
+        ExcelUtil<RealExamCompRequest> util = new ExcelUtil<RealExamCompRequest>(RealExamCompRequest.class);
+        util.exportExcel(response, list, "考试更换件关联数据");
+    }
+
+    /**
+     * 获取考试更换件关联详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:query')")
+    @GetMapping(value = "/{relId}")
+    public AjaxResult getInfo(@PathVariable("relId") Long relId) {
+        return success(realExamCompRequestService.selectRealExamCompRequestByRelId(relId));
+    }
+
+    /**
+     * 新增考试更换件关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:add')")
+    @Log(title = "考试更换件关联", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RealExamCompRequest realExamCompRequest) {
+        return toAjax(realExamCompRequestService.insertRealExamCompRequest(realExamCompRequest));
+    }
+
+    /**
+     * 修改考试更换件关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:edit')")
+    @Log(title = "考试更换件关联", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RealExamCompRequest realExamCompRequest) {
+        return toAjax(realExamCompRequestService.updateRealExamCompRequest(realExamCompRequest));
+    }
+
+    /**
+     * 删除考试更换件关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-comp-request:remove')")
+    @Log(title = "考试更换件关联", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{relIds}")
+    public AjaxResult remove(@PathVariable Long[] relIds) {
+        return toAjax(realExamCompRequestService.deleteRealExamCompRequestByRelIds(relIds));
+    }
+}

+ 98 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.sim.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.sim.service.impl.RealExamService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.sim.domain.RealExam;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考试Controller
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+@RestController
+@RequestMapping("/sim/real-exam")
+public class RealExamController extends BaseController {
+    @Autowired
+    private RealExamService realExamService;
+
+    /**
+     * 查询考试列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RealExam realExam) {
+        startPage();
+        List<RealExam> list = realExamService.selectRealExamList(realExam);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考试列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam:export')")
+    @Log(title = "考试", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RealExam realExam) {
+        List<RealExam> list = realExamService.selectRealExamList(realExam);
+        ExcelUtil<RealExam> util = new ExcelUtil<RealExam>(RealExam.class);
+        util.exportExcel(response, list, "考试数据");
+    }
+
+    /**
+     * 获取考试详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam:query')")
+    @GetMapping(value = "/{examId}")
+    public AjaxResult getInfo(@PathVariable("examId") Long examId) {
+        return success(realExamService.selectRealExamByExamId(examId));
+    }
+
+    /**
+     * 新增考试
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam:add')")
+    @Log(title = "考试", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RealExam realExam) {
+        return toAjax(realExamService.insertRealExam(realExam));
+    }
+
+    /**
+     * 修改考试
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam:edit')")
+    @Log(title = "考试", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RealExam realExam) {
+        return toAjax(realExamService.updateRealExam(realExam));
+    }
+
+    /**
+     * 删除考试
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam:remove')")
+    @Log(title = "考试", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{examIds}")
+    public AjaxResult remove(@PathVariable Long[] examIds) {
+        return toAjax(realExamService.deleteRealExamByExamIds(examIds));
+    }
+}

+ 98 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/RealExamFaultController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.sim.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.sim.service.impl.RealExamFaultService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.sim.domain.RealExamFault;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 考试故障关联Controller
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+@RestController
+@RequestMapping("/sim/real-exam-fault")
+public class RealExamFaultController extends BaseController {
+    @Autowired
+    private RealExamFaultService realExamFaultService;
+
+    /**
+     * 查询考试故障关联列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-fault:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RealExamFault realExamFault) {
+        startPage();
+        List<RealExamFault> list = realExamFaultService.selectRealExamFaultList(realExamFault);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出考试故障关联列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-fault:export')")
+    @Log(title = "考试故障关联", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, RealExamFault realExamFault) {
+        List<RealExamFault> list = realExamFaultService.selectRealExamFaultList(realExamFault);
+        ExcelUtil<RealExamFault> util = new ExcelUtil<RealExamFault>(RealExamFault.class);
+        util.exportExcel(response, list, "考试故障关联数据");
+    }
+
+    /**
+     * 获取考试故障关联详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-fault:query')")
+    @GetMapping(value = "/{refId}")
+    public AjaxResult getInfo(@PathVariable("refId") Long refId) {
+        return success(realExamFaultService.selectRealExamFaultByRefId(refId));
+    }
+
+    /**
+     * 新增考试故障关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-fault:add')")
+    @Log(title = "考试故障关联", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody RealExamFault realExamFault) {
+        return toAjax(realExamFaultService.insertRealExamFault(realExamFault));
+    }
+
+    /**
+     * 修改考试故障关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-fault:edit')")
+    @Log(title = "考试故障关联", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RealExamFault realExamFault) {
+        return toAjax(realExamFaultService.updateRealExamFault(realExamFault));
+    }
+
+    /**
+     * 删除考试故障关联
+     */
+    @PreAuthorize("@ss.hasPermi('sim:real-exam-fault:remove')")
+    @Log(title = "考试故障关联", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{refIds}")
+    public AjaxResult remove(@PathVariable Long[] refIds) {
+        return toAjax(realExamFaultService.deleteRealExamFaultByRefIds(refIds));
+    }
+}

+ 98 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/SeatController.java

@@ -0,0 +1,98 @@
+package com.ruoyi.sim.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.sim.service.impl.SeatService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.sim.domain.Seat;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 座Controller
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+@RestController
+@RequestMapping("/sim/seat")
+public class SeatController extends BaseController {
+    @Autowired
+    private SeatService seatService;
+
+    /**
+     * 查询座列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:seat:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Seat seat) {
+        startPage();
+        List<Seat> list = seatService.selectSeatList(seat);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出座列表
+     */
+    @PreAuthorize("@ss.hasPermi('sim:seat:export')")
+    @Log(title = "座", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, Seat seat) {
+        List<Seat> list = seatService.selectSeatList(seat);
+        ExcelUtil<Seat> util = new ExcelUtil<Seat>(Seat.class);
+        util.exportExcel(response, list, "座数据");
+    }
+
+    /**
+     * 获取座详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('sim:seat:query')")
+    @GetMapping(value = "/{seatId}")
+    public AjaxResult getInfo(@PathVariable("seatId") Long seatId) {
+        return success(seatService.selectSeatBySeatId(seatId));
+    }
+
+    /**
+     * 新增座
+     */
+    @PreAuthorize("@ss.hasPermi('sim:seat:add')")
+    @Log(title = "座", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody Seat seat) {
+        return toAjax(seatService.insertSeat(seat));
+    }
+
+    /**
+     * 修改座
+     */
+    @PreAuthorize("@ss.hasPermi('sim:seat:edit')")
+    @Log(title = "座", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody Seat seat) {
+        return toAjax(seatService.updateSeat(seat));
+    }
+
+    /**
+     * 删除座
+     */
+    @PreAuthorize("@ss.hasPermi('sim:seat:remove')")
+    @Log(title = "座", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{seatIds}")
+    public AjaxResult remove(@PathVariable Long[] seatIds) {
+        return toAjax(seatService.deleteSeatBySeatIds(seatIds));
+    }
+}

+ 2 - 2
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/SimController.java

@@ -3,6 +3,7 @@ package com.ruoyi.sim.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.sim.service.impl.SimService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -18,7 +19,6 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.sim.domain.Sim;
-import com.ruoyi.sim.service.ISimService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
@@ -32,7 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 @RequestMapping("/sim/sim")
 public class SimController extends BaseController {
     @Autowired
-    private ISimService simService;
+    private SimService simService;
 
     /**
      * 查询模拟器列表

+ 2 - 2
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/SimMsgController.java

@@ -3,6 +3,7 @@ package com.ruoyi.sim.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.sim.service.impl.SimMsgService;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +20,6 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.sim.domain.SimMsg;
-import com.ruoyi.sim.service.ISimMsgService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
@@ -33,7 +33,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 @RequestMapping("/sim/sim_msg")
 public class SimMsgController extends BaseController {
     @Autowired
-    private ISimMsgService simMsgService;
+    private SimMsgService simMsgService;
 
     /**
      * 查询模拟器报文列表

+ 12 - 8
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TaskController.java

@@ -3,6 +3,8 @@ package com.ruoyi.sim.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.sim.domain.vo.TaskVo;
+import com.ruoyi.sim.service.impl.TaskService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +21,6 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.sim.domain.Task;
-import com.ruoyi.sim.service.ITaskService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
@@ -34,13 +35,14 @@ import com.ruoyi.common.core.page.TableDataInfo;
 @Api("任务Controller")
 public class TaskController extends BaseController {
     @Autowired
-    private ITaskService taskService;
+    private TaskService taskService;
 
     /**
      * 查询任务列表
      */
     // @PreAuthorize("@ss.hasPermi('sim:task:list')")
     @GetMapping("/list")
+    @ApiOperation("查询任务列表")
     public TableDataInfo list(Task task) {
         startPage();
         List<Task> list = taskService.selectTaskList(task);
@@ -51,7 +53,7 @@ public class TaskController extends BaseController {
      * 导出任务列表
      */
     // @PreAuthorize("@ss.hasPermi('sim:task:export')")
-    @Log(title = "任务", businessType = BusinessType.EXPORT)
+    // @Log(title = "任务", businessType = BusinessType.EXPORT)
     // @PostMapping("/export")
     public void export(HttpServletResponse response, Task task) {
         List<Task> list = taskService.selectTaskList(task);
@@ -64,6 +66,7 @@ public class TaskController extends BaseController {
      */
     // @PreAuthorize("@ss.hasPermi('sim:task:query')")
     @GetMapping(value = "/{taskId}")
+    @ApiOperation("获取任务详细信息")
     public AjaxResult getInfo(@PathVariable("taskId") Long taskId) {
         return success(taskService.selectTaskByTaskId(taskId));
     }
@@ -75,8 +78,8 @@ public class TaskController extends BaseController {
     @Log(title = "任务", businessType = BusinessType.INSERT)
     @PostMapping
     @ApiOperation("新增任务")
-    public AjaxResult add(@RequestBody Task task) {
-        return toAjax(taskService.insertTask(task));
+    public AjaxResult add(@RequestBody TaskVo task) {
+        return taskService.insertTaskByTeacher(task);
     }
 
     /**
@@ -95,6 +98,7 @@ public class TaskController extends BaseController {
     // @PreAuthorize("@ss.hasPermi('sim:task:remove')")
     @Log(title = "任务", businessType = BusinessType.DELETE)
     @DeleteMapping("/{taskIds}")
+    @ApiOperation("删除任务")
     public AjaxResult remove(@PathVariable Long[] taskIds) {
         return toAjax(taskService.deleteTaskByTaskIds(taskIds));
     }
@@ -102,12 +106,12 @@ public class TaskController extends BaseController {
     // -------------------------------- tom add  --------------------------------
 
     /**
-     * 获取空白的任务详细信息,为了新建任务
+     * 获取空白的任务详细信息,为了新建任务
      */
     // @PreAuthorize("@ss.hasPermi('sim:task:query')")
     @GetMapping("/getInfoForAdd/{simType}")
-    @ApiOperation("获取空白的任务详细信息,为了新建任务")
+    @ApiOperation("获取空白的任务详细信息,为了新建任务")
     public AjaxResult getInfoForAdd(@PathVariable("simType") String simType) {
-        return success(taskService.selectNewTaskViaSimType(simType));
+        return taskService.getInfoForAdd(simType);
     }
 }

+ 2 - 2
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TaskFaultController.java

@@ -3,6 +3,7 @@ package com.ruoyi.sim.controller;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.sim.service.impl.TaskFaultService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -18,7 +19,6 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.sim.domain.TaskFault;
-import com.ruoyi.sim.service.ITaskFaultService;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.core.page.TableDataInfo;
 
@@ -32,7 +32,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 @RequestMapping("/sim/task-fault")
 public class TaskFaultController extends BaseController {
     @Autowired
-    private ITaskFaultService taskFaultService;
+    private TaskFaultService taskFaultService;
 
     /**
      * 查询任务故障关联列表

+ 2 - 2
ruoyi-sim/src/main/java/com/ruoyi/sim/controller/TeacherController.java

@@ -9,7 +9,7 @@ import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.sim.domain.Clazz;
 import com.ruoyi.sim.domain.Major;
-import com.ruoyi.sim.service.IAddOnDeptService;
+import com.ruoyi.sim.service.impl.AddOnDeptService;
 import com.ruoyi.sim.service.impl.Consts;
 import com.ruoyi.sim.service.impl.TeacherService;
 import com.ruoyi.system.mapper.SysDeptMapper;
@@ -143,7 +143,7 @@ public class TeacherController extends BaseController {
     @Autowired
     private SysDeptMapper deptMapper;
     @Autowired
-    private IAddOnDeptService addOnDeptService;
+    private AddOnDeptService addOnDeptService;
 
     /**
      * 获取班级/部门列表

+ 2 - 17
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/AddOnUser.java

@@ -9,22 +9,16 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * 用户附加对象 sim_add_on_user
  *
  * @author tom
- * @date 2024-12-11
+ * @date 2024-12-15
  */
 public class AddOnUser extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
     /**
-     * 用户ID
+     * 学员ID/教师ID/用户ID
      */
     private Long userId;
 
-    /**
-     * 专业ID
-     */
-    @Excel(name = "专业ID")
-    private Long majorId;
-
     public void setUserId(Long userId) {
         this.userId = userId;
     }
@@ -33,19 +27,10 @@ public class AddOnUser extends BaseEntity {
         return userId;
     }
 
-    public void setMajorId(Long majorId) {
-        this.majorId = majorId;
-    }
-
-    public Long getMajorId() {
-        return majorId;
-    }
-
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                 .append("userId", getUserId())
-                .append("majorId", getMajorId())
                 .append("createBy", getCreateBy())
                 .append("createTime", getCreateTime())
                 .append("updateBy", getUpdateBy())

+ 54 - 5
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Fault.java

@@ -1,5 +1,6 @@
 package com.ruoyi.sim.domain;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -9,9 +10,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * 故障对象 sim_fault
  *
  * @author tom
- * @date 2024-12-13
+ * @date 2024-12-15
  */
-public class Fault extends BaseEntity {
+public class Fault extends BaseEntity implements Comparable<Fault> {
     private static final long serialVersionUID = 1L;
 
     /**
@@ -20,10 +21,10 @@ public class Fault extends BaseEntity {
     private String faultId;
 
     /**
-     * $column.columnComment
+     * 父故障ID
      */
-    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
-    private String parentFaultId = "";
+    @Excel(name = "父故障ID")
+    private String parentFaultId;
 
     /**
      * 模拟器类型
@@ -49,6 +50,18 @@ public class Fault extends BaseEntity {
     private String conflictFaultId;
 
     /**
+     * 是否是更换件 1:是 0:不是
+     */
+    @Excel(name = "是否是更换件 1:是 0:不是")
+    private String replacePart;
+
+    /**
+     * 更换件名称
+     */
+    @Excel(name = "更换件名称")
+    private String replaceName;
+
+    /**
      * 名称
      */
     @Excel(name = "名称")
@@ -106,6 +119,22 @@ public class Fault extends BaseEntity {
         return conflictFaultId;
     }
 
+    public void setReplacePart(String replacePart) {
+        this.replacePart = replacePart;
+    }
+
+    public String getReplacePart() {
+        return replacePart;
+    }
+
+    public void setReplaceName(String replaceName) {
+        this.replaceName = replaceName;
+    }
+
+    public String getReplaceName() {
+        return replaceName;
+    }
+
     public void setName(String name) {
         this.name = name;
     }
@@ -138,6 +167,8 @@ public class Fault extends BaseEntity {
                 .append("simType", getSimType())
                 .append("faultType", getFaultType())
                 .append("conflictFaultId", getConflictFaultId())
+                .append("replacePart", getReplacePart())
+                .append("replaceName", getReplaceName())
                 .append("name", getName())
                 .append("simMsg", getSimMsg())
                 .append("orderNum", getOrderNum())
@@ -148,4 +179,22 @@ public class Fault extends BaseEntity {
                 .append("remark", getRemark())
                 .toString();
     }
+
+    // -------------------------------- tom add  --------------------------------
+    @Override
+    public int compareTo(Fault o) {
+        if (StringUtils.isNotEmpty(faultId)) {
+            return faultId.compareTo(o.getFaultId());
+        } else {
+            return -1;
+        }
+    }
+
+    public static String FAULT_TYPE_1 = "1";
+    public static String FAULT_TYPE_2 = "2";
+    public static String FAULT_TYPE_3 = "3";
+    public static String FAULT_TYPE_4 = "4";
+    public static String FAULT_TYPE_5 = "5";
+
+    public static String ROOT_FAULT_ID = "000000000000";
 }

+ 222 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExam.java

@@ -0,0 +1,222 @@
+package com.ruoyi.sim.domain;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 考试对象 sim_real_exam
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public class RealExam extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 考试ID
+     */
+    private Long examId;
+
+    /**
+     * 考试集合ID
+     */
+    @Excel(name = "考试集合ID")
+    private Long examCollectionId;
+
+    /**
+     * 学员ID/用户ID
+     */
+    @Excel(name = "学员ID/用户ID")
+    private Long userId;
+
+    /**
+     * 座ID
+     */
+    @Excel(name = "座ID")
+    private Long seatId;
+
+    /**
+     * 模拟器ID
+     */
+    @Excel(name = "模拟器ID")
+    private Long simId;
+
+    /**
+     * 考试状态
+     * 0:未登录
+     * 1:已登录
+     * 2:模拟器检查并下发ok
+     * 3:答题中
+     * 4:已交卷
+     * 5:获取模拟成绩分析
+     * 80:教师标记缺考
+     * 81:登录未开始答题
+     * 90:模拟器异常结束
+     */
+    @Excel(name = "考试状态")
+    private String examStatus;
+
+    /**
+     * 总分:累加扣分和计算出总分
+     */
+    @Excel(name = "总分:累加扣分和计算出总分")
+    private Integer totalScore;
+
+    /**
+     * 扣分总计,不计超时扣分
+     */
+    @Excel(name = "扣分总计,不计超时扣分")
+    private Integer deductionTotalScore;
+
+    /**
+     * 考试实际开始时间(毫秒)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "考试实际开始时间(毫秒)", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 考试实际结束时间(毫秒)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "考试实际结束时间(毫秒)", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 登录时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "登录时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date loginTime;
+
+    /**
+     * 登出时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "登出时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date logoutTime;
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setExamCollectionId(Long examCollectionId) {
+        this.examCollectionId = examCollectionId;
+    }
+
+    public Long getExamCollectionId() {
+        return examCollectionId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setSeatId(Long seatId) {
+        this.seatId = seatId;
+    }
+
+    public Long getSeatId() {
+        return seatId;
+    }
+
+    public void setSimId(Long simId) {
+        this.simId = simId;
+    }
+
+    public Long getSimId() {
+        return simId;
+    }
+
+    public void setExamStatus(String examStatus) {
+        this.examStatus = examStatus;
+    }
+
+    public String getExamStatus() {
+        return examStatus;
+    }
+
+    public void setTotalScore(Integer totalScore) {
+        this.totalScore = totalScore;
+    }
+
+    public Integer getTotalScore() {
+        return totalScore;
+    }
+
+    public void setDeductionTotalScore(Integer deductionTotalScore) {
+        this.deductionTotalScore = deductionTotalScore;
+    }
+
+    public Integer getDeductionTotalScore() {
+        return deductionTotalScore;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setLoginTime(Date loginTime) {
+        this.loginTime = loginTime;
+    }
+
+    public Date getLoginTime() {
+        return loginTime;
+    }
+
+    public void setLogoutTime(Date logoutTime) {
+        this.logoutTime = logoutTime;
+    }
+
+    public Date getLogoutTime() {
+        return logoutTime;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("examId", getExamId())
+                .append("examCollectionId", getExamCollectionId())
+                .append("userId", getUserId())
+                .append("seatId", getSeatId())
+                .append("simId", getSimId())
+                .append("examStatus", getExamStatus())
+                .append("totalScore", getTotalScore())
+                .append("deductionTotalScore", getDeductionTotalScore())
+                .append("startTime", getStartTime())
+                .append("endTime", getEndTime())
+                .append("loginTime", getLoginTime())
+                .append("logoutTime", getLogoutTime())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 184 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCollection.java

@@ -0,0 +1,184 @@
+package com.ruoyi.sim.domain;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 考试集合对象 sim_real_exam_collection
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+public class RealExamCollection extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 考试集合ID
+     */
+    private Long examCollectionId;
+
+    /**
+     * 模拟器类型
+     */
+    @Excel(name = "模拟器类型")
+    private String simType;
+
+    /** 出题方式:
+     1 系统随机
+     2 教师自选
+     3 任务自选
+     */
+    @Excel(name = "出题方式")
+    private String questionSettingMethod;
+
+    /** 考试类型
+     1:练习
+     2:自主练习
+     3:考试 */
+    @Excel(name = "考试类型")
+    private String examCollectionType;
+
+    /**
+     * 考试名称
+     */
+    @Excel(name = "考试名称")
+    private String examCollectionName;
+
+    /**
+     * 任务ID
+     */
+    @Excel(name = "任务ID")
+    private Long taskId;
+
+    /**
+     * 限制时长(分钟)
+     */
+    @Excel(name = "限制时长(分钟)")
+    private Integer limitDuration;
+
+    /**
+     * 考试开始时间(天)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "考试开始时间(天)", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date startTime;
+
+    /**
+     * 考试结束时间(天)
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "考试结束时间(天)", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date endTime;
+
+    /**
+     * 创建教师ID/用户ID
+     */
+    @Excel(name = "创建教师ID/用户ID")
+    private Long createUserId;
+
+    public void setExamCollectionId(Long examCollectionId) {
+        this.examCollectionId = examCollectionId;
+    }
+
+    public Long getExamCollectionId() {
+        return examCollectionId;
+    }
+
+    public void setSimType(String simType) {
+        this.simType = simType;
+    }
+
+    public String getSimType() {
+        return simType;
+    }
+
+    public void setQuestionSettingMethod(String questionSettingMethod) {
+        this.questionSettingMethod = questionSettingMethod;
+    }
+
+    public String getQuestionSettingMethod() {
+        return questionSettingMethod;
+    }
+
+    public void setExamCollectionType(String examCollectionType) {
+        this.examCollectionType = examCollectionType;
+    }
+
+    public String getExamCollectionType() {
+        return examCollectionType;
+    }
+
+    public void setExamCollectionName(String examCollectionName) {
+        this.examCollectionName = examCollectionName;
+    }
+
+    public String getExamCollectionName() {
+        return examCollectionName;
+    }
+
+    public void setTaskId(Long taskId) {
+        this.taskId = taskId;
+    }
+
+    public Long getTaskId() {
+        return taskId;
+    }
+
+    public void setLimitDuration(Integer limitDuration) {
+        this.limitDuration = limitDuration;
+    }
+
+    public Integer getLimitDuration() {
+        return limitDuration;
+    }
+
+    public void setStartTime(Date startTime) {
+        this.startTime = startTime;
+    }
+
+    public Date getStartTime() {
+        return startTime;
+    }
+
+    public void setEndTime(Date endTime) {
+        this.endTime = endTime;
+    }
+
+    public Date getEndTime() {
+        return endTime;
+    }
+
+    public void setCreateUserId(Long createUserId) {
+        this.createUserId = createUserId;
+    }
+
+    public Long getCreateUserId() {
+        return createUserId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("examCollectionId", getExamCollectionId())
+                .append("simType", getSimType())
+                .append("questionSettingMethod", getQuestionSettingMethod())
+                .append("examCollectionType", getExamCollectionType())
+                .append("examCollectionName", getExamCollectionName())
+                .append("taskId", getTaskId())
+                .append("limitDuration", getLimitDuration())
+                .append("startTime", getStartTime())
+                .append("endTime", getEndTime())
+                .append("createUserId", getCreateUserId())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 67 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCollectionDept.java

@@ -0,0 +1,67 @@
+package com.ruoyi.sim.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 考试集合班级关联对象 sim_real_exam_collection_dept
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+public class RealExamCollectionDept extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     *
+     */
+    private Long relId;
+
+    /**
+     * 正式考试集合ID
+     */
+    @Excel(name = "正式考试集合ID")
+    private Long examCollectionId;
+
+    /**
+     * 班级ID/部门ID
+     */
+    @Excel(name = "班级ID/部门ID")
+    private Long deptId;
+
+    public void setRelId(Long relId) {
+        this.relId = relId;
+    }
+
+    public Long getRelId() {
+        return relId;
+    }
+
+    public void setExamCollectionId(Long examCollectionId) {
+        this.examCollectionId = examCollectionId;
+    }
+
+    public Long getExamCollectionId() {
+        return examCollectionId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("relId", getRelId())
+                .append("examCollectionId", getExamCollectionId())
+                .append("deptId", getDeptId())
+                .append("updateTime", getUpdateTime())
+                .toString();
+    }
+}

+ 119 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamCompRequest.java

@@ -0,0 +1,119 @@
+package com.ruoyi.sim.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 考试更换件关联对象 sim_real_exam_comp_request
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public class RealExamCompRequest extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long relId;
+
+    /**
+     * 考试ID
+     */
+    @Excel(name = "考试ID")
+    private Long examId;
+
+    /**
+     * 故障ID
+     */
+    @Excel(name = "故障ID")
+    private String faultId;
+
+    /**
+     * 状态
+     * 1:已申请
+     * 2:已处理
+     * 3:已驳回
+     */
+    @Excel(name = "状态")
+    private String requestStatus;
+
+    /**
+     * 创建学员ID/用户ID
+     */
+    @Excel(name = "创建学员ID/用户ID")
+    private Long createByUserId;
+
+    /**
+     * 创建教师ID/用户ID
+     */
+    @Excel(name = "创建教师ID/用户ID")
+    private Long updateByUserId;
+
+    public void setRelId(Long relId) {
+        this.relId = relId;
+    }
+
+    public Long getRelId() {
+        return relId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setFaultId(String faultId) {
+        this.faultId = faultId;
+    }
+
+    public String getFaultId() {
+        return faultId;
+    }
+
+    public void setRequestStatus(String requestStatus) {
+        this.requestStatus = requestStatus;
+    }
+
+    public String getRequestStatus() {
+        return requestStatus;
+    }
+
+    public void setCreateByUserId(Long createByUserId) {
+        this.createByUserId = createByUserId;
+    }
+
+    public Long getCreateByUserId() {
+        return createByUserId;
+    }
+
+    public void setUpdateByUserId(Long updateByUserId) {
+        this.updateByUserId = updateByUserId;
+    }
+
+    public Long getUpdateByUserId() {
+        return updateByUserId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("relId", getRelId())
+                .append("examId", getExamId())
+                .append("faultId", getFaultId())
+                .append("requestStatus", getRequestStatus())
+                .append("createByUserId", getCreateByUserId())
+                .append("updateByUserId", getUpdateByUserId())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 133 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/RealExamFault.java

@@ -0,0 +1,133 @@
+package com.ruoyi.sim.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 考试故障关联对象 sim_real_exam_fault
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public class RealExamFault extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long refId;
+
+    /**
+     * 考试ID
+     */
+    @Excel(name = "考试ID")
+    private Long examId;
+
+    /**
+     * 故障ID
+     */
+    @Excel(name = "故障ID")
+    private String faultId;
+
+    /**
+     * 7:未知
+     * 1:选中
+     * 0:没有选中
+     */
+    @Excel(name = "flag")
+    private String flag;
+
+    /**
+     * 出题数值
+     */
+    @Excel(name = "出题数值")
+    private String questionValue;
+
+    /**
+     * 答题数值
+     */
+    @Excel(name = "答题数值")
+    private String answerValue;
+
+    /**
+     * 减分值 计正数
+     */
+    @Excel(name = "减分值 计正数")
+    private Integer minus;
+
+    public void setRefId(Long refId) {
+        this.refId = refId;
+    }
+
+    public Long getRefId() {
+        return refId;
+    }
+
+    public void setExamId(Long examId) {
+        this.examId = examId;
+    }
+
+    public Long getExamId() {
+        return examId;
+    }
+
+    public void setFaultId(String faultId) {
+        this.faultId = faultId;
+    }
+
+    public String getFaultId() {
+        return faultId;
+    }
+
+    public void setFlag(String flag) {
+        this.flag = flag;
+    }
+
+    public String getFlag() {
+        return flag;
+    }
+
+    public void setQuestionValue(String questionValue) {
+        this.questionValue = questionValue;
+    }
+
+    public String getQuestionValue() {
+        return questionValue;
+    }
+
+    public void setAnswerValue(String answerValue) {
+        this.answerValue = answerValue;
+    }
+
+    public String getAnswerValue() {
+        return answerValue;
+    }
+
+    public void setMinus(Integer minus) {
+        this.minus = minus;
+    }
+
+    public Integer getMinus() {
+        return minus;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("refId", getRefId())
+                .append("examId", getExamId())
+                .append("faultId", getFaultId())
+                .append("flag", getFlag())
+                .append("questionValue", getQuestionValue())
+                .append("answerValue", getAnswerValue())
+                .append("minus", getMinus())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 86 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Seat.java

@@ -0,0 +1,86 @@
+package com.ruoyi.sim.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 座对象 sim_seat
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+public class Seat extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 座ID
+     */
+    private Long seatId;
+
+    /**
+     * 座号
+     */
+    @Excel(name = "座号")
+    private Integer seatNum;
+
+    /**
+     * 绑定的IP地址
+     */
+    @Excel(name = "绑定的IP地址")
+    private String seatBindIp;
+
+    /**
+     * 当前座上学员/用户ID
+     */
+    @Excel(name = "当前座上学员/用户ID")
+    private Long currentUserId;
+
+    public void setSeatId(Long seatId) {
+        this.seatId = seatId;
+    }
+
+    public Long getSeatId() {
+        return seatId;
+    }
+
+    public void setSeatNum(Integer seatNum) {
+        this.seatNum = seatNum;
+    }
+
+    public Integer getSeatNum() {
+        return seatNum;
+    }
+
+    public void setSeatBindIp(String seatBindIp) {
+        this.seatBindIp = seatBindIp;
+    }
+
+    public String getSeatBindIp() {
+        return seatBindIp;
+    }
+
+    public void setCurrentUserId(Long currentUserId) {
+        this.currentUserId = currentUserId;
+    }
+
+    public Long getCurrentUserId() {
+        return currentUserId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("seatId", getSeatId())
+                .append("seatNum", getSeatNum())
+                .append("seatBindIp", getSeatBindIp())
+                .append("currentUserId", getCurrentUserId())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
+    }
+}

+ 7 - 7
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Sim.java

@@ -9,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
  * 模拟器对象 sim_sim
  *
  * @author tom
- * @date 2024-12-11
+ * @date 2024-12-13
  */
 public class Sim extends BaseEntity {
     private static final long serialVersionUID = 1L;
@@ -35,7 +35,7 @@ public class Sim extends BaseEntity {
      * 模拟器在线 1:在线 2:离线 3:硬件故障异常
      */
     @Excel(name = "模拟器在线 1:在线 2:离线 3:硬件故障异常")
-    private String state;
+    private String simState;
 
     /**
      * 模拟器序列号
@@ -67,12 +67,12 @@ public class Sim extends BaseEntity {
         return simType;
     }
 
-    public void setState(String state) {
-        this.state = state;
+    public void setSimState(String simState) {
+        this.simState = simState;
     }
 
-    public String getState() {
-        return state;
+    public String getSimState() {
+        return simState;
     }
 
     public void setSimSn(String simSn) {
@@ -89,7 +89,7 @@ public class Sim extends BaseEntity {
                 .append("simId", getSimId())
                 .append("seatId", getSeatId())
                 .append("simType", getSimType())
-                .append("state", getState())
+                .append("simState", getSimState())
                 .append("simSn", getSimSn())
                 .append("createBy", getCreateBy())
                 .append("createTime", getCreateTime())

+ 9 - 10
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/Task.java

@@ -1,6 +1,6 @@
 package com.ruoyi.sim.domain;
 
-import com.ruoyi.sim.domain.vo.FaultTree;
+import com.ruoyi.sim.domain.vo.FaultTreeVo;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
@@ -107,13 +107,12 @@ public class Task extends BaseEntity {
     // -------------------------------- tom add  --------------------------------
     public static final Long EMPTY_TASK_ID = 0L;
 
-    private List<FaultTree> faultTreeList;
-
-    public List<FaultTree> getFaultTreeList() {
-        return faultTreeList;
-    }
-
-    public void setFaultTreeList(List<FaultTree> faultTreeList) {
-        this.faultTreeList = faultTreeList;
-    }
+    /**
+     * 教师创建管理
+     */
+    public static final String TASK_TYPE_TEACHER_ADD = "1";
+    /**
+     * 考试临时数据
+     */
+    public static final String TASK_TYPE_TEMP = "2";
 }

+ 6 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/TaskFault.java

@@ -96,4 +96,10 @@ public class TaskFault extends BaseEntity {
         this.faultId = faultId;
         this.flag = flag;
     }
+
+    public TaskFault(Long taskId, String faultId, String flag) {
+        this.taskId = taskId;
+        this.faultId = faultId;
+        this.flag = flag;
+    }
 }

+ 15 - 4
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/vo/FaultTree.java → ruoyi-sim/src/main/java/com/ruoyi/sim/domain/vo/FaultTreeVo.java

@@ -9,17 +9,28 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
  */
 import java.util.List;
 
-public class FaultTree extends Fault {
+/**
+ *
+ */
+public class FaultTreeVo extends Fault {
 
-    private List<FaultTree> children;
+    private List<FaultTreeVo> children;
 
     private TaskFault taskFault;
 
-    public List<FaultTree> getChildren() {
+    public FaultTreeVo() {
+    }
+
+    public FaultTreeVo(List<FaultTreeVo> children, TaskFault taskFault) {
+        this.children = children;
+        this.taskFault = taskFault;
+    }
+
+    public List<FaultTreeVo> getChildren() {
         return children;
     }
 
-    public void setChildren(List<FaultTree> children) {
+    public void setChildren(List<FaultTreeVo> children) {
         this.children = children;
     }
 

+ 26 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/domain/vo/TaskVo.java

@@ -0,0 +1,26 @@
+package com.ruoyi.sim.domain.vo;
+
+import com.ruoyi.sim.domain.Task;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.List;
+
+public class TaskVo extends Task {
+
+    private List<FaultTreeVo> selectedData;
+
+    public List<FaultTreeVo> getSelectedData() {
+        return selectedData;
+    }
+
+    public void setSelectedData(List<FaultTreeVo> selectedData) {
+        this.selectedData = selectedData;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("selectedData", selectedData).toString();
+    }
+}

+ 1 - 1
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/AddOnUserMapper.java

@@ -8,7 +8,7 @@ import com.ruoyi.sim.domain.AddOnUser;
  * 用户附加Mapper接口
  *
  * @author tom
- * @date 2024-12-11
+ * @date 2024-12-15
  */
 public interface AddOnUserMapper {
     /**

+ 61 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCollectionDeptMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.sim.mapper;
+
+import java.util.List;
+
+import com.ruoyi.sim.domain.RealExamCollectionDept;
+
+/**
+ * 考试集合班级关联Mapper接口
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+public interface RealExamCollectionDeptMapper {
+    /**
+     * 查询考试集合班级关联
+     *
+     * @param relId 考试集合班级关联主键
+     * @return 考试集合班级关联
+     */
+    public RealExamCollectionDept selectRealExamCollectionDeptByRelId(Long relId);
+
+    /**
+     * 查询考试集合班级关联列表
+     *
+     * @param realExamCollectionDept 考试集合班级关联
+     * @return 考试集合班级关联集合
+     */
+    public List<RealExamCollectionDept> selectRealExamCollectionDeptList(RealExamCollectionDept realExamCollectionDept);
+
+    /**
+     * 新增考试集合班级关联
+     *
+     * @param realExamCollectionDept 考试集合班级关联
+     * @return 结果
+     */
+    public int insertRealExamCollectionDept(RealExamCollectionDept realExamCollectionDept);
+
+    /**
+     * 修改考试集合班级关联
+     *
+     * @param realExamCollectionDept 考试集合班级关联
+     * @return 结果
+     */
+    public int updateRealExamCollectionDept(RealExamCollectionDept realExamCollectionDept);
+
+    /**
+     * 删除考试集合班级关联
+     *
+     * @param relId 考试集合班级关联主键
+     * @return 结果
+     */
+    public int deleteRealExamCollectionDeptByRelId(Long relId);
+
+    /**
+     * 批量删除考试集合班级关联
+     *
+     * @param relIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRealExamCollectionDeptByRelIds(Long[] relIds);
+}

+ 61 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCollectionMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.sim.mapper;
+
+import java.util.List;
+
+import com.ruoyi.sim.domain.RealExamCollection;
+
+/**
+ * 考试集合Mapper接口
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+public interface RealExamCollectionMapper {
+    /**
+     * 查询考试集合
+     *
+     * @param examCollectionId 考试集合主键
+     * @return 考试集合
+     */
+    public RealExamCollection selectRealExamCollectionByExamCollectionId(Long examCollectionId);
+
+    /**
+     * 查询考试集合列表
+     *
+     * @param realExamCollection 考试集合
+     * @return 考试集合集合
+     */
+    public List<RealExamCollection> selectRealExamCollectionList(RealExamCollection realExamCollection);
+
+    /**
+     * 新增考试集合
+     *
+     * @param realExamCollection 考试集合
+     * @return 结果
+     */
+    public int insertRealExamCollection(RealExamCollection realExamCollection);
+
+    /**
+     * 修改考试集合
+     *
+     * @param realExamCollection 考试集合
+     * @return 结果
+     */
+    public int updateRealExamCollection(RealExamCollection realExamCollection);
+
+    /**
+     * 删除考试集合
+     *
+     * @param examCollectionId 考试集合主键
+     * @return 结果
+     */
+    public int deleteRealExamCollectionByExamCollectionId(Long examCollectionId);
+
+    /**
+     * 批量删除考试集合
+     *
+     * @param examCollectionIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRealExamCollectionByExamCollectionIds(Long[] examCollectionIds);
+}

+ 61 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamCompRequestMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.sim.mapper;
+
+import java.util.List;
+
+import com.ruoyi.sim.domain.RealExamCompRequest;
+
+/**
+ * 考试更换件关联Mapper接口
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public interface RealExamCompRequestMapper {
+    /**
+     * 查询考试更换件关联
+     *
+     * @param relId 考试更换件关联主键
+     * @return 考试更换件关联
+     */
+    public RealExamCompRequest selectRealExamCompRequestByRelId(Long relId);
+
+    /**
+     * 查询考试更换件关联列表
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 考试更换件关联集合
+     */
+    public List<RealExamCompRequest> selectRealExamCompRequestList(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 新增考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    public int insertRealExamCompRequest(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 修改考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    public int updateRealExamCompRequest(RealExamCompRequest realExamCompRequest);
+
+    /**
+     * 删除考试更换件关联
+     *
+     * @param relId 考试更换件关联主键
+     * @return 结果
+     */
+    public int deleteRealExamCompRequestByRelId(Long relId);
+
+    /**
+     * 批量删除考试更换件关联
+     *
+     * @param relIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRealExamCompRequestByRelIds(Long[] relIds);
+}

+ 62 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamFaultMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.sim.mapper;
+
+import java.util.List;
+
+import com.ruoyi.sim.domain.RealExamFault;
+
+/**
+ * 考试故障关联Mapper接口
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public interface RealExamFaultMapper {
+    /**
+     * 查询考试故障关联
+     *
+     * @param refId 考试故障关联主键
+     * @return 考试故障关联
+     */
+    public RealExamFault selectRealExamFaultByRefId(Long refId);
+
+    /**
+     * 查询考试故障关联列表
+     *
+     * @param realExamFault 考试故障关联
+     * @return 考试故障关联集合
+     */
+    public List<RealExamFault> selectRealExamFaultList(RealExamFault realExamFault);
+
+    /**
+     * 新增考试故障关联
+     *
+     * @param realExamFault 考试故障关联
+     * @return 结果
+     */
+    public int insertRealExamFault(RealExamFault realExamFault);
+
+    /**
+     * 修改考试故障关联
+     *
+     * @param realExamFault 考试故障关联
+     * @return 结果
+     */
+    public int updateRealExamFault(RealExamFault realExamFault);
+
+    /**
+     * 删除考试故障关联
+     *
+     * @param refId 考试故障关联主键
+     * @return 结果
+     */
+    public int deleteRealExamFaultByRefId(Long refId);
+
+    /**
+     * 批量删除考试故障关联
+     *
+     * @param refIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRealExamFaultByRefIds(Long[] refIds);
+}
+

+ 61 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/RealExamMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.sim.mapper;
+
+import java.util.List;
+
+import com.ruoyi.sim.domain.RealExam;
+
+/**
+ * 考试Mapper接口
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+public interface RealExamMapper {
+    /**
+     * 查询考试
+     *
+     * @param examId 考试主键
+     * @return 考试
+     */
+    public RealExam selectRealExamByExamId(Long examId);
+
+    /**
+     * 查询考试列表
+     *
+     * @param realExam 考试
+     * @return 考试集合
+     */
+    public List<RealExam> selectRealExamList(RealExam realExam);
+
+    /**
+     * 新增考试
+     *
+     * @param realExam 考试
+     * @return 结果
+     */
+    public int insertRealExam(RealExam realExam);
+
+    /**
+     * 修改考试
+     *
+     * @param realExam 考试
+     * @return 结果
+     */
+    public int updateRealExam(RealExam realExam);
+
+    /**
+     * 删除考试
+     *
+     * @param examId 考试主键
+     * @return 结果
+     */
+    public int deleteRealExamByExamId(Long examId);
+
+    /**
+     * 批量删除考试
+     *
+     * @param examIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteRealExamByExamIds(Long[] examIds);
+}

+ 62 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/SeatMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.sim.mapper;
+
+import java.util.List;
+
+import com.ruoyi.sim.domain.Seat;
+
+/**
+ * 座Mapper接口
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+public interface SeatMapper {
+    /**
+     * 查询座
+     *
+     * @param seatId 座主键
+     * @return 座
+     */
+    public Seat selectSeatBySeatId(Long seatId);
+
+    /**
+     * 查询座列表
+     *
+     * @param seat 座
+     * @return 座集合
+     */
+    public List<Seat> selectSeatList(Seat seat);
+
+    /**
+     * 新增座
+     *
+     * @param seat 座
+     * @return 结果
+     */
+    public int insertSeat(Seat seat);
+
+    /**
+     * 修改座
+     *
+     * @param seat 座
+     * @return 结果
+     */
+    public int updateSeat(Seat seat);
+
+    /**
+     * 删除座
+     *
+     * @param seatId 座主键
+     * @return 结果
+     */
+    public int deleteSeatBySeatId(Long seatId);
+
+    /**
+     * 批量删除座
+     *
+     * @param seatIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSeatBySeatIds(Long[] seatIds);
+}
+

+ 1 - 1
ruoyi-sim/src/main/java/com/ruoyi/sim/mapper/SimMapper.java

@@ -8,7 +8,7 @@ import com.ruoyi.sim.domain.Sim;
  * 模拟器Mapper接口
  *
  * @author tom
- * @date 2024-12-11
+ * @date 2024-12-13
  */
 public interface SimMapper {
     /**

+ 0 - 67
ruoyi-sim/src/main/java/com/ruoyi/sim/service/IAddOnDeptService.java

@@ -1,67 +0,0 @@
-package com.ruoyi.sim.service;
-
-import java.util.List;
-
-import com.ruoyi.common.core.domain.entity.SysDept;
-import com.ruoyi.sim.domain.AddOnDept;
-import com.ruoyi.sim.domain.Clazz;
-import com.ruoyi.sim.domain.Major;
-
-/**
- * 部门附加Service接口
- *
- * @author tom
- * @date 2024-12-13
- */
-public interface IAddOnDeptService {
-    /**
-     * 查询部门附加
-     *
-     * @param deptId 部门附加主键
-     * @return 部门附加
-     */
-    public AddOnDept selectAddOnDeptByDeptId(Long deptId);
-
-    /**
-     * 查询部门附加列表
-     *
-     * @param addOnDept 部门附加
-     * @return 部门附加集合
-     */
-    public List<AddOnDept> selectAddOnDeptList(AddOnDept addOnDept);
-
-    /**
-     * 新增部门附加
-     *
-     * @param addOnDept 部门附加
-     * @return 结果
-     */
-    public int insertAddOnDept(AddOnDept addOnDept);
-
-    /**
-     * 修改部门附加
-     *
-     * @param addOnDept 部门附加
-     * @return 结果
-     */
-    public int updateAddOnDept(AddOnDept addOnDept);
-
-    /**
-     * 批量删除部门附加
-     *
-     * @param deptIds 需要删除的部门附加主键集合
-     * @return 结果
-     */
-    public int deleteAddOnDeptByDeptIds(Long[] deptIds);
-
-    /**
-     * 删除部门附加信息
-     *
-     * @param deptId 部门附加主键
-     * @return 结果
-     */
-    public int deleteAddOnDeptByDeptId(Long deptId);
-
-    // -------------------------------- tom add  --------------------------------
-    public Major selectMajorByDeptId(Long deptId);
-}

+ 0 - 61
ruoyi-sim/src/main/java/com/ruoyi/sim/service/IAddOnUserService.java

@@ -1,61 +0,0 @@
-package com.ruoyi.sim.service;
-
-import java.util.List;
-
-import com.ruoyi.sim.domain.AddOnUser;
-
-/**
- * 用户附加Service接口
- *
- * @author tom
- * @date 2024-12-11
- */
-public interface IAddOnUserService {
-    /**
-     * 查询用户附加
-     *
-     * @param userId 用户附加主键
-     * @return 用户附加
-     */
-    public AddOnUser selectAddOnUserByUserId(Long userId);
-
-    /**
-     * 查询用户附加列表
-     *
-     * @param addOnUser 用户附加
-     * @return 用户附加集合
-     */
-    public List<AddOnUser> selectAddOnUserList(AddOnUser addOnUser);
-
-    /**
-     * 新增用户附加
-     *
-     * @param addOnUser 用户附加
-     * @return 结果
-     */
-    public int insertAddOnUser(AddOnUser addOnUser);
-
-    /**
-     * 修改用户附加
-     *
-     * @param addOnUser 用户附加
-     * @return 结果
-     */
-    public int updateAddOnUser(AddOnUser addOnUser);
-
-    /**
-     * 批量删除用户附加
-     *
-     * @param userIds 需要删除的用户附加主键集合
-     * @return 结果
-     */
-    public int deleteAddOnUserByUserIds(Long[] userIds);
-
-    /**
-     * 删除用户附加信息
-     *
-     * @param userId 用户附加主键
-     * @return 结果
-     */
-    public int deleteAddOnUserByUserId(Long userId);
-}

+ 0 - 72
ruoyi-sim/src/main/java/com/ruoyi/sim/service/IFaultService.java

@@ -1,72 +0,0 @@
-package com.ruoyi.sim.service;
-
-import java.util.List;
-
-import com.ruoyi.sim.domain.Fault;
-import com.ruoyi.sim.domain.vo.FaultTree;
-
-/**
- * 故障Service接口
- *
- * @author tom
- * @date 2024-12-13
- */
-public interface IFaultService {
-    /**
-     * 查询故障
-     *
-     * @param faultId 故障主键
-     * @return 故障
-     */
-    public Fault selectFaultByFaultId(String faultId);
-
-    /**
-     * 查询故障列表
-     *
-     * @param fault 故障
-     * @return 故障集合
-     */
-    public List<Fault> selectFaultList(Fault fault);
-
-    /**
-     * 新增故障
-     *
-     * @param fault 故障
-     * @return 结果
-     */
-    public int insertFault(Fault fault);
-
-    /**
-     * 修改故障
-     *
-     * @param fault 故障
-     * @return 结果
-     */
-    public int updateFault(Fault fault);
-
-    /**
-     * 批量删除故障
-     *
-     * @param faultIds 需要删除的故障主键集合
-     * @return 结果
-     */
-    public int deleteFaultByFaultIds(String[] faultIds);
-
-    /**
-     * 删除故障信息
-     *
-     * @param faultId 故障主键
-     * @return 结果
-     */
-    public int deleteFaultByFaultId(String faultId);
-
-    // -------------------------------- tom add  --------------------------------
-
-    /**
-     * 查询故障列表tree
-     *
-     * @param fault 故障
-     * @return 故障集合
-     */
-    public List<FaultTree> selectFaultListAllTree(Fault fault);
-}

+ 0 - 61
ruoyi-sim/src/main/java/com/ruoyi/sim/service/IMajorService.java

@@ -1,61 +0,0 @@
-package com.ruoyi.sim.service;
-
-import java.util.List;
-
-import com.ruoyi.sim.domain.Major;
-
-/**
- * 专业Service接口
- *
- * @author tom
- * @date 2024-12-11
- */
-public interface IMajorService {
-    /**
-     * 查询专业
-     *
-     * @param majorId 专业主键
-     * @return 专业
-     */
-    public Major selectMajorByMajorId(Long majorId);
-
-    /**
-     * 查询专业列表
-     *
-     * @param major 专业
-     * @return 专业集合
-     */
-    public List<Major> selectMajorList(Major major);
-
-    /**
-     * 新增专业
-     *
-     * @param major 专业
-     * @return 结果
-     */
-    public int insertMajor(Major major);
-
-    /**
-     * 修改专业
-     *
-     * @param major 专业
-     * @return 结果
-     */
-    public int updateMajor(Major major);
-
-    /**
-     * 批量删除专业
-     *
-     * @param majorIds 需要删除的专业主键集合
-     * @return 结果
-     */
-    public int deleteMajorByMajorIds(Long[] majorIds);
-
-    /**
-     * 删除专业信息
-     *
-     * @param majorId 专业主键
-     * @return 结果
-     */
-    public int deleteMajorByMajorId(Long majorId);
-}

+ 0 - 61
ruoyi-sim/src/main/java/com/ruoyi/sim/service/ISimMsgService.java

@@ -1,61 +0,0 @@
-package com.ruoyi.sim.service;
-
-import java.util.List;
-
-import com.ruoyi.sim.domain.SimMsg;
-
-/**
- * 模拟器报文Service接口
- *
- * @author tom
- * @date 2024-12-11
- */
-public interface ISimMsgService {
-    /**
-     * 查询模拟器报文
-     *
-     * @param simMsgId 模拟器报文主键
-     * @return 模拟器报文
-     */
-    public SimMsg selectSimMsgBySimMsgId(Long simMsgId);
-
-    /**
-     * 查询模拟器报文列表
-     *
-     * @param simMsg 模拟器报文
-     * @return 模拟器报文集合
-     */
-    public List<SimMsg> selectSimMsgList(SimMsg simMsg);
-
-    /**
-     * 新增模拟器报文
-     *
-     * @param simMsg 模拟器报文
-     * @return 结果
-     */
-    public int insertSimMsg(SimMsg simMsg);
-
-    /**
-     * 修改模拟器报文
-     *
-     * @param simMsg 模拟器报文
-     * @return 结果
-     */
-    public int updateSimMsg(SimMsg simMsg);
-
-    /**
-     * 批量删除模拟器报文
-     *
-     * @param simMsgIds 需要删除的模拟器报文主键集合
-     * @return 结果
-     */
-    public int deleteSimMsgBySimMsgIds(Long[] simMsgIds);
-
-    /**
-     * 删除模拟器报文信息
-     *
-     * @param simMsgId 模拟器报文主键
-     * @return 结果
-     */
-    public int deleteSimMsgBySimMsgId(Long simMsgId);
-}

+ 0 - 61
ruoyi-sim/src/main/java/com/ruoyi/sim/service/ISimService.java

@@ -1,61 +0,0 @@
-package com.ruoyi.sim.service;
-
-import java.util.List;
-
-import com.ruoyi.sim.domain.Sim;
-
-/**
- * 模拟器Service接口
- *
- * @author tom
- * @date 2024-12-11
- */
-public interface ISimService {
-    /**
-     * 查询模拟器
-     *
-     * @param simId 模拟器主键
-     * @return 模拟器
-     */
-    public Sim selectSimBySimId(Long simId);
-
-    /**
-     * 查询模拟器列表
-     *
-     * @param sim 模拟器
-     * @return 模拟器集合
-     */
-    public List<Sim> selectSimList(Sim sim);
-
-    /**
-     * 新增模拟器
-     *
-     * @param sim 模拟器
-     * @return 结果
-     */
-    public int insertSim(Sim sim);
-
-    /**
-     * 修改模拟器
-     *
-     * @param sim 模拟器
-     * @return 结果
-     */
-    public int updateSim(Sim sim);
-
-    /**
-     * 批量删除模拟器
-     *
-     * @param simIds 需要删除的模拟器主键集合
-     * @return 结果
-     */
-    public int deleteSimBySimIds(Long[] simIds);
-
-    /**
-     * 删除模拟器信息
-     *
-     * @param simId 模拟器主键
-     * @return 结果
-     */
-    public int deleteSimBySimId(Long simId);
-}

+ 0 - 61
ruoyi-sim/src/main/java/com/ruoyi/sim/service/ITaskFaultService.java

@@ -1,61 +0,0 @@
-package com.ruoyi.sim.service;
-
-import java.util.List;
-
-import com.ruoyi.sim.domain.TaskFault;
-
-/**
- * 任务故障关联Service接口
- *
- * @author tom
- * @date 2024-12-13
- */
-public interface ITaskFaultService {
-    /**
-     * 查询任务故障关联
-     *
-     * @param relId 任务故障关联主键
-     * @return 任务故障关联
-     */
-    public TaskFault selectTaskFaultByRelId(Long relId);
-
-    /**
-     * 查询任务故障关联列表
-     *
-     * @param taskFault 任务故障关联
-     * @return 任务故障关联集合
-     */
-    public List<TaskFault> selectTaskFaultList(TaskFault taskFault);
-
-    /**
-     * 新增任务故障关联
-     *
-     * @param taskFault 任务故障关联
-     * @return 结果
-     */
-    public int insertTaskFault(TaskFault taskFault);
-
-    /**
-     * 修改任务故障关联
-     *
-     * @param taskFault 任务故障关联
-     * @return 结果
-     */
-    public int updateTaskFault(TaskFault taskFault);
-
-    /**
-     * 批量删除任务故障关联
-     *
-     * @param relIds 需要删除的任务故障关联主键集合
-     * @return 结果
-     */
-    public int deleteTaskFaultByRelIds(Long[] relIds);
-
-    /**
-     * 删除任务故障关联信息
-     *
-     * @param relId 任务故障关联主键
-     * @return 结果
-     */
-    public int deleteTaskFaultByRelId(Long relId);
-}

+ 0 - 77
ruoyi-sim/src/main/java/com/ruoyi/sim/service/ITaskService.java

@@ -1,77 +0,0 @@
-package com.ruoyi.sim.service;
-
-import java.util.List;
-
-import com.ruoyi.sim.domain.Task;
-
-/**
- * 任务Service接口
- *
- * @author tom
- * @date 2024-12-13
- */
-public interface ITaskService {
-    /**
-     * 查询任务
-     *
-     * @param taskId 任务主键
-     * @return 任务
-     */
-    public Task selectTaskByTaskId(Long taskId);
-
-    /**
-     * 查询任务列表
-     *
-     * @param task 任务
-     * @return 任务集合
-     */
-    public List<Task> selectTaskList(Task task);
-
-    /**
-     * 新增任务
-     *
-     * @param task 任务
-     * @return 结果
-     */
-    public int insertTask(Task task);
-
-    /**
-     * 修改任务
-     *
-     * @param task 任务
-     * @return 结果
-     */
-    public int updateTask(Task task);
-
-    /**
-     * 批量删除任务
-     *
-     * @param taskIds 需要删除的任务主键集合
-     * @return 结果
-     */
-    public int deleteTaskByTaskIds(Long[] taskIds);
-
-    /**
-     * 删除任务信息
-     *
-     * @param taskId 任务主键
-     * @return 结果
-     */
-    public int deleteTaskByTaskId(Long taskId);
-
-    // -------------------------------- tom add  --------------------------------
-
-    /**
-     * @param simType
-     * @return
-     */
-    public Task selectNewTaskViaSimType(String simType);
-
-    /**
-     * 新增任务附带选择故障
-     *
-     * @param task 任务
-     * @return 结果
-     */
-    public int insertTaskWithFault(Task task);
-}

+ 1 - 14
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/AddOnDeptServiceImpl.java → ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/AddOnDeptService.java

@@ -1,20 +1,13 @@
 package com.ruoyi.sim.service.impl;
 
-import java.util.ArrayList;
 import java.util.List;
 
-import com.ruoyi.common.core.domain.entity.SysDept;
-import com.ruoyi.sim.domain.Clazz;
 import com.ruoyi.sim.domain.Major;
 import com.ruoyi.sim.mapper.MajorMapper;
-import com.ruoyi.sim.service.IMajorService;
-import com.ruoyi.system.mapper.SysDeptMapper;
-import com.ruoyi.system.service.ISysDeptService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.sim.mapper.AddOnDeptMapper;
 import com.ruoyi.sim.domain.AddOnDept;
-import com.ruoyi.sim.service.IAddOnDeptService;
 
 /**
  * 部门附加Service业务层处理
@@ -23,7 +16,7 @@ import com.ruoyi.sim.service.IAddOnDeptService;
  * @date 2024-12-13
  */
 @Service
-public class AddOnDeptServiceImpl implements IAddOnDeptService {
+public class AddOnDeptService  {
     @Autowired
     private AddOnDeptMapper addOnDeptMapper;
 
@@ -33,7 +26,6 @@ public class AddOnDeptServiceImpl implements IAddOnDeptService {
      * @param deptId 部门附加主键
      * @return 部门附加
      */
-    @Override
     public AddOnDept selectAddOnDeptByDeptId(Long deptId) {
         return addOnDeptMapper.selectAddOnDeptByDeptId(deptId);
     }
@@ -44,7 +36,6 @@ public class AddOnDeptServiceImpl implements IAddOnDeptService {
      * @param addOnDept 部门附加
      * @return 部门附加
      */
-    @Override
     public List<AddOnDept> selectAddOnDeptList(AddOnDept addOnDept) {
         return addOnDeptMapper.selectAddOnDeptList(addOnDept);
     }
@@ -55,7 +46,6 @@ public class AddOnDeptServiceImpl implements IAddOnDeptService {
      * @param addOnDept 部门附加
      * @return 结果
      */
-    @Override
     public int insertAddOnDept(AddOnDept addOnDept) {
         return addOnDeptMapper.insertAddOnDept(addOnDept);
     }
@@ -66,7 +56,6 @@ public class AddOnDeptServiceImpl implements IAddOnDeptService {
      * @param addOnDept 部门附加
      * @return 结果
      */
-    @Override
     public int updateAddOnDept(AddOnDept addOnDept) {
         return addOnDeptMapper.updateAddOnDept(addOnDept);
     }
@@ -77,7 +66,6 @@ public class AddOnDeptServiceImpl implements IAddOnDeptService {
      * @param deptIds 需要删除的部门附加主键
      * @return 结果
      */
-    @Override
     public int deleteAddOnDeptByDeptIds(Long[] deptIds) {
         return addOnDeptMapper.deleteAddOnDeptByDeptIds(deptIds);
     }
@@ -88,7 +76,6 @@ public class AddOnDeptServiceImpl implements IAddOnDeptService {
      * @param deptId 部门附加主键
      * @return 结果
      */
-    @Override
     public int deleteAddOnDeptByDeptId(Long deptId) {
         return addOnDeptMapper.deleteAddOnDeptByDeptId(deptId);
     }

+ 2 - 11
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/AddOnUserServiceImpl.java → ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/AddOnUserService.java

@@ -3,22 +3,19 @@ package com.ruoyi.sim.service.impl;
 import java.util.List;
 
 import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.system.service.ISysDeptService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.sim.mapper.AddOnUserMapper;
 import com.ruoyi.sim.domain.AddOnUser;
-import com.ruoyi.sim.service.IAddOnUserService;
 
 /**
  * 用户附加Service业务层处理
  *
  * @author tom
- * @date 2024-12-11
+ * @date 2024-12-15
  */
 @Service
-public class AddOnUserServiceImpl implements IAddOnUserService {
-
+public class AddOnUserService   {
     @Autowired
     private AddOnUserMapper addOnUserMapper;
 
@@ -28,7 +25,6 @@ public class AddOnUserServiceImpl implements IAddOnUserService {
      * @param userId 用户附加主键
      * @return 用户附加
      */
-    @Override
     public AddOnUser selectAddOnUserByUserId(Long userId) {
         return addOnUserMapper.selectAddOnUserByUserId(userId);
     }
@@ -39,7 +35,6 @@ public class AddOnUserServiceImpl implements IAddOnUserService {
      * @param addOnUser 用户附加
      * @return 用户附加
      */
-    @Override
     public List<AddOnUser> selectAddOnUserList(AddOnUser addOnUser) {
         return addOnUserMapper.selectAddOnUserList(addOnUser);
     }
@@ -50,7 +45,6 @@ public class AddOnUserServiceImpl implements IAddOnUserService {
      * @param addOnUser 用户附加
      * @return 结果
      */
-    @Override
     public int insertAddOnUser(AddOnUser addOnUser) {
         addOnUser.setCreateTime(DateUtils.getNowDate());
         return addOnUserMapper.insertAddOnUser(addOnUser);
@@ -62,7 +56,6 @@ public class AddOnUserServiceImpl implements IAddOnUserService {
      * @param addOnUser 用户附加
      * @return 结果
      */
-    @Override
     public int updateAddOnUser(AddOnUser addOnUser) {
         addOnUser.setUpdateTime(DateUtils.getNowDate());
         return addOnUserMapper.updateAddOnUser(addOnUser);
@@ -74,7 +67,6 @@ public class AddOnUserServiceImpl implements IAddOnUserService {
      * @param userIds 需要删除的用户附加主键
      * @return 结果
      */
-    @Override
     public int deleteAddOnUserByUserIds(Long[] userIds) {
         return addOnUserMapper.deleteAddOnUserByUserIds(userIds);
     }
@@ -85,7 +77,6 @@ public class AddOnUserServiceImpl implements IAddOnUserService {
      * @param userId 用户附加主键
      * @return 结果
      */
-    @Override
     public int deleteAddOnUserByUserId(Long userId) {
         return addOnUserMapper.deleteAddOnUserByUserId(userId);
     }

+ 66 - 26
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/FaultServiceImpl.java → ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/FaultService.java

@@ -3,9 +3,11 @@ package com.ruoyi.sim.service.impl;
 import java.util.*;
 import java.util.stream.Collectors;
 
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.sim.domain.TaskFault;
-import com.ruoyi.sim.domain.vo.FaultTree;
+import com.ruoyi.sim.domain.vo.FaultTreeVo;
+import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
@@ -13,16 +15,15 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.sim.mapper.FaultMapper;
 import com.ruoyi.sim.domain.Fault;
-import com.ruoyi.sim.service.IFaultService;
 
 /**
  * 故障Service业务层处理
  *
  * @author tom
- * @date 2024-12-13
+ * @date 2024-12-15
  */
 @Service
-public class FaultServiceImpl implements IFaultService {
+public class FaultService {
     @Autowired
     private FaultMapper faultMapper;
 
@@ -32,7 +33,6 @@ public class FaultServiceImpl implements IFaultService {
      * @param faultId 故障主键
      * @return 故障
      */
-    @Override
     public Fault selectFaultByFaultId(String faultId) {
         return faultMapper.selectFaultByFaultId(faultId);
     }
@@ -43,7 +43,6 @@ public class FaultServiceImpl implements IFaultService {
      * @param fault 故障
      * @return 故障
      */
-    @Override
     public List<Fault> selectFaultList(Fault fault) {
         return faultMapper.selectFaultList(fault);
     }
@@ -54,7 +53,6 @@ public class FaultServiceImpl implements IFaultService {
      * @param fault 故障
      * @return 结果
      */
-    @Override
     public int insertFault(Fault fault) {
         fault.setCreateTime(DateUtils.getNowDate());
         return faultMapper.insertFault(fault);
@@ -66,7 +64,6 @@ public class FaultServiceImpl implements IFaultService {
      * @param fault 故障
      * @return 结果
      */
-    @Override
     public int updateFault(Fault fault) {
         fault.setUpdateTime(DateUtils.getNowDate());
         return faultMapper.updateFault(fault);
@@ -78,7 +75,6 @@ public class FaultServiceImpl implements IFaultService {
      * @param faultIds 需要删除的故障主键
      * @return 结果
      */
-    @Override
     public int deleteFaultByFaultIds(String[] faultIds) {
         return faultMapper.deleteFaultByFaultIds(faultIds);
     }
@@ -89,43 +85,50 @@ public class FaultServiceImpl implements IFaultService {
      * @param faultId 故障主键
      * @return 结果
      */
-    @Override
     public int deleteFaultByFaultId(String faultId) {
         return faultMapper.deleteFaultByFaultId(faultId);
     }
 
     // -------------------------------- tom add  --------------------------------
 
-    private static final Logger log = LoggerFactory.getLogger(FaultServiceImpl.class);
+    private static final Logger log = LoggerFactory.getLogger(FaultService.class);
 
     /**
      * 查询故障列表tree
      *
-     * @param fault 故障
      * @return 故障
      */
-    @Override
-    public List<FaultTree> selectFaultListAllTree(Fault fault) {
-        //
+    public AjaxResult selectAllTreeViaSimType(String simType) {
+        // check
+        if (StringUtils.isEmpty(simType)) {
+            return AjaxResult.error("simType empty!");
+        }
+        if (!checkSimTypeOk(simType)) {
+            return AjaxResult.error("simType value error!");
+        }
+        // query obj.
+        Fault q = new Fault();
+        q.setSimType(simType);
         // fault.getParams().put(TableSupport.PAGE_NUM, 1);
         // fault.getParams().put(TableSupport.PAGE_SIZE, 100);
         //
-        List<Fault> list = faultMapper.selectFaultList(fault);
+        List<Fault> list = faultMapper.selectFaultList(q);
+        Collections.sort(list);
         log.info("AAAAAAAAAAAAAAAAAAAAAAAAAAAA000000000000");
         log.info(Objects.requireNonNull(list).toString());
-        log.info(Objects.requireNonNull(fault.getParams()).toString());
+        log.info(Objects.requireNonNull(q.getParams()).toString());
         log.info(Objects.requireNonNull(list.size()).toString());
 
-        List<FaultTree> tempListNode = new ArrayList<>();
+        List<FaultTreeVo> tempListNode = new ArrayList<>();
         for (Fault source : list) {
-            FaultTree target = new FaultTree();
+            FaultTreeVo target = new FaultTreeVo();
             BeanUtils.copyProperties(source, target);
             tempListNode.add(target);
         }
         log.info(Objects.requireNonNull(tempListNode).toString());
-        List<FaultTree> tree = toTree(tempListNode, ROOT_FAULT_ID);
+        List<FaultTreeVo> tree = toTree(tempListNode, Fault.ROOT_FAULT_ID);
         log.info(Objects.requireNonNull(tree).toString());
-        return tree;
+        return AjaxResult.success(tree);
     }
 
     public static final String SIM_TYPE_0001 = "0001";
@@ -142,12 +145,10 @@ public class FaultServiceImpl implements IFaultService {
      * @param simType
      * @return
      */
-    public boolean checkSimType(String simType) {
+    public boolean checkSimTypeOk(String simType) {
         return SIM_TYPE_SET.contains(simType);
     }
 
-    private static String ROOT_FAULT_ID = "000000000000";
-
 //    private static List<FaultNode> toTree2(List<FaultNode> list) {
 //        List<FaultNode> tree = new ArrayList<>();
 //        for (FaultNode fn1 : list) {
@@ -166,9 +167,9 @@ public class FaultServiceImpl implements IFaultService {
 //        return tree;
 //    }
 
-    private static List<FaultTree> toTree(List<FaultTree> list, String parentFaultId) {
+    public static List<FaultTreeVo> toTree(List<FaultTreeVo> list, String parentFaultId) {
         // todo:sort
-        List<FaultTree> tree = list
+        List<FaultTreeVo> tree = list
                 .stream()
                 .filter(
                         parent ->
@@ -183,4 +184,43 @@ public class FaultServiceImpl implements IFaultService {
                 .collect(Collectors.toList());
         return tree;
     }
+
+    public static List<FaultTreeVo> flatten(List<FaultTreeVo> list) {
+        return list
+                // todo:stream filter
+
+//                .stream()
+//                .filter(x -> {
+//                    return StringUtils.isEmpty(x.getParentFaultId());
+//                })
+//                .collect(Collectors.toList())
+                .stream()
+                .map(x -> {
+                    return flatten(x, list);
+                })
+                .flatMap(Collection::stream)
+                .distinct()
+                .collect(Collectors.toList());
+    }
+
+    public static List<FaultTreeVo> flatten(FaultTreeVo node, List<FaultTreeVo> list2222) {
+        List<FaultTreeVo> results = new ArrayList<>();
+        if (node != null) {
+            // get rid of children & parent references
+            FaultTreeVo target = new FaultTreeVo();
+            BeanUtils.copyProperties(node, target);
+            results.add(target);
+        }
+
+        List<FaultTreeVo> children = node.getChildren();
+        for (FaultTreeVo child : children) {
+            if (child.getChildren() != null) {
+                // Recursive call - Keep flattening until no more children
+                List<FaultTreeVo> flatten = flatten(child, list2222);
+                results.addAll(flatten);
+            }
+        }
+        // stop or exit condition
+        return results;
+    }
 }

+ 21 - 10
ruoyi-sim/src/main/java/com/ruoyi/sim/service/my/IotService.java → ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/IotService.java

@@ -1,15 +1,18 @@
-package com.ruoyi.sim.service.my;
+package com.ruoyi.sim.service.impl;
 
+import com.ruoyi.sim.config.SimConfig;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.InetAddress;
 import java.net.Socket;
 
-import static com.ruoyi.sim.service.my.IotService.Const.*;
+import static com.ruoyi.sim.service.impl.IotService.Const.*;
 
 /**
  * 硬件通信
@@ -55,7 +58,10 @@ public class IotService {
 
     private static final Logger logger = LoggerFactory.getLogger(IotService.class);
 
-    private Socket socket = null;
+    private Socket cachedSocket = null;
+
+    @Autowired
+    private SimConfig sc;
 
     /**
      * 检查所有模拟器状态
@@ -171,11 +177,11 @@ public class IotService {
         logger.info(sendMsg);
         String receiveMsg = null;
         try {
-            if (socket == null) {
-                socket = new Socket(IP, PORT);
+            if (cachedSocket == null) {
+                cachedSocket = new Socket(IP, PORT);
             }
-            InputStream is = socket.getInputStream();
-            OutputStream os = socket.getOutputStream();
+            InputStream is = cachedSocket.getInputStream();
+            OutputStream os = cachedSocket.getOutputStream();
             os.write(hexStrToByteArrs(sendMsg));
             byte[] buffer = new byte[1024];
             int length = is.read(buffer);
@@ -197,13 +203,13 @@ public class IotService {
      */
     public void close() {
         try {
-            if (socket != null) {
-                socket.close();
+            if (cachedSocket != null) {
+                cachedSocket.close();
             }
         } catch (IOException e) {
             throw new RuntimeException(e);
         } finally {
-            socket = null;
+            cachedSocket = null;
         }
     }
 
@@ -224,4 +230,9 @@ public class IotService {
         }
         return bytes;
     }
+
+    public boolean isReachable(String ipV4) throws IOException {
+        InetAddress ia = InetAddress.getByName(ipV4);
+        return ia.isReachable(sc.getGatewayReachableTimeout());
+    }
 }

+ 1 - 8
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/MajorServiceImpl.java → ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/MajorService.java

@@ -7,7 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.sim.mapper.MajorMapper;
 import com.ruoyi.sim.domain.Major;
-import com.ruoyi.sim.service.IMajorService;
 
 /**
  * 专业Service业务层处理
@@ -16,7 +15,7 @@ import com.ruoyi.sim.service.IMajorService;
  * @date 2024-12-11
  */
 @Service
-public class MajorServiceImpl implements IMajorService {
+public class MajorService {
     @Autowired
     private MajorMapper majorMapper;
 
@@ -26,7 +25,6 @@ public class MajorServiceImpl implements IMajorService {
      * @param majorId 专业主键
      * @return 专业
      */
-    @Override
     public Major selectMajorByMajorId(Long majorId) {
         return majorMapper.selectMajorByMajorId(majorId);
     }
@@ -37,7 +35,6 @@ public class MajorServiceImpl implements IMajorService {
      * @param major 专业
      * @return 专业
      */
-    @Override
     public List<Major> selectMajorList(Major major) {
         return majorMapper.selectMajorList(major);
     }
@@ -48,7 +45,6 @@ public class MajorServiceImpl implements IMajorService {
      * @param major 专业
      * @return 结果
      */
-    @Override
     public int insertMajor(Major major) {
         major.setCreateTime(DateUtils.getNowDate());
         return majorMapper.insertMajor(major);
@@ -60,7 +56,6 @@ public class MajorServiceImpl implements IMajorService {
      * @param major 专业
      * @return 结果
      */
-    @Override
     public int updateMajor(Major major) {
         major.setUpdateTime(DateUtils.getNowDate());
         return majorMapper.updateMajor(major);
@@ -72,7 +67,6 @@ public class MajorServiceImpl implements IMajorService {
      * @param majorIds 需要删除的专业主键
      * @return 结果
      */
-    @Override
     public int deleteMajorByMajorIds(Long[] majorIds) {
         return majorMapper.deleteMajorByMajorIds(majorIds);
     }
@@ -83,7 +77,6 @@ public class MajorServiceImpl implements IMajorService {
      * @param majorId 专业主键
      * @return 结果
      */
-    @Override
     public int deleteMajorByMajorId(Long majorId) {
         return majorMapper.deleteMajorByMajorId(majorId);
     }

+ 82 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCollectionDeptService.java

@@ -0,0 +1,82 @@
+package com.ruoyi.sim.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.sim.mapper.RealExamCollectionDeptMapper;
+import com.ruoyi.sim.domain.RealExamCollectionDept;
+
+/**
+ * 考试集合班级关联Service业务层处理
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+@Service
+public class RealExamCollectionDeptService {
+    @Autowired
+    private RealExamCollectionDeptMapper realExamCollectionDeptMapper;
+
+    /**
+     * 查询考试集合班级关联
+     *
+     * @param relId 考试集合班级关联主键
+     * @return 考试集合班级关联
+     */
+    public RealExamCollectionDept selectRealExamCollectionDeptByRelId(Long relId) {
+        return realExamCollectionDeptMapper.selectRealExamCollectionDeptByRelId(relId);
+    }
+
+    /**
+     * 查询考试集合班级关联列表
+     *
+     * @param realExamCollectionDept 考试集合班级关联
+     * @return 考试集合班级关联
+     */
+    public List<RealExamCollectionDept> selectRealExamCollectionDeptList(RealExamCollectionDept realExamCollectionDept) {
+        return realExamCollectionDeptMapper.selectRealExamCollectionDeptList(realExamCollectionDept);
+    }
+
+    /**
+     * 新增考试集合班级关联
+     *
+     * @param realExamCollectionDept 考试集合班级关联
+     * @return 结果
+     */
+    public int insertRealExamCollectionDept(RealExamCollectionDept realExamCollectionDept) {
+        return realExamCollectionDeptMapper.insertRealExamCollectionDept(realExamCollectionDept);
+    }
+
+    /**
+     * 修改考试集合班级关联
+     *
+     * @param realExamCollectionDept 考试集合班级关联
+     * @return 结果
+     */
+    public int updateRealExamCollectionDept(RealExamCollectionDept realExamCollectionDept) {
+        realExamCollectionDept.setUpdateTime(DateUtils.getNowDate());
+        return realExamCollectionDeptMapper.updateRealExamCollectionDept(realExamCollectionDept);
+    }
+
+    /**
+     * 批量删除考试集合班级关联
+     *
+     * @param relIds 需要删除的考试集合班级关联主键
+     * @return 结果
+     */
+    public int deleteRealExamCollectionDeptByRelIds(Long[] relIds) {
+        return realExamCollectionDeptMapper.deleteRealExamCollectionDeptByRelIds(relIds);
+    }
+
+    /**
+     * 删除考试集合班级关联信息
+     *
+     * @param relId 考试集合班级关联主键
+     * @return 结果
+     */
+    public int deleteRealExamCollectionDeptByRelId(Long relId) {
+        return realExamCollectionDeptMapper.deleteRealExamCollectionDeptByRelId(relId);
+    }
+}

+ 83 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCollectionService.java

@@ -0,0 +1,83 @@
+package com.ruoyi.sim.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.sim.mapper.RealExamCollectionMapper;
+import com.ruoyi.sim.domain.RealExamCollection;
+
+/**
+ * 考试集合Service业务层处理
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+@Service
+public class RealExamCollectionService {
+    @Autowired
+    private RealExamCollectionMapper realExamCollectionMapper;
+
+    /**
+     * 查询考试集合
+     *
+     * @param examCollectionId 考试集合主键
+     * @return 考试集合
+     */
+    public RealExamCollection selectRealExamCollectionByExamCollectionId(Long examCollectionId) {
+        return realExamCollectionMapper.selectRealExamCollectionByExamCollectionId(examCollectionId);
+    }
+
+    /**
+     * 查询考试集合列表
+     *
+     * @param realExamCollection 考试集合
+     * @return 考试集合
+     */
+    public List<RealExamCollection> selectRealExamCollectionList(RealExamCollection realExamCollection) {
+        return realExamCollectionMapper.selectRealExamCollectionList(realExamCollection);
+    }
+
+    /**
+     * 新增考试集合
+     *
+     * @param realExamCollection 考试集合
+     * @return 结果
+     */
+    public int insertRealExamCollection(RealExamCollection realExamCollection) {
+        realExamCollection.setCreateTime(DateUtils.getNowDate());
+        return realExamCollectionMapper.insertRealExamCollection(realExamCollection);
+    }
+
+    /**
+     * 修改考试集合
+     *
+     * @param realExamCollection 考试集合
+     * @return 结果
+     */
+    public int updateRealExamCollection(RealExamCollection realExamCollection) {
+        realExamCollection.setUpdateTime(DateUtils.getNowDate());
+        return realExamCollectionMapper.updateRealExamCollection(realExamCollection);
+    }
+
+    /**
+     * 批量删除考试集合
+     *
+     * @param examCollectionIds 需要删除的考试集合主键
+     * @return 结果
+     */
+    public int deleteRealExamCollectionByExamCollectionIds(Long[] examCollectionIds) {
+        return realExamCollectionMapper.deleteRealExamCollectionByExamCollectionIds(examCollectionIds);
+    }
+
+    /**
+     * 删除考试集合信息
+     *
+     * @param examCollectionId 考试集合主键
+     * @return 结果
+     */
+    public int deleteRealExamCollectionByExamCollectionId(Long examCollectionId) {
+        return realExamCollectionMapper.deleteRealExamCollectionByExamCollectionId(examCollectionId);
+    }
+}

+ 83 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamCompRequestService.java

@@ -0,0 +1,83 @@
+package com.ruoyi.sim.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.sim.mapper.RealExamCompRequestMapper;
+import com.ruoyi.sim.domain.RealExamCompRequest;
+
+/**
+ * 考试更换件关联Service业务层处理
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+@Service
+public class RealExamCompRequestService {
+    @Autowired
+    private RealExamCompRequestMapper realExamCompRequestMapper;
+
+    /**
+     * 查询考试更换件关联
+     *
+     * @param relId 考试更换件关联主键
+     * @return 考试更换件关联
+     */
+    public RealExamCompRequest selectRealExamCompRequestByRelId(Long relId) {
+        return realExamCompRequestMapper.selectRealExamCompRequestByRelId(relId);
+    }
+
+    /**
+     * 查询考试更换件关联列表
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 考试更换件关联
+     */
+    public List<RealExamCompRequest> selectRealExamCompRequestList(RealExamCompRequest realExamCompRequest) {
+        return realExamCompRequestMapper.selectRealExamCompRequestList(realExamCompRequest);
+    }
+
+    /**
+     * 新增考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    public int insertRealExamCompRequest(RealExamCompRequest realExamCompRequest) {
+        realExamCompRequest.setCreateTime(DateUtils.getNowDate());
+        return realExamCompRequestMapper.insertRealExamCompRequest(realExamCompRequest);
+    }
+
+    /**
+     * 修改考试更换件关联
+     *
+     * @param realExamCompRequest 考试更换件关联
+     * @return 结果
+     */
+    public int updateRealExamCompRequest(RealExamCompRequest realExamCompRequest) {
+        realExamCompRequest.setUpdateTime(DateUtils.getNowDate());
+        return realExamCompRequestMapper.updateRealExamCompRequest(realExamCompRequest);
+    }
+
+    /**
+     * 批量删除考试更换件关联
+     *
+     * @param relIds 需要删除的考试更换件关联主键
+     * @return 结果
+     */
+    public int deleteRealExamCompRequestByRelIds(Long[] relIds) {
+        return realExamCompRequestMapper.deleteRealExamCompRequestByRelIds(relIds);
+    }
+
+    /**
+     * 删除考试更换件关联信息
+     *
+     * @param relId 考试更换件关联主键
+     * @return 结果
+     */
+    public int deleteRealExamCompRequestByRelId(Long relId) {
+        return realExamCompRequestMapper.deleteRealExamCompRequestByRelId(relId);
+    }
+}

+ 83 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamFaultService.java

@@ -0,0 +1,83 @@
+package com.ruoyi.sim.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.sim.mapper.RealExamFaultMapper;
+import com.ruoyi.sim.domain.RealExamFault;
+
+/**
+ * 考试故障关联Service业务层处理
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+@Service
+public class RealExamFaultService {
+    @Autowired
+    private RealExamFaultMapper realExamFaultMapper;
+
+    /**
+     * 查询考试故障关联
+     *
+     * @param refId 考试故障关联主键
+     * @return 考试故障关联
+     */
+    public RealExamFault selectRealExamFaultByRefId(Long refId) {
+        return realExamFaultMapper.selectRealExamFaultByRefId(refId);
+    }
+
+    /**
+     * 查询考试故障关联列表
+     *
+     * @param realExamFault 考试故障关联
+     * @return 考试故障关联
+     */
+    public List<RealExamFault> selectRealExamFaultList(RealExamFault realExamFault) {
+        return realExamFaultMapper.selectRealExamFaultList(realExamFault);
+    }
+
+    /**
+     * 新增考试故障关联
+     *
+     * @param realExamFault 考试故障关联
+     * @return 结果
+     */
+    public int insertRealExamFault(RealExamFault realExamFault) {
+        realExamFault.setCreateTime(DateUtils.getNowDate());
+        return realExamFaultMapper.insertRealExamFault(realExamFault);
+    }
+
+    /**
+     * 修改考试故障关联
+     *
+     * @param realExamFault 考试故障关联
+     * @return 结果
+     */
+    public int updateRealExamFault(RealExamFault realExamFault) {
+        realExamFault.setUpdateTime(DateUtils.getNowDate());
+        return realExamFaultMapper.updateRealExamFault(realExamFault);
+    }
+
+    /**
+     * 批量删除考试故障关联
+     *
+     * @param refIds 需要删除的考试故障关联主键
+     * @return 结果
+     */
+    public int deleteRealExamFaultByRefIds(Long[] refIds) {
+        return realExamFaultMapper.deleteRealExamFaultByRefIds(refIds);
+    }
+
+    /**
+     * 删除考试故障关联信息
+     *
+     * @param refId 考试故障关联主键
+     * @return 结果
+     */
+    public int deleteRealExamFaultByRefId(Long refId) {
+        return realExamFaultMapper.deleteRealExamFaultByRefId(refId);
+    }
+}

+ 83 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/RealExamService.java

@@ -0,0 +1,83 @@
+package com.ruoyi.sim.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.sim.mapper.RealExamMapper;
+import com.ruoyi.sim.domain.RealExam;
+
+/**
+ * 考试Service业务层处理
+ *
+ * @author tom
+ * @date 2024-12-15
+ */
+@Service
+public class RealExamService {
+    @Autowired
+    private RealExamMapper realExamMapper;
+
+    /**
+     * 查询考试
+     *
+     * @param examId 考试主键
+     * @return 考试
+     */
+    public RealExam selectRealExamByExamId(Long examId) {
+        return realExamMapper.selectRealExamByExamId(examId);
+    }
+
+    /**
+     * 查询考试列表
+     *
+     * @param realExam 考试
+     * @return 考试
+     */
+    public List<RealExam> selectRealExamList(RealExam realExam) {
+        return realExamMapper.selectRealExamList(realExam);
+    }
+
+    /**
+     * 新增考试
+     *
+     * @param realExam 考试
+     * @return 结果
+     */
+    public int insertRealExam(RealExam realExam) {
+        realExam.setCreateTime(DateUtils.getNowDate());
+        return realExamMapper.insertRealExam(realExam);
+    }
+
+    /**
+     * 修改考试
+     *
+     * @param realExam 考试
+     * @return 结果
+     */
+    public int updateRealExam(RealExam realExam) {
+        realExam.setUpdateTime(DateUtils.getNowDate());
+        return realExamMapper.updateRealExam(realExam);
+    }
+
+    /**
+     * 批量删除考试
+     *
+     * @param examIds 需要删除的考试主键
+     * @return 结果
+     */
+    public int deleteRealExamByExamIds(Long[] examIds) {
+        return realExamMapper.deleteRealExamByExamIds(examIds);
+    }
+
+    /**
+     * 删除考试信息
+     *
+     * @param examId 考试主键
+     * @return 结果
+     */
+    public int deleteRealExamByExamId(Long examId) {
+        return realExamMapper.deleteRealExamByExamId(examId);
+    }
+}

+ 83 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SeatService.java

@@ -0,0 +1,83 @@
+package com.ruoyi.sim.service.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.sim.mapper.SeatMapper;
+import com.ruoyi.sim.domain.Seat;
+
+/**
+ * 座Service业务层处理
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+@Service
+public class SeatService {
+    @Autowired
+    private SeatMapper seatMapper;
+
+    /**
+     * 查询座
+     *
+     * @param seatId 座主键
+     * @return 座
+     */
+    public Seat selectSeatBySeatId(Long seatId) {
+        return seatMapper.selectSeatBySeatId(seatId);
+    }
+
+    /**
+     * 查询座列表
+     *
+     * @param seat 座
+     * @return 座
+     */
+    public List<Seat> selectSeatList(Seat seat) {
+        return seatMapper.selectSeatList(seat);
+    }
+
+    /**
+     * 新增座
+     *
+     * @param seat 座
+     * @return 结果
+     */
+    public int insertSeat(Seat seat) {
+        seat.setCreateTime(DateUtils.getNowDate());
+        return seatMapper.insertSeat(seat);
+    }
+
+    /**
+     * 修改座
+     *
+     * @param seat 座
+     * @return 结果
+     */
+    public int updateSeat(Seat seat) {
+        seat.setUpdateTime(DateUtils.getNowDate());
+        return seatMapper.updateSeat(seat);
+    }
+
+    /**
+     * 批量删除座
+     *
+     * @param seatIds 需要删除的座主键
+     * @return 结果
+     */
+    public int deleteSeatBySeatIds(Long[] seatIds) {
+        return seatMapper.deleteSeatBySeatIds(seatIds);
+    }
+
+    /**
+     * 删除座信息
+     *
+     * @param seatId 座主键
+     * @return 结果
+     */
+    public int deleteSeatBySeatId(Long seatId) {
+        return seatMapper.deleteSeatBySeatId(seatId);
+    }
+}

+ 1 - 8
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SimMsgServiceImpl.java → ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SimMsgService.java

@@ -7,7 +7,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.sim.mapper.SimMsgMapper;
 import com.ruoyi.sim.domain.SimMsg;
-import com.ruoyi.sim.service.ISimMsgService;
 
 /**
  * 模拟器报文Service业务层处理
@@ -16,7 +15,7 @@ import com.ruoyi.sim.service.ISimMsgService;
  * @date 2024-12-11
  */
 @Service
-public class SimMsgServiceImpl implements ISimMsgService {
+public class SimMsgService {
     @Autowired
     private SimMsgMapper simMsgMapper;
 
@@ -26,7 +25,6 @@ public class SimMsgServiceImpl implements ISimMsgService {
      * @param simMsgId 模拟器报文主键
      * @return 模拟器报文
      */
-    @Override
     public SimMsg selectSimMsgBySimMsgId(Long simMsgId) {
         return simMsgMapper.selectSimMsgBySimMsgId(simMsgId);
     }
@@ -37,7 +35,6 @@ public class SimMsgServiceImpl implements ISimMsgService {
      * @param simMsg 模拟器报文
      * @return 模拟器报文
      */
-    @Override
     public List<SimMsg> selectSimMsgList(SimMsg simMsg) {
         return simMsgMapper.selectSimMsgList(simMsg);
     }
@@ -48,7 +45,6 @@ public class SimMsgServiceImpl implements ISimMsgService {
      * @param simMsg 模拟器报文
      * @return 结果
      */
-    @Override
     public int insertSimMsg(SimMsg simMsg) {
         simMsg.setCreateTime(DateUtils.getNowDate());
         return simMsgMapper.insertSimMsg(simMsg);
@@ -60,7 +56,6 @@ public class SimMsgServiceImpl implements ISimMsgService {
      * @param simMsg 模拟器报文
      * @return 结果
      */
-    @Override
     public int updateSimMsg(SimMsg simMsg) {
         simMsg.setUpdateTime(DateUtils.getNowDate());
         return simMsgMapper.updateSimMsg(simMsg);
@@ -72,7 +67,6 @@ public class SimMsgServiceImpl implements ISimMsgService {
      * @param simMsgIds 需要删除的模拟器报文主键
      * @return 结果
      */
-    @Override
     public int deleteSimMsgBySimMsgIds(Long[] simMsgIds) {
         return simMsgMapper.deleteSimMsgBySimMsgIds(simMsgIds);
     }
@@ -83,7 +77,6 @@ public class SimMsgServiceImpl implements ISimMsgService {
      * @param simMsgId 模拟器报文主键
      * @return 结果
      */
-    @Override
     public int deleteSimMsgBySimMsgId(Long simMsgId) {
         return simMsgMapper.deleteSimMsgBySimMsgId(simMsgId);
     }

+ 2 - 9
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SimServiceImpl.java → ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/SimService.java

@@ -7,16 +7,15 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.sim.mapper.SimMapper;
 import com.ruoyi.sim.domain.Sim;
-import com.ruoyi.sim.service.ISimService;
 
 /**
  * 模拟器Service业务层处理
  *
  * @author tom
- * @date 2024-12-11
+ * @date 2024-12-13
  */
 @Service
-public class SimServiceImpl implements ISimService {
+public class SimService {
     @Autowired
     private SimMapper simMapper;
 
@@ -26,7 +25,6 @@ public class SimServiceImpl implements ISimService {
      * @param simId 模拟器主键
      * @return 模拟器
      */
-    @Override
     public Sim selectSimBySimId(Long simId) {
         return simMapper.selectSimBySimId(simId);
     }
@@ -37,7 +35,6 @@ public class SimServiceImpl implements ISimService {
      * @param sim 模拟器
      * @return 模拟器
      */
-    @Override
     public List<Sim> selectSimList(Sim sim) {
         return simMapper.selectSimList(sim);
     }
@@ -48,7 +45,6 @@ public class SimServiceImpl implements ISimService {
      * @param sim 模拟器
      * @return 结果
      */
-    @Override
     public int insertSim(Sim sim) {
         sim.setCreateTime(DateUtils.getNowDate());
         return simMapper.insertSim(sim);
@@ -60,7 +56,6 @@ public class SimServiceImpl implements ISimService {
      * @param sim 模拟器
      * @return 结果
      */
-    @Override
     public int updateSim(Sim sim) {
         sim.setUpdateTime(DateUtils.getNowDate());
         return simMapper.updateSim(sim);
@@ -72,7 +67,6 @@ public class SimServiceImpl implements ISimService {
      * @param simIds 需要删除的模拟器主键
      * @return 结果
      */
-    @Override
     public int deleteSimBySimIds(Long[] simIds) {
         return simMapper.deleteSimBySimIds(simIds);
     }
@@ -83,7 +77,6 @@ public class SimServiceImpl implements ISimService {
      * @param simId 模拟器主键
      * @return 结果
      */
-    @Override
     public int deleteSimBySimId(Long simId) {
         return simMapper.deleteSimBySimId(simId);
     }

+ 2 - 4
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/StudentService.java

@@ -5,8 +5,6 @@ import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.sim.domain.AddOnDept;
 import com.ruoyi.sim.domain.Major;
 import com.ruoyi.sim.domain.Student;
-import com.ruoyi.sim.service.IAddOnDeptService;
-import com.ruoyi.sim.service.IMajorService;
 import com.ruoyi.system.mapper.*;
 import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysDeptService;
@@ -48,10 +46,10 @@ public class StudentService {
     private ISysDeptService deptService;
 
     @Autowired
-    private IAddOnDeptService addOnDeptService;
+    private AddOnDeptService addOnDeptService;
 
     @Autowired
-    private IMajorService majorService;
+    private MajorService majorService;
 
     @Autowired
     protected Validator validator;

+ 53 - 8
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskFaultServiceImpl.java → ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskFaultService.java

@@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.sim.mapper.TaskFaultMapper;
 import com.ruoyi.sim.domain.TaskFault;
-import com.ruoyi.sim.service.ITaskFaultService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 任务故障关联Service业务层处理
@@ -16,7 +16,7 @@ import com.ruoyi.sim.service.ITaskFaultService;
  * @date 2024-12-13
  */
 @Service
-public class TaskFaultServiceImpl implements ITaskFaultService {
+public class TaskFaultService {
     @Autowired
     private TaskFaultMapper taskFaultMapper;
 
@@ -26,7 +26,6 @@ public class TaskFaultServiceImpl implements ITaskFaultService {
      * @param relId 任务故障关联主键
      * @return 任务故障关联
      */
-    @Override
     public TaskFault selectTaskFaultByRelId(Long relId) {
         return taskFaultMapper.selectTaskFaultByRelId(relId);
     }
@@ -37,7 +36,6 @@ public class TaskFaultServiceImpl implements ITaskFaultService {
      * @param taskFault 任务故障关联
      * @return 任务故障关联
      */
-    @Override
     public List<TaskFault> selectTaskFaultList(TaskFault taskFault) {
         return taskFaultMapper.selectTaskFaultList(taskFault);
     }
@@ -48,7 +46,6 @@ public class TaskFaultServiceImpl implements ITaskFaultService {
      * @param taskFault 任务故障关联
      * @return 结果
      */
-    @Override
     public int insertTaskFault(TaskFault taskFault) {
         return taskFaultMapper.insertTaskFault(taskFault);
     }
@@ -59,7 +56,6 @@ public class TaskFaultServiceImpl implements ITaskFaultService {
      * @param taskFault 任务故障关联
      * @return 结果
      */
-    @Override
     public int updateTaskFault(TaskFault taskFault) {
         taskFault.setUpdateTime(DateUtils.getNowDate());
         return taskFaultMapper.updateTaskFault(taskFault);
@@ -71,7 +67,6 @@ public class TaskFaultServiceImpl implements ITaskFaultService {
      * @param relIds 需要删除的任务故障关联主键
      * @return 结果
      */
-    @Override
     public int deleteTaskFaultByRelIds(Long[] relIds) {
         return taskFaultMapper.deleteTaskFaultByRelIds(relIds);
     }
@@ -82,8 +77,58 @@ public class TaskFaultServiceImpl implements ITaskFaultService {
      * @param relId 任务故障关联主键
      * @return 结果
      */
-    @Override
     public int deleteTaskFaultByRelId(Long relId) {
         return taskFaultMapper.deleteTaskFaultByRelId(relId);
     }
+
+    // -------------------------------- tom add  --------------------------------
+    public TaskFault selectUniqueTaskFault(Long taskId, String faultId) {
+        TaskFault q = new TaskFault();
+        q.setTaskId(taskId);
+        q.setFaultId(faultId);
+        List<TaskFault> list = selectTaskFaultList(q);
+        if (list != null && !list.isEmpty()) {
+            return list.get(0);
+        } else {
+            return null;
+        }
+    }
+
+
+    public int insertTaskFault(Long taskId, String faultId, String flag) {
+        TaskFault n = new TaskFault(0L, taskId, faultId, flag);
+        return insertTaskFault(n);
+    }
+
+
+    public int updateTaskFault(Long relId, Long taskId, String faultId, String flag) {
+        TaskFault f = selectTaskFaultByRelId(relId);
+        f.setTaskId(taskId);
+        f.setFaultId(faultId);
+        f.setFlag(flag);
+        return updateTaskFault(f);
+    }
+
+
+    public int insertOrUpdateTaskFault(TaskFault tf) {
+        TaskFault f = selectUniqueTaskFault(tf.getTaskId(), tf.getFaultId());
+        if (f == null) {
+            return insertTaskFault(tf);
+        } else {
+            return updateTaskFault(tf);
+        }
+    }
+
+    public int deleteTaskFaultByTaskId(Long taskId) {
+        TaskFault q = new TaskFault();
+        q.setTaskId(taskId);
+        List<TaskFault> list = selectTaskFaultList(q);
+        if (list == null || list.isEmpty()) {
+            return 0;
+        }
+        for (TaskFault o : list) {
+            deleteTaskFaultByRelId(o.getRelId());
+        }
+        return list.size();
+    }
 }

+ 196 - 0
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskService.java

@@ -0,0 +1,196 @@
+package com.ruoyi.sim.service.impl;
+
+import java.util.List;
+
+import cn.hutool.http.useragent.UserAgentUtil;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.sim.domain.Fault;
+import com.ruoyi.sim.domain.TaskFault;
+import com.ruoyi.sim.domain.vo.FaultTreeVo;
+import com.ruoyi.sim.domain.vo.TaskVo;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.sim.mapper.TaskMapper;
+import com.ruoyi.sim.domain.Task;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 任务Service业务层处理
+ *
+ * @author tom
+ * @date 2024-12-13
+ */
+@Service
+public class TaskService {
+    @Autowired
+    private TaskMapper taskMapper;
+
+    /**
+     * 查询任务
+     *
+     * @param taskId 任务主键
+     * @return 任务
+     */
+    public Task selectTaskByTaskId(Long taskId) {
+        return taskMapper.selectTaskByTaskId(taskId);
+    }
+
+    /**
+     * 查询任务列表
+     *
+     * @param task 任务
+     * @return 任务
+     */
+    public List<Task> selectTaskList(Task task) {
+        return taskMapper.selectTaskList(task);
+    }
+
+    /**
+     * 修改任务
+     *
+     * @param task 任务
+     * @return 结果
+     */
+    public int updateTask(Task task) {
+        task.setUpdateTime(DateUtils.getNowDate());
+        return taskMapper.updateTask(task);
+    }
+
+    /**
+     * 批量删除任务
+     *
+     * @param taskIds 需要删除的任务主键
+     * @return 结果
+     */
+    public int deleteTaskByTaskIds(Long[] taskIds) {
+        return taskMapper.deleteTaskByTaskIds(taskIds);
+    }
+
+    /**
+     * 删除任务信息
+     *
+     * @param taskId 任务主键
+     * @return 结果
+     */
+    public int deleteTaskByTaskId(Long taskId) {
+        return taskMapper.deleteTaskByTaskId(taskId);
+    }
+
+    // -------------------------------- tom add  --------------------------------
+    private static final Logger l = LoggerFactory.getLogger(TaskService.class);
+    @Autowired
+    private FaultService faultService;
+    @Autowired
+    private TaskFaultService taskFaultService;
+
+    /**
+     * 新增任务
+     *
+     * @param tv 任务
+     * @return 结果
+     * todo:事务有问题。
+     */
+    @Transactional
+    public AjaxResult insertTaskByTeacher(TaskVo tv) {
+        l.info("task new task " + tv);
+        // check
+        if (tv == null) {
+            return AjaxResult.error("TaskVo empty!");
+        }
+        if (!faultService.checkSimTypeOk(tv.getSimType())) {
+            return AjaxResult.error("simType error!");
+        }
+        if (!Task.TASK_TYPE_TEACHER_ADD.equals(tv.getTaskType())) {
+            return AjaxResult.error("taskType value error!");
+        }
+        if (StringUtils.isEmpty(tv.getName())) {
+            return AjaxResult.error("name isEmpty!");
+        }
+        //
+        tv.setCreateByUserId(SecurityUtils.getUserId());
+        tv.setCreateBy(SecurityUtils.getUsername());
+        tv.setCreateTime(DateUtils.getNowDate());
+        tv.setUpdateBy(SecurityUtils.getUsername());
+        tv.setUpdateTime(DateUtils.getNowDate());
+        tv.setRemark("");
+        List<FaultTreeVo> selectedData = tv.getSelectedData();
+        taskMapper.insertTask(tv);
+        if (selectedData != null) {
+            List<FaultTreeVo> list = FaultService.flatten(selectedData);
+            for (FaultTreeVo ftv : list) {
+                if (ftv == null) {
+                    continue;
+                }
+                if (!Fault.FAULT_TYPE_3.equals(ftv.getFaultType())) {
+                    continue;
+                }
+                TaskFault tf = ftv.getTaskFault();
+                // check
+                if (tf == null) {
+                    return AjaxResult.error("TaskFault empty!");
+                }
+                String flag = tf.getFlag();
+                if (StringUtils.isEmpty(flag)) {
+                    return AjaxResult.error("flag empty!");
+                }
+                if (TaskFault.UNKNOWN.equals(flag)) {
+                    return AjaxResult.error("flag UNKNOWN!");
+                }
+                if (!TaskFault.YES.equals(flag) && !TaskFault.NO.equals(flag)) {
+                    return AjaxResult.error("flag must YES or NO!");
+                }
+                // todo:选中数量限制
+
+                // todo:故障部位冲突
+                tf.setTaskId(tv.getTaskId());
+                taskFaultService.insertOrUpdateTaskFault(tf);
+            }
+        }
+        return AjaxResult.success();
+    }
+
+    /**
+     * 为了新建,返回一个带tree结构的数据对象。
+     *
+     * @return 任务
+     */
+    public AjaxResult getInfoForAdd(String simType) {
+        // check
+        if (StringUtils.isEmpty(simType)) {
+            return AjaxResult.error("simType empty!");
+        }
+        if (!faultService.checkSimTypeOk(simType)) {
+            return AjaxResult.error("simType value error!");
+        }
+        // query obj.
+        Fault q = new Fault();
+        q.setSimType(simType);
+        List<FaultTreeVo> ftList = (List<FaultTreeVo>) faultService.selectAllTreeViaSimType(simType).get(AjaxResult.DATA_TAG);
+        TaskVo t = new TaskVo();
+        t.setTaskId(Task.EMPTY_TASK_ID);
+        t.setSelectedData(ftList);
+        return AjaxResult.success(t);
+    }
+
+    /**
+     * 新增任务附带选择故障
+     *
+     * @param task 任务
+     * @return 结果
+     */
+    @Transactional
+    public int insertTaskWithFault(Task task) {
+        Long taskId = task.getTaskId();
+        if (selectTaskByTaskId(taskId) != null) {
+            // 已经存在
+        }
+        task.setCreateTime(DateUtils.getNowDate());
+        task.setUpdateTime(DateUtils.getNowDate());
+        return taskMapper.insertTask(task);
+    }
+}

+ 0 - 136
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/TaskServiceImpl.java

@@ -1,136 +0,0 @@
-package com.ruoyi.sim.service.impl;
-
-import java.util.List;
-
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.sim.domain.Fault;
-import com.ruoyi.sim.domain.vo.FaultTree;
-import com.ruoyi.sim.service.IFaultService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.ruoyi.sim.mapper.TaskMapper;
-import com.ruoyi.sim.domain.Task;
-import com.ruoyi.sim.service.ITaskService;
-import org.springframework.transaction.annotation.Transactional;
-
-/**
- * 任务Service业务层处理
- *
- * @author tom
- * @date 2024-12-13
- */
-@Service
-public class TaskServiceImpl implements ITaskService {
-    @Autowired
-    private TaskMapper taskMapper;
-
-    /**
-     * 查询任务
-     *
-     * @param taskId 任务主键
-     * @return 任务
-     */
-    @Override
-    public Task selectTaskByTaskId(Long taskId) {
-        return taskMapper.selectTaskByTaskId(taskId);
-    }
-
-    /**
-     * 查询任务列表
-     *
-     * @param task 任务
-     * @return 任务
-     */
-    @Override
-    public List<Task> selectTaskList(Task task) {
-        return taskMapper.selectTaskList(task);
-    }
-
-    /**
-     * 新增任务
-     *
-     * @param task 任务
-     * @return 结果
-     */
-    @Override
-    public int insertTask(Task task) {
-        task.setCreateTime(DateUtils.getNowDate());
-        return taskMapper.insertTask(task);
-    }
-
-    /**
-     * 修改任务
-     *
-     * @param task 任务
-     * @return 结果
-     */
-    @Override
-    public int updateTask(Task task) {
-        task.setUpdateTime(DateUtils.getNowDate());
-        return taskMapper.updateTask(task);
-    }
-
-    /**
-     * 批量删除任务
-     *
-     * @param taskIds 需要删除的任务主键
-     * @return 结果
-     */
-    @Override
-    public int deleteTaskByTaskIds(Long[] taskIds) {
-        return taskMapper.deleteTaskByTaskIds(taskIds);
-    }
-
-    /**
-     * 删除任务信息
-     *
-     * @param taskId 任务主键
-     * @return 结果
-     */
-    @Override
-    public int deleteTaskByTaskId(Long taskId) {
-        return taskMapper.deleteTaskByTaskId(taskId);
-    }
-
-    // -------------------------------- tom add  --------------------------------
-    @Autowired
-    private IFaultService faultService;
-
-    /**
-     * 为了新建,返回一个带tree结构的数据对象。
-     *
-     * @return 任务
-     */
-    public Task selectNewTaskViaSimType(String simType) {
-        // check
-
-        //
-        Task t = new Task();
-        // fa 构建用于查询的对象。
-        Fault fa = new Fault();
-        fa.setSimType(simType);
-        //
-        List<FaultTree> ftList = faultService.selectFaultListAllTree(fa);
-        t.setTaskId(Task.EMPTY_TASK_ID);
-        t.setFaultTreeList(ftList);
-        return t;
-    }
-
-    /**
-     * 新增任务附带选择故障
-     *
-     * @param task 任务
-     * @return 结果
-     */
-    @Override
-    @Transactional
-    public int insertTaskWithFault(Task task) {
-        Long taskId = task.getTaskId();
-        if (selectTaskByTaskId(taskId) != null) {
-            // 已经存在
-        }
-        task.setCreateTime(DateUtils.getNowDate());
-        task.setUpdateTime(DateUtils.getNowDate());
-        return taskMapper.insertTask(task);
-    }
-}

+ 0 - 5
ruoyi-sim/src/main/java/com/ruoyi/sim/service/my/MajorMyService.java

@@ -1,13 +1,8 @@
 package com.ruoyi.sim.service.my;
 
-import com.ruoyi.sim.service.IMajorService;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service
 public class MajorMyService {
 
-    @Autowired
-    private IMajorService majorService;
-
 }

+ 4 - 10
ruoyi-sim/src/main/resources/mapper/sim/AddOnUserMapper.xml

@@ -6,8 +6,7 @@
 
     <resultMap type="AddOnUser" id="AddOnUserResult">
         <result property="userId" column="user_id"/>
-        <result property="majorId" column="major_id"/>
-        <result property="createBy" column="createBy"/>
+        <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
         <result property="updateBy" column="update_by"/>
         <result property="updateTime" column="update_time"/>
@@ -15,15 +14,13 @@
     </resultMap>
 
     <sql id="selectAddOnUserVo">
-        select user_id, major_id, createBy, create_time, update_by, update_time, remark
+        select user_id, create_by, create_time, update_by, update_time, remark
         from sim_add_on_user
     </sql>
 
     <select id="selectAddOnUserList" parameterType="AddOnUser" resultMap="AddOnUserResult">
         <include refid="selectAddOnUserVo"/>
         <where>
-            <if test="majorId != null ">and major_id = #{majorId}</if>
-            <if test="createBy != null  and createBy != ''">and createBy = #{createBy}</if>
         </where>
     </select>
 
@@ -35,15 +32,13 @@
     <insert id="insertAddOnUser" parameterType="AddOnUser" useGeneratedKeys="true" keyProperty="userId">
         insert into sim_add_on_user
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="majorId != null">major_id,</if>
-            <if test="createBy != null">createBy,</if>
+            <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="majorId != null">#{majorId},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -55,8 +50,7 @@
     <update id="updateAddOnUser" parameterType="AddOnUser">
         update sim_add_on_user
         <trim prefix="SET" suffixOverrides=",">
-            <if test="majorId != null">major_id = #{majorId},</if>
-            <if test="createBy != null">createBy = #{createBy},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>

+ 14 - 0
ruoyi-sim/src/main/resources/mapper/sim/FaultMapper.xml

@@ -10,6 +10,8 @@
         <result property="simType" column="sim_type"/>
         <result property="faultType" column="fault_type"/>
         <result property="conflictFaultId" column="conflict_fault_id"/>
+        <result property="replacePart" column="replace_part"/>
+        <result property="replaceName" column="replace_name"/>
         <result property="name" column="name"/>
         <result property="simMsg" column="sim_msg"/>
         <result property="orderNum" column="order_num"/>
@@ -26,6 +28,8 @@
                sim_type,
                fault_type,
                conflict_fault_id,
+               replace_part,
+               replace_name,
                name,
                sim_msg,
                order_num,
@@ -45,6 +49,10 @@
             <if test="faultType != null  and faultType != ''">and fault_type = #{faultType}</if>
             <if test="conflictFaultId != null  and conflictFaultId != ''">and conflict_fault_id = #{conflictFaultId}
             </if>
+            <if test="replacePart != null  and replacePart != ''">and replace_part = #{replacePart}</if>
+            <if test="replaceName != null  and replaceName != ''">and replace_name like concat('%', #{replaceName},
+                '%')
+            </if>
             <if test="name != null  and name != ''">and name like concat('%', #{name}, '%')</if>
             <if test="simMsg != null  and simMsg != ''">and sim_msg = #{simMsg}</if>
             <if test="orderNum != null ">and order_num = #{orderNum}</if>
@@ -64,6 +72,8 @@
             <if test="simType != null and simType != ''">sim_type,</if>
             <if test="faultType != null">fault_type,</if>
             <if test="conflictFaultId != null">conflict_fault_id,</if>
+            <if test="replacePart != null">replace_part,</if>
+            <if test="replaceName != null">replace_name,</if>
             <if test="name != null">name,</if>
             <if test="simMsg != null">sim_msg,</if>
             <if test="orderNum != null">order_num,</if>
@@ -79,6 +89,8 @@
             <if test="simType != null and simType != ''">#{simType},</if>
             <if test="faultType != null">#{faultType},</if>
             <if test="conflictFaultId != null">#{conflictFaultId},</if>
+            <if test="replacePart != null">#{replacePart},</if>
+            <if test="replaceName != null">#{replaceName},</if>
             <if test="name != null">#{name},</if>
             <if test="simMsg != null">#{simMsg},</if>
             <if test="orderNum != null">#{orderNum},</if>
@@ -97,6 +109,8 @@
             <if test="simType != null and simType != ''">sim_type = #{simType},</if>
             <if test="faultType != null">fault_type = #{faultType},</if>
             <if test="conflictFaultId != null">conflict_fault_id = #{conflictFaultId},</if>
+            <if test="replacePart != null">replace_part = #{replacePart},</if>
+            <if test="replaceName != null">replace_name = #{replaceName},</if>
             <if test="name != null">name = #{name},</if>
             <if test="simMsg != null">sim_msg = #{simMsg},</if>
             <if test="orderNum != null">order_num = #{orderNum},</if>

+ 146 - 0
ruoyi-sim/src/main/resources/mapper/sim/RealExamCollection.xml

@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.sim.mapper.RealExamCollectionMapper">
+
+    <resultMap type="RealExamCollection" id="RealExamCollectionResult">
+        <result property="examCollectionId" column="exam_collection_id"/>
+        <result property="simType" column="sim_type"/>
+        <result property="questionSettingMethod" column="question_setting_method"/>
+        <result property="examCollectionType" column="exam_collection_type"/>
+        <result property="examCollectionName" column="exam_collection_name"/>
+        <result property="taskId" column="task_id"/>
+        <result property="limitDuration" column="limit_duration"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="createUserId" column="create_user_id"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectRealExamCollectionVo">
+        select exam_collection_id,
+               sim_type,
+               question_setting_method,
+               exam_collection_type,
+               exam_collection_name,
+               task_id,
+               limit_duration,
+               start_time,
+               end_time,
+               create_user_id,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sim_real_exam_collection
+    </sql>
+
+    <select id="selectRealExamCollectionList" parameterType="RealExamCollection" resultMap="RealExamCollectionResult">
+        <include refid="selectRealExamCollectionVo"/>
+        <where>
+            <if test="simType != null  and simType != ''">and sim_type = #{simType}</if>
+            <if test="questionSettingMethod != null  and questionSettingMethod != ''">and question_setting_method =
+                #{questionSettingMethod}
+            </if>
+            <if test="examCollectionType != null  and examCollectionType != ''">and exam_collection_type =
+                #{examCollectionType}
+            </if>
+            <if test="examCollectionName != null  and examCollectionName != ''">and exam_collection_name like
+                concat('%', #{examCollectionName}, '%')
+            </if>
+            <if test="taskId != null ">and task_id = #{taskId}</if>
+            <if test="limitDuration != null ">and limit_duration = #{limitDuration}</if>
+            <if test="startTime != null ">and start_time = #{startTime}</if>
+            <if test="endTime != null ">and end_time = #{endTime}</if>
+            <if test="createUserId != null ">and create_user_id = #{createUserId}</if>
+        </where>
+    </select>
+
+    <select id="selectRealExamCollectionByExamCollectionId" parameterType="Long" resultMap="RealExamCollectionResult">
+        <include refid="selectRealExamCollectionVo"/>
+        where exam_collection_id = #{examCollectionId}
+    </select>
+
+    <insert id="insertRealExamCollection" parameterType="RealExamCollection" useGeneratedKeys="true"
+            keyProperty="examCollectionId">
+        insert into sim_real_exam_collection
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="simType != null and simType != ''">sim_type,</if>
+            <if test="questionSettingMethod != null and questionSettingMethod != ''">question_setting_method,</if>
+            <if test="examCollectionType != null and examCollectionType != ''">exam_collection_type,</if>
+            <if test="examCollectionName != null and examCollectionName != ''">exam_collection_name,</if>
+            <if test="taskId != null">task_id,</if>
+            <if test="limitDuration != null">limit_duration,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="createUserId != null">create_user_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="simType != null and simType != ''">#{simType},</if>
+            <if test="questionSettingMethod != null and questionSettingMethod != ''">#{questionSettingMethod},</if>
+            <if test="examCollectionType != null and examCollectionType != ''">#{examCollectionType},</if>
+            <if test="examCollectionName != null and examCollectionName != ''">#{examCollectionName},</if>
+            <if test="taskId != null">#{taskId},</if>
+            <if test="limitDuration != null">#{limitDuration},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="createUserId != null">#{createUserId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateRealExamCollection" parameterType="RealExamCollection">
+        update sim_real_exam_collection
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="simType != null and simType != ''">sim_type = #{simType},</if>
+            <if test="questionSettingMethod != null and questionSettingMethod != ''">question_setting_method =
+                #{questionSettingMethod},
+            </if>
+            <if test="examCollectionType != null and examCollectionType != ''">exam_collection_type =
+                #{examCollectionType},
+            </if>
+            <if test="examCollectionName != null and examCollectionName != ''">exam_collection_name =
+                #{examCollectionName},
+            </if>
+            <if test="taskId != null">task_id = #{taskId},</if>
+            <if test="limitDuration != null">limit_duration = #{limitDuration},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="createUserId != null">create_user_id = #{createUserId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where exam_collection_id = #{examCollectionId}
+    </update>
+
+    <delete id="deleteRealExamCollectionByExamCollectionId" parameterType="Long">
+        delete
+        from sim_real_exam_collection
+        where exam_collection_id = #{examCollectionId}
+    </delete>
+
+    <delete id="deleteRealExamCollectionByExamCollectionIds" parameterType="String">
+        delete from sim_real_exam_collection where exam_collection_id in
+        <foreach item="examCollectionId" collection="array" open="(" separator="," close=")">
+            #{examCollectionId}
+        </foreach>
+    </delete>
+</mapper>

+ 70 - 0
ruoyi-sim/src/main/resources/mapper/sim/RealExamCollectionDeptMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.sim.mapper.RealExamCollectionDeptMapper">
+
+    <resultMap type="RealExamCollectionDept" id="RealExamCollectionDeptResult">
+        <result property="relId" column="rel_id"/>
+        <result property="examCollectionId" column="exam_collection_id"/>
+        <result property="deptId" column="dept_id"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <sql id="selectRealExamCollectionDeptVo">
+        select rel_id, exam_collection_id, dept_id, update_time
+        from sim_real_exam_collection_dept
+    </sql>
+
+    <select id="selectRealExamCollectionDeptList" parameterType="RealExamCollectionDept"
+            resultMap="RealExamCollectionDeptResult">
+        <include refid="selectRealExamCollectionDeptVo"/>
+        <where>
+            <if test="examCollectionId != null ">and exam_collection_id = #{examCollectionId}</if>
+            <if test="deptId != null ">and dept_id = #{deptId}</if>
+        </where>
+    </select>
+
+    <select id="selectRealExamCollectionDeptByRelId" parameterType="Long" resultMap="RealExamCollectionDeptResult">
+        <include refid="selectRealExamCollectionDeptVo"/>
+        where rel_id = #{relId}
+    </select>
+
+    <insert id="insertRealExamCollectionDept" parameterType="RealExamCollectionDept" useGeneratedKeys="true"
+            keyProperty="relId">
+        insert into sim_real_exam_collection_dept
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="examCollectionId != null">exam_collection_id,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="updateTime != null">update_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="examCollectionId != null">#{examCollectionId},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updateRealExamCollectionDept" parameterType="RealExamCollectionDept">
+        update sim_real_exam_collection_dept
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="examCollectionId != null">exam_collection_id = #{examCollectionId},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where rel_id = #{relId}
+    </update>
+
+    <delete id="deleteRealExamCollectionDeptByRelId" parameterType="Long">
+        delete
+        from sim_real_exam_collection_dept
+        where rel_id = #{relId}
+    </delete>
+
+    <delete id="deleteRealExamCollectionDeptByRelIds" parameterType="String">
+        delete from sim_real_exam_collection_dept where rel_id in
+        <foreach item="relId" collection="array" open="(" separator="," close=")">
+            #{relId}
+        </foreach>
+    </delete>
+</mapper>

+ 111 - 0
ruoyi-sim/src/main/resources/mapper/sim/RealExamCompRequestMapper.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.sim.mapper.RealExamCompRequestMapper">
+
+    <resultMap type="RealExamCompRequest" id="RealExamCompRequestResult">
+        <result property="relId" column="rel_id"/>
+        <result property="examId" column="exam_id"/>
+        <result property="faultId" column="fault_id"/>
+        <result property="requestStatus" column="request_status"/>
+        <result property="createByUserId" column="create_by_user_id"/>
+        <result property="updateByUserId" column="update_by_user_id"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectRealExamCompRequestVo">
+        select rel_id,
+               exam_id,
+               fault_id,
+               request_status,
+               create_by_user_id,
+               update_by_user_id,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sim_real_exam_comp_request
+    </sql>
+
+    <select id="selectRealExamCompRequestList" parameterType="RealExamCompRequest"
+            resultMap="RealExamCompRequestResult">
+        <include refid="selectRealExamCompRequestVo"/>
+        <where>
+            <if test="examId != null ">and exam_id = #{examId}</if>
+            <if test="faultId != null  and faultId != ''">and fault_id = #{faultId}</if>
+            <if test="requestStatus != null  and requestStatus != ''">and request_status = #{requestStatus}</if>
+            <if test="createByUserId != null ">and create_by_user_id = #{createByUserId}</if>
+            <if test="updateByUserId != null ">and update_by_user_id = #{updateByUserId}</if>
+        </where>
+    </select>
+
+    <select id="selectRealExamCompRequestByRelId" parameterType="Long" resultMap="RealExamCompRequestResult">
+        <include refid="selectRealExamCompRequestVo"/>
+        where rel_id = #{relId}
+    </select>
+
+    <insert id="insertRealExamCompRequest" parameterType="RealExamCompRequest" useGeneratedKeys="true"
+            keyProperty="relId">
+        insert into sim_real_exam_comp_request
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="examId != null">exam_id,</if>
+            <if test="faultId != null and faultId != ''">fault_id,</if>
+            <if test="requestStatus != null and requestStatus != ''">request_status,</if>
+            <if test="createByUserId != null">create_by_user_id,</if>
+            <if test="updateByUserId != null">update_by_user_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="examId != null">#{examId},</if>
+            <if test="faultId != null and faultId != ''">#{faultId},</if>
+            <if test="requestStatus != null and requestStatus != ''">#{requestStatus},</if>
+            <if test="createByUserId != null">#{createByUserId},</if>
+            <if test="updateByUserId != null">#{updateByUserId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateRealExamCompRequest" parameterType="RealExamCompRequest">
+        update sim_real_exam_comp_request
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="examId != null">exam_id = #{examId},</if>
+            <if test="faultId != null and faultId != ''">fault_id = #{faultId},</if>
+            <if test="requestStatus != null and requestStatus != ''">request_status = #{requestStatus},</if>
+            <if test="createByUserId != null">create_by_user_id = #{createByUserId},</if>
+            <if test="updateByUserId != null">update_by_user_id = #{updateByUserId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where rel_id = #{relId}
+    </update>
+
+    <delete id="deleteRealExamCompRequestByRelId" parameterType="Long">
+        delete
+        from sim_real_exam_comp_request
+        where rel_id = #{relId}
+    </delete>
+
+    <delete id="deleteRealExamCompRequestByRelIds" parameterType="String">
+        delete from sim_real_exam_comp_request where rel_id in
+        <foreach item="relId" collection="array" open="(" separator="," close=")">
+            #{relId}
+        </foreach>
+    </delete>
+</mapper>

+ 115 - 0
ruoyi-sim/src/main/resources/mapper/sim/RealExamFaultMapper.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.sim.mapper.RealExamFaultMapper">
+
+    <resultMap type="RealExamFault" id="RealExamFaultResult">
+        <result property="refId" column="ref_id"/>
+        <result property="examId" column="exam_id"/>
+        <result property="faultId" column="fault_id"/>
+        <result property="flag" column="flag"/>
+        <result property="questionValue" column="question_value"/>
+        <result property="answerValue" column="answer_value"/>
+        <result property="minus" column="minus"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectRealExamFaultVo">
+        select ref_id,
+               exam_id,
+               fault_id,
+               flag,
+               question_value,
+               answer_value,
+               minus,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sim_real_exam_fault
+    </sql>
+
+    <select id="selectRealExamFaultList" parameterType="RealExamFault" resultMap="RealExamFaultResult">
+        <include refid="selectRealExamFaultVo"/>
+        <where>
+            <if test="examId != null ">and exam_id = #{examId}</if>
+            <if test="faultId != null  and faultId != ''">and fault_id = #{faultId}</if>
+            <if test="flag != null  and flag != ''">and flag = #{flag}</if>
+            <if test="questionValue != null  and questionValue != ''">and question_value = #{questionValue}</if>
+            <if test="answerValue != null  and answerValue != ''">and answer_value = #{answerValue}</if>
+            <if test="minus != null ">and minus = #{minus}</if>
+        </where>
+    </select>
+
+    <select id="selectRealExamFaultByRefId" parameterType="Long" resultMap="RealExamFaultResult">
+        <include refid="selectRealExamFaultVo"/>
+        where ref_id = #{refId}
+    </select>
+
+    <insert id="insertRealExamFault" parameterType="RealExamFault" useGeneratedKeys="true" keyProperty="refId">
+        insert into sim_real_exam_fault
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="examId != null">exam_id,</if>
+            <if test="faultId != null and faultId != ''">fault_id,</if>
+            <if test="flag != null and flag != ''">flag,</if>
+            <if test="questionValue != null">question_value,</if>
+            <if test="answerValue != null">answer_value,</if>
+            <if test="minus != null">minus,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="examId != null">#{examId},</if>
+            <if test="faultId != null and faultId != ''">#{faultId},</if>
+            <if test="flag != null and flag != ''">#{flag},</if>
+            <if test="questionValue != null">#{questionValue},</if>
+            <if test="answerValue != null">#{answerValue},</if>
+            <if test="minus != null">#{minus},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateRealExamFault" parameterType="RealExamFault">
+        update sim_real_exam_fault
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="examId != null">exam_id = #{examId},</if>
+            <if test="faultId != null and faultId != ''">fault_id = #{faultId},</if>
+            <if test="flag != null and flag != ''">flag = #{flag},</if>
+            <if test="questionValue != null">question_value = #{questionValue},</if>
+            <if test="answerValue != null">answer_value = #{answerValue},</if>
+            <if test="minus != null">minus = #{minus},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where ref_id = #{refId}
+    </update>
+
+    <delete id="deleteRealExamFaultByRefId" parameterType="Long">
+        delete
+        from sim_real_exam_fault
+        where ref_id = #{refId}
+    </delete>
+
+    <delete id="deleteRealExamFaultByRefIds" parameterType="String">
+        delete from sim_real_exam_fault where ref_id in
+        <foreach item="refId" collection="array" open="(" separator="," close=")">
+            #{refId}
+        </foreach>
+    </delete>
+</mapper>

+ 147 - 0
ruoyi-sim/src/main/resources/mapper/sim/RealExamMapper.xml

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.sim.mapper.RealExamMapper">
+
+    <resultMap type="RealExam" id="RealExamResult">
+        <result property="examId" column="exam_id"/>
+        <result property="examCollectionId" column="exam_collection_id"/>
+        <result property="userId" column="user_id"/>
+        <result property="seatId" column="seat_id"/>
+        <result property="simId" column="sim_id"/>
+        <result property="examStatus" column="exam_status"/>
+        <result property="totalScore" column="total_score"/>
+        <result property="deductionTotalScore" column="deduction_total_score"/>
+        <result property="startTime" column="start_time"/>
+        <result property="endTime" column="end_time"/>
+        <result property="loginTime" column="login_time"/>
+        <result property="logoutTime" column="logout_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectRealExamVo">
+        select exam_id,
+               exam_collection_id,
+               user_id,
+               seat_id,
+               sim_id,
+               exam_status,
+               total_score,
+               deduction_total_score,
+               start_time,
+               end_time,
+               login_time,
+               logout_time,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sim_real_exam
+    </sql>
+
+    <select id="selectRealExamList" parameterType="RealExam" resultMap="RealExamResult">
+        <include refid="selectRealExamVo"/>
+        <where>
+            <if test="examCollectionId != null ">and exam_collection_id = #{examCollectionId}</if>
+            <if test="userId != null ">and user_id = #{userId}</if>
+            <if test="seatId != null ">and seat_id = #{seatId}</if>
+            <if test="simId != null ">and sim_id = #{simId}</if>
+            <if test="examStatus != null  and examStatus != ''">and exam_status = #{examStatus}</if>
+            <if test="totalScore != null ">and total_score = #{totalScore}</if>
+            <if test="deductionTotalScore != null ">and deduction_total_score = #{deductionTotalScore}</if>
+            <if test="startTime != null ">and start_time = #{startTime}</if>
+            <if test="endTime != null ">and end_time = #{endTime}</if>
+            <if test="loginTime != null ">and login_time = #{loginTime}</if>
+            <if test="logoutTime != null ">and logout_time = #{logoutTime}</if>
+        </where>
+    </select>
+
+    <select id="selectRealExamByExamId" parameterType="Long" resultMap="RealExamResult">
+        <include refid="selectRealExamVo"/>
+        where exam_id = #{examId}
+    </select>
+
+    <insert id="insertRealExam" parameterType="RealExam">
+        insert into sim_real_exam
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="examId != null">exam_id,</if>
+            <if test="examCollectionId != null">exam_collection_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="seatId != null">seat_id,</if>
+            <if test="simId != null">sim_id,</if>
+            <if test="examStatus != null">exam_status,</if>
+            <if test="totalScore != null">total_score,</if>
+            <if test="deductionTotalScore != null">deduction_total_score,</if>
+            <if test="startTime != null">start_time,</if>
+            <if test="endTime != null">end_time,</if>
+            <if test="loginTime != null">login_time,</if>
+            <if test="logoutTime != null">logout_time,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="examId != null">#{examId},</if>
+            <if test="examCollectionId != null">#{examCollectionId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="seatId != null">#{seatId},</if>
+            <if test="simId != null">#{simId},</if>
+            <if test="examStatus != null">#{examStatus},</if>
+            <if test="totalScore != null">#{totalScore},</if>
+            <if test="deductionTotalScore != null">#{deductionTotalScore},</if>
+            <if test="startTime != null">#{startTime},</if>
+            <if test="endTime != null">#{endTime},</if>
+            <if test="loginTime != null">#{loginTime},</if>
+            <if test="logoutTime != null">#{logoutTime},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateRealExam" parameterType="RealExam">
+        update sim_real_exam
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="examCollectionId != null">exam_collection_id = #{examCollectionId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="seatId != null">seat_id = #{seatId},</if>
+            <if test="simId != null">sim_id = #{simId},</if>
+            <if test="examStatus != null">exam_status = #{examStatus},</if>
+            <if test="totalScore != null">total_score = #{totalScore},</if>
+            <if test="deductionTotalScore != null">deduction_total_score = #{deductionTotalScore},</if>
+            <if test="startTime != null">start_time = #{startTime},</if>
+            <if test="endTime != null">end_time = #{endTime},</if>
+            <if test="loginTime != null">login_time = #{loginTime},</if>
+            <if test="logoutTime != null">logout_time = #{logoutTime},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where exam_id = #{examId}
+    </update>
+
+    <delete id="deleteRealExamByExamId" parameterType="Long">
+        delete
+        from sim_real_exam
+        where exam_id = #{examId}
+    </delete>
+
+    <delete id="deleteRealExamByExamIds" parameterType="String">
+        delete from sim_real_exam where exam_id in
+        <foreach item="examId" collection="array" open="(" separator="," close=")">
+            #{examId}
+        </foreach>
+    </delete>
+</mapper>

+ 97 - 0
ruoyi-sim/src/main/resources/mapper/sim/SeatMapper.xml

@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.sim.mapper.SeatMapper">
+
+    <resultMap type="Seat" id="SeatResult">
+        <result property="seatId" column="seat_id"/>
+        <result property="seatNum" column="seat_num"/>
+        <result property="seatBindIp" column="seat_bind_ip"/>
+        <result property="currentUserId" column="current_user_id"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
+    </resultMap>
+
+    <sql id="selectSeatVo">
+        select seat_id,
+               seat_num,
+               seat_bind_ip,
+               current_user_id,
+               create_by,
+               create_time,
+               update_by,
+               update_time,
+               remark
+        from sim_seat
+    </sql>
+
+    <select id="selectSeatList" parameterType="Seat" resultMap="SeatResult">
+        <include refid="selectSeatVo"/>
+        <where>
+            <if test="seatNum != null ">and seat_num = #{seatNum}</if>
+            <if test="seatBindIp != null  and seatBindIp != ''">and seat_bind_ip = #{seatBindIp}</if>
+            <if test="currentUserId != null ">and current_user_id = #{currentUserId}</if>
+        </where>
+    </select>
+
+    <select id="selectSeatBySeatId" parameterType="Long" resultMap="SeatResult">
+        <include refid="selectSeatVo"/>
+        where seat_id = #{seatId}
+    </select>
+
+    <insert id="insertSeat" parameterType="Seat" useGeneratedKeys="true" keyProperty="seatId">
+        insert into sim_seat
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="seatNum != null">seat_num,</if>
+            <if test="seatBindIp != null and seatBindIp != ''">seat_bind_ip,</if>
+            <if test="currentUserId != null">current_user_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="seatNum != null">#{seatNum},</if>
+            <if test="seatBindIp != null and seatBindIp != ''">#{seatBindIp},</if>
+            <if test="currentUserId != null">#{currentUserId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+        </trim>
+    </insert>
+
+    <update id="updateSeat" parameterType="Seat">
+        update sim_seat
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="seatNum != null">seat_num = #{seatNum},</if>
+            <if test="seatBindIp != null and seatBindIp != ''">seat_bind_ip = #{seatBindIp},</if>
+            <if test="currentUserId != null">current_user_id = #{currentUserId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where seat_id = #{seatId}
+    </update>
+
+    <delete id="deleteSeatBySeatId" parameterType="Long">
+        delete
+        from sim_seat
+        where seat_id = #{seatId}
+    </delete>
+
+    <delete id="deleteSeatBySeatIds" parameterType="String">
+        delete from sim_seat where seat_id in
+        <foreach item="seatId" collection="array" open="(" separator="," close=")">
+            #{seatId}
+        </foreach>
+    </delete>
+</mapper>

+ 46 - 70
ruoyi-sim/src/main/resources/mapper/sim/SimMapper.xml

@@ -2,18 +2,14 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.ruoyi.sim.mapper.SimMsgMapper">
+<mapper namespace="com.ruoyi.sim.mapper.SimMapper">
 
-    <resultMap type="SimMsg" id="SimMsgResult">
-        <result property="simMsgId" column="sim_msg_id"/>
+    <resultMap type="Sim" id="SimResult">
         <result property="simId" column="sim_id"/>
-        <result property="state" column="state"/>
-        <result property="priority" column="priority"/>
-        <result property="sendMsg" column="send_msg"/>
-        <result property="sendTime" column="send_time"/>
-        <result property="receiveMsg" column="receive_msg"/>
-        <result property="receiveTime" column="receive_time"/>
-        <result property="retryCount" column="retry_count"/>
+        <result property="seatId" column="seat_id"/>
+        <result property="simType" column="sim_type"/>
+        <result property="simState" column="sim_state"/>
+        <result property="simSn" column="sim_sn"/>
         <result property="createBy" column="create_by"/>
         <result property="createTime" column="create_time"/>
         <result property="updateBy" column="update_by"/>
@@ -21,54 +17,42 @@
         <result property="remark" column="remark"/>
     </resultMap>
 
-    <sql id="selectSimMsgVo">
-        select sim_msg_id,
-               sim_id,
-               state,
-               priority,
-               send_msg,
-               send_time,
-               receive_msg,
-               receive_time,
-               retry_count,
+    <sql id="selectSimVo">
+        select sim_id,
+               seat_id,
+               sim_type,
+               sim_state,
+               sim_sn,
                create_by,
                create_time,
                update_by,
                update_time,
                remark
-        from sim_sim_msg
+        from sim_sim
     </sql>
 
-    <select id="selectSimMsgList" parameterType="SimMsg" resultMap="SimMsgResult">
-        <include refid="selectSimMsgVo"/>
+    <select id="selectSimList" parameterType="Sim" resultMap="SimResult">
+        <include refid="selectSimVo"/>
         <where>
-            <if test="simId != null ">and sim_id = #{simId}</if>
-            <if test="state != null  and state != ''">and state = #{state}</if>
-            <if test="priority != null ">and priority = #{priority}</if>
-            <if test="sendMsg != null  and sendMsg != ''">and send_msg = #{sendMsg}</if>
-            <if test="sendTime != null ">and send_time = #{sendTime}</if>
-            <if test="receiveMsg != null  and receiveMsg != ''">and receive_msg = #{receiveMsg}</if>
-            <if test="receiveTime != null ">and receive_time = #{receiveTime}</if>
-            <if test="retryCount != null ">and retry_count = #{retryCount}</if>
+            <if test="seatId != null ">and seat_id = #{seatId}</if>
+            <if test="simType != null  and simType != ''">and sim_type = #{simType}</if>
+            <if test="simState != null  and simState != ''">and sim_state = #{simState}</if>
+            <if test="simSn != null  and simSn != ''">and sim_sn = #{simSn}</if>
         </where>
     </select>
 
-    <select id="selectSimMsgBySimMsgId" parameterType="Long" resultMap="SimMsgResult">
-        <include refid="selectSimMsgVo"/>
-        where sim_msg_id = #{simMsgId}
+    <select id="selectSimBySimId" parameterType="Long" resultMap="SimResult">
+        <include refid="selectSimVo"/>
+        where sim_id = #{simId}
     </select>
 
-    <insert id="insertSimMsg" parameterType="SimMsg" useGeneratedKeys="true" keyProperty="simMsgId">
-        insert into sim_sim_msg
+    <insert id="insertSim" parameterType="Sim" useGeneratedKeys="true" keyProperty="simId">
+        insert into sim_sim
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="simId != null">sim_id,</if>
-            <if test="state != null and state != ''">state,</if>
-            <if test="priority != null">priority,</if>
-            <if test="sendMsg != null">send_msg,</if>
-            <if test="sendTime != null">send_time,</if>
-            <if test="receiveMsg != null">receive_msg,</if>
-            <if test="receiveTime != null">receive_time,</if>
-            <if test="retryCount != null">retry_count,</if>
+            <if test="seatId != null">seat_id,</if>
+            <if test="simType != null and simType != ''">sim_type,</if>
+            <if test="simState != null and simState != ''">sim_state,</if>
+            <if test="simSn != null and simSn != ''">sim_sn,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -76,14 +60,10 @@
             <if test="remark != null">remark,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="simId != null">#{simId},</if>
-            <if test="state != null and state != ''">#{state},</if>
-            <if test="priority != null">#{priority},</if>
-            <if test="sendMsg != null">#{sendMsg},</if>
-            <if test="sendTime != null">#{sendTime},</if>
-            <if test="receiveMsg != null">#{receiveMsg},</if>
-            <if test="receiveTime != null">#{receiveTime},</if>
-            <if test="retryCount != null">#{retryCount},</if>
+            <if test="seatId != null">#{seatId},</if>
+            <if test="simType != null and simType != ''">#{simType},</if>
+            <if test="simState != null and simState != ''">#{simState},</if>
+            <if test="simSn != null and simSn != ''">#{simSn},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -92,36 +72,32 @@
         </trim>
     </insert>
 
-    <update id="updateSimMsg" parameterType="SimMsg">
-        update sim_sim_msg
+    <update id="updateSim" parameterType="Sim">
+        update sim_sim
         <trim prefix="SET" suffixOverrides=",">
-            <if test="simId != null">sim_id = #{simId},</if>
-            <if test="state != null and state != ''">state = #{state},</if>
-            <if test="priority != null">priority = #{priority},</if>
-            <if test="sendMsg != null">send_msg = #{sendMsg},</if>
-            <if test="sendTime != null">send_time = #{sendTime},</if>
-            <if test="receiveMsg != null">receive_msg = #{receiveMsg},</if>
-            <if test="receiveTime != null">receive_time = #{receiveTime},</if>
-            <if test="retryCount != null">retry_count = #{retryCount},</if>
+            <if test="seatId != null">seat_id = #{seatId},</if>
+            <if test="simType != null and simType != ''">sim_type = #{simType},</if>
+            <if test="simState != null and simState != ''">sim_state = #{simState},</if>
+            <if test="simSn != null and simSn != ''">sim_sn = #{simSn},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="remark != null">remark = #{remark},</if>
         </trim>
-        where sim_msg_id = #{simMsgId}
+        where sim_id = #{simId}
     </update>
 
-    <delete id="deleteSimMsgBySimMsgId" parameterType="Long">
+    <delete id="deleteSimBySimId" parameterType="Long">
         delete
-        from sim_sim_msg
-        where sim_msg_id = #{simMsgId}
+        from sim_sim
+        where sim_id = #{simId}
     </delete>
 
-    <delete id="deleteSimMsgBySimMsgIds" parameterType="String">
-        delete from sim_sim_msg where sim_msg_id in
-        <foreach item="simMsgId" collection="array" open="(" separator="," close=")">
-            #{simMsgId}
+    <delete id="deleteSimBySimIds" parameterType="String">
+        delete from sim_sim where sim_id in
+        <foreach item="simId" collection="array" open="(" separator="," close=")">
+            #{simId}
         </foreach>
     </delete>
 </mapper>

+ 3 - 0
ruoyi-sim/src/main/resources/mapper/sim/TaskMapper.xml

@@ -47,6 +47,9 @@
     </select>
 
     <insert id="insertTask" parameterType="Task">
+        <selectKey keyProperty="taskId" order="AFTER" resultType="java.lang.Long">
+            select last_insert_id()
+        </selectKey>
         insert into sim_task
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="taskId != null">task_id,</if>

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott