Compare commits
2 Commits
f994fc391e
...
374a508737
| Author | SHA1 | Date | |
|---|---|---|---|
| 374a508737 | |||
| 80279a0586 |
@@ -574,12 +574,21 @@ public class CphGoodApplyServiceImpl extends ServiceImpl<CphGoodApplyMapper, Cph
|
||||
// 各科平均成绩75分以上含70分
|
||||
List<CphStuScoreMiddleDto> cphStuScoreMiddleDtos = new LambdaQueryChainWrapper<>(cphStuScoreMiddleDtoMapper)
|
||||
.eq(CphStuScoreMiddleDto::getStuNo, stuNo)
|
||||
.eq(CphStuScoreMiddleDto::getXndm, year.xndm)
|
||||
.list();
|
||||
BigDecimal Grade = new BigDecimal(0);
|
||||
for (CphStuScoreMiddleDto cphStuScoreMiddleDto : cphStuScoreMiddleDtos) {
|
||||
if(cphStuScoreMiddleDto.getCj().equals("不及格")){
|
||||
throw new RuntimeException("有不及格成绩,无法申请");
|
||||
}
|
||||
if(cphStuScoreMiddleDto.getCj().equals("及格")){
|
||||
BigDecimal bigDecimal = new BigDecimal("60.00");
|
||||
Grade = Grade.add(bigDecimal);
|
||||
}else{
|
||||
BigDecimal bigDecimal = new BigDecimal(cphStuScoreMiddleDto.getCj());
|
||||
Grade = Grade.add(bigDecimal);
|
||||
}
|
||||
}
|
||||
if (Grade.divide(new BigDecimal(cphStuScoreMiddleDtos.size()), 2, RoundingMode.HALF_UP)
|
||||
.compareTo(new BigDecimal(70)) < 0) {
|
||||
return AjaxResult.error("学生各科平均成绩需要达到70分以上");
|
||||
@@ -678,9 +687,17 @@ public class CphGoodApplyServiceImpl extends ServiceImpl<CphGoodApplyMapper, Cph
|
||||
|| Objects.equals(cphStuScoreMiddleDto.getCj(), "NULL")) {
|
||||
continue;
|
||||
}
|
||||
if(cphStuScoreMiddleDto.getCj().equals("不及格")){
|
||||
throw new RuntimeException("有不及格成绩,无法申请");
|
||||
}
|
||||
if(cphStuScoreMiddleDto.getCj().equals("及格")){
|
||||
BigDecimal bigDecimal = new BigDecimal("60.00");
|
||||
Grade = Grade.add(bigDecimal);
|
||||
}else{
|
||||
BigDecimal bigDecimal = new BigDecimal(cphStuScoreMiddleDto.getCj());
|
||||
Grade = Grade.add(bigDecimal);
|
||||
}
|
||||
}
|
||||
if (Grade.divide(new BigDecimal(cphStuScoreMiddleDtos.size()), 2, RoundingMode.HALF_UP)
|
||||
.compareTo(new BigDecimal(75)) < 0) {
|
||||
throw new RuntimeException("学生各科平均成绩需要达到75分以上");
|
||||
@@ -784,6 +801,7 @@ public class CphGoodApplyServiceImpl extends ServiceImpl<CphGoodApplyMapper, Cph
|
||||
// 各科平均成绩75分以上含75分
|
||||
LambdaQueryWrapper<CphStuScoreMiddleDto> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CphStuScoreMiddleDto::getStuNo, stuNo);
|
||||
queryWrapper.eq(CphStuScoreMiddleDto::getXndm, year.getXndm());
|
||||
List<CphStuScoreMiddleDto> cphStuScoreMiddleDtos = cphStuScoreMiddleDtoMapper
|
||||
.selectList(queryWrapper);
|
||||
BigDecimal Grade = new BigDecimal(0);
|
||||
@@ -794,9 +812,17 @@ public class CphGoodApplyServiceImpl extends ServiceImpl<CphGoodApplyMapper, Cph
|
||||
|| Objects.equals(cphStuScoreMiddleDto.getCj(), "NULL")) {
|
||||
continue;
|
||||
}
|
||||
if(cphStuScoreMiddleDto.getCj().equals("不及格")){
|
||||
throw new RuntimeException("有不及格成绩,无法申请");
|
||||
}
|
||||
if(cphStuScoreMiddleDto.getCj().equals("及格")){
|
||||
BigDecimal bigDecimal = new BigDecimal("60.00");
|
||||
Grade = Grade.add(bigDecimal);
|
||||
}else{
|
||||
BigDecimal bigDecimal = new BigDecimal(cphStuScoreMiddleDto.getCj());
|
||||
Grade = Grade.add(bigDecimal);
|
||||
}
|
||||
}
|
||||
if (Grade.divide(new BigDecimal(cphStuScoreMiddleDtos.size()), 2, RoundingMode.HALF_UP)
|
||||
.compareTo(new BigDecimal(75)) < 0) {
|
||||
throw new RuntimeException("学生各科平均成绩需要达到75分以上");
|
||||
@@ -993,9 +1019,17 @@ public class CphGoodApplyServiceImpl extends ServiceImpl<CphGoodApplyMapper, Cph
|
||||
.list();
|
||||
BigDecimal Grade = new BigDecimal(0);
|
||||
for (CphStuScoreMiddleDto cphStuScoreMiddleDto : cphStuScoreMiddleDtos) {
|
||||
if(cphStuScoreMiddleDto.getCj().equals("不及格")){
|
||||
throw new RuntimeException("有不及格成绩,无法申请");
|
||||
}
|
||||
if(cphStuScoreMiddleDto.getCj().equals("及格")){
|
||||
BigDecimal bigDecimal = new BigDecimal("60.00");
|
||||
Grade = Grade.add(bigDecimal);
|
||||
}else{
|
||||
BigDecimal bigDecimal = new BigDecimal(cphStuScoreMiddleDto.getCj());
|
||||
Grade = Grade.add(bigDecimal);
|
||||
}
|
||||
}
|
||||
if (Grade.divide(new BigDecimal(cphStuScoreMiddleDtos.size()), 2, RoundingMode.HALF_UP)
|
||||
.compareTo(new BigDecimal(70)) < 0) {
|
||||
return AjaxResult.error("学生各科平均成绩需要达到70分以上");
|
||||
|
||||
Reference in New Issue
Block a user