|
|
@ -181,6 +181,9 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
this.collectNodesToDelete(node.getId(), nodes, nodesToDelete);
|
|
|
|
this.collectNodesToDelete(node.getId(), nodes, nodesToDelete);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (ObjectUtils.isEmpty(nodesToDelete)) {
|
|
|
|
|
|
|
|
throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "删除节点不存在");
|
|
|
|
|
|
|
|
}
|
|
|
|
nodes.removeAll(nodesToDelete);
|
|
|
|
nodes.removeAll(nodesToDelete);
|
|
|
|
|
|
|
|
|
|
|
|
return buildTree(appraiseRepository.save(appraise));
|
|
|
|
return buildTree(appraiseRepository.save(appraise));
|
|
|
@ -189,6 +192,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void vote(AppraiseVoteDto appraiseVoteDto) {
|
|
|
|
public void vote(AppraiseVoteDto appraiseVoteDto) {
|
|
|
|
String targetId = appraiseVoteDto.getTargetId();
|
|
|
|
String targetId = appraiseVoteDto.getTargetId();
|
|
|
|
|
|
|
|
String classId = appraiseVoteDto.getClassId();
|
|
|
|
boolean spread = appraiseVoteDto.isSpread();
|
|
|
|
boolean spread = appraiseVoteDto.isSpread();
|
|
|
|
String targetType = appraiseVoteDto.getTargetType();
|
|
|
|
String targetType = appraiseVoteDto.getTargetType();
|
|
|
|
String appraiseId = appraiseVoteDto.getAppraiseId();
|
|
|
|
String appraiseId = appraiseVoteDto.getAppraiseId();
|
|
|
@ -197,6 +201,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断评价对象是否合法
|
|
|
|
if (!targetType.equals(TARGET_STUDENT) && !targetType.equals(TARGET_CLASS)) {
|
|
|
|
if (!targetType.equals(TARGET_STUDENT) && !targetType.equals(TARGET_CLASS)) {
|
|
|
|
throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "不受支持的评价对象");
|
|
|
|
throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "不受支持的评价对象");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -223,7 +228,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
// 初始化新的评价节点
|
|
|
|
// 初始化新的评价节点
|
|
|
|
AppraiseRecordItem item = new AppraiseRecordItem();
|
|
|
|
AppraiseRecordItem item = new AppraiseRecordItem();
|
|
|
|
item.setId(UUID.randomUUID().toString());
|
|
|
|
item.setId(UUID.randomUUID().toString());
|
|
|
|
item.setAppraiseNodeId(appraiseId);
|
|
|
|
item.setAppraiseNode(appraiseTreeNode);
|
|
|
|
item.setCreator(loginUser.getName());
|
|
|
|
item.setCreator(loginUser.getName());
|
|
|
|
item.setCreatorId(loginUser.getId());
|
|
|
|
item.setCreatorId(loginUser.getId());
|
|
|
|
item.setCreateTime(LocalDateTime.now());
|
|
|
|
item.setCreateTime(LocalDateTime.now());
|
|
|
@ -239,6 +244,7 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
record.setTargetType(TARGET_CLASS);
|
|
|
|
record.setTargetType(TARGET_CLASS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
record.setTargetId(targetId);
|
|
|
|
record.setTargetId(targetId);
|
|
|
|
|
|
|
|
record.setClassId(classId);
|
|
|
|
record.setAcademicYearId(academicYearId);
|
|
|
|
record.setAcademicYearId(academicYearId);
|
|
|
|
record.setPraiseCount(appraiseTreeNode.isPraise() ? 1 : -1);
|
|
|
|
record.setPraiseCount(appraiseTreeNode.isPraise() ? 1 : -1);
|
|
|
|
record.setScore(ObjectUtils.isEmpty(appraiseTreeNode.getScore()) ? 0 : appraiseTreeNode.getScore());
|
|
|
|
record.setScore(ObjectUtils.isEmpty(appraiseTreeNode.getScore()) ? 0 : appraiseTreeNode.getScore());
|
|
|
@ -263,6 +269,11 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void findVoteRecord(FindVoteRecordDto findVoteRecordDto) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 递归收集 id 的节点及 id 节点的孩子节点 (迭代器删除居然也报错)
|
|
|
|
* 递归收集 id 的节点及 id 节点的孩子节点 (迭代器删除居然也报错)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|