|
|
|
@ -79,10 +79,9 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
|
Appraise appraise = appraiseRepository.findAppraiseBySchoolIdAndPeriodIdAndCode(schoolId, periodId, PK.PK_APPRAISE);
|
|
|
|
|
if (appraise != null) {
|
|
|
|
|
return this.buildTree(appraise);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 如果传参 period 所在没有 tree 的话,则复制一份模板 tree 给他 (处理节点 id)
|
|
|
|
|
if (appraise == null) {
|
|
|
|
|
appraise = RepositoryUtil.findOne(appraiseRepository.findTemplateTree(), "获取模板评价树失败");
|
|
|
|
|
if (appraise == null) {
|
|
|
|
|
throw new ServiceException();
|
|
|
|
@ -93,6 +92,8 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
appraise.setSchoolId(schoolId);
|
|
|
|
|
appraise.setId(null);
|
|
|
|
|
appraise = appraiseRepository.save(appraise);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this.buildTree(appraise);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -141,6 +142,8 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
for (AppraiseTreeNode parent : parents) {
|
|
|
|
|
buildChildren(parent, nodes);
|
|
|
|
|
}
|
|
|
|
|
// 排序
|
|
|
|
|
parents = parents.stream().sorted(Comparator.comparing(AppraiseTreeNode::getOrder)).collect(Collectors.toList());
|
|
|
|
|
appraise.setNodes(parents);
|
|
|
|
|
return appraise;
|
|
|
|
|
}
|
|
|
|
|