0.2缺陷管理

hehai
mzh820631607 4 years ago
parent 850f7c87e0
commit d52514e993
  1. 16
      src/main/java/com/msdw/tms/common/utils/ExcelImportHelper.java
  2. 1
      src/main/java/com/msdw/tms/dao/ProjectRecordDao.java
  3. 2
      src/main/java/com/msdw/tms/dao/SystemSetttingDao.java
  4. 4
      src/main/java/com/msdw/tms/entity/vo/StaffExportVo.java
  5. 3
      src/main/java/com/msdw/tms/service/impl/ProjectRecordServiceImpl.java
  6. 5
      src/main/java/com/msdw/tms/service/impl/QuestionsServiceImpl.java
  7. 39
      src/main/java/com/msdw/tms/service/impl/SystemSettingServiceImpl.java
  8. BIN
      src/main/resources/excel-template/员工信息导入模板.xlsx
  9. BIN
      src/main/resources/excel-template/员工导入失败数据导出模板.xlsx
  10. BIN
      src/main/resources/excel-template/虚拟仿真实验报告导出模板.xlsx
  11. 25
      src/main/resources/mapper/tms/ProjectRecordDao.xml
  12. 4
      src/main/resources/mapper/tms/SystemSetting.xml

@ -127,27 +127,27 @@ public class ExcelImportHelper {
// Cell staffGradeName = row.getCell(4); // Cell staffGradeName = row.getCell(4);
if (row.getCell(4)!=null){ if (row.getCell(4)!=null){
row.getCell(4).setCellType(CellType.STRING); row.getCell(4).setCellType(CellType.STRING);
staffGradeName = row.getCell(4); staffProfessionalArchitectureName = row.getCell(4);
}else { }else {
staffGradeName = row.createCell(4); staffProfessionalArchitectureName = row.createCell(4);
} }
if (row.getCell(5)!=null){ if (row.getCell(5)!=null){
row.getCell(5).setCellType(CellType.STRING); row.getCell(5).setCellType(CellType.STRING);
staffProfessionalArchitectureName = row.getCell(5); staffGradeName = row.getCell(5);
}else { }else {
staffProfessionalArchitectureName = row.createCell(5); staffGradeName = row.createCell(5);
} }
if (row.getCell(6)!=null){ if (row.getCell(6)!=null){
row.getCell(6).setCellType(CellType.STRING); row.getCell(6).setCellType(CellType.STRING);
staffGradeNameTwo = row.getCell(6); staffProfessionalArchitectureNameTwo = row.getCell(6);
}else { }else {
staffGradeNameTwo = row.createCell(6); staffProfessionalArchitectureNameTwo = row.createCell(6);
} }
if (row.getCell(7)!=null){ if (row.getCell(7)!=null){
row.getCell(7).setCellType(CellType.STRING); row.getCell(7).setCellType(CellType.STRING);
staffProfessionalArchitectureNameTwo = row.getCell(7); staffGradeNameTwo = row.getCell(7);
}else { }else {
staffProfessionalArchitectureNameTwo = row.createCell(7); staffGradeNameTwo = row.createCell(7);
} }

@ -33,4 +33,5 @@ public interface ProjectRecordDao extends BaseMapper<ProjectRecordEntity> {
boolean updateUserRecord(ProjectRecordEntity projectRecord); boolean updateUserRecord(ProjectRecordEntity projectRecord);
List<ProjectRecordExportVo> getByRecordImport(ProjectRecordEntity projectRecord);
} }

@ -54,5 +54,5 @@ public interface SystemSetttingDao {
Integer queryDepartmentNameOrganization(String staffProfessionalArchitectureName,Integer schoolId); Integer queryDepartmentNameOrganization(String staffProfessionalArchitectureName,Integer schoolId);
boolean judgmentGrade(String name,Integer schoolId); List<StaffVo> judgmentGrade(String name,Integer schoolId);
} }

@ -54,11 +54,11 @@ public class StaffExportVo {
private String email; private String email;
//所属院校 //所属院校
@ExcelAttribute(sort = 10) @ExcelAttribute(sort = 11)
private String schoolAppellationName; private String schoolAppellationName;
//失败原因 //失败原因
@ExcelAttribute(sort = 11) @ExcelAttribute(sort = 10)
private String failureMsg; private String failureMsg;

@ -76,7 +76,8 @@ public class ProjectRecordServiceImpl extends ServiceImpl<ProjectRecordDao, Proj
//获取数据 //获取数据
ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType()); ProjectRecordEntity projectRecord = new ProjectRecordEntity().setUserid(userId).setIsdel(Constant.IsDel.NOT_DEL.getType());
List<ProjectRecordExportVo> projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord); List<ProjectRecordExportVo> projectRecordVos = this.baseMapper.getByRecordImport(projectRecord);
// List<ProjectRecordExportVo> projectRecordVos = this.baseMapper.getByUserRecordImport(projectRecord);
List<ProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> { List<ProjectRecordImportRequest> importRequests = projectRecordVos.stream().map(project -> {
ProjectRecordImportRequest request = new ProjectRecordImportRequest(); ProjectRecordImportRequest request = new ProjectRecordImportRequest();

@ -574,11 +574,12 @@ public class QuestionsServiceImpl extends ServiceImpl<QuestionsDao, QuestionsEnt
//2.加载模板流数据 //2.加载模板流数据
org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/试题导出模板.xlsx"); org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/试题导出模板.xlsx");
FileInputStream fis = new FileInputStream(resource.getFile()); // FileInputStream fis = new FileInputStream(resource.getFile());
InputStream inputStream = resource.getInputStream();
//3、通过工具类下载文件 //3、通过工具类下载文件
new ExcelExportUtil(QuestionsImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). new ExcelExportUtil(QuestionsImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX).
export(response, fis, list, "试题表.xlsx"); export(response, inputStream, list, "试题表.xlsx");
} }
@Override @Override

