wangjun 4 lat temu
rodzic
commit
4cb9c2ef54

+ 29 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/message/service/SystemMessageService.java

@ -2,11 +2,18 @@ package com.yihu.jw.hospital.message.service;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.YkyySMSService;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -26,6 +33,12 @@ public class SystemMessageService extends BaseJpaService<SystemMessageDO,SystemM
    private SystemMessageDao systemMessageDao;
    @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private OutpatientDao outpatientDao;
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    /**
@ -109,6 +122,22 @@ public class SystemMessageService extends BaseJpaService<SystemMessageDO,SystemM
        }
        return null;
    }
    public String  sendDoctorRemindSms(String outpatienId){
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatienId);
        String msg = "";
        if (wlyyOutpatientDO!=null){
            BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(wlyyOutpatientDO.getDoctor());
            if (baseDoctorDO!=null){
                ykyySMSService.sendSmsByTempcode("message_remind_paitent",wlyyOutpatientDO,null,baseDoctorDO.getMobile());
                msg="发送成功";
            }else{
                msg="发送失败,医生不存在";
            }
        }else {
            msg="发送失败,门诊不存在";
        }
        return msg;
    }
}

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

@ -79,7 +79,6 @@ import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.date.DateUtil;
@ -986,6 +985,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            outpatientDO.setPayStatus(1);
        } else {
            outpatientDO.setPayStatus(0);
            outpatientDO.setFee(price);
            outpatient = outpatientDao.save(outpatientDO);
        }
        if (outpatient.getOutpatientType().equalsIgnoreCase("1")){
@ -2598,7 +2599,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //保存挂号费用
            prescription.setRegFee(getChargeFee(outpatientDO.getDoctor()));
            prescription.setRegFee(outpatientDO.getFee());
            prescription.setPrescribeTime(new Date());
            //保存费用
            prescriptionDao.save(prescription);
@ -2621,14 +2622,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        } else {
                            ykyyService.updateDrugorderInfo(businessOrderDO.getOrderNo(), wlyyPrescriptionDO.getOrderId(), wlyyPrescriptionDO.getRealOrder());
                        }
                        ykyySMSService.sendSmsByTempcode("prescription_remind",outpatientDO,wlyyPrescriptionDO,"");
                    }
                    /*SmsTemplateDO smsTemplateDO =  smsTemplateDao.findByClientId("prescription_remind");
                    if (smsTemplateDO!=null){
                        String content = smsTemplateDO.getContent().replace("{{病人姓名}}",outpatientDO.getPatientName()).replace("{{时间}}",Da)
                    }*/
                }
                }
                result.put("code", 1);
                result.put("mes", "诊断完成");
                result.put("prescriptionId",prescription.getId());
@ -2786,6 +2783,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        try {
            BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
            WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByChargeTypeAndDeptTypeCode(doctorDO.getChargeType(), "6");
            return chargeDictDO.getReqFee();
        } catch (Exception e) {
            logger.error("getChargeFee:" + e.toString());

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

@ -38,6 +38,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.EntityUtils;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.YkyySMSService;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
@ -150,6 +151,8 @@ public class YkyyEntranceService {
    private FileUploadService fileUploadService;
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
@ -1581,6 +1584,62 @@ public class YkyyEntranceService {
        return array;
    }
    /**
     * 获取his病人信息
     * @param idcard
     * @return
     * @throws Exception
     */
    public JSONArray findHisPatientByIdCard(String idcard,boolean demoFlag) throws Exception {
        String sql = "SELECT\n" +
                "\tx.brid AS \"brid\",\n" +
                "\tx.mzhm AS \"mzhm\",\n" +
                "\tx.brxm AS \"brxm\",\n" +
                "\tx.sfzh AS \"sfzh\",\n" +
                "\tx.brxz AS \"brxz\",\n" +
                "\tx.brxb AS \"brxb\",\n" +
                "\tx.csny as \"csny\",\n" +
                "\tx.jzkh AS \"jzkh\",\n" +
                "\tx.jdsj AS \"jdsj\",\n" +
                "\tx.sjhm AS \"sjhm\",\n" +
                "\tx.fzxmc AS \"fzxmc\",\n" +
                "\tx.gzztmc AS \"gzztmc\",\n" +
                "\tx.lxdz AS \"lxdz\"\n" +
                "FROM\n" +
                "\tV_ZKSG_BRCX x\n" +
                "WHERE\n" +
                "\tx.sfzh = '"+idcard+"' ";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("idcard:"+sql);
        if (demoFlag){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("brid","1168517");
            jsonObject.put("mzhm","0502452155");
            jsonObject.put("brxm","于小童");
            jsonObject.put("sfzh","450521199405092535");
            jsonObject.put("brxz","自费");
            jsonObject.put("brxb","男");
            jsonObject.put("csny","1994-05-09");
            jsonObject.put("jzkh","2396501");
            jsonObject.put("jdsj","2020-06-28 15:15:35");
            jsonObject.put("gzztmc","一般");
            jsonObject.put("lxdz","厦门市五缘湾");
            array.add(jsonObject);
        }else  {
            HttpResponse response = HttpUtils.doGet(url,params);
            String content = response.getContent();
            logger.info("response:"+content);
            JSONObject rs = JSON.parseObject(content);
            Integer status = rs.getInteger("status");
            if (status==200){
                array = rs.getJSONArray("detailModelList");
            }
        }
        return array;
    }
    /**
     * 获取his病人信息
     * @param medicare
@ -1743,6 +1802,13 @@ public class YkyyEntranceService {
            //同步检查检验
            if(null!=inspectionDOS&&inspectionDOS.size()>0){
                synInspect(inspectionDOS);
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
                //向患者发送检查提醒短信
                if (wlyyOutpatientDO!=null){
                    ykyySMSService.sendSmsByTempcode("inspection_remind",wlyyOutpatientDO,null,"");
                }
            }
        }
@ -2687,7 +2753,7 @@ public class YkyyEntranceService {
        String sql = "select t.ztmc as\"ztmc\",t.ztid as\"ztid\"," +
                "t.gslb as\"gslb\",t.gsdm as\"gsdm\"," +
                "t.pydm as\"pydm\",t.Mzsy as\"Mzsy\"" +
                "from portal_his.emr_yzzt@ykzxtest t where 1=1";
                "from portal_his.emr_yzzt@xec_link t where 1=1";
        if(StringUtils.isNotEmpty(gslb)){
            sql+=" and t.gslb = "+Integer.valueOf(gslb);
            }
@ -2711,7 +2777,7 @@ public class YkyyEntranceService {
    public JSONArray findZtmxByid(String ztId) throws Exception{
        String sql = "select t.ztid as \"ztid\",t.xmdm as \"code\"," +
                "t.xmmc as \"name\",t.mrsl as \"quantity\",t.zxks as \"dept\"" +
                "from portal_his.emr_ztmx@ykzxtest t where 1=1";
                "from portal_his.emr_ztmx@xec_link t where 1=1";
        if (StringUtils.isNotEmpty(ztId)){
            sql += " and t.ztid = '"+ztId+"'";
        }

+ 9 - 7
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -36,7 +36,6 @@ import com.yihu.jw.order.pay.wx.WeChatConfig;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.jw.util.common.XMLUtil;
@ -44,6 +43,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeiXinPayUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.ByteToInputStream;
import com.yihu.jw.utils.YkyySMSService;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
@ -856,6 +856,12 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
                    wlyyOutpatientDO.setPayStatus(1);
                    outpatientDao.save(wlyyOutpatientDO);
                    if (StringUtils.isNoneBlank(wlyyOutpatientDO.getDoctor())){
                        BaseDoctorDO baseDoctorDO= doctorDao.findById(wlyyOutpatientDO.getDoctor());
                        if (baseDoctorDO!=null){
                            ykyySMSService.sendSmsByTempcode("outpatient_remind",wlyyOutpatientDO,null,baseDoctorDO.getMobile());
                        }
                    }
                }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                    List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
                    if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
@ -885,12 +891,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                                            " where "+condition+" t.CFSB ='"+wlyyPrescriptionDO.getRealOrder()+"'";
                                    ykyyEntranceService.updateHisStatus(updatesql);
                                    logger.info("自取写入更新his");
                                   WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
                                    SmsTemplateDO smsTemplateDO = smsTemplateDao.findByClientId("oneself_pick");
                                    if (smsTemplateDO!=null){
                                        String content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime())).replace("{{门诊号码}}",wlyyOutpatientDO.getRealOrder());
                                        ykyySMSService.ykyySendSMS(wlyyOutpatientDO.getConsumerMobile(),smsTemplateDO.getHeader()+content);
                                    }
                                    WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionDO.getOutpatientId());
                                    ykyySMSService.sendSmsByTempcode("oneself_pick",wlyyOutpatientDO,wlyyPrescriptionDO,"");
                                }else {
                                    //向顺丰下单

+ 290 - 0
business/base-service/src/main/java/com/yihu/jw/utils/YkyySMSService.java

@ -0,0 +1,290 @@
package com.yihu.jw.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.sms.SmsTemplateDO;
import com.yihu.jw.entity.hospital.prescription.WlyyInspectionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.hospital.prescription.dao.WlyyInspectionDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.sms.util.ykyy.client.SmsClient;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2020/3/19.
 */
@Service
public class YkyySMSService {
    private static final Logger logger = LoggerFactory.getLogger(YkyySMSService.class);
    private final String usrCode ="300643";
    private final String pw ="T9IHN69DDF";
    private final String urlSms ="https://smsapp.wlwx.com";
    private final static String url="http://192.168.20.55:10023/ykyy/createSQLQuery";
    @Autowired
    private BaseSmsTemplateDao smsTemplateDao;
    @Autowired
    private WlyyInspectionDao inspectionDao;
    @Autowired
    private BasePatientDao basePatientDao;
    /**
     * 发送短信验证码
     * @param mobile
     * @param content
     * @return
     */
    public ResultMsg ykyySendSMS(String mobile, String content){
        SmsClient smsClient = new SmsClient();
        return smsClient.sendSms("ykyy",usrCode, content,mobile,"yes","","8",urlSms,pw);
    }
    public void sendSmsByTempcode(String temlateCode, WlyyOutpatientDO wlyyOutpatientDO, WlyyPrescriptionDO wlyyPrescriptionDO,String doctorMobile){
        SmsTemplateDO smsTemplateDO =  null;
        String content="";
        String sex = "先生/女士";
        String mobile = "";
        if (wlyyOutpatientDO!=null){
            if (StringUtils.isNoneBlank(wlyyOutpatientDO.getIdcard())){
                String sexNo = IdCardUtil.getSexForIdcard_new(wlyyOutpatientDO.getIdcard());
                if ("1".equalsIgnoreCase(sexNo)){
                    sex = "先生";
                }else if ("2".equalsIgnoreCase(sexNo)){
                    sex = "女士";
                }
            }
            BasePatientDO basePatientDO = basePatientDao.findById(wlyyOutpatientDO.getPatient());
            if (basePatientDO!=null&&StringUtils.isNoneBlank(basePatientDO.getMobile())){
                mobile = basePatientDO.getMobile();
            }else {
                mobile=wlyyOutpatientDO.getMobile();
            }
        }
        logger.info("temlateCode"+temlateCode+"==mobile:"+mobile);
        try {
            if ("prescription_remind".equalsIgnoreCase(temlateCode)){//开具处方提醒
                smsTemplateDO = smsTemplateDao.findByClientId("prescription_remind");
                if (smsTemplateDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}", DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime()))
                            .replace("{{处方编号}}",wlyyPrescriptionDO.getRealOrder()).replace("{{性别}}",sex);
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
            }else if ("outpatient_remind".equalsIgnoreCase(temlateCode)){//患者发起复诊给医生发送消息
                smsTemplateDO = smsTemplateDao.findByClientId("outpatient_remind");
                if (smsTemplateDO!=null){
                    if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                        content = smsTemplateDO.getContent();
                        ykyySendSMS(doctorMobile,smsTemplateDO.getHeader()+content);
                    }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                        content = smsTemplateDO.getContent().replace("图文","视频");
                        ykyySendSMS(doctorMobile,smsTemplateDO.getHeader()+content);
                    }
                }
            }else if ("message_remind_paitent".equalsIgnoreCase(temlateCode)){//医生发消息发送短信提醒
                content = smsTemplateDO.getContent().replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
            }else if ("oneself_pick".equalsIgnoreCase(temlateCode)){//病人自取
                smsTemplateDO = smsTemplateDao.findByClientId("oneself_pick");
                if (smsTemplateDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime())).replace("{{门诊号码}}",wlyyOutpatientDO.getRealOrder())
                    .replace("{{性别}}",sex);;
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
            }else if("check_failed".equalsIgnoreCase(temlateCode)){//处方审核失败
                smsTemplateDO = smsTemplateDao.findByClientId("check_failed_patient");
                if (smsTemplateDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",wlyyPrescriptionDO.getRealOrder()).replace("{{性别}}",sex);;
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
                SmsTemplateDO smsTemplateDO1 = smsTemplateDao.findByClientId("check_failed_doctor");
                if (smsTemplateDO1!=null){
                    String contentDoctor = smsTemplateDO1.getContent().replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName()).replace("{{时间}}",DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime()))
                            .replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",wlyyPrescriptionDO.getRealOrder());
                    ykyySendSMS(doctorMobile,smsTemplateDO1.getHeader()+contentDoctor);
                }
            }else if ("check_success_patient".equalsIgnoreCase(temlateCode)){//处方审核通过
                smsTemplateDO = smsTemplateDao.findByClientId("check_success_patient");
                if (smsTemplateDO!=null&&wlyyOutpatientDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",wlyyPrescriptionDO.getRealOrder()).replace("{{性别}}",sex);;
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
            }else if ("inspection_remind".equalsIgnoreCase(temlateCode)){//处方审核通过
                smsTemplateDO = smsTemplateDao.findByClientId("inspection_remind");
                if (smsTemplateDO!=null&&wlyyOutpatientDO!=null){
                    String medicard = "";
                    Integer brxb = 0;
                    String mzhm ="0";
                    //如果患者医保卡不为空则用社保卡 否则用mzhm
                    if(StringUtils.isNoneBlank(wlyyOutpatientDO.getCardNo())){
                        medicard = wlyyOutpatientDO.getCardNo();
                        JSONArray jsonArray3 = findHisPatient(medicard,false);
                        if(jsonArray3!=null&&jsonArray3.size()>0){
                            //获取居民信息
                            JSONObject json = jsonArray3.getJSONObject(0);
                            mzhm = json.getString("mzhm");
                        }else {
                            medicard="";
                        }
                    }else {
                        JSONArray jsonArray3 = findHisPatientByIdCard(wlyyOutpatientDO.getIdcard(),false);
                        if(jsonArray3!=null&&jsonArray3.size()>0){
                            //获取居民信息
                            JSONObject json = jsonArray3.getJSONObject(0);
                            mzhm = json.getString("mzhm");
                        }
                    }
                    List<WlyyInspectionDO> list = inspectionDao.findByOutpatientId(wlyyOutpatientDO.getId());
                    String createTime = "";
                    if (list!=null&&list.size()>0){
                        createTime = DateUtil.dateToStrLong(list.get(0).getCreateTime());
                    }
                    if (StringUtils.isNoneBlank(medicard)){
                        content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",createTime).replace("{{门诊号码}}",mzhm)
                        .replace("{{社保卡号}}","【凭社保卡/就诊卡"+medicard+"到院充值预缴金做检查】").replace("{{性别}}",sex).replace("{{时间}}",createTime);
                    }else {
                        content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",createTime).replace("{{门诊号码}}",mzhm)
                                .replace("{{社保卡号}}","【到收费处,凭此条短信中的门诊号码换卡充值预缴金做检查】").replace("{{性别}}",sex);;
                    }
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
            }
            logger.info("发送后:temlateCode"+temlateCode+"==mobile:"+mobile+"content"+content+"doctorMobile"+doctorMobile);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(temlateCode+"模板发送失败");
        }
    }
    /**
     * 获取his病人信息
     * @param ssc
     * @return
     * @throws Exception
     */
    public JSONArray findHisPatient(String ssc,boolean demoFlag) throws Exception {
        String sql = "SELECT\n" +
                "\tx.brid AS \"brid\",\n" +
                "\tx.mzhm AS \"mzhm\",\n" +
                "\tx.brxm AS \"brxm\",\n" +
                "\tx.sfzh AS \"sfzh\",\n" +
                "\tx.brxz AS \"brxz\",\n" +
                "\tx.brxb AS \"brxb\",\n" +
                "\tx.csny as \"csny\",\n" +
                "\tx.jzkh AS \"jzkh\",\n" +
                "\tx.jdsj AS \"jdsj\",\n" +
                "\tx.sjhm AS \"sjhm\",\n" +
                "\tx.fzxmc AS \"fzxmc\",\n" +
                "\tx.gzztmc AS \"gzztmc\",\n" +
                "\tx.lxdz AS \"lxdz\"\n" +
                "FROM\n" +
                "\tV_ZKSG_BRCX x\n" +
                "WHERE\n" +
                "\tx.jzkh = '"+ssc+"' ";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("idcard:"+sql);
        if (demoFlag){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("brid","1168517");
            jsonObject.put("mzhm","0502452155");
            jsonObject.put("brxm","于小童");
            jsonObject.put("sfzh","450521199405092535");
            jsonObject.put("brxz","自费");
            jsonObject.put("brxb","男");
            jsonObject.put("csny","1994-05-09");
            jsonObject.put("jzkh","2396501");
            jsonObject.put("jdsj","2020-06-28 15:15:35");
            jsonObject.put("gzztmc","一般");
            jsonObject.put("lxdz","厦门市五缘湾");
            array.add(jsonObject);
        }else  {
            HttpResponse response = HttpUtils.doGet(url,params);
            String content = response.getContent();
            logger.info("response:"+content);
            JSONObject rs = JSON.parseObject(content);
            Integer status = rs.getInteger("status");
            if (status==200){
                array = rs.getJSONArray("detailModelList");
            }
        }
        return array;
    }
    /**
     * 获取his病人信息
     * @param idcard
     * @return
     * @throws Exception
     */
    public JSONArray findHisPatientByIdCard(String idcard,boolean demoFlag) throws Exception {
        String sql = "SELECT\n" +
                "\tx.brid AS \"brid\",\n" +
                "\tx.mzhm AS \"mzhm\",\n" +
                "\tx.brxm AS \"brxm\",\n" +
                "\tx.sfzh AS \"sfzh\",\n" +
                "\tx.brxz AS \"brxz\",\n" +
                "\tx.brxb AS \"brxb\",\n" +
                "\tx.csny as \"csny\",\n" +
                "\tx.jzkh AS \"jzkh\",\n" +
                "\tx.jdsj AS \"jdsj\",\n" +
                "\tx.sjhm AS \"sjhm\",\n" +
                "\tx.fzxmc AS \"fzxmc\",\n" +
                "\tx.gzztmc AS \"gzztmc\",\n" +
                "\tx.lxdz AS \"lxdz\"\n" +
                "FROM\n" +
                "\tV_ZKSG_BRCX x\n" +
                "WHERE\n" +
                "\tx.sfzh = '"+idcard+"' ";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("idcard:"+sql);
        if (demoFlag){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("brid","1168517");
            jsonObject.put("mzhm","0502452155");
            jsonObject.put("brxm","于小童");
            jsonObject.put("sfzh","450521199405092535");
            jsonObject.put("brxz","自费");
            jsonObject.put("brxb","男");
            jsonObject.put("csny","1994-05-09");
            jsonObject.put("jzkh","2396501");
            jsonObject.put("jdsj","2020-06-28 15:15:35");
            jsonObject.put("gzztmc","一般");
            jsonObject.put("lxdz","厦门市五缘湾");
            array.add(jsonObject);
        }else  {
            HttpResponse response = HttpUtils.doGet(url,params);
            String content = response.getContent();
            logger.info("response:"+content);
            JSONObject rs = JSON.parseObject(content);
            Integer status = rs.getInteger("status");
            if (status==200){
                array = rs.getJSONArray("detailModelList");
            }
        }
        return array;
    }
}

+ 266 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/service/YkyyINSMSService.java

@ -0,0 +1,266 @@
package com.yihu.jw.sms.service;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.sms.util.ykyy.client.SmsClient;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * Created by Trick on 2020/3/19.
 */
@Service
public class YkyyINSMSService {
    private static final Logger logger = LoggerFactory.getLogger(YkyyINSMSService.class);
    private final String usrCode ="300643";
    private final String pw ="T9IHN69DDF";
    private final String urlSms ="https://smsapp.wlwx.com";
    @Autowired
    private BaseSmsTemplateDao smsTemplateDao;
    /**
     * 发送短信验证码
     * @param mobile
     * @param content
     * @return
     */
    public ResultMsg ykyySendSMS(String mobile, String content){
        SmsClient smsClient = new SmsClient();
        return smsClient.sendSms("ykyy",usrCode, content,mobile,"yes","","8",urlSms,pw);
    }
   /* public void sendSmsByTempcode(String temlateCode, WlyyOutpatientDO wlyyOutpatientDO, WlyyPrescriptionDO wlyyPrescriptionDO,String doctorMobile){
        SmsTemplateDO smsTemplateDO =  null;
        String content="";
        String sex = "先生/女士";
        String mobile = "";
        if (wlyyOutpatientDO!=null){
            if (StringUtils.isNoneBlank(wlyyOutpatientDO.getIdcard())){
                String sexNo = IdCardUtil.getSexForIdcard_new(wlyyOutpatientDO.getIdcard());
                if ("1".equalsIgnoreCase(sexNo)){
                    sex = "先生";
                }else if ("2".equalsIgnoreCase(sexNo)){
                    sex = "女士";
                }
            }
            BasePatientDO basePatientDO = basePatientDao.findById(wlyyOutpatientDO.getPatient());
            if (basePatientDO!=null&&!StringUtils.isNoneBlank(basePatientDO.getMobile())){
                mobile = basePatientDO.getMobile();
            }else {
                mobile=wlyyOutpatientDO.getMobile();
            }
        }
        logger.info("temlateCode"+temlateCode+"==mobile:"+mobile);
        try {
            if ("prescription_remind".equalsIgnoreCase(temlateCode)){//开具处方提醒
                smsTemplateDO = smsTemplateDao.findByClientId("prescription_remind");
                if (smsTemplateDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}", DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime()))
                            .replace("{{处方编号}}",wlyyPrescriptionDO.getRealOrder()).replace("{{性别}}",sex);
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
            }else if ("outpatient_remind".equalsIgnoreCase(temlateCode)){//患者发起复诊给医生发送消息
                smsTemplateDO = smsTemplateDao.findByClientId("outpatient_remind");
                if (smsTemplateDO!=null){
                    if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                        content = smsTemplateDO.getContent();
                        ykyySendSMS(doctorMobile,smsTemplateDO.getHeader()+content);
                    }else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                        content = smsTemplateDO.getContent().replace("图文","视频");
                        ykyySendSMS(doctorMobile,smsTemplateDO.getHeader()+content);
                    }
                }
            }else if ("message_remind_paitent".equalsIgnoreCase(temlateCode)){//医生发消息发送短信提醒
                content = smsTemplateDO.getContent().replace("{{医生姓名}}",wlyyOutpatientDO.getDoctorName());
                ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
            }else if ("oneself_pick".equalsIgnoreCase(temlateCode)){//病人自取
                smsTemplateDO = smsTemplateDao.findByClientId("oneself_pick");
                if (smsTemplateDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime())).replace("{{门诊号码}}",wlyyOutpatientDO.getRealOrder())
                    .replace("{{性别}}",sex);;
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
            }else if("check_failed".equalsIgnoreCase(temlateCode)){//处方审核失败
                smsTemplateDO = smsTemplateDao.findByClientId("check_failed_patient");
                if (smsTemplateDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",wlyyPrescriptionDO.getRealOrder()).replace("{{性别}}",sex);;
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
                SmsTemplateDO smsTemplateDO1 = smsTemplateDao.findByClientId("check_failed_doctor");
                if (smsTemplateDO1!=null){
                    content = smsTemplateDO.getContent().replace("{{医生姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",DateUtil.dateToStrLong(wlyyPrescriptionDO.getCreateTime()))
                            .replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",wlyyPrescriptionDO.getRealOrder());
                    ykyySendSMS(doctorMobile,smsTemplateDO.getHeader()+content);
                }
            }else if ("check_success_patient".equalsIgnoreCase(temlateCode)){//处方审核通过
                smsTemplateDO = smsTemplateDao.findByClientId("check_success_patient");
                if (smsTemplateDO!=null&&wlyyOutpatientDO!=null){
                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",wlyyPrescriptionDO.getRealOrder()).replace("{{性别}}",sex);;
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
            }else if ("inspection_remind".equalsIgnoreCase(temlateCode)){//处方审核通过
                smsTemplateDO = smsTemplateDao.findByClientId("inspection_remind");
                if (smsTemplateDO!=null&&wlyyOutpatientDO!=null){
                    String medicard = "";
                    Integer brxb = 0;
                    String mzhm ="0";
                    //如果患者医保卡不为空则用社保卡 否则用mzhm
                    if(StringUtils.isNoneBlank(wlyyOutpatientDO.getCardNo())){
                        medicard = wlyyOutpatientDO.getCardNo();
                        JSONArray jsonArray3 = findHisPatient(medicard,false);
                        if(jsonArray3!=null&&jsonArray3.size()>0){
                            //获取居民信息
                            JSONObject json = jsonArray3.getJSONObject(0);
                            mzhm = json.getString("mzhm");
                        }else {
                            medicard="";
                        }
                    }else {
                        JSONArray jsonArray3 = findHisPatientByIdCard(wlyyOutpatientDO.getIdcard(),false);
                        if(jsonArray3!=null&&jsonArray3.size()>0){
                            //获取居民信息
                            JSONObject json = jsonArray3.getJSONObject(0);
                            mzhm = json.getString("mzhm");
                        }
                    }
                    List<WlyyInspectionDO> list = inspectionDao.findByOutpatientId(wlyyOutpatientDO.getId());
                    String createTime = "";
                    if (list!=null&&list.size()>0){
                        createTime = DateUtil.dateToStrLong(list.get(0).getCreateTime());
                    }
                    if (StringUtils.isNoneBlank(medicard)){
                        content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",createTime).replace("{{门诊号码}}",mzhm)
                        .replace("{{社保卡号}}","【凭社保卡"+medicard+"到院充值预缴金做检查】").replace("{{性别}}",sex);;
                    }else {
                        content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",createTime).replace("{{门诊号码}}",mzhm)
                                .replace("{{社保卡号}}","【到收费处,凭此条短信中的门诊号码换卡充值预缴金做检查】").replace("{{性别}}",sex);;
                    }
                    ykyySendSMS(mobile,smsTemplateDO.getHeader()+content);
                }
            }
            logger.info("发送后:temlateCode"+temlateCode+"==mobile:"+mobile+"content"+content);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(temlateCode+"模板发送失败");
        }
    }
    *//**
     * 获取his病人信息
     * @param ssc
     * @return
     * @throws Exception
     *//*
    public JSONArray findHisPatient(String ssc,boolean demoFlag) throws Exception {
        String sql = "SELECT\n" +
                "\tx.brid AS \"brid\",\n" +
                "\tx.mzhm AS \"mzhm\",\n" +
                "\tx.brxm AS \"brxm\",\n" +
                "\tx.sfzh AS \"sfzh\",\n" +
                "\tx.brxz AS \"brxz\",\n" +
                "\tx.brxb AS \"brxb\",\n" +
                "\tx.csny as \"csny\",\n" +
                "\tx.jzkh AS \"jzkh\",\n" +
                "\tx.jdsj AS \"jdsj\",\n" +
                "\tx.sjhm AS \"sjhm\",\n" +
                "\tx.fzxmc AS \"fzxmc\",\n" +
                "\tx.gzztmc AS \"gzztmc\",\n" +
                "\tx.lxdz AS \"lxdz\"\n" +
                "FROM\n" +
                "\tV_ZKSG_BRCX x\n" +
                "WHERE\n" +
                "\tx.jzkh = '"+ssc+"' ";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("idcard:"+sql);
        if (demoFlag){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("brid","1168517");
            jsonObject.put("mzhm","0502452155");
            jsonObject.put("brxm","于小童");
            jsonObject.put("sfzh","450521199405092535");
            jsonObject.put("brxz","自费");
            jsonObject.put("brxb","男");
            jsonObject.put("csny","1994-05-09");
            jsonObject.put("jzkh","2396501");
            jsonObject.put("jdsj","2020-06-28 15:15:35");
            jsonObject.put("gzztmc","一般");
            jsonObject.put("lxdz","厦门市五缘湾");
            array.add(jsonObject);
        }else  {
            HttpResponse response = HttpUtils.doGet(url,params);
            String content = response.getContent();
            logger.info("response:"+content);
            JSONObject rs = JSON.parseObject(content);
            Integer status = rs.getInteger("status");
            if (status==200){
                array = rs.getJSONArray("detailModelList");
            }
        }
        return array;
    }
    *//**
     * 获取his病人信息
     * @param idcard
     * @return
     * @throws Exception
     *//*
    public JSONArray findHisPatientByIdCard(String idcard,boolean demoFlag) throws Exception {
        String sql = "SELECT\n" +
                "\tx.brid AS \"brid\",\n" +
                "\tx.mzhm AS \"mzhm\",\n" +
                "\tx.brxm AS \"brxm\",\n" +
                "\tx.sfzh AS \"sfzh\",\n" +
                "\tx.brxz AS \"brxz\",\n" +
                "\tx.brxb AS \"brxb\",\n" +
                "\tx.csny as \"csny\",\n" +
                "\tx.jzkh AS \"jzkh\",\n" +
                "\tx.jdsj AS \"jdsj\",\n" +
                "\tx.sjhm AS \"sjhm\",\n" +
                "\tx.fzxmc AS \"fzxmc\",\n" +
                "\tx.gzztmc AS \"gzztmc\",\n" +
                "\tx.lxdz AS \"lxdz\"\n" +
                "FROM\n" +
                "\tV_ZKSG_BRCX x\n" +
                "WHERE\n" +
                "\tx.sfzh = '"+idcard+"' ";
        JSONArray array = new JSONArray();
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("idcard:"+sql);
        if (demoFlag){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("brid","1168517");
            jsonObject.put("mzhm","0502452155");
            jsonObject.put("brxm","于小童");
            jsonObject.put("sfzh","450521199405092535");
            jsonObject.put("brxz","自费");
            jsonObject.put("brxb","男");
            jsonObject.put("csny","1994-05-09");
            jsonObject.put("jzkh","2396501");
            jsonObject.put("jdsj","2020-06-28 15:15:35");
            jsonObject.put("gzztmc","一般");
            jsonObject.put("lxdz","厦门市五缘湾");
            array.add(jsonObject);
        }else  {
            HttpResponse response = HttpUtils.doGet(url,params);
            String content = response.getContent();
            logger.info("response:"+content);
            JSONObject rs = JSON.parseObject(content);
            Integer status = rs.getInteger("status");
            if (status==200){
                array = rs.getJSONArray("detailModelList");
            }
        }
        return array;
    }*/
}

+ 0 - 29
business/sms-service/src/main/java/com/yihu/jw/sms/service/YkyySMSService.java

@ -1,29 +0,0 @@
package com.yihu.jw.sms.service;
import com.yihu.jw.sms.util.ykyy.client.SmsClient;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import org.springframework.stereotype.Service;
/**
 * Created by Trick on 2020/3/19.
 */
@Service
public class YkyySMSService {
    private final String usrCode ="300643";
    private final String pw ="T9IHN69DDF";
    private final String url ="https://smsapp.wlwx.com";
    /**
     * 发送短信验证码
     * @param mobile
     * @param content
     * @return
     */
    public ResultMsg ykyySendSMS(String mobile, String content){
        SmsClient smsClient = new SmsClient();
        return smsClient.sendSms("ykyy",usrCode, content,mobile,"yes","","8",url,pw);
    }
}

+ 4 - 4
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -29,7 +29,7 @@ import com.yihu.jw.security.utils.AES;
import com.yihu.jw.security.utils.DateUtil;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.jw.security.utils.SerializeUtil;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.sms.service.ZBSmsService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
@ -139,7 +139,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @Autowired
    private OauthSsoService oauthSsoService;
    @Autowired
    private YkyySMSService ykyySMSService;
    private YkyyINSMSService ykyyINSMSService;
    @Autowired
    private RegisterService registerService;
    @Autowired
@ -805,9 +805,9 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                        return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
                    }
                }else if("1".equals(type)){
                    result = ykyySMSService.ykyySendSMS(username,"您好,您的手机登录短信验证码是:"+captcha+",5分钟内有效。");
                    result = ykyyINSMSService.ykyySendSMS(username,"您好,您的手机登录短信验证码是:"+captcha+",5分钟内有效。");
                }else if("2".equals(type)) {
                    result = ykyySMSService.ykyySendSMS(username, "您好,您正在进行找回密码操作,您的短信验证码是:" + captcha + ",请勿将验证码告诉他人,5分钟内有效。");
                    result = ykyyINSMSService.ykyySendSMS(username, "您好,您正在进行找回密码操作,您的短信验证码是:" + captcha + ",请勿将验证码告诉他人,5分钟内有效。");
                }
                if (result.isSuccess()) {
                    Captcha _captcha = new Captcha();

+ 7 - 21
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -35,11 +35,11 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.sms.dao.BaseSmsTemplateDao;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.RSAEncrypt;
import com.yihu.jw.utils.YkyySMSService;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WxPushLogDao;
@ -189,7 +189,7 @@ public class UnSettledHISPrescriptionService {
                    JSONObject json = jsonArray.getJSONObject(i);
                    String cfsb = json.getString("CFSB");
                    //查找对应的处方
                    String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR,w.DOCTOR_NAME,to_char(w.CREATE_TIME,'YYYY-MM-DD hh24:mi:ss')  AS \"CREATE_TIME\" from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '"+cfsb+"' and status <> 11 ORDER BY w.CREATE_TIME desc";
                    String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR,w.DOCTOR_NAME from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '"+cfsb+"' and status <> 11 ORDER BY w.CREATE_TIME desc";
                    List<Map<String, Object>> pre = hibenateUtils.createSQLQuery(sql);
                    if(pre!=null && pre.size()>0){
                        String prescriptionId = pre.get(0).get("ID").toString();
@ -209,17 +209,10 @@ public class UnSettledHISPrescriptionService {
                        System.out.println("发送诊断消息成功:"+immsg);
                        //发送短信提醒
                        String content = "";
                        SmsTemplateDO smsTemplateDO = smsTemplateDao.findByClientId("check_failed_patient");
                        if (smsTemplateDO!=null){
                            content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",cfsb);
                            ykyySMSService.ykyySendSMS(wlyyOutpatientDO.getConsumerMobile(),content);
                        }
                        SmsTemplateDO smsTemplateDO1 = smsTemplateDao.findByClientId("check_failed_doctor");
                        if (smsTemplateDO1!=null){
                            content = smsTemplateDO.getContent().replace("{{医生姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{时间}}",pre.get(0).get("CREATE_TIME").toString())
                                    .replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",cfsb);
                            ykyySMSService.ykyySendSMS(wlyyOutpatientDO.getConsumerMobile(),content);
                        }
                        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findByRealOrder(cfsb);
                        BaseDoctorDO baseDoctorDO = doctorDao.findById(doctor);
                        ykyySMSService.sendSmsByTempcode("check_failed",wlyyOutpatientDO,prescriptionDO,baseDoctorDO.getMobile());
                    }
                }
            }
@ -305,14 +298,7 @@ public class UnSettledHISPrescriptionService {
                                }
                                prescriptionVO.setDiagnosisVOs(wlyyPrescriptionDiagnosisVOS);
                                imService.pushPrescriptionImMessage(prescriptionVO);
                                //发送审核成功短信提醒
                                //发送短信提醒
                                String content = "";
                                SmsTemplateDO smsTemplateDO = smsTemplateDao.findByClientId("check_failed_patient");
                                if (smsTemplateDO!=null&&wlyyOutpatientDO!=null){
                                    content = smsTemplateDO.getContent().replace("{{病人姓名}}",wlyyOutpatientDO.getPatientName()).replace("{{处方编号}}",cfsb);
                                    ykyySMSService.ykyySendSMS(wlyyOutpatientDO.getConsumerMobile(),content);
                                }
                                ykyySMSService.sendSmsByTempcode("check_success_patient",wlyyOutpatientDO,wlyyPrescriptionDO,"");
                            }
                        }
                    }

+ 3 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -15,7 +15,7 @@ import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.sms.service.ZBSmsService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
@ -55,7 +55,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @Autowired
    private RedisTemplate redisTemplate;
    @Autowired
    private YkyySMSService ykyySMSService;
    private YkyyINSMSService ykyyINSMSService;
    private final String KEY_SUFFIX = ":code";
    @Autowired
    private ZhongShanSMSService zhongShanSMSService;
@ -195,7 +195,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
            if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                System.out.println("发送眼科验证码开始");
                ResultMsg result= null;
                result = ykyySMSService.ykyySendSMS(phoneNum, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                result = ykyyINSMSService.ykyySendSMS(phoneNum, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                if (result.isSuccess()){
                    this.store(client_id, phoneNum, captcha, 120);
                    mixEnvelop.setMessage("验证码发送成功");

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

@ -26,6 +26,7 @@ import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.hospital.message.service.BaseBannerDoctorService;
import com.yihu.jw.hospital.message.service.BaseUserMsgService;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.*;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
@ -49,7 +50,7 @@ import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -185,9 +186,11 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    private YkyySMSService ykyySMSService;
    private YkyyINSMSService ykyyINSMSService;
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    @Autowired
    private SystemMessageService systemMessageService;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -1547,6 +1550,10 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    }
    @GetMapping("/testsms")
    public void testsms(String mobile ,String contet){
        ykyySMSService.ykyySendSMS(mobile,contet);
        ykyyINSMSService.ykyySendSMS(mobile,contet);
    }
    @GetMapping("/smsToDoctor")
    public Envelop sentMessageRemindSms(String outpatientId){
        return  success(systemMessageService.sendDoctorRemindSms(outpatientId));
    }
}

+ 1 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/wechat/WechatCoreController.java

@ -156,6 +156,7 @@ public class WechatCoreController extends EnvelopRestEndpoint {
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            if (validate(signature, timestamp, nonce)) {
                String xmlStr = weiXinCoreService.messageProcess(request, wxAccessTokenDO.getAccessToken());
                logger.info("返回xml:"+xmlStr);
                // 判断返回值是xml、json格式(取关是空串)
                Boolean flag = weiXinCoreService.isXML(xmlStr);
                if (xmlStr == "error") {

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

@ -130,7 +130,7 @@ public class WeiXinEventProcess {
            String url = null;
            // 医生二维码跳转URL
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3a%2f%2fintel.yanketong.com%2fims-wx%2f%23%2fpersonal%2ffamilyMember%2findex%3ftype%3dnucleicTest&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
                url = "https://intel.yanketong.com/ims-wx/redirect.html";
                picUrl = "https://intel.yanketong.com/group1/M00/00/13/wKghxmAZD-iAEyHgAAA-zHpYNyg537.png";
                article.put("Url", url);
                article.put("Title", "核酸检测预约");