diff --git a/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java b/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java index 78dd0b3..83a3ff9 100644 --- a/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java +++ b/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java @@ -103,7 +103,7 @@ public class ExcelImportHelper { if (hssfSheet == null) { continue; } - int lastRowNum = hssfSheet.getLastRowNum(); + int lastRowNum = hssfSheet.getLastRowNum()+1;//最后一行行标,比行数小1 if (lastRowNum==2){ break; } @@ -190,11 +190,11 @@ public class ExcelImportHelper { String str; // 角色id if (roleValue.equals("管理员")){ - str = "2"; + str = "13";//2 }else if (roleValue.equals("老师")){ - str = "3"; + str = "14";//3 }else{ - str = "2,3"; + str = "13,14"; } staff.setRoleId(str); //角色名称 diff --git a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java index 0c7db4e..e620417 100644 --- a/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java @@ -319,7 +319,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService { for (String str : split) { s=s+str; } - if (s.indexOf("2")!=-1){ + if (s.indexOf("13")!=-1){//2 if (architectureName!=null&&architectureName!=""){ if (gradeName==null|gradeName==""){ StaffExportVo vo = new StaffExportVo(); @@ -353,7 +353,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService { } } } - if (s.indexOf("3")!=-1){ + if (s.indexOf("14")!=-1){//3 if (architectureNameTwo!=null&&architectureNameTwo!=""){ if (gradeNameTwo==null|gradeNameTwo==""){ StaffExportVo vo = new StaffExportVo(); @@ -390,13 +390,13 @@ public class SystemSettingServiceImpl implements SystemSetttingService { userInfoDao.addUserinfo(staffVo); for (String str : split){ - if (Integer.parseInt(str)==2){ + if (Integer.parseInt(str)==13){//2 Integer organizationId = systemSetttingDao.queryDepartmentNameOrganization(staffVo.getStaffProfessionalArchitectureName(),ConstantUtils.Keda_schoolId); Integer gradeId = systemSetttingDao.queryDepartmentNameGrade(staffVo.getStaffGradeName(),organizationId); staffVo.setStaffGradeId(gradeId).setStaffProfessionalArchitectureId(organizationId); boolean b = systemSetttingDao.addStaffManager(staffVo); if(!b){throw new RuntimeException();} - }else if (Integer.parseInt(str)==3){ + }else if (Integer.parseInt(str)==14){//3 Integer organizationId = systemSetttingDao.queryDepartmentNameOrganization(staffVo.getStaffProfessionalArchitectureNameTwo(),ConstantUtils.Keda_schoolId); Integer gradeId = systemSetttingDao.queryDepartmentNameGrade(staffVo.getStaffGradeNameTwo(),organizationId); staffVo.setStaffGradeId(gradeId).setStaffProfessionalArchitectureId(organizationId); diff --git a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml index 8c28e2e..81b68a9 100644 --- a/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml +++ b/src/main/resources/mapper/tms/ExperimentalTeachingDao.xml @@ -103,7 +103,7 @@ AND DATE_SUB(CURDATE(), INTERVAL #{exp.month} month ) <= date(creation_time) - AND (user_id in (select userId FROM staff WHERE schoolId = #{exp.schoolId} AND isdel = 0 AND FIND_IN_SET(roleId,'1,2,3') ) + AND (user_id in (select userId FROM staff WHERE schoolId = #{exp.schoolId} AND isdel = 0 AND FIND_IN_SET(roleId,'1,13,14') ) OR user_id IN ( SELECT userId FROM hr_user_info WHERE disableAccount = 0 AND isdel = 0 AND FIND_IN_SET( roleId, '1' ) ) ) order by creation_time desc diff --git a/src/test/java/com/msdw/tms/Main.java b/src/test/java/com/msdw/tms/Main.java index ca7a67a..1740575 100644 --- a/src/test/java/com/msdw/tms/Main.java +++ b/src/test/java/com/msdw/tms/Main.java @@ -3,15 +3,13 @@ package com.msdw.tms; import com.msdw.tms.entity.ProjectEntity; import org.springframework.util.StringUtils; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; +import java.util.*; public class Main { public static void main(String[] args) { - List project = new ArrayList<>(); + /*List project = new ArrayList<>(); ProjectEntity p1 = new ProjectEntity(); p1.setProjectid(1); p1.setProjectname("1"); @@ -38,7 +36,23 @@ public class Main { for (ProjectEntity pro:project) { System.out.println(pro); - } + }*/ + List list = new ArrayList<>(); + for (int i = 0; i < 1000; i++) { + list.add(i + ""); + } + Set set = new HashSet<>(); + Random random = new Random(); + int i; + while (true) { + i = random.nextInt(list.size()); + set.add(list.get(i)); + if (set.size() >= 100000) { + break; + } + } + + System.out.println(111); } }