|
@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
import com.xjrsoft.common.enums.EnabledMark;
|
|
@@ -157,9 +158,18 @@ public class BaseStudentAssessmentInspectionController {
|
|
|
relation.setModifyDate(new Date());
|
|
relation.setModifyDate(new Date());
|
|
|
boolean update = studentRelationService.updateById(relation);
|
|
boolean update = studentRelationService.updateById(relation);
|
|
|
|
|
|
|
|
|
|
+ long count = studentRelationService.count(
|
|
|
|
|
+ new QueryWrapper<BaseStudentAssessmentStudentRelation>().lambda()
|
|
|
|
|
+ .eq(BaseStudentAssessmentStudentRelation::getBaseStudentAssessmentInspectionId, relation.getBaseStudentAssessmentInspectionId())
|
|
|
|
|
+ .eq(BaseStudentAssessmentStudentRelation::getEnabledMark, EnabledMark.ENABLED.getCode())
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
BaseStudentAssessmentInspection inspection = inspectionService.getById(relation.getBaseStudentAssessmentInspectionId());
|
|
BaseStudentAssessmentInspection inspection = inspectionService.getById(relation.getBaseStudentAssessmentInspectionId());
|
|
|
inspection.setModifyDate(new Date());
|
|
inspection.setModifyDate(new Date());
|
|
|
inspection.setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
inspection.setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
|
|
|
+ if(count == 0){
|
|
|
|
|
+ inspection.setEnabledMark(EnabledMark.DISABLED.getCode());
|
|
|
|
|
+ }
|
|
|
inspectionService.updateById(inspection);
|
|
inspectionService.updateById(inspection);
|
|
|
return RT.ok(update);
|
|
return RT.ok(update);
|
|
|
}
|
|
}
|