|
@@ -13,6 +13,7 @@ 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;
|
|
|
import com.diagbot.service.ConceptDetailService;
|
|
@@ -80,7 +81,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
* 医学知识(静态信息)检索
|
|
|
*
|
|
|
* @param staticKnowledgeIndexVO
|
|
|
- * @param type 0:过滤逻辑删除数据,1:不过滤逻辑删除数据
|
|
|
+ * @param type 0:过滤逻辑删除数据,1:不过滤逻辑删除数据
|
|
|
* @return
|
|
|
*/
|
|
|
public List<StaticKnowledgeIndexDTO> staticKnowledgeIndex(StaticKnowledgeIndexVO staticKnowledgeIndexVO, Integer type) {
|
|
@@ -107,6 +108,9 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
|
|
|
conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.in("name", conNameList);
|
|
|
+ if (type.equals(0)) {
|
|
|
+ conceptInfoQueryWrapper.eq("status", StatusEnum.Enable.getKey());
|
|
|
+ }
|
|
|
List<ConceptInfo> conceptInfoList = this.list(conceptInfoQueryWrapper);
|
|
|
if (ListUtil.isNotEmpty(conceptInfoList)) {
|
|
|
//typeName转换
|
|
@@ -125,9 +129,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
.collect(Collectors.toList());
|
|
|
if (ListUtil.isNotEmpty(conceptIdList)) {
|
|
|
QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
|
|
|
- if (type.equals(0)) {
|
|
|
- conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- }
|
|
|
+ conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
conceptDetailQueryWrapper.in("concept_id", conceptIdList);
|
|
|
List<ConceptDetail> conceptDetailList = conceptDetailFacade.list(conceptDetailQueryWrapper);
|
|
|
Map<Long, List<ConceptDetail>> detailMap
|
|
@@ -271,11 +273,12 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
conceptInfo.setModifier(userId);
|
|
|
conceptInfo.setGmtModified(now);
|
|
|
|
|
|
- //是否包含静态信息,包含启用和禁用
|
|
|
+ //是否包含静态信息
|
|
|
List<ConceptDetail> oldDetails = null;
|
|
|
QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
|
|
|
if (conceptInfo.getId() != null) {
|
|
|
conceptDetailQueryWrapper.eq("concept_id", conceptInfo.getId());
|
|
|
+ conceptDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
oldDetails = conceptDetailFacade.list(conceptDetailQueryWrapper);
|
|
|
}
|
|
|
if (conceptInfoVO.getId() == null
|
|
@@ -331,11 +334,20 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
public Boolean changeStatus(ChangeStatusVO changeStatusVO) {
|
|
|
String userId = UserUtils.getCurrentPrincipleID();
|
|
|
Date now = DateUtil.now();
|
|
|
+ //更新主表
|
|
|
+ UpdateWrapper<ConceptInfo> conceptInfoUpdateWrapper = new UpdateWrapper<>();
|
|
|
+ conceptInfoUpdateWrapper.eq("id", changeStatusVO.getId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
+ .set("gmt_modified", now)
|
|
|
+ .set("modifier", userId)
|
|
|
+ .set("status", changeStatusVO.getStatus());
|
|
|
+ this.update(conceptInfoUpdateWrapper);
|
|
|
+ //更新明细表
|
|
|
UpdateWrapper<ConceptDetail> conceptDetailUpdateWrapper = new UpdateWrapper<>();
|
|
|
conceptDetailUpdateWrapper.eq("concept_id", changeStatusVO.getId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.set("gmt_modified", now)
|
|
|
- .set("modifier", userId)
|
|
|
- .set("is_deleted", changeStatusVO.getIsDeleted());
|
|
|
+ .set("modifier", userId);
|
|
|
conceptDetailService.update(conceptDetailUpdateWrapper);
|
|
|
return true;
|
|
|
}
|
|
@@ -360,7 +372,8 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
return false;
|
|
|
}
|
|
|
QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
|
|
|
- conceptDetailQueryWrapper.eq("concept_id", conceptInfo.getId());
|
|
|
+ conceptDetailQueryWrapper.eq("concept_id", conceptInfo.getId())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
List<ConceptDetail> conceptDetailList = conceptDetailService.list(conceptDetailQueryWrapper);
|
|
|
if (ListUtil.isEmpty(conceptDetailList)) {
|
|
|
return false;
|
|
@@ -396,7 +409,6 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
|
|
|
conceptInfoDTO.setType(String.valueOf(StaticTypeEnum.getKey(typeName)));
|
|
|
conceptInfoDTO.setModifier(conceptDetailList.get(0).getModifier());
|
|
|
conceptInfoDTO.setGmtModified(conceptDetailList.get(0).getGmtModified());
|
|
|
- conceptInfoDTO.setIsDeleted(conceptDetailList.get(0).getIsDeleted());
|
|
|
}
|
|
|
return conceptInfoDTO;
|
|
|
}
|