|
|
@ -60,8 +60,6 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
* 从 token 中获取 schoolId
|
|
|
|
* 从 token 中获取 schoolId
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private Appraise findAppraise(String periodId) {
|
|
|
|
private Appraise findAppraise(String periodId) {
|
|
|
|
// 默认学区为 default
|
|
|
|
|
|
|
|
periodId = StringUtils.isEmpty(periodId) ? "default" : periodId;
|
|
|
|
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
|
|
|
|
|
|
|
@ -76,8 +74,6 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public Appraise getTree(GetEvaluateTreeDto getEvaluateTreeDto) {
|
|
|
|
public Appraise getTree(GetEvaluateTreeDto getEvaluateTreeDto) {
|
|
|
|
String periodId = getEvaluateTreeDto.getPeriodId();
|
|
|
|
String periodId = getEvaluateTreeDto.getPeriodId();
|
|
|
|
// 默认学区为 default
|
|
|
|
|
|
|
|
periodId = StringUtils.isEmpty(periodId) ? "default" : periodId;
|
|
|
|
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
User loginUser = SecurityUtil.getLoginUser();
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
String schoolId = loginUser.getSchoolId();
|
|
|
|
Appraise appraise = appraiseRepository.findAppraiseBySchoolIdAndPeriodIdAndCode(schoolId, periodId, PK.PK_APPRAISE);
|
|
|
|
Appraise appraise = appraiseRepository.findAppraiseBySchoolIdAndPeriodIdAndCode(schoolId, periodId, PK.PK_APPRAISE);
|
|
|
@ -279,7 +275,10 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
|
|
|
|
|
|
|
|
// 获取评价项节点
|
|
|
|
// 获取评价项节点
|
|
|
|
List<AppraiseTreeNode> nodes = appraiseRepository.findNodeById(PK.PK_APPRAISE, appraiseId);
|
|
|
|
List<AppraiseTreeNode> nodes = appraiseRepository.findNodeById(PK.PK_APPRAISE, appraiseId);
|
|
|
|
AppraiseTreeNode appraiseTreeNode = RepositoryUtil.findOne(nodes, "获取评价项失败");
|
|
|
|
AppraiseTreeNode appraiseTreeNode = RepositoryUtil.findOne(nodes, "该评价项不存在");
|
|
|
|
|
|
|
|
if (appraiseTreeNode.getPath() == null) {
|
|
|
|
|
|
|
|
throw new ServiceException(ErrorCode.PARAMS_ERROR.getCode(), "仅能评价三级评价项");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 通过 periodId 获取 semesters
|
|
|
|
// 通过 periodId 获取 semesters
|
|
|
|
List<School.Period> periodById = schoolRepository.findPeriodById(schoolId, periodId);
|
|
|
|
List<School.Period> periodById = schoolRepository.findPeriodById(schoolId, periodId);
|
|
|
@ -439,6 +438,10 @@ public class EvaluationServiceImpl implements EvaluationService {
|
|
|
|
for (AppraiseRecordItem record : records) {
|
|
|
|
for (AppraiseRecordItem record : records) {
|
|
|
|
AppraiseTreeNode appraiseNode = record.getAppraiseNode();
|
|
|
|
AppraiseTreeNode appraiseNode = record.getAppraiseNode();
|
|
|
|
String[] path = appraiseNode.getPath();
|
|
|
|
String[] path = appraiseNode.getPath();
|
|
|
|
|
|
|
|
// 数据异常则跳过
|
|
|
|
|
|
|
|
if (path == null || path.length == 0){
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
String root = path[0];
|
|
|
|
String root = path[0];
|
|
|
|
if (appraiseNode.isPraise()) {
|
|
|
|
if (appraiseNode.isPraise()) {
|
|
|
|
praiseDistribution.put(root, praiseDistribution.getOrDefault(root, 0) + 1);
|
|
|
|
praiseDistribution.put(root, praiseDistribution.getOrDefault(root, 0) + 1);
|
|
|
|