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