@ -2,6 +2,7 @@ package com.msdw.tms.service.impl;
import com.alibaba.fastjson.JSON ;
import com.alibaba.fastjson.TypeReference ;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper ;
import com.baomidou.mybatisplus.core.metadata.IPage ;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page ;
import com.msdw.tms.common.exception.ExceptionCast ;
@ -10,6 +11,8 @@ import com.msdw.tms.common.utils.poi.ExcelExportUtil;
import com.msdw.tms.dao.SystemSetttingDao ;
import com.msdw.tms.dao.UserInfoDao ;
import com.msdw.tms.entity.StaffEntity ;
import com.msdw.tms.entity.StudentEntity ;
import com.msdw.tms.entity.UserInfoEntity ;
import com.msdw.tms.entity.XlsxTemplateEntity ;
import com.msdw.tms.entity.response.CommonCode ;
import com.msdw.tms.entity.vo.StaffExportVo ;
@ -130,7 +133,6 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
String email = staffVo . getEmail ( ) ;
String workNumber = staffVo . getWorkNumber ( ) ;
List < StaffEntity > staff = staffVo . getStaff ( ) ; //获取员工数据
StaffVo result = userInfoDao . queryAccountUpdate ( staffVo . getUserId ( ) ) ;
String roleIds = result . getRoleId ( ) ;
String [ ] splitOld = staffVo . getRoleId ( ) . split ( "," ) ;
@ -320,7 +322,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
if ( architectureName ! = null & & architectureName ! = "" ) {
if ( gradeName = = null | gradeName = = "" ) {
StaffExportVo vo = new StaffExportVo ( ) ;
vo . setFailureMsg ( "二级部门不能为空" ) ;
vo . setFailureMsg ( "二级部门不能为空(管理员) " ) ;
vo . setIndex ( ii ) . setUserName ( staffVo . getUserName ( ) ) . setAccount ( staffVo . getAccount ( ) ) . setRole ( staffVo . getRole ( ) ) . setWorkNumber ( staffVo . getWorkNumber ( ) ) . setStaffGradeName ( staffVo . getStaffGradeName ( ) ) . setStaffProfessionalArchitectureName ( staffVo . getStaffProfessionalArchitectureName ( ) ) . setStaffGradeNameTwo ( staffVo . getStaffGradeNameTwo ( ) ) . setStaffProfessionalArchitectureNameTwo ( staffVo . getStaffProfessionalArchitectureNameTwo ( ) ) . setPhone ( staffVo . getPhone ( ) ) . setEmail ( staffVo . getEmail ( ) ) . setSchoolAppellationName ( staffVo . getSchoolAppellationName ( ) ) ;
staffs . remove ( i ) ;
i - - ;
@ -330,7 +332,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
Integer b = systemSetttingDao . queryDepartmentNameOrganization ( architectureName , ConstantUtils . Keda_schoolId ) ;
if ( b = = null ) {
StaffExportVo vo = new StaffExportVo ( ) ;
vo . setFailureMsg ( "不存在的一级部门" ) ;
vo . setFailureMsg ( "不存在的一级部门(管理员) " ) ;
vo . setIndex ( ii ) . setUserName ( staffVo . getUserName ( ) ) . setAccount ( staffVo . getAccount ( ) ) . setRole ( staffVo . getRole ( ) ) . setWorkNumber ( staffVo . getWorkNumber ( ) ) . setStaffGradeName ( staffVo . getStaffGradeName ( ) ) . setStaffProfessionalArchitectureName ( staffVo . getStaffProfessionalArchitectureName ( ) ) . setStaffGradeNameTwo ( staffVo . getStaffGradeNameTwo ( ) ) . setStaffProfessionalArchitectureNameTwo ( staffVo . getStaffProfessionalArchitectureNameTwo ( ) ) . setPhone ( staffVo . getPhone ( ) ) . setEmail ( staffVo . getEmail ( ) ) . setSchoolAppellationName ( staffVo . getSchoolAppellationName ( ) ) ;
staffs . remove ( i ) ;
i - - ;
@ -340,7 +342,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
List < StaffVo > a = systemSetttingDao . judgmentGrade ( architectureName , ConstantUtils . Keda_schoolId ) ;
if ( a . size ( ) = = 0 ) {
StaffExportVo vo = new StaffExportVo ( ) ;
vo . setFailureMsg ( "不存在此子级部门" ) ;
vo . setFailureMsg ( "不存在此子级部门(管理员) " ) ;
vo . setIndex ( ii ) . setUserName ( staffVo . getUserName ( ) ) . setAccount ( staffVo . getAccount ( ) ) . setRole ( staffVo . getRole ( ) ) . setWorkNumber ( staffVo . getWorkNumber ( ) ) . setStaffGradeName ( staffVo . getStaffGradeName ( ) ) . setStaffProfessionalArchitectureName ( staffVo . getStaffProfessionalArchitectureName ( ) ) . setStaffGradeNameTwo ( staffVo . getStaffGradeNameTwo ( ) ) . setStaffProfessionalArchitectureNameTwo ( staffVo . getStaffProfessionalArchitectureNameTwo ( ) ) . setPhone ( staffVo . getPhone ( ) ) . setEmail ( staffVo . getEmail ( ) ) . setSchoolAppellationName ( staffVo . getSchoolAppellationName ( ) ) ;
staffs . remove ( i ) ;
i - - ;
@ -349,11 +351,12 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
}
}
}
} else if ( s . indexOf ( "3" ) ! = - 1 ) {
}
if ( s . indexOf ( "3" ) ! = - 1 ) {
if ( architectureNameTwo ! = null & & architectureNameTwo ! = "" ) {
if ( gradeNameTwo = = null | gradeNameTwo = = "" ) {
StaffExportVo vo = new StaffExportVo ( ) ;
vo . setFailureMsg ( "二级部门不能为空" ) ;
vo . setFailureMsg ( "二级部门不能为空(老师) " ) ;
vo . setIndex ( ii ) . setUserName ( staffVo . getUserName ( ) ) . setAccount ( staffVo . getAccount ( ) ) . setRole ( staffVo . getRole ( ) ) . setWorkNumber ( staffVo . getWorkNumber ( ) ) . setStaffGradeName ( staffVo . getStaffGradeName ( ) ) . setStaffProfessionalArchitectureName ( staffVo . getStaffProfessionalArchitectureName ( ) ) . setStaffGradeNameTwo ( staffVo . getStaffGradeNameTwo ( ) ) . setStaffProfessionalArchitectureNameTwo ( staffVo . getStaffProfessionalArchitectureNameTwo ( ) ) . setPhone ( staffVo . getPhone ( ) ) . setEmail ( staffVo . getEmail ( ) ) . setSchoolAppellationName ( staffVo . getSchoolAppellationName ( ) ) ;
staffs . remove ( i ) ;
i - - ;
@ -363,7 +366,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
Integer b = systemSetttingDao . queryDepartmentNameOrganization ( architectureNameTwo , ConstantUtils . Keda_schoolId ) ;
if ( b = = null ) {
StaffExportVo vo = new StaffExportVo ( ) ;
vo . setFailureMsg ( "不存在的一级部门" ) ;
vo . setFailureMsg ( "不存在此 的一级部门(老师) " ) ;
vo . setIndex ( ii ) . setUserName ( staffVo . getUserName ( ) ) . setAccount ( staffVo . getAccount ( ) ) . setRole ( staffVo . getRole ( ) ) . setWorkNumber ( staffVo . getWorkNumber ( ) ) . setStaffGradeName ( staffVo . getStaffGradeName ( ) ) . setStaffProfessionalArchitectureName ( staffVo . getStaffProfessionalArchitectureName ( ) ) . setStaffGradeNameTwo ( staffVo . getStaffGradeNameTwo ( ) ) . setStaffProfessionalArchitectureNameTwo ( staffVo . getStaffProfessionalArchitectureNameTwo ( ) ) . setPhone ( staffVo . getPhone ( ) ) . setEmail ( staffVo . getEmail ( ) ) . setSchoolAppellationName ( staffVo . getSchoolAppellationName ( ) ) ;
staffs . remove ( i ) ;
i - - ;
@ -373,7 +376,7 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
List < StaffVo > a = systemSetttingDao . judgmentGrade ( architectureNameTwo , ConstantUtils . Keda_schoolId ) ;
if ( a . size ( ) = = 0 ) {
StaffExportVo vo = new StaffExportVo ( ) ;
vo . setFailureMsg ( "不存在此子级部门 " ) ;
vo . setFailureMsg ( "不存在的子级部门(老师) " ) ;
vo . setIndex ( ii ) . setUserName ( staffVo . getUserName ( ) ) . setAccount ( staffVo . getAccount ( ) ) . setRole ( staffVo . getRole ( ) ) . setWorkNumber ( staffVo . getWorkNumber ( ) ) . setStaffGradeName ( staffVo . getStaffGradeName ( ) ) . setStaffProfessionalArchitectureName ( staffVo . getStaffProfessionalArchitectureName ( ) ) . setStaffGradeNameTwo ( staffVo . getStaffGradeNameTwo ( ) ) . setStaffProfessionalArchitectureNameTwo ( staffVo . getStaffProfessionalArchitectureNameTwo ( ) ) . setPhone ( staffVo . getPhone ( ) ) . setEmail ( staffVo . getEmail ( ) ) . setSchoolAppellationName ( staffVo . getSchoolAppellationName ( ) ) ;
staffs . remove ( i ) ;
i - - ;
@ -476,4 +479,22 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
XlsxTemplateEntity xlsxTemplate = xlsxTemplateService . getById ( ConstantUtils . XLSX_TEMPLATE_ID3 ) ;
ossService . downloadFiles ( response , xlsxTemplate . getFileName ( ) ) ;
}
@Override
public R queryAccount ( String account , Integer schoolId ) {
HashMap < String , Object > map = new HashMap < > ( ) ;
List < StaffVo > result = systemSetttingDao . queryAccount ( account , schoolId ) ;
List < StaffVo > vos = userInfoDao . queryAccount ( account ) ;
if ( result . size ( ) > 1 ) { return R . error ( "系统存在多个相同的账号:" + account ) ;
} else if ( result . size ( ) = = 1 ) {
StaffVo staffVo = result . get ( 0 ) ;
map . put ( "user" , staffVo ) ;
List < StaffVo > staffVos = systemSetttingDao . queryStaffInfo ( staffVo . getUserId ( ) ) ;
map . put ( "staff" , staffVos ) ;
return R . ok ( ) . put ( "data" , map ) ;
} else if ( vos . size ( ) > 0 ) {
return R . error ( "账号已存在" ) ;
}
return R . ok ( ) ;
}
}