|
|
|
@ -235,6 +235,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
public void vote(AppraiseVoteDto appraiseVoteDto) {
|
|
|
|
|
String targetId = appraiseVoteDto.getTargetId();
|
|
|
|
|
boolean spread = appraiseVoteDto.isSpread();
|
|
|
|
|
boolean pushParent = appraiseVoteDto.isPushParent();
|
|
|
|
|
String targetType = appraiseVoteDto.getTargetType();
|
|
|
|
|
String appraiseId = appraiseVoteDto.getAppraiseId();
|
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
@ -293,6 +294,12 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
item.setCreator(loginUser.getName());
|
|
|
|
|
item.setCreatorId(loginUser.getId());
|
|
|
|
|
item.setCreateTime(LocalDateTime.now());
|
|
|
|
|
// 处理学校与学生的差异
|
|
|
|
|
if (targetType.equals(TARGET_CLASS)){
|
|
|
|
|
item.setSpread(spread);
|
|
|
|
|
} else {
|
|
|
|
|
item.setPushParent(pushParent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 不存在或者学生的班级不一样则创建一条新的,存在则处理一下分值后再向其 nodes 中插入一条 item
|
|
|
|
|
if (record == null || !classId.equals(record.getClassId())) {
|
|
|
|
@ -312,10 +319,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
record.setCode(String.format(PK.PK_APPRAISE_RECORD, schoolId));
|
|
|
|
|
appraiseRecordRepository.save(record);
|
|
|
|
|
} else {
|
|
|
|
|
// 处理学校与学生的差异
|
|
|
|
|
if (targetType.equals(TARGET_CLASS)){
|
|
|
|
|
item.setSpread(spread);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CosmosPatchOperations operations = CosmosPatchOperations.create();
|
|
|
|
|
operations.add("/nodes/0", item);
|
|
|
|
|
// 表扬
|
|
|
|
|