|
@@ -8,6 +8,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import com.diagbot.client.InquiryInfoServiceClient;
|
|
|
import com.diagbot.dto.*;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.vo.HisInquirysForDjVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Qualifier;
|
|
@@ -40,8 +41,6 @@ import com.google.common.collect.Lists;
|
|
|
@Component
|
|
|
public class InquiryInfoFacade extends InquiryInfoServiceImpl{
|
|
|
|
|
|
- @Autowired
|
|
|
- private InquiryInfoServiceClient inquiryInfoServiceClient;
|
|
|
@Autowired
|
|
|
private InquiryDetailFacade inquiryDetailFacade;
|
|
|
@Autowired
|
|
@@ -50,9 +49,52 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl{
|
|
|
@Qualifier("inquiryDetailServiceImpl")
|
|
|
private InquiryDetailServiceImpl inquiryDetailServiceImpl;
|
|
|
|
|
|
- public RespDTO<List<HisInquirysForDjDTO>> hisInquirysForDj(HisInquirysForDjVO hisInquirysForDjVO){
|
|
|
- RespDTO<List<HisInquirysForDjDTO>> list=inquiryInfoServiceClient.hisInquirysForDj(hisInquirysForDjVO);
|
|
|
- return list;
|
|
|
+ public List<HisInquirysForDjDTO> hisInquirysForDj(HisInquirysForDjVO hisInquirysForDjVO){
|
|
|
+ QueryWrapper<InquiryInfo> queryWrapper = new QueryWrapper<InquiryInfo>();
|
|
|
+ queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ queryWrapper.eq("hospital_id", hisInquirysForDjVO.getHospitalId());
|
|
|
+ if (hisInquirysForDjVO.getHospitalDeptId() != null) {
|
|
|
+ queryWrapper.eq("hospital_dept_id", hisInquirysForDjVO.getHospitalDeptId());
|
|
|
+ }
|
|
|
+ if (hisInquirysForDjVO.getDoctorId() != null) {
|
|
|
+ queryWrapper.eq("doctor_id", hisInquirysForDjVO.getDoctorId());
|
|
|
+ }
|
|
|
+ if (hisInquirysForDjVO.getPatientId() != null) {
|
|
|
+ queryWrapper.eq("patient_id", hisInquirysForDjVO.getPatientId());
|
|
|
+ }
|
|
|
+ if (StringUtil.isNotBlank(hisInquirysForDjVO.getInquiryCode())) {
|
|
|
+ queryWrapper.eq("inquiry_code", hisInquirysForDjVO.getInquiryCode());
|
|
|
+ }
|
|
|
+ if (hisInquirysForDjVO.getType() != null) {
|
|
|
+ queryWrapper.eq("type", hisInquirysForDjVO.getType());
|
|
|
+ }
|
|
|
+ if (hisInquirysForDjVO.getSign() != null) {
|
|
|
+ queryWrapper.eq("sign", hisInquirysForDjVO.getSign());
|
|
|
+ }
|
|
|
+ if (hisInquirysForDjVO.getStartDate() != null) {
|
|
|
+ queryWrapper.ge("gmt_create", hisInquirysForDjVO.getStartDate());
|
|
|
+ }
|
|
|
+ if (hisInquirysForDjVO.getEndDate() != null) {
|
|
|
+ queryWrapper.le("gmt_create", hisInquirysForDjVO.getEndDate());
|
|
|
+ }
|
|
|
+ if (hisInquirysForDjVO.getOrderType() == 1) {
|
|
|
+ queryWrapper.orderByDesc("gmt_modified");
|
|
|
+ } else if (hisInquirysForDjVO.getOrderType() == 2) {
|
|
|
+ queryWrapper.orderByAsc("gmt_modified");
|
|
|
+ }
|
|
|
+ List<InquiryInfo> inquiryInfoList = this.list(queryWrapper);
|
|
|
+ if (ListUtil.isEmpty(inquiryInfoList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<Long, List<InquiryDetail>> inquiryDetailMap = inquiryDetailFacade.getDetailsByInquryIds(inquiryInfoList.stream().map(i -> i.getId()).collect(Collectors.toList()));
|
|
|
+ List<HisInquirysForDjDTO> hisInquirysForDjDTOList = BeanUtil.listCopyTo(inquiryInfoList, HisInquirysForDjDTO.class);
|
|
|
+
|
|
|
+ hisInquirysForDjDTOList.forEach(i -> {
|
|
|
+ i.setContentList(inquiryDetailMap.get(i.getId()).stream().map(k -> k.getContentValue()).collect(Collectors.toList()));
|
|
|
+ });
|
|
|
+
|
|
|
+ return hisInquirysForDjDTOList;
|
|
|
}
|
|
|
|
|
|
/**
|