@ -241,6 +241,7 @@ public class EvaluationServiceImpl implements EvaluationService {
User loginUser = SecurityUtil . getLoginUser ( ) ;
String schoolId = loginUser . getSchoolId ( ) ;
String classId ;
String className ;
String periodId ;
String name ;
String avatar = null ;
@ -255,6 +256,10 @@ public class EvaluationServiceImpl implements EvaluationService {
name = student . getName ( ) ;
avatar = student . getPicture ( ) ;
gender = student . getGender ( ) ;
// 获取班级信息
ClassInfo classInfo = classRepository . findClassByIdAndCode ( classId , String . format ( PK . CLASS , schoolId ) ) ;
className = classInfo . getName ( ) ;
} else if ( targetType . equals ( TARGET_CLASS ) ) {
ClassInfo classInfo = classRepository . findClassByIdAndCode ( targetId , String . format ( PK . CLASS , schoolId ) ) ;
if ( classInfo = = null ) {
@ -263,6 +268,7 @@ public class EvaluationServiceImpl implements EvaluationService {
classId = targetId ;
periodId = classInfo . getPeriodId ( ) ;
name = classInfo . getName ( ) ;
className = classInfo . getName ( ) ;
} else {
throw new ServiceException ( ErrorCode . PARAMS_ERROR . getCode ( ) , "不受支持的评价对象" ) ;
}
@ -309,6 +315,7 @@ public class EvaluationServiceImpl implements EvaluationService {
record . setTargetId ( targetId ) ;
record . setTargetType ( targetType ) ;
record . setClassId ( classId ) ;
record . setClassName ( className ) ;
record . setName ( name ) ;
record . setAvatar ( avatar ) ;
record . setGender ( gender ) ;
@ -319,7 +326,6 @@ public class EvaluationServiceImpl implements EvaluationService {
record . setCode ( String . format ( PK . PK_APPRAISE_RECORD , schoolId ) ) ;
appraiseRecordRepository . save ( record ) ;
} else {
CosmosPatchOperations operations = CosmosPatchOperations . create ( ) ;
operations . add ( "/nodes/0" , item ) ;
// 表扬