소스 검색

Merge branch 'dev' of wangjun/wlyy2.0 into dev

wangzhinan 4 년 전
부모
커밋
16a41b6865

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

@ -60,7 +60,7 @@ public interface PrescriptionDao extends PagingAndSortingRepository<WlyyPrescrip
    List<WlyyPrescriptionDO> findByOutPatientIdList(String outpatientId);
    List<WlyyPrescriptionDO> findByDoctorAndCreateTimeAndRemark(String doctor,Date createTime,String remark);
    @Query("select a from WlyyPrescriptionDO a where  a.createTime <?1 and a.status <30 and a.status>=0")
    List<WlyyPrescriptionDO> findListByCheckStatus(Date createTime);
    @Query("select a from WlyyPrescriptionDO a where a.createTime>?1 and  a.createTime <?2 and a.status <30 and a.status>=0")
    List<WlyyPrescriptionDO> findListByCheckStatus(Date startTime,Date endTime);
}

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

@ -914,6 +914,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            prescriptionExpressageDao.save(expressageDO);
        }
        if (wechatId.equalsIgnoreCase("xm_xzzx_wx")){
            logger.info("心脏中心同步患者开始");
            xzzxEntranceService.updatePatientMapping(outpatient.getConsumer(),outpatient.getCardNo());
            logger.info("同步患者id成功");
        }
