Pārlūkot izejas kodu

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 gadi atpakaļ
vecāks
revīzija
af1af9a319

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

@ -1652,6 +1652,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                outpatientDO.setConNo(registerDO.getConNo());
                outpatientDO.setRegisterNo(registerDO.getRegisterNo());
                outpatientDO.setAdmDate(registerDO.getCreateTime());
                outpatientDO.setXtgzh(registerDO.getXtgzh());
                outpatientDO.setRealOrder(registerDO.getRealOrder());
                outpatientDao.save(outpatientDO);
                //调用电子病历注册
                manageType = 2;
@ -1693,13 +1695,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setRealOrder(realOrder);
            registerDO.setXtgzh(xtgzh);
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            //挂号流水号与挂号次数
            registerDO.setRegisterNo(serialNo);
            registerDO.setConNo(conNo);
            registerDO.setCreateTime(new Date());
            registerDO.setDel(1);
            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
            patientRegisterDao.save(registerDO);
@ -1728,7 +1732,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setRealOrder(realOrder);
            registerDO.setXtgzh(xtgzh);
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            registerDO.setRegisterNo(serialNo);

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -874,9 +874,9 @@ public class EntranceService {
            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01
            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>" + sourceSysCode + "</SourceSysCode><TargetSysCode>" + targetSysCode + "</TargetSysCode></MessageHeader>");
            //查询信息拼接
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root>");
            sbs.append("<MsgInfo><endNum>20000</endNum><Msg><as_xml><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?><root>");
            sbs.append("<resquest card_no=\"" + card_no + "\" doctor=\"" + doctor + "\" dept=\"" + dept + "\" serial_no=\"" + serial_no + "\"   win_no=\"" + win_no + "\" >");
            sbs.append("</resquest></root>]]></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            sbs.append("</resquest></root>]]></as_xml></Msg><startNum>1</startNum></MsgInfo></ESBEntry>");
            //超时等待时间150s
            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid);
            resp = MqSdkUtil.xml2jsonArrayRootRow(resp);

+ 4 - 4
business/base-service/src/mqConfig/esbmq-config.xml

@ -29,10 +29,10 @@
				<BS10110_1>EwellQ.S60.BS10110.GET</BS10110_1>
				<BS10111_0>EwellQ.S60.BS10111.PUT</BS10111_0>
				<BS10111_1>EwellQ.S60.BS10111.GET</BS10111_1>
				<BS10111_0>EwellQ.S60.BS10138.PUT</BS10111_0>
				<BS10111_1>EwellQ.S60.BS10138.GET</BS10111_1>
				<BS10111_0>EwellQ.S60.BS15054.PUT</BS10111_0>
				<BS10111_1>EwellQ.S60.BS15054.GET</BS10111_1>
				<BS10138_0>EwellQ.S60.BS10138.PUT</BS10138_0>
				<BS10138_1>EwellQ.S60.BS10138.GET</BS10138_1>
				<BS15054_0>EwellQ.S60.BS15054.PUT</BS15054_0>
				<BS15054_1>EwellQ.S60.BS15054.GET</BS15054_1>
				<BS10112_0>EwellQ.S60.BS10112.PUT</BS10112_0>
				<BS10112_1>EwellQ.S60.BS10112.GET</BS10112_1>
				<BS10114_0>EwellQ.S60.BS10114.PUT</BS10114_0>

+ 25 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPatientRegisterDO.java

@ -25,6 +25,15 @@ public class WlyyPatientRegisterDO extends UuidIdentityEntity {
    private String date;//yyyy-MM-dd',
    private Integer del;//删除标识
    private Date createTime;//创建时间',
    /**
     * his单据号
     */
    private String xtgzh;
    /**
     * 处方号
     */
    private String realOrder;
    public String getPatient() {
        return patient;
@ -114,4 +123,20 @@ public class WlyyPatientRegisterDO extends UuidIdentityEntity {
    public void setDel(Integer del) {
        this.del = del;
    }
    public String getXtgzh() {
        return xtgzh;
    }
    public void setXtgzh(String xtgzh) {
        this.xtgzh = xtgzh;
    }
    public String getRealOrder() {
        return realOrder;
    }
    public void setRealOrder(String realOrder) {
        this.realOrder = realOrder;
    }
}

+ 4 - 0
svr/svr-internet-hospital-entrance/src/mqConfig/esbmq-config.xml

@ -24,6 +24,10 @@
				<BS10110_1>EwellQ.S60.BS10110.GET</BS10110_1>
				<BS10111_0>EwellQ.S60.BS10111.PUT</BS10111_0>
				<BS10111_1>EwellQ.S60.BS10111.GET</BS10111_1>
				<BS10138_0>EwellQ.S60.BS10138.PUT</BS10138_0>
				<BS10138_1>EwellQ.S60.BS10138.GET</BS10138_1>
				<BS15054_0>EwellQ.S60.BS15054.PUT</BS15054_0>
				<BS15054_1>EwellQ.S60.BS15054.GET</BS15054_1>
				<BS10112_0>EwellQ.S60.BS10112.PUT</BS10112_0>
				<BS10112_1>EwellQ.S60.BS10112.GET</BS10112_1>
				<BS10114_0>EwellQ.S60.BS10114.PUT</BS10114_0>

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

@ -19,6 +19,7 @@ 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.XzyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.im.dao.ConsultDao;
@ -107,6 +108,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	private PatientMappingDao patientMappingDao;
	@Autowired
	private PrescriptionDao prescriptionDao;
	@Autowired
	private EntranceService entranceService;
	
	@Value("${wechat.id}")
	private String wxId;
@ -421,35 +424,39 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (StringUtils.isNoneBlank(cons.getRelationCode())){
			Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
			Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient(),startTime,endTime);
			//发送诊断支付
			if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
				WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
				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");
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
			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");
				net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
				net.sf.json.JSONObject res = object.getJSONObject("resquest");
				logger.info("获取待结算数据 res: " + res.toString());
				String rsCode = res.getString("@RESULT");
				String free= 0+"";
				if ("0".equals(rsCode)) {
					free = res.getString("@total_charge");
				}
				if (!free.equalsIgnoreCase("0")){
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
				}
				logger.info("发送诊查费支付模板消息end");
			}
		}
		if(1 == resutl){

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

@ -22,6 +22,7 @@ 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.entrance.EntranceService;
import com.yihu.jw.hospital.service.SystemMessage.HospitalSystemMessageService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.im.dao.ConsultDao;
@ -127,6 +128,8 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
	private PatientMappingDao patientMappingDao;
	@Autowired
	private PrescriptionDao prescriptionDao;
	@Autowired
	private EntranceService entranceService;
	@Value("${fastDFS.fastdfs_file_url}")
@ -630,36 +633,41 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
		//结束时医生未开处方则发送模板消息结算
		ConsultDo cons = consultDao.findOne(consult);
		if (org.apache.commons.lang3.StringUtils.isNoneBlank(cons.getRelationCode())){
			Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
			Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
			List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(cons.getPatient(),startTime,endTime);
			//发送诊断支付
			if (wlyyOutpatientDOList==null||wlyyOutpatientDOList.size()==0){
				WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
				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");
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(cons.getRelationCode());
			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");
				net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
				net.sf.json.JSONObject res = object.getJSONObject("resquest");
				logger.info("获取待结算数据 res: " + res.toString());
				String rsCode = res.getString("@RESULT");
				String free= 0+"";
				if ("0".equals(rsCode)) {
					free = res.getString("@total_charge");
				}
				if (!free.equalsIgnoreCase("0")){
					ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getRealOrder(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
				}
				logger.info("发送诊查费支付模板消息end");
			}
		}
		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}";

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

@ -850,15 +850,11 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                String voucherNo = waitPayDetailVO.getVoucherNo();
                                List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                for (WlyyPrescriptionDO prescriptionDO:prescriptionDOList){
                                    String patient = prescriptionDO.getPatientCode();
                                    if (prescriptionDO.getStatus()!=30){
                                        String fee=null;
                                        String title = null;
                                        Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
                                        Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
                                        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByPatientListNoStatus(prescriptionDO.getPatientCode(),startTime,endTime);
                                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
                                        if (wlyyOutpatientDOList==null&&wlyyOutpatientDOList.size()==0){
                                        if (wlyyOutpatientDO.getHisStatus()==null){
                                            fee=(prescriptionDO.getDrugFee()+15)+"";
                                            title="您在厦门大学附属中山医院有一笔诊察/处方费用已支付完成!结算费用包含本次在线问诊的复诊诊查费:15元。";
                                        }else {
@ -892,15 +888,19 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            }
                            for (WaitPayDetailVO waitPayDetailVO:listWPD){
                                if (waitPayDetailVO.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
                                    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("更新门诊结算状态");
                                    logger.info(waitPayDetailVO.getRecipeNo());
                                    List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderList(waitPayDetailVO.getRecipeNo());
                                    if (prescriptionDOList==null||prescriptionDOList.size()==0){
                                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findByRealOrder(waitPayDetailVO.getRecipeNo());
                                        if (wlyyOutpatientDO!=null){
                                            if (wlyyOutpatientDO.getHisStatus()==null){
                                                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("更新门诊结算状态");
                                            }
                                        }
                                    }
                                }

+ 0 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -1,16 +1,13 @@
package com.yihu.jw.hospital.endpoint.statistics;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.es.util.ElasticsearchUtil;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -19,8 +16,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * Created by wangzhinan on 2019/12/3.
 */
@ -35,8 +30,6 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private StatisticsEsService statisticsEsService;
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    /**
     *