Browse Source

对接ca、短信

wangzhinan 1 năm trước cách đây
mục cha
commit
580da5691c
14 tập tin đã thay đổi với 1201 bổ sung132 xóa
  1. 182 6
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/DsyyPrescriptionService.java
  2. 486 110
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DsyyEntranceService.java
  3. 12 0
      business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/SendMessgeSoap.java
  4. 131 0
      business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/SendMessgeSoapStub.java
  5. 16 0
      business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/SendMessge_Service.java
  6. 142 0
      business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/SendMessge_ServiceLocator.java
  7. 1 1
      business/base-service/src/main/java/com/yihu/jw/utils/WritebackCvalueInterface.java
  8. 1 1
      business/base-service/src/main/java/com/yihu/jw/utils/WritebackCvalueInterfaceLocator.java
  9. 1 1
      business/base-service/src/main/java/com/yihu/jw/utils/WritebackCvalueInterfaceSoap.java
  10. 1 1
      business/base-service/src/main/java/com/yihu/jw/utils/WritebackCvalueInterfaceSoapStub.java
  11. 77 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  12. 133 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/DsyyService.java
  13. 11 5
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/DsyyController.java
  14. 7 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

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

@ -22,6 +22,7 @@ import com.yihu.jw.mysql.query.BaseJpaService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.WebserviceUtil;
@ -53,15 +54,190 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    private BasePatientMedicareCardDao patientMedicareCardDao;
    //=============查询视图========================
    /**
     * 通过身份证获取卡号
     *
     *
     * @param patient
     * 获取门诊就诊记录列表
     * @param patient 居民id
     * @return
     */
    public List<WlyyOutpatientVO> selectOutpatientList(String patient, String startTime, String endTime,String ksdm,String cardNo) throws Exception {
        return dsyyEntranceService.selectOutpatientList(patient,startTime,endTime,ksdm,cardNo);
    }
    /**
     * 获取单条门诊就诊记录
     * @param patient 居民id
     * @param conNo 就诊次数
     * @return
     */
    public WlyyOutpatientVO selectOutpatientInfo(String patient,String conNo) throws Exception {
        return dsyyEntranceService.selectOutpatientInfo(patient,conNo);
    }
    public String isEmty(String str){
        if (str.equalsIgnoreCase("[]")){
            return null;
        }else {
            return str;
        }
    }
    /**
     * 获取门诊下所有处方信息
     * @param registerSn 流水号
     * @param patNo 居民id
     * @param admNo 住院唯一号
     * @param realOrder 处方号
     * @return
     * @throws Exception
     */
    public List<WlyyPrescriptionVO> selectOriginPrescriptionList(String registerSn, String patNo, String admNo, String realOrder) throws Exception {
        List<WlyyPrescriptionVO> prescriptionVOList = new ArrayList<>();
        String response="";
        String params = "";
        if (StringUtils.isNoneBlank(realOrder)){
            params +="&realOrder="+realOrder;
        }
        logger.info("处方request:"+registerSn+"=="+patNo+"==="+admNo+"===="+realOrder);
        JSONArray array = dsyyEntranceService.getOriginPrescriptionList(registerSn,patNo,admNo,realOrder,null,null);
        for (int i=0;i<array.size();i++){
            WlyyPrescriptionVO wlyyPrescriptionVO = new WlyyPrescriptionVO();
            JSONObject jsonObject = array.getJSONObject(i);
            wlyyPrescriptionVO.setCreateTime(DateUtil.strToDate(isEmty(jsonObject.getString("CREATETIME"))));
            wlyyPrescriptionVO.setCreateUser(isEmty(jsonObject.getString("CREATEUSER")));
            wlyyPrescriptionVO.setCreateUserName(isEmty(jsonObject.getString("CREATENAME")));
            wlyyPrescriptionVO.setUpdateTime(DateUtil.strToDate(isEmty(jsonObject.getString("UPDATETIME"))));
            wlyyPrescriptionVO.setUpdateUser(isEmty(jsonObject.getString("UPDATEUSER")));
            wlyyPrescriptionVO.setUpdateUserName(isEmty(jsonObject.getString("UPDATEUSERNAME")));
            wlyyPrescriptionVO.setRealOrder(isEmty(jsonObject.getString("REALORDER")));
            wlyyPrescriptionVO.setOriginRealOrder(isEmty(jsonObject.getString("ORIGINREALORDER")));
            wlyyPrescriptionVO.setAdmNo(isEmty(jsonObject.getString("ADMNO")));
            wlyyPrescriptionVO.setOriginAdmNo(isEmty(jsonObject.getString("ORIGINADMNO")));
            wlyyPrescriptionVO.setSerialNo(isEmty(jsonObject.getString("SERIALNO")));
            wlyyPrescriptionVO.setOriginSerialNo(isEmty(jsonObject.getString("ORIGINSERIALNO")));
            wlyyPrescriptionVO.setType(jsonObject.getInteger("TYPE"));
            wlyyPrescriptionVO.setPatientCode(isEmty(jsonObject.getString("PATIENTCODE")));
            wlyyPrescriptionVO.setPatientName(isEmty(jsonObject.getString("PATEINTNAME")));
            wlyyPrescriptionVO.setIdcard(isEmty(jsonObject.getString("IDCARD")));
            wlyyPrescriptionVO.setCardNo(isEmty(jsonObject.getString("CARDNO")));
            wlyyPrescriptionVO.setSsc(isEmty(jsonObject.getString("SSC")));
            wlyyPrescriptionVO.setDoctor(isEmty(jsonObject.getString("DOCTOR")));
            wlyyPrescriptionVO.setDoctorName(isEmty(jsonObject.getString("DOCTORNAME")));
            wlyyPrescriptionVO.setStatus(jsonObject.getInteger("STATUS"));
            wlyyPrescriptionVO.setMkFailReason(isEmty(jsonObject.getString("MKFAILREASON")));
            wlyyPrescriptionVO.setMkTime(DateUtil.strToDate(isEmty(jsonObject.getString("MKTIME"))));
            wlyyPrescriptionVO.setPrescribeTime(DateUtil.strToDate(isEmty(jsonObject.getString("PRESCRIBETIME"))));
            wlyyPrescriptionVO.setPrescribeReason(isEmty(jsonObject.getString("PRESCRIBEREASON")));
            wlyyPrescriptionVO.setPayTime(DateUtil.strToDate(isEmty(jsonObject.getString("PAYTIME"))));
            wlyyPrescriptionVO.setDosageTime(DateUtil.strToDate(isEmty(jsonObject.getString("DOSAGETIME"))));
            wlyyPrescriptionVO.setFinishTime(DateUtil.strToDate(isEmty(jsonObject.getString("FINISHTIME"))));
            wlyyPrescriptionVO.setDept(isEmty(jsonObject.getString("DEPT")));
            wlyyPrescriptionVO.setDeptName(isEmty(jsonObject.getString("DEPTNAME")));
            wlyyPrescriptionVO.setHospital(isEmty(jsonObject.getString("HOSPITAL")));
            wlyyPrescriptionVO.setHospitalName(isEmty(jsonObject.getString("HOSPITALNAME")));
            wlyyPrescriptionVO.setConsult(isEmty(jsonObject.getString("CONSULT")));
            wlyyPrescriptionVO.setDispensaryType(isEmty(jsonObject.getString("DISPENSARYTYPE"))!=null?Integer.parseInt(isEmty(jsonObject.getString("DISPENSARYTYPE"))):null);
            wlyyPrescriptionVO.setReason(isEmty(jsonObject.getString("REASON")));
            wlyyPrescriptionVO.setDiseaseImg(isEmty(jsonObject.getString("DISEASEIMG")));
            wlyyPrescriptionVO.setRemark(isEmty(jsonObject.getString("REMARK")));
            wlyyPrescriptionVO.setCancelReason(isEmty(jsonObject.getString("CANCELREASON")));
            wlyyPrescriptionVO.setCaCertData(isEmty(jsonObject.getString("CACERTDATA")));
            wlyyPrescriptionVO.setCaMessage(isEmty(jsonObject.getString("CAMESSAGE")));
            wlyyPrescriptionVO.setDigitalSignNo(isEmty(jsonObject.getString("DIGITALSIGNNO")));
            wlyyPrescriptionVO.setOriginalDataAbstract(isEmty(jsonObject.getString("ORIGINALDATAABSTRACT")));
            wlyyPrescriptionVO.setStrOriginalData(isEmty(jsonObject.getString("STRORIGINALDATA")));
            wlyyPrescriptionVO.setHisDeptCode(isEmty(jsonObject.getString("HISDEPTCODE")));
            wlyyPrescriptionVO.setHisDoctorCode(isEmty(jsonObject.getString("HISDOCTORCODE")));
            wlyyPrescriptionVO.setHisGisterTypeCode(isEmty(jsonObject.getString("HISGISTERTYPECODE")));
            wlyyPrescriptionVO.setHisRateTypeCode(isEmty(jsonObject.getString("HISRATETYPECODE")));
            wlyyPrescriptionVO.setHisHospital(isEmty(jsonObject.getString("HISHOSPITAL")));
            wlyyPrescriptionVO.setHisRegisterFee(isEmty(jsonObject.getString("HISREGISTERFEE"))!=null?Integer.parseInt(isEmty(jsonObject.getString("HISREGISTERFEE"))):null);
            wlyyPrescriptionVO.setPayStatus(isEmty(jsonObject.getString("PAYSTATUS"))!=null?Integer.parseInt(isEmty(jsonObject.getString("PAYSTATUS"))):null);
            //TODO 快递数据
            wlyyPrescriptionVO.setDispUser(isEmty(jsonObject.getString("DISPUSER")));
            wlyyPrescriptionVO.setDispUserName(isEmty(jsonObject.getString("DISPUSERNAME")));
            wlyyPrescriptionVO.setDispDate(DateUtil.strToDate(isEmty(jsonObject.getString("DISPDATE"))));
            //诊断
            JSONArray jsonArray = dsyyEntranceService.getOutpatientDiagnosis(registerSn,patNo,admNo,realOrder,null,null);
            logger.info("诊断"+jsonArray.toJSONString());
            List<WlyyPrescriptionDiagnosisVO> prescriptionDiagnosisVOS = new ArrayList<>();
            for (int j=0;j<jsonArray.size();j++){
                JSONObject disagnosisJson = jsonArray.getJSONObject(j);
                WlyyPrescriptionDiagnosisVO prescriptionDiagnosisVO = new WlyyPrescriptionDiagnosisVO();
                prescriptionDiagnosisVO.setCode(isEmty(disagnosisJson.getString("CODE")));
                prescriptionDiagnosisVO.setName(isEmty(disagnosisJson.getString("NAME")));
                prescriptionDiagnosisVO.setType(isEmty(disagnosisJson.getString("TYPE"))==null?null:Integer.parseInt(disagnosisJson.getString("DIAGNOSETYPE")));
                prescriptionDiagnosisVOS.add(prescriptionDiagnosisVO);
            }
            wlyyPrescriptionVO.setDiagnosisVOs(prescriptionDiagnosisVOS);
            //药品
            JSONArray infoArray = dsyyEntranceService.getOutpatientDrugInfo(registerSn,patNo,admNo,realOrder,null,null);
            //药品
            List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOList = new ArrayList<>();
            for (int j=0;j<infoArray.size();j++){
                WlyyPrescriptionInfoVO prescriptionInfoVO = new WlyyPrescriptionInfoVO();
                JSONObject infoJson = infoArray.getJSONObject(j);
                prescriptionInfoVO.setDrugNo(isEmty(infoJson.getString("DRUGNO")));
                prescriptionInfoVO.setDrugName(isEmty(infoJson.getString("DRUGNAME")));
                prescriptionInfoVO.setDispDeposite(isEmty(infoJson.getString("DISPDEPOSITE")));
                prescriptionInfoVO.setDosage(isEmty(infoJson.getString("DOSAGE")));
                prescriptionInfoVO.setQuantity(isEmty(infoJson.getString("QUANTITY")));
                prescriptionInfoVO.setUnit(isEmty(infoJson.getString("UNIT")));
                prescriptionInfoVO.setUnitName(isEmty(infoJson.getString("UNITNAME")));
                prescriptionInfoVO.setPackUnitName(isEmty(infoJson.getString("PACKUNITNAME")));
                prescriptionInfoVO.setPackUnit(isEmty(infoJson.getString("PACKUNIT")));
                prescriptionInfoVO.setUsageCode(isEmty(infoJson.getString("USAGECODE")));
                prescriptionInfoVO.setUsageName(isEmty(infoJson.getString("USAGENAME")));
                prescriptionInfoVO.setSupplyCode(isEmty(infoJson.getString("SUPPLYCODE")));
                prescriptionInfoVO.setSupplyName(isEmty(infoJson.getString("SUPPLYNAME")));
                prescriptionInfoVO.setDays(isEmty(infoJson.getString("DAYS")));
                prescriptionInfoVO.setFrequency(isEmty(infoJson.getString("FREQUENCY")));
                prescriptionInfoVO.setSerial(isEmty(infoJson.getString("SERIAL")));
                /*    prescriptionInfoVO.setGroupNo(isEmty(infoJson.getString("groupNo")));*/
                prescriptionInfoVO.setSpecification(isEmty(infoJson.getString("SPECIFICATION")));
                prescriptionInfoVO.setPackRetprice(isEmty(infoJson.getString("PACKRETPRICE"))!=null?Double.parseDouble(isEmty(infoJson.getString("PACKRETPRICE"))):null);
                prescriptionInfoVO.setHerbalCount(isEmty(infoJson.getString("HERBALCOUNT")));
                prescriptionInfoVO.setPostCount(isEmty(infoJson.getString("POSTCOUNT")));
                prescriptionInfoVO.setDel(isEmty(infoJson.getString("DEL"))!=null?Integer.parseInt(infoJson.getString("DEL")):null);
                prescriptionInfoVO.setComm(infoJson.getString("COMM"));
                wlyyPrescriptionInfoVOList.add(prescriptionInfoVO);
                wlyyPrescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOList);
            }
            //检查检验内容
           /* String inspectObj = hcyyEntranceService.getOutpatientCheckTestInfo(registerSn,patNo,admNo,realOrder,null,null);
            logger.info("检查检验内容inspectionResponse:"+inspectObj);
            List<WlyyInspectionVO> wlyyInspectionVOList = new ArrayList<>();
            JSONArray inspectionArray = JSONArray.parseArray(inspectObj).getJSONArray(0);
            for (int j=0;j<inspectionArray.size();j++){
                WlyyInspectionVO inspectionVO = new WlyyInspectionVO();
                JSONObject inspectionJson = inspectionArray.getJSONObject(j);
                inspectionVO.setGroupName(isEmty(inspectionJson.getString("GROUPNAME")));
                inspectionVO.setQuantity(isEmty(inspectionJson.getString("QUANTITYS"))!=null?Integer.parseInt(isEmty(inspectionJson.getString("QUANTITYS"))):null);
                inspectionVO.setFrequency(isEmty(inspectionJson.getString("FREQUENCYS")));
                inspectionVO.setParentCode(isEmty(inspectionJson.getString("PARENTCODE")));
                inspectionVO.setParentName(isEmty(inspectionJson.getString("PARENTCODENAME")));
                inspectionVO.setCode(isEmty(inspectionJson.getString("CODES")));
                inspectionVO.setName(isEmty(inspectionJson.getString("NAMES")));
                inspectionVO.setInformation(isEmty(inspectionJson.getString("INFORMATION")));
                inspectionVO.setCheckEquip(isEmty(inspectionJson.getString("CHECKEQUIP")));
                inspectionVO.setCheckPartName(isEmty(inspectionJson.getString("CHECKPARTNAME")));
                inspectionVO.setCheckPart(isEmty(inspectionJson.getString("CHECKPART")));
                wlyyInspectionVOList.add(inspectionVO);
            }
            wlyyPrescriptionVO.setInspectionVOs(wlyyInspectionVOList);*/
            prescriptionVOList.add(wlyyPrescriptionVO);
        }
        return prescriptionVOList;
    }
        /**
         * 通过身份证获取卡号
         *
         *
         * @param patient
         * @return
         * @throws Exception
         */
    public JSONArray findCardNo(String patient) throws Exception {
        BasePatientDO patientDO = patientDao.getOne(patient);
        if (patientDO==null){

+ 486 - 110
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/DsyyEntranceService.java

@ -26,6 +26,7 @@ import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.oauth.OauthRsaKeyDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.encrypt.MD5;
@ -33,11 +34,11 @@ import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.network.HttpResponse;
import com.yihu.jw.util.network.HttpUtils;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.utils.WritebackCvalueInterfaceLocator;
import com.yihu.jw.utils.dsyyUtil.SendMessge_ServiceLocator;
import com.yihu.jw.utils.dsyyUtil.WritebackCvalueInterfaceLocator;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import net.sf.json.xml.XMLSerializer;
import okhttp3.*;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -240,8 +241,8 @@ public class DsyyEntranceService {
    }
    //==========================调用his视图===============
    private final static String url="http://192.168.101.2:10023/ykyy/createSQLQuery";
    private final static String orgCode ="dsyy";
    private final static String url="http://192.168.101.2:10023/dsyy/createSQLQuery";
    private final static String orgCode ="350211A1004";
    /**
     * 同步科室信息
@ -437,6 +438,461 @@ public class DsyyEntranceService {
        return "success";
    }
    public String isEmty(String str){
        if (str.equalsIgnoreCase("[]")){
            return null;
        }else {
            return str;
        }
    }
    /**
     * 获取门诊就诊记录列表
     * @param patient 居民id
     * @return
     */
    public List<WlyyOutpatientVO> selectOutpatientList(String patient, String startTime, String endTime,String ksdm, String cardNo) throws Exception {
        List<WlyyOutpatientVO> wlyyOutpatientVOList = new ArrayList<>();
        JSONArray array = new JSONArray();
        patient = updatePatientMapping(patient,cardNo);
        String sql = "SELECT\n" +
                "\tadmNo AS \"ADMNO\",\n" +
                "\toriginAdmNo AS \"ORIGINADMNO\",\n" +
                "\tregisterNo AS \"REGISTERNO\",\n" +
                "\toriginRegisterNo AS \"ORIGINREGISTERNO\",\n" +
                "\toriginConNo as \"ORIGINCONNO\",\n" +
                "\tdept as \"DEPT\",\n" +
                "\tDEPTNAME as \"DEPTNAME\",\n" +
                "  PATIENT as \"PATIENT\",\n" +
                "\tPATIENTNAME as \"PATIENTNAME\",\n" +
                "\tDOCTOR as \"DOCTOR\",\n" +
                "\tDOCTORNAME as \"DOCTORNAME\",\n" +
                "\tIDCARD as \"IDCARD\",\n" +
                "\tMJZ as \"MJZ\",\n" +
                "\tICDCODE as \"ICDCODE\",\n" +
                "\tICDNAME as \"ICDNAME\",\n" +
                "\tADMDATE as \"ADMDATE\",\n" +
                "\tCONDATE as \"CONDATE\",\n" +
                "\tDESCRIPTION as \"DESCRIPTION\",\n" +
                "\tDISEASEIMG as \"DISEASEIMG\",\n" +
                "\tCREATETIME as \"CREATETIME\",\n" +
                "\tSTATUS as \"STATUS\",\n" +
                "\tVISITNUM as \"VISITNUM\"\n" +
                "FROM\n" +
                "\tv_internet_dispensary_cure where 1=1 ";
        if (StringUtils.isNoneBlank(startTime)){
            sql +=" and CREATETIME >= to_date('"+startTime+"','yyyy-MM-dd HH24:mi:ss') ";
        }
        if (StringUtils.isNoneBlank(endTime)){
            sql +=" and CREATETIME <= to_date('"+endTime+"','yyyy-MM-dd HH24:mi:ss') ";
        }
        if (StringUtils.isNoneBlank(patient)){
            sql +=" and PATIENT ='"+patient+"' ";
        }
        if (StringUtils.isNoneBlank(ksdm)){
            sql += " and dept ='"+ksdm+"' ";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("获取就诊记录列表:"+sql);
        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");
            for (int i=0;i<array.size();i++){
                JSONObject object = array.getJSONObject(i);
                WlyyOutpatientVO outpatientVO = new WlyyOutpatientVO();
                outpatientVO.setAdmNo(isEmty(object.getString("ADMNO")));
                outpatientVO.setOriginAdmNo(isEmty(object.getString("ORIGINADMNO")));
                outpatientVO.setRegisterNo(isEmty(object.getString("REGISTERNO")));
                outpatientVO.setOriginRegisterNo(isEmty(object.getString("ORIGINREGISTERNO")));
                outpatientVO.setDept(isEmty(object.getString("DEPT")));
                outpatientVO.setDeptName(isEmty(object.getString("DEPTNAME")));
                outpatientVO.setPatient(isEmty(object.getString("PATIENT")));
                outpatientVO.setPatientName(isEmty(object.getString("PATIENTNAME")));
                outpatientVO.setDoctor(isEmty(object.getString("DOCTOR")));
                outpatientVO.setDoctorName(isEmty(object.getString("DOCTORNAME")));
                outpatientVO.setIdcard(isEmty(object.getString("IDCARD")));
                outpatientVO.setMjz(isEmty(object.getString("MJZ")));
                outpatientVO.setIcd10(isEmty(object.getString("ICDCODE")));
                outpatientVO.setIcd10Name(isEmty(object.getString("ICDNAME")));
                outpatientVO.setAdmDate(DateUtil.strToDate(object.getString("ADMDATE")));
                outpatientVO.setConDate(DateUtil.strToDate(object.getString("CONDATE")));
                outpatientVO.setDescription(isEmty(object.getString("DESCRIPTION")));
                outpatientVO.setDiseaseImg(isEmty(object.getString("DISEASEIMG")));
                outpatientVO.setCreateTime(DateUtil.strToDate(object.getString("CREATETIME")));
                outpatientVO.setStatus(isEmty(object.getString("STATUS")));
                outpatientVO.setConNo(isEmty(object.getString("VISITNUM")));
                outpatientVO.setPatient(patient);
                wlyyOutpatientVOList.add(outpatientVO);
            }
        }
        return wlyyOutpatientVOList;
    }
    /**
     * 获取单条门诊就诊记录
     * @param patient 居民id
     * @param conNo 就诊次数
     * @return
     */
    public WlyyOutpatientVO selectOutpatientInfo(String patient,String conNo) throws Exception {
        WlyyOutpatientVO outpatientVO = new WlyyOutpatientVO();
        JSONArray array = new JSONArray();
        BasePatientDO patientDO = patientDao.findById(patient).orElse(null);
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        if (patientMappingDO!=null){
            patient = patientMappingDO.getMappingCode();
        }else {
            patient = savePatientMapping(patient);
        }
        String sql = "SELECT\n" +
                "\tadmNo AS \"ADMNO\",\n" +
                "\toriginAdmNo AS \"ORIGINADMNO\",\n" +
                "\tregisterNo AS \"REGISTERNO\",\n" +
                "\toriginRegisterNo AS \"ORIGINREGISTERNO\",\n" +
                "\toriginConNo as \"ORIGINCONNO\",\n" +
                "\tdept as \"DEPT\",\n" +
                "\tDEPTNAME as \"DEPTNAME\",\n" +
                "  PATIENT as \"PATIENT\",\n" +
                "\tPATIENTNAME as \"PATIENTNAME\",\n" +
                "\tDOCTOR as \"DOCTOR\",\n" +
                "\tDOCTORNAME as \"DOCTORNAME\",\n" +
                "\tIDCARD as \"IDCARD\",\n" +
                "\tMJZ as \"MJZ\",\n" +
                "\tICDCODE as \"ICDCODE\",\n" +
                "\tICDNAME as \"ICDNAME\",\n" +
                "\tADMDATE as \"ADMDATE\",\n" +
                "\tCONDATE as \"CONDATE\",\n" +
                "\tDESCRIPTION as \"DESCRIPTION\",\n" +
                "\tDISEASEIMG as \"DISEASEIMG\",\n" +
                "\tCREATETIME as \"CREATETIME\",\n" +
                "\tSTATUS as \"STATUS\",\n" +
                "\tVISITNUM as \"VISITNUM\"\n" +
                "FROM\n" +
                "\tv_internet_dispensary_cure where 1=1 ";
        if (StringUtils.isNoneBlank(patient)){
            sql +=" and PATIENT ='"+patient+"' ";
        }
        if (StringUtils.isNoneBlank(conNo)){
            sql += " and conNo ='"+conNo+"' ";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("获取单个就诊记录:"+sql);
        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");
            for (int i=0;i<array.size();i++){
                JSONObject object = array.getJSONObject(i);
                outpatientVO.setAdmNo(isEmty(object.getString("ADMNO")));
                outpatientVO.setOriginAdmNo(isEmty(object.getString("ORIGINADMNO")));
                outpatientVO.setRegisterNo(isEmty(object.getString("REGISTERNO")));
                outpatientVO.setOriginRegisterNo(isEmty(object.getString("ORIGINREGISTERNO")));
                outpatientVO.setDept(isEmty(object.getString("DEPT")));
                outpatientVO.setDeptName(isEmty(object.getString("DEPTNAME")));
                outpatientVO.setPatientName(isEmty(object.getString("PATIENTNAME")));
                outpatientVO.setDoctor(isEmty(object.getString("DOCTOR")));
                outpatientVO.setDoctorName(isEmty(object.getString("DOCTORNAME")));
                outpatientVO.setIdcard(isEmty(object.getString("IDCARD")));
                outpatientVO.setMjz(isEmty(object.getString("MJZ")));
                outpatientVO.setIcd10(isEmty(object.getString("ICDCODE")));
                outpatientVO.setIcd10Name(isEmty(object.getString("ICDNAME")));
                outpatientVO.setAdmDate(DateUtil.strToDate(object.getString("ADMDATE")));
                outpatientVO.setConDate(DateUtil.strToDate(object.getString("CONDATE")));
                outpatientVO.setDescription(isEmty(object.getString("DESCRIPTION")));
                outpatientVO.setDiseaseImg(isEmty(object.getString("DISEASEIMG")));
                outpatientVO.setCreateTime(DateUtil.strToDate(object.getString("CREATETIME")));
                outpatientVO.setStatus(isEmty(object.getString("STATUS")));
                outpatientVO.setConNo(isEmty(object.getString("VISITNUM")));
                outpatientVO.setHospitalName("厦门市第三医院");
                outpatientVO.setHospital("350211A1004");
                outpatientVO.setSex(patientDO.getSex() + "");
                outpatientVO.setPatient(patientDO.getId());
                outpatientVO.setBirthday(patientDO.getBirthday());
            }
        }
        return outpatientVO;
    }
    /**
     * 更新患者hisid
     * @param patient
     * @param cardNo
     * @return
     * @throws Exception
     */
    public String updatePatientMapping(String patient,String cardNo) throws Exception {
        BasePatientDO patientDO = patientDao.findById(patient).orElse(null);
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        JSONArray array =findCardNo(patientDO.getIdcard());
        for (int i=0;i<array.size();i++){
            JSONObject object = array.getJSONObject(i);
            logger.info("判断卡号是否相同:"+object.getString("CARD_NO")+"cardNo:"+cardNo);
            if (object.getString("CARD_NO").equalsIgnoreCase(cardNo)){
                logger.info("卡号相同");
                if (patientMappingDO==null){
                    patientMappingDO = new PatientMappingDO();
                    patientMappingDO.setIdcard(patientDO.getIdcard());
                    patientMappingDO.setPatientName(patientDO.getName());
                    patientMappingDO.setPatient(patientDO.getId());
                    patientMappingDO.setCreateTime(new Date());
                    patientMappingDO.setSource("1");
                    patientMappingDO.setMappingCode(object.getString("SICK_ID"));
                }else {
                    patientMappingDO.setMappingCode(object.getString("SICK_ID"));
                }
                patientMappingDO = patientMappingDao.save(patientMappingDO);
            }
        }
        return patientMappingDO.getMappingCode();
    }
    /**
     * 获取处方主表
     *
     *
     * @param
     * @throws Exception
     */
    public JSONArray getOriginPrescriptionList(String registerSn,String patNo,String admNo,String realOrder,String startTime,String endTime) throws Exception {
        String sql ="SELECT\n" +
                "\tREALORDER as \"REALORDER\",\n" +
                "  ORIGINREALORDER as \"ORIGINREALORDER\",\n" +
                "\tADMNO as \"ADMNO\",\n" +
                "\tORIGINADMNO as \"ORIGINADMNO\",\n" +
                "\tSERIALNO as \"SERIALNO\",\n" +
                "\tORIGINSERIALNO as \"ORIGINSERIALNO\",\n" +
                "\tTYPE as \"TYPE\",\n" +
                "\tPATIENTCODE as \"PATIENTCODE\",\n" +
                "\tPATEINTNAME as \"PATEINTNAME\",\n" +
                "\tIDCARD as \"IDCARD\",\n" +
                "\tCARDNO as \"CARDNO\",\n" +
                "\tSSC as \"SSC\",\n" +
                "\tDOCTOR as \"DOCTOR\",\n" +
                "\tDOCTORNAME as \"DOCTORNAME\",\n" +
                "\tSTATUS as \"STATUS\",\n" +
                "\tPRESCRIBETIME as \"PRESCRIBETIME\",\n" +
                "\tPRESCRIBEREASON as \"PRESCRIBEREASON\",\n" +
                "\tPAYTIME as \"PAYTIME\",\n" +
                "\tDOSAGETIME as \"DOSAGETIME\",\n" +
                "  FINISHTIME as \"FINISHTIME\", \n" +
                "\tCREATETIME AS \"CREATETIME\",\n" +
                "\tDEPT as \"DEPT\",\n" +
                "\tDEPTNAME as \"DEPTNAME\",\n" +
                "\tHOSPITAL as \"HOSPITAL\",\n" +
                "\tHOSPITALNAME as \"HOSPITALNAME\",\n" +
                "\tDISPENSARYTYPE as \"DISPENSARYTYPE\",\n" +
                "\tDISEASEIMG as \"DISEASEIMG\",\n" +
                "\tREMARK as \"REMARK\",\n" +
                "\tCANCELREASON as \"CANCELREASON\",\n" +
                "\tCACERTDATA as \"CACERTDATA\",\n" +
                "\tCAMESSAGE as \"CAMESSAGE\",\n" +
                "\tDIGITALSIGNNO as \"DIGITALSIGNNO\",\n" +
                "\tORIGINALDATAABSTRACT as \"ORIGINALDATAABSTRACT\",\n" +
                "\tSTRORIGINALDATA as \"STRORIGINALDATA\",\n" +
                "\tHISDEPTCODE as \"HISDEPTCODE\",\n" +
                "\tHISDOCTORCODE as \"HISDOCTORCODE\",\n" +
                "\tHISGISTERTYPECODE as \"HISGISTERTYPECODE\",\n" +
                "\tHISRATETYPECODE as \"HISRATETYPECODE\",\n" +
                "\tHISHOSPITAL as \"HISHOSPITAL\",\n" +
                "\tHISREGISTERFEE as \"HISREGISTERFEE\",\n" +
                "\tPAYSTATUS as \"PAYSTATUS\",\n" +
                "  DISPUSER as \"DISPUSER\",\n" +
                "\tDISPUSERNAME as \"DISPUSERNAME\",\n" +
                "\tDISPDATE as \"DISPDATE\"\n" +
                "FROM\n" +
                "\tv_internet_prescrip_master where 1=1 ";
        JSONArray array = new JSONArray();
        if (StringUtils.isNoneBlank(registerSn)){
            sql +=" and REGISTERNO = '"+registerSn+"' ";
        }
        if (StringUtils.isNoneBlank(patNo)){
            sql +=" and patient = '"+patNo+"' ";
        }
        if (StringUtils.isNoneBlank(patNo)){
            sql +=" and admNo = '"+admNo+"' ";
        }
        if (StringUtils.isNoneBlank(realOrder)){
            sql+=" and realOrder ='"+realOrder+"' ";
        }
        if (StringUtils.isNoneBlank(startTime)){
            sql +=" and CREATETIME >= to_date('"+startTime+"','yyyy-MM-dd HH24:mi:ss') ";
        }
        if (StringUtils.isNoneBlank(endTime)){
            sql +=" and CREATETIME <= to_date('"+endTime+"','yyyy-MM-dd HH24:mi:ss') ";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("cardNo:"+sql);
        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;
    }
    /**
     * 获取门诊诊断
     *
     *
     * @param
     * @throws Exception
     */
    public JSONArray getOutpatientDiagnosis(String registerSn,String patNo,String admNo,String realOrder,String startTime,String endTime) throws Exception {
        String sql ="SELECT\n" +
                "\tREALORDER as \"REALORDER\",\n" +
                "\tCODE AS \"CODE\",\n" +
                "\tNAME AS \"NAME\",\n" +
                "\tTYPE AS \"TYPE\",\n" +
                "\tcreateTime AS \"CREATETIME\"\n" +
                "FROM\n" +
                "\tv_internet_sick_diagnosis_info where 1=1 ";
        JSONArray array = new JSONArray();
        if (StringUtils.isNoneBlank(registerSn)){
            sql +=" and REGISTERNO = '"+registerSn+"' ";
        }
        if (StringUtils.isNoneBlank(patNo)){
            sql +=" and patient = '"+patNo+"' ";
        }
        if (StringUtils.isNoneBlank(patNo)){
            sql +=" and admNo = '"+admNo+"' ";
        }
        if (StringUtils.isNoneBlank(realOrder)){
            sql+=" and realOrder ='"+realOrder+"' ";
        }
        if (StringUtils.isNoneBlank(startTime)){
            sql +=" and CREATETIME >= to_date('"+startTime+"','yyyy-MM-dd HH24:mi:ss') ";
        }
        if (StringUtils.isNoneBlank(endTime)){
            sql +=" and CREATETIME <= to_date('"+endTime+"','yyyy-MM-dd HH24:mi:ss') ";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("cardNo:"+sql);
        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;
    }
    /**
     * 获取门诊处方药品
     *
     *
     * @param
     * @throws Exception
     */
    public JSONArray getOutpatientDrugInfo(String registerSn,String patNo,String admNo,String realOrder,String startTime,String endTime) throws Exception {
        String sql ="SELECT\n" +
                "\tREALORDER as \"REALORDER\",\n" +
                "\tDRUGNO AS \"DRUGNO\",\n" +
                "\tDRUGNAME AS \"DRUGNAME\",\n" +
                "\tDISPDEPOSITE AS \"DISPDEPOSITE\",\n" +
                "\tDOSAGE AS \"DOSAGE\",\n" +
                "  QUANTITY as \"QUANTITY\",\n" +
                "\tDRUGNO AS \"UNIT\",\n" +
                "\tDRUGNAME AS \"UNITNAME\",\n" +
                "\tDISPDEPOSITE AS \"PACKUNITNAME\",\n" +
                "\tDOSAGE AS \"PACKUNIT\",\n" +
                "\tUSAGECODE as \"USAGECODE\",\n" +
                "\tUSAGENAME as \"USAGENAME\",\n" +
                "\tSUPPLYCODE as \"SUPPLYCODE\",\n" +
                "\tSUPPLYNAME as \"SUPPLYNAME\",\n" +
                "\tDAYS as \"DAYS\",\n" +
                "\tFREQUENCY as \"FREQUENCY\",\n" +
                "\tSERIAL as \"SERIAL\",\n" +
                "\tSPECIFICATION as \"SPECIFICATION\",\n" +
                "\tPACKRETPRICE as \"PACKRETPRICE\",\n" +
                "\tHERBALCOUNT as \"HERBALCOUNT\",\n" +
                "\tPOSTCOUNT as \"POSTCOUNT\",\n" +
                "\tDEL as \"DEL\",\n" +
                "\tCOMM as \"COMM\"\n" +
                "FROM\n" +
                "\tv_internet_prescrip_detail where 1=1 ";
        JSONArray array = new JSONArray();
        if (StringUtils.isNoneBlank(registerSn)){
            sql +=" and REGISTERNO = '"+registerSn+"' ";
        }
        if (StringUtils.isNoneBlank(patNo)){
            sql +=" and patient = '"+patNo+"' ";
        }
        if (StringUtils.isNoneBlank(patNo)){
            sql +=" and admNo = '"+admNo+"' ";
        }
        if (StringUtils.isNoneBlank(realOrder)){
            sql+=" and realOrder ='"+realOrder+"' ";
        }
        if (StringUtils.isNoneBlank(startTime)){
            sql +=" and CREATETIME >= to_date('"+startTime+"','yyyy-MM-dd HH24:mi:ss') ";
        }
        if (StringUtils.isNoneBlank(endTime)){
            sql +=" and CREATETIME <= to_date('"+endTime+"','yyyy-MM-dd HH24:mi:ss') ";
        }
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("cardNo:"+sql);
        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;
    }
    /**
     * 保存患者hisid
     * @param patient
     * @return
     * @throws Exception
     */
    public String savePatientMapping(String patient) throws Exception {
        BasePatientDO patientDO = patientDao.findById(patient).orElse(null);
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        JSONArray array =findCardNo(patientDO.getIdcard());
        if (array.size()!=0&array.size()>=1){
            JSONObject object = array.getJSONObject(0);
            if (patientMappingDO==null){
                patientMappingDO = new PatientMappingDO();
                patientMappingDO.setIdcard(patientDO.getIdcard());
                patientMappingDO.setPatientName(patientDO.getName());
                patientMappingDO.setPatient(patientDO.getId());
                patientMappingDO.setCreateTime(new Date());
                patientMappingDO.setSource("1");
                patientMappingDO.setMappingCode(object.getString("SICK_ID"));
            }else {
                patientMappingDO.setMappingCode(object.getString("SICK_ID"));
            }
            patientMappingDO = patientMappingDao.save(patientMappingDO);
        }
        return patientMappingDO.getMappingCode();
    }
    /**
     * 获取患者卡列表
     *
@ -1017,31 +1473,38 @@ public class DsyyEntranceService {
    //========================集成平台调用开始===========================
    /**
     * 发送退号信息到his
     * OAuth认证请求接口
     * @return
     * @throws Exception
     */
    public void authorize()throws Exception{
        test1();
//        test();
/*        String api = "authorize";
        String msgHeader ="";
        String condition ="<![CDATA[{\"clientId\":\"12222222\",\"responseType\":\"code\"}]]>";
//        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
        String msgBody = "<authorize><pinput>"+condition+"</pinput></authorize>";
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        Map<String,String> params = new HashedMap();
        params.put("Header",msgHeader);
        params.put("Body",msgBody);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("authorize params:"+params.toString());
        String xml = getDsyyJhWebServiceInfo(api,params,getJhServiceUrl());
    public String authorize()throws Exception{
        String condition ="{\"clientId\":\"2019111513540975\",\"responseType\":\"code\"}";
        WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
        String returnStr = locator.getWritebackCvalueInterfaceSoap().authorize(condition);
        return returnStr;
    }
    /**
     * OAuth登陆-获取用户信息
     * @return
     * @throws Exception
     */
    public String tokeninfo(String requestId)throws Exception{
        String condition ="{\"clientId\":\"2019111513540975\",\"requestId\":\""+requestId+"\"}";
        WritebackCvalueInterfaceLocator locator = new WritebackCvalueInterfaceLocator();
        String returnStr = locator.getWritebackCvalueInterfaceSoap().tokeninfo(condition);
        return returnStr;
    }
    public String sendMessage(String strDllModel,String strPhoneNO,String strMsgContent)throws Exception{
        SendMessge_ServiceLocator locator = new SendMessge_ServiceLocator();
        String returnStr = locator.getSendMessgeSoap().sendMessge(strDllModel,strPhoneNO,strMsgContent);
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("authorize json:"+json);*/
/*        return json;*/
        String json = xmlSerializer.read(returnStr).toString();
        return json;
    }
    public void test1(){
        try {
            String condition ="{\"clientId\":\"2019111513540975\",\"responseType\":\"code\"}";
@ -1053,93 +1516,6 @@ public class DsyyEntranceService {
        }
    }
    public void test(){
        try {
            OkHttpClient client = new OkHttpClient().newBuilder()
                    .build();
            MediaType mediaType = MediaType.parse("Content-Type");
            RequestBody body = RequestBody.create(mediaType, "<soapenv:Envelope " +
                    "xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
                    " xmlns:good=\"http://goodwillcis.com\">  " +
                    " <soapenv:Header/>  <soapenv:Body>    " +
                    " <good:authorize>        " +
                    "<good:pInput><![CDATA[{\"clientId\":\"12222222\",\"responseType\":\"code\"}]]></good:pInput>     " +
                    " </good:authorize> " +
                    "  </soapenv:Body> </soapenv:Envelope>");
            Request request = new Request.Builder()
                    .url("http://10.95.8.41:80/csp/jhip/JHIP.BJCA.BS.BJCAServicesBS.cls")
                    .method("POST", body)
                    .addHeader("Content-Type", "Content-Type")
                    .addHeader("SOAPAction", "\"#authorize\"")
                    .build();
            Response response = client.newCall(request).execute();
            System.out.println("==============================="+response.code());
            System.out.println("==============================="+response.body().string());
            System.out.println("==============================="+response.message());
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    //发送短信
    public String SendMessage(String strDllModel,String strPhoneNO,String strMsgContent) throws Exception {
        String api = "SendMessage";
        String msgHeader ="";
        String condition ="<![CDATA[{\"strDllModel\":\"\",\"strPhoneNO\":\"13559485270\",\"strMsgContent\":\"测试短信\"}]]>";
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        Map<String,String> params = new HashedMap();
        params.put("Header",msgHeader);
        params.put("strDllModel",strDllModel);
        params.put("strPhoneNO",strPhoneNO);
        params.put("strMsgContent",strMsgContent);
        wlyyHttpLogDO.setRequest(params.toString());
        logger.info("SendMessage params:"+params.toString());
        List<WlyyHospitalSysDictDO> distList =  wlyyHospitalSysDictDao.findByDictName("DX_SMS_SERVICE");
        Map<String,String> dictMap = distList.stream().collect(Collectors.toMap(WlyyHospitalSysDictDO::getDictCode,WlyyHospitalSysDictDO::getDictValue));
        String msgUrl = dictMap.get("SMS_SERVICE_URL");
        String soapaction = dictMap.get("SMS_SERVICE_SOAPACTION");
        String xml = getDsyyJhWebServiceInfo(api,params,msgUrl);
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("SendMessage json:"+json);
        return json;
/*        String operationName = "SendMessage";// 调用方法名
        org.apache.axis.client.Service service = new org.apache.axis.client.Service();
        String response = "";
        if (StringUtils.isBlank(strDllModel)){
            strDllModel="";
        }
        List<WlyyHospitalSysDictDO> distList =  wlyyHospitalSysDictDao.findByDictName("DX_SMS_SERVICE");
        Map<String,String> dictMap = distList.stream().collect(Collectors.toMap(WlyyHospitalSysDictDO::getDictCode,WlyyHospitalSysDictDO::getDictValue));
        String msgUrl = dictMap.get("SMS_SERVICE_URL");
        String soapaction = dictMap.get("SMS_SERVICE_SOAPACTION");
        Object[] obj =  new Object[]{};
        try {
            Call call = (Call) service.createCall();
            call.setTargetEndpointAddress(msgUrl);
            call.setOperationName(new QName(soapaction, operationName)); // 设置要调用哪个方法
            call.addParameter(new QName(soapaction, "strDllModel"), // 设置要传递的参数
                    org.apache.axis.encoding.XMLType.XSD_STRING,
                    javax.xml.rpc.ParameterMode.IN);
            call.addParameter(new QName(soapaction, "strPhoneNO"),
                    org.apache.axis.encoding.XMLType.XSD_STRING,
                    javax.xml.rpc.ParameterMode.IN);
            call.addParameter(new QName(soapaction, "strMsgContent"),
                    org.apache.axis.encoding.XMLType.XSD_STRING,
                    javax.xml.rpc.ParameterMode.IN);
            call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);// (标准的类型)
            call.setUseSOAPAction(true);
            call.setSOAPActionURI(soapaction +"/"+ "JHIP.SMS.BS.SendMessge");
//            obj =  new Object[]{strMoID, strMobiles, strContent, strApiCode, NAME, PWD, strSender};
            obj =  new Object[]{strDllModel, strPhoneNO, strMsgContent};
            response = (String) call.invoke(obj);
            //response 返回字符串的不以error开头,则表示成功
            return response;
        }catch (Exception e) {
            e.printStackTrace();
            throw new Exception("短信下发失败");
        }*/
    }
    //========================集成平台调用结束===========================
    public String replaceHtml(String demoData,String oldChar,String newChar){

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/SendMessgeSoap.java

@ -0,0 +1,12 @@
/**
 * SendMessgeSoap.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.dsyyUtil;
public interface SendMessgeSoap extends java.rmi.Remote {
    public String sendMessge(String strDllModel, String strPhoneNO, String strMsgContent) throws java.rmi.RemoteException;
}

+ 131 - 0
business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/SendMessgeSoapStub.java

@ -0,0 +1,131 @@
/**
 * SendMessgeSoapStub.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.dsyyUtil;
public class SendMessgeSoapStub extends org.apache.axis.client.Stub implements SendMessgeSoap {
    private java.util.Vector cachedSerClasses = new java.util.Vector();
    private java.util.Vector cachedSerQNames = new java.util.Vector();
    private java.util.Vector cachedSerFactories = new java.util.Vector();
    private java.util.Vector cachedDeserFactories = new java.util.Vector();
    static org.apache.axis.description.OperationDesc [] _operations;
    static {
        _operations = new org.apache.axis.description.OperationDesc[1];
        _initOperationDesc1();
    }
    private static void _initOperationDesc1(){
        org.apache.axis.description.OperationDesc oper;
        org.apache.axis.description.ParameterDesc param;
        oper = new org.apache.axis.description.OperationDesc();
        oper.setName("SendMessge");
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.bjgoodwill.com", "strDllModel"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.bjgoodwill.com", "strPhoneNO"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        param = new org.apache.axis.description.ParameterDesc(new javax.xml.namespace.QName("http://www.bjgoodwill.com", "strMsgContent"), org.apache.axis.description.ParameterDesc.IN, new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
        param.setOmittable(true);
        oper.addParameter(param);
        oper.setReturnType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        oper.setReturnClass(String.class);
        oper.setReturnQName(new javax.xml.namespace.QName("http://www.bjgoodwill.com", "SendMessgeResult"));
        oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
        oper.setUse(org.apache.axis.constants.Use.LITERAL);
        _operations[0] = oper;
    }
    public SendMessgeSoapStub() throws org.apache.axis.AxisFault {
         this(null);
    }
    public SendMessgeSoapStub(java.net.URL endpointURL, javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
         this(service);
         super.cachedEndpoint = endpointURL;
    }
    public SendMessgeSoapStub(javax.xml.rpc.Service service) throws org.apache.axis.AxisFault {
        if (service == null) {
            super.service = new org.apache.axis.client.Service();
        } else {
            super.service = service;
        }
        ((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
    }
    protected org.apache.axis.client.Call createCall() throws java.rmi.RemoteException {
        try {
            org.apache.axis.client.Call _call = super._createCall();
            if (super.maintainSessionSet) {
                _call.setMaintainSession(super.maintainSession);
            }
            if (super.cachedUsername != null) {
                _call.setUsername(super.cachedUsername);
            }
            if (super.cachedPassword != null) {
                _call.setPassword(super.cachedPassword);
            }
            if (super.cachedEndpoint != null) {
                _call.setTargetEndpointAddress(super.cachedEndpoint);
            }
            if (super.cachedTimeout != null) {
                _call.setTimeout(super.cachedTimeout);
            }
            if (super.cachedPortName != null) {
                _call.setPortName(super.cachedPortName);
            }
            java.util.Enumeration keys = super.cachedProperties.keys();
            while (keys.hasMoreElements()) {
                String key = (String) keys.nextElement();
                _call.setProperty(key, super.cachedProperties.get(key));
            }
            return _call;
        }
        catch (Throwable _t) {
            throw new org.apache.axis.AxisFault("Failure trying to get the Call object", _t);
        }
    }
    public String sendMessge(String strDllModel, String strPhoneNO, String strMsgContent) throws java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[0]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("http://www.bjgoodwill.com/JHIP.SMS.BS.SendMessge.SendMessge");
        _call.setEncodingStyle(null);
        _call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
        _call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("http://www.bjgoodwill.com", "SendMessge"));
        setRequestHeaders(_call);
        setAttachments(_call);
 try {        Object _resp = _call.invoke(new Object[] {strDllModel, strPhoneNO, strMsgContent});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        else {
            extractAttachments(_call);
            try {
                return (String) _resp;
            } catch (Exception _exception) {
                return (String) org.apache.axis.utils.JavaUtils.convert(_resp, String.class);
            }
        }
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;
}
    }
}

+ 16 - 0
business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/SendMessge_Service.java

@ -0,0 +1,16 @@
/**
 * SendMessge_Service.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.dsyyUtil;
public interface SendMessge_Service extends javax.xml.rpc.Service {
    public String getSendMessgeSoapAddress();
    public SendMessgeSoap getSendMessgeSoap() throws javax.xml.rpc.ServiceException;
    public SendMessgeSoap getSendMessgeSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException;
}

+ 142 - 0
business/base-service/src/main/java/com/yihu/jw/utils/dsyyUtil/SendMessge_ServiceLocator.java

@ -0,0 +1,142 @@
/**
 * SendMessge_ServiceLocator.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils.dsyyUtil;
public class SendMessge_ServiceLocator extends org.apache.axis.client.Service implements SendMessge_Service {
    public SendMessge_ServiceLocator() {
    }
    public SendMessge_ServiceLocator(org.apache.axis.EngineConfiguration config) {
        super(config);
    }
    public SendMessge_ServiceLocator(String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
        super(wsdlLoc, sName);
    }
    // Use to get a proxy class for SendMessgeSoap
    private String SendMessgeSoap_address = "http://10.95.8.41/csp/jhip/JHIP.SMS.BS.SendMessge.cls";
    public String getSendMessgeSoapAddress() {
        return SendMessgeSoap_address;
    }
    // The WSDD service name defaults to the port name.
    private String SendMessgeSoapWSDDServiceName = "SendMessgeSoap";
    public String getSendMessgeSoapWSDDServiceName() {
        return SendMessgeSoapWSDDServiceName;
    }
    public void setSendMessgeSoapWSDDServiceName(String name) {
        SendMessgeSoapWSDDServiceName = name;
    }
    public SendMessgeSoap getSendMessgeSoap() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(SendMessgeSoap_address);
        }
        catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getSendMessgeSoap(endpoint);
    }
    public SendMessgeSoap getSendMessgeSoap(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            SendMessgeSoapStub _stub = new SendMessgeSoapStub(portAddress, this);
            _stub.setPortName(getSendMessgeSoapWSDDServiceName());
            return _stub;
        }
        catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }
    public void setSendMessgeSoapEndpointAddress(String address) {
        SendMessgeSoap_address = address;
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (SendMessgeSoap.class.isAssignableFrom(serviceEndpointInterface)) {
                SendMessgeSoapStub _stub = new SendMessgeSoapStub(new java.net.URL(SendMessgeSoap_address), this);
                _stub.setPortName(getSendMessgeSoapWSDDServiceName());
                return _stub;
            }
        }
        catch (Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        if (portName == null) {
            return getPort(serviceEndpointInterface);
        }
        String inputPortName = portName.getLocalPart();
        if ("SendMessgeSoap".equals(inputPortName)) {
            return getSendMessgeSoap();
        }
        else  {
            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
            return _stub;
        }
    }
    public javax.xml.namespace.QName getServiceName() {
        return new javax.xml.namespace.QName("http://www.bjgoodwill.com", "SendMessge");
    }
    private java.util.HashSet ports = null;
    public java.util.Iterator getPorts() {
        if (ports == null) {
            ports = new java.util.HashSet();
            ports.add(new javax.xml.namespace.QName("http://www.bjgoodwill.com", "SendMessgeSoap"));
        }
        return ports.iterator();
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(String portName, String address) throws javax.xml.rpc.ServiceException {
        
if ("SendMessgeSoap".equals(portName)) {
            setSendMessgeSoapEndpointAddress(address);
        }
        else 
{ // Unknown Port Name
            throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
        }
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(javax.xml.namespace.QName portName, String address) throws javax.xml.rpc.ServiceException {
        setEndpointAddress(portName.getLocalPart(), address);
    }
}

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/utils/WritebackCvalueInterface.java

@ -5,7 +5,7 @@
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils;
package com.yihu.jw.utils.dsyyUtil;
public interface WritebackCvalueInterface extends javax.xml.rpc.Service {
    public String getWritebackCvalueInterfaceSoapAddress();

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/utils/WritebackCvalueInterfaceLocator.java

@ -5,7 +5,7 @@
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils;
package com.yihu.jw.utils.dsyyUtil;
public class WritebackCvalueInterfaceLocator extends org.apache.axis.client.Service implements WritebackCvalueInterface {

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/utils/WritebackCvalueInterfaceSoap.java

@ -5,7 +5,7 @@
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils;
package com.yihu.jw.utils.dsyyUtil;
public interface WritebackCvalueInterfaceSoap extends java.rmi.Remote {
    public String existUnsign(String pInput) throws java.rmi.RemoteException;

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/utils/WritebackCvalueInterfaceSoapStub.java

@ -5,7 +5,7 @@
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.utils;
package com.yihu.jw.utils.dsyyUtil;
public class WritebackCvalueInterfaceSoapStub extends org.apache.axis.client.Stub implements WritebackCvalueInterfaceSoap {
    private java.util.Vector cachedSerClasses = new java.util.Vector();

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

@ -185,6 +185,9 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    @Autowired
    private WechatService wechatService;
    @Autowired
    private DsyyService dsyyService;
    @PostConstruct
    private void init() {
        super.setTokenGranter(tokenGranter);
@ -859,6 +862,64 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        throw new IllegalStateException("验证码发送失败!");
    }
    /**
     * 第三医院短信接口
     * @param parameters
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/oauth/sendDsyyCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendDsyyCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String client_id = parameters.get("client_id");
        String username = parameters.get("username");
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id");
        }
        if (StringUtils.isEmpty(username)) {
            throw new InvalidRequestException("username");
        }
        if (username.length()>12){
            throw new InvalidRequestException("请输入正确的手机号!");
        }
        //验证请求间隔超时,防止频繁获取验证码
        if (!wlyyRedisVerifyCodeService.isIntervalTimeout(client_id, username)) {
            throw new IllegalAccessException("SMS request frequency is too fast");
        }
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyhospitalSysdictDao.findDictById("isNeedSMS");
        if (wlyyHospitalSysDictDO!=null&&!StringUtils.isEmpty(wlyyHospitalSysDictDO.getDictValue())){
            String captcha = wlyyHospitalSysDictDO.getDictValue();
            Captcha _captcha = new Captcha();
            _captcha.setCode(captcha);
            _captcha.setExpiresIn(300);
            wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
            Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("success", 200);
            HttpHeaders headers = new HttpHeaders();
            headers.set("Cache-Control", "no-store");
            headers.set("Pragma", "no-cache");
            return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
        }else {
            //发送短信获取验证码
            String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
            String content = "您好,你的手机登录短信验证码是:"+captcha+",5分钟内有效。";
            int result =  dsyyService.SendSms(username,content);
            if (0 == result) {
                Captcha _captcha = new Captcha();
                _captcha.setCode(captcha);
                _captcha.setExpiresIn(300);
                wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
                Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200, null);
                HttpHeaders headers = new HttpHeaders();
                headers.set("Cache-Control", "no-store");
                headers.set("Pragma", "no-cache");
                return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
            }
        }
        throw new IllegalStateException("验证码发送失败!");
    }
    /**
     * 福州健康之路短信接口
@ -1063,6 +1124,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            return sendXZCaptcha(parameters);
        }else if ("sd_tnzyy_wx".equals(wxId)){
            return sendZBCaptcha(parameters);
        }else if ("xm_dsyy_wx".equals(wxId)){
            return sendDsyyCaptcha(parameters);
        }else if("hz_yyyzh_wx".equals(wxId)){
            return sendTXYCaptcha(parameters);
        }else if("xm_mlwyy_wx".equals(wxId)){
@ -1652,6 +1715,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            return ObjEnvelop.getSuccess("success", ykyyService.getQRCode());
        }else if (wechatId.equalsIgnoreCase("xm_hcyy_wx")){
            return ObjEnvelop.getSuccess("success", hcyyService.getQRCode(getIpAddress(request)));
        }else if (wechatId.equalsIgnoreCase("xm_dsyy_wx")){
            return ObjEnvelop.getSuccess("success", dsyyService.getQRCode());
        }else {
            return ObjEnvelop.getSuccess("success", null);
        }
@ -1694,6 +1759,18 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            openId = jsonObject.getString("uniqueid");
            jsonObject.put("qrCodeStatus","LoginQrCodeBeenScan");
            rs.put("code",1000);
        }else if (wechatId.equalsIgnoreCase("xm_dsyy_wx")){
            rs = dsyyService.getTokeninfo(qrcode);
            JSONObject jsonObject = rs.getJSONObject("data");
            logger.info("查询登录信息"+rs);
            String qrCodeStatus = rs.getString("status");
            if(!"0".equals(qrCodeStatus)){
                return ObjEnvelop.getSuccess("error",rs);
            }
            username = jsonObject.getString("userIdcardNum");
            openId = jsonObject.getString("uniqueid");
            jsonObject.put("qrCodeStatus","LoginQrCodeBeenScan");
            rs.put("code",1000);
        }else if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
            rs = ykyyService.getTokeninfo(qrcode);
            JSONObject jsonObject = rs.getJSONObject("data");

+ 133 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/service/DsyyService.java

@ -0,0 +1,133 @@
package com.yihu.jw.security.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.ca.OauthCaConfigDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.security.dao.OauthCaConfigDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorDao;
import com.yihu.jw.security.dao.doctor.BaseDoctorHospitalDao;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang.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 wangzhinan on 2020/10/20.
 *
 * @author .
 */
@Service
public class DsyyService {
    private Logger logger = LoggerFactory.getLogger(DsyyService.class);
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private OauthCaConfigDao oauthCaConfigDao;
    @Autowired
    private BaseDoctorDao doctorDao;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
    public static String entranceUrl = "http://192.168.101.2:10024/dsyy/";
    /**
     * OAuth登陆-认证请求接口
     * @param
     * @return
     */
    public String getQRCode() {
        try {
            logger.info("生成二维码 getQRCode :");
            String url = entranceUrl + "authorize";
            String response = httpClientUtil.get(url,"utf-8");
            JSONObject rs = new JSONObject();
            JSONObject data = new JSONObject();
            String res = "";
            if (StringUtils.isNotBlank(response)){
                JSONObject object = JSONObject.parseObject(response);
                String status = object.getString("status");
                if (status.equalsIgnoreCase("200")){
                    JSONObject jsonObject = object.getJSONObject("message");
                    if (jsonObject.getString("status").equalsIgnoreCase("0")){
                        JSONObject dataJson  = jsonObject.getJSONObject("data");
                        String imgBase64 = dataJson.getString("imgBase64");
                        data.put("resultCode",0);
                        data.put("resultMsg","Success");
                        data.put("qrCodeImg",imgBase64);
                        data.put("qrCode",dataJson.getString("requestId"));
                        rs.put("code",1000);
                        rs.put("msg","成功");
                        rs.put("data",data);
                    }else {
                        rs.put("code",-1);
                        rs.put("msg",jsonObject.getString("message"));
                    }
                }else {
                    rs.put("code",-1);
                    rs.put("msg",object.getString("message"));
                }
            }
            return rs.toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * OAuth登陆-获取用户信息
     * @param requestId
     * @return
     */
    public JSONObject getTokeninfo(String requestId){
        try {
            String url = entranceUrl+"tokeninfo";
            String response = httpClientUtil.get(url,"utf-8");
            logger.info("验证二维码 getQueryQRCode :"+response);
            JSONObject object = JSONObject.parseObject(response);
            if (object.getString("status").equalsIgnoreCase("200")){
                return object.getJSONObject("message");
            }else {
                throw new Exception(object.getString("message"));
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    /**
     * 发送短信验证码
     * @return
     * @throws Exception
     */
    public Integer SendSms(String phone,String content) throws Exception {
        int result = 0;
        String response="";
        String url = entranceUrl+"sendMessage?strPhoneNO="+phone+"&strMsgContent="+content;
        response = httpClientUtil.get(url,"utf-8");
        logger.info("返回参数:"+response);
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            JSONObject jsonObject = object.getJSONObject("message");
            if (jsonObject.getString("action").equalsIgnoreCase("send")){
                result=0;
            }
        }
        return result;
    }
}

+ 11 - 5
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/DsyyController.java

@ -160,16 +160,22 @@ public class DsyyController extends EnvelopRestEndpoint {
    @GetMapping(value = "/authorize")
    @ApiOperation(value = "ca认证")
    public Envelop saveInspectToHospital() throws Exception {
        dsyyEntranceService.authorize();
        return success();
    public Envelop authorize() throws Exception {
        return success(dsyyEntranceService.authorize());
    }
    @GetMapping(value = "/SendMessage")
    @GetMapping(value = "/tokeninfo")
    @ApiOperation(value = "OAuth登陆-获取用户信息")
    public Envelop authorize( @ApiParam(name = "requestId", value = "唯一标识", required = false)
                                  @RequestParam(value = "requestId",required = false)String requestId) throws Exception {
        return success(dsyyEntranceService.tokeninfo(requestId));
    }
    @GetMapping(value = "/sendMessage")
    @ApiOperation(value = "发短信")
    public Envelop SendMessage(String strDllModel,String strPhoneNO,String strMsgContent) throws Exception {
        try {
            return success(dsyyEntranceService.SendMessage(strDllModel,strPhoneNO,strMsgContent));
            return success(dsyyEntranceService.sendMessage(strDllModel,strPhoneNO,strMsgContent));
        }catch (Exception e){
            e.printStackTrace();
        }

+ 7 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -239,8 +239,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                vos = tnPrescriptionService.findOutpatientList(patient, cardNo, startTime, endTime, demoFlag, ksdm, flag);
            } else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                vos = hcyyPrescriptionService.selectOutpatientList(patient,startTime,endTime,cardNo);
            } else if (wxId.equalsIgnoreCase("xm_tasy_wx")) {
                vos = prescriptionService.findOutpatientList(patient, startTime, endTime, demoFlag, ksdm, cardNo);
            } else if (wxId.equalsIgnoreCase("xm_dsyy_wx")) {
                vos = dsyyPrescriptionService.selectOutpatientList(patient, startTime, endTime, ksdm, cardNo);
            } else {
                return ListEnvelop.getError("尚未开发!");
            }
@ -266,8 +266,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                obj = tnPrescriptionService.findOutpatientInfo(patient, conNo, demoFlag, null);
            } else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                obj = hcyyPrescriptionService.selectOutpatientInfo(patient,conNo);
            } else  if (wxId.equalsIgnoreCase("xm_tasy_wx")) {
                obj = prescriptionService.findOutpatientInfo(patient, conNo);
            } else  if (wxId.equalsIgnoreCase("xm_dsyy_wx")) {
                obj = dsyyPrescriptionService.selectOutpatientInfo(patient, conNo);
            } else {
                return ObjEnvelop.getError("尚未开发!");
            }
@ -297,8 +297,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                obj = tnPrescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo, demoFlag);
            } else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                obj = hcyyPrescriptionService.selectOriginPrescriptionListLocal(registerSn,patNo,admNo,realOrder);
            } else if (wxId.equalsIgnoreCase("xm_tasy_wx")) {
                obj = prescriptionService.findOriginPrescriptionList(registerSn, patNo, realOrder, admNo, demoFlag);
            } else if (wxId.equalsIgnoreCase("xm_dsyy_wx")) {
                obj = dsyyPrescriptionService.selectOriginPrescriptionList(registerSn, patNo, realOrder, admNo);
            }else {
                return ListEnvelop.getError("尚未开发!");
            }
@ -445,7 +445,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                    }
                }
                return success(jsonArray);
            } else if ("xm_tasy_wx".equalsIgnoreCase(wxId)) {
            } else if ("xm_dsyy_wx".equalsIgnoreCase(wxId)) {
                return success(dsyyPrescriptionService.findCardNo(patient));
            }else if ("xm_mlwyy_wx".equalsIgnoreCase(wxId)){
                return success(mlwyyPrescriptionService.findPatientCardList(patient));