Эх сурвалжийг харах

fix:支持演示demo制作

caozixuan 3 жил өмнө
parent
commit
68b7e6d7b9

+ 11 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/BasicCourse.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.teachcloud.common.base.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 
@@ -36,6 +37,9 @@ public class BasicCourse extends BaseEntity implements Serializable {
      */
     private String name;
 
+    @ApiModelProperty("历史课程名称")
+    private String historicName;
+
     public Long getSchoolId() {
         return schoolId;
     }
@@ -60,4 +64,11 @@ public class BasicCourse extends BaseEntity implements Serializable {
         this.name = name;
     }
 
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
 }

+ 11 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/SysOrg.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.teachcloud.common.base.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
 
@@ -46,6 +47,9 @@ public class SysOrg extends BaseEntity implements Serializable {
      */
     private Boolean enable;
 
+    @ApiModelProperty("历史机构名")
+    private String historicName;
+
     public Long getSchoolId() {
         return schoolId;
     }
@@ -86,4 +90,11 @@ public class SysOrg extends BaseEntity implements Serializable {
         this.enable = enable;
     }
 
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
 }

+ 13 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/SysUser.java

@@ -1,5 +1,6 @@
 package com.qmth.teachcloud.common.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@@ -9,6 +10,7 @@ import com.qmth.teachcloud.common.contant.SpringContextHolder;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.service.SysConfigService;
 import com.qmth.teachcloud.common.util.Base64Util;
+import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.StringUtils;
 import org.hibernate.validator.constraints.Length;
 
