|
@@ -12,7 +12,6 @@ import com.diagbot.dto.StaticKnowledgeIndexDTO;
|
|
|
import com.diagbot.entity.ConceptDetail;
|
|
|
import com.diagbot.entity.ConceptInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
-import com.diagbot.enums.StaticTypeEnum;
|
|
|
import com.diagbot.enums.StatusEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -214,9 +213,15 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
*/
|
|
|
public IPage<ConceptInfoDTO> getPage(ConceptInfoPageVO conceptInfoPageVO) {
|
|
|
List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
|
|
|
+ //静态知识类型
|
|
|
+ List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
|
|
|
+ Map<Integer, String> dicStaticTypeValNameMap =
|
|
|
+ EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
|
|
|
+ Map<String, Integer> dicStaticTypeNameValMap =
|
|
|
+ EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
|
|
|
if (StringUtil.isNotBlank(conceptInfoPageVO.getType())) {
|
|
|
String typeName
|
|
|
- = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoPageVO.getType())), 1, dicList);
|
|
|
+ = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoPageVO.getType()), 1, dicList);
|
|
|
conceptInfoPageVO.setTypeName(typeName);
|
|
|
}
|
|
|
IPage<ConceptInfoDTO> page = super.getPage(conceptInfoPageVO);
|
|
@@ -225,7 +230,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
records.forEach(record -> {
|
|
|
String typeName = convertTypeName(record.getType(), 2, dicList);
|
|
|
record.setTypeName(typeName);
|
|
|
- record.setType(String.valueOf(StaticTypeEnum.getKey(typeName)));
|
|
|
+ record.setType(String.valueOf(dicStaticTypeNameValMap.get(typeName)));
|
|
|
});
|
|
|
}
|
|
|
page.setRecords(records);
|
|
@@ -242,8 +247,14 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
String userId = UserUtils.getCurrentPrincipleID();
|
|
|
Date now = DateUtil.now();
|
|
|
List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
|
|
|
+ //静态知识类型
|
|
|
+ List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
|
|
|
+ Map<Integer, String> dicStaticTypeValNameMap =
|
|
|
+ EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
|
|
|
+ Map<String, Integer> dicStaticTypeNameValMap =
|
|
|
+ EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
|
|
|
//术语类型转换
|
|
|
- String typeName = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
|
|
|
+ String typeName = convertTypeName(dicStaticTypeValNameMap.get(conceptInfoVO.getType()), 1, dicList);
|
|
|
conceptInfoVO.setTypeName(typeName);
|
|
|
ConceptInfo conceptInfo = new ConceptInfo();
|
|
|
|
|
@@ -360,8 +371,14 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
*/
|
|
|
public Boolean isExist(ConceptInfoVO conceptInfoVO) {
|
|
|
List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
|
|
|
+ //静态知识类型
|
|
|
+ List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
|
|
|
+ Map<Integer, String> dicStaticTypeValNameMap =
|
|
|
+ EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
|
|
|
+ Map<String, Integer> dicStaticTypeNameValMap =
|
|
|
+ EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
|
|
|
//术语类型转换
|
|
|
- String typeName = convertTypeName(StaticTypeEnum.getName(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
|
|
|
+ String typeName = convertTypeName(dicStaticTypeValNameMap.get(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
|
|
|
conceptInfoVO.setTypeName(typeName);
|
|
|
QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
|
|
|
conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
@@ -389,6 +406,12 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
*/
|
|
|
public ConceptInfoDTO getRecordById(IdVO idVO) {
|
|
|
List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
|
|
|
+ //静态知识类型
|
|
|
+ List<DictionaryInfoDTO> dicStaticTypeList = dictionaryFacade.getListByGroupType(10);
|
|
|
+ Map<Integer, String> dicStaticTypeValNameMap =
|
|
|
+ EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "val", "name");
|
|
|
+ Map<String, Integer> dicStaticTypeNameValMap =
|
|
|
+ EntityUtil.makeMapWithKeyValue(dicStaticTypeList, "name", "val");
|
|
|
ConceptInfoDTO conceptInfoDTO = new ConceptInfoDTO();
|
|
|
ConceptInfo conceptInfo = this.getById(idVO.getId());
|
|
|
if (conceptInfo == null) {
|
|
@@ -406,7 +429,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
//启用状态、修改人、修改时间为明细的内容
|
|
|
String typeName = convertTypeName(conceptInfoDTO.getType(), 2, dicList);
|
|
|
conceptInfoDTO.setTypeName(typeName);
|
|
|
- conceptInfoDTO.setType(String.valueOf(StaticTypeEnum.getKey(typeName)));
|
|
|
+ conceptInfoDTO.setType(String.valueOf(dicStaticTypeNameValMap.get(typeName)));
|
|
|
conceptInfoDTO.setModifier(conceptDetailList.get(0).getModifier());
|
|
|
conceptInfoDTO.setGmtModified(conceptDetailList.get(0).getGmtModified());
|
|
|
}
|