Browse Source

1、异动bug修复
2、班级考核汇总导入bug修复

dzx 1 month ago
parent
commit
1d949a5863

+ 11 - 8
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentAssessmentInspectionServiceImpl.java

@@ -985,10 +985,6 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
 
             Set<String> categorys = savedDataList.stream().map(ImportBaseStudentAssessmentInspectionDto::getAssessmentCategory).collect(Collectors.toSet());
 
-            Set<String> projects = savedDataList.stream().map(ImportBaseStudentAssessmentInspectionDto::getAssessmentProject).collect(Collectors.toSet());
-
-            Set<String> items = savedDataList.stream().map(ImportBaseStudentAssessmentInspectionDto::getAssessmentItem).collect(Collectors.toSet());
-
             // 提取出所有身份证
             Set<String> credentialNumbers = savedDataList.stream().map(ImportBaseStudentAssessmentInspectionDto::getCredentialNumber).collect(Collectors.toSet());
 
@@ -1009,10 +1005,10 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
                             .eq(BaseStudentAssessmentProject::getDeleteMark, DeleteMark.NODELETE.getCode())
                             .eq(BaseStudentAssessmentProject::getEnabledMark, EnabledMark.ENABLED.getCode())
             );
-            Map<Long, Map<String, Long>> projectMap = projectList.stream().collect(
+            Map<Long, Map<String, BaseStudentAssessmentProject>> projectMap = projectList.stream().collect(
                     Collectors.groupingBy(
                             BaseStudentAssessmentProject::getBaseStudentAssessmentCategoryId,
-                            Collectors.toMap(BaseStudentAssessmentProject::getName, BaseStudentAssessmentProject::getId)
+                            Collectors.toMap(BaseStudentAssessmentProject::getName, x -> x)
                     )
             );
 
@@ -1081,12 +1077,19 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
                 data.setBaseStudentAssessmentItemId(itemGroup.get(dto.getAssessmentItem()));
 
 
-                Map<String, Long> projectGroup = projectMap.get(data.getBaseStudentAssessmentItemId());
+                Map<String, BaseStudentAssessmentProject> projectGroup = projectMap.get(data.getBaseStudentAssessmentItemId());
                 if(projectGroup == null || !projectGroup.containsKey(dto.getAssessmentProject())){
                     checkProjects.add("考核项目“" + dto.getAssessmentItem() + "”中不存在考核项“" + dto.getAssessmentProject() + "”" ) ;
                     continue;
                 }
-                data.setBaseStudentAssessmentProjectId(projectGroup.get(dto.getAssessmentProject()));
+                BaseStudentAssessmentProject project = projectGroup.get(dto.getAssessmentProject());
+                data.setBaseStudentAssessmentProjectId(project.getId());
+
+                if(project.getBasicPoints() > 0){
+                    data.setScoreType("score_add");
+                }else{
+                    data.setScoreType("score_minus");
+                }
 
                 data.setReason(dto.getReason());
                 data.setAssessmentUserId(StpUtil.getLoginIdAsLong());

+ 13 - 0
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.common.enums.ArchivesStatusEnum;
 import com.xjrsoft.common.enums.DeleteMark;
 import com.xjrsoft.common.enums.GenderDictionaryEnum;
 import com.xjrsoft.common.enums.RollModalityEnum;
@@ -131,6 +132,18 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
                         2
                 );
             }
+            if(schoolRoll.getArchivesStatus() != null && !schoolRoll.getArchivesStatus().equals(dto.getArchivesStatus())){
+                recordService.insertData(
+                        ArchivesStatusEnum.fromCode(schoolRoll.getArchivesStatus()),
+                        schoolRoll.getArchivesStatus(),
+                        ArchivesStatusEnum.fromCode(dto.getArchivesStatus()),
+                        dto.getArchivesStatus(),
+                        id,
+                        StpUtil.getLoginIdAsLong(),
+                        StudentChangeTypeEnum.ArchivesStatus.getCode(),
+                        2
+                );
+            }
 
             baseStudentSchoolRollMapper.updateInfoByUserId(dto, id);
         }