Przeglądaj źródła

Merge branch 'dev-api' of http://123.57.51.87:40003/lishuo/RuoYi-Vue into dev-api

tom 5 miesięcy temu
rodzic
commit
5f9e3b406a

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

@@ -0,0 +1,33 @@
+/*
+ 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: 13/12/2024 13:35:34
+*/
+
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for sim_task_fault
+-- ----------------------------
+DROP TABLE IF EXISTS `sim_task_fault`;
+CREATE TABLE `sim_task_fault`  (
+  `rel_id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `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,
+  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;

Plik diff jest za duży
+ 58 - 17
pla-sim/01_SQL/03_dev_backup/pla-chem-sim-dev-1.sql


+ 16 - 7
ruoyi-sim/src/main/java/com/ruoyi/sim/service/impl/StudentService.java

@@ -84,18 +84,27 @@ public class StudentService {
 
     public Student selectStudentByUserId(Long userId) {
         SysUser sysUser = userMapper.selectUserById(userId);
-        // 屏蔽密码
-        sysUser.setPassword("");
         Student student = new Student();
-        BeanUtils.copyProperties(sysUser, student);
-        student.setMajor(getMajorByDeptId(sysUser.getDeptId()));
-        // logger.info(Objects.requireNonNull(student.toString()));
+        // todo:用户角色判断。
+        // 屏蔽密码
+        if (Objects.nonNull(sysUser)) {
+            sysUser.setPassword("");
+            BeanUtils.copyProperties(sysUser, student);
+            Major m = getMajorByDeptId(sysUser.getDeptId());
+            if (Objects.nonNull(m)) {
+                student.setMajor(m);
+            }
+            // logger.info(Objects.requireNonNull(student.toString()));
+        }
         return student;
     }
 
-    public Major getMajorByDeptId(long deptId) {
+    public Major getMajorByDeptId(Long deptId) {
         AddOnDept a = addOnDeptService.selectAddOnDeptByDeptId(deptId);
-        Major m = majorService.selectMajorByMajorId(a.getMajorId());
+        Major m = null;
+        if (Objects.nonNull(a)) {
+            m = majorService.selectMajorByMajorId(a.getMajorId());
+        }
         return m;
     }
 }

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików