|
|
@@ -2,6 +2,7 @@ package com.xjrsoft.module.student.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.ExcelWriter;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
@@ -492,38 +493,42 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
//获取考核记录
|
|
|
BaseStudentAssessmentInspection baseStudentAssessmentInspection = this.getById(id);
|
|
|
if(baseStudentAssessmentInspection != null){
|
|
|
- //同步数据到考核关联班级表
|
|
|
- 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(StrUtil.isNotEmpty(baseStudentAssessmentInspection.getClassIds())) {
|
|
|
+ //同步数据到考核关联班级表
|
|
|
+ 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);
|
|
|
+ }});
|
|
|
+ }
|
|
|
}
|
|
|
//同步数据到考核关联学生表
|
|
|
- String[] studentIds = baseStudentAssessmentInspection.getPersonalStudentUserIds().split(",");
|
|
|
- for (String studentId: studentIds) {
|
|
|
- assessmentStudentRelationMapper.insert(new BaseStudentAssessmentStudentRelation(){{
|
|
|
- MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
|
- baseStudentSchoolRollMPJLambdaWrapper
|
|
|
- .select(BaseStudentSchoolRoll::getId)
|
|
|
- .select(BaseStudentSchoolRoll.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentSchoolRoll.class).contains(x.getProperty()))
|
|
|
- .eq(BaseStudentSchoolRoll::getUserId, studentId);
|
|
|
- BaseStudentSchoolRoll baseStudentSchoolRoll = baseStudentSchoolRollMapper.selectOne(baseStudentSchoolRollMPJLambdaWrapper);
|
|
|
- if(baseStudentSchoolRoll != null){
|
|
|
- setClassId(baseStudentSchoolRoll.getClassId());
|
|
|
- }
|
|
|
- setUserId(Long.parseLong(studentId));
|
|
|
- setBaseStudentAssessmentInspectionId(baseStudentAssessmentInspection.getId());
|
|
|
- QueryWrapper<BaseStudentAssessmentStudentRelation> queryWrapperSortcode = new QueryWrapper<>();
|
|
|
- queryWrapperSortcode.select("IFNULL(MAX(sort_code),0) as sortCode");
|
|
|
- BaseStudentAssessmentStudentRelation b = assessmentStudentRelationMapper.selectOne(queryWrapperSortcode);
|
|
|
- setSortCode(b.getSortCode() + 1);
|
|
|
- }});
|
|
|
+ if(StrUtil.isNotEmpty(baseStudentAssessmentInspection.getPersonalStudentUserIds())){
|
|
|
+ String[] studentIds = baseStudentAssessmentInspection.getPersonalStudentUserIds().split(",");
|
|
|
+ for (String studentId: studentIds) {
|
|
|
+ assessmentStudentRelationMapper.insert(new BaseStudentAssessmentStudentRelation(){{
|
|
|
+ MPJLambdaWrapper<BaseStudentSchoolRoll> baseStudentSchoolRollMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
|
|
+ baseStudentSchoolRollMPJLambdaWrapper
|
|
|
+ .select(BaseStudentSchoolRoll::getId)
|
|
|
+ .select(BaseStudentSchoolRoll.class, x -> VoToColumnUtil.fieldsToColumns(BaseStudentSchoolRoll.class).contains(x.getProperty()))
|
|
|
+ .eq(BaseStudentSchoolRoll::getUserId, studentId);
|
|
|
+ BaseStudentSchoolRoll baseStudentSchoolRoll = baseStudentSchoolRollMapper.selectOne(baseStudentSchoolRollMPJLambdaWrapper);
|
|
|
+ if(baseStudentSchoolRoll != null){
|
|
|
+ setClassId(baseStudentSchoolRoll.getClassId());
|
|
|
+ }
|
|
|
+ setUserId(Long.parseLong(studentId));
|
|
|
+ setBaseStudentAssessmentInspectionId(baseStudentAssessmentInspection.getId());
|
|
|
+ QueryWrapper<BaseStudentAssessmentStudentRelation> queryWrapperSortcode = new QueryWrapper<>();
|
|
|
+ queryWrapperSortcode.select("IFNULL(MAX(sort_code),0) as sortCode");
|
|
|
+ BaseStudentAssessmentStudentRelation b = assessmentStudentRelationMapper.selectOne(queryWrapperSortcode);
|
|
|
+ setSortCode(b.getSortCode() + 1);
|
|
|
+ }});
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return true;
|