@ -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

@ -33,6 +33,8 @@
tpr.userId = #{pro.userid} tpr.userId = #{pro.userid}
AND AND
tpr.isdel = #{pro.isdel} tpr.isdel = #{pro.isdel}
AND
tp.projectPermissions =0
</select> </select>
<!-- --> <!-- -->
@ -54,6 +56,8 @@
tpr.userId = #{pro.userid} tpr.userId = #{pro.userid}
AND AND
tpr.isdel = #{pro.isdel} tpr.isdel = #{pro.isdel}
AND
tp.projectPermissions !=0
</select> </select>
<select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo"> <select id="getByUserRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo">
@ -76,6 +80,8 @@
tpr.isdel = #{isdel} tpr.isdel = #{isdel}
AND AND
tpr.projectId = tet.project_id tpr.projectId = tet.project_id
AND
tp.projectPermissions != 0
</select> </select>
<!-- 个人实验预览--> <!-- 个人实验预览-->
@ -126,6 +132,25 @@
<if test="pro.recordState!=null">and recordState=#{pro.recordState}</if> <if test="pro.recordState!=null">and recordState=#{pro.recordState}</if>
<if test="pro.condition!=null">and ( projectName like concat('%',#{pro.condition},'%') or schoolName like concat('%',#{pro.condition},'%') or userName like concat('%',#{pro.condition},'%') )</if> <if test="pro.condition!=null">and ( projectName like concat('%',#{pro.condition},'%') or schoolName like concat('%',#{pro.condition},'%') or userName like concat('%',#{pro.condition},'%') )</if>
</select> </select>
<select id="getByRecordImport" resultType="com.msdw.tms.entity.vo.ProjectRecordExportVo">
SELECT
tpr.projectId,
projectName,
score,
timeSum,
startingTime as startTime,
endTime,
recordState
FROM
tms_project_record tpr
LEFT JOIN hr_project_management tp ON tpr.projectId = tp.projectId
WHERE
tpr.userId = #{userid}
AND
tpr.isdel = #{isdel}
AND
tp.projectPermissions =0
</select>
<update id="updateUserRecord" parameterType="com.msdw.tms.entity.ProjectRecordEntity" > <update id="updateUserRecord" parameterType="com.msdw.tms.entity.ProjectRecordEntity" >
update tms_project_record update tms_project_record

@ -92,6 +92,7 @@
u.logInNumber, u.logInNumber,
u.lastLoginTime, u.lastLoginTime,
u.schoolId, u.schoolId,
u.account,
s.staffId, s.staffId,
s.workNumber, s.workNumber,
s.staffProfessionalArchitectureId, s.staffProfessionalArchitectureId,
@ -159,7 +160,7 @@
<select id="queryDepartmentNameOrganization" resultType="java.lang.Integer"> <select id="queryDepartmentNameOrganization" resultType="java.lang.Integer">
select staffProfessionalArchitectureId from staff_professional_architecture where schoolId = #{schoolId} and staffProfessionalArchitectureName = #{staffProfessionalArchitectureName} select staffProfessionalArchitectureId from staff_professional_architecture where schoolId = #{schoolId} and staffProfessionalArchitectureName = #{staffProfessionalArchitectureName}
</select> </select>
<select id="judgmentGrade" resultType="java.lang.Boolean"> <select id="judgmentGrade" resultType="com.msdw.tms.entity.vo.StaffVo">
SELECT SELECT
staffGradeName staffGradeName
FROM FROM
@ -169,5 +170,6 @@ WHERE
g.staffProfessionalArchitectureId = a.staffProfessionalArchitectureId g.staffProfessionalArchitectureId = a.staffProfessionalArchitectureId
AND a.schoolId = #{schoolId} AND a.schoolId = #{schoolId}
AND a.staffProfessionalArchitectureName = #{name} AND a.staffProfessionalArchitectureName = #{name}
AND g.isdel = 0 AND a.isdel = 0
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save