|
@@ -2,7 +2,10 @@ package com.diagbot.facade;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.dto.DoctorAdviceDTO;
|
|
|
+import com.diagbot.exception.CommonErrorCode;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.impl.DoctorAdviceServiceImpl;
|
|
|
+import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.SysUserUtils;
|
|
|
import com.diagbot.vo.DoctorAdviceVO;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -15,8 +18,19 @@ import org.springframework.stereotype.Component;
|
|
|
@Component
|
|
|
public class DoctorAdviceFacade extends DoctorAdviceServiceImpl {
|
|
|
|
|
|
- public IPage<DoctorAdviceDTO> getPageFac(DoctorAdviceVO doctorAdviceVO){
|
|
|
+ public IPage<DoctorAdviceDTO> getPageFac(DoctorAdviceVO doctorAdviceVO) {
|
|
|
doctorAdviceVO.setHospitalId(Long.valueOf(SysUserUtils.getCurrentHospitalID()));
|
|
|
+ if (null != doctorAdviceVO.getDaStartDateStart()) {
|
|
|
+ doctorAdviceVO.setDaStartDateStart(DateUtil.getFirstTimeOfDay(doctorAdviceVO.getDaStartDateStart()));
|
|
|
+ }
|
|
|
+ if (null != doctorAdviceVO.getDaStartDateEnd()) {
|
|
|
+ doctorAdviceVO.setDaStartDateEnd(DateUtil.getFirstTimeOfDay(DateUtil.addDay(doctorAdviceVO.getDaStartDateEnd(), 1)));
|
|
|
+ }
|
|
|
+ if (null != doctorAdviceVO.getDaStartDateStart() && null != doctorAdviceVO.getDaStartDateEnd()) {
|
|
|
+ if (DateUtil.after(doctorAdviceVO.getDaStartDateStart(), doctorAdviceVO.getDaStartDateEnd())) {
|
|
|
+ throw new CommonException(CommonErrorCode.PARAM_IS_ERROR, "开始时间必须小于结束时间!");
|
|
|
+ }
|
|
|
+ }
|
|
|
return this.getPage(doctorAdviceVO);
|
|
|
}
|
|
|
}
|