@ -426,8 +426,8 @@ public class EvaluationServiceImpl implements EvaluationService {
academicYearId ,
academicYearId ,
String . format ( PK . PK_APPRAISE_RECORD , schoolId )
String . format ( PK . PK_APPRAISE_RECORD , schoolId )
) ;
) ;
// 班级内学生总数
int stuInClassCount = studentRepository . countByClassIdAndCode ( classId , String . format ( PK . STUDENT , schoolId ) ) ;
int stuInClassCount = studentRepository . countByClassIdAndCode ( classId , String . format ( PK . STUDENT , schoolId ) ) ;
List < AppraiseRecord > classRecord = appraiseRecordRepository . findClassRecord ( String . format ( PK . PK_APPRAISE_RECORD , schoolId ) , academicYearId , classId ) ;
if ( appraiseRecord = = null | | appraiseRecord . getNodes ( ) = = null ) {
if ( appraiseRecord = = null | | appraiseRecord . getNodes ( ) = = null ) {
throw new ServiceException ( ErrorCode . OPERATION_ERROR . getCode ( ) , "当前学生暂未产生评价数据,无法生成报告" ) ;
throw new ServiceException ( ErrorCode . OPERATION_ERROR . getCode ( ) , "当前学生暂未产生评价数据,无法生成报告" ) ;
@ -450,9 +450,11 @@ public class EvaluationServiceImpl implements EvaluationService {
Map < String , Integer > praiseNodeMap = new HashMap < > ( ) ;
Map < String , Integer > praiseNodeMap = new HashMap < > ( ) ;
Map < String , Integer > criticalNodeMap = new HashMap < > ( ) ;
Map < String , Integer > criticalNodeMap = new HashMap < > ( ) ;
// 计算当前学生排名在全班次位
// 计算当前学生排名在全班次位
int greaterCount = appraiseRecordRepository . findClassRecord ( String . format ( PK . PK_APPRAISE_RECORD , schoolId ) , academicYearId , classId , praiseCount ) ;
float beyondPercent = 0 ;
float beyondPercent = 0 ;
long currentRank = classRecord. stream ( ) . filter ( item - > item . getPraiseCount ( ) < praiseCount ) . count ( ) ;
long currentRank = stuInClassCount - greaterCount ;
beyondPercent = ( float ) currentRank / stuInClassCount ;
beyondPercent = ( float ) currentRank / stuInClassCount ;
// 根据全部数据计算结果
// 根据全部数据计算结果
for ( AppraiseRecordItem record : records ) {
for ( AppraiseRecordItem record : records ) {
AppraiseTreeNode appraiseNode = record . getAppraiseNode ( ) ;
AppraiseTreeNode appraiseNode = record . getAppraiseNode ( ) ;