Explorar o código

添加工具类判断节假日

wangzhinan %!s(int64=2) %!d(string=hai) anos
pai
achega
8ca5bb6a9d

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/healthCare/YlzMedicailRelationDao.java

@ -27,6 +27,9 @@ public interface YlzMedicailRelationDao extends PagingAndSortingRepository<YlzMe
    @Query("from YlzMedicalRelationDO a where a.logNo = ?1 ")
    YlzMedicalRelationDO findByLog_no(String logNo);
   /* @Query("from YlzMedicalRelationDO a where a.hisSerial = ?1 ")
    YlzMedicalRelationDO findByHisSerial(String hisSerial);*/
    @Query("from YlzMedicalRelationDO a where a.insuranceSerial = ?1 ")
    YlzMedicalRelationDO findByInsuranceSerial(String insuranceSerial);
}

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

@ -10,17 +10,25 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.ca.OauthCaConfigDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalIcdDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalMxDO;
import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailIcdDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailMxDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailRelationDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.util.common.IdCardUtil;
@ -28,6 +36,8 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
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;
@ -84,6 +94,19 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    private HcyyEntranceService hcyyEntranceService;
    @Autowired
    private PrescriptionDao prescriptionDao;
    public static String entranceUrlLocal = "http://127.0.0.1:10023/hcyy/";
    @Autowired
    public YlzMedicailRelationDao ylzMedicailRelationDao;
    @Autowired
    public YlzMedicailMxDao ylzMedicailMxDao;
    @Autowired
    public YlzMedicailIcdDao ylzMedicailIcdDao;
    @Autowired
    public BusinessOrderDao businessOrderDao;
    @Autowired
    public PrescriptionLogDao prescriptionLogDao;
@ -191,12 +214,12 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     * @param patient 居民id
     * @return
     */
    public List<WlyyOutpatientVO> selectOutpatientList(String patient, String startTime, String endTime, String cardNo) throws Exception {
    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();
        String response="";
        patient = updatePatientMapping(patient,cardNo);
        String obj = hcyyEntranceService.findOutpatientInfo(patient,null,startTime,endTime);
        String obj = hcyyEntranceService.findOutpatientInfo(patient,null,ksdm,startTime,endTime);
        if (StringUtils.isNoneBlank(obj)){
            array = JSONArray.parseArray(obj).getJSONArray(0);
            for (int i=0;i<array.size();i++){
@ -248,7 +271,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            patient = savePatientMapping(patient);
        }
        if (StringUtils.isNoneBlank(patient)) {
            String obj = hcyyEntranceService.findOutpatientInfo(patient, conNo, null, null);
            String obj = hcyyEntranceService.findOutpatientInfo(patient, conNo, null,null, null);
            if (StringUtils.isNoneBlank(obj)) {
                array = JSONArray.parseArray(obj).getJSONArray(0);
                if (array != null && array.size() != 0) {
@ -743,7 +766,7 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                JSONArray array = JSONArray.parseArray(obj);
                if (array!=null&&array.size()!=0){
                    JSONObject jsonObject = array.getJSONObject(0);
                    operatorId = jsonObject.getString("staffNo");
                    operatorId = jsonObject.getString("SUPER_ADD");
                }
            }
            if(null!=doctorMappingDO){
@ -766,8 +789,8 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
                paramRequest.put("outpatientCode","R"+wlyyOutpatientDO.getRegisterNo());
                paramRequest.put("eventno","R"+wlyyOutpatientDO.getRegisterNo());
            }
            paramRequest.put("templateid","1158");
            paramRequest.put("catalogid","50");
            paramRequest.put("templateid","2160");
            paramRequest.put("catalogid","74");
            paramRequest.put("emrtype","93");
            paramRequest.put("emrtitle","互联网医院");
@ -1561,4 +1584,233 @@ public class HcyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        optPatient+="</opt_prescription_item>";
        return optPatient;
    }
    public YlzMedicalRelationDO getSettlementInfo(String cardno,String outpatientId) throws Exception {
        YlzMedicalRelationDO ylzMedicalRelationDO =new YlzMedicalRelationDO();
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        String resNo = outpatientDO.getRegisterNo();
        //请求his获取待结算存储
        Map<String,Object> params = new HashedMap();
        String url =entranceUrlLocal +"getSettleMent";
        params.put("mct","03");
        params.put("mcn",cardno);
        HttpResponse response = HttpUtils.doGet(url,params);
        //获取his结算基本信息表
        String basicSql ="select * from SST_JSDP_JBXX_GJYB where CARD_NO ='"+cardno+"'";
        String res = hcyyEntranceService.getSql(basicSql);
        if (StringUtils.isNoneBlank(res)){
            JSONObject rs = JSONObject.parseObject(res);
            Integer status = rs.getInteger("status");
            if(status!=null&&status == 200){
                JSONArray array = rs.getJSONArray("detailModelList");
                for (int i=0;i<array.size();i++){
                    JSONObject object = array.getJSONObject(i);
                    String logNo = object.getString("LOG_NO");
                    String registerNo = object.getString("IPT_OTP_NO");
                    logger.info("logNo=="+logNo +"registerNo=="+registerNo);
                    if (registerNo.equalsIgnoreCase(resNo)){
                        logger.info("logNo=="+logNo +"registerNo=="+registerNo);
                        ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
                        if (ylzMedicalRelationDO==null){
                            ylzMedicalRelationDO = new YlzMedicalRelationDO();
                            ylzMedicalRelationDO.setLogNo(logNo);
                            ylzMedicalRelationDO.setRelationCode(outpatientId);
                            ylzMedicalRelationDO.setName(object.getString("PSN_NAME"));
                            ylzMedicalRelationDO.setTotalAmount(object.getString("COST"));
                            ylzMedicalRelationDO.setPersonCash(object.getString("ORIGIN_CHARGES"));
                            ylzMedicalRelationDO.setHisSerial(object.getString("RESIDENCE_NO"));
                            ylzMedicalRelationDO.setHisBillSerial(object.getString("SETTLE_NO"));
                            ylzMedicalRelationDO.setDeptCode(object.getString("DEPT_CODE"));
                            ylzMedicalRelationDO.setDeptName(object.getString("DEPT_NAME"));
                            ylzMedicalRelationDO.setHisDeptCode(object.getString("DEPT_CODE"));
                            ylzMedicalRelationDO.setHisDeptName(object.getString("DEPT_NAME"));
                            ylzMedicalRelationDO.setStatus(0);
                            ylzMedicalRelationDO.setState(0);
                            ylzMedicalRelationDO.setPersonAccount("0");
                            ylzMedicalRelationDO.setMedicalPrice("0");
                            ylzMedicalRelationDO.setHisSettleNo(object.getString("IPT_OTP_NO"));
                            ylzMedicalRelationDO.setCardNo(object.getString("CARD_NO"));
                            ylzMedicalRelationDO.setDate(DateUtil.strToDate(object.getString("BEGNTIME")));
                            ylzMedicalRelationDO.setBcwkje(object.getString("MEDFEE_SUMAMT"));
                        }else {
                            ylzMedicalRelationDO.setTotalAmount(object.getString("COST"));
                            ylzMedicalRelationDO.setPersonCash(object.getString("ORIGIN_CHARGES"));
                        }
                        ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
                        ylzMedicailMxDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
                        //获取结算明细
                        String detailSql =" select * from SST_JSDP_JSMX_GJYB where LOG_NO ='"+logNo+"' ";
                        String detailRes = hcyyEntranceService.getSql(detailSql);
                        List<YlzMedicalMxDO> mxDOList = new ArrayList<>();
                        if (StringUtils.isNoneBlank(detailRes)) {
                            JSONObject drs = JSONObject.parseObject(detailRes);
                            Integer dstatus = drs.getInteger("status");
                            if (dstatus != null && dstatus == 200) {
                                JSONArray darray = drs.getJSONArray("detailModelList");
                                for (int j = 0; j < darray.size(); j++) {
                                    JSONObject dobject = darray.getJSONObject(j);
                                    YlzMedicalMxDO medicalMxDO = new YlzMedicalMxDO();
                                    medicalMxDO.setDel(1);
                                    medicalMxDO.setCreateTime(new Date());
                                    medicalMxDO.setItemName(dobject.getString("XMMC00"));
                                    medicalMxDO.setHisDetailSn(dobject.getString("FEEDETL_SN"));
                                    medicalMxDO.setItemCode(dobject.getString("MED_LIST_CODG"));
                                    medicalMxDO.setPrescriptionCode(dobject.getString(""));
                                    medicalMxDO.setChargeUnit(dobject.getString("PRCUNT"));
                                    medicalMxDO.setSpecificationType(dobject.getString(""));
                                    medicalMxDO.setAmount(dobject.getString("CNT"));
                                    medicalMxDO.setPrice(dobject.getString("PRIC"));
                                    medicalMxDO.setSingleDose(dobject.getString("SIN_DOS_DSCR"));
                                    medicalMxDO.setUseFrequency(dobject.getString("USED_FRQU_DSCR"));
                                    medicalMxDO.setMedicationDays(dobject.getString("PRD_DAYS"));
                                    medicalMxDO.setMedicalWay(dobject.getString("MEDC_WAY_DSCR"));
                                    medicalMxDO.setDeptCode(dobject.getString("BILG_DEPT_CODG"));
                                    medicalMxDO.setDeptName(dobject.getString("BILG_DEPT_NAME"));
                                    medicalMxDO.setHisDeptCode(dobject.getString("BILG_DEPT_CODG"));
                                    medicalMxDO.setHisDeptName(dobject.getString("BILG_DEPT_NAME"));
                                    medicalMxDO.setMedicalPerId(dobject.getString("BILG_DR_CODG"));
                                    medicalMxDO.setMedicalPerName(dobject.getString("BILG_DR_NAME"));
                                    medicalMxDO.setLimitType(dobject.getString("HOSP_APPR_FLAG"));
                                    medicalMxDO.setHisItemCode(dobject.getString("MED_LIST_CODG"));
                                    medicalMxDO.setHisItemName(dobject.getString("XMMC00"));
                                    medicalMxDO.setTotalMoney(dobject.getString("DET_ITEM_FEE_SUMAMT"));
                                    medicalMxDO = ylzMedicailMxDao.save(medicalMxDO);
                                    mxDOList.add(medicalMxDO);
                                }
                            }
                        }
                        ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
                        List<YlzMedicalIcdDO> icdDOS = new ArrayList<>();
                        ylzMedicailIcdDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
                        //获取诊断
                        String icdSql =" select * from SST_JSDP_JSMX_GJYB where LOG_NO ='"+logNo+"' ";
                        String icdRes = hcyyEntranceService.getSql(icdSql);
                        if (StringUtils.isNoneBlank(icdRes)) {
                            JSONObject drs = JSONObject.parseObject(icdRes);
                            Integer dstatus = drs.getInteger("status");
                            if (dstatus != null && dstatus == 200) {
                                JSONArray darray = drs.getJSONArray("detailModelList");
                                for (int j = 0; j < darray.size(); j++) {
                                    JSONObject dobject = darray.getJSONObject(j);
                                    YlzMedicalIcdDO icdDO = new YlzMedicalIcdDO();
                                    icdDO.setCreateTime(new Date());
                                    icdDO.setDel(1);
                                    icdDO.setDiseaseCodeIcd10(dobject.getString("DIAG_CODE"));
                                    icdDO.setDiseaseNameIcd10(dobject.getString("DIAG_NAME"));
                                    icdDO.setDiseaseType(dobject.getString("DIAG_TYPE"));
                                    icdDO.setDiseaseOrder(dobject.getString("DIAG_SRT_NO"));
                                    icdDO.setMedicalId(ylzMedicalRelationDO.getId());
                                    icdDO = ylzMedicailIcdDao.save(icdDO);
                                    icdDOS.add(icdDO);
                                }
                            }
                        }
                        ylzMedicalRelationDO.setYlzMedicalIcdDOList(icdDOS);
                    }
                }
            }
        }
        return  ylzMedicalRelationDO;
    }
    public String confirmSettlement(String outpatientId) throws Exception {
        try {
            WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
            if (outpatientDO==null){
                throw new Exception("未找到待结算记录");
            }
            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
            if (ylzMedicalRelationDO.getState()==1){
                return "已结算";
            }
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(ylzMedicalRelationDO.getId());
            ylzMedicalRelationDO.setState(1);
            ylzMedicalRelationDO.setSettleDate(new Date());
            ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
            String sql = "update SST_JSDP_JBXX_GJYB\n" +
                    "   set SETL_ID           = '', \n" +
                    "       ACCT_PAY          = '0',\n" +
                    "       PSN_CASH_PAY      = '"+ylzMedicalRelationDO.getTotalAmount()+"',\n" +
                    "       FUND_PAY_SUMAMT   = '0',\n" +
                    "       CVLSERV_PAY       = '0',\n" +
                    "       PSN_PART_AMT      = '0',\n" +
                    "       HIFMI_PAY         = '0',\n" +
                    "       MEDFEE_SUMAMT     = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
                    "       SETL_TIME         = '0',\n" +
                    "       BALC              = '0',\n" +
                    "       ACCT_MULAID_PAY   = '0',\n" +
                    "       HIFOB_PAY         = '0',\n" +
                    "       MDTRT_ID          = '',\n" +
                    "       HIFP_PAY          = '0',\n" +
                    "       MAF_PAY           = '',\n" +
                    "       OTH_PAY           = '0',\n" +
                    "       HIFES_PAY         = '0',\n" +
                    "       OUTCHARGENO       = '"+businessOrderDO.getOrderNo()+"',\n" +
                    "       PSN_CERT_TYPE     = '0',\n" +
                    "       NATY              = '0',\n" +
                    "       BRDY              = '0',\n" +
                    "       CVLSERV_FLAG      = '0',\n" +
                    "       ACT_PAY_DEDC      = '0',\n" +
                    "       PSN_TYPE          = '0',\n" +
                    "       HOSP_PART_AMT     = '0',\n" +
                    "       CLR_OPTINS        = '0',\n" +
                    "       CLR_WAY           = '0',\n" +
                    "       CLR_TYPE          = '0',\n" +
                    "       POOL_PROP_SELFPAY = '0',\n" +
                    "       INSUPLC_ADMDVS    = '',\n" +
                    "       INSUTYPE          = '',\n" +
                    "       PSN_NO            = '',\n" +
                    "       CHANNEL_TYPE      = '',\n" +
                    "       ACSIGN_TYPE       = 'null',\n" +
                    "       MDTRT_CERT_TYPE   = '03',\n" +
                    "       CVL_ACCT_PAY      = '0',\n" +
                    "       CVL_ACCT_BALC     = '0',\n" +
                    "       HL_ACCT_PAY       = '0',\n" +
                    "       HL_ACCT_BALC      = '0',\n" +
                    "       FM_ACCT_BALC      = '0',\n" +
                    "       PUR_ACCT_PAY      = '0'\n" +
                    " where 1 = 1\n" +
                    "   and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
            //结算更新
            System.out.println("sql=="+sql);
            String res = hcyyEntranceService.updateUrl(sql);
            Map<String,Object> params = new HashedMap();
            String url =entranceUrlLocal +"comfirmSettleMent";
            params.put("mct","03");
            params.put("mcn",ylzMedicalRelationDO.getCardNo());
            params.put("xtgzh0",ylzMedicalRelationDO.getLogNo());
            HttpResponse response = HttpUtils.doGet(url,params);
            System.out.println("response=="+response.getContent());
            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findByOutPatientIdList(ylzMedicalRelationDO.getRegionCode());
            /*String */
            for (WlyyPrescriptionDO prescriptionDO:wlyyPrescriptionDOS){
                if (prescriptionDO.getStatus()==20){
                    WlyyPrescriptionLogDO prescriptionLogDO = new WlyyPrescriptionLogDO();
                    prescriptionLogDO.setCreateTime(new Date());
                    prescriptionLogDO.setStatus(30);
                    prescriptionLogDO.setOutpatientId(prescriptionDO.getOutpatientId());
                    prescriptionLogDO.setPrescriptionCode(prescriptionDO.getId());
                    prescriptionLogDO.setUserCode(prescriptionDO.getPatientCode());
                    prescriptionLogDO.setUserName(prescriptionDO.getPatientName());
                    prescriptionLogDO.setUserType(1);
                    prescriptionLogDO.setDatajson("处方结算");
                    prescriptionLogDao.save(prescriptionLogDO);
                    prescriptionDO.setStatus(30);
                    prescriptionDO.setPayTime(new Date());
                    prescriptionDao.save(prescriptionDO);
                    logger.info("变更处方结算状态成功");
                }
            }
            return "结算成功!";
        }catch (Exception e){
            e.printStackTrace();
            return "结算失败";
        }
    }
}

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

@ -14417,7 +14417,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            object.put("cardNo",outpatientDO.getCardNo());
            object.put("deptName",outpatientDO.getPatientName());
            return object;
        }else {
        } else if (wechatId.equalsIgnoreCase("xm_hcyy_wx")){
            com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
            logger.info("获取患者待结算信息开始!");
            YlzMedicalRelationDO ylzMedicalRelationDO = new YlzMedicalRelationDO();
            ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId);
            try {
                ylzMedicalRelationDO = hcyyPrescriptionService.getSettlementInfo(outpatientDO.getCardNo(),outpatientDO.getId());
            }catch (Exception e){
                throw new Exception(e.getMessage());
            }
            BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getPersonCash());//个人现金
            BigDecimal b2 = new BigDecimal(ylzMedicalRelationDO.getPersonAccount());//个人账户
            BigDecimal b3 = new BigDecimal(ylzMedicalRelationDO.getMedicalPrice());//医保总金额
            Double totalPirce=b1.add(b2).add(b3).doubleValue();
            logger.info("总费用:"+totalPirce);
            if (totalPirce!=Double.parseDouble(ylzMedicalRelationDO.getTotalAmount())){
                object.put("code","403");
                object.put("message","金额不对无法结算!");
            }else {
                object.put("code","200");
                object.put("message","核对金额无误!");
            }
            object.put("getSettleInfo",ylzMedicalRelationDO);
            return object;
        } else {
            com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
            logger.info("获取患者待结算信息开始!");
            YlzMedicalRelationDO ylzMedicalRelationDO = new YlzMedicalRelationDO();

+ 91 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/HcyyEntranceService.java

@ -43,7 +43,10 @@ import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import com.yihu.utils.security.MD5;
import net.sf.json.xml.XMLSerializer;
import nu.xom.*;
@ -54,6 +57,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -125,6 +129,12 @@ public class HcyyEntranceService {
    @Autowired
    private OauthRsaKeyDao rsaKeyDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
@ -137,7 +147,11 @@ public class HcyyEntranceService {
    private String sendMessageUrl="http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage";
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
    public static String entranceUrlLocal = "http://localhost:10023/xzzx/";
    public static String entranceUrlLocal = "http://127.0.0.1:10023/hcyy/";
    private final static String url="http://127.0.0.1:10023/hcyy/createSQLQuery";
    private final static String updateUrl="http://127.0.0.1:10023/hcyy/updateBySql";
    public static String hospitalUrl = "http://192.168.118.240:10022/";//172.16.100.63
@ -357,6 +371,8 @@ public class HcyyEntranceService {
        logger.info("getDoctorInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("getDoctorInfo json:"+json);
@ -804,7 +820,7 @@ public class HcyyEntranceService {
     * @throws Exception
     */
    //获取单条门诊就诊记录
    public String findOutpatientInfo(String patient,String conNo,String startTime,String endTime)throws Exception{
    public String findOutpatientInfo(String patient,String conNo,String ksdm,String startTime,String endTime)throws Exception{
        String api = "FindOutpatientInfo";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
@ -824,6 +840,9 @@ public class HcyyEntranceService {
            condition += "<startTime>"+startTime+"</startTime>";
        }
        if (StringUtils.isNoneBlank(ksdm)){
            condition +="<DEPT>"+ksdm+"</DEPT>";
        }
        if (!StringUtils.isEmpty(endTime)&&!endTime.equalsIgnoreCase("null")){
            condition += "<endTime>"+endTime+"</endTime>";
        }
@ -2980,7 +2999,7 @@ public class HcyyEntranceService {
                "   <callOperator></callOperator> " +
                "   <certificate>"+caKey+"</certificate> " +
                "</root>";
        String condition ="<strUserFileName>"+docIdcard+".png</strUserFileName>";
        String condition ="<strUserFileName>"+docIdcard+".jpg</strUserFileName>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
@ -3003,4 +3022,73 @@ public class HcyyEntranceService {
    //===========================CA签名==================================
    //=====================结算==============================
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
        return hibenateUtils.createSQLQuery(sql,params,page,size);
    }
    public List<Map<String, Object>> jdbcSQLQuery(String sql){
        return jdbcTemplate.queryForList(sql);
    }
    public void updateBySql(String sql){
        hibenateUtils.updateBySql(sql);
    }
    /**
     * 待结算
     *
     * @param fzxbh0
     * @param yyjgdm
     * @param mct
     * @param mcn
     * @return
     */
    public JSONObject  SP_SST_JSDP_JSMX_GJYB(String fzxbh0,String yyjgdm,String mct,String mcn){
        return hibenateUtils.SP_SST_JSDP_JSMX_GJYB(fzxbh0,yyjgdm,mct,mcn);
    }
    /**
     * 确认结算
     * @param fzxbh0
     * @param yyjgdm
     * @param mct
     * @param mcn
     * @param xtgzh0
     * @return
     */
    public JSONObject  SP_SST_JSDP_JSMXQR_GJYB(String fzxbh0,String yyjgdm,String mct,String mcn,String xtgzh0){
        return hibenateUtils.SP_SST_JSDP_JSMXQR_GJYB(fzxbh0,yyjgdm,mct,mcn,xtgzh0);
    }
    /**
     * 请求his服务查询数据
     * @param sql
     * @return
     * @throws Exception
     */
    public String getSql(String sql) throws Exception {
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("sql语句:"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        return content;
    }
    public String updateUrl(String sql) throws Exception {
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("sql语句:"+sql);
        HttpResponse response = HttpUtils.doGet(updateUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        return content;
    }
}

+ 169 - 0
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -2112,6 +2112,175 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        return response;
    }
    /**
     * 预交金处方支付
     * @param code
     * @param depositType
     * @param wechatId
     * @return
     * @throws Exception
     */
    public String ylzRechargePreHc(String code,String depositType,String wechatId,String cardType,String cardNo,boolean demoFlag) throws Exception {
        try {
        String response = null;
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        if(wxWechatDO==null){
            throw new Exception("can't find wechat:the wxId is "+wechatId);
        }
        WlyyHospitalSysDictDO hospitalSysDictDO =hospitalSysDictDao.findById("YLZ_NOTIFY_URL");
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(code);
        YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(code);
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(ylzMedicalRelationDO.getId());
        BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getBcwkje());//总金额
        BigDecimal b2 = new BigDecimal(ylzMedicalRelationDO.getPersonAccount());//个人账户
        BigDecimal b3 = new BigDecimal(ylzMedicalRelationDO.getMedicalPrice());//医保总金额
        Double fee = b1.subtract(b2).subtract(b3).doubleValue();
        if (businessOrderDO!=null){
            BasePatientDO patientDO = patientDao.findById(businessOrderDO.getPatient());
            String idcard = "";
            if (patientDO!=null){
                idcard = patientDO.getIdcard();
            }
            logger.info("开始1"+idcard);
            String openId = "";
            businessOrderDO.setPayPrice(b1.doubleValue());
            businessOrderDO.setPayType(4);
            businessOrderDO.setHistoryOrder(businessOrderDO.getOrderNo());
            businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessOrderDO.setDepositType(depositType);
            businessOrderDao.save(businessOrderDO);
            List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,wlyyOutpatientDO.getConsumer());
            if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                openId = patientWechatDo.getOpenid();
            }else {
                throw new Exception("请关注“厦门大学附属中山医院”公众号,点击互联网医院-在线诊室进行结算!");
            }
            String price = businessOrderDO.getPayPrice().toString();
            String notifyUrl = hospitalSysDictDO.getDictCode();
            String operatorId =null;
            String operatorName = null;
            if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                operatorId = "123456";
                operatorName =businessOrderDO.getPatientName();
            }else if(wechatId.equalsIgnoreCase("xm_xzzx_wx")){
                operatorId = "hlwyy";
                operatorName = "互联网医院";
            }else if(wechatId.equalsIgnoreCase("xm_hcyy_wx")){
                operatorId = "hlwyy";
                operatorName = "互联网医院";
            }
            response = ylzPayService.recharge(operatorId,operatorName,cardType,"01",cardNo,idcard,depositType,price,businessOrderDO.getOrderNo(),openId,patientDO.getName(),notifyUrl);
            if (depositType.equalsIgnoreCase("WX_QR")){
                JSONObject object = JSONObject.parseObject(response);
                if (object!=null){
                    JSONObject jsonObject = object.getJSONObject("param");
                    if (object.getString("respCode").equalsIgnoreCase("000000")){
                        InputStream qrcode = QrcodeUtil.createQrcode(jsonObject.getString("qrcode"),300,"jpg");
                        ByteToInputStream byteToInputStream = new ByteToInputStream();
                        String QRCodeImg = byteToInputStream.getBase64FromInputStream(qrcode);
                        jsonObject.put("qrcodeUrl","data:image/png;base64,"+ QRCodeImg);
                        String traceNo = jsonObject.getString("traceNo");
                        businessOrderDO.setTraceNo(traceNo);
                        businessOrderDao.save(businessOrderDO);
                    }
                    response = object.toJSONString();
                }
            }else {
                JSONObject object = JSONObject.parseObject(response);
                if (object!=null){
                    JSONObject jsonObject = object.getJSONObject("param");
                    if (object.getString("respCode").equalsIgnoreCase("000000")){
                        String traceNo = jsonObject.getString("traceNo");
                        businessOrderDO.setTraceNo(traceNo);
                        businessOrderDao.save(businessOrderDO);
                    }
                }
            }
        }else {
            businessOrderDO = new BusinessOrderDO();
            BasePatientDO patientDO = patientDao.findById(wlyyOutpatientDO.getPatient());
            String idcard = "";
            if (patientDO!=null){
                idcard = patientDO.getIdcard();
            }
            logger.info("开始1"+idcard);
            String openId = "";
            businessOrderDO.setPayPrice(b1.doubleValue());
            businessOrderDO.setPayType(4);
            businessOrderDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessOrderDO.setDepositType(depositType);
            businessOrderDO.setRelationCode(ylzMedicalRelationDO.getId());
            businessOrderDO.setRelationName("费用结算");
            businessOrderDO.setPatientName(patientDO.getName());
            businessOrderDO.setPatient(patientDO.getId());
            businessOrderDO.setDoctor(wlyyOutpatientDO.getDoctor());
            businessOrderDO.setOrderCategory("6");
            businessOrderDO.setOrderType(6);
            businessOrderDO.setStatus(0);
            businessOrderDO.setDescription("费用结算");
            businessOrderDO.setCreateTime(new Date());
            businessOrderDO.setUpdateTime(new Date());
            businessOrderDao.save(businessOrderDO);
            List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wechatId,businessOrderDO.getPatient());
            if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                BasePatientWechatDo patientWechatDo = patientWechatDos.get(0);
                openId = patientWechatDo.getOpenid();
            }
            String price = businessOrderDO.getPayPrice().toString();
            String notifyUrl = hospitalSysDictDO.getDictCode();
            String operatorId =null;
            String operatorName = null;
            if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
                operatorId = "123456";
                operatorName =businessOrderDO.getPatientName();
            }else if(wechatId.equalsIgnoreCase("xm_xzzx_wx")){
                operatorId = "hlwyy";
                operatorName = "互联网医院";
            }else if(wechatId.equalsIgnoreCase("xm_hcyy_wx")){
                operatorId = "hlwyy";
                operatorName = "互联网医院";
            }
            response = ylzPayService.recharge(operatorId,operatorName,cardType,"01",cardNo,idcard,depositType,price,businessOrderDO.getOrderNo(),openId,patientDO.getName(),notifyUrl);
            if (depositType.equalsIgnoreCase("WX_QR")){
                JSONObject object = JSONObject.parseObject(response);
                if (object!=null){
                    JSONObject jsonObject = object.getJSONObject("param");
                    if (object.getString("respCode").equalsIgnoreCase("000000")){
                        InputStream qrcode = QrcodeUtil.createQrcode(jsonObject.getString("qrcode"),300,"jpg");
                        ByteToInputStream byteToInputStream = new ByteToInputStream();
                        String QRCodeImg = byteToInputStream.getBase64FromInputStream(qrcode);
                        jsonObject.put("qrcodeUrl","data:image/png;base64,"+ QRCodeImg);
                        String traceNo = jsonObject.getString("traceNo");
                        businessOrderDO.setTraceNo(traceNo);
                        businessOrderDao.save(businessOrderDO);
                    }
                    response = object.toJSONString();
                }
            }else {
                JSONObject object = JSONObject.parseObject(response);
                if (object!=null){
                    JSONObject jsonObject = object.getJSONObject("param");
                    if (object.getString("respCode").equalsIgnoreCase("000000")){
                        String traceNo = jsonObject.getString("traceNo");
                        businessOrderDO.setTraceNo(traceNo);
                        businessOrderDao.save(businessOrderDO);
                    }
                }
            }
        }
        return response;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
    /**
     * 咨询退费
     * @param consult

+ 71 - 0
business/base-service/src/main/java/com/yihu/jw/utils/hibernate/HibenateUtils.java

@ -1,5 +1,6 @@
package com.yihu.jw.utils.hibernate;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.prescription.HlwCf01DO;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
@ -259,5 +260,75 @@ public class HibenateUtils {
        return priceStr;
    }
    /**
     * 获取待结算
     *
     * @param
     * @param fzxbh0 参保机构编号
     * @param yyjgdm  医院机构代码(总院、分院)
     * @param mct 就诊凭证类型01:医保凭证 02:身份证号 03:社保卡/接诊卡
     * @param mcn 病人卡号
     * @return
     */
    public JSONObject SP_SST_JSDP_JSMX_GJYB(String fzxbh0,String yyjgdm,String mct,String mcn){
        JSONObject object = new JSONObject();
        object.put("P_TRADE_TYPE","4");
        object.put("P_ZDBH00","XMHCYYHLWJS01");
        object.put("P_FZXBH0",fzxbh0);
        object.put("P_YYJGDM",yyjgdm);
        object.put("P_MDTRT_CERT_TYPE",mct);
        object.put("P_MDTRT_CERT_NO",mcn);
        System.out.println("object==="+object.toJSONString());
        StoredProcedureQuery query = entityManager
                .createStoredProcedureQuery("SP_SST_JSDP_JSMX_GJYB") // 被调用存储过程名称
                .registerStoredProcedureParameter("as_json_in", String.class, ParameterMode.IN) // 入参数
                .registerStoredProcedureParameter("rs_json_out",String.class,ParameterMode.INOUT) //出参
                .registerStoredProcedureParameter("P_ERRMSG", String.class, ParameterMode.INOUT)
                .setParameter("as_json_in",object.toJSONString());
        query.execute();
        JSONObject jsonObject = new JSONObject();
        String priceStr = (String) query.getOutputParameterValue("P_ERRMSG"); // 获取存储过程中的返回值
        String rs = (String) query.getOutputParameterValue("rs_json_out"); // 获取存储过程中的返回值
        jsonObject.put("error",priceStr);
        jsonObject.put("rs",rs);
        return jsonObject;
    }
    /**
     * 确认结算
     *
     * @param fzxbh0 参保机构编号
     * @param yyjgdm  医院机构代码(总院、分院)
     * @param mct 就诊凭证类型01:医保凭证 02:身份证号 03:社保卡/接诊卡
     * @param mcn 病人卡号
     * @param xtgzh0
     * @return
     */
    public JSONObject SP_SST_JSDP_JSMXQR_GJYB(String fzxbh0,String yyjgdm,String mct,String mcn,String xtgzh0){
        JSONObject object = new JSONObject();
        object.put("P_TRADE_TYPE","4");
        object.put("P_ZDBH00","XMHCYYHLWJS01");
        object.put("P_FZXBH0",fzxbh0);
        object.put("P_YYJGDM",yyjgdm);
        object.put("P_MDTRT_CERT_TYPE",mct);
        object.put("P_MDTRT_CERT_NO",mcn);
        object.put("P_XTGZH0",xtgzh0);
        System.out.println("object==="+object.toJSONString());
        StoredProcedureQuery query = entityManager
                .createStoredProcedureQuery("SP_SST_JSDP_JSMXQR_GJYB") // 被调用存储过程名称
                .registerStoredProcedureParameter("as_json_in", String.class, ParameterMode.IN) // 入参数
                .registerStoredProcedureParameter("rs_json_out",String.class,ParameterMode.INOUT) //出参
                .registerStoredProcedureParameter("P_ERRMSG", String.class, ParameterMode.INOUT)
                .setParameter("as_json_in",object.toJSONString());
        query.execute();
        JSONObject jsonObject = new JSONObject();
        String priceStr = (String) query.getOutputParameterValue("P_ERRMSG"); // 获取存储过程中的返回值
        String rs = (String) query.getOutputParameterValue("rs_json_out"); // 获取存储过程中的返回值
        jsonObject.put("error",priceStr);
        jsonObject.put("rs",rs);
        return jsonObject;
    }
}

+ 105 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/HcyyController.java

@ -0,0 +1,105 @@
package com.yihu.jw.entrance.controller;
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.prescription.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.HcyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.utils.EntityUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2020/1/19.
 */
@RestController
@RequestMapping(value ="/hcyy")
@Api(value = "海沧医院视图解析", description = "海沧医院视图解析", tags = {"海沧医院视图解析"})
public class HcyyController extends EnvelopRestEndpoint {
    @Autowired
    private HcyyEntranceService hcyyEntranceService;
    @GetMapping(value = "/createSQLQuery")
    @ApiOperation(value = "视图统一查询")
    public ListEnvelop createSQLQuery(@ApiParam(name = "sql", value = "sql语句", required = true)
                                      @RequestParam(value = "sql",required = true)String sql,
                                      @ApiParam(name = "params", value = "入参", required = false)
                                      @RequestParam(value = "params",required = false)Map<String, Object> params,
                                      @ApiParam(name = "page", value = "第几页", required = false)
                                      @RequestParam(value = "page",required = false)Integer page,
                                      @ApiParam(name = "size", value = "分页大小", required = false)
                                      @RequestParam(value = "size",required = false)Integer size){
        return success(hcyyEntranceService.createSQLQuery(sql,params,page,size));
    }
    @GetMapping(value = "/jdbcSQLQuery")
    @ApiOperation(value = "视图统一查询")
    public ListEnvelop jdbcSQLQuery(@ApiParam(name = "sql", value = "sql语句", required = true)
                                      @RequestParam(value = "sql",required = true)String sql){
        return success(hcyyEntranceService.jdbcSQLQuery(sql));
    }
    @GetMapping(value = "/getSettleMent")
    @ApiOperation(value = "待结算列表")
    public Envelop getSettleMent(@ApiParam(name = "fzxbh0", value = "参保机构编号", required = false)
                                    @RequestParam(value = "fzxbh0",required = false)String fzxbh0,
                                     @ApiParam(name = "yyjgdm", value = "医院机构代码(总院、分院)", required = false)
                                     @RequestParam(value = "yyjgdm",required = false)String yyjgdm,
                                     @ApiParam(name = "mct", value = "就诊凭证类型01:医保凭证 02:身份证号 03:社保卡/接诊卡", required = false)
                                         @RequestParam(value = "mct",required = false)String mct,
                                     @ApiParam(name = "mcn", value = "病人卡号", required = false)
                                         @RequestParam(value = "mcn",required = false)String mcn){
        return success(hcyyEntranceService.SP_SST_JSDP_JSMX_GJYB(fzxbh0,yyjgdm,mct,mcn));
    }
    @GetMapping(value = "/comfirmSettleMent")
    @ApiOperation(value = "确认结算")
    public Envelop comfirmSettleMent(@ApiParam(name = "fzxbh0", value = "参保机构编号", required = false)
                                 @RequestParam(value = "fzxbh0",required = false)String fzxbh0,
                                 @ApiParam(name = "yyjgdm", value = "医院机构代码(总院、分院)", required = false)
                                 @RequestParam(value = "yyjgdm",required = false)String yyjgdm,
                                 @ApiParam(name = "mct", value = "就诊凭证类型01:医保凭证 02:身份证号 03:社保卡/接诊卡", required = false)
                                 @RequestParam(value = "mct",required = false)String mct,
                                 @ApiParam(name = "mcn", value = "病人卡号", required = false)
                                 @RequestParam(value = "mcn",required = false)String mcn,
                                 @ApiParam(name = "xtgzh0", value = "系统跟踪号", required = false)
                                     @RequestParam(value = "xtgzh0",required = false)String xtgzh0){
        return success(hcyyEntranceService.SP_SST_JSDP_JSMXQR_GJYB(fzxbh0,yyjgdm,mct,mcn,xtgzh0));
    }
    @GetMapping(value = "/updateBySql")
    @ApiOperation(value = "更新语句")
    public ObjEnvelop updateBySql(@ApiParam(name = "sql", value = "sql语句", required = true)
                                  @RequestParam(value = "sql",required = true)String sql){
        ObjEnvelop envelop = new ObjEnvelop();
        hcyyEntranceService.updateBySql(sql);
        return success(envelop);
    }
}

+ 23 - 16
svr/svr-internet-hospital-entrance/src/main/resources/application.yml

@ -580,12 +580,12 @@ express:
#海沧医院内网
spring:
  profiles: hcyyProd
  profiles: ZjxlProd
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://127.0.0.1:3306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: wlyy
    password: 2oEq3Kf7@zjxl
    url: jdbc:mysql://192.168.1.103:4406/zentao?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: root
    password: jkzlehr
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
@ -622,14 +622,21 @@ express:
---
#海沧医院内网
# 海沧医院连his库
spring:
  profiles: ZjxlProd
  profiles: hcyyProd
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    url: jdbc:mysql://192.168.1.103:4406/zentao?useUnicode:true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: root
    password: jkzlehr
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@10.95.100.10:1521/hcyy
    username: NET
    password: zy02v4NT
  jpa:
    properties:
      hibernate:
        dialect: org.hibernate.dialect.Oracle10gDialect
        show_sql: true
    database: oracle
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
@ -644,22 +651,22 @@ hospital:
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://192.168.118.240:3000/
  im_list_get: http://172.16.1.42:3000/
  data_base_name: im
fastDFS:
  fastdfs_file_url: http://127.0.0.1:8888/
  fastdfs_file_url: http://192.0.33.26:8888/
fast-dfs:
  tracker-server: :22122 #服务器地址
  tracker-server: 192.168.103.159:22122 #服务器地址
#是否开启i健康接口 0关闭,1开启
testPattern:
  sign: 0
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: WH000061
  sf_check_word: BEWFSCXSyjt4314rz
  sf_code: WH000091
  sf_check_word: SFAHKAOFAAITyjt7890

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

@ -232,6 +232,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private TasyNatService tasyNatService;
    @Autowired
    private YqfkService yqfkService;
    @Autowired
    private HcyyPrescriptionService hcyyPrescriptionService;
    @Value("${testPattern.sign}")
    private String isClose;
@ -732,7 +734,12 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            hospitalSystemMessageService.sendImMessage(systemMessageDO);
                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("6")){
                            YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findOne(businessOrderDO.getRelationCode());
                            prescriptionService.confirmSettlementService(ylzMedicalRelationDO.getRelationCode());
                            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
                                hcyyPrescriptionService.confirmSettlement(ylzMedicalRelationDO.getRelationCode());
                            }else {
                                prescriptionService.confirmSettlementService(ylzMedicalRelationDO.getRelationCode());
                            }
                        }
                    }
                    businessOrderService.updatePayStatus(traceNo);

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/HcyyPrescriptionCotroller.java

@ -138,7 +138,7 @@ public class HcyyPrescriptionCotroller extends EnvelopRestEndpoint {
                                             @RequestParam(value = "startTime",required = false)String startTime,
                                         @ApiParam(name = "endTime", value = "结束时间", required = false)
                                             @RequestParam(value = "endTime",required = false)String endTime)throws Exception{
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.findOutpatientInfo(patient,conNo,startTime,endTime));
        return ObjEnvelop.getSuccess("ok",hcyyEntranceService.findOutpatientInfo(patient,conNo,null,startTime,endTime));
    }
    /**

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

@ -233,7 +233,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            } else if (wxId.equalsIgnoreCase("sd_tnzyy_wx")) {
                vos = tnPrescriptionService.findOutpatientList(patient, cardNo, startTime, endTime, demoFlag, ksdm, flag);
            } else if (wxId.equalsIgnoreCase("xm_hcyy_wx")) {
                vos = hcyyPrescriptionService.selectOutpatientList(patient,startTime,endTime,cardNo);
                vos = hcyyPrescriptionService.selectOutpatientList(patient,startTime,endTime,ksdm,cardNo);
            } else {
                return ListEnvelop.getError("尚未开发!");
            }
@ -2162,6 +2162,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "cardNo", value = "cardNo", required = true)
            @RequestParam(required = true) String cardNo) throws Exception {
        try {
            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
                return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePreHc(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
            }
            return ObjEnvelop.getSuccess("ok", businessOrderService.ylzRechargePre(relationCode, depositType, wxId, cardType, cardNo, demoFlag));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
@ -3682,6 +3685,9 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "outpatientId", value = "outpatientId")
            @RequestParam(value = "outpatientId", required = false) String outpatientId) throws Exception {
        try {
            if (wxId.equalsIgnoreCase("xm_hcyy_wx")){
                return success("操作成功", hcyyPrescriptionService.confirmSettlement(outpatientId));
            }
            return success("操作成功", prescriptionService.confirmSettlementService(outpatientId));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());