|
@@ -21,6 +21,8 @@ import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.diagbot.client.TranServiceClient;
|
|
|
import com.diagbot.dto.GetEvaluationScalesDTO;
|
|
|
import com.diagbot.dto.GetEvaluationsDTO;
|
|
@@ -296,47 +298,35 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
* @param hisInquirysVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<HisInquiryDTO> hisInquirys(HisInquirysVO hisInquirysVO) {
|
|
|
- QueryWrapper<InquiryInfo> queryWrapper = new QueryWrapper<InquiryInfo>();
|
|
|
- queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- queryWrapper.eq("hospital_id", hisInquirysVO.getHospitalId());
|
|
|
- if (hisInquirysVO.getHospitalDeptId() != null) {
|
|
|
- queryWrapper.eq("hospital_dept_id", hisInquirysVO.getHospitalDeptId());
|
|
|
- }
|
|
|
- if (hisInquirysVO.getDoctorId() != null) {
|
|
|
- queryWrapper.eq("doctor_id", hisInquirysVO.getDoctorId());
|
|
|
- }
|
|
|
- if (hisInquirysVO.getPatientId() != null) {
|
|
|
- queryWrapper.eq("patient_id", hisInquirysVO.getPatientId());
|
|
|
- }
|
|
|
- if (hisInquirysVO.getType() != null) {
|
|
|
- queryWrapper.eq("type", hisInquirysVO.getType());
|
|
|
- }
|
|
|
- if (hisInquirysVO.getSign() != null) {
|
|
|
- queryWrapper.eq("sign", hisInquirysVO.getSign());
|
|
|
- }
|
|
|
- if (hisInquirysVO.getStartDate() != null) {
|
|
|
- queryWrapper.ge("gmt_create", hisInquirysVO.getStartDate());
|
|
|
- }
|
|
|
- if (hisInquirysVO.getEndDate() != null) {
|
|
|
- queryWrapper.le("gmt_create", hisInquirysVO.getEndDate());
|
|
|
- }
|
|
|
- if (hisInquirysVO.getOrderType() == 1) {
|
|
|
- queryWrapper.orderByDesc("gmt_modified");
|
|
|
- } else if (hisInquirysVO.getOrderType() == 2) {
|
|
|
- queryWrapper.orderByAsc("gmt_modified");
|
|
|
- }
|
|
|
-
|
|
|
+ public IPage<HisInquiryDTO> hisInquirys(HisInquirysVO hisInquirysVO) {
|
|
|
+ Page<HisInquiryDTO> hisInquiryDTOPage = new Page<>();
|
|
|
+
|
|
|
+ QueryWrapper<InquiryInfo> inquiryInfoQe = new QueryWrapper<>();
|
|
|
+ inquiryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ inquiryInfoQe.eq("hospital_id", hisInquirysVO.getHospitalId());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getHospitalDeptId() != null, "hospital_dept_id", hisInquirysVO.getHospitalDeptId());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getDoctorId() != null, "doctor_id", hisInquirysVO.getDoctorId());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getPatientId() != null, "patient_id", hisInquirysVO.getPatientId());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getType() != null, "type", hisInquirysVO.getType());
|
|
|
+ inquiryInfoQe.eq(hisInquirysVO.getSign() != null, "sign", hisInquirysVO.getSign());
|
|
|
+ inquiryInfoQe.ge(hisInquirysVO.getStartDate() != null, "gmt_create", hisInquirysVO.getStartDate());
|
|
|
+ inquiryInfoQe.le(hisInquirysVO.getEndDate() != null, "gmt_create", hisInquirysVO.getEndDate());
|
|
|
+ inquiryInfoQe.orderByDesc(hisInquirysVO.getOrderType() == 1,"gmt_modified");
|
|
|
+ inquiryInfoQe.orderByAsc(hisInquirysVO.getOrderType() == 2, "gmt_modified");
|
|
|
+
|
|
|
if (hisInquirysVO.getDisType() == 1) {
|
|
|
Date nowDate = DateUtil.now();
|
|
|
Date lastDate = DateUtil.addMonth(nowDate, -6);
|
|
|
- queryWrapper.ge("gmt_create", lastDate);
|
|
|
- queryWrapper.le("gmt_create", nowDate);
|
|
|
- queryWrapper.likeRight("diagnose", hisInquirysVO.getDisName());
|
|
|
+ inquiryInfoQe.ge("gmt_create", lastDate);
|
|
|
+ inquiryInfoQe.le("gmt_create", nowDate);
|
|
|
+ inquiryInfoQe.likeRight("diagnose", hisInquirysVO.getDisName());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- List<InquiryInfo> inquiryInfoList = this.list(queryWrapper);
|
|
|
+ Page<InquiryInfo> inquiryInfoPage = new Page<>(hisInquirysVO.getCurrent(),hisInquirysVO.getSize());
|
|
|
+ IPage<InquiryInfo> iPage = this.page(inquiryInfoPage, inquiryInfoQe);
|
|
|
+ BeanUtil.copyProperties(iPage, hisInquiryDTOPage);
|
|
|
+
|
|
|
+ List<InquiryInfo> inquiryInfoList = iPage.getRecords();
|
|
|
if (inquiryInfoList.size() == 0) {
|
|
|
return null;
|
|
|
}
|
|
@@ -371,8 +361,8 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
hisInquiryDTOList.add(hisInquiryDTO);
|
|
|
});
|
|
|
|
|
|
-
|
|
|
- return hisInquiryDTOList;
|
|
|
+ hisInquiryDTOPage.setRecords(hisInquiryDTOList);
|
|
|
+ return hisInquiryDTOPage;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -450,9 +440,11 @@ public class InquiryInfoFacade extends InquiryInfoServiceImpl {
|
|
|
*/
|
|
|
public GetInquiryDetailDTO getInquiryDetail(GetInquiryDetailVO getInquiryDetailVO) {
|
|
|
GetInquiryDetailDTO getInquiryDetailDTO = new GetInquiryDetailDTO();
|
|
|
-
|
|
|
+
|
|
|
+ InquiryInfo inquiryInfo = this.getById(getInquiryDetailVO.getInquiryId());
|
|
|
List<InquiryDetail> inquiryDetailList = inquiryDetailFacade.getListByInquryId(getInquiryDetailVO.getInquiryId());
|
|
|
-
|
|
|
+
|
|
|
+ getInquiryDetailDTO.setDataJson(inquiryInfo.getDataJson());
|
|
|
getInquiryDetailDTO.setInquiryDetailList(inquiryDetailList);
|
|
|
|
|
|
return getInquiryDetailDTO;
|