|
@@ -3,21 +3,31 @@
|
|
|
*/
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.AddTagRetrievalDTO;
|
|
|
import com.diagbot.dto.GetRetrievalsByTagDTO;
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.dto.RetrievalListDTO;
|
|
|
import com.diagbot.entity.Retrieval;
|
|
|
import com.diagbot.entity.RetrievalMapping;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.RetrievalServiceImpl;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
import com.diagbot.vo.AddTagRetrievalVO;
|
|
|
import com.diagbot.vo.DelRetrievalsByMapsVO;
|
|
|
import com.diagbot.vo.GetRetrievalsByTagVO;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
+import com.diagbot.vo.RetrievalListVO;
|
|
|
|
|
|
/**
|
|
|
* @author rgb
|
|
@@ -29,6 +39,8 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
|
|
|
@Autowired
|
|
|
private RetrievalMappingFacade retrievalMappingFacade;
|
|
|
+ @Autowired
|
|
|
+ private UserServiceClient userServiceClient;
|
|
|
|
|
|
/**
|
|
|
* 根据标签获取同义词
|
|
@@ -48,8 +60,15 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean delRetrievalsByMaps(DelRetrievalsByMapsVO delRetrievalsByMapsVO) {
|
|
|
- retrievalMappingFacade.removeByIds(delRetrievalsByMapsVO.getRetrievalMappingIds());
|
|
|
- return true;
|
|
|
+ QueryWrapper<RetrievalMapping> mappingQe = new QueryWrapper<>();
|
|
|
+ String userId = UserUtils.getCurrentPrincipleID();
|
|
|
+ RetrievalMapping retrievalMapping = new RetrievalMapping();
|
|
|
+ retrievalMapping.setGmtModified(DateUtil.now());
|
|
|
+ retrievalMapping.setModifier(userId);
|
|
|
+ retrievalMapping.setIsDeleted("Y");
|
|
|
+ mappingQe.in("id", delRetrievalsByMapsVO.getRetrievalMappingIds());
|
|
|
+ retrievalMappingFacade.update(retrievalMapping, mappingQe);
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -92,5 +111,22 @@ public class RetrievalFacade extends RetrievalServiceImpl {
|
|
|
addTagRetrievalDTO.setRetrievalMappingId(retrievalMapping.getId());
|
|
|
return addTagRetrievalDTO;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取标签同义词列表
|
|
|
+ * @param retrievalListVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public IPage<RetrievalListDTO> retrievalList(RetrievalListVO retrievalListVO) {
|
|
|
+ IPage<RetrievalListDTO> ipage = this.getRetrievalList(retrievalListVO);
|
|
|
+ List<String> ids = ipage.getRecords().stream().map(i->i.getOperatorName()).collect(Collectors.toList());
|
|
|
+ RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
|
|
|
+ if (respDTO == null || !"0".equals(respDTO.code)) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,
|
|
|
+ "获取用户信息失败");
|
|
|
+ }
|
|
|
+ ipage.getRecords().forEach(i->i.setOperatorName(respDTO.data.get(i.getOperatorName())));
|
|
|
+ return ipage;
|
|
|
+ }
|
|
|
|
|
|
}
|