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 8e5ec3f..164137b 100644 --- a/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java +++ b/src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java @@ -127,27 +127,27 @@ public class ExcelImportHelper { // Cell staffGradeName = row.getCell(4); if (row.getCell(4)!=null){ row.getCell(4).setCellType(CellType.STRING); - staffGradeName = row.getCell(4); + staffProfessionalArchitectureName = row.getCell(4); }else { - staffGradeName = row.createCell(4); + staffProfessionalArchitectureName = row.createCell(4); } if (row.getCell(5)!=null){ row.getCell(5).setCellType(CellType.STRING); - staffProfessionalArchitectureName = row.getCell(5); + staffGradeName = row.getCell(5); }else { - staffProfessionalArchitectureName = row.createCell(5); + staffGradeName = row.createCell(5); } if (row.getCell(6)!=null){ row.getCell(6).setCellType(CellType.STRING); - staffGradeNameTwo = row.getCell(6); + staffProfessionalArchitectureNameTwo = row.getCell(6); }else { - staffGradeNameTwo = row.createCell(6); + staffProfessionalArchitectureNameTwo = row.createCell(6); } if (row.getCell(7)!=null){ row.getCell(7).setCellType(CellType.STRING); - staffProfessionalArchitectureNameTwo = row.getCell(7); + staffGradeNameTwo = row.getCell(7); }else { - staffProfessionalArchitectureNameTwo = row.createCell(7); + staffGradeNameTwo = row.createCell(7); } diff --git a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java index d1cb7f8..0473934 100644 --- a/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java +++ b/src/main/java/com/msdw/tms/dao/ProjectRecordDao.java @@ -33,4 +33,5 @@ public interface ProjectRecordDao extends BaseMapper { boolean updateUserRecord(ProjectRecordEntity projectRecord); + List getByRecordImport(ProjectRecordEntity projectRecord); } diff --git a/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java b/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java index 091dfd9..5c8612f 100644 --- a/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java +++ b/src/main/java/com/msdw/tms/dao/SystemSetttingDao.java @@ -54,5 +54,5 @@ public interface SystemSetttingDao { Integer queryDepartmentNameOrganization(String staffProfessionalArchitectureName,Integer schoolId); - boolean judgmentGrade(String name,Integer schoolId); + List judgmentGrade(String name,Integer schoolId); } diff --git a/src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java b/src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java index 0e383dd..6c149ef 100644 --- a/src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java +++ b/src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java @@ -54,11 +54,11 @@ public class StaffExportVo { private String email; //所属院校 - @ExcelAttribute(sort = 10) + @ExcelAttribute(sort = 11) private String schoolAppellationName; //失败原因 - @ExcelAttribute(sort = 11) + @ExcelAttribute(sort = 10) private String failureMsg; diff --git a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java index c480cef..e27ed14 100644 --- a/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java @@ -76,7 +76,8 @@ public class ProjectRecordServiceImpl extends ServiceImpl projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord); + List projectRecordVos = this.baseMapper.getByRecordImport(projectRecord); +// List projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord); List importRequests = projectRecordVos.stream().map(project -> { ProjectRecordImportRequest request = new ProjectRecordImportRequest(); diff --git a/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java b/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java index 2fafc67..ab1195f 100644 --- a/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java +++ b/src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java @@ -574,11 +574,12 @@ public class QuestionsServiceImpl extends ServiceImpl a = systemSetttingDao.judgmentGrade(architectureName,ConstantUtils.Keda_schoolId); + if (a.size()==0){ StaffExportVo vo = new StaffExportVo(); 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()); @@ -372,8 +370,8 @@ public class SystemSettingServiceImpl implements SystemSetttingService { failVo1.add(vo); continue; } - boolean a = systemSetttingDao.judgmentGrade(architectureNameTwo,ConstantUtils.Keda_schoolId); - if (!a){ + List a = systemSetttingDao.judgmentGrade(architectureNameTwo,ConstantUtils.Keda_schoolId); + if (a.size()==0){ StaffExportVo vo = new StaffExportVo(); 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()); @@ -445,15 +443,32 @@ public class SystemSettingServiceImpl implements SystemSetttingService { parse.sort(Comparator.comparing(StaffExportVo::getIndex)); //2.加载模板流数据 - 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"); + org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/员工导入失败数据导出模板.xlsx"); +// FileInputStream fis = new FileInputStream(resource.getFile()); InputStream inputStream = resource.getInputStream(); -// InputStream inputStream = new FileInputStream("E:/JavaworkSpace2/msdw_tms/src/main/resources/excel-template/员工信息导入失败模板.xlsx"); - - //3、通过工具类下载文件 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 diff --git a/src/main/resources/excel-template/员工信息导入模板.xlsx b/src/main/resources/excel-template/员工信息导入模板.xlsx index e4d75db..70142e8 100644 Binary files a/src/main/resources/excel-template/员工信息导入模板.xlsx and b/src/main/resources/excel-template/员工信息导入模板.xlsx differ diff --git a/src/main/resources/excel-template/员工导入失败数据导出模板.xlsx b/src/main/resources/excel-template/员工导入失败数据导出模板.xlsx new file mode 100644 index 0000000..30133bd Binary files /dev/null and b/src/main/resources/excel-template/员工导入失败数据导出模板.xlsx differ diff --git a/src/main/resources/excel-template/虚拟仿真实验报告导出模板.xlsx b/src/main/resources/excel-template/虚拟仿真实验报告导出模板.xlsx index 74e47f4..d4eb76e 100644 Binary files a/src/main/resources/excel-template/虚拟仿真实验报告导出模板.xlsx and b/src/main/resources/excel-template/虚拟仿真实验报告导出模板.xlsx differ diff --git a/src/main/resources/mapper/tms/ProjectRecordDao.xml b/src/main/resources/mapper/tms/ProjectRecordDao.xml index ef5f35d..a3ab716 100644 --- a/src/main/resources/mapper/tms/ProjectRecordDao.xml +++ b/src/main/resources/mapper/tms/ProjectRecordDao.xml @@ -33,6 +33,8 @@ tpr.userId = #{pro.userid} AND tpr.isdel = #{pro.isdel} + AND + tp.projectPermissions =0 @@ -54,6 +56,8 @@ tpr.userId = #{pro.userid} AND tpr.isdel = #{pro.isdel} + AND + tp.projectPermissions !=0 @@ -126,6 +132,25 @@ and recordState=#{pro.recordState} and ( projectName like concat('%',#{pro.condition},'%') or schoolName like concat('%',#{pro.condition},'%') or userName like concat('%',#{pro.condition},'%') ) + update tms_project_record diff --git a/src/main/resources/mapper/tms/SystemSetting.xml b/src/main/resources/mapper/tms/SystemSetting.xml index 8d5380d..e513654 100644 --- a/src/main/resources/mapper/tms/SystemSetting.xml +++ b/src/main/resources/mapper/tms/SystemSetting.xml @@ -92,6 +92,7 @@ u.logInNumber, u.lastLoginTime, u.schoolId, + u.account, s.staffId, s.workNumber, s.staffProfessionalArchitectureId, @@ -159,7 +160,7 @@ - SELECT staffGradeName FROM @@ -169,5 +170,6 @@ WHERE g.staffProfessionalArchitectureId = a.staffProfessionalArchitectureId AND a.schoolId = #{schoolId} AND a.staffProfessionalArchitectureName = #{name} + AND g.isdel = 0 AND a.isdel = 0 \ No newline at end of file