|
|
@@ -176,7 +176,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
|
|
|
@Override
|
|
|
public Page<BaseStudentAssessmentInspectionMobilePageVo> getMobilePage(Page<BaseStudentAssessmentInspectionMobilePageDto> page, BaseStudentAssessmentInspectionMobilePageDto dto) {
|
|
|
- if (dto.getClassIds() == null || dto.getClassIds().size() == 0) {
|
|
|
+ if (dto.getClassIds() == null || dto.getClassIds().isEmpty()) {
|
|
|
// 获取当前用户所管班级
|
|
|
List<Long> classIds = baseClassMapper.selectList(
|
|
|
Wrappers.<BaseClass>query().lambda()
|
|
|
@@ -185,17 +185,10 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
).stream().map(BaseClass::getId).collect(Collectors.toList());
|
|
|
dto.setClassIds(classIds);
|
|
|
}
|
|
|
- if (dto.getClassIds() == null || dto.getClassIds().size() == 0) {
|
|
|
+ if (dto.getClassIds() == null || dto.getClassIds().isEmpty()) {
|
|
|
return null;
|
|
|
}
|
|
|
- Page<BaseStudentAssessmentInspectionMobilePageVo> result = assessmentInspectionMapper.getMobilePage(page, dto);
|
|
|
- // 处理加减分
|
|
|
- result.getRecords().forEach((node) -> {
|
|
|
- if (node.getScoreType().equals(ScoreTypeEnum.ScoreMinus.getCode())) {
|
|
|
- node.setScore(node.getScore() * -1);
|
|
|
- }
|
|
|
- });
|
|
|
- return result;
|
|
|
+ return assessmentInspectionMapper.getMobilePage(page, dto);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -206,12 +199,17 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
result.setScore(result.getScore() * -1);
|
|
|
}
|
|
|
|
|
|
+ MPJLambdaWrapper<BaseStudentAssessmentStudentRelation> baseStudentAssessmentStudentRelationWrapper = new MPJLambdaWrapper<>();
|
|
|
+ baseStudentAssessmentStudentRelationWrapper
|
|
|
+ .select(BaseStudentAssessmentStudentRelation::getId)
|
|
|
+ .selectAs(XjrUser::getName,BaseStudentAssessmentStudentRelation::getName)
|
|
|
+ .selectAs(XjrUser::getCredentialNumber,BaseStudentAssessmentStudentRelation::getStudentId)
|
|
|
+ .eq(BaseStudentAssessmentStudentRelation::getBaseStudentAssessmentInspectionId, result.getBaseStudentAssessmentInspectionId())
|
|
|
+ .eq(BaseStudentAssessmentStudentRelation::getClassId, result.getClassId())
|
|
|
+ .leftJoin(XjrUser.class, XjrUser::getId, BaseStudentAssessmentStudentRelation::getUserId)
|
|
|
+ ;
|
|
|
// 获取学生信息
|
|
|
- List<BaseStudentAssessmentStudentRelation> baseStudentAssessmentStudentRelations = assessmentStudentRelationMapper.selectList(
|
|
|
- Wrappers.<BaseStudentAssessmentStudentRelation>query().lambda()
|
|
|
- .eq(BaseStudentAssessmentStudentRelation::getBaseStudentAssessmentInspectionId, result.getBaseStudentAssessmentInspectionId())
|
|
|
- .eq(BaseStudentAssessmentStudentRelation::getClassId, result.getClassId())
|
|
|
- );
|
|
|
+ List<BaseStudentAssessmentStudentRelation> baseStudentAssessmentStudentRelations = assessmentStudentRelationMapper.selectList(baseStudentAssessmentStudentRelationWrapper);
|
|
|
result.setStudentList(baseStudentAssessmentStudentRelations);
|
|
|
result.setStudentCount(baseStudentAssessmentStudentRelations.size());
|
|
|
|
|
|
@@ -505,21 +503,25 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
|
|
|
if(!classIdList.isEmpty()){
|
|
|
//学生个人行为
|
|
|
- dto.setBaseStudentAssessmentCategoryId(1782327704603373570L);
|
|
|
+ dto.setCategoryCode("student_behavior");
|
|
|
Map<Long , QuantitativeAssessmentSingleScoreVo> individualBehaviorMap = getQuantitativeAssessmentSingleScoreMap(dto);
|
|
|
|
|
|
//常规管理
|
|
|
- dto.setBaseStudentAssessmentCategoryId(1782329720935329794L);
|
|
|
+ dto.setCategoryCode("convention_manage");
|
|
|
Map<Long , QuantitativeAssessmentSingleScoreVo> conventionalManagementMap = getQuantitativeAssessmentSingleScoreMap(dto);
|
|
|
|
|
|
//获奖及荣誉奖彰
|
|
|
- dto.setBaseStudentAssessmentCategoryId(1787316203484131329L);
|
|
|
+ dto.setCategoryCode("awards_and_honors");
|
|
|
Map<Long , QuantitativeAssessmentSingleScoreVo> awardsAndHonorableMap = getQuantitativeAssessmentSingleScoreMap(dto);
|
|
|
|
|
|
//准军事化考核
|
|
|
- dto.setBaseStudentAssessmentCategoryId(1868835208799236098L);
|
|
|
+ dto.setCategoryCode("militarize_manage");
|
|
|
Map<Long , QuantitativeAssessmentSingleScoreVo> paramilitaryMap = getQuantitativeAssessmentSingleScoreMap(dto);
|
|
|
|
|
|
+ //班级文化建设
|
|
|
+ dto.setCategoryCode("classe_culture");
|
|
|
+ Map<Long , QuantitativeAssessmentSingleScoreVo> classCultureMap = getQuantitativeAssessmentSingleScoreMap(dto);
|
|
|
+
|
|
|
//查询任课教师查询班级的数据
|
|
|
TeaEvaluateClassDto evaluateClassDto = new TeaEvaluateClassDto();
|
|
|
evaluateClassDto.setEvaluateType(EvaluateTypeEnum.TEACHER_EVALUATE_CLASS.getCode());
|
|
|
@@ -535,58 +537,82 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
List<TeaEvaluateClassListVo> teaEvaluateClassList = evaluateResultMapper.getTeaEvaluateClassList(evaluateClassDto);
|
|
|
Map<Long, List<TeaEvaluateClassListVo>> classEvaluateMap = teaEvaluateClassList.stream().collect(Collectors.groupingBy(TeaEvaluateClassListVo::getEvaluatedObjectId));
|
|
|
String jskhFormula = quotaFormulaRuleService.getFormulaByQuota("teacher_assessment");
|
|
|
+ String gfjyFormula = quotaFormulaRuleService.getFormulaByQuota("militarize_manage");
|
|
|
+ String xsgrFormula = quotaFormulaRuleService.getFormulaByQuota("student_behavior");
|
|
|
+ String cgglFormula = quotaFormulaRuleService.getFormulaByQuota("convention_manage");
|
|
|
+ String huojiangFormula = quotaFormulaRuleService.getFormulaByQuota("awards_and_honors");
|
|
|
+ String classCultureFormula = quotaFormulaRuleService.getFormulaByQuota("classe_culture");
|
|
|
|
|
|
//将结果写进对应的班级里
|
|
|
for(CalssQuantitativeAssessmentPageVo c: resultPage.getRecords()){
|
|
|
Long classId = Long.parseLong(c.getClassId());
|
|
|
+ //学生个人行为
|
|
|
if(individualBehaviorMap.get(classId) != null){
|
|
|
- c.setStuPersonalBehaviorSubScore(individualBehaviorMap.get(classId).getSumScore()==null?"":individualBehaviorMap.get(classId).getSumScore().toString());
|
|
|
- double v = (100 + individualBehaviorMap.get(classId).getSumScore()) / 100 * 25;
|
|
|
- c.setStuPersonalBehaviorScore(v + "");
|
|
|
+ Double sumScore = individualBehaviorMap.get(classId).getSumScore();
|
|
|
+ c.setStuPersonalBehaviorSubScore(sumScore==null?"":sumScore.toString());
|
|
|
+ String replacedExpression = xsgrFormula.replace("xsgrKouFen", Double.toString(sumScore));
|
|
|
+ ScriptEngineManager manager = new ScriptEngineManager();
|
|
|
+ ScriptEngine engine = manager.getEngineByName("JavaScript");
|
|
|
+ try {
|
|
|
+ double result = ((Number) engine.eval(replacedExpression)).doubleValue();
|
|
|
+ c.setStuPersonalBehaviorScore(BigDecimal.valueOf(result).setScale(2, RoundingMode.HALF_UP).doubleValue() + "");
|
|
|
+ } catch (ScriptException e) {
|
|
|
+ Log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+ //常规管理
|
|
|
if(conventionalManagementMap.get(classId) != null){
|
|
|
Double sumScore = conventionalManagementMap.get(classId).getSumScore();
|
|
|
if(sumScore != null){
|
|
|
String scoreStr = sumScore.toString();
|
|
|
-// boolean isInteger = sumScore == Math.floor(sumScore);
|
|
|
-// if(isInteger){
|
|
|
-// scoreStr = sumScore.intValue() + "";
|
|
|
-// }
|
|
|
c.setClassConventionalManageSubScore(scoreStr);
|
|
|
|
|
|
- double v = (100 + sumScore) / 100 * 25;
|
|
|
- c.setClassConventionalManageScore(v + "");
|
|
|
+ String replacedExpression = cgglFormula.replace("cgglKouFen", Double.toString(sumScore));
|
|
|
+ ScriptEngineManager manager = new ScriptEngineManager();
|
|
|
+ ScriptEngine engine = manager.getEngineByName("JavaScript");
|
|
|
+ try {
|
|
|
+ double result = ((Number) engine.eval(replacedExpression)).doubleValue();
|
|
|
+ c.setClassConventionalManageScore(BigDecimal.valueOf(result).setScale(2, RoundingMode.HALF_UP).doubleValue() + "");
|
|
|
+ } catch (ScriptException e) {
|
|
|
+ Log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ //获奖和荣誉
|
|
|
if(awardsAndHonorableMap.get(classId) != null){
|
|
|
Double sumScore = awardsAndHonorableMap.get(classId).getSumScore();
|
|
|
if(sumScore != null){
|
|
|
c.setHonorSumScore(sumScore.toString());
|
|
|
- if(sumScore < 10){
|
|
|
- c.setHonorScore(sumScore.toString());
|
|
|
- }else {
|
|
|
- c.setHonorScore("10");
|
|
|
+
|
|
|
+ String replacedExpression = huojiangFormula.replace("HuoJiang", Double.toString(sumScore));
|
|
|
+ ScriptEngineManager manager = new ScriptEngineManager();
|
|
|
+ ScriptEngine engine = manager.getEngineByName("JavaScript");
|
|
|
+ try {
|
|
|
+ double result = ((Number) engine.eval(replacedExpression)).doubleValue();
|
|
|
+ c.setHonorScore(BigDecimal.valueOf(result).setScale(2, RoundingMode.HALF_UP).doubleValue() + "");
|
|
|
+ } catch (ScriptException e) {
|
|
|
+ Log.error(e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ //军事化
|
|
|
if(paramilitaryMap.get(classId) != null){
|
|
|
Double sumScore = awardsAndHonorableMap.get(classId).getSumScore();
|
|
|
if(sumScore != null){
|
|
|
- c.setMilitaryManageScore(sumScore.toString());
|
|
|
- if(sumScore < 10){
|
|
|
- c.setHonorScore(sumScore.toString());
|
|
|
- }else {
|
|
|
- c.setHonorScore("10");
|
|
|
+ c.setMilitaryManageComprehensiveIndex(sumScore.toString());
|
|
|
+ //此项得分
|
|
|
+ String replacedExpression = gfjyFormula.replace("gfjyKouFen", Double.toString(sumScore));
|
|
|
+ ScriptEngineManager manager = new ScriptEngineManager();
|
|
|
+ ScriptEngine engine = manager.getEngineByName("JavaScript");
|
|
|
+ try {
|
|
|
+ double result = ((Number) engine.eval(replacedExpression)).doubleValue();
|
|
|
+ c.setMilitaryManageComprehensiveIndex(BigDecimal.valueOf(result).setScale(2, RoundingMode.HALF_UP).doubleValue() + "");
|
|
|
+ } catch (ScriptException e) {
|
|
|
+ Log.error(e.getMessage(), e);
|
|
|
}
|
|
|
-
|
|
|
- double v = (100 + sumScore) / 100 * 25;
|
|
|
- c.setMilitaryManageComprehensiveIndex(v + "");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ //任课教师考核
|
|
|
if(classEvaluateMap.containsKey(classId)){
|
|
|
Map<Long, List<TeaEvaluateClassListVo>> evaluateCategoryMap = classEvaluateMap.get(classId).stream().collect(Collectors.groupingBy(TeaEvaluateClassListVo::getId));
|
|
|
int size = evaluateCategoryMap.size();
|
|
|
@@ -611,6 +637,24 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
Log.error(e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
+ //班级文化建设
|
|
|
+ if(classCultureMap.containsKey(classId)){
|
|
|
+ Double sumScore = classCultureMap.get(classId).getSumScore();
|
|
|
+ if(sumScore != null){
|
|
|
+ c.setClassCultureScore(sumScore.toString());
|
|
|
+
|
|
|
+ String replacedExpression = classCultureFormula.replace("bjwhKouFen", Double.toString(sumScore));
|
|
|
+
|
|
|
+ ScriptEngineManager manager = new ScriptEngineManager();
|
|
|
+ ScriptEngine engine = manager.getEngineByName("JavaScript");
|
|
|
+ try {
|
|
|
+ double result = ((Number) engine.eval(replacedExpression)).doubleValue();
|
|
|
+ c.setClassCultureIndex(BigDecimal.valueOf(result).setScale(2, RoundingMode.HALF_UP).doubleValue() + "");
|
|
|
+ } catch (ScriptException e) {
|
|
|
+ Log.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -621,6 +665,7 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
List<QuantitativeAssessmentSingleScoreVo> individualBehaviorList = assessmentInspectionMapper.getAssessmentInspectionByClassIdList(new QuantitativeAssessmentSingleScoreDto(){{
|
|
|
setClassIdList(dto.getClassIdList());
|
|
|
setBaseStudentAssessmentCategoryId(dto.getBaseStudentAssessmentCategoryId());
|
|
|
+ setCategoryCode(dto.getCategoryCode());
|
|
|
if(dto.getBaseSemesterId() != null){
|
|
|
setBaseSemesterId(dto.getBaseSemesterId());
|
|
|
}
|
|
|
@@ -876,6 +921,18 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
cell.setCellValue(pageVo.getTeacherAssessScore());
|
|
|
cell.setCellStyle(cellStyle);
|
|
|
|
|
|
+
|
|
|
+ columnNumber ++;
|
|
|
+ cell = dataRow.createCell(columnNumber);
|
|
|
+ cell.setCellValue(pageVo.getClassCultureScore());
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+
|
|
|
+ columnNumber ++;
|
|
|
+ cell = dataRow.createCell(columnNumber);
|
|
|
+ cell.setCellValue(pageVo.getClassCultureIndex());
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+
|
|
|
+
|
|
|
columnNumber ++;
|
|
|
cell = dataRow.createCell(columnNumber);
|
|
|
cell.setCellValue(pageVo.getAssessSumScore());
|
|
|
@@ -979,6 +1036,14 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
sheet.addMergedRegion(new CellRangeAddress(0, 0, columnNumber, columnNumber + 1));
|
|
|
columnNumber ++;
|
|
|
|
|
|
+ columnNumber ++;
|
|
|
+ cell = row.createCell(columnNumber);
|
|
|
+ cell.setCellValue("班级文化建设");
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(0, 0, columnNumber, columnNumber + 1));
|
|
|
+ columnNumber ++;
|
|
|
+
|
|
|
+
|
|
|
columnNumber ++;
|
|
|
cell = row.createCell(columnNumber);
|
|
|
cell.setCellValue("月份总得分");
|
|
|
@@ -1054,5 +1119,15 @@ public class BaseStudentAssessmentInspectionServiceImpl extends MPJBaseServiceIm
|
|
|
cell = row.createCell(columnNumber);
|
|
|
cell.setCellValue("此项得分");
|
|
|
cell.setCellStyle(cellStyle);
|
|
|
+
|
|
|
+
|
|
|
+ cell = row.createCell(columnNumber);
|
|
|
+ cell.setCellValue("扣分");
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
+ columnNumber ++;
|
|
|
+
|
|
|
+ cell = row.createCell(columnNumber);
|
|
|
+ cell.setCellValue("此项得分");
|
|
|
+ cell.setCellStyle(cellStyle);
|
|
|
}
|
|
|
}
|