@@ -90,6 +92,9 @@ public class SysUser extends BaseEntity implements Serializable {
     @TableField(exist = false)
     private Long[] courseIds;
 
+    @ApiModelProperty("历史用户名")
+    private String historicName;
+
     public void setInsertInfo(Long userId) {
         setId(SystemConstant.getDbUuid());
         setCreateId(userId);
@@ -201,4 +206,12 @@ public class SysUser extends BaseEntity implements Serializable {
     public void setOldPassword(String oldPassword) {
         this.oldPassword = oldPassword;
     }
+
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
 }

+ 72 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/excel/BasicCourseChangeDto.java

@@ -0,0 +1,72 @@
+package com.qmth.teachcloud.report.business.bean.dto.excel;
+
+import com.qmth.teachcloud.common.annotation.ExcelNote;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @Description: 基础课程变更导入类
+ * @Author: CaoZixuan
+ * @Date: 2022-02-25
+ */
+public class BasicCourseChangeDto implements Serializable {
+    @ExcelNote(value = "id")
+    @NotNull
+    private String id;
+
+    @ExcelNote(value = "学校id")
+    @NotNull
+    private String schoolId;
+
+    @ExcelNote(value = "课程编号")
+    @NotNull
+    private String courseCode;
+
+    @ExcelNote(value = "课程名称")
+    @NotNull
+    private String historicName;
+
+    @ExcelNote(value = "变更后的名称")
+    private String newName;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(String schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
+
+    public String getNewName() {
+        return newName;
+    }
+
+    public void setNewName(String newName) {
+        this.newName = newName;
+    }
+}

+ 73 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/excel/SysOrgChangeDto.java

@@ -0,0 +1,73 @@
+package com.qmth.teachcloud.report.business.bean.dto.excel;
+
+import com.qmth.teachcloud.common.annotation.ExcelNote;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @Description: 系统机构改名类
+ * @Author: CaoZixuan
+ * @Date: 2022-02-25
+ */
+public class SysOrgChangeDto implements Serializable {
+    @ExcelNote(value = "id")
+    @NotNull
+    private String id;
+
+    @ExcelNote(value = "学校id")
+    @NotNull
+    private String schoolId;
+
+    @ExcelNote(value = "机构编号")
+    @NotNull
+    private String orgCode;
+
+    @ExcelNote(value = "机构名称")
+    @NotNull
+    private String historicName;
+
+    @ExcelNote(value = "变更后的名称")
+    @NotNull
+    private String newName;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(String schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public String getOrgCode() {
+        return orgCode;
+    }
+
+    public void setOrgCode(String orgCode) {
+        this.orgCode = orgCode;
+    }
+
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
+
+    public String getNewName() {
+        return newName;
+    }
+
+    public void setNewName(String newName) {
+        this.newName = newName;
+    }
+}

+ 73 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/dto/excel/SysUserChangeDto.java

@@ -0,0 +1,73 @@
+package com.qmth.teachcloud.report.business.bean.dto.excel;
+
+import com.qmth.teachcloud.common.annotation.ExcelNote;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @Description: 基础用户变更导入类
+ * @Author: CaoZixuan
+ * @Date: 2022-02-25
+ */
+public class SysUserChangeDto implements Serializable {
+    @ExcelNote(value = "id")
+    @NotNull
+    private String id;
+
+    @ExcelNote(value = "学校id")
+    @NotNull
+    private String schoolId;
+
+    @ExcelNote(value = "真实姓名")
+    @NotNull
+    private String historicName;
+
+    @ExcelNote(value = "变更后的名称")
+    @NotNull
+    private String newName;
+
+    @ExcelNote(value = "角色")
+    @NotNull
+    private String roleName;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(String schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public String getHistoricName() {
+        return historicName;
+    }
+
+    public void setHistoricName(String historicName) {
+        this.historicName = historicName;
+    }
+
+    public String getNewName() {
+        return newName;
+    }
+
+    public void setNewName(String newName) {
+        this.newName = newName;
+    }
+
+    public String getRoleName() {
+        return roleName;
+    }
+
+    public void setRoleName(String roleName) {
+        this.roleName = roleName;
+    }
+}

+ 45 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/CourseUnitOperateService.java

@@ -0,0 +1,45 @@
+package com.qmth.teachcloud.report.business.service;
+
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+
+/**
+ * @Description: 课程单元操作服务类(课程删除、以课程为单位的改名操作)
+ * @Author: CaoZixuan
+ * @Date: 2022-02-25
+ */
+public interface CourseUnitOperateService {
+
+    /**
+     * 演示用变更基础课程名
+     *
+     * @param file     文件
+     * @param schoolId 学校id(检测器)
+     * @return 结果
+     */
+    String changeBasicCourse(MultipartFile file, Long schoolId) throws IOException, NoSuchFieldException;
+
+    /**
+     * 演示用变更系统机构名
+     *
+     * @param file     文件
+     * @param schoolId 学校id(检测器)
+     * @return 结果
+     */
+    String changeSysOrg(MultipartFile file, Long schoolId) throws IOException, NoSuchFieldException;
+
+    /**
+     * 演示用变更
+     *
+     * @param file     文件
+     * @param schoolId 学校id(检测器)
+     * @return 结果
+     */
+    String changeSysUser(MultipartFile file, Long schoolId) throws IOException, NoSuchFieldException;
+
+    /**
+     * 制作真实数据
+     */
+    void createDemoData();
+}

+ 612 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/CourseUnitOperateServiceImpl.java

@@ -0,0 +1,612 @@
+package com.qmth.teachcloud.report.business.service.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.common.collect.Lists;
+import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.BasicCourse;
+import com.qmth.teachcloud.common.entity.SysOrg;
+import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
+import com.qmth.teachcloud.common.service.BasicCourseService;
+import com.qmth.teachcloud.common.service.SysOrgService;
+import com.qmth.teachcloud.common.service.SysUserService;
+import com.qmth.teachcloud.common.util.ExcelUtil;
+import com.qmth.teachcloud.report.business.bean.dto.excel.BasicCourseChangeDto;
+import com.qmth.teachcloud.report.business.bean.dto.excel.SysOrgChangeDto;
+import com.qmth.teachcloud.report.business.bean.dto.excel.SysUserChangeDto;
+import com.qmth.teachcloud.report.business.entity.TAExamCourse;
+import com.qmth.teachcloud.report.business.entity.TAExamTotal;
+import com.qmth.teachcloud.report.business.service.*;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @Description: 课程单元操作服务实现类
+ * @Author: CaoZixuan
+ * @Date: 2022-02-25
+ */
+@Service
+public class CourseUnitOperateServiceImpl implements CourseUnitOperateService {
+    @Resource
+    private BasicCourseService basicCourseService;
+    @Resource
+    private SysOrgService sysOrgService;
+    @Resource
+    private SysUserService sysUserService;
+    @Resource
+    private TBCommonLevelConfigService tbCommonLevelConfigService;
+    @Resource
+    private TBCommonRankLevelConfigService tbCommonRankLevelConfigService;
+    @Resource
+    private TBDimensionService tbDimensionService;
+    @Resource
+    private TBExamCourseService tbExamCourseService;
+    @Resource
+    private TBExamStudentService tbExamStudentService;
+    @Resource
+    private TBModuleConfigService tbModuleConfigService;
+    @Resource
+    private TBModuleProficiencyService tbModuleProficiencyService;
+    @Resource
+    private TBPaperService tbPaperService;
+    @Resource
+    private TBTeacherService tbTeacherService;
+    @Resource
+    private TAExamCourseService taExamCourseService;
+    @Resource
+    private TAExamCourseClazzService taExamCourseClazzService;
+    @Resource
+    private TAExamCourseCollegeInspectService taExamCourseCollegeInspectService;
+    @Resource
+    private TAExamCourseCollegeInspectDioService taExamCourseCollegeInspectDioService;
+    @Resource
+    private TAExamCourseCollegePaperStructService taExamCourseCollegePaperStructService;
+    @Resource
+    private TAExamCourseCollegeTeacherService taExamCourseCollegeTeacherService;
+    @Resource
+    private TAExamCourseDifficultService taExamCourseDifficultService;
+    @Resource
+    private TAExamCourseDioService taExamCourseDioService;
+    @Resource
+    private TAExamCourseRecordDioService taExamCourseRecordDioService;
+    @Resource
+    private TAExamCourseRecordModService taExamCourseRecordModService;
+    @Resource
+    private TAExamCourseTeacherService taExamCourseTeacherService;
+    @Resource
+    private TAExamCourseTeacherCollegeDifficultService taExamCourseTeacherCollegeDifficultService;
+    @Resource
+    private TAExamCourseTeacherCollegeDioService taExamCourseTeacherCollegeDioService;
+    @Resource
+    private TAExamCourseTeacherCollegePaperStructService taExamCourseTeacherCollegePaperStructService;
+    @Resource
+    private TAExamCourseTeacherDifficultService taExamCourseTeacherDifficultService;
+    @Resource
+    private TAExamCourseTeacherDioService taExamCourseTeacherDioService;
+    @Resource
+    private TAExamCourseTeacherPaperStructService taExamCourseTeacherPaperStructService;
+    @Resource
+    private TAExamTotalService taExamTotalService;
+    @Resource
+    private TAPaperStructService taPaperStructService;
+
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public String changeBasicCourse(MultipartFile file, Long schoolId) throws IOException, NoSuchFieldException {
+        // 基础课程数据源
+        List<BasicCourse> basicCourseDatasource = basicCourseService.list(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId, schoolId));
+
+        List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(file.getInputStream(), Lists.newArrayList(BasicCourseChangeDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
+            if (finalExcelErrorList.size() > 0) {
+                throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(finalExcelErrorList));
+            }
+            return finalExcelList;
+        });
+        List<BasicCourse> updateData = new ArrayList<>();
+        if (Objects.nonNull(finalList) && finalList.size() > 0) {
+            for (int i = 0; i < finalList.size(); i++) {
+                LinkedMultiValueMap<Integer, Object> map = finalList.get(i);
+                List<Object> dataSource = map.get(i);
+                for (int y = 0; y < Objects.requireNonNull(dataSource).size(); y++) {
+                    if (dataSource.get(y) instanceof BasicCourseChangeDto) {
+                        BasicCourseChangeDto basicCourseChangeDto = (BasicCourseChangeDto) dataSource.get(y);
+                        Long id = SystemConstant.convertIdToLong(basicCourseChangeDto.getId());
+
+
+                        List<BasicCourse> basicCourseVerifyList = basicCourseDatasource.stream().filter(e -> e.getId().equals(id)).collect(Collectors.toList());
+                        if (basicCourseVerifyList.size() > 0) {
+                            BasicCourse basicCourse = basicCourseVerifyList.get(0);
+                            Long excelSchoolId = SystemConstant.convertIdToLong(basicCourseChangeDto.getSchoolId());
+                            String courseCode = basicCourseChangeDto.getCourseCode();
+                            String historicName = basicCourseChangeDto.getHistoricName();
+                            String newName = basicCourseChangeDto.getNewName();
+                            if (!SystemConstant.strNotNull(newName)) {
+                                continue;
+                            }
+
+                            // 数据校验
+                            if (!basicCourse.getSchoolId().equals(excelSchoolId) || !basicCourse.getCode().equals(courseCode) || !basicCourse.getName().equals(historicName)) {
+                                throw ExceptionResultEnum.ERROR.exception("第【" + (y + 2) + "】行数据不对应");
+                            }
+                            // 基础数据替换
+                            basicCourse.setName(newName);
+                            basicCourse.setHistoricName(historicName);
+                            updateData.add(basicCourse);
+                        }
+                    }
+                }
+            }
+        }
+        basicCourseService.updateBatchById(updateData);
+        return "'basic_course' 基础课程表完成更新【" + updateData.size() + "】课次";
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public String changeSysOrg(MultipartFile file, Long schoolId) throws IOException, NoSuchFieldException {
+        // 基础机构数据
+        List<SysOrg> sysOrgDatasource = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId));
+        List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(file.getInputStream(), Lists.newArrayList(SysOrgChangeDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
+            if (finalExcelErrorList.size() > 0) {
+                throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(finalExcelErrorList));
+            }
+            return finalExcelList;
+        });
+        List<SysOrg> updateData = new ArrayList<>();
+        Map<String, Integer> nameCheck = new HashMap<>();
+
+        if (Objects.nonNull(finalList) && finalList.size() > 0) {
+            for (int i = 0; i < finalList.size(); i++) {
+                LinkedMultiValueMap<Integer, Object> map = finalList.get(i);
+                List<Object> dataSource = map.get(i);
+                for (int y = 0; y < Objects.requireNonNull(dataSource).size(); y++) {
+                    if (dataSource.get(y) instanceof SysOrgChangeDto) {
+                        SysOrgChangeDto sysOrgChangeDto = (SysOrgChangeDto) dataSource.get(y);
+                        Long id = SystemConstant.convertIdToLong(sysOrgChangeDto.getId());
+
+
+                        List<SysOrg> sysOrgVerifyList = sysOrgDatasource.stream().filter(e -> e.getId().equals(id)).collect(Collectors.toList());
+                        if (sysOrgVerifyList.size() > 0) {
+                            SysOrg sysOrg = sysOrgVerifyList.get(0);
+                            Long excelSchoolId = SystemConstant.convertIdToLong(sysOrgChangeDto.getSchoolId());
+                            String orgCode = sysOrgChangeDto.getOrgCode();
+                            String historicName = sysOrgChangeDto.getHistoricName();
+                            String newName = sysOrgChangeDto.getNewName();
+                            if (!SystemConstant.strNotNull(newName)) {
+                                continue;
+                            }
+
+                            // 数据校验
+                            if (nameCheck.containsKey(newName)) {
+                                throw ExceptionResultEnum.ERROR.exception("第【" + (y + 2) + "】行变更的机构名称【" + newName + "】和第【" + nameCheck.get(newName) + "】行重复");
+                            } else {
+                                nameCheck.put(newName, (y + 2));
+                            }
+                            if (!sysOrg.getSchoolId().equals(excelSchoolId) || !sysOrg.getCode().equals(orgCode) || !sysOrg.getName().equals(historicName)) {
+                                throw ExceptionResultEnum.ERROR.exception("第【" + (y + 2) + "】行数据不对应");
+                            }
+                            // 基础数据替换
+                            sysOrg.setName(newName);
+                            sysOrg.setHistoricName(historicName);
+                            updateData.add(sysOrg);
+                        }
+                    }
+                }
+            }
+        }
+        sysOrgService.updateBatchById(updateData);
+        return "'sys_org' 系统机构表完成更新【" + updateData.size() + "】次";
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public String changeSysUser(MultipartFile file, Long schoolId) throws IOException, NoSuchFieldException {
+        // 基础机构数据
+        List<SysOrg> sysOrgDatasource = sysOrgService.list(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId));
+        // 基础用户数据
+        List<SysUser> sysUserDatasource = sysUserService.list(new QueryWrapper<SysUser>().lambda().eq(SysUser::getSchoolId, schoolId));
+
+        List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(file.getInputStream(), Lists.newArrayList(SysUserChangeDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
+            if (finalExcelErrorList.size() > 0) {
+                throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(finalExcelErrorList));
+            }
+            return finalExcelList;
+        });
+
+        List<SysUser> updateData = new ArrayList<>();
+
+        if (Objects.nonNull(finalList) && finalList.size() > 0) {
+            for (int i = 0; i < finalList.size(); i++) {
+                LinkedMultiValueMap<Integer, Object> map = finalList.get(i);
+                List<Object> dataSource = map.get(i);
+                for (int y = 0; y < Objects.requireNonNull(dataSource).size(); y++) {
+                    if (dataSource.get(y) instanceof SysUserChangeDto) {
+                        SysUserChangeDto sysUserChangeDto = (SysUserChangeDto) dataSource.get(y);
+                        Long id = SystemConstant.convertIdToLong(sysUserChangeDto.getId());
+
+
+                        List<SysUser> sysUserVerifyList = sysUserDatasource.stream().filter(e -> e.getId().equals(id)).collect(Collectors.toList());
+                        if (sysUserDatasource.size() > 0) {
+                            SysUser sysUser = sysUserVerifyList.get(0);
+                            Long excelSchoolId = SystemConstant.convertIdToLong(sysUserChangeDto.getSchoolId());
+                            String historicName = sysUserChangeDto.getHistoricName();
+                            String newName = sysUserChangeDto.getNewName();
+                            if (!SystemConstant.strNotNull(newName)) {
+                                continue;
+                            }
+                            // 如果该用户是机构表中自动创建的考察学院院长用户,则同步更新用户名为机构表名称
+                            List<SysOrg> sysOrgList = sysOrgDatasource.stream().filter(e -> e.getHistoricName().equals(historicName)).collect(Collectors.toList());
+                            if (sysOrgList.size() == 1) {
+                                sysUser.setRealName(sysOrgList.get(0).getName());
+                            } else {
+                                // 数据校验
+                                if (!sysUser.getSchoolId().equals(excelSchoolId) || !sysUser.getRealName().equals(historicName)) {
+                                    throw ExceptionResultEnum.ERROR.exception("第【" + (y + 2) + "】行数据不对应");
+                                }
+                                // 基础数据替换
+                                sysUser.setRealName(newName);
+                            }
+                            sysUser.setHistoricName(historicName);
+                            updateData.add(sysUser);
+                        }
+                    }
+                }
+            }
+        }
+        sysUserService.updateBatchById(updateData);
+        return "'sys_user' 系统用户表完成更新【" + updateData.size() + "】次";
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void createDemoData() {
+        this.changeBasicDataTable();
+        this.changeAnalyzeDataTable();
+    }
+
+    /**
+     * 查询 课程编号 - 课程名称 map
+     *
+     * @return map
+     */
+    private Map<String, String> findCourseMap() {
+        Map<String, String> map = new HashMap<>();
+        for (BasicCourse basicCourse : basicCourseService.list()) {
+            map.put(basicCourse.getCode(), basicCourse.getName());
+        }
+        return map;
+    }
+
+    /**
+     * 查询 机构id - 机构名称 map
+     *
+     * @return map
+     */
+    private Map<Long, String> findOrgMap() {
+        Map<Long, String> map = new HashMap<>();
+        for (SysOrg sysOrg : sysOrgService.list()) {
+            map.put(sysOrg.getId(), sysOrg.getName());
+        }
+        return map;
+    }
+
+    /**
+     * 查询 用户登录名(工号) - 用户真实名
+     *
+     * @return map
+     */
+    private Map<String, String> findUserCodeNameMap() {
+        Map<String, String> map = new HashMap<>();
+        for (SysUser sysUser : sysUserService.list()) {
+            map.put(sysUser.getLoginName(), sysUser.getRealName());
+        }
+        return map;
+    }
+
+    /**
+     * 查询 用户id - 用户真实名
+     *
+     * @return map
+     */
+    private Map<Long, String> findUserIdNameMap() {
+        Map<Long, String> map = new HashMap<>();
+        for (SysUser sysUser : sysUserService.list()) {
+            map.put(sysUser.getId(), sysUser.getRealName());
+        }
+        return map;
+    }
+
+
+    /**
+     * 更新基础数据表
+     */
+    private void changeBasicDataTable() {
+        Map<String, String> courseMap = this.findCourseMap();
+        Map<Long, String> orgMap = this.findOrgMap();
+        Map<String, String> userMap = this.findUserCodeNameMap();
+        // t_b_common_level_config
+        tbCommonLevelConfigService.updateBatchById(tbCommonLevelConfigService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+        // t_b_common_rank_level_config
+        tbCommonRankLevelConfigService.updateBatchById(tbCommonRankLevelConfigService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+        // t_b_dimension
+        tbDimensionService.updateBatchById(tbDimensionService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+        // t_b_exam_course
+        tbExamCourseService.updateBatchById(tbExamCourseService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getTeachCollegeId())) {
+                e.setTeachCollegeName(orgMap.get(e.getTeachCollegeId()));
+            }
+        }).collect(Collectors.toList()));
+        // t_b_exam_student
+        tbExamStudentService.updateBatchById(tbExamStudentService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+        // t_b_module_config
+        tbModuleConfigService.updateBatchById(tbModuleConfigService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+        // t_b_module_proficiency
+        tbModuleProficiencyService.updateBatchById(tbModuleProficiencyService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+        // t_b_paper
+        tbPaperService.updateBatchById(tbPaperService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+        // t_b_teacher
+        tbTeacherService.updateBatchById(tbTeacherService.list().stream().filter(e -> userMap.containsKey(e.getTeacherCode())).peek(e -> e.setTeacherName(userMap.get(e.getTeacherCode()))).collect(Collectors.toList()));
+    }
+
+    /**
+     * 更新分析数据表
+     */
+    public void changeAnalyzeDataTable() {
+        Map<String, String> courseMap = this.findCourseMap();
+        Map<Long, String> orgMap = this.findOrgMap();
+        Map<Long, String> userMap = this.findUserIdNameMap();
+        List<SysOrg> sysOrgList = sysOrgService.list();
+
+        // t_a_exam_course
+        this.complicatedTableTAExamCourseChanged();
+
+        // t_a_exam_course_clazz
+        taExamCourseClazzService.updateBatchById(taExamCourseClazzService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            List<SysOrg> cellList = sysOrgList.stream().filter(o -> o.getHistoricName().equals(e.getCollegeName()) && o.getSchoolId().equals(e.getSchoolId())).collect(Collectors.toList());
+            if (cellList.size() > 1) {
+                throw ExceptionResultEnum.ERROR.exception("数据异常");
+            }
+            if (cellList.size() == 1) {
+                e.setCollegeName(cellList.get(0).getName());
+            }
+        }).collect(Collectors.toList()));
+
+        // t_a_exam_course_college_inspect
+        taExamCourseCollegeInspectService.updateBatchById(taExamCourseCollegeInspectService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+
+        // t_a_exam_course_college_inspect_dio
+        taExamCourseCollegeInspectDioService.updateBatchById(taExamCourseCollegeInspectDioService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getInspectCollegeId())) {
+                e.setInspectCollegeName(orgMap.get(e.getInspectCollegeId()));
+            }
+        }).collect(Collectors.toList()));
+
+        // t_a_exam_course_college_paper_struct
+        taExamCourseCollegePaperStructService.updateBatchById(taExamCourseCollegePaperStructService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getInspectCollegeId())) {
+                e.setInspectCollegeName(orgMap.get(e.getInspectCollegeId()));
+            }
+        }).collect(Collectors.toList()));
+
+        // t_a_exam_course_college_teacher
+        taExamCourseCollegeTeacherService.updateBatchById(taExamCourseCollegeTeacherService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getInspectCollegeId())) {
+                e.setInspectCollegeName(orgMap.get(e.getInspectCollegeId()));
+            }
+            if (orgMap.containsKey(e.getTeachCollegeId())) {
+                e.setTeachCollegeName(orgMap.get(e.getTeachCollegeId()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        // t_a_exam_course_difficult
+        taExamCourseDifficultService.updateBatchById(taExamCourseDifficultService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+
+        // t_a_exam_course_dio
+        taExamCourseDioService.updateBatchById(taExamCourseDioService.list().stream().filter(e -> courseMap.containsKey(e.getCourseCode())).peek(e -> e.setCourseName(courseMap.get(e.getCourseCode()))).collect(Collectors.toList()));
+
+        //t_a_exam_course_record_dio
+        taExamCourseRecordDioService.updateBatchById(taExamCourseRecordDioService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getInspectCollegeId())) {
+                e.setInspectCollegeName(orgMap.get(e.getInspectCollegeId()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_course_record_mod
+        taExamCourseRecordModService.updateBatchById(taExamCourseRecordModService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getInspectCollegeId())) {
+                e.setInspectCollegeName(orgMap.get(e.getInspectCollegeId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_course_teacher
+        taExamCourseTeacherService.updateBatchById(taExamCourseTeacherService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_course_teacher_college_difficult
+        taExamCourseTeacherCollegeDifficultService.updateBatchById(taExamCourseTeacherCollegeDifficultService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getInspectCollegeId())) {
+                e.setInspectCollegeName(orgMap.get(e.getInspectCollegeId()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_course_teacher_college_dio
+        taExamCourseTeacherCollegeDioService.updateBatchById(taExamCourseTeacherCollegeDioService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getInspectCollegeId())) {
+                e.setInspectCollegeName(orgMap.get(e.getInspectCollegeId()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_course_teacher_college_paper_struct
+        taExamCourseTeacherCollegePaperStructService.updateBatchById(taExamCourseTeacherCollegePaperStructService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (orgMap.containsKey(e.getInspectCollegeId())) {
+                e.setInspectCollegeName(orgMap.get(e.getInspectCollegeId()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_course_teacher_difficult
+        taExamCourseTeacherDifficultService.updateBatchById(taExamCourseTeacherDifficultService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_course_teacher_dio
+        taExamCourseTeacherDioService.updateBatchById(taExamCourseTeacherDioService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_course_teacher_paper_struct
+        taExamCourseTeacherPaperStructService.updateBatchById(taExamCourseTeacherPaperStructService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+            if (userMap.containsKey(e.getTeacherId())) {
+                e.setTeacherName(userMap.get(e.getTeacherId()));
+            }
+        }).collect(Collectors.toList()));
+
+        //t_a_exam_total
+        this.complicatedTableTAExamTotalChanged();
+
+        //t_a_paper_struct
+        taPaperStructService.updateBatchById(taPaperStructService.list().stream().peek(e -> {
+            if (courseMap.containsKey(e.getCourseCode())) {
+                e.setCourseName(courseMap.get(e.getCourseCode()));
+            }
+        }).collect(Collectors.toList()));
+
+    }
+
+    /**
+     * 复杂表 't_a_exam_course' 创建
+     */
+    private void complicatedTableTAExamCourseChanged() {
+        Map<String, String> courseMap = this.findCourseMap();
+        Map<Long, String> orgMap = this.findOrgMap();
+        List<SysOrg> sysOrgList = sysOrgService.list();
+
+        List<TAExamCourse> taExamCourseList = taExamCourseService.list();
+        for (TAExamCourse taExamCourse : taExamCourseList) {
+            Long schoolId = taExamCourse.getSchoolId();
+
+            if (courseMap.containsKey(taExamCourse.getCourseCode())) {
+                taExamCourse.setCourseName(courseMap.get(taExamCourse.getCourseCode()));
+            }
+            if (orgMap.containsKey(taExamCourse.getTeachCollegeId())) {
+                taExamCourse.setTeachCollegeName(orgMap.get(taExamCourse.getTeachCollegeId()));
+            }
+            String inspectCollegeNameStr = taExamCourse.getInspectCollegeNames();
+            List<String> newInspect = new ArrayList<>();
+            String[] inspectCollegeNameList = inspectCollegeNameStr.split("、");
+            for (String s : inspectCollegeNameList) {
+                List<SysOrg> cellList = sysOrgList.stream().filter(e -> e.getHistoricName().equals(s) && e.getSchoolId().equals(schoolId)).collect(Collectors.toList());
+                if (cellList.size() > 0) {
+                    if (cellList.size() > 1) {
+                        throw ExceptionResultEnum.ERROR.exception("数据异常");
+                    }
+                    SysOrg cell = cellList.get(0);
+                    newInspect.add(cell.getName());
+                }
+            }
+            if (newInspect.size() > 0) {
+                taExamCourse.setInspectCollegeNames(String.join("、", newInspect));
+            }
+        }
+        taExamCourseService.updateBatchById(taExamCourseList);
+    }
+
+    /**
+     * 复杂表 't_a_exam_total' 创建
+     */
+    private void complicatedTableTAExamTotalChanged() {
+        List<SysOrg> sysOrgList = sysOrgService.list();
+        List<TAExamTotal> taExamTotalList = taExamTotalService.list();
+        for (TAExamTotal taExamTotal : taExamTotalList) {
+            String collegeNameStr = taExamTotal.getCollegeNames();
+            List<String> newCollegeList = new ArrayList<>();
+            String[] collegeNameList = collegeNameStr.split("、");
+            for (String s : collegeNameList) {
+                List<SysOrg> cellList = sysOrgList.stream().filter(e -> e.getHistoricName().equals(s) && e.getSchoolId().equals(taExamTotal.getSchoolId())).collect(Collectors.toList());
+                if (cellList.size() > 0) {
+                    if (cellList.size() > 1) {
+                        throw ExceptionResultEnum.ERROR.exception("数据异常");
+                    }
+                    SysOrg cell = cellList.get(0);
+                    newCollegeList.add(cell.getName());
+                }
+            }
+            if (newCollegeList.size() > 0) {
+                taExamTotal.setCollegeNames(String.join("、", newCollegeList));
+            }
+        }
+    }
+}

+ 12 - 12
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/BasicDatasourceController.java

@@ -611,12 +611,12 @@ public class BasicDatasourceController {
 
         Map<String, TBStudent> checkMap = new HashMap<>();
         for (Map map : finalList) {
-            String subjectCode = (String) map.get(ExamCloudDataEnum.SUBJECT_CODE.getName()); //科目代码
-            String subjectName = (String) map.get(ExamCloudDataEnum.SUBJECT_NAME.getName()); //科目名称
-            String examNumber = (String) map.get(ExamCloudDataEnum.EXAM_NUMBER.getName()); //准考证号
-            String studentCode = (String) map.get(ExamCloudDataEnum.STUDENT_CODE.getName()); //学号
-            String name = (String) map.get(ExamCloudDataEnum.NAME.getName()); //名称
-            String paperType = (String) map.get(ExamCloudDataEnum.PAPER_TYPE.getName()); //试卷类型
+            String subjectCode = String.valueOf(map.get(ExamCloudDataEnum.SUBJECT_CODE.getName())); //科目代码
+            String subjectName = String.valueOf(map.get(ExamCloudDataEnum.SUBJECT_NAME.getName())); //科目名称
+            String examNumber = String.valueOf(map.get(ExamCloudDataEnum.EXAM_NUMBER.getName())); //准考证号
+            String studentCode = String.valueOf(map.get(ExamCloudDataEnum.STUDENT_CODE.getName())); //学号
+            String name = String.valueOf(map.get(ExamCloudDataEnum.NAME.getName())); //名称
+            String paperType = String.valueOf(map.get(ExamCloudDataEnum.PAPER_TYPE.getName())); //试卷类型
             // 循环依次为#生成(分配)试卷编号为A、B、C......A、B、C......
             if (count > 0 && paperType.equals(specialPaperType)) {
                 paperType = paperTypeList.get(i);
@@ -626,17 +626,17 @@ public class BasicDatasourceController {
                 }
             }
 
-            String college = (String) map.get(ExamCloudDataEnum.COLLEGE.getName()); //学院
-            String className = (String) map.get(ExamCloudDataEnum.CLASS_NAME.getName()); //班级名称
-            String teacher = (String) map.get(ExamCloudDataEnum.TEACHER.getName()); //教师
+            String college = String.valueOf(map.get(ExamCloudDataEnum.COLLEGE.getName())); //学院
+            String className = String.valueOf(map.get(ExamCloudDataEnum.CLASS_NAME.getName())); //班级名称
+            String teacher = String.valueOf(map.get(ExamCloudDataEnum.TEACHER.getName())); //教师
             Map<String, String> teacherMap = this.disposeTeacherInfo(teacher);
             String teacherName = teacherMap.get("teacherName");
             String teacherCode = teacherMap.get("teacherCode");
             // 缺考状态 2 -> 缺考 ; 3 -> 违纪
             int status = (int) map.get(ExamCloudDataEnum.STATUS.getName()); //学生考试状态
-            String totalScore = (String) map.get(ExamCloudDataEnum.TOTAL_SCORE.getName()); //考生总分
-            String objectiveScore = (String) map.get(ExamCloudDataEnum.OBJECTIVE_SCORE.getName()); //客观题总分
-            String subjectiveScore = (String) map.get(ExamCloudDataEnum.SUBJECTIVE_SCORE.getName()); //主观题总分
+            String totalScore = String.valueOf(map.get(ExamCloudDataEnum.TOTAL_SCORE.getName())); //考生总分
+            String objectiveScore = String.valueOf(map.get(ExamCloudDataEnum.OBJECTIVE_SCORE.getName())); //客观题总分
+            String subjectiveScore = String.valueOf(map.get(ExamCloudDataEnum.SUBJECTIVE_SCORE.getName())); //主观题总分
             List<Map<Object, Object>> objectiveScoreDetailList = (List<Map<Object, Object>>) map.get(ExamCloudDataEnum.OBJECTIVE_SCORE_DETAIL.getName()); //客观题明细
             List<Map<Object, Object>> subjectiveScoreDetailList = (List<Map<Object, Object>>) map.get(ExamCloudDataEnum.SUBJECTIVE_SCORE_DETAIL.getName()); //主观题答题明细
 

+ 88 - 0
teachcloud-report/src/test/java/com/qmth/teachcloud/report/report/CourseUnitOperateServiceTest.java

@@ -0,0 +1,88 @@
+package com.qmth.teachcloud.report.report;
+
+import com.qmth.teachcloud.report.TeachcloudReportApplication;
+import com.qmth.teachcloud.report.business.service.CourseUnitOperateService;
+import org.apache.commons.io.IOUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.mock.web.MockMultipartFile;
+import org.springframework.scheduling.annotation.Async;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+
+/**
+ * @Description: 课程单元演示制作测试类
+ * @Author: CaoZixuan
+ * @Date: 2022-03-01
+ */
+@SpringBootTest(classes = {TeachcloudReportApplication.class})
+@RunWith(SpringRunner.class)
+public class CourseUnitOperateServiceTest {
+    @Resource
+    private CourseUnitOperateService courseUnitOperateService;
+
+    private MultipartFile transferFtoM(File file) throws IOException {
+        FileInputStream input = new FileInputStream(file);
+        return new MockMultipartFile("file", file.getName(), "text/plain", IOUtils.toByteArray(input));
+    }
+
+    @Test
+    public void testChangeBasicCourse() throws IOException, NoSuchFieldException {
+        File file = new File("C:\\Users\\ASUS\\Desktop\\教研分析演示文件\\基础课程文件.xlsx");
+        MultipartFile m = this.transferFtoM(file);
+        Long schoolId = 2L;
+        System.out.println(courseUnitOperateService.changeBasicCourse(m, schoolId));
+    }
+
+    @Test
+    public void testChangeSysOrg() throws IOException, NoSuchFieldException {
+        File file = new File("C:\\Users\\ASUS\\Desktop\\教研分析演示文件\\机构文件.xlsx");
+        MultipartFile m = this.transferFtoM(file);
+        Long schoolId = 2L;
+        System.out.println(courseUnitOperateService.changeSysOrg(m, schoolId));
+    }
+
+    @Test
+    public void testChangeSysUser() throws IOException, NoSuchFieldException {
+        File file = new File("C:\\Users\\ASUS\\Desktop\\教研分析演示文件\\用户文件.xlsx");
+        MultipartFile m = this.transferFtoM(file);
+        Long schoolId = 2L;
+        System.out.println(courseUnitOperateService.changeSysUser(m, schoolId));
+    }
+
+    @Test
+    public void testCreateDemoData() {
+        courseUnitOperateService.createDemoData();
+    }
+
+    @Async
+    public void sout10() throws InterruptedException {
+        for (int i = 0; i < 10; i++) {
+            System.out.println(10);
+            Thread.sleep(10);
+        }
+    }
+
+    @Async
+    public void sout20() throws InterruptedException {
+        for (int i = 0; i < 10; i++) {
+            System.out.println(20);
+            Thread.sleep(10);
+        }
+    }
+
+    @Test
+    public void soutTest() throws InterruptedException {
+        Long b = System.currentTimeMillis();
+        this.sout10();
+        this.sout20();
+        Long e = System.currentTimeMillis();
+        System.out.println(e - b);
+    }
+}