|
@@ -20,9 +20,10 @@ import cn.tr.module.smart.common.po.*;
|
|
|
import cn.tr.module.smart.common.repository.*;
|
|
import cn.tr.module.smart.common.repository.*;
|
|
|
import cn.tr.module.smart.common.service.IBizMissionDocService;
|
|
import cn.tr.module.smart.common.service.IBizMissionDocService;
|
|
|
import cn.tr.module.smart.wx.controller.vo.BizDeptAndDocVO;
|
|
import cn.tr.module.smart.wx.controller.vo.BizDeptAndDocVO;
|
|
|
|
|
+import cn.tr.module.smart.wx.dto.BizWxAllMissionDocQueryDTO;
|
|
|
import cn.tr.module.smart.wx.dto.BizWxKnowledgeDocQueryDTO;
|
|
import cn.tr.module.smart.wx.dto.BizWxKnowledgeDocQueryDTO;
|
|
|
import cn.tr.module.smart.wx.dto.BizWxMissionDocQueryDTO;
|
|
import cn.tr.module.smart.wx.dto.BizWxMissionDocQueryDTO;
|
|
|
-import cn.tr.module.smart.wx.dto.BizWxQueryPO;
|
|
|
|
|
|
|
+import cn.tr.module.smart.wx.dto.BizWxQueryDTO;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -30,10 +31,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.Collection;
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 宣教文档Service接口实现类
|
|
* 宣教文档Service接口实现类
|
|
@@ -207,19 +205,7 @@ public class BizMissionDocServiceImpl implements IBizMissionDocService {
|
|
|
if (Objects.isNull(bizClinicPO)) {
|
|
if (Objects.isNull(bizClinicPO)) {
|
|
|
throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "患者手术信息不存在");
|
|
throw new ServiceException(TRExcCode.SYSTEM_ERROR_B0001, "患者手术信息不存在");
|
|
|
}
|
|
}
|
|
|
- DateTime clinicStartTime = DateUtil.beginOfDay(bizClinicPO.getClinicStartTime());
|
|
|
|
|
- DateTime queryDate = DateUtil.beginOfDay(query.getQueryDate());
|
|
|
|
|
- //计算传入时间跟查无如时间差值
|
|
|
|
|
- long time = DateUtil.between(clinicStartTime, queryDate, DateUnit.DAY);
|
|
|
|
|
- //判断传入时间跟手术开始时间之前 手术当天算术前
|
|
|
|
|
- boolean isBefore = DateUtil.compare(queryDate, clinicStartTime) <= 0;
|
|
|
|
|
- String phase;
|
|
|
|
|
- if (isBefore) {
|
|
|
|
|
- phase = PhaseConstant.BEFORE;
|
|
|
|
|
- } else {
|
|
|
|
|
- phase = PhaseConstant.AFTER;
|
|
|
|
|
- }
|
|
|
|
|
- return baseRepository.selectBizDeptAndDocByDeptIdList(new BizWxQueryPO(bizClinicPO.getDeptId(), time, phase));
|
|
|
|
|
|
|
+ return selectWxMissionDocListByPhaseAndTime(bizClinicPO.getClinicStartTime(),query.getQueryDate(),bizClinicPO.getDeptId());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -230,7 +216,7 @@ public class BizMissionDocServiceImpl implements IBizMissionDocService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public List<BizDeptAndDocVO> selectWxKnowledgeDocList(BizWxKnowledgeDocQueryDTO query) {
|
|
public List<BizDeptAndDocVO> selectWxKnowledgeDocList(BizWxKnowledgeDocQueryDTO query) {
|
|
|
- return baseRepository.selectBizDeptAndDocByDeptIdList(new BizWxQueryPO(query.getDeptId(), query.getTitle()));
|
|
|
|
|
|
|
+ return baseRepository.selectBizDeptAndDocByDeptIdList(new BizWxQueryDTO(query.getDeptId(), query.getTitle()));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -256,4 +242,24 @@ public class BizMissionDocServiceImpl implements IBizMissionDocService {
|
|
|
return bizDeptAndDocVO;
|
|
return bizDeptAndDocVO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<BizDeptAndDocVO> selectWxAllKnowledgeDocList(BizWxAllMissionDocQueryDTO query) {
|
|
|
|
|
+ return selectWxMissionDocListByPhaseAndTime(new Date(),query.getQueryDate(),null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private List<BizDeptAndDocVO> selectWxMissionDocListByPhaseAndTime(Date startTime,Date queryTime,String deptId){
|
|
|
|
|
+ DateTime clinicStartTime = DateUtil.beginOfDay(startTime);
|
|
|
|
|
+ DateTime queryDate = DateUtil.beginOfDay(queryTime);
|
|
|
|
|
+ //计算传入时间跟查无如时间差值
|
|
|
|
|
+ long time = DateUtil.between(clinicStartTime, queryDate, DateUnit.DAY);
|
|
|
|
|
+ //判断传入时间跟手术开始时间之前 手术当天算术前
|
|
|
|
|
+ boolean isBefore = DateUtil.compare(queryDate, clinicStartTime) <= 0;
|
|
|
|
|
+ String phase;
|
|
|
|
|
+ if (isBefore) {
|
|
|
|
|
+ phase = PhaseConstant.BEFORE;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ phase = PhaseConstant.AFTER;
|
|
|
|
|
+ }
|
|
|
|
|
+ return baseRepository.selectBizDeptAndDocByDeptIdList(new BizWxQueryDTO(deptId, time, phase));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|