Forráskód Böngészése

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

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/PatientRehabilitationPlanDO.java
wangzhinan 5 éve
szülő
commit
b60a204ecd

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

@ -0,0 +1,25 @@
package com.yihu.jw.dict.dao;
import com.yihu.jw.entity.hospital.dict.BaseDeptDict;
import com.yihu.jw.entity.hospital.dict.BaseSuperviseDict;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 监管平台字典 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年10月19日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDeptDictDao extends PagingAndSortingRepository<BaseDeptDict, Integer>, JpaSpecificationExecutor<BaseDeptDict>  {
    @Query("select s from BaseDeptDict s where s.deptCode=1")
    BaseDeptDict selectByDeptCode(String deptCode);
}

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

@ -9,7 +9,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 医生职务字典 数据库访问层
 * 监管平台字典
 * 
 * @version 
 * <pre>

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

@ -9,7 +9,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 
 * 医生职务字典 数据库访问层
 * 监管平台字典 数据库访问层
 * 
 * @version 
 * <pre>

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

@ -25,6 +25,7 @@ import com.yihu.jw.hospital.prescription.service.entrance.util.AES;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
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;
@ -74,15 +75,34 @@ public class XzzxEntranceService {
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    private static String key="bvvsf3JA0mUXMU+mVnMaOQ==";
    //发送微信模板消息
    public static String sendMessageUrl ="http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage";
    public String getXzzxWebServiceInfo(String api, Map<String,String> params)throws Exception{
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
    public String getSelectUrl(){
        List<WlyyHospitalSysDictDO> list =  wlyyHospitalSysDictDao.findByDictName("xzzxWebService");
        List<WlyyHospitalSysDictDO> list =  wlyyHospitalSysDictDao.findByDictName("xzzxWebSelectService");
        String url = list.get(0).getDictCode();
        return url;
    }
    public String getOperateUrl(){
        List<WlyyHospitalSysDictDO> list =  wlyyHospitalSysDictDao.findByDictName("xzzxWebOperateService");
        String url = list.get(0).getDictCode();
        return url;
    }
    public String getXzzxWebServiceInfo(String api, Map<String,String> params,String url)throws Exception{
        logger.info("url"+url);
@ -101,7 +121,6 @@ public class XzzxEntranceService {
     */
    public String getDeptInfo(String code)throws Exception{
        String api = "GetDeptInfo";
        String key ="bvvsf3JA0mUXMU+mVnMaOQ==";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
@ -121,7 +140,7 @@ public class XzzxEntranceService {
        params.put("msgBody",msgBody);
        logger.info("getDeptInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params);
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
@ -173,7 +192,6 @@ public class XzzxEntranceService {
     */
    public String getDoctorInfo(String idcard)throws Exception{
        String api = "GetDoctorInfo";
        String key ="bvvsf3JA0mUXMU+mVnMaOQ==";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
@ -193,7 +211,7 @@ public class XzzxEntranceService {
        params.put("msgBody",msgBody);
        logger.info("getDoctorInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params);
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
@ -369,7 +387,6 @@ public class XzzxEntranceService {
     */
    public String getJobTitle()throws Exception{
        String api = "GetTitleInfo";
        String key ="bvvsf3JA0mUXMU+mVnMaOQ==";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
@ -385,7 +402,7 @@ public class XzzxEntranceService {
        params.put("msgBody",msgBody);
        logger.info("getJobTitleInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params);
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
@ -420,7 +437,6 @@ public class XzzxEntranceService {
     */
    public String getChargeDict()throws Exception{
        String api = "GetScheduleType";
        String key ="bvvsf3JA0mUXMU+mVnMaOQ==";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
@ -436,7 +452,7 @@ public class XzzxEntranceService {
        params.put("msgBody",msgBody);
        logger.info("getChargeDictInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("CallInterface",params);
        String xml = getXzzxWebServiceInfo("CallInterface",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
@ -472,6 +488,257 @@ public class XzzxEntranceService {
        }
        return json;
    }
    /**
     * 查询患者就诊卡
     * @param idCard 身份证
     * @return
     * @throws Exception
     */
    //查询患者就诊卡
    public String findPatientCard(String idCard)throws Exception{
        String api = "FindPatientCard";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(idCard)){
            condition = "<Idcard>"+idCard+"</Idcard>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("findPatientCard params:"+params.toString());
        String xml = getXzzxWebServiceInfo("FindPatientCard",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("findPatientCard json:"+json);
        return json;
    }
    /**
     *
     *  获取卡信息
     *
     * @param cardNo 卡号(必填)
     * @return
     * @throws Exception
     */
    //获取卡信息
    public String getCardInfo(String cardNo)throws Exception{
        String api = "GetCardInfo";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(cardNo)){
            condition = "<cardNo>"+cardNo+"</cardNo>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("getCardInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("GetCardInfo",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("getCardInfo json:"+json);
        return json;
    }
    /**
     * 获取单条门诊就诊记录
     * @param patient 居民id
     * @param conNo 就诊次数
     * @return
     * @throws Exception
     */
    //获取单条门诊就诊记录
    public String findOutpatientInfo(String patient,String conNo)throws Exception{
        String api = "FindOutpatientInfo";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(patient)){
            condition += "<patient>"+patient+"</patient>";
        }
        if (StringUtils.isNoneBlank(conNo)){
            condition += "<conNo>"+conNo+"</conNo>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("FindOutpatientInfo params:"+params.toString());
        String xml = getXzzxWebServiceInfo("FindOutpatientInfo",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("getCardInfo json:"+json);
        return json;
    }
    /**
     * 获取门诊下所有处方信息
     * @param registerSn 流水号(必传)
     * @param patNo 病人id(必传)
     * @param admNo 住院唯一号(必传)
     * @param realOrder 处方号(非必传,传相当于查单条处方)
     * @return
     * @throws Exception
     */
    //获取门诊下所有处方信息
    public String getOriginPrescriptionList(String registerSn,String patNo,String admNo,String realOrder)throws Exception{
        String api = "GetOriginPrescriptionList";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(registerSn)){
            condition += "<registerSn>"+registerSn+"</registerSn>";
        }
        if (StringUtils.isNoneBlank(patNo)){
            condition += "<patNo>"+patNo+"</patNo>";
        }
        if (StringUtils.isNoneBlank(admNo)){
            condition += "<admNo>"+admNo+"</admNo>";
        }
        if (StringUtils.isNoneBlank(realOrder)){
            condition += "<realOrder>"+realOrder+"</realOrder>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("getOriginPrescriptionList params:"+params.toString());
        String xml = getXzzxWebServiceInfo("GetOriginPrescriptionList",params,getSelectUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("getOriginPrescriptionList json:"+json);
        return json;
    }
    /**
     * 挂号(调his后台包)
     * @param doctor 医生ID(必填)
     * @param dept 科室编码(必填)
     * @param sickId 病人id
     * @param clinicclass 挂号类别(必填)
     * @return
     * @throws Exception
     */
    //挂号(调his后台包)
    public String registered(String doctor,String dept,String sickId,String clinicclass)throws Exception{
        String api = "Registered";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(doctor)){
            condition += "<doctor>"+doctor+"</doctor>";
        }
        if (StringUtils.isNoneBlank(dept)){
            condition +="<dept>"+dept+"</dept>";
        }
        if (StringUtils.isNoneBlank(sickId)){
            condition += "<sickId>"+sickId+"</sickId>";
        }
        if (StringUtils.isNoneBlank(clinicclass)){
            condition +="<clinicclass>"+clinicclass+"</clinicclass>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("registered params:"+params.toString());
        String xml = getXzzxWebServiceInfo("Registered",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("registered json:"+json);
        return json;
    }
    /**
     * 处方状态变更
     * @param admNo 就诊唯一号(必填)
     * @param realOrder 处方号(必填)
     * @param status 处方状态:3结算完成(必填)
     * @return
     * @throws Exception
     */
    //处方状态变更
    public String updatePreStatus(String admNo,String realOrder,String status)throws Exception{
        String api = "UpdatePreStatus";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String condition ="";
        if (StringUtils.isNoneBlank(admNo)){
            condition += "<admNo>"+admNo+"</admNo>";
        }
        if (StringUtils.isNoneBlank(realOrder)){
            condition +="<realOrder>"+realOrder+"</realOrder>";
        }
        if (StringUtils.isNoneBlank(status)){
            condition += "<status>"+status+"</status>";
        }
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root>"+condition+"</root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("updatePreStatus params:"+params.toString());
        String xml = getXzzxWebServiceInfo("UpdatePreStatus",params,getOperateUrl());
        XMLSerializer xmlSerializer = new XMLSerializer();
        String json = xmlSerializer.read(xml).toString();
        logger.info("updatePreStatus json:"+json);
        return json;
    }
//=====================微信模板消息推送===================================
    public String sendMes(String wxId,String patient,String cardNo,String first,String noticeContent,String remark,String redirectUrl){
@ -557,7 +824,7 @@ public class XzzxEntranceService {
    }
    /**
     * 获取中山医院token
     * 获取心脏医院token
     * @return
     * @throws Exception
     */
@ -584,4 +851,81 @@ public class XzzxEntranceService {
//=====================微信模板消息推送接口================================
//=====================hospital应用调用entrance应用============start=================
    /**
     * 查询患者就诊卡
     * @param idCard 身份证号
     * @return
     */
    public String selectPateintCard(String idCard){
        String response="";
        String url = entranceUrl+"findPatientCard?idCard="+idCard;
        response = httpClientUtil.get(url,"GBK");
        return response;
    }
    /**
     * 获取卡信息
     * @param cardNo 就诊卡
     * @return
     */
    public String selectCardInfo(String cardNo){
        String response="";
        String url = entranceUrl+"getCardInfo?cardNo="+cardNo;
        response = httpClientUtil.get(url,"GBK");
        return response;
    }
    /**
     * 获取单条门诊就诊记录
     * @param patient 居民id
     * @param conNo 就诊次数
     * @return
     */
    public String selectOutpatientInfo(String patient,String conNo){
        String response="";
        String url = entranceUrl+"findOutpatientInfo?patient="+patient+"&conNo="+conNo;
        response = httpClientUtil.get(url,"GBK");
        return response;
    }
    /**
     * 获取门诊下所有处方信息
     * @param registerSn 流水号
     * @param patNo 病人id
     * @param admNo 住院唯一号
     * @param realOrder 处方号
     * @return
     */
    public String selectOriginPrescriptionList(String registerSn,String patNo,String admNo,String realOrder){
        String response="";
        String url = entranceUrl+"getOriginPrescriptionList?registerSn="+registerSn+"&patNo="+patNo+"&admNo="+admNo+"&realOrder"+realOrder;
        response = httpClientUtil.get(url,"GBK");
        return response;
    }
    /**
     *
     * 挂号(调his后台包)
     * @param doctor 医生ID(必填)
     * @param dept 科室编码(必填)
     * @param sickId 病人id
     * @param clinicclass 挂号类别(必填)
     * @return
     */
    public String registeredOperate(String doctor,String dept,String sickId,String clinicclass){
        String response="";
        String url = entranceUrl+"registered?doctor="+doctor+"&dept="+dept+"&sickId="+sickId+"&clinicclass"+clinicclass;
        response = httpClientUtil.get(url,"GBK");
        return response;
    }
//=====================hospital应用调用entrance应用============end=================
}

+ 44 - 65
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -3,11 +3,15 @@ package com.yihu.jw.internet.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.BaseDeptDictDao;
import com.yihu.jw.dict.dao.BaseSuperviseDataDictDao;
import com.yihu.jw.dict.dao.BaseSuperviseDictDao;
import com.yihu.jw.dict.dao.DictDoctorDutyDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.dict.DictDoctorDutyDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.dict.BaseDeptDict;
import com.yihu.jw.entity.hospital.dict.BaseSuperviseDataDict;
import com.yihu.jw.entity.hospital.dict.BaseSuperviseDict;
import com.yihu.jw.entity.hospital.jgpt.HospitalImgDO;
@ -20,6 +24,7 @@ import com.yihu.jw.internet.entity.InternetUpLogDO;
import com.yihu.jw.internet.wsapi.Wsapi;
import com.yihu.jw.internet.wsapi.WsapiProxy;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.ImgUtils;
@ -74,6 +79,10 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
    private BaseSuperviseDictDao superviseDictDao;
    @Autowired
    private BaseSuperviseDataDictDao superviseDataDictDao;
    @Autowired
    private BaseDeptDictDao deptDictDao;
    @Autowired
    private DictDoctorDutyDao dictDoctorDutyDao;
    public String userName ;
    public String psw ;
@ -215,31 +224,15 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
        String corpIdcardHead ="";
        String corpIdcardTail="";
        String praLic="";
        HospitalImgDO hospitalImgDO=hospitalImgDao.selectById("hsimg");
        HospitalImgDO hospitalImgDO1=hospitalImgDao.selectById("zyxkz");
        HospitalImgDO hospitalImgDO2=hospitalImgDao.selectById("idcardA");
        HospitalImgDO hospitalImgDO3=hospitalImgDao.selectById("idcardB");
        if (hospitalImgDO!=null){
           hospitalImg=hospitalImgDO.getImg();
        }
        if (hospitalImgDO1!=null){
            busLic=hospitalImgDO1.getImg();
            praLic=hospitalImgDO1.getImg();
        }
        if (hospitalImgDO2!=null){
            corpIdcardHead=hospitalImgDO2.getImg();
        }
        if (hospitalImgDO3!=null){
            corpIdcardTail=hospitalImgDO3.getImg();
        }
        jb.put("hospital_img",hospitalImg );
        jb.put("bus_lic",busLic);
        jb.put("corp_idcord_head",corpIdcardHead);
        jb.put("corp_idcord_tail", corpIdcardTail);
        jb.put("pra_lic", praLic);
        //医院图片
        jb.put("hospital_img",ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"hsimg.jpg"));
        //营业执照
        jb.put("bus_lic",ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"zyxkz.jpg"));
        //身份证正面
        jb.put("corp_idcord_head",ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"idcardA.jpg"));
        jb.put("corp_idcord_tail", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"idcardB.jpg"));
        jb.put("pra_lic", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"zyxkz.jpg"));
        jb.put("secu_level",StringUtils.isNoneBlank(superviseDataDict.getSecuLevel())?superviseDataDict.getSecuLevel():"");
        jb.put("secu_level_cert",ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"dbtp.jpg"));
@ -364,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].toString());
                jb.put("subject_name", dept[1].toString());
                jb.put("subject", dept[0]);
                jb.put("subject_name", 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].toString());  // 需要与监管平台的字典进行映射
                jb.put("title_code", dutyInfo[0]);  // 需要与监管平台的字典进行映射
                jb.put("first_compeny_code", orgCode);
                jb.put("first_compeny_name", orgName);
                jb.put("secd_compeny_code", "");
@ -494,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].toString());
                jb.put("reg_subject_name", dept[1].toString());
                jb.put("reg_subject_code",  dept[0]);
                jb.put("reg_subject_name", 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()));
@ -586,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].toString());
                    jb.put("app_dep_code", dept[0]);
                    jb.put("app_class_code", ins.get("code"));
                    jb.put("id_doctor", docInterId);
                    jb.put("fg_handle", "1");
@ -1009,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].toString());
                jb.put("visit_ subject _name",dept[1].toString());
                jb.put("visit_subject_code", dept[0]);
                jb.put("visit_ subject _name",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"));
@ -1168,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].toString());
                jb.put("pres_subject_name", dept[1].toString());
                jb.put("pres_subject_code", dept[0]);
                jb.put("pres_subject_name", 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")));
@ -1682,22 +1675,17 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
    // 基于医生所在科室,转换成国家诊疗科目代码(中山医院专用)
    // 当科室信息在列表中不存在的情况,全部配置为预防保健科
    public static  String[]  depToSubject(String dep){
    public String[] depToSubject(String dep){
        String[] res = new String[2];
        res[0] = "10";
        res[1] = "眼科";
        if(StringUtils.isNotBlank(dep)){
            if("1010".equals(dep)){
                res[0] = "3";
                res[1] = "内科";
            }else if("1154".equals(dep)){
                res[0] = "3";
                res[1] = "内科";
            }
        BaseDeptDict baseDeptDict = deptDictDao.selectByDeptCode(dep);
        if (baseDeptDict!=null){
            res[0]=baseDeptDict.getSubject();
            res[1]=baseDeptDict.getSubjectName();
        }else {
            res[0]="";
            res[1]="";
        }
        return  res;
        return res;
    }
    //2.5 预约,是否到诊字典转换
@ -1750,24 +1738,15 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
    }
    // 基于中山医院的职务字典,强转为监管平台的字典(该部分过滤掉字典与监管理无法匹配的部分)
    public static  String[]  classToduty(String duty){
    public  String[]  classToduty(String duty){
        String[] res = new String[2];
        switch (duty) {
            case "1":
                res[0] = "231";
                res[1] = "主任医师";
                break;
            case "2":
                res[0] = "232";
                res[1] = "副主任医师";
                break;
            case "3":
                res[0] = "233";
                res[1] = "主治医师";
                break;
            default:
                res[0] = "234";
                res[1] = "医师";
        DictDoctorDutyDO doctorDutyDO = dictDoctorDutyDao.findByCode(duty);
        if (doctorDutyDO!=null){
            res[0]=doctorDutyDO.getTitleCode();
            res[1]=doctorDutyDO.getName();
        }else {
            res[0]="";
            res[1]="";
        }
        return  res;
    }

+ 13 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/dict/DictDoctorDutyDO.java

@ -32,6 +32,10 @@ public class DictDoctorDutyDO extends IntegerIdentityEntity {
    @Column(name = "name")
	private String name;
    @Column(name = "title_code")
    private String titleCode;
    /**
	 * 创建时间
	 */
@ -63,4 +67,13 @@ public class DictDoctorDutyDO extends IntegerIdentityEntity {
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "title_code")
    public String getTitleCode() {
        return titleCode;
    }
    public void setTitleCode(String titleCode) {
        this.titleCode = titleCode;
    }
}

+ 56 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/dict/BaseDeptDict.java

@ -0,0 +1,56 @@
package com.yihu.jw.entity.hospital.dict;
import com.yihu.jw.entity.IntegerIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by zdm on 2019/5/28.
 */
@Entity
@Table(name = "base_dept_dict")
public class BaseDeptDict extends IntegerIdentityEntity {
    private String subject;
    private String subjectName;
    private String deptCode;
    private String deptName;
    @Column(name = "subject")
    public String getSubject() {
        return subject;
    }
    public void setSubject(String subject) {
        this.subject = subject;
    }
    @Column(name = "subject_name")
    public String getSubjectName() {
        return subjectName;
    }
    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }
    @Column(name = "dept_code")
    public String getDeptCode() {
        return deptCode;
    }
    public void setDeptCode(String deptCode) {
        this.deptCode = deptCode;
    }
    @Column(name = "dept_name")
    public String getDeptName() {
        return deptName;
    }
    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }
}

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

@ -6,9 +6,11 @@ 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 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;
/**
@ -46,4 +48,108 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
    public ObjEnvelop getChargeDict()throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getChargeDict());
    }
    /**
     * 查询患者就诊卡
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/findPatientCard")
    @ApiOperation(value = "查询患者就诊卡", notes = "查询患者就诊卡")
    public ObjEnvelop findPatientCard(@ApiParam(name = "idCard", value = "身份证号", required = false)
                                          @RequestParam(value = "idCard",required = false)String idCard)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.findPatientCard(idCard));
    }
    /**
     * 获取卡信息
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/getCardInfo")
    @ApiOperation(value = "获取卡信息", notes = "获取卡信息")
    public ObjEnvelop getCardInfo(@ApiParam(name = "cardNo", value = "就诊卡", required = false)
                                      @RequestParam(value = "cardNo",required = false)String cardNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getCardInfo(cardNo));
    }
    /**
     * 获取单条门诊就诊记录
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/findOutpatientInfo")
    @ApiOperation(value = "获取单条门诊就诊记录", notes = "获取单条门诊就诊记录")
    public ObjEnvelop findOutpatientInfo(@ApiParam(name = "patient", value = "居民id", required = false)
                                  @RequestParam(value = "patient",required = false)String patient,
                                         @ApiParam(name = "conNo", value = "就诊次数", required = false)
                                         @RequestParam(value = "conNo",required = false)String conNo)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.findOutpatientInfo(patient,conNo));
    }
    /**
     * 获取门诊下所有处方信息
     * @param registerSn 流水号(必传)
     * @param patNo 病人id(必传)
     * @param admNo 住院唯一号(必传)
     * @param realOrder 处方号(非必传,传相当于查单条处方)
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/getOriginPrescriptionList")
    @ApiOperation(value = "获取门诊下所有处方信息", notes = "获取门诊下所有处方信息")
    public ObjEnvelop getOriginPrescriptionList(@ApiParam(name = "registerSn", value = "流水号", required = false)
                                         @RequestParam(value = "registerSn",required = false)String registerSn,
                                         @ApiParam(name = "patNo", value = "病人id", required = false)
                                         @RequestParam(value = "patNo",required = false)String patNo,
                                         @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)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getOriginPrescriptionList(registerSn,patNo,admNo,realOrder));
    }
    /**
     * 挂号(调his后台包)
     * @param doctor 医生ID(必填)
     * @param dept 科室编码(必填)
     * @param sickId 病人id
     * @param clinicclass 挂号类别(必填)
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/registered")
    @ApiOperation(value = "挂号(调his后台包)", notes = "挂号(调his后台包)")
    public ObjEnvelop registered(@ApiParam(name = "doctor", value = "医生ID", required = false)
                                         @RequestParam(value = "doctor",required = false)String doctor,
                                         @ApiParam(name = "dept", value = "科室编码", required = false)
                                         @RequestParam(value = "dept",required = false)String dept,
                                 @ApiParam(name = "sickId", value = "病人id", required = false)
                                     @RequestParam(value = "sickId",required = false)String sickId,
                                 @ApiParam(name = "clinicclass", value = "挂号类别", required = false)
                                     @RequestParam(value = "clinicclass",required = false)String clinicclass)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.registered(doctor,dept,sickId,clinicclass));
    }
    /**
     * 处方状态变更
     * @param admNo 就诊唯一号(必填)
     * @param realOrder 处方号(必填)
     * @param status 处方状态:3结算完成(必填)
     * @return
     * @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{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.updatePreStatus(admNo,realOrder,status));
    }
}

+ 2 - 2
svr/svr-internet-hospital-job/pom.xml

@ -46,10 +46,10 @@
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
       <!-- <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        </dependency>-->
        <!--注释掉就不会读取git的配置,只会读取yml中的配置-->
        <!--<dependency>-->
            <!--<groupId>org.springframework.cloud</groupId>-->

+ 71 - 9
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -53,14 +53,14 @@ FileTempPath:
  chat_file_path : /var/local/upload/chat
#发现服务
eureka:
  client:
    healthcheck:
      enabled: false #监控检查
    serviceUrl:
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka/
  instance:
    prefer-ip-address: false
#eureka:
#  client:
#    healthcheck:
#      enabled: true #监控检查
#    serviceUrl:
#      defaultZone: http://172.16.100.63:8761/eureka/
#  instance:
#    prefer-ip-address: false
#    instance-id: ${spring.cloud.client.ipAddress}:${server.port}
---
@ -222,4 +222,66 @@ fastDFS:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
spring:
  profiles: xzprod
  datasource:
    url: jdbc:mysql://172.16.100.240:7306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: jkzl
    password: jkzl@2020
hlwyyEntrance:
  url: http://172.16.100.63:10023
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://172.16.100.241:3000/
  data_base_name: im
fastDFS:
  fastdfs_file_url: http://172.16.100.240:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
spring:
  profiles: xzprod_in
  datasource:
    url: jdbc:mysql://192.168.103.155:7306/base?useUnicode:true&characterEncoding=utf-8&autoReconnect=true
    username: jkzl
    password: jkzl@2020
hlwyyEntrance:
  url: http://172.16.100.63:10023
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://192.168.103.150:3000/
  data_base_name: im
fastDFS:
  fastdfs_file_url: http://192.168.103.159:8888/
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段

+ 8 - 0
svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml

@ -51,3 +51,11 @@ spring:
    config:
      uri: ${wlyy.spring.config.uri:http://192.168.131.174:1221}
      label: ${wlyy.spring.config.label:local}
----
spring:
  profiles: xzprod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://172.16.100.63:1221}
      label: ${wlyy.spring.config.label:master}

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

@ -0,0 +1,63 @@
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.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 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;
/**
 * Created by Trick on 2020/1/19.
 */
@RestController
@RequestMapping(value ="/Xzyy")
@Api(value = "心脏医院", description = "心脏医院", tags = {"心脏医院"})
public class XzyyController extends EnvelopRestEndpoint {
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    /**
     * 查询患者就诊卡
     * @return
     * @throws Exception
     */
    @GetMapping(value = "/findPatientCard")
    @ApiOperation(value = "查询患者就诊卡", notes = "查询患者就诊卡")
    public ObjEnvelop 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
     * @throws Exception
     */
    @GetMapping(value = "/getCardInfo")
    @ApiOperation(value = "获取卡信息", notes = "获取卡信息")
    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));
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());
        }
    }
}

+ 3 - 1
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/controller/ActivityController.java

@ -174,13 +174,15 @@ public class ActivityController extends EnvelopRestEndpoint {
    @ApiOperation(value = "参与的活动")
    public MixEnvelop<ActivityDO, ActivityDO> selectByPatient(@ApiParam(name = "activity",value = "健康活动JSON")
                                           @RequestParam(value = "activity",required = false)String activity,
                                            @ApiParam(name = "flag",value = "1活动和计划")
                                                @RequestParam(value = "flag",required = false)String flag,
                                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                           @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                           @RequestParam(value = "size", required = false)Integer size){
        try{
            ActivityDO activityDO = toEntity(activity,ActivityDO.class);
            return service.selectByPatient(activityDO,page,size);
            return service.selectByPatient(activityDO,flag,page,size);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 7 - 3
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/service/ActivityService.java

@ -387,11 +387,15 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
     * @param size 分页大小
     * @return
     */
    public MixEnvelop<ActivityDO, ActivityDO> selectByPatient(ActivityDO activityDO, Integer page, Integer size){
    public MixEnvelop<ActivityDO, ActivityDO> selectByPatient(ActivityDO activityDO,String flag, Integer page, Integer size){
        String condition = "";
        if (activityDO.getUnionId()!=null&&activityDO.getUnionId() !=""){
            condition="AND union_id = '"+ activityDO.getUnionId()+"'";
        }
        String condition1="";
        if (!StringUtils.isNoneBlank(flag)){
            condition1 =" and type <> '健康计划' ";
        }
        String sql ="SELECT * " +
                " FROM wlyy_health_bank_activity " +
                "WHERE " +
@ -403,7 +407,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
                "wlyy_health_bank_task_patient_detail" +
                " WHERE " +
                " patient_idcard = '"+activityDO.getPatientIdcard()+"' "+ condition+")" +
                " ) AND del_flag =1 " +
                " ) AND del_flag =1 " +condition1+
                " LIMIT "+(page-1)*size +","+size;
        List<ActivityDO> activityDOS = jdbcTemplate.query(sql,new BeanPropertyRowMapper(ActivityDO.class));
        for (ActivityDO activityDO1:activityDOS){
@ -474,7 +478,7 @@ public class ActivityService extends BaseJpaService<ActivityDO,ActivityDao> {
                "wlyy_health_bank_task_patient_detail" +
                " WHERE " +
                " patient_openid = '"+activityDO.getOpenId()+ "' AND patient_idcard = '"+activityDO.getPatientIdcard()+"'"+condition+ ")" +
                " )";
                " ) "+condition1;
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sqlcount);
        Long count = 0L;
        if(rstotal!=null&&rstotal.size()>0){