manage : 问题库列表添加父级字典

dev_2.1.0
xueqingkun 1 year ago
parent fa51965b82
commit 2bcbca68d2

@ -36,7 +36,12 @@ public class AskQuestionLibraryManageServiceImpl implements AskQuestionLibraryMa
public Page<AskQuestionLibraryResVo> queryPageList(Integer pageNum, Integer pageSize,
AskQuestionLibraryReqVo askQuestionLibraryReqVo) {
return askTemplateQuestionLibraryService.queryPageList(pageNum,pageSize,askQuestionLibraryReqVo);
Page<AskQuestionLibraryResVo> askQuestionLibraryResVoPage = askTemplateQuestionLibraryService.queryPageList(pageNum, pageSize, askQuestionLibraryReqVo);
if (CollUtil.isNotEmpty(askQuestionLibraryResVoPage.getRecords())){
askQuestionLibraryResVoPage.getRecords().forEach(AskQuestionLibraryResVo::generateDicIdPath);
}
return askQuestionLibraryResVoPage;
}
@Override

@ -1,8 +1,10 @@
package com.supervision.vo.manage;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
@ -20,6 +22,9 @@ public class AskQuestionLibraryResVo {
@ApiModelProperty("问题类目id")
private String dictId;
@ApiModelProperty(value = "问题类目父级id")
private String parentDictId;
@ApiModelProperty("由用户传入的问题生成的问题列表")
private List<String> question;
@ -34,4 +39,17 @@ public class AskQuestionLibraryResVo {
@ApiModelProperty("类目名")
private String nameZh;
private List<Integer> dicIdPath;
public void generateDicIdPath(){
dicIdPath = new ArrayList<>();
if (StrUtil.isNotEmpty(parentDictId)){
dicIdPath.add(Integer.parseInt(parentDictId));
}
if (StrUtil.isNotEmpty(dictId)){
dicIdPath.add(Integer.parseInt(dictId));
}
}
}

@ -46,6 +46,7 @@
atql.id as libraryQuestionId,
cd.code as code,
atql.dict_id as dictId,
cd.parent_id as parentDictId,
atql.description as description,
atql.question as question,
cd.name_zh_path as nameZhPath,

Loading…
Cancel
Save