wangliang 3 lat temu
rodzic
commit
e0caec8b6b

+ 6 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TSyncExamStudentScoreServiceImpl.java

@@ -235,6 +235,12 @@ public class TSyncExamStudentScoreServiceImpl extends ServiceImpl<TSyncExamStude
                     zipFile.getParentFile().mkdirs();
                     zipFile.createNewFile();
                 }
+                File[] files = tSyncExamStudentScore.getTrajectoryFileList().get(0).getParentFile().listFiles();
+                List<File> fileList = new ArrayList<>(Arrays.asList(files));
+                fileList.removeAll(tSyncExamStudentScore.getTrajectoryFileList());
+                for (File file : fileList) {
+                    file.delete();
+                }
                 FileUtil.doZip(zipFile, Arrays.asList(tSyncExamStudentScore.getTrajectoryFileList().get(0).getParentFile()));
                 HttpServletResponse response = ServletUtil.getResponse();
 //                response.setContentType("image/jpeg");

+ 19 - 13
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -1199,23 +1199,23 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     String teachingRoomName = basicCourseImportDto.getTeachingRoomName();
                     String clazz = basicCourseImportDto.getClazz();
 
-                    if (courseDtoMap.containsKey(courseCode)){
+                    if (courseDtoMap.containsKey(courseCode)) {
                         BasicCourseImportDto primaryCell = courseDtoMap.get(courseCode);
                         String primaryName = primaryCell.getCourseName();
                         String primaryTeachingRoomName = primaryCell.getTeachingRoomName();
-                        if (!Objects.equals(primaryName,courseName)){
+                        if (!Objects.equals(primaryName, courseName)) {
                             throw ExceptionResultEnum.ERROR.exception("【课程编号】 : " + courseCode + ",存在不同的【课程名称】");
                         }
-                        if (!Objects.equals(primaryTeachingRoomName,teachingRoomName)){
+                        if (!Objects.equals(primaryTeachingRoomName, teachingRoomName)) {
                             throw ExceptionResultEnum.ERROR.exception("【课程编号】 : " + courseCode + ",存在不同的【所属教研室】");
                         }
                         String primaryClazz = primaryCell.getClazz();
-                        if (SystemConstant.strNotNull(clazz)){
+                        if (SystemConstant.strNotNull(clazz)) {
                             primaryClazz = primaryClazz + SystemConstant.COMMA + clazz;
                             primaryCell.setClazz(primaryClazz);
                         }
                         duplicateData.add(basicCourseImportDto);
-                    }else {
+                    } else {
                         courseDtoMap.put(courseCode, basicCourseImportDto);
                     }
 
@@ -1244,7 +1244,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
         InputStream inputStream = (InputStream) map.get("inputStream");
         List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(inputStream, Lists.newArrayList(SysUserImportDto.class, DescribeImportDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
             List<ExcelError> excelErrorTemp = new ArrayList<>();
-            Map<String,SysUserImportDto> checkDtoMap = new HashMap<>();
+            Map<String, SysUserImportDto> checkDtoMap = new HashMap<>();
 
             for (int i = 0; i < finalExcelList.size(); i++) {
                 LinkedMultiValueMap<Integer, Object> excelMap = finalExcelList.get(i);
@@ -1263,28 +1263,28 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                     String orgName = sysUserImportDto.getOrgName();
                     String roleName = sysUserImportDto.getRoleName();
 
-                    if (checkDtoMap.containsKey(code)){
+                    if (checkDtoMap.containsKey(code)) {
                         SysUserImportDto primaryCell = checkDtoMap.get(code);
                         String priName = primaryCell.getName();
                         String priPhoneNumber = primaryCell.getPhoneNumber();
                         String priOrgName = primaryCell.getOrgName();
-                        if (!Objects.equals(priName,name)){
+                        if (!Objects.equals(priName, name)) {
                             throw ExceptionResultEnum.ERROR.exception("【工号】 :" + code + ",的用户存在不同的用户名称异常");
                         }
-                        if (!Objects.equals(priPhoneNumber,phoneNumber)){
+                        if (!Objects.equals(priPhoneNumber, phoneNumber)) {
                             throw ExceptionResultEnum.ERROR.exception("【工号】 :" + code + ",的用户存在不同的手机号异常");
                         }
-                        if (!Objects.equals(priOrgName,orgName)){
+                        if (!Objects.equals(priOrgName, orgName)) {
                             throw ExceptionResultEnum.ERROR.exception("【工号】 :" + code + ",的用户存在不同的组织架构异常");
                         }
                         String priRoleName = primaryCell.getRoleName();
-                        if (SystemConstant.strNotNull(roleName)){
+                        if (SystemConstant.strNotNull(roleName)) {
                             priRoleName = priRoleName + SystemConstant.COMMA + roleName;
                             primaryCell.setRoleName(priRoleName);
                         }
                         duplicateData.add(sysUserImportDto);
-                    }else {
-                        checkDtoMap.put(code,sysUserImportDto);
+                    } else {
+                        checkDtoMap.put(code, sysUserImportDto);
                     }
 
                     excelErrorTemp.addAll(ExcelUtil.checkExcelField(sysUserImportDto, y, i));
@@ -1514,6 +1514,12 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                         boolean update = Objects.isNull(t.getTrajectoryUrls()) ? true : false;
                         t = tSyncExamStudentScoreService.createImageTrajectory(t, ImageTrajectoryEnum.DOWNLOAD);
                         if (Objects.nonNull(t.getTrajectoryFileList())) {
+                            File[] files = t.getTrajectoryFileList().get(0).getParentFile().listFiles();
+                            List<File> fileList = new ArrayList<>(Arrays.asList(files));
+                            fileList.removeAll(t.getTrajectoryFileList());
+                            for (File file : fileList) {
+                                file.delete();
+                            }
                             sourceFiles.add(t.getTrajectoryFileList().get(0).getParentFile());
                         } else {
                             errorTSyncExamStudentScoreList.add(t);

+ 2 - 2
distributed-print-business/src/main/resources/mapper/TSyncExamStudentScoreMapper.xml

@@ -32,11 +32,11 @@
         join basic_semester bs on
             bs.id = tsess.semester_id
         join basic_student bs2 on
-            bs2.student_code = tsess.student_code
+            bs2.school_id = tsess.school_id and bs2.student_code = tsess.student_code
         join basic_clazz bc on
             bc.id = tsess.clazz_id
         join exam_student es on
-            es.student_code = tsess.student_code
+            es.school_id = tsess.school_id and es.student_code = tsess.student_code
         join basic_major bm on
             bm.id = tsess.major_id
         join sys_org so on