@ -4289,7 +4290,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            String responseMsg="";
            //String prefix="https://www.xmheart.com";
            String prefix = "https://ih.xmheart.com";
            String prefix = "https://ih.xmheart.com/hlwyy";
            if(StringUtils.isNotEmpty(outpatientId)){
                responseMsg = xzzxEntranceService.sendXCXMes(wxId,
                        patientDO.getId(),
@ -7670,7 +7671,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    xzyyPrescriptionService.SOF_SignDataWithExtraInfo(wlyyPrescriptionDO);
                    //同步电子病历
                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId);
                   /* try {
                    try {
                        if (prescriptionEmrDO != null) {
                            logger.info("电子病历同步");
                            xzzxEntranceService.saveEmrToEntrance(prescriptionId);
@ -7680,7 +7681,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    }*/
                    }
                    try {
                        if (object!=null){
                            if (object.getString("code").equalsIgnoreCase("0")){

+ 53 - 10
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -264,7 +264,6 @@ public class XzzxEntranceService{
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("getDoctorInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
@ -567,14 +566,19 @@ public class XzzxEntranceService{
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("findPatientCard params:"+params.toString());
        wlyyHttpLogDO.setRequest(params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        wlyyHttpLogDO.setResponse(json);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setName("查询患者就诊卡");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info("findPatientCard json:"+json);
        return json;
    }
@ -606,14 +610,20 @@ public class XzzxEntranceService{
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("getCardInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        wlyyHttpLogDO.setResponse(json);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setName("获取卡信息");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info("getCardInfo json:"+json);
        return json;
    }
@ -920,12 +930,19 @@ public class XzzxEntranceService{
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("registered params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        wlyyHttpLogDO.setResponse(json);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setDoctor(doctor);
        wlyyHttpLogDO.setName("挂号(调his后台包)");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info("registered json:"+json);
        return json;
    }
@ -1272,12 +1289,19 @@ public class XzzxEntranceService{
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("savePrescriptionToHospital params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        wlyyHttpLogDO.setResponse(json);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setDoctor(ApplyDoctor);
        wlyyHttpLogDO.setName("互联网医院开处方信息更新到his");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info(" savePrescriptionToHospital json:"+json);
        return json;
    }
@ -1330,12 +1354,18 @@ public class XzzxEntranceService{
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("delHisPrescriptionByHisNo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        wlyyHttpLogDO.setResponse(json);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setName("互联网医院删除处方信息更新到his");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info("delHisPrescriptionByHisNo json:"+json);
        return json;
    }
@ -1379,14 +1409,19 @@ public class XzzxEntranceService{
        condition+="<ChnDiagnosisName>"+"</ChnDiagnosisName>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("saveDiagnosis params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        wlyyHttpLogDO.setResponse(json);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setName("保存入门诊断信息到his");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info(" saveDiagnosis json:"+json);
        return json;
    }
@ -1416,14 +1451,19 @@ public class XzzxEntranceService{
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("refundConsultation params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        wlyyHttpLogDO.setResponse(json);
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setName("发送退号信息到his");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        logger.info("refundConsultation json:"+json);
        return json;
    }
@ -1548,8 +1588,8 @@ public class XzzxEntranceService{
        wlyyHttpLogDO.setDoctor(patientAndDoctor.getString("doctorId"));
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setRequest(postBody);
        wlyyHttpLogDO.setName("合理用药审核接口");
        wlyyHttpLogDO.setResponse(res);
        wlyyHttpLogDO.setName("checkPrescriptionInEntrance");
        return  res;
    }
    /*
@ -1564,8 +1604,9 @@ public class XzzxEntranceService{
        wlyyHttpLogDO.setDoctor(patientAndDoctor.getString("doctorId"));
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setRequest(postBody);
        wlyyHttpLogDO.setName("合理用药保存接口");
        wlyyHttpLogDO.setResponse(res);
        wlyyHttpLogDO.setName("checkPrescriptionInEntrance");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        return  res;
    }
    /*
@ -1582,7 +1623,8 @@ public class XzzxEntranceService{
        wlyyHttpLogDO.setCreateTime(new Date());
        wlyyHttpLogDO.setRequest(postBody);
        wlyyHttpLogDO.setResponse(res);
        wlyyHttpLogDO.setName("checkPrescriptionInEntrance");
        wlyyHttpLogDO.setName("合理用药作废接口");
        wlyyHttpLogDao.save(wlyyHttpLogDO);
        return  res;
    }
    public List<Map<String,Object>> transXmlCommen(String xml){
@ -2167,7 +2209,6 @@ public class XzzxEntranceService{
        }
        return jsonObject;
    }
    public String savePatientMapping(String patient){
        BasePatientDO patientDO = patientDao.findById(patient);
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
@ -2197,7 +2238,6 @@ public class XzzxEntranceService{
        }
        return patientMappingDO.getMappingCode();
    }
    public String updatePatientMapping(String patient,String cardNo){
        BasePatientDO patientDO = patientDao.findById(patient);
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
@ -2211,7 +2251,9 @@ public class XzzxEntranceService{
            JSONArray array = JSONArray.parseArray(obj).getJSONArray(0);
            for (int i=0;i<array.size();i++){
                JSONObject object1 = array.getJSONObject(i);
                logger.info("判断卡号是否相同:"+object1.getString("CARD_NO")+"cardNo:"+cardNo);
                if (object1.getString("CARD_NO").equalsIgnoreCase(cardNo)){
                    logger.info("卡号相同");
                    if (patientMappingDO==null){
                        patientMappingDO = new PatientMappingDO();
                        patientMappingDO.setIdcard(patientDO.getIdcard());
@ -2837,6 +2879,7 @@ public class XzzxEntranceService{
        return jsonArray;
    }
    /**
     * 获取药品字典
     * @param spellCode 拼音码
@ -3295,7 +3338,7 @@ public Map checkSyncHis(String IoFlag,String PayCardNo,String NullahNumber,Strin
        response = httpClientUtil.httpPost(url,params);
        JSONObject object = new JSONObject();
        logger.info("保存电子病历"+response);
        if (response.contains("error:插入失败")){
        if (response.contains("error")){
            logger.info("保存失败:"+response);
            return "faild";
        }else {

+ 5 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionDeleteService.java

@ -39,10 +39,13 @@ public class PrescriptionDeleteService {
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    //定时作废处方
    public void deletePrescription() throws Exception{
        Date d = new Date();
        Calendar ca = Calendar.getInstance();//得到一个Calendar的实例
        ca.setTime(new Date()); //设置时间为当前时间
        ca.add(Calendar.DATE, -1); //年份减1
        Date d = ca.getTime();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String s = sdf.format(d);
        List<WlyyPrescriptionDO> prescriptionDOS = prescriptionDao.findListByCheckStatus(DateUtil.strToDate(s+" 00:00:00"));
        List<WlyyPrescriptionDO> prescriptionDOS = prescriptionDao.findListByCheckStatus(DateUtil.strToDate(s+" 00:00:00"),DateUtil.strToDate(s+" 23:59:59"));
        if (null!=prescriptionDOS&&prescriptionDOS.size()>0){
            for (WlyyPrescriptionDO prescriptionDO:prescriptionDOS){
                logger.info("处方删除时间满足条件");

+ 16 - 4
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/wechat/WeiXinEventProcess.java

@ -1,11 +1,15 @@
package com.yihu.jw.hospital.service.wechat;
import com.netflix.discovery.converters.Auto;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.util.wechat.WeiXinMessageReplyUtils;
import com.yihu.jw.util.wechat.WeiXinMessageUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@ -26,6 +30,8 @@ public class WeiXinEventProcess {
    @Value("${wechat.id}")
    private String wechatId;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    /**
     * 微信推送事件处理
@ -77,15 +83,21 @@ public class WeiXinEventProcess {
            // 图文信息
            List<Map<String, String>> articles = new ArrayList<>();
            Map<String, String> article = new HashMap<>();
            // 图片URL
//            String picUrl = systemConf.getProperty("doctor_qrcode_pic_url");
            // 二维码参数
            String[] keys = eventKey.replace("doctor_", "").split("_");
            // 图片URL
            String picUrl = "";
            BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(keys[0]);
            String url = null;
            if (null!=baseDoctorDO){
                picUrl = baseDoctorDO.getPhoto();
            }
            // 医生二维码跳转URL
            if ("xm_ykyy_wx".equalsIgnoreCase("wechatId")){
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                url = "https://intel.yanketong.com/ims-wx/#/doctorInfo?doctorCode="+keys[0];
                picUrl = "https://intel.yanketong.com/"+picUrl;
            }
            // 图文消息URL
            //图片地址
@ -94,7 +106,7 @@ public class WeiXinEventProcess {
            article.put("Url", url);
            article.put("Title", keys[1] + "医生个人诊间");
            article.put("Description", "厦门眼科中心医院互联网医院");
            article.put("PicUrl", url);
            article.put("PicUrl", picUrl);
            articles.add(article);
            // 消息XML