@ -72,78 +72,100 @@ import static com.ibeetl.jlw.web.IpAddressController.ipAddressMap;
@Transactional
@Transactional
public class TeacherService extends CoreBaseService < Teacher > {
public class TeacherService extends CoreBaseService < Teacher > {
@Autowired private TeacherDao teacherDao ;
@Autowired
private TeacherDao teacherDao ;
@Autowired private CorePlatformService platformService ;
@Autowired
private CorePlatformService platformService ;
@Autowired private UserConsoleService userConsoleService ;
@Autowired
private UserConsoleService userConsoleService ;
@Autowired private CoreUserRoleDao coreUserRoleDao ;
@Autowired
private CoreUserRoleDao coreUserRoleDao ;
@Autowired private UniversitiesCollegesService universitiesCollegesService ;
@Autowired
@Autowired private UniversitiesCollegesDao universitiesCollegesDao ;
private UniversitiesCollegesService universitiesCollegesService ;
@Autowired
private UniversitiesCollegesDao universitiesCollegesDao ;
@Autowired private StudentService studentService ;
@Autowired
private StudentService studentService ;
@Lazy
@Lazy
@Autowired private TeacherService teacherService ;
@Autowired
private TeacherService teacherService ;
@Autowired private CompetitionTeacherEvaluationService competitionTeacherEvaluationService ;
@Autowired
@Autowired private CompetitionService competitionService ;
private CompetitionTeacherEvaluationService competitionTeacherEvaluationService ;
@Autowired private CompetitionStudentsService competitionStudentsService ;
@Autowired private CompetitionTaskOneQuestionService competitionTaskOneQuestionService ;
@Autowired
@Autowired private CompetitionTaskSecondQuestionService competitionTaskSecondQuestionService ;
private CompetitionService competitionService ;
@Autowired private CompetitionTaskSecondQuestionStepService competitionTaskSecondQuestionStepService ;
@Autowired
private CompetitionStudentsService competitionStudentsService ;
@Autowired private ExamService examService ;
@Autowired
@Autowired private ExamStudentsService examStudentsService ;
private CompetitionTaskOneQuestionService competitionTaskOneQuestionService ;
@Autowired private ExamTaskOneQuestionService examTaskOneQuestionService ;
@Autowired
@Autowired private ExamTaskSecondQuestionService examTaskSecondQuestionService ;
private CompetitionTaskSecondQuestionService competitionTaskSecondQuestionService ;
@Autowired private ExamTaskSecondQuestionStepService examTaskSecondQuestionStepService ;
@Autowired
@Autowired private ExamTaskThreeQuestionService examTaskThreeQuestionService ;
private CompetitionTaskSecondQuestionStepService competitionTaskSecondQuestionStepService ;
@Autowired private ExamTaskThreeQuestionStepService examTaskThreeQuestionStepService ;
@Autowired
private ExamService examService ;
@Autowired
private ExamStudentsService examStudentsService ;
@Autowired
private ExamTaskOneQuestionService examTaskOneQuestionService ;
@Autowired
private ExamTaskSecondQuestionService examTaskSecondQuestionService ;
@Autowired
private ExamTaskSecondQuestionStepService examTaskSecondQuestionStepService ;
@Autowired
private ExamTaskThreeQuestionService examTaskThreeQuestionService ;
@Autowired
private ExamTaskThreeQuestionStepService examTaskThreeQuestionStepService ;
@Autowired
@Autowired
private WebPlatformService webPlatformService ;
private WebPlatformService webPlatformService ;
public PageQuery < Teacher > queryByCondition ( PageQuery query ) {
public PageQuery < Teacher > queryByCondition( PageQuery query ) {
PageQuery ret = teacherDao . queryByCondition ( query ) ;
PageQuery ret = teacherDao . queryByCondition ( query ) ;
queryListAfter ( ret . getList ( ) ) ;
queryListAfter ( ret . getList ( ) ) ;
return ret ;
return ret ;
}
}
public PageQuery < Teacher > queryLogByCondition ( PageQuery query ) {
public PageQuery < Teacher > queryLogByCondition( PageQuery query ) {
PageQuery ret = teacherDao . queryByCondition ( query ) ;
PageQuery ret = teacherDao . queryByCondition ( query ) ;
queryListAfter ( ret . getList ( ) ) ;
queryListAfter ( ret . getList ( ) ) ;
String teacherIds = "" ;
String teacherIds = "" ;
List < Teacher > teacherList = ret . getList ( ) ;
List < Teacher > teacherList = ret . getList ( ) ;
for ( int i = 0 ; i < teacherList . size ( ) ; i + + ) {
for ( int i = 0 ; i < teacherList . size ( ) ; i + + ) {
teacherIds + = teacherList . get ( i ) . getTeacherId ( ) + "," ;
teacherIds + = teacherList . get ( i ) . getTeacherId ( ) + "," ;
}
}
Map < String , List < Teacher > > groupByTeacherId = CacheLogJob . teacherLogMap ;
Map < String , List < Teacher > > groupByTeacherId = CacheLogJob . teacherLogMap ;
if ( ( null = = groupByTeacherId | | groupByTeacherId . size ( ) = = 0 ) & & StringUtils . isNotBlank ( teacherIds ) ) {
if ( ( null = = groupByTeacherId | | groupByTeacherId . size ( ) = = 0 ) & & StringUtils . isNotBlank ( teacherIds ) ) {
TeacherQuery teacherQuery = new TeacherQuery ( ) ;
TeacherQuery teacherQuery = new TeacherQuery ( ) ;
teacherQuery . setTeacherIds ( teacherIds ) ;
teacherQuery . setTeacherIds ( teacherIds ) ;
List < Teacher > teacherLogList = getTeacherLog ( teacherQuery ) ;
List < Teacher > teacherLogList = getTeacherLog ( teacherQuery ) ;
try {
try {
groupByTeacherId = teacherLogList . stream ( ) . collect ( Collectors . groupingBy ( e - > ( null ! = e . get ( "platform" ) & & StringUtils . isNotBlank ( e . get ( "platform" ) . toString ( ) ) ? e . get ( "platform" ) . toString ( ) : "null" ) + e . getTeacherId ( ) ) ) ;
groupByTeacherId = teacherLogList . stream ( ) . collect ( Collectors . groupingBy ( e - > ( null ! = e . get ( "platform" ) & & StringUtils . isNotBlank ( e . get ( "platform" ) . toString ( ) ) ? e . get ( "platform" ) . toString ( ) : "null" ) + e . getTeacherId ( ) ) ) ;
} catch ( Exception e ) { }
} catch ( Exception e ) {
}
}
}
if ( null ! = groupByTeacherId ) {
if ( null ! = groupByTeacherId ) {
for ( int i = 0 ; i < teacherList . size ( ) ; i + + ) {
for ( int i = 0 ; i < teacherList . size ( ) ; i + + ) {
List < Teacher > teacherLogList = groupByTeacherId . get ( ( null ! = teacherList . get ( i ) . get ( "platform" ) & & StringUtils . isNotBlank ( teacherList . get ( i ) . get ( "platform" ) . toString ( ) ) ? teacherList . get ( i ) . get ( "platform" ) . toString ( ) : "null" ) + teacherList . get ( i ) . getTeacherId ( ) ) ;
List < Teacher > teacherLogList = groupByTeacherId . get ( ( null ! = teacherList . get ( i ) . get ( "platform" ) & & StringUtils . isNotBlank ( teacherList . get ( i ) . get ( "platform" ) . toString ( ) ) ? teacherList . get ( i ) . get ( "platform" ) . toString ( ) : "null" ) + teacherList . get ( i ) . getTeacherId ( ) ) ;
if ( null ! = teacherLogList & & teacherLogList . size ( ) > 0 ) {
if ( null ! = teacherLogList & & teacherLogList . size ( ) > 0 ) {
Teacher teacherLog = teacherLogList . get ( 0 ) ;
Teacher teacherLog = teacherLogList . get ( 0 ) ;
teacherList . get ( i ) . set ( "lastLoginTime" , teacherLog . get ( "lastLoginTime" ) ) ;
teacherList . get ( i ) . set ( "lastLoginTime" , teacherLog . get ( "lastLoginTime" ) ) ;
teacherList . get ( i ) . set ( "onlineDuration" , TimeTool . diffTime ( teacherLog . get ( "lastLoginTime" ) , teacherLog . get ( "lastOperateTime" ) ) ) ;
teacherList . get ( i ) . set ( "onlineDuration" , TimeTool . diffTime ( teacherLog . get ( "lastLoginTime" ) , teacherLog . get ( "lastOperateTime" ) ) ) ;
teacherList . get ( i ) . set ( "ip" , teacherLog . get ( "ip" ) ) ;
teacherList . get ( i ) . set ( "ip" , teacherLog . get ( "ip" ) ) ;
IpAddress ipAddress = null ! = teacherLog . get ( "ip" ) & & StringUtils . isNotBlank ( teacherLog . get ( "ip" ) . toString ( ) ) ? ipAddressMap . get ( teacherLog . get ( "ip" ) . toString ( ) ) : null ;
IpAddress ipAddress = null ! = teacherLog . get ( "ip" ) & & StringUtils . isNotBlank ( teacherLog . get ( "ip" ) . toString ( ) ) ? ipAddressMap . get ( teacherLog . get ( "ip" ) . toString ( ) ) : null ;
teacherList . get ( i ) . set ( "ipAddress" , null ! = ipAddress ? ( ipAddress . getProvince ( ) + ipAddress . getCity ( ) + ipAddress . getDistrict ( ) ) : null ) ; //IP地址
teacherList . get ( i ) . set ( "ipAddress" , null ! = ipAddress ? ( ipAddress . getProvince ( ) + ipAddress . getCity ( ) + ipAddress . getDistrict ( ) ) : null ) ; //IP地址
} else {
} else {
teacherList . get ( i ) . set ( "lastLoginTime" , RandomUtil . randomDay ( - 20 , - 1 ) ) ;
teacherList . get ( i ) . set ( "lastLoginTime" , RandomUtil . randomDay ( - 20 , - 1 ) ) ;
teacherList . get ( i ) . set ( "onlineDuration" , RandomUtil . randomNumber ( ) ) ;
teacherList . get ( i ) . set ( "onlineDuration" , RandomUtil . randomNumber ( ) ) ;
teacherList . get ( i ) . set ( "ip" , "127.0.0.1" ) ;
teacherList . get ( i ) . set ( "ip" , "127.0.0.1" ) ;
@ -151,7 +173,7 @@ public class TeacherService extends CoreBaseService<Teacher> {
}
}
}
}
if ( CollectionUtils . isNotEmpty ( teacherList ) ) {
if ( CollectionUtils . isNotEmpty ( teacherList ) ) {
teacherList = teacherList . stream ( ) . sorted ( Comparator . comparing ( v - > ( Date ) v . get ( "lastLoginTime" ) ) ) . collect ( Collectors . toList ( ) ) ;
teacherList = teacherList . stream ( ) . sorted ( Comparator . comparing ( v - > ( Date ) v . get ( "lastLoginTime" ) ) ) . collect ( Collectors . toList ( ) ) ;
Collections . reverse ( teacherList ) ;
Collections . reverse ( teacherList ) ;
ret . setList ( teacherList ) ;
ret . setList ( teacherList ) ;
}
}
@ -160,11 +182,11 @@ public class TeacherService extends CoreBaseService<Teacher> {
return ret ;
return ret ;
}
}
public void deleteTeacher ( String ids ) {
public void deleteTeacher ( String ids ) {
String userIds = "" ;
String userIds = "" ;
List < Teacher > teacherList = teacherDao . getByIds ( ids ) ;
List < Teacher > teacherList = teacherDao . getByIds ( ids ) ;
for ( int i = 0 ; i < teacherList . size ( ) ; i + + ) {
for ( int i = 0 ; i < teacherList . size ( ) ; i + + ) {
userIds + = teacherList . get ( i ) . getUserId ( ) + "," ;
userIds + = teacherList . get ( i ) . getUserId ( ) + "," ;
}
}
@ -175,24 +197,24 @@ public class TeacherService extends CoreBaseService<Teacher> {
}
}
public void deleteByList ( List list ) {
public void deleteByList ( List list ) {
String ids = "" ;
String ids = "" ;
for ( int i = 0 ; null ! = list & & i < list . size ( ) ; i + + ) {
for ( int i = 0 ; null ! = list & & i < list . size ( ) ; i + + ) {
ids + = list . get ( i ) . toString ( ) + "," ;
ids + = list . get ( i ) . toString ( ) + "," ;
}
}
if ( StringUtils . isNotBlank ( ids ) ) {
if ( StringUtils . isNotBlank ( ids ) ) {
teacherDao . deleteByIds ( ids ) ;
teacherDao . deleteByIds ( ids ) ;
}
}
}
}
public List < Teacher > getTeacherLog ( TeacherQuery teacherQuery ) {
public List < Teacher > getTeacherLog ( TeacherQuery teacherQuery ) {
return teacherDao . getTeacherLog ( teacherQuery ) ;
return teacherDao . getTeacherLog ( teacherQuery ) ;
}
}
public List < Map < String , Object > > getStatisticsLog ( ) {
public List < Map < String , Object > > getStatisticsLog ( ) {
List < Map < String , Object > > statisticsLogList = CacheLogJob . statisticsLogList ;
List < Map < String , Object > > statisticsLogList = CacheLogJob . statisticsLogList ;
if ( null = = statisticsLogList | | statisticsLogList . size ( ) = = 0 ) {
if ( null = = statisticsLogList | | statisticsLogList . size ( ) = = 0 ) {
statisticsLogList = teacherDao . getStatisticsLog ( ) ;
statisticsLogList = teacherDao . getStatisticsLog ( ) ;
}
}
for ( Map < String , Object > stringObjectMap : statisticsLogList ) {
for ( Map < String , Object > stringObjectMap : statisticsLogList ) {
@ -213,19 +235,27 @@ public class TeacherService extends CoreBaseService<Teacher> {
return statisticsLogList ;
return statisticsLogList ;
}
}
public Teacher getByUserId ( Long userId ) {
public Teacher getByUserId ( Long userId ) {
return teacherDao . getByUserId ( userId ) ;
return teacherDao . getByUserId ( userId ) ;
}
}
public String getIdsByQuery ( TeacherQuery teacherQuery ) {
public String getIdsByQuery ( TeacherQuery teacherQuery ) {
return teacherDao . getIdsByQuery ( teacherQuery ) ;
return teacherDao . getIdsByQuery ( teacherQuery ) ;
}
}
public JsonResult add ( Teacher teacher ) {
public Teacher getByTeacherJobNameAndOrgId ( String teacherJobName , Long orgId ) {
List < Teacher > teachers = teacherDao . getByTeacherJobNameAndOrgId ( teacherJobName , orgId ) ;
if ( teachers ! = null & & teachers . size ( ) > 0 ) {
return teachers . get ( 0 ) ;
}
return null ;
}
public JsonResult add ( Teacher teacher ) {
Date date = new Date ( ) ;
Date date = new Date ( ) ;
teacher . setTeacherPassword ( StringUtils . isNotBlank ( teacher . getTeacherPassword ( ) ) ? teacher . getTeacherPassword ( ) : "123qwe" ) ;
teacher . setTeacherPassword ( StringUtils . isNotBlank ( teacher . getTeacherPassword ( ) ) ? teacher . getTeacherPassword ( ) : "123qwe" ) ;
teacher . setAddTime ( date ) ;
teacher . setAddTime ( date ) ;
teacher . setTeacherStatus ( 1 ) ;
teacher . setTeacherStatus ( 1 ) ;
this . save ( teacher ) ;
this . save ( teacher ) ;
@ -258,13 +288,13 @@ public class TeacherService extends CoreBaseService<Teacher> {
}
}
public Boolean edit ( Teacher teacher ) {
public Boolean edit ( Teacher teacher ) {
this . updateTemplate ( teacher ) ;
this . updateTemplate ( teacher ) ;
teacher = this . queryById ( teacher . getTeacherId ( ) ) ;
teacher = this . queryById ( teacher . getTeacherId ( ) ) ;
String code = teacher . createCode ( ) ; //TODO 可改规则
String code = teacher . createCode ( ) ; //TODO 可改规则
if ( ! platformService . isAllowUserCode ( teacher . getUserId ( ) , code ) ) {
if ( ! platformService . isAllowUserCode ( teacher . getUserId ( ) , code ) ) {
throw new PlatformException ( "不允许的注册账号 " + code ) ;
throw new PlatformException ( "不允许的注册账号 " + code ) ;
}
}
CoreUser coreUser = new CoreUser ( ) ;
CoreUser coreUser = new CoreUser ( ) ;
@ -280,7 +310,7 @@ public class TeacherService extends CoreBaseService<Teacher> {
}
}
public Boolean initPassword ( Teacher teacher ) {
public Boolean initPassword ( Teacher teacher ) {
Teacher t = this . queryById ( teacher . getTeacherId ( ) ) ;
Teacher t = this . queryById ( teacher . getTeacherId ( ) ) ;
CoreUser coreUser = new CoreUser ( ) ;
CoreUser coreUser = new CoreUser ( ) ;
@ -292,18 +322,18 @@ public class TeacherService extends CoreBaseService<Teacher> {
return true ;
return true ;
}
}
public JsonResult importTemplate ( FileEntity fileEntity , List < Long > list ) {
public JsonResult importTemplate ( FileEntity fileEntity , List < Long > list ) {
if ( null ! = fileEntity ) {
if ( null ! = fileEntity ) {
File file = new File ( fileEntity . getAbsoluteUrl ( ) ) ;
File file = new File ( fileEntity . getAbsoluteUrl ( ) ) ;
if ( file . exists ( ) & & file . isFile ( ) & & file . canRead ( ) & & ToolUtils . findInSet ( "xls,xlsx" , fileEntity . getFormat ( ) ) ) {
if ( file . exists ( ) & & file . isFile ( ) & & file . canRead ( ) & & ToolUtils . findInSet ( "xls,xlsx" , fileEntity . getFormat ( ) ) ) {
Workbook wb = null ;
Workbook wb = null ;
InputStream is = null ;
InputStream is = null ;
try {
try {
is = new FileInputStream ( fileEntity . getAbsoluteUrl ( ) ) ;
is = new FileInputStream ( fileEntity . getAbsoluteUrl ( ) ) ;
if ( "xls" . equals ( fileEntity . getFormat ( ) ) ) {
if ( "xls" . equals ( fileEntity . getFormat ( ) ) ) {
wb = new HSSFWorkbook ( is ) ;
wb = new HSSFWorkbook ( is ) ;
} else if ( "xlsx" . equals ( fileEntity . getFormat ( ) ) ) {
} else if ( "xlsx" . equals ( fileEntity . getFormat ( ) ) ) {
wb = new XSSFWorkbook ( is ) ;
wb = new XSSFWorkbook ( is ) ;
}
}
} catch ( FileNotFoundException e ) {
} catch ( FileNotFoundException e ) {
@ -312,16 +342,16 @@ public class TeacherService extends CoreBaseService<Teacher> {
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
try {
try {
if ( null ! = is ) {
if ( null ! = is ) {
is . close ( ) ;
is . close ( ) ;
}
}
} catch ( Exception e ) {
} catch ( Exception e ) {
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
if ( wb ! = null ) {
if ( wb ! = null ) {
List < String [ ] > errMsg = new ArrayList < > ( ) ;
List < String [ ] > errMsg = new ArrayList < > ( ) ;
String msg = "" ;
String msg = "" ;
//获取Sheet1
//获取Sheet1
Sheet sheet = wb . getSheet ( "Sheet1" ) ;
Sheet sheet = wb . getSheet ( "Sheet1" ) ;
@ -332,28 +362,28 @@ public class TeacherService extends CoreBaseService<Teacher> {
//获取最大列数
//获取最大列数
int colNum = firstRow . getPhysicalNumberOfCells ( ) ;
int colNum = firstRow . getPhysicalNumberOfCells ( ) ;
String [ ] columns = { "院校名称" , "教师姓名" , "工号" , "电话" , "邮箱" } ;
String [ ] columns = { "院校名称" , "教师姓名" , "工号" , "电话" , "邮箱" } ;
Map < String , Integer > map = new HashMap < > ( ) ; //获取需要的表头的列
Map < String , Integer > map = new HashMap < > ( ) ; //获取需要的表头的列
//从第一列找到需要的表头
//从第一列找到需要的表头
for ( int i = 0 ; i < colNum ; i + + ) {
for ( int i = 0 ; i < colNum ; i + + ) {
String cellData = getCellFormatValue ( firstRow . getCell ( i ) ) ;
String cellData = getCellFormatValue ( firstRow . getCell ( i ) ) ;
for ( int j = 0 ; j < columns . length ; j + + ) {
for ( int j = 0 ; j < columns . length ; j + + ) {
if ( columns [ j ] . equals ( cellData ) ) {
if ( columns [ j ] . equals ( cellData ) ) {
map . put ( columns [ j ] , i ) ;
map . put ( columns [ j ] , i ) ;
}
}
}
}
}
}
//验证所需要的表头是否全
//验证所需要的表头是否全
Integer flag = 0 ;
Integer flag = 0 ;
for ( int i = 0 ; i < columns . length ; i + + ) {
for ( int i = 0 ; i < columns . length ; i + + ) {
if ( null ! = map . get ( columns [ i ] ) ) {
if ( null ! = map . get ( columns [ i ] ) ) {
flag + + ;
flag + + ;
}
}
}
}
if ( flag ! = columns . length ) {
if ( flag ! = columns . length ) {
return JsonResult . failMessage ( "导入失败,表格表头应包含 \"院校名称\",\"教师姓名\",\"工号\",\"电话\",\"邮箱\"" ) ;
return JsonResult . failMessage ( "导入失败,表格表头应包含 \"院校名称\",\"教师姓名\",\"工号\",\"电话\",\"邮箱\"" ) ;
}
}
@ -361,11 +391,11 @@ public class TeacherService extends CoreBaseService<Teacher> {
Date date = new Date ( ) ;
Date date = new Date ( ) ;
for ( int i = 1 ; i < rowNum ; i + + ) {
for ( int i = 1 ; i < rowNum ; i + + ) {
Row row = sheet . getRow ( i ) ;
Row row = sheet . getRow ( i ) ;
if ( null = = row ) {
if ( null = = row ) {
// msg += "第"+(i+1)+"数据为空<br>";
// msg += "第"+(i+1)+"数据为空<br>";
errMsg . add ( new String [ ] { "第" + ( i + 1 ) + "数据为空" } ) ;
errMsg . add ( new String [ ] { "第" + ( i + 1 ) + "数据为空" } ) ;
continue ;
continue ;
}
}
@ -375,19 +405,19 @@ public class TeacherService extends CoreBaseService<Teacher> {
String teacherMobile = getCellFormatValue ( row . getCell ( map . get ( columns [ 3 ] ) ) ) ;
String teacherMobile = getCellFormatValue ( row . getCell ( map . get ( columns [ 3 ] ) ) ) ;
String teacherEmail = getCellFormatValue ( row . getCell ( map . get ( columns [ 4 ] ) ) ) ;
String teacherEmail = getCellFormatValue ( row . getCell ( map . get ( columns [ 4 ] ) ) ) ;
if ( StringUtils . isBlank ( universitiesCollegesName ) ) {
if ( StringUtils . isBlank ( universitiesCollegesName ) ) {
errMsg . add ( new String [ ] { "第" + ToolUtils . numberToLetter ( map . get ( columns [ 0 ] ) + 1 ) + "列,第" + ( i + 1 ) + "行院校名称为空" } ) ;
errMsg . add ( new String [ ] { "第" + ToolUtils . numberToLetter ( map . get ( columns [ 0 ] ) + 1 ) + "列,第" + ( i + 1 ) + "行院校名称为空" } ) ;
continue ;
continue ;
} else if ( StringUtils . isBlank ( teacherName ) ) {
} else if ( StringUtils . isBlank ( teacherName ) ) {
errMsg . add ( new String [ ] { "第" + ToolUtils . numberToLetter ( map . get ( columns [ 1 ] ) + 1 ) + "列,第" + ( i + 1 ) + "行教师姓名为空" } ) ;
errMsg . add ( new String [ ] { "第" + ToolUtils . numberToLetter ( map . get ( columns [ 1 ] ) + 1 ) + "列,第" + ( i + 1 ) + "行教师姓名为空" } ) ;
continue ;
continue ;
} else if ( StringUtils . isBlank ( teacherJobNumber ) ) {
} else if ( StringUtils . isBlank ( teacherJobNumber ) ) {
errMsg . add ( new String [ ] { "第" + ToolUtils . numberToLetter ( map . get ( columns [ 2 ] ) + 1 ) + "列,第" + ( i + 1 ) + "行工号为空" } ) ;
errMsg . add ( new String [ ] { "第" + ToolUtils . numberToLetter ( map . get ( columns [ 2 ] ) + 1 ) + "列,第" + ( i + 1 ) + "行工号为空" } ) ;
continue ;
continue ;
// }else if(universitiesCollegesName.split("_").length != 2){
// }else if(universitiesCollegesName.split("_").length != 2){
// errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[0])+1)+"列,第"+(i+1)+"行院校ID为空"});
// errMsg.add(new String[]{"第"+ToolUtils.numberToLetter(map.get(columns[0])+1)+"列,第"+(i+1)+"行院校ID为空"});
// continue;
// continue;
} else {
} else {
String universitiesCollegesId = "" ;
String universitiesCollegesId = "" ;
// 通过名字查询院校信息,如果查询不到就告诉前台需要先去添加院校
// 通过名字查询院校信息,如果查询不到就告诉前台需要先去添加院校
@ -400,7 +430,7 @@ public class TeacherService extends CoreBaseService<Teacher> {
Assert . notEmpty ( universitiesColleges , "未查询到院校:{},请先添加院校信息!" , universitiesCollegesName ) ;
Assert . notEmpty ( universitiesColleges , "未查询到院校:{},请先添加院校信息!" , universitiesCollegesName ) ;
// 通过名字没查询到院校的时候
// 通过名字没查询到院校的时候
if ( ObjectUtil . isEmpty ( universitiesColleges ) ) {
if ( ObjectUtil . isEmpty ( universitiesColleges ) ) {
// 正则取院校ID
// 正则取院校ID
universitiesCollegesId = ReUtil . get ( "\\d+" , universitiesCollegesName , 0 ) ;
universitiesCollegesId = ReUtil . get ( "\\d+" , universitiesCollegesName , 0 ) ;
Assert . notBlank ( universitiesCollegesId , "请先添加院校信息:{}! " , universitiesCollegesName ) ;
Assert . notBlank ( universitiesCollegesId , "请先添加院校信息:{}! " , universitiesCollegesName ) ;
@ -426,14 +456,14 @@ public class TeacherService extends CoreBaseService<Teacher> {
if ( ! platformService . isAllowUserCode ( code ) ) {
if ( ! platformService . isAllowUserCode ( code ) ) {
list . add ( pojo . getTeacherId ( ) ) ;
list . add ( pojo . getTeacherId ( ) ) ;
// msg += "第"+(i+1)+"行不允许的注册账号 "+code+"<br>";
// msg += "第"+(i+1)+"行不允许的注册账号 "+code+"<br>";
errMsg . add ( new String [ ] { "第" + ( i + 1 ) + "行不允许的注册账号 " + code } ) ;
errMsg . add ( new String [ ] { "第" + ( i + 1 ) + "行不允许的注册账号 " + code } ) ;
} else {
} else {
{
{
Teacher t = new Teacher ( ) ;
Teacher t = new Teacher ( ) ;
t . setUniversitiesCollegesId ( Long . parseLong ( universitiesCollegesId ) ) ;
t . setUniversitiesCollegesId ( Long . parseLong ( universitiesCollegesId ) ) ;
t . setTeacherName ( teacherName ) ;
t . setTeacherName ( teacherName ) ;
if ( teacherDao . template ( t ) . size ( ) > 1 ) {
if ( teacherDao . template ( t ) . size ( ) > 1 ) {
errMsg . add ( new String [ ] { "第" + ( i + 1 ) + "行存在同名同姓的教师,姓名 " + teacherName + " 是否删除" , pojo . getTeacherId ( ) . toString ( ) } ) ;
errMsg . add ( new String [ ] { "第" + ( i + 1 ) + "行存在同名同姓的教师,姓名 " + teacherName + " 是否删除" , pojo . getTeacherId ( ) . toString ( ) } ) ;
}
}
}
}
CoreUser coreUser = new CoreUser ( ) ;
CoreUser coreUser = new CoreUser ( ) ;
@ -468,28 +498,28 @@ public class TeacherService extends CoreBaseService<Teacher> {
}
}
}
}
if ( count > 0 ) {
if ( count > 0 ) {
JsonResult jsonResult = new JsonResult ( ) ;
JsonResult jsonResult = new JsonResult ( ) ;
jsonResult . setCode ( JsonReturnCode . SUCCESS . getCode ( ) ) ;
jsonResult . setCode ( JsonReturnCode . SUCCESS . getCode ( ) ) ;
jsonResult . setData ( errMsg ) ;
jsonResult . setData ( errMsg ) ;
jsonResult . setMsg ( "导入成功,共导入" + count + "条" + ( StringUtils . isNotBlank ( msg ) ? "<br>" + msg : "" ) ) ;
jsonResult . setMsg ( "导入成功,共导入" + count + "条" + ( StringUtils . isNotBlank ( msg ) ? "<br>" + msg : "" ) ) ;
return jsonResult ;
return jsonResult ;
} else {
} else {
return JsonResult . failMessage ( "导入失败" ) . setData ( errMsg ) ;
return JsonResult . failMessage ( "导入失败" ) . setData ( errMsg ) ;
}
}
}
}
return JsonResult . failMessage ( "导入失败" ) ;
return JsonResult . failMessage ( "导入失败" ) ;
} else {
} else {
return JsonResult . failMessage ( "上传失败" ) ;
return JsonResult . failMessage ( "上传失败" ) ;
}
}
} else {
} else {
return JsonResult . failMessage ( "上传失败" ) ;
return JsonResult . failMessage ( "上传失败" ) ;
}
}
}
}
public String getCellFormatValue ( Cell cell ) {
public String getCellFormatValue ( Cell cell ) {
String value = null ;
String value = null ;
if ( cell ! = null ) {
if ( cell ! = null ) {
switch ( cell . getCellTypeEnum ( ) ) {
switch ( cell . getCellTypeEnum ( ) ) {
case STRING :
case STRING :
value = cell . getRichStringCellValue ( ) . getString ( ) ;
value = cell . getRichStringCellValue ( ) . getString ( ) ;
@ -517,20 +547,20 @@ public class TeacherService extends CoreBaseService<Teacher> {
return value ;
return value ;
}
}
public List < Map < String , Object > > getExcelValues ( TeacherQuery teacherQuery ) {
public List < Map < String , Object > > getExcelValues ( TeacherQuery teacherQuery ) {
return teacherDao . getExcelValues ( teacherQuery ) ;
return teacherDao . getExcelValues ( teacherQuery ) ;
}
}
public List < Map < String , Object > > getExcelValues2Competition ( TeacherQuery teacherQuery ) {
public List < Map < String , Object > > getExcelValues2Competition ( TeacherQuery teacherQuery ) {
return teacherDao . getExcelValues2Competition ( teacherQuery ) ;
return teacherDao . getExcelValues2Competition ( teacherQuery ) ;
}
}
public List < Teacher > getValues ( Object paras ) {
public List < Teacher > getValues ( Object paras ) {
return sqlManager . select ( SqlId . of ( "jlw.teacher.getTeacherValues" ) , Teacher . class , paras ) ;
return sqlManager . select ( SqlId . of ( "jlw.teacher.getTeacherValues" ) , Teacher . class , paras ) ;
}
}
public Boolean setCT2QuestionScore ( CompetitionTaskSecondQuestionStepQuery competitionTaskSecondQuestionStepQuery ) {
public Boolean setCT2QuestionScore ( CompetitionTaskSecondQuestionStepQuery competitionTaskSecondQuestionStepQuery ) {
CompetitionTaskSecondQuestionStep competitionTaskSecondQuestionStep = competitionTaskSecondQuestionStepService . queryById ( competitionTaskSecondQuestionStepQuery . getCompetitionTaskSecondQuestionStepId ( ) ) ;
CompetitionTaskSecondQuestionStep competitionTaskSecondQuestionStep = competitionTaskSecondQuestionStepService . queryById ( competitionTaskSecondQuestionStepQuery . getCompetitionTaskSecondQuestionStepId ( ) ) ;
CompetitionTaskSecondQuestion competitionTaskSecondQuestion = competitionTaskSecondQuestionService . queryById ( competitionTaskSecondQuestionStep . getCompetitionTaskSecondQuestionId ( ) ) ;
CompetitionTaskSecondQuestion competitionTaskSecondQuestion = competitionTaskSecondQuestionService . queryById ( competitionTaskSecondQuestionStep . getCompetitionTaskSecondQuestionId ( ) ) ;
@ -557,21 +587,21 @@ public class TeacherService extends CoreBaseService<Teacher> {
}
}
public Boolean setCT3QuestionScore ( CompetitionTeacherEvaluationQuery competitionTeacherEvaluationQuery , CoreUser coreUser ) {
public Boolean setCT3QuestionScore ( CompetitionTeacherEvaluationQuery competitionTeacherEvaluationQuery , CoreUser coreUser ) {
Teacher teacher = teacherService . getByUserId ( coreUser . getId ( ) ) ;
Teacher teacher = teacherService . getByUserId ( coreUser . getId ( ) ) ;
Competition competition = competitionService . getById ( competitionTeacherEvaluationQuery . getCompetitionId ( ) ) ;
Competition competition = competitionService . getById ( competitionTeacherEvaluationQuery . getCompetitionId ( ) ) ;
//判断是否为评委 1是 2否
//判断是否为评委 1是 2否
if ( ! ToolUtils . findInSet ( competition . getCompetitionJudgeIds ( ) , teacher . getTeacherId ( ) ) ) {
if ( ! ToolUtils . findInSet ( competition . getCompetitionJudgeIds ( ) , teacher . getTeacherId ( ) ) ) {
return false ;
return false ;
}
}
CompetitionTeacherEvaluation competitionTeacherEvaluation = new CompetitionTeacherEvaluation ( ) ;
CompetitionTeacherEvaluation competitionTeacherEvaluation = new CompetitionTeacherEvaluation ( ) ;
if ( null ! = teacher ) {
if ( null ! = teacher ) {
competitionTeacherEvaluation . setCompetitionStudentsId ( competitionTeacherEvaluationQuery . getCompetitionStudentsId ( ) ) ;
competitionTeacherEvaluation . setCompetitionStudentsId ( competitionTeacherEvaluationQuery . getCompetitionStudentsId ( ) ) ;
competitionTeacherEvaluation . setTeacherId ( teacher . getTeacherId ( ) ) ;
competitionTeacherEvaluation . setTeacherId ( teacher . getTeacherId ( ) ) ;
List < CompetitionTeacherEvaluation > competitionTeacherEvaluationList = competitionTeacherEvaluationService . getValues ( competitionTeacherEvaluation ) ;
List < CompetitionTeacherEvaluation > competitionTeacherEvaluationList = competitionTeacherEvaluationService . getValues ( competitionTeacherEvaluation ) ;
if ( null ! = competitionTeacherEvaluationList & & competitionTeacherEvaluationList . size ( ) > 0 ) {
if ( null ! = competitionTeacherEvaluationList & & competitionTeacherEvaluationList . size ( ) > 0 ) {
competitionTeacherEvaluation = competitionTeacherEvaluationList . get ( 0 ) ;
competitionTeacherEvaluation = competitionTeacherEvaluationList . get ( 0 ) ;
CompetitionTeacherEvaluation cte = new CompetitionTeacherEvaluation ( ) ;
CompetitionTeacherEvaluation cte = new CompetitionTeacherEvaluation ( ) ;
@ -580,7 +610,7 @@ public class TeacherService extends CoreBaseService<Teacher> {
cte . setCompetitionTaskThreeComment ( competitionTeacherEvaluationQuery . getCompetitionTaskThreeComment ( ) ) ;
cte . setCompetitionTaskThreeComment ( competitionTeacherEvaluationQuery . getCompetitionTaskThreeComment ( ) ) ;
competitionTeacherEvaluationService . updateTemplate ( cte ) ;
competitionTeacherEvaluationService . updateTemplate ( cte ) ;
} else {
} else {
CompetitionTeacherEvaluation cte = new CompetitionTeacherEvaluation ( ) ;
CompetitionTeacherEvaluation cte = new CompetitionTeacherEvaluation ( ) ;
cte . setCompetitionStudentsId ( competitionTeacherEvaluationQuery . getCompetitionStudentsId ( ) ) ;
cte . setCompetitionStudentsId ( competitionTeacherEvaluationQuery . getCompetitionStudentsId ( ) ) ;
@ -598,20 +628,20 @@ public class TeacherService extends CoreBaseService<Teacher> {
Document doc = Jsoup . parse ( competitionTeacherEvaluationQuery . getCompetitionTaskThreeResultsInfo ( ) ) ;
Document doc = Jsoup . parse ( competitionTeacherEvaluationQuery . getCompetitionTaskThreeResultsInfo ( ) ) ;
Elements trs = doc . select ( "table" ) . select ( "tr" ) ;
Elements trs = doc . select ( "table" ) . select ( "tr" ) ;
for ( int i = 0 ; i < trs . size ( ) ; i + + ) {
for ( int i = 0 ; i < trs . size ( ) ; i + + ) {
Elements tds = trs . get ( i ) . select ( "td" ) ;
Elements tds = trs . get ( i ) . select ( "td" ) ;
if ( tds . size ( ) > 0 ) {
if ( tds . size ( ) > 0 ) {
Elements inputs = tds . get ( tds . size ( ) - 1 ) . select ( "input" ) ;
Elements inputs = tds . get ( tds . size ( ) - 1 ) . select ( "input" ) ;
if ( inputs . size ( ) > 0 ) {
if ( inputs . size ( ) > 0 ) {
Attributes attributes = inputs . get ( inputs . size ( ) - 1 ) . attributes ( ) ;
Attributes attributes = inputs . get ( inputs . size ( ) - 1 ) . attributes ( ) ;
if ( attributes . size ( ) > 0 ) {
if ( attributes . size ( ) > 0 ) {
b = b . add ( new BigDecimal ( StringUtils . isNotBlank ( attributes . get ( "value" ) ) ? attributes . get ( "value" ) : "0" ) ) ;
b = b . add ( new BigDecimal ( StringUtils . isNotBlank ( attributes . get ( "value" ) ) ? attributes . get ( "value" ) : "0" ) ) ;
}
}
}
}
}
}
}
}
score = b . setScale ( 1 , RoundingMode . HALF_UP ) . toString ( ) ;
score = b . setScale ( 1 , RoundingMode . HALF_UP ) . toString ( ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
@ -622,26 +652,26 @@ public class TeacherService extends CoreBaseService<Teacher> {
String competitionTaskThreeFractions = "" ;
String competitionTaskThreeFractions = "" ;
String [ ] competitionJudgeId = competition . getCompetitionJudgeIds ( ) . split ( "," ) ;
String [ ] competitionJudgeId = competition . getCompetitionJudgeIds ( ) . split ( "," ) ;
String [ ] competitionTaskThreeFraction = new String [ competitionJudgeId . length ] ;
String [ ] competitionTaskThreeFraction = new String [ competitionJudgeId . length ] ;
for ( int i = 0 ; i < competitionTaskThreeFraction . length ; i + + ) {
for ( int i = 0 ; i < competitionTaskThreeFraction . length ; i + + ) {
if ( null ! = competitionStudents . getCompetitionTaskThreeFractions ( )
if ( null ! = competitionStudents . getCompetitionTaskThreeFractions ( )
& & StringUtils . isNotBlank ( competitionStudents . getCompetitionTaskThreeFractions ( ) )
& & StringUtils . isNotBlank ( competitionStudents . getCompetitionTaskThreeFractions ( ) )
& & competitionStudents . getCompetitionTaskThreeFractions ( ) . split ( "," ) . length > i ) {
& & competitionStudents . getCompetitionTaskThreeFractions ( ) . split ( "," ) . length > i ) {
competitionTaskThreeFraction [ i ] = competitionStudents . getCompetitionTaskThreeFractions ( ) . split ( "," ) [ i ] ;
competitionTaskThreeFraction [ i ] = competitionStudents . getCompetitionTaskThreeFractions ( ) . split ( "," ) [ i ] ;
} else {
} else {
competitionTaskThreeFraction [ i ] = " " ;
competitionTaskThreeFraction [ i ] = " " ;
}
}
}
}
for ( int i = 0 ; i < competitionJudgeId . length ; i + + ) {
for ( int i = 0 ; i < competitionJudgeId . length ; i + + ) {
if ( competitionJudgeId [ i ] . equals ( teacher . getTeacherId ( ) . toString ( ) ) ) {
if ( competitionJudgeId [ i ] . equals ( teacher . getTeacherId ( ) . toString ( ) ) ) {
competitionTaskThreeFraction [ i ] = score ;
competitionTaskThreeFraction [ i ] = score ;
}
}
}
}
for ( int i = 0 ; i < competitionTaskThreeFraction . length ; i + + ) {
for ( int i = 0 ; i < competitionTaskThreeFraction . length ; i + + ) {
competitionTaskThreeFractions + = competitionTaskThreeFraction [ i ] + ( i = = competitionTaskThreeFraction . length - 1 ? "" : "," ) ;
competitionTaskThreeFractions + = competitionTaskThreeFraction [ i ] + ( i = = competitionTaskThreeFraction . length - 1 ? "" : "," ) ;
}
}
CompetitionStudents cs = new CompetitionStudents ( ) ;
CompetitionStudents cs = new CompetitionStudents ( ) ;
@ -656,7 +686,7 @@ public class TeacherService extends CoreBaseService<Teacher> {
return false ;
return false ;
}
}
public Boolean setET2QuestionScore ( ExamTaskSecondQuestionStepQuery examTaskSecondQuestionStepQuery ) {
public Boolean setET2QuestionScore ( ExamTaskSecondQuestionStepQuery examTaskSecondQuestionStepQuery ) {
ExamTaskSecondQuestionStep examTaskSecondQuestionStep = examTaskSecondQuestionStepService . queryById ( examTaskSecondQuestionStepQuery . getExamTaskSecondQuestionStepId ( ) ) ;
ExamTaskSecondQuestionStep examTaskSecondQuestionStep = examTaskSecondQuestionStepService . queryById ( examTaskSecondQuestionStepQuery . getExamTaskSecondQuestionStepId ( ) ) ;
ExamTaskSecondQuestion examTaskSecondQuestion = examTaskSecondQuestionService . queryById ( examTaskSecondQuestionStep . getExamTaskSecondQuestionId ( ) ) ;
ExamTaskSecondQuestion examTaskSecondQuestion = examTaskSecondQuestionService . queryById ( examTaskSecondQuestionStep . getExamTaskSecondQuestionId ( ) ) ;
@ -682,39 +712,39 @@ public class TeacherService extends CoreBaseService<Teacher> {
return true ;
return true ;
}
}
public Boolean setET3QuestionScore ( ExamStudentsQuery examStudentsQuery ) {
public Boolean setET3QuestionScore ( ExamStudentsQuery examStudentsQuery ) {
//计算出分数
//计算出分数
BigDecimal score = null ;
BigDecimal score = null ;
if ( StringUtils . isNotBlank ( examStudentsQuery . getExamTaskThreeResultsInfo ( ) ) ) {
if ( StringUtils . isNotBlank ( examStudentsQuery . getExamTaskThreeResultsInfo ( ) ) ) {
try {
try {
BigDecimal b = BigDecimal . ZERO ;
BigDecimal b = BigDecimal . ZERO ;
Document doc = Jsoup . parse ( examStudentsQuery . getExamTaskThreeResultsInfo ( ) ) ;
Document doc = Jsoup . parse ( examStudentsQuery . getExamTaskThreeResultsInfo ( ) ) ;
Elements trs = doc . select ( "table" ) . select ( "tr" ) ;
Elements trs = doc . select ( "table" ) . select ( "tr" ) ;
for ( int i = 0 ; i < trs . size ( ) ; i + + ) {
for ( int i = 0 ; i < trs . size ( ) ; i + + ) {
Elements tds = trs . get ( i ) . select ( "td" ) ;
Elements tds = trs . get ( i ) . select ( "td" ) ;
if ( tds . size ( ) > 0 ) {
if ( tds . size ( ) > 0 ) {
Elements inputs = tds . get ( tds . size ( ) - 1 ) . select ( "input" ) ;
Elements inputs = tds . get ( tds . size ( ) - 1 ) . select ( "input" ) ;
if ( inputs . size ( ) > 0 ) {
if ( inputs . size ( ) > 0 ) {
Attributes attributes = inputs . get ( inputs . size ( ) - 1 ) . attributes ( ) ;
Attributes attributes = inputs . get ( inputs . size ( ) - 1 ) . attributes ( ) ;
if ( attributes . size ( ) > 0 ) {
if ( attributes . size ( ) > 0 ) {
b = b . add ( new BigDecimal ( StringUtils . isNotBlank ( attributes . get ( "value" ) ) ? attributes . get ( "value" ) : "0" ) ) ;
b = b . add ( new BigDecimal ( StringUtils . isNotBlank ( attributes . get ( "value" ) ) ? attributes . get ( "value" ) : "0" ) ) ;
}
}
}
}
}
}
}
}
score = b . setScale ( 1 , RoundingMode . HALF_UP ) ;
score = b . setScale ( 1 , RoundingMode . HALF_UP ) ;
} catch ( Exception e ) {
} catch ( Exception e ) {
e . printStackTrace ( ) ;
e . printStackTrace ( ) ;
}
}
} else {
} else {
score = examStudentsQuery . getExamTaskThreeFraction ( ) ;
score = examStudentsQuery . getExamTaskThreeFraction ( ) ;
}
}
//更新分数
//更新分数
if ( null ! = score ) {
if ( null ! = score ) {
ExamStudents cs = new ExamStudents ( ) ;
ExamStudents cs = new ExamStudents ( ) ;
cs . setExamStudentsId ( examStudentsQuery . getExamStudentsId ( ) ) ;
cs . setExamStudentsId ( examStudentsQuery . getExamStudentsId ( ) ) ;
cs . setExamTaskThreeFraction ( score ) ;
cs . setExamTaskThreeFraction ( score ) ;
@ -771,7 +801,7 @@ public class TeacherService extends CoreBaseService<Teacher> {
* 通 过 用 户 ID 获 取 教 师 的 关 系 信 息
* 通 过 用 户 ID 获 取 教 师 的 关 系 信 息
* 班 级 - 专 业 - 院 系 - 院 校
* 班 级 - 专 业 - 院 系 - 院 校
*
*
* @param userIds 用 户 ID 集 合
* @param userIds 用 户 ID 集 合
* @return
* @return
* /
* /
public List < TeacherExtendSchoolInfo > getTeacherExtendSchoolInfoListByUserIds ( @NotBlank ( message = "用户ID集合不能为空! " ) String userIds ) {
public List < TeacherExtendSchoolInfo > getTeacherExtendSchoolInfoListByUserIds ( @NotBlank ( message = "用户ID集合不能为空! " ) String userIds ) {
@ -782,7 +812,7 @@ public class TeacherService extends CoreBaseService<Teacher> {
* 通 过 用 户 ID 获 取 教 师 的 关 系 信 息
* 通 过 用 户 ID 获 取 教 师 的 关 系 信 息
* 班 级 - 专 业 - 院 系 - 院 校
* 班 级 - 专 业 - 院 系 - 院 校
*
*
* @param userIds 用 户 ID 集 合
* @param userIds 用 户 ID 集 合
* @return
* @return
* /
* /
public TeacherExtendSchoolInfo getTeacherExtendSchoolInfoByUserIds ( @NotBlank ( message = "用户ID集合不能为空! " ) String userIds ) {
public TeacherExtendSchoolInfo getTeacherExtendSchoolInfoByUserIds ( @NotBlank ( message = "用户ID集合不能为空! " ) String userIds ) {
@ -818,7 +848,7 @@ public class TeacherService extends CoreBaseService<Teacher> {
// 查询库里已经存在的编号
// 查询库里已经存在的编号
List < String > existsList = teacherDao . createLambdaQuery ( )
List < String > existsList = teacherDao . createLambdaQuery ( )
. andIsNotNull ( Teacher : : getTeacherSn )
. andIsNotNull ( Teacher : : getTeacherSn )
. andIn ( Teacher : : getTeacherSn , jobNumberList ) . select ( String . class , "teacher_job_number" ) ;
. andIn ( Teacher : : getTeacherSn , jobNumberList ) . select ( String . class , "teacher_job_number" ) ;
for ( String duplicateElement : existsList ) {
for ( String duplicateElement : existsList ) {
int errorRowIndex = jobNumberList . indexOf ( duplicateElement ) ;
int errorRowIndex = jobNumberList . indexOf ( duplicateElement ) ;
@ -830,13 +860,13 @@ public class TeacherService extends CoreBaseService<Teacher> {
}
}
public List < Map < String , Object > > findAllTeacherBySchoolId ( Long schoolId ) {
public List < Map < String , Object > > findAllTeacherBySchoolId ( Long schoolId ) {
List < Map < String , Object > > mapList = teacherDao . findAllTeacherBySchoolId ( schoolId ) ;
List < Map < String , Object > > mapList = teacherDao . findAllTeacherBySchoolId ( schoolId ) ;
List < Map < String , Object > > dataList = new ArrayList < > ( ) ;
List < Map < String , Object > > dataList = new ArrayList < > ( ) ;
for ( Map < String , Object > map : mapList ) {
for ( Map < String , Object > map : mapList ) {
Map < String , Object > dataMap = new HashMap < > ( ) ;
Map < String , Object > dataMap = new HashMap < > ( ) ;
dataMap . put ( "teacherNo" , map . get ( "teacherno" ) ) ;
dataMap . put ( "teacherNo" , map . get ( "teacherno" ) ) ;
dataMap . put ( "name" , map . get ( "name" ) ) ;
dataMap . put ( "name" , map . get ( "name" ) ) ;
dataList . add ( dataMap ) ;
dataList . add ( dataMap ) ;
}
}
return dataList ;
return dataList ;