Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

Trick 5 years ago
parent
commit
9b05c8a6cb
20 changed files with 1118 additions and 65 deletions
  1. 1 1
      business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseDeptDictDao.java
  2. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/mapping/dao/DoctorMappingDao.java
  3. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/mapping/dao/PatientMappingDao.java
  4. 2 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OauthYlzConfigDao.java
  5. 534 26
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
  6. 13 11
      business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java
  7. 6 0
      business/base-service/src/main/java/com/yihu/jw/utils/hibernate/HibenateUtils.java
  8. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java
  9. 6 6
      common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/BaseSuperviseDataDict.java
  10. 88 0
      common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java
  11. 21 0
      common/common-entity/src/main/java/com/yihu/jw/entity/ylzinfo/OauthYlzConfigDO.java
  12. 8 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  13. 8 6
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java
  14. 13 3
      svr/svr-internet-hospital/pom.xml
  15. 14 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/dao/order/businessOrderDao.java
  16. 125 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/MultipleCode/MultipleCoderController.java
  17. 65 11
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/Xzyy/XzyyController.java
  18. 185 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/MultipleCode/MultipleCodeService.java
  19. 14 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/order/BusinessOrderService.java
  20. 1 1
      svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistScreenResultService.java

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseDeptDictDao.java

@ -20,6 +20,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * @since 1.
 */
public interface BaseDeptDictDao extends PagingAndSortingRepository<BaseDeptDict, Integer>, JpaSpecificationExecutor<BaseDeptDict>  {
    @Query("select s from BaseDeptDict s where s.deptCode=1")
    @Query("select s from BaseDeptDict s where s.deptCode=?1")
    BaseDeptDict selectByDeptCode(String deptCode);
}

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/dao/DoctorMappingDao.java

@ -14,4 +14,6 @@ public interface DoctorMappingDao extends PagingAndSortingRepository<DoctorMappi
    List<DoctorMappingDO> findByDoctorAndOrgCode(String doctor,String orgCode);
    List<DoctorMappingDO> findByOrgCodeAndMappingCode(String orgCode,String mappingCode);
    DoctorMappingDO findByDoctor(String doctor);
}

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/dao/PatientMappingDao.java

@ -11,4 +11,6 @@ public interface PatientMappingDao extends PagingAndSortingRepository<PatientMap
    PatientMappingDO findByIdcardAndSource(String idcard,String source);
    PatientMappingDO findByMappingCodeAndSource(String mappingCode,String source);
    PatientMappingDO findByPatient(String patient);
}

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

@ -8,4 +8,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
 * Created by Trick on 2019/7/26.
 */
public interface OauthYlzConfigDao extends PagingAndSortingRepository<OauthYlzConfigDO, String>, JpaSpecificationExecutor<OauthYlzConfigDO> {
    OauthYlzConfigDO findById(String id);
}

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

@ -3,7 +3,6 @@ package com.yihu.jw.hospital.prescription.service.entrance;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dict.dao.BaseDictJobTitleDao;
import com.yihu.jw.dict.dao.DictDoctorDutyDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
@ -18,13 +17,19 @@ import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
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.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
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.util.AES;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.http.HttpClientUtil;
@ -32,21 +37,19 @@ import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.WebserviceUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import net.sf.json.xml.XMLSerializer;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.*;
/**
 * 心脏中心内网his对接服务
@ -54,7 +57,7 @@ import java.util.Random;
 */
@Service
@Transactional
public class XzzxEntranceService {
public class XzzxEntranceService{
    private static Logger logger = LoggerFactory.getLogger(XzzxEntranceService.class);
@ -75,12 +78,29 @@ public class XzzxEntranceService {
    @Autowired
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private BasePatientDao patientDao;
    @Autowired
    private PatientMappingDao patientMappingDao;
    @Autowired
    private OutpatientDao outpatientDao;
    @Autowired
    private PatientRegisterDao patientRegisterDao;
    @Autowired
    private WlyyHttpLogDao wlyyHttpLogDao;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionDiagnosisDao diagnosisDao;
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private WlyyInspectionDao wlyyInspectionDao;
    private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
@ -711,7 +731,7 @@ public class XzzxEntranceService {
     * @throws Exception
     */
    //处方状态变更
    public String updatePreStatus(String admNo,String realOrder,String status)throws Exception{
    public String updatePrescriptionStatus(String admNo,String realOrder,String status)throws Exception{
        String api = "UpdatePreStatus";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
@ -854,9 +874,9 @@ public class XzzxEntranceService {
    public String ehospitalNotice(String userName, String idCard, String phone, String title, String url, String content, String contentString) {
        logger.info("ehospitalNotice:");
        BasePatientDO patientDO = basePatientDao.findByIdcardAndDel(idCard,"1");
        BasePatientDO patientDO = patientDao.findByIdcardAndDel(idCard,"1");
        if(patientDO!=null&&StringUtils.isNotBlank(patientDO.getIdcard())){
            sendXCXMes("xm_xzzx_wx",patientDO.getId(),null,content,contentString,"",url,"");
            sendMes("xm_xzzx_wx",patientDO.getId(),null,content,contentString,"",url);
        }
        return "-2";
    }
@ -871,14 +891,43 @@ public class XzzxEntranceService {
    /**
     * 查询患者就诊卡
     * @param idCard 身份证号
     * @param patient 身份证号
     * @return
     */
    public String selectPateintCard(String idCard){
    public JSONArray selectPateintCard(String patient) throws Exception {
        BasePatientDO patientDO = patientDao.findById(patient);
        String idCard = "";
        if (patientDO==null||StringUtil.isBlank(patientDO.getIdcard())){
            throw new Exception("居民身份证不存在");
        }else {
            idCard = patientDO.getIdcard();
        }
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        String response="";
        String url = entranceUrl+"findPatientCard?idCard="+idCard;
        response = httpClientUtil.get(url,"GBK");
        return response;
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
            JSONArray array = JSONArray.parseArray(obj).getJSONArray(0);
            if (array!=null&&array.size()!=0){
                JSONObject object1 = array.getJSONObject(0);
                if (patientMappingDO==null){
                    patientMappingDO.setIdcard(patientDO.getIdcard());
                    patientMappingDO.setPatientName(patientDO.getName());
                    patientMappingDO.setPatient(patientDO.getId());
                    patientMappingDO.setCreateTime(new Date());
                    patientMappingDO.setSource("1");
                    patientMappingDO.setMappingCode(object1.getString("SICKID"));
                }else {
                    patientMappingDO.setMappingCode(object1.getString("SICKID"));
                }
                patientMappingDao.save(patientMappingDO);
            }
            return array;
        }
        return null;
    }
    /**
@ -886,11 +935,16 @@ public class XzzxEntranceService {
     * @param cardNo 就诊卡
     * @return
     */
    public String selectCardInfo(String cardNo){
    public JSONArray selectCardInfo(String cardNo){
        JSONArray array = new JSONArray();
        String response="";
        String url = entranceUrl+"getCardInfo?cardNo="+cardNo;
        response = httpClientUtil.get(url,"GBK");
        return response;
        JSONObject object = JSONObject.parseObject(response);
        if (object.getInteger("status")==200){
            array = JSONArray.parseArray(object.getString("obj")).getJSONArray(0);
        }
        return array;
    }
@ -900,27 +954,219 @@ public class XzzxEntranceService {
     * @param conNo 就诊次数
     * @return
     */
    public String selectOutpatientInfo(String patient,String conNo){
    public WlyyOutpatientVO selectOutpatientInfo(String patient,String conNo){
        WlyyOutpatientVO outpatientVO = new WlyyOutpatientVO();
        JSONArray array = new JSONArray();
        String response="";
        String url = entranceUrl+"findOutpatientInfo?patient="+patient+"&conNo="+conNo;
        response = httpClientUtil.get(url,"GBK");
        return response;
        JSONObject jsonObject = JSONObject.parseObject(response);
        if (jsonObject.getInteger("status")==200){
            array = JSONArray.parseArray(jsonObject.getString("obj")).getJSONArray(0);
            JSONObject object = array.getJSONObject(0);
            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.setIdcard(isEmty(object.getString("idcard")));
            outpatientVO.setMjz(isEmty(object.getString("mjz")));
            outpatientVO.setIcd10(isEmty(object.getString("icd10")));
            outpatientVO.setIcd10Name(isEmty(object.getString("icd10Name")));
            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")));
        }
        return outpatientVO;
    }
    /**
     * 获取门诊下所有处方信息
     * @param registerSn 流水号
     * @param patNo 病人id
     * @param patNo 居民id
     * @param admNo 住院唯一号
     * @param realOrder 处方号
     * @return
     */
    public String selectOriginPrescriptionList(String registerSn,String patNo,String admNo,String realOrder){
    public List<WlyyPrescriptionVO> selectOriginPrescriptionList(String registerSn,String patNo,String admNo,String realOrder){
        List<WlyyPrescriptionVO> prescriptionVOList = new ArrayList<>();
        JSONArray array = new JSONArray();
        String response="";
        String url = entranceUrl+"getOriginPrescriptionList?registerSn="+registerSn+"&patNo="+patNo+"&admNo="+admNo+"&realOrder"+realOrder;
        String params = "";
        if (StringUtils.isNoneBlank(realOrder)){
            params +="&realOrder="+realOrder;
        }
        String url = entranceUrl+"getOriginPrescriptionList?registerSn="+registerSn+"&patNo="+patNo+"&admNo="+admNo+params;
        response = httpClientUtil.get(url,"GBK");
        return response;
        JSONObject object = JSONObject.parseObject(response);
        if (object.getInteger("status")==200){
            array = JSONArray.parseArray(object.getString("obj")).getJSONArray(0);
            for (int i=0;i<array.size();i++){
                WlyyPrescriptionVO wlyyPrescriptionVO = new WlyyPrescriptionVO();
                JSONObject jsonObject = array.getJSONObject(i);
                wlyyPrescriptionVO.setId(isEmty(jsonObject.getString("id")));
                wlyyPrescriptionVO.setCreateTime(DateUtil.strToDate(isEmty(jsonObject.getString("createTime"))));
                wlyyPrescriptionVO.setCreateUser(isEmty(jsonObject.getString("createUser")));
                wlyyPrescriptionVO.setCreateUserName(isEmty(jsonObject.getString("createUserName")));
                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("patientName")));
                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(""))));
                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(jsonObject.getInteger("dispensaryType"));
                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(jsonObject.getInteger("hisRegisterFee"));
                wlyyPrescriptionVO.setPayStatus(jsonObject.getInteger("payStatus"));
                //TODO 快递数据
                wlyyPrescriptionVO.setDispUser(isEmty(jsonObject.getString("dispUser")));
                wlyyPrescriptionVO.setDispUserName(isEmty(jsonObject.getString("dispUserName")));
                wlyyPrescriptionVO.setDispDate(DateUtil.strToDate(isEmty(jsonObject.getString("dispDate"))));
                //诊断
                List<WlyyPrescriptionDiagnosisVO> prescriptionDiagnosisVOS = new ArrayList<>();
                JSONArray jsonArray = jsonObject.getJSONArray("diagnosisVOs");
                for (int j=0;j<jsonArray.size();j++){
                    JSONObject disagnosisJson = jsonArray.getJSONObject(j);
                    WlyyPrescriptionDiagnosisVO prescriptionDiagnosisVO = new WlyyPrescriptionDiagnosisVO();
                    prescriptionDiagnosisVO.setId(isEmty(disagnosisJson.getString("id")));
                    prescriptionDiagnosisVO.setCreateTime(DateUtil.strToDate(isEmty(disagnosisJson.getString("createTime"))));
                    prescriptionDiagnosisVO.setCreateUser(isEmty(disagnosisJson.getString("createUser")));
                    prescriptionDiagnosisVO.setCreateUserName(isEmty(disagnosisJson.getString("createUserName")));
                    prescriptionDiagnosisVO.setUpdateTime(DateUtil.strToDate(isEmty(disagnosisJson.getString("updateTime"))));
                    prescriptionDiagnosisVO.setUpdateUser(isEmty(disagnosisJson.getString("updateUser")));
                    prescriptionDiagnosisVO.setUpdateUserName(isEmty(disagnosisJson.getString("updateUserName")));
                    prescriptionDiagnosisVO.setPrescriptionId(isEmty(disagnosisJson.getString("prescriptionId")));
                    prescriptionDiagnosisVO.setCode(isEmty(disagnosisJson.getString("code")));
                    prescriptionDiagnosisVO.setName(isEmty(disagnosisJson.getString("name")));
                    prescriptionDiagnosisVO.setType(disagnosisJson.getInteger("type"));
                    prescriptionDiagnosisVOS.add(prescriptionDiagnosisVO);
                }
                wlyyPrescriptionVO.setDiagnosisVOs(prescriptionDiagnosisVOS);
                //药品
                List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOList = new ArrayList<>();
                JSONArray infoArray = jsonObject.getJSONArray("infoVOs");
                for (int j=0;j<infoArray.size();j++){
                    WlyyPrescriptionInfoVO prescriptionInfoVO = new WlyyPrescriptionInfoVO();
                    JSONObject infoJson = infoArray.getJSONObject(j);
                    prescriptionInfoVO.setId(isEmty(infoJson.getString("id")));
                    prescriptionInfoVO.setCreateTime(DateUtil.strToDate(isEmty(infoJson.getString("createTime"))));
                    prescriptionInfoVO.setCreateUser(isEmty(infoJson.getString("createUser")));
                    prescriptionInfoVO.setCreateUserName(infoJson.getString("createUserName"));
                    prescriptionInfoVO.setUpdateTime(DateUtil.strToDate(isEmty(infoJson.getString("updateTime"))));
                    prescriptionInfoVO.setUpdateUser(isEmty(infoJson.getString("updateUser")));
                    prescriptionInfoVO.setUpdateUserName(isEmty(infoJson.getString("updateUserName")));
                    prescriptionInfoVO.setPrescriptionId(isEmty(infoJson.getString("prescriptionId")));
                    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(infoJson.getDouble("packRetprice"));
                    prescriptionInfoVO.setHerbalCount(isEmty(infoJson.getString("herbalCount")));
                    prescriptionInfoVO.setPostCount(isEmty(infoJson.getString("postCount")));
                    prescriptionInfoVO.setDel(infoJson.getInteger("del"));
                    prescriptionInfoVO.setComm(infoJson.getString("comm"));
                    wlyyPrescriptionInfoVOList.add(prescriptionInfoVO);
                }
                wlyyPrescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOList);
                //检查检验内容
                List<WlyyInspectionVO> wlyyInspectionVOList = new ArrayList<>();
                JSONArray inspectionArray = jsonObject.getJSONArray("inspectionVOs");
                for (int j=0;j<inspectionArray.size();j++){
                    WlyyInspectionVO inspectionVO = new WlyyInspectionVO();
                    JSONObject inspectionJson = inspectionArray.getJSONObject(j);
                    inspectionVO.setId(isEmty(inspectionJson.getString("id")));
                    inspectionVO.setOutpatientId(isEmty(inspectionJson.getString("outpatientId")));
                    inspectionVO.setDept(isEmty(inspectionJson.getString("dept")));
                    inspectionVO.setDeptName(isEmty(inspectionJson.getString("deptName")));
                    inspectionVO.setGroupName(isEmty(inspectionJson.getString("groupName")));
                    inspectionVO.setQuantity(inspectionJson.getInteger("quantity"));
                    inspectionVO.setFrequency(isEmty(inspectionJson.getString("frequency")));
                    inspectionVO.setParentCode(isEmty(inspectionJson.getString("parentCode")));
                    inspectionVO.setParentName(isEmty(inspectionJson.getString("parentName")));
                    inspectionVO.setCode(isEmty(inspectionJson.getString("code")));
                    inspectionVO.setName(isEmty(inspectionJson.getString("name")));
                    inspectionVO.setInformation(isEmty(inspectionJson.getString("information")));
                    inspectionVO.setCheckEquip(isEmty(inspectionJson.getString("checkEquip")));
                    inspectionVO.setCheckPartName(isEmty(inspectionJson.getString("checkPartName")));
                    inspectionVO.setCheckPart(isEmty(inspectionJson.getString("checkPart")));
                    inspectionVO.setAdresult(isEmty(inspectionJson.getString("adresult")));
                    inspectionVO.setGoal(isEmty(inspectionJson.getString("goal")));
                    inspectionVO.setOpview(isEmty(inspectionJson.getString("opview")));
                    inspectionVO.setSpecimenName(isEmty(inspectionJson.getString("specimenName")));
                    inspectionVO.setSpecimenNum(isEmty(inspectionJson.getString("specimenNum")));
                    inspectionVO.setYwjcResult(isEmty(inspectionJson.getString("ywjcResult")));
                    inspectionVO.setYwjcDate(isEmty(inspectionJson.getString("ywjcDate")));
                    inspectionVO.setBlzd(isEmty(inspectionJson.getString("blzd")));
                    inspectionVO.setFixationfluid(isEmty(inspectionJson.getString("fixationfluid")));
                    inspectionVO.setCreateTime(DateUtil.strToDate(isEmty(inspectionJson.getString("createTime"))));
                    inspectionVO.setCheckbox(isEmty(inspectionJson.getString("checkbox")));
                    inspectionVO.setMzpg(isEmty(inspectionJson.getString("mzpg")));
                    inspectionVO.setSfzg(isEmty(inspectionJson.getString("sfzg")));
                    wlyyInspectionVOList.add(inspectionVO);
                }
                wlyyPrescriptionVO.setInspectionVOs(wlyyInspectionVOList);
            }
        }
        return prescriptionVOList;
    }
@ -933,14 +1179,276 @@ public class XzzxEntranceService {
     * @param clinicclass 挂号类别(必填)
     * @return
     */
    public String registeredOperate(String doctor,String dept,String sickId,String clinicclass){
    public JSONArray registeredOperate(String doctor,String dept,String sickId,String clinicclass){
        JSONArray array = new JSONArray();
        String response="";
        String url = entranceUrl+"registered?doctor="+doctor+"&dept="+dept+"&sickId="+sickId+"&clinicclass"+clinicclass;
        response = httpClientUtil.get(url,"GBK");
        return response;
        JSONObject object = JSONObject.parseObject(response);
        if (object.getInteger("status")==200){
            array = JSONArray.parseArray(object.getString("obj")).getJSONArray(0);
        }
        return array;
    }
//=====================hospital应用调用entrance应用============end=================
//============================hospital业务层==================start====================
    /**
     * 挂号接口
     * @param outPatientId
     * @param doctor
     * @param chargeType
     * @return
     */
    public JSONObject registerOutPatient(String outPatientId, String doctor,String chargeType){
        WlyyOutpatientDO outpatientDO = outpatientDao.findOne(outPatientId);
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        if (doctorMappingDO == null) {
            throw new RuntimeException("未找到医生映射信息");
        }
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getPatient());
        if (patientMappingDO==null){
            throw new RuntimeException("未找到居民映射信息");
        }
        //查找居民当天挂号记录
        String date = DateUtil.dateToStr(new Date(), "yyyy-MM-dd");
        List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctor(outpatientDO.getPatient(), date, doctor);
        if (patientRegisterDOs != null && patientRegisterDOs.size() > 0) {
            WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
            //判断是否已经挂号,如果已经挂号
            if (StringUtils.isNotBlank(registerDO.getRegisterNo())) {
                JSONObject res = new JSONObject();
                res.put("@RESULT", "0");
                logger.info("已经挂号 res: " + res.toString());
                //更新挂号流水号
                outpatientDO.setConNo(registerDO.getConNo());
                outpatientDO.setRegisterNo(registerDO.getRegisterNo());
                outpatientDO.setAdmDate(registerDO.getCreateTime());
                outpatientDao.save(outpatientDO);
                return res;
            }
        }
        JSONArray response =  registeredOperate(doctorMappingDO.getMappingCode(),outpatientDO.getDept(),patientMappingDO.getMappingCode(),chargeType);
        JSONObject res = response.getJSONObject(0);
        logger.info("挂号结果 res: " + response.toString());
        String rsCode = res.getString("registerNo");
        if ("0".equals(rsCode)) {
            //存储挂号号
            String serialNo = (String) res.get("registerNo");
            outpatientDO.setRegisterNo(serialNo);
            outpatientDO.setAdmDate(new Date());
            logger.info("挂号流水 registerNo: ");
            outpatientDao.save(outpatientDO);
            //存储就诊记录
            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
            // 存储挂号医生与挂号科室
            registerDO.setDoctor(outpatientDO.getDoctor());
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            //挂号流水号与挂号次数
            registerDO.setRegisterNo(serialNo);
            registerDO.setCreateTime(new Date());
            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
            patientRegisterDao.save(registerDO);
        } else if ("-2".equals(rsCode)) {
            String serialNo = (String) res.get("registerNo");
            outpatientDO.setRegisterNo(serialNo);
            outpatientDO.setAdmDate(new Date());
            logger.info("挂号流水 registerNo: " + serialNo );
            outpatientDao.save(outpatientDO);
            //存储就诊记录
            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
            registerDO.setDoctor(outpatientDO.getDoctor());
            registerDO.setDoctorName(outpatientDO.getDoctorName());
            registerDO.setDept(outpatientDO.getDept());
            registerDO.setDeptName(outpatientDO.getDeptName());
            registerDO.setPatient(outpatientDO.getPatient());
            registerDO.setPatientName(outpatientDO.getPatientName());
            registerDO.setRegisterNo(serialNo);
            registerDO.setCreateTime(new Date());
            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
            patientRegisterDao.save(registerDO);
        }
        //保存日志
        WlyyHttpLogDO log = new WlyyHttpLogDO();
        log.setCode("registerOutPatient");
        log.setName("挂号");
        log.setPatient(outpatientDO.getPatient());
        log.setDoctor(doctor);
        log.setResponse(response.toString());
        log.setRequest("outPatientId=" + outPatientId + "&doctor=" + doctor);
        log.setStatus(rsCode);
        log.setCreateTime(new Date());
        wlyyHttpLogDao.save(log);
        return res;
    }
    /**
     * 查询单条门诊记录
     * @param patient
     * @param conNo
     * @return
     */
    public WlyyOutpatientVO findOutpatientData(String patient, String conNo)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =findHisPatNoByPatient(patient);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
        logger.info("findOutpatientList patNo:"+patNo);
        WlyyOutpatientVO outpatientVO=selectOutpatientInfo(patNo,conNo);
        if(outpatientVO!=null){
            BasePatientDO patientDO = patientDao.findById(patient);
            outpatientVO.setSex(patientDO.getSex()+"");
            outpatientVO.setBirthday(patientDO.getBirthday());
            return outpatientVO;
        }
        return outpatientVO;
    }
    public String isEmty(String str){
        if (str.equalsIgnoreCase("[]")){
            return null;
        }else {
            return str;
        }
    }
    /**
     * 获取his居民id
     * @param patient
     * @return
     * @throws Exception
     */
    public String findHisPatNoByPatient(String patient)throws Exception{
        logger.info("findHisPatNoByPatient:"+patient);
        BasePatientDO patientDO = patientDao.findById(patient);
        logger.info("patientDO:"+patientDO.toString());
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patient);
        if(patientMappingDO!=null){
            return patientMappingDO.getMappingCode();
        }
        String patientId = "";
        JSONArray rs = selectPateintCard(patient);
        if (rs!=null&&rs.size()!=0){
            JSONObject object = rs.getJSONObject(0);
            patientId = object.getString("SICKID");
        }
        return patientId;
    }
    /*
     * @param registerSn 流水号
     * @param patient 居民code
     * @param admNo 住院唯一号
     * @param realOrder 处方号
     * @return
     */
    public List<WlyyPrescriptionVO> findPrescriptionList(String outPatientId,String realOrder) throws Exception {
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outPatientId);
        if (outpatientDO==null){
            throw new Exception("该门诊记录不存在!");
        }
        String registerSn = outpatientDO.getRegisterNo();
        if (!StringUtils.isNoneBlank(registerSn)){
            throw new Exception("挂号流水号不存在");
        }
        String admNo = outpatientDO.getAdmNo();
        PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatientDO.getPatient());
        if (patientMappingDO==null||!StringUtils.isNoneBlank(patientMappingDO.getMappingCode())){
            throw new Exception("该居民映射表不存在!");
        }
        List<WlyyPrescriptionVO> wlyyPrescriptionVOList = selectOriginPrescriptionList(registerSn,patientMappingDO.getMappingCode(),admNo,realOrder);
        return wlyyPrescriptionVOList;
    }
/*    public Map<String,Object> updatePreStatus(String admNo,String realOrder,String status) throws Exception {
        Map<String,Object> map = new HashedMap();
        List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findByAdmNo(admNo);
        if (wlyyOutpatientDOList!=null&&wlyyOutpatientDOList.size()!=0){
            throw new Exception("该就诊号查不到!");
        }
        for (WlyyOutpatientDO wlyyOutpatientDO:wlyyOutpatientDOList){
            String registerNo = wlyyOutpatientDO.getRegisterNo();
            if (!StringUtils.isNoneBlank(registerNo)){
                throw new Exception("挂号流水号为空!");
            }
            PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(wlyyOutpatientDO.getPatient());
            List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByOutpatientId(wlyyOutpatientDO.getId());
            if (prescriptionDOList==null||prescriptionDOList.size()==0){
                List<WlyyPrescriptionVO> prescriptionVOList = selectOriginPrescriptionList(registerNo,patientMappingDO.getMappingCode(),admNo,realOrder);
                for (WlyyPrescriptionVO prescriptionVO:prescriptionVOList){
                    WlyyPrescriptionDO prescriptionDO = new WlyyPrescriptionDO();
                    BeanUtils.copyProperties(prescriptionVO, prescriptionDO);
                    prescriptionDO.setOutpatientId(wlyyOutpatientDO.getId());
                    if (status.equalsIgnoreCase("3")){
                        prescriptionDO.setStatus(30);
                    }
                    prescriptionDO= prescriptionDao.save(prescriptionDO);
                    //处方诊断表vo
                    List<WlyyPrescriptionDiagnosisVO> diagnosisVOS = prescriptionVO.getDiagnosisVOs();
                    for (WlyyPrescriptionDiagnosisVO diagnosisVO:diagnosisVOS){
                        WlyyPrescriptionDiagnosisDO prescriptionDiagnosisDO = new WlyyPrescriptionDiagnosisDO();
                        BeanUtils.copyProperties(diagnosisVO,prescriptionDiagnosisDO);
                        prescriptionDiagnosisDO.setPrescriptionId(prescriptionDO.getId());
                        diagnosisDao.save(prescriptionDiagnosisDO);
                    }
                    //药品表
                    List<WlyyPrescriptionInfoVO> infoVOList = prescriptionVO.getInfoVOs();
                    for (WlyyPrescriptionInfoVO infoVO:infoVOList){
                        WlyyPrescriptionInfoDO infoDO = new WlyyPrescriptionInfoDO();
                        BeanUtils.copyProperties(infoVO,infoDO);
                        infoDO.setPrescriptionId(prescriptionDO.getId());
                        prescriptionInfoDao.save(infoDO);
                    }
                    List<WlyyInspectionVO> inspectionVOList = prescriptionVO.getInspectionVOs();
                    for (WlyyInspectionVO inspectionVO:inspectionVOList){
                        WlyyInspectionDO inspectionDO = new WlyyInspectionDO();
                        BeanUtils.copyProperties(inspectionVO,inspectionDO);
                        inspectionDO.setPrescriptionId(prescriptionDO.getId());
                        wlyyInspectionDao.save(inspectionDO);
                    }
                }
            }
        }
        return map;
    }*/
//============================hospital业务层==================start====================
}

+ 13 - 11
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -201,7 +201,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
        jb.put("second_organ_name", StringUtils.isNoneBlank(superviseDataDict.getSecondOrganName())?superviseDataDict.getSecondOrganName():"");
        jb.put("charge_person",StringUtils.isNoneBlank(superviseDataDict.getChargePerson())?superviseDataDict.getChargePerson():"");
        jb.put("level", superviseDataDict.getLevel());
        jb.put("level", superviseDataDict.getLevelCode());
        jb.put("economic_type", superviseDataDict.getEconomicType());
        jb.put("organ_type",superviseDataDict.getOrganType());
        jb.put("organ_sub", orgSub);
@ -357,14 +357,14 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("id_card", info.get("idcard")== null ? "0":info.get("idcard"));
                jb.put("sex", info.get("sex")== null ? "0":info.get("sex"));
                jb.put("birthday", info.get("birthday")  == null?"1900-01-01": DateUtil.dateToStrLong((Date)info.get("birthday")));
                jb.put("subject", dept[0]);
                jb.put("subject_name", dept[1]);
                jb.put("subject", dept.length>=1?dept[0]:"");
                jb.put("subject_name",dept.length>=2?dept[1]:"");
                jb.put("belong_dept",jb.getString("dept_code"));
                jb.put("belong_dept_name", jb.getString("dept_name"));
                jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
                jb.put("title_rec_date", getDateString(info.get("fzrq").toString()));
                jb.put("prac_type", "1");   // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
                jb.put("title_code", dutyInfo[0]);  // 需要与监管平台的字典进行映射
                jb.put("title_code", dutyInfo.length>=1?dutyInfo[0]:"");  // 需要与监管平台的字典进行映射
                jb.put("first_compeny_code", orgCode);
                jb.put("first_compeny_name", orgName);
                jb.put("secd_compeny_code", "");
@ -487,8 +487,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("fg_visit",  fgConvent(info.get("status") == null?"-1":info.get("status").toString()));
                jb.put("reg_dep_code",  info.get("dept") == null?"0":info.get("dept"));
                jb.put("reg_dep_name",  info.get("dept_name") == null?"0":info.get("dept_name"));
                jb.put("reg_subject_code",  dept[0]);
                jb.put("reg_subject_name", dept[1]);
                jb.put("reg_subject_code",  dept.length>=1?dept[0]:"");
                jb.put("reg_subject_name", dept.length>=2?dept[1]:"");
                jb.put("reg_price",  "0");
                jb.put("pt_name", info.get("name") == null?"0":info.get("name"));
                jb.put("ge_code",   IdCardUtil.getSexForIdcard_new(info.get("idcard").toString()));
@ -579,7 +579,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                    jb.put("cd_area", orgArea);
                    jb.put("cd_orgSub", orgSub);
                    jb.put("app_time",DateUtil.dateToStr((Date)ins.get("register_date"),"yyyy-MM-dd HH:mm:ss"));
                    jb.put("app_dep_code", dept[0]);
                    jb.put("app_dep_code", dept.length>=1?dept[0]:"");
                    jb.put("app_class_code", ins.get("code"));
                    jb.put("id_doctor", docInterId);
                    jb.put("fg_handle", "1");
@ -1002,8 +1002,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("visit_doc_name",  info.get("doctor_name"));
                jb.put("visit_doc_id_no", info.get("docIdCard"));
                jb.put("visit_doc_code", visitDocCode);
                jb.put("visit_subject_code", dept[0]);
                jb.put("visit_ subject _name",dept[1]);
                jb.put("visit_subject_code", dept.length>=1?dept[0]:"");
                jb.put("visit_ subject _name",dept.length>=2?dept[1]:"");
                jb.put("visit_dept_code", info.get("dept"));
                jb.put("visit_dept_name", info.get("dept_name"));
                jb.put("pt_no", info.get("paName"));
@ -1161,8 +1161,8 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
                jb.put("ins_class_name", "");
                jb.put("org_code", orgCode);
                jb.put("org_name",orgName);
                jb.put("pres_subject_code", dept[0]);
                jb.put("pres_subject_name", dept[1]);
                jb.put("pres_subject_code", dept.length>=1?dept[0]:"");
                jb.put("pres_subject_name", dept.length>=2?dept[1]:"");
                jb.put("pres_dept_code", info.get("dept")== null?"0":info.get("dept"));
                jb.put("pres_dept_name",info.get("dept_name")== null?"0":info.get("dept_name"));
                jb.put("pres_time", info.get("create_time")== null?"1900-01-01 00:00:00":DateUtil.dateToStrLong((Date)info.get("create_time")));
@ -1685,6 +1685,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            res[0]="";
            res[1]="";
        }
        logger.info("科室转换:"+res.toString());
        return res;
    }
@ -1748,6 +1749,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
            res[0]="";
            res[1]="";
        }
        logger.info("职称转换:"+res.toString());
        return  res;
    }

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

@ -154,4 +154,10 @@ public class HibenateUtils {
        }
    }
    public void save(Object object) {
        Session session = (Session) entityManager.getDelegate();
        session.saveOrUpdate(object);
    }
}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -237,6 +237,16 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    private String userId;
    private String register;
    @Column(name = "register")
    public String getRegister() {
        return register;
    }
    public void setRegister(String register) {
        this.register = register;
    }
    @Column(name = "saas_id")
    public String getSaasId() {

+ 6 - 6
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/BaseSuperviseDataDict.java

@ -18,7 +18,7 @@ public class BaseSuperviseDataDict extends IntegerIdentityEntity {
    private String noPraLic;//执业许可登记号
    private String secondOrganName;//机构第二名称
    private String chargePerson;//主要负责人
    private String level;//机构等位分级
    private String levelCode;//机构等位分级
    private String economicType;//经济类型
    private String organType;//组织类别
    private String hospitalAddress;//医院具体地址
@ -81,13 +81,13 @@ public class BaseSuperviseDataDict extends IntegerIdentityEntity {
    public void setChargePerson(String chargePerson) {
        this.chargePerson = chargePerson;
    }
    @Column(name = "level")
    public String getLevel() {
        return level;
    @Column(name = "level_code")
    public String getLevelCode() {
        return levelCode;
    }
    public void setLevel(String level) {
        this.level = level;
    public void setLevelCode(String levelCode) {
        this.levelCode = levelCode;
    }
    @Column(name = "economic_type")
    public String getEconomicType() {

+ 88 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java

@ -0,0 +1,88 @@
package com.yihu.jw.entity.order;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
/**
 * 业务订单表
 */
@Entity
@Table(name = "base_business_order_pay")
public class BusinessOrderDO extends IntegerIdentityEntityWithOperator {
    private String orderNo;//订单号
    private Integer orderType;//订单类型
    private String relationCode;//业务关联code
    private String relationName;//业务关联名称
    private Integer payType;//支付类型1微信2支付宝
    private Double payPrice;//支付金额
    private Integer status;//0待支付1支付成功2支付失败3取消
    @Column(name = "order_no")
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    @Column(name = "order_type")
    public Integer getOrderType() {
        return orderType;
    }
    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }
    @Column(name = "relation_code")
    public String getRelationCode() {
        return relationCode;
    }
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }
    @Column(name = "relation_name")
    public String getRelationName() {
        return relationName;
    }
    public void setRelationName(String relationName) {
        this.relationName = relationName;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Column(name = "pay_type")
    public Integer getPayType() {
        return payType;
    }
    public void setPayType(Integer payType) {
        this.payType = payType;
    }
    @Column(name = "pay_price")
    public Double getPayPrice() {
        return payPrice;
    }
    public void setPayPrice(Double payPrice) {
        this.payPrice = payPrice;
    }
}

+ 21 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/ylzinfo/OauthYlzConfigDO.java

@ -2,6 +2,7 @@ package com.yihu.jw.entity.ylzinfo;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@ -19,6 +20,10 @@ public class OauthYlzConfigDO extends UuidIdentityEntity {
    private String signType;
    private String encType;
    private String url;
    @Column(name = "private_key")
    private String privateKey;
    @Column(name = "ehc_public_key")
    private String ehcPublicKey;
    public String getAppId() {
        return appId;
@ -75,4 +80,20 @@ public class OauthYlzConfigDO extends UuidIdentityEntity {
    public void setUrl(String url) {
        this.url = url;
    }
    public String getPrivateKey() {
        return privateKey;
    }
    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }
    public String getEhcPublicKey() {
        return ehcPublicKey;
    }
    public void setEhcPublicKey(String ehcPublicKey) {
        this.ehcPublicKey = ehcPublicKey;
    }
}

+ 8 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -715,4 +715,12 @@ public class BaseRequestMapping {
        public static final String getLog  = "/getLog";
    }
    /**ThirdInterface
     * 多码融合
     */
    public static class ThirdInterface extends Basic{
        public static final String PREFIX  = "/thirdInterface";
        public static final String selectHealthIdCard  = "/selectHealthIdCard";
    }
}

+ 8 - 6
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java

@ -140,16 +140,18 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
     * @param realOrder 处方号(必填)
     * @param status 处方状态:3结算完成(必填)
     * @return
     * @throws Exception
             * @throws Exception
     */
    @GetMapping(value = "/updatePreStatus")
    @ApiOperation(value = "获取单条门诊就诊记录", notes = "获取单条门诊就诊记录")
    public ObjEnvelop updatePreStatus(@ApiParam(name = "admNo", value = "就诊唯一号", required = false)
                                 @RequestParam(value = "admNo",required = false)String admNo,
                                 @ApiParam(name = "realOrder", value = "处方号", required = false)
                                 @RequestParam(value = "realOrder",required = false)String realOrder,
                                 @ApiParam(name = "status", value = "处方状态:3结算完成", required = false)
                                 @RequestParam(value = "status",required = false)String status)throws Exception{
                                      @RequestParam(value = "admNo",required = false)String admNo,
                                      @ApiParam(name = "realOrder", value = "处方号", required = false)
                                      @RequestParam(value = "realOrder",required = false)String realOrder,
                                      @ApiParam(name = "status", value = "处方状态:3结算完成", required = false)
                                      @RequestParam(value = "status",required = false)String status)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.updatePreStatus(admNo,realOrder,status));
    }
}

+ 13 - 3
svr/svr-internet-hospital/pom.xml

@ -69,10 +69,15 @@
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>com.ylz.loginsdk</groupId>-->
            <!--<artifactId>ehcsdk</artifactId>-->
            <!--<version>1.0</version>-->
        <!--</dependency>-->
        <dependency>
            <groupId>com.ylz.loginsdk</groupId>
            <artifactId>ehcsdk</artifactId>
            <version>1.0</version>
            <groupId>com.ylz.dmrh</groupId>
            <artifactId>ehcsdk-java-sdk-base</artifactId>
            <version>1.0.3</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
@ -82,6 +87,11 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>wxpay-sdk</artifactId>
            <version>3.0.9</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>

+ 14 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/dao/order/businessOrderDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.hospital.dao.order;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface businessOrderDao extends PagingAndSortingRepository<BusinessOrderDO, Integer>, JpaSpecificationExecutor<BusinessOrderDO>  {
}

+ 125 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/MultipleCode/MultipleCoderController.java

@ -0,0 +1,125 @@
package com.yihu.jw.hospital.endpoint.MultipleCode;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.service.MultipleCode.MultipleCodeService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.ylzinfo.ehc.trans.TransResponse;
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.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.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/4/9
 */
@RestController
@RequestMapping("mcf" )
@Api(tags ="多码融合", description = "互联网医院")
public class MultipleCoderController extends EnvelopRestEndpoint {
    @Autowired
    private MultipleCodeService multipleCodeService;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private WlyyHttpLogDao wlyyHttpLogDao;
    /**
     *  多码融合-获取健康卡
     * @param patientId 居民id
     * @param wechatId 微信id
     * @return
     */
    @GetMapping(value = BaseRequestMapping.ThirdInterface.selectHealthIdCard)
    @ApiOperation(value = "多码融合-获取健康卡")
    public MixEnvelop getE_healthCard(@ApiParam(name = "patientId", value = "居民id")
                               @RequestParam(value = "patientId",required = true) String patientId,
                                      @ApiParam(name = "wechatId", value = "微信id")
                               @RequestParam(value = "wechatId",required = true) String wechatId){
        try {
            WlyyHttpLogDO logDO = new WlyyHttpLogDO();
            MixEnvelop envelop = new MixEnvelop();
            BasePatientDO patientDO = basePatientDao.findById(patientId);
            if (patientDO!=null&&patientDO.getRegister().equalsIgnoreCase("0")){
                logDO.setCode("ehc.ehealthcard.register");
                logDO.setName("注册多码融合信息");
                logDO.setPatient(patientId);
                logDO.setRequest("patientId="+patientId+"&wechatId="+wechatId);
                wlyyHttpLogDao.save(logDO);
                envelop = multipleCodeService.mcfRegister(patientDO,wechatId);
                Object obj = envelop.getObj();
                String response = JSONObject.toJSONString(obj);
                logDO.setResponse(response);
                logDO.setStatus("0");
                logDO.setCreateTime(DateUtil.getNowDate());
                wlyyHttpLogDao.save(logDO);
            }else {
                WlyyHttpLogDO queryInfoLogDO = new WlyyHttpLogDO();
                queryInfoLogDO.setCode("ehc.ehealthcard.queryInfo");
                queryInfoLogDO.setName("根据身份证查询多码融合信息");
                queryInfoLogDO.setPatient(patientId);
                queryInfoLogDO.setRequest("idType="+"01"+"&Idcard="+patientDO.getIdcard());//01代表证件类型为身份证
                wlyyHttpLogDao.save(queryInfoLogDO);
                TransResponse re = multipleCodeService.mcfQueryInfo("01", patientDO.getIdcard());
                String code = re.getRet_code();
                if (code.equals("0000")){
                    String ehealthCardId = JSONObject.parseObject(re.getBiz_content()).getString("ehealth_card_id").toString();
                    queryInfoLogDO.setResponse("ehealthCardId="+ehealthCardId);
                    queryInfoLogDO.setStatus("0");
                    queryInfoLogDO.setCreateTime(DateUtil.getNowDate());
                    wlyyHttpLogDao.save(queryInfoLogDO);
                    logDO.setCode("ehc.ehealthcard.getCodeUrl");
                    logDO.setName("获取多码融合展示码URL");
                    logDO.setPatient(patientId);
                    logDO.setRequest("ehealthCardId="+ehealthCardId);
                    wlyyHttpLogDao.save(logDO);
                    envelop = multipleCodeService.mcfGetCodeUrl(ehealthCardId);
                    Object obj = envelop.getObj();
                    String response = JSONObject.toJSONString(obj);
                    logDO.setResponse(response);
                    logDO.setStatus("0");
                    logDO.setCreateTime(DateUtil.getNowDate());
                    wlyyHttpLogDao.save(logDO);
                } else {
                    return MixEnvelop.getError(JSONObject.parseObject(re.getRet_msg()).toString());
                }
            }
            return envelop;
        } catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

+ 65 - 11
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/Xzyy/XzyyController.java

@ -2,16 +2,15 @@ package com.yihu.jw.hospital.endpoint.Xzyy;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import oracle.jdbc.proxy.annotation.Post;
import org.springframework.beans.factory.annotation.Autowired;
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 org.springframework.web.bind.annotation.*;
/**
 * Created by Trick on 2020/1/19.
@ -32,13 +31,9 @@ public class XzyyController extends EnvelopRestEndpoint {
     */
    @GetMapping(value = "/findPatientCard")
    @ApiOperation(value = "查询患者就诊卡", notes = "查询患者就诊卡")
    public ObjEnvelop findPatientCard(@ApiParam(name = "idCard", value = "身份证号", required = false)
    public ListEnvelop findPatientCard(@ApiParam(name = "idCard", value = "身份证号", required = false)
                                      @RequestParam(value = "idCard",required = false)String idCard)throws Exception{
        try {
            return ObjEnvelop.getSuccess("ok",xzzxEntranceService.selectPateintCard(idCard));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
        return success(xzzxEntranceService.selectPateintCard(idCard));
    }
@ -52,12 +47,71 @@ public class XzyyController extends EnvelopRestEndpoint {
    public ObjEnvelop getCardInfo(@ApiParam(name = "cardNo", value = "就诊卡", required = false)
                                  @RequestParam(value = "cardNo",required = false)String cardNo)throws Exception{
        try {
            return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getCardInfo(cardNo));
            return ObjEnvelop.getSuccess("ok",xzzxEntranceService.selectCardInfo(cardNo));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 挂号
     * @return
     * @throws Exception
     */
    @PostMapping(value = "/registerOutPatient")
    @ApiOperation(value = "挂号", notes = "挂号")
    public ObjEnvelop registerOutPatient(@ApiParam(name = "outPatientId", value = "门诊id", required = true)
                                  @RequestParam(value = "outPatientId",required = true)String outPatientId,
                                  @ApiParam(name = "doctor", value = "医生code", required = true)
                                  @RequestParam(value = "doctor",required = true)String doctor,
                                  @ApiParam(name = "chargeType", value = "号别", required = true)
                                   @RequestParam(value = "chargeType",required = true)String chargeType)throws Exception{
        try {
            return ObjEnvelop.getSuccess("ok",xzzxEntranceService.registerOutPatient(outPatientId,doctor,chargeType));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 获取单条门诊就诊记录
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/findOutpatientInfo")
    @ApiOperation(value = "获取门诊就诊记录", notes = "获取门诊就诊记录")
    public ObjEnvelop findOutpatientInfo(@ApiParam(name = "patient", value = "居民code", required = true)
                                         @RequestParam(value = "patient",required = true)String patient,
                                         @ApiParam(name = "conNo", value = "就诊次数", required = false)
                                         @RequestParam(value = "conNo",required = false)String conNo)throws Exception{
        try {
            return ObjEnvelop.getSuccess("ok",xzzxEntranceService.findOutpatientInfo(patient,conNo));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    /**
     * 获取门诊下所有处方信息
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/findPrescriptionList")
    @ApiOperation(value = "获取门诊下所有处方信息", notes = "获取门诊下所有处方信息")
    public ObjEnvelop findPrescriptionList(@ApiParam(name = "outPatientId", value = "门诊id", required = true)
                                           @RequestParam(value = "outPatientId",required = true)String outPatientId,
                                           @ApiParam(name = "realOrder", value = "处方code", required = false)
                                           @RequestParam(value = "realOrder",required = false)String realOrder)throws Exception{
        try {
            return ObjEnvelop.getSuccess("ok",xzzxEntranceService.findPrescriptionList(outPatientId,realOrder));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 185 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/MultipleCode/MultipleCodeService.java

@ -0,0 +1,185 @@
package com.yihu.jw.hospital.service.MultipleCode;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
import com.ylzinfo.ehc.trans.TransRequest;
import com.ylzinfo.ehc.trans.TransResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.UUID;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/4/17
 */
@Service
public class MultipleCodeService {
    @Autowired
    private OauthYlzConfigDao oauthYlzConfigDao;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    public MixEnvelop mcfRegister(BasePatientDO patientDO, String wechatId) throws Exception {
        BasePatientWechatDo patientWechatDo = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, patientDO.getId()).get(0);
        OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("mcf_config");
        TransResponse re= new TransResponse();
        WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
        try {
            TransRequest request = new TransRequest();
            request.setMethod("ehc.ehealthcard.register");
            request.setApp_id(oauthYlzConfigDO.getAppId());
            request.setTerm_id(oauthYlzConfigDO.getTermId());
            request.setVersion("X.M.0.1");
            request.setTimestamp(DateUtils.getOutTradeTime());
            request.setSign_type("RSA");
            request.setEnc_type("Plain");
            JSONObject bizContent = new JSONObject();
            bizContent.put("out_register_time", DateUtils.getOutTradeTime());
            bizContent.put("out_register_no", DateUtils.getOutTradeTime());
            bizContent.put("open_id", patientWechatDo.getOpenid());
            bizContent.put("account_id", "gh_a09552a72c9b");
            bizContent.put("certificate_mode", "01");
            bizContent.put("id_type", "01");
            bizContent.put("id_no", patientDO.getIdcard());
            bizContent.put("user_name", patientDO.getName());
            bizContent.put("birthday", patientDO.getBirthday());
            bizContent.put("address", patientDO.getAddress());
            bizContent.put("mobile_phone", patientDO.getMobile());
            bizContent.put("apply_method", "1");
            bizContent.put("user_sex", "1");
            bizContent.put("nation", "01");
            request.setBiz_content(JSONObject.toJSONString(bizContent));
            EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl()+"ehcweb/gateway.do", oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getPrivateKey(), oauthYlzConfigDO.getEhcPublicKey());
            re = ehcHandler.execute(request);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("code_url",JSONObject.parseObject(re.getBiz_content()).getString("code_url"));
            String result = jsonObject.toJSONString().replaceAll("\\|888", "");
            if(result!=null){
                patientDO.setRegister("1");
                basePatientDao.save(patientDO);
                return MixEnvelop.getSuccess("注册成功",result);
            }
            return MixEnvelop.getError(JSONObject.parseObject(re.getRet_msg()).toString());
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(JSONObject.parseObject(re.getRet_msg()).toString());
        }
    }
//     根据openId、 accountId查询三码融合码信息
    public MixEnvelop mcfOpenquery(String openId,String accountId) throws Exception {
            OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findOne("mcf_config");
            TransRequest request = new TransRequest();
            request.setMethod("ehc.ehealthcard.openquery");
            request.setApp_id(oauthYlzConfigDO.getAppId());
            request.setTerm_id(oauthYlzConfigDO.getTermId());
            request.setVersion("X.M.0.1");
            request.setTimestamp(DateUtils.getOutTradeTime());
            request.setSign_type("MD5");
            request.setEnc_type("Plain");
            JSONObject bizContent = new JSONObject();
            bizContent.put("open_id", openId);
            bizContent.put("account_id", accountId);
            request.setBiz_content(JSONObject.toJSONString(bizContent));
            EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl()+"ehcService/gateway.do", oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getAppKey());
            TransResponse re = ehcHandler.execute(request);
            if ("0000".equals(JSONObject.parseObject(re.getRet_code()))){
                String ehealth_card_id = JSONObject.parseObject(re.getBiz_content()).getString("ehealth_card_id").toString();
                if (ehealth_card_id!=null){
                    return MixEnvelop.getSuccess("查询用户信息成功",ehealth_card_id);
                }
            }
        return MixEnvelop.getError(JSONObject.parseObject(re.getRet_msg()).toString());
    }
//     获取展码地址
    public MixEnvelop mcfGetCodeUrl(String ehealth_card_id) throws Exception {
        OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("mcf_config");
        TransRequest request = new TransRequest();
        request.setMethod("ehc.ehealthcard.getCodeUrl");
        request.setApp_id(oauthYlzConfigDO.getAppId());
        request.setTerm_id(oauthYlzConfigDO.getTermId());
        request.setVersion("X.M.0.1");
        request.setTimestamp(DateUtils.getOutTradeTime());
        request.setSign_type("RSA");
        request.setEnc_type("Plain");
        JSONObject bizContent = new JSONObject();
        String no = UUID.randomUUID().toString();
        bizContent.put("ehealth_card_id",ehealth_card_id);
        bizContent.put("out_trade_no",no);
        bizContent.put("out_trade_time",DateUtils.getOutTradeTime());
        request.setBiz_content(JSONObject.toJSONString(bizContent));
        EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl()+"ehcweb/gateway.do", oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getPrivateKey(), oauthYlzConfigDO.getEhcPublicKey());
        TransResponse re = ehcHandler.execute(request);
        if ("0000".equalsIgnoreCase(re.getRet_code())){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("code_url",JSONObject.parseObject(re.getBiz_content()).getString("code_url"));
            String code_url = jsonObject.toJSONString().replaceAll("\\|888", "");
            if (code_url!=null){
                return MixEnvelop.getSuccess("获取展码成功",code_url);
            }
        }
        return MixEnvelop.getError("获取展码失败");
    }
    //通过身边证查询用户信息
    public  TransResponse  mcfQueryInfo(String idType,String ID) throws Exception {
        OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("mcf_config");
        TransRequest request = new TransRequest();
        request.setMethod("ehc.ehealthcard.queryInfo");
        request.setApp_id(oauthYlzConfigDO.getAppId());
        request.setTerm_id(oauthYlzConfigDO.getTermId());
        request.setVersion("X.M.0.1");
        request.setTimestamp(DateUtils.getOutTradeTime());
        request.setSign_type("MD5");
        request.setEnc_type("Plain");
        JSONObject bizContent = new JSONObject();
        String no = UUID.randomUUID().toString();
        bizContent.put("id_type", idType);
        bizContent.put("id_no", ID);
        request.setBiz_content(JSONObject.toJSONString(bizContent));
        EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl()+"ehcService/gateway.do", oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getAppKey());
        TransResponse re = ehcHandler.execute(request);
        return re;
    }
    public MixEnvelop mcfQueryInfo(String ehealth_card_id ) throws Exception {
        OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findById("mcf_config");
        TransRequest request = new TransRequest();
        request.setMethod("ehc.ehealthcard.queryInfo");
        request.setApp_id(oauthYlzConfigDO.getAppId());
        request.setTerm_id(oauthYlzConfigDO.getTermId());
        request.setVersion("X.M.0.1");
        request.setTimestamp(DateUtils.getOutTradeTime());
        request.setSign_type("MD5");
        request.setEnc_type("Plain");
        JSONObject bizContent = new JSONObject();
        String no = UUID.randomUUID().toString();
        bizContent.put("ehealth_card_id",ehealth_card_id);
        request.setBiz_content(JSONObject.toJSONString(bizContent));
        EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl()+"ehcService/gateway.do", oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getAppKey());
        TransResponse re = ehcHandler.execute(request);
        if ("0000".equals(JSONObject.parseObject(re.getRet_code()))){
            return MixEnvelop.getSuccess("获取用户信息成功",re);
        }
        return MixEnvelop.getError("获取用户信息失败");
    }
}

+ 14 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/order/BusinessOrderService.java

@ -0,0 +1,14 @@
package com.yihu.jw.hospital.service.order;
import org.springframework.stereotype.Service;
/**
 *
 * 业务订单
 */
@Service
public class BusinessOrderService {
}

File diff suppressed because it is too large
+ 1 - 1
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistScreenResultService.java