Bladeren bron

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionExpressageLogDO.java
wangzhinan 4 jaren geleden
bovenliggende
commit
0f900fb85e

+ 4 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -18,7 +18,7 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.status in(0,1)")
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.status in(0,1)")
    List<WlyyOutpatientDO> findByPatientList(String patient);
    List<WlyyOutpatientDO> findByPatientList(String patient);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.hisStatus=1")
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.hisStatus<>1")
    List<WlyyOutpatientDO> findByPatientListNoStatus(String patient);
    List<WlyyOutpatientDO> findByPatientListNoStatus(String patient);
    List<WlyyOutpatientDO> findByDoctorAndStatus(String doctor,String status);
    List<WlyyOutpatientDO> findByDoctorAndStatus(String doctor,String status);
@ -26,6 +26,9 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.doctor = ?1 and a.status in(2,3)")
    @Query("from WlyyOutpatientDO a where a.doctor = ?1 and a.status in(2,3)")
    List<WlyyOutpatientDO> findByDoctorList(String doctor);
    List<WlyyOutpatientDO> findByDoctorList(String doctor);
    @Query("from WlyyOutpatientDO a where a.real_order = ?1 ")
    WlyyOutpatientDO findByRealOrder(String realOrder);
    Integer countByDoctorAndStatusAndOutpatientType(String doctor,String status,String outpatientType);
    Integer countByDoctorAndStatusAndOutpatientType(String doctor,String status,String outpatientType);
    List<WlyyOutpatientDO> findByDoctor(String doctor);
    List<WlyyOutpatientDO> findByDoctor(String doctor);

+ 8 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -1678,6 +1678,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            outpatientDO.setRegisterNo(serialNo);
            outpatientDO.setRegisterNo(serialNo);
            String conNo = (String) res.get("@times");
            String conNo = (String) res.get("@times");
            outpatientDO.setConNo(conNo);
            outpatientDO.setConNo(conNo);
            String xtgzh = (String) res.get("@xtgzh");
            String realOrder = (String) res.get("@real_order");
            outpatientDO.setXtgzh(xtgzh);
            outpatientDO.setRealOrder(realOrder);
            outpatientDO.setAdmDate(new Date());
            outpatientDO.setAdmDate(new Date());
            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
            outpatientDao.save(outpatientDO);
            outpatientDao.save(outpatientDO);
@ -1706,9 +1710,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        } else if ("-2".equals(rsCode)) {
        } else if ("-2".equals(rsCode)) {
            String serialNo = (String) res.get("@serial_no");
            String serialNo = (String) res.get("@serial_no");
            String xtgzh = (String) res.get("@xtgzh");
            String realOrder = (String) res.get("@real_order");
            outpatientDO.setRegisterNo(serialNo);
            outpatientDO.setRegisterNo(serialNo);
            String conNo = (String) res.get("@times");
            String conNo = (String) res.get("@times");
            outpatientDO.setConNo(conNo);
            outpatientDO.setConNo(conNo);
            outpatientDO.setXtgzh(xtgzh);
            outpatientDO.setRealOrder(realOrder);
            outpatientDO.setAdmDate(new Date());
            outpatientDO.setAdmDate(new Date());
            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
            outpatientDao.save(outpatientDO);
            outpatientDao.save(outpatientDO);

+ 28 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientDO.java

@ -257,6 +257,16 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
     */
     */
    private String consumerMobile;
    private String consumerMobile;
    /**
     * his单据号
     */
    private String xtgzh;
    /**
     * 处方号
     */
    private String realOrder;
    @Column(name = "remind_count")
    @Column(name = "remind_count")
    public Integer getRemindCount() {
    public Integer getRemindCount() {
@ -677,4 +687,22 @@ public class WlyyOutpatientDO extends UuidIdentityEntity {
    public void setConsumerMobile(String consumerMobile) {
    public void setConsumerMobile(String consumerMobile) {
        this.consumerMobile = consumerMobile;
        this.consumerMobile = consumerMobile;
    }
    }
    @Column(name = "xtgzh")
    public String getXtgzh() {
        return xtgzh;
    }
    public void setXtgzh(String xtgzh) {
        this.xtgzh = xtgzh;
    }
    @Column(name = "real_order")
    public String getRealOrder() {
        return realOrder;
    }
    public void setRealOrder(String realOrder) {
        this.realOrder = realOrder;
    }
}
}

+ 32 - 21
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -9,11 +9,14 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionEmrDO;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.XzyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
@ -102,6 +105,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	private YlzPayService ylzPayService;
	private YlzPayService ylzPayService;
	@Autowired
	@Autowired
	private PatientMappingDao patientMappingDao;
	private PatientMappingDao patientMappingDao;
	@Autowired
	private PrescriptionDao prescriptionDao;
	
	
	@Value("${wechat.id}")
	@Value("${wechat.id}")
	private String wxId;
	private String wxId;
@ -413,32 +418,38 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		msgObj.put("msg",baseDoctorDO.getName()+"结束了咨询");
		msgObj.put("msg",baseDoctorDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		msgObj.put("consultcode",consult);
		String jsonStr = "";
		String jsonStr = "";
		/*ConsultDo cons = consultDao.findOne(consult);
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (StringUtils.isNoneBlank(cons.getRelationCode())){
		if (StringUtils.isNoneBlank(cons.getRelationCode())){
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient());
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient());
			//发送诊断消息
			if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
			//发送诊断支付
			if (wlyyOutpatientDOList!=null&&wlyyOutpatientDOList.size()==1){
				WlyyOutpatientDO outpatientDO = wlyyOutpatientDOList.get(0);
				WlyyOutpatientDO outpatientDO = wlyyOutpatientDOList.get(0);
				BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
				String userName = null;
				String idcard = null;
				if (patientDO != null) {
					userName = patientDO.getName();
					idcard = patientDO.getIdcard();
				}
				PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getPatient());
				String userNo = null;
				if (patientMappingDO != null) {
					userNo = patientMappingDO.getMappingCode();
				}
				String cardNo = null;
				if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
					cardNo = outpatientDO.getCardNo();
				List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
				if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
					logger.info("发送诊查费支付模板消息start");
					BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
					String userName = null;
					String idcard = null;
					if (patientDO != null) {
						userName = patientDO.getName();
						idcard = patientDO.getIdcard();
					}
					PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
					String userNo = null;
					if (patientMappingDO != null) {
						userNo = patientMappingDO.getMappingCode();
					}
					String cardNo = null;
					if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
						cardNo = outpatientDO.getCardNo();
					}
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
					logger.info("发送诊查费支付模板消息end");
				}
				}
				String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
				ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, null, outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
			}
			}
		}*/
		}
		if(1 == resutl){
		if(1 == resutl){
			jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
			jsonStr = "{\"id\":\""+ UUID.randomUUID().toString()+"\",\"sender_id\":\""+doctorCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}
		}

+ 47 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -11,10 +11,16 @@ import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
@ -22,6 +28,7 @@ import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.Envelop;
@ -112,6 +119,14 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	@Autowired
	@Autowired
	public ImUtil imUtil;
	public ImUtil imUtil;
	@Autowired
	private OutpatientDao outpatientDao;
	@Autowired
	private YlzPayService ylzPayService;
	@Autowired
	private PatientMappingDao patientMappingDao;
	@Autowired
	private PrescriptionDao prescriptionDao;
	@Value("${fastDFS.fastdfs_file_url}")
	@Value("${fastDFS.fastdfs_file_url}")
@ -611,9 +626,39 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		JSONObject msgObj = new JSONObject();
		JSONObject msgObj = new JSONObject();
		msgObj.put("msg",basePatientDO.getName()+"结束了咨询");
		msgObj.put("msg",basePatientDO.getName()+"结束了咨询");
		msgObj.put("consultcode",consult);
		msgObj.put("consultcode",consult);
		
		String jsonStr = "";
		String jsonStr = "";
		
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(cons.getRelationCode())){
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient());
			//发送诊断支付
			if (wlyyOutpatientDOList!=null&&wlyyOutpatientDOList.size()==1){
				WlyyOutpatientDO outpatientDO = wlyyOutpatientDOList.get(0);
				List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutpatientId(outpatientDO.getId());
				if (wlyyPrescriptionDOS==null||wlyyPrescriptionDOS.size()==0){
					logger.info("发送诊查费支付模板消息start");
					BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
					String userName = null;
					String idcard = null;
					if (patientDO != null) {
						userName = patientDO.getName();
						idcard = patientDO.getIdcard();
					}
					PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getConsumer());
					String userNo = null;
					if (patientMappingDO != null) {
						userNo = patientMappingDO.getMappingCode();
					}
					String cardNo = null;
					if (org.apache.commons.lang3.StringUtils.isNoneBlank(outpatientDO.getCardNo())) {
						cardNo = outpatientDO.getCardNo();
					}
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, "15", "1");
					logger.info("发送诊查费支付模板消息end");
				}
			}
		}
		if(1 == resutl){
		if(1 == resutl){
			jsonStr = "{\"id\":\""+UUID.randomUUID().toString()+"\",\"sender_id\":\""+patientCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
			jsonStr = "{\"id\":\""+UUID.randomUUID().toString()+"\",\"sender_id\":\""+patientCode+"\",\"sender_name\":\"系统\",\"timestamp\":"+new Date().getTime()+",\"content_type\":7,\"content\":"+msgObj.toString()+",\"business_type\":1}";
		}
		}

+ 10 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -889,11 +889,16 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            }
                            }
                            for (WaitPayDetailVO waitPayDetailVO:listWPD){
                            for (WaitPayDetailVO waitPayDetailVO:listWPD){
                                if (waitPayDetailVO.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
                                if (waitPayDetailVO.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
                                    List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                    if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
                                        WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0);
                                        outpatientDao.updateHisStatusById(wlyyPrescriptionDO.getOutpatientId(),1);
                                        logger.info("更新门诊结算状态");
                                    WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findByRealOrder(waitPayDetailVO.getRecipeNo());
                                    if (wlyyOutpatientDO!=null){
                                        if (wlyyOutpatientDO.getHisStatus()!=null&&wlyyOutpatientDO.getHisStatus()!=1){
                                            String fee="15";
                                            String title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!";
                                            String url = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+wlyyOutpatientDO.getId()+"";
                                            payInfoNoticeService.pushPrescriptionPay(wlyyOutpatientDO.getConsumer(),wlyyOutpatientDO.getDoctorName(),waitPayDetailVO.getVoucherNo(),null,null,fee,title,url);
                                            outpatientDao.updateHisStatusById(wlyyOutpatientDO.getId(),1);
                                            logger.info("更新门诊结算状态");
                                        }
                                    }
                                    }
                                }
                                }
                                prescriptionDao.updateStatusByRealOrder(waitPayDetailVO.getRecipeNo(),30,new Date());
                                prescriptionDao.updateStatusByRealOrder(waitPayDetailVO.getRecipeNo(),30,new Date());