|
@ -10,12 +10,18 @@ import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
|
|
|
import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
|
|
|
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.*;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDiagnosisDO;
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
|
|
|
import com.yihu.jw.entity.order.BusinessOrderDO;
|
|
|
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
|
|
|
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
|
|
|
import com.yihu.jw.hospital.message.service.SystemMessageService;
|
|
|
import com.yihu.jw.hospital.prescription.dao.*;
|
|
|
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
|
|
|
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
|
|
|
import com.yihu.jw.hospital.prescription.dao.PrescriptionDiagnosisDao;
|
|
|
import com.yihu.jw.hospital.prescription.dao.PrescriptionInfoDao;
|
|
|
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
|
|
|
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
|
|
|
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
|
|
@ -25,7 +31,6 @@ import com.yihu.jw.im.service.ImService;
|
|
|
import com.yihu.jw.order.BusinessOrderService;
|
|
|
import com.yihu.jw.order.dao.BusinessOrderDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.repository.job.QuartzJobLogDao;
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
|
|
|
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
|
|
@ -38,8 +43,6 @@ import com.yihu.jw.util.http.HttpUtils;
|
|
|
import com.yihu.jw.utils.YkyySMSService;
|
|
|
import com.yihu.jw.utils.hibernate.HibenateUtils;
|
|
|
import com.yihu.jw.wechat.dao.WxPushLogDao;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@ -153,9 +156,9 @@ public class PrescriptionStatusUpdateService {
|
|
|
}
|
|
|
|
|
|
//根据处方id获取处方详情
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(preId);
|
|
|
WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findById(preId).orElse(null);
|
|
|
//根据门诊id获取门诊记录:如果处方状态为已完成,需要将门诊状态改为已诊
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outPatientId);
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outPatientId).orElse(null);
|
|
|
|
|
|
if (null != wlyyPrescriptionVOS) {
|
|
|
|
|
@ -241,7 +244,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
wlyyPrescriptionDiagnosisDOS.add(diagnosisDO);
|
|
|
}
|
|
|
//重新保存诊断
|
|
|
prescriptionDiagnosisDao.save(wlyyPrescriptionDiagnosisDOS);
|
|
|
prescriptionDiagnosisDao.saveAll(wlyyPrescriptionDiagnosisDOS);
|
|
|
//药品更新
|
|
|
List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = new ArrayList<>();
|
|
|
for (WlyyPrescriptionInfoVO infoVO : wlyyPrescriptionVO.getInfoVOs()) {
|
|
@ -290,7 +293,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
infoDO.setPackRetprice(infoVO.getPackRetprice());
|
|
|
wlyyPrescriptionInfoDOS.add(infoDO);
|
|
|
}
|
|
|
prescriptionInfoDao.save(wlyyPrescriptionInfoDOS);
|
|
|
prescriptionInfoDao.saveAll(wlyyPrescriptionInfoDOS);
|
|
|
|
|
|
Icd10 = Icd10.substring(0, Icd10.length() - 1);
|
|
|
Icd10Name = Icd10Name.substring(0, Icd10Name.length() - 1);
|
|
@ -362,7 +365,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
logger.info(outpatientDO.getId()+"的处方记录设置为结束");
|
|
|
}
|
|
|
}
|
|
|
outpatientDao.save(outpatientDOs);
|
|
|
outpatientDao.saveAll(outpatientDOs);
|
|
|
/*//退费
|
|
|
for (WlyyOutpatientDO outpatientDO:outpatientDOs){
|
|
|
long currentTime = new Date().getTime();
|
|
@ -414,7 +417,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
//结束门诊
|
|
|
outpatientDO.setStatus("0");
|
|
|
}
|
|
|
outpatientDao.save(outpatientDOs);
|
|
|
outpatientDao.saveAll(outpatientDOs);
|
|
|
//退费
|
|
|
for (WlyyOutpatientDO outpatientDO:outpatientDOs){
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
|
|
@ -446,7 +449,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
}
|
|
|
public String singelCancel(String outpatientId){
|
|
|
logger.info("进入结束超时未接诊的门诊");
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId).orElse(null);
|
|
|
String msgReturn = "";
|
|
|
if (null!=wlyyOutpatientDO){
|
|
|
logger.info("开始结束超时未接诊的门诊");
|
|
@ -513,7 +516,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
//推送消息到眼科通
|
|
|
BasePatientDO patient = basePatientDao.findById(wlyyOutpatientDO.getPatient());
|
|
|
BasePatientDO patient = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
logger.info("推送消息到眼科通");
|
|
|
ykyyService.pushNotificationToYktPatient(patient.getYktId(), messageDO.getTitle(), data.get("msg").toString());
|
|
@ -525,7 +528,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
//删除门诊号源
|
|
|
List<WlyyPatientRegisterTimeDO> list = patientRegisterTimeDao.findByOutpatientId(wlyyOutpatientDO.getId());
|
|
|
if (list != null && list.size() > 0) {
|
|
|
patientRegisterTimeDao.delete(list);
|
|
|
patientRegisterTimeDao.deleteAll(list);
|
|
|
}
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
|
|
|
try {
|
|
@ -636,7 +639,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
messageDO.setData(data.toString());
|
|
|
systemMessageService.saveMessage(messageDO);
|
|
|
//推送消息到眼科通
|
|
|
BasePatientDO patient = basePatientDao.findById(wlyyOutpatientDO.getPatient());
|
|
|
BasePatientDO patient = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
logger.info("推送消息到眼科通");
|
|
|
ykyyService.pushNotificationToYktPatient(patient.getYktId(), messageDO.getTitle(), data.get("msg").toString());
|
|
@ -645,7 +648,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
//删除门诊号源
|
|
|
List<WlyyPatientRegisterTimeDO> list = patientRegisterTimeDao.findByOutpatientId(wlyyOutpatientDO.getId());
|
|
|
if (list != null && list.size() > 0) {
|
|
|
patientRegisterTimeDao.delete(list);
|
|
|
patientRegisterTimeDao.deleteAll(list);
|
|
|
}
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
|
|
|
if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) {
|
|
@ -706,7 +709,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
}
|
|
|
logger.info(outpatientDO.getId()+"的处方记录设置为结束");
|
|
|
}
|
|
|
outpatientDao.save(outpatientDOs);
|
|
|
outpatientDao.saveAll(outpatientDOs);
|
|
|
//退费
|
|
|
for (WlyyOutpatientDO outpatientDO:outpatientDOs){
|
|
|
try {
|
|
@ -732,7 +735,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
}
|
|
|
public void cancelRecieveSingle(String outpatientId){
|
|
|
//将所有的已接诊的处方记录
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId).orElse(null);
|
|
|
if(outpatientDO!=null){
|
|
|
System.out.println(outpatientDO.getId()+"id______-");
|
|
|
//结束门诊
|
|
@ -844,7 +847,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
messageDO.setData(data.toString());
|
|
|
systemMessageService.saveMessage(messageDO);
|
|
|
//推送消息到眼科通
|
|
|
BasePatientDO patient = basePatientDao.findById(wlyyOutpatientDO.getPatient());
|
|
|
BasePatientDO patient = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
logger.info("推送消息到眼科通");
|
|
|
ykyyService.pushNotificationToYktPatient(patient.getYktId(), messageDO.getTitle(), data.get("msg").toString());
|
|
@ -853,7 +856,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
//删除门诊号源
|
|
|
List<WlyyPatientRegisterTimeDO> list = patientRegisterTimeDao.findByOutpatientId(wlyyOutpatientDO.getId());
|
|
|
if (list != null && list.size() > 0) {
|
|
|
patientRegisterTimeDao.delete(list);
|
|
|
patientRegisterTimeDao.deleteAll(list);
|
|
|
}
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
|
|
|
if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) {
|
|
@ -928,7 +931,7 @@ public class PrescriptionStatusUpdateService {
|
|
|
cal.add(Calendar.MINUTE,Integer.parseInt(remind));
|
|
|
Long now = new Date().getTime();
|
|
|
Long min = cal.getTime().getTime();
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId);
|
|
|
WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientId).orElse(null);
|
|
|
if (min<=now){
|
|
|
String mobileList[] = mobiles.split(",");
|
|
|
if ("1".equalsIgnoreCase(sendMesControl)){
|