|
@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
+import com.qmth.teachcloud.common.entity.SysOrg;
|
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
|
import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
|
|
|
+import com.qmth.teachcloud.common.service.SysOrgService;
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
|
import com.qmth.teachcloud.report.business.bean.result.*;
|
|
|
import com.qmth.teachcloud.report.business.entity.TAExamCourse;
|
|
@@ -52,7 +54,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
|
|
|
TBPaperService tbPaperService;
|
|
|
|
|
|
@Resource
|
|
|
- TAExamCourseService taExamCourseService;
|
|
|
+ SysOrgService sysOrgService;
|
|
|
|
|
|
@Resource
|
|
|
TBExamService tbExamService;
|
|
@@ -70,7 +72,7 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
|
|
|
public IPage<TAExamCourseResult> surveyTeacherList(IPage<Map> iPage, Long examId, SemesterEnum semester, Long schoolId) {
|
|
|
SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
Long collegeId = sysUser.getOrgId();
|
|
|
- return taExamCourseMapper.surveyTeacherList(iPage, examId, Objects.nonNull(semester) ? semester.name() : null, schoolId,collegeId);
|
|
|
+ return taExamCourseMapper.surveyTeacherList(iPage, examId, Objects.nonNull(semester) ? semester.name() : null, schoolId, collegeId);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -93,7 +95,17 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
|
|
|
*/
|
|
|
@Override
|
|
|
public IPage<TAExamCourseResult> surveyAspointsList(IPage<Map> iPage, Long schoolId, Long examId, String courseCode, PublishStatusEnum publishStatus, SemesterEnum semester) {
|
|
|
- return taExamCourseMapper.surveyAspointsList(iPage, schoolId, examId, courseCode, Objects.nonNull(publishStatus) ? publishStatus.name() : null, Objects.nonNull(semester) ? semester.name() : null);
|
|
|
+ SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ QueryWrapper<SysOrg> sysOrgQueryWrapper = new QueryWrapper<>();
|
|
|
+ sysOrgQueryWrapper.lambda().eq(SysOrg::getParentId, sysUser.getOrgId())
|
|
|
+ .eq(SysOrg::getEnable, true);
|
|
|
+ List<SysOrg> sysOrgList = sysOrgService.list(sysOrgQueryWrapper);
|
|
|
+ if (Objects.nonNull(sysOrgList) && sysOrgList.size() > 0) {
|
|
|
+ List<Long> collegeIds = sysOrgList.stream().map(s -> s.getId()).collect(Collectors.toList());
|
|
|
+ return taExamCourseMapper.surveyAspointsList(iPage, schoolId, examId, courseCode, Objects.nonNull(publishStatus) ? publishStatus.name() : null, Objects.nonNull(semester) ? semester.name() : null, collegeIds);
|
|
|
+ } else {
|
|
|
+ return taExamCourseMapper.surveyAspointsList(iPage, schoolId, examId, courseCode, Objects.nonNull(publishStatus) ? publishStatus.name() : null, Objects.nonNull(semester) ? semester.name() : null, Arrays.asList(sysUser.getOrgId()));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -249,9 +261,9 @@ public class TAExamCourseServiceImpl extends ServiceImpl<TAExamCourseMapper, TAE
|
|
|
for (TAExamCourseRecord taExamCourseRecord : taExamCourseRecordList) {
|
|
|
BigDecimal paperScore = taExamCourseRecord.getTotalScore();
|
|
|
BigDecimal assignScore;
|
|
|
- if (coefficient.compareTo(BigDecimal.ZERO) != 0){
|
|
|
- assignScore = paperScore.add((fullScore.subtract(paperScore)).divide(coefficient, 4, BigDecimal.ROUND_HALF_UP));
|
|
|
- }else {
|
|
|
+ if (coefficient.compareTo(BigDecimal.ZERO) != 0) {
|
|
|
+ assignScore = paperScore.add((fullScore.subtract(paperScore)).divide(coefficient, 4, BigDecimal.ROUND_HALF_UP));
|
|
|
+ } else {
|
|
|
assignScore = paperScore;
|
|
|
}
|
|
|
|