|
|
@@ -6,6 +6,7 @@ import com.alibaba.excel.ExcelWriter;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.yulichang.base.MPJBaseServiceImpl;
|
|
|
@@ -242,7 +243,44 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
|
|
|
@Override
|
|
|
public Boolean dataHandle(Long id) {
|
|
|
-
|
|
|
- return null;
|
|
|
+ //获取考核记录
|
|
|
+ BaseStudentAssessmentInspection baseStudentAssessmentInspection = this.getById(id);
|
|
|
+ if(baseStudentAssessmentInspection != null){
|
|
|
+ //同步数据到考核关联班级表
|
|
|
+ if(baseStudentAssessmentInspection.getAssessmentType() != null
|
|
|
+ && baseStudentAssessmentInspection.getAssessmentType().equals("class")
|
|
|
+ && baseStudentAssessmentInspection.getClassIds() != null
|
|
|
+ && !baseStudentAssessmentInspection.getClassIds().equals("")){
|
|
|
+ String[] classIds = baseStudentAssessmentInspection.getClassIds().split(",");
|
|
|
+ for (String classId: classIds) {
|
|
|
+ assessmentClassRelationMapper.insert(new BaseStudentAssessmentClassRelation(){{
|
|
|
+ setClassId(Long.parseLong(classId));
|
|
|
+ setBaseStudentAssessmentInspectionId(baseStudentAssessmentInspection.getId());
|
|
|
+ QueryWrapper<BaseStudentAssessmentClassRelation> queryWrapperSortcode = new QueryWrapper<>();
|
|
|
+ queryWrapperSortcode.select("IFNULL(MAX(sort_code),0) as sortCode");
|
|
|
+ BaseStudentAssessmentClassRelation b = assessmentClassRelationMapper.selectOne(queryWrapperSortcode);
|
|
|
+ setSortCode(b.getSortCode() + 1);
|
|
|
+ }});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //同步数据到考核关联班级表
|
|
|
+ if(baseStudentAssessmentInspection.getAssessmentType() != null
|
|
|
+ && baseStudentAssessmentInspection.getAssessmentType().equals("personal")
|
|
|
+ && baseStudentAssessmentInspection.getStudentUserIds() != null
|
|
|
+ && !baseStudentAssessmentInspection.getStudentUserIds().equals("")){
|
|
|
+ String[] studentIds = baseStudentAssessmentInspection.getStudentUserIds().split(",");
|
|
|
+ for (String studentId: studentIds) {
|
|
|
+ assessmentStudentRelationMapper.insert(new BaseStudentAssessmentStudentRelation(){{
|
|
|
+ setClassId(Long.parseLong(studentId));
|
|
|
+ setBaseStudentAssessmentInspectionId(baseStudentAssessmentInspection.getId());
|
|
|
+ QueryWrapper<BaseStudentAssessmentClassRelation> queryWrapperSortcode = new QueryWrapper<>();
|
|
|
+ queryWrapperSortcode.select("IFNULL(MAX(sort_code),0) as sortCode");
|
|
|
+ BaseStudentAssessmentClassRelation b = assessmentClassRelationMapper.selectOne(queryWrapperSortcode);
|
|
|
+ setSortCode(b.getSortCode() + 1);
|
|
|
+ }});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
}
|