@ -21,7 +21,6 @@ import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T ;
import org.apache.poi.ss.formula.functions.T ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.core.io.ClassPathResource ;
import org.springframework.core.io.ClassPathResource ;
import org.springframework.core.io.FileSystemResource ;
import org.springframework.data.redis.core.StringRedisTemplate ;
import org.springframework.data.redis.core.StringRedisTemplate ;
import org.springframework.data.redis.core.ValueOperations ;
import org.springframework.data.redis.core.ValueOperations ;
import org.springframework.stereotype.Service ;
import org.springframework.stereotype.Service ;
@ -30,7 +29,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource ;
import javax.annotation.Resource ;
import javax.servlet.http.HttpServletResponse ;
import javax.servlet.http.HttpServletResponse ;
import java.io.FileInputStream ;
import java.io.IOException ;
import java.io.IOException ;
import java.io.InputStream ;
import java.io.InputStream ;
import java.util.* ;
import java.util.* ;
@ -339,8 +337,8 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
failVo1 . add ( vo ) ;
failVo1 . add ( vo ) ;
continue ;
continue ;
}
}
boolean a = systemSetttingDao . judgmentGrade ( architectureName , ConstantUtils . Keda_schoolId ) ;
List < StaffVo > a = systemSetttingDao . judgmentGrade ( architectureName , ConstantUtils . Keda_schoolId ) ;
if ( ! a ) {
if ( a . size ( ) = = 0 ) {
StaffExportVo vo = new StaffExportVo ( ) ;
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 ( ) ) ;
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 ( ) ) ;
@ -372,8 +370,8 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
failVo1 . add ( vo ) ;
failVo1 . add ( vo ) ;
continue ;
continue ;
}
}
boolean a = systemSetttingDao . judgmentGrade ( architectureNameTwo , ConstantUtils . Keda_schoolId ) ;
List < StaffVo > a = systemSetttingDao . judgmentGrade ( architectureNameTwo , ConstantUtils . Keda_schoolId ) ;
if ( ! a ) {
if ( a . size ( ) = = 0 ) {
StaffExportVo vo = new StaffExportVo ( ) ;
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 ( ) ) ;
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 ( ) ) ;
@ -445,15 +443,32 @@ public class SystemSettingServiceImpl implements SystemSetttingService {
parse . sort ( Comparator . comparing ( StaffExportVo : : getIndex ) ) ;
parse . sort ( Comparator . comparing ( StaffExportVo : : getIndex ) ) ;
//2.加载模板流数据
//2.加载模板流数据
org . springframework . core . io . Resource resource = new ClassPathResource ( "excel-template/员工信息 导入失败模板.xlsx" ) ;
org . springframework . core . io . Resource resource = new ClassPathResource ( "excel-template/员工导入失败数据导出 模板.xlsx" ) ;
// org.springframework.core.io.Resource resource = new FileSystemResource("E:/JavaworkSpace2/msdw_tms/src/main/resources/excel-template/员工信息导入失败模板.xlsx" );
// FileInputStream fis = new FileInputStream(resource.getFile() );
InputStream inputStream = resource . getInputStream ( ) ;
InputStream inputStream = resource . getInputStream ( ) ;
// InputStream inputStream = new FileInputStream("E:/JavaworkSpace2/msdw_tms/src/main/resources/excel-template/员工信息导入失败模板.xlsx");
//3、通过工具类下载文件
//3、通过工具类下载文件
new ExcelExportUtil ( StaffExportVo . class , Constant . ROW_INDEX , Constant . STYLE_INDEX ) .
new ExcelExportUtil ( StaffExportVo . class , Constant . ROW_INDEX , Constant . STYLE_INDEX ) .
export ( response , inputStream , parse , "员工信息导入失败数据表.xlsx" ) ;
export ( response , inputStream , parse , "导入失败数据表.xlsx" ) ;
if ( inputStream ! = null ) {
inputStream . close ( ) ;
}
// //2.加载模板流数据
// org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/staff/测试.xlsx");
//// org.springframework.core.io.Resource resource = new FileSystemResource("E:/JavaworkSpace2/msdw_tms/src/main/resources/excel-template/员工信息导入失败模板.xlsx");
// InputStream inputStream = resource.getInputStream();
// //3、通过工具类下载文件
// new ExcelExportUtil(StaffExportVo.class, Constant.ROW_INDEX, Constant.STYLE_INDEX).
// export(response, inputStream, parse, "员工信息导入失败数据表.xlsx");
//
// if (inputStream!=null){
// inputStream.close();
// }
}
}
@Override
@Override