up:移除获取默认评价树接口

develop
PL 1 month ago
parent 687e28f3df
commit b7cee64e37

@ -34,18 +34,6 @@ public class AppraiseController {
@Resource
private EvaluationService evaluationService;
/**
*
* @return
*/
@PostMapping("getDefaultTrees")
@ApiOperation(value = "获取默认评价树", notes = "获取默认评价树")
public R<Appraise> getDefaultTree() {
Appraise appraise = evaluationService.getDefaultTree();
return R.success(appraise);
}
@PostMapping("getTrees")
@ApiOperation(value = "获取评价树", notes = "获取评价树")
public R<Appraise> getEvaluateTree(@RequestBody @Valid GetEvaluateTreeDto getEvaluateTreeDto) {

@ -25,9 +25,6 @@ import java.util.Set;
public interface AppraiseRepository extends CosmosRepository<Appraise, String> {
Appraise findBySchoolId(String schoolId, PartitionKey partitionKey);
Appraise findAppraiseBySchoolIdAndPeriodIdAndCode(String schoolId, String periodId, String code);
Appraise findAppraiseById(String id, PartitionKey partitionKey);
/**
*

@ -20,13 +20,6 @@ import java.util.Map;
*/
public interface EvaluationService {
/**
*
* @return
*/
Appraise getDefaultTree();
Appraise getTree(GetEvaluateTreeDto getEvaluateTreeDto);
/**

@ -96,29 +96,6 @@ public class EvaluationServiceImpl implements EvaluationService {
return appraise;
}
/**
*
* @return
*/
@Override
public Appraise getDefaultTree(){
Appraise appraise = appraiseRepository.findAppraiseById("default",new PartitionKey(PK.PK_APPRAISE));
// 如果传参 period 所在没有 tree 的话,则复制一份模板 tree 给他 (处理节点 id)
if (appraise == null) {
appraise = RepositoryUtil.findOne(appraiseRepository.findTemplateTree(), "获取模板评价树失败");
if (appraise == null) {
throw new ServiceException("模板评价树不存在");
}
// refresh
refreshAppraiseTree(appraise);
appraise.setId(null);
appraise = appraiseRepository.save(appraise);
}
return this.buildTree(appraise);
}
@Override
public Appraise getTree(GetEvaluateTreeDto getEvaluateTreeDto) {
String periodId = getEvaluateTreeDto.getPeriodId();

Loading…
Cancel
Save