ソースを参照

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 5 年 前
コミット
a0f78f3836
15 ファイル変更799 行追加9 行削除
  1. 30 0
      business/base-service/src/main/java/com/yihu/jw/hospital/caauth/CaService.java
  2. 10 3
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  3. 33 0
      common/common-entity/src/main/java/com/yihu/jw/entity/ca/OauthCaConfigDO.java
  4. 21 0
      server/svr-authentication/pom.xml
  5. 11 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/dao/OauthCaConfigDao.java
  6. 71 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  7. 84 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthCaConfigSerivce.java
  8. 32 4
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthWlyyConfigService.java
  9. 14 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeService.java
  10. 16 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeServiceImplService.java
  11. 142 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeServiceImplServiceLocator.java
  12. 214 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeServiceImplServiceSoapBindingStub.java
  13. 66 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeServiceProxy.java
  14. 51 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/CaController.java
  15. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

+ 30 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/caauth/CaService.java

@ -0,0 +1,30 @@
package com.yihu.jw.hospital.caauth;
import com.yihu.jw.utils.WebserviceUtil;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Map;
/**
 * Created by Trick on 2019/12/24.
 */
@Service
@Transactional
public class CaService {
    public String getQRCodeBySys(String url,String name,String api,String sys)throws Exception{
        Map<String,String> params = new HashedMap();
        params.put("sys",sys);
        return WebserviceUtil.post(url,name,api,params);
    }
    public String queryQRCode(String url,String name,String api,String qrCode)throws Exception{
        Map<String,String> params = new HashedMap();
        params.put("qrCode",qrCode);
        return WebserviceUtil.post(url,name,api,params);
    }
}

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

@ -817,8 +817,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param orgCode
     * @return
     */
    public List<DictHospitalDeptVO> findDeptByHospital(String orgCode,String dept){
        List<DictHospitalDeptDO> list =  dictHospitalDeptDao.findByOrgCodeIn(orgCode);
    public List<DictHospitalDeptVO> findDeptByHospital(String orgCode,String dept,String consultDeptFlag){
        List<DictHospitalDeptDO> list;
        if(StringUtils.isNotBlank(consultDeptFlag)&&"1".equals(consultDeptFlag)){
            list = dictHospitalDeptDao.findByOrgCodeAndConsultDeptFlag(orgCode,consultDeptFlag);
        }else {
            list =  dictHospitalDeptDao.findByOrgCodeIn(orgCode);
        }
        List<DictHospitalDeptVO> rs = new ArrayList<>();
        convertToModels(list,rs,DictHospitalDeptVO.class);
        if(rs!=null&&rs.size()>0&&StringUtils.isNotBlank(dept)){
@ -1366,7 +1371,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 下诊断
     * 下诊断,线上开方
     * @param outPatientId
     * @param advice
     * @param type 1带处方,2不带处方
@ -2355,6 +2360,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            rs.put("outpatientType",doctorDO.getOutpatientType());
            rs.put("expertise",doctorDO.getExpertise());
            rs.put("introduce",doctorDO.getIntroduce());
            rs.put("townCode",doctorDO.getTownCode());
            rs.put("townName",doctorDO.getTownName());
            rs.put("consultStatus",doctorDO.getConsultStatus());// 咨询在线状态
            //机构科室信息

+ 33 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/ca/OauthCaConfigDO.java

@ -0,0 +1,33 @@
package com.yihu.jw.entity.ca;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2019/12/25.
 */
@Entity
@Table(name = "oauth_ca_config")
public class OauthCaConfigDO extends UuidIdentityEntity {
    private String url;
    private String remark;
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}

+ 21 - 0
server/svr-authentication/pom.xml

@ -149,6 +149,27 @@
            <version>2.0.0</version>
        </dependency>
        <dependency>
            <groupId>axis</groupId>
            <artifactId>axis-jaxrpc</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.axis</groupId>
            <artifactId>axis</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-discovery</groupId>
            <artifactId>commons-discovery</artifactId>
            <version>0.2</version>
        </dependency>
        <dependency>
            <groupId>javax.wsdl</groupId>
            <artifactId>javax.wsdl</artifactId>
            <version>1.5.1</version>
        </dependency>
    </dependencies>
    <build>

+ 11 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/dao/OauthCaConfigDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.security.dao;
import com.yihu.jw.entity.ca.OauthCaConfigDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2019/12/25.
 */
public interface OauthCaConfigDao extends PagingAndSortingRepository<OauthCaConfigDO, String>, JpaSpecificationExecutor<OauthCaConfigDO> {
}

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

@ -18,6 +18,7 @@ import com.yihu.jw.security.model.*;
import com.yihu.jw.security.oauth2.core.redis.WlyyRedisVerifyCodeService;
import com.yihu.jw.security.oauth2.provider.WlyyTokenGranter;
import com.yihu.jw.security.oauth2.provider.error.WlyyOAuth2ExceptionTranslator;
import com.yihu.jw.security.service.OauthCaConfigSerivce;
import com.yihu.jw.security.service.OauthWlyyConfigService;
import com.yihu.jw.security.service.OauthYlzConfigService;
import com.yihu.jw.security.utils.DateUtil;
@ -121,6 +122,8 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private OauthWlyyConfigService oauthWlyyConfigService;
    @Autowired
    private ZhongShanSMSService zhongShanSMSService;
    @Autowired
    private OauthCaConfigSerivce oauthCaConfigSerivce;
    @PostConstruct
@ -758,6 +761,71 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        return ObjEnvelop.getSuccess("success", oauthYlzConfigService.getOauthQRCode());
    }
    @RequestMapping(value = "/oauth/getCaQRCode", method = RequestMethod.GET)
    public ObjEnvelop getCaQRCode(){
        logger.info("/oauth/getCaQRCode");
        String sys ="JKZLHLWYLJKGLPT";
        return ObjEnvelop.getSuccess("success", oauthCaConfigSerivce.getQRCode(sys));
    }
    /**
     * 医生二维码登录
     * @param qrcode
     * @param client_id
     * @param login_type 2
     * @return
     */
    @RequestMapping(value = "/oauth/checkCaQRCodeLogin", method = RequestMethod.POST)
    public ObjEnvelop checkCaQRCodeLogin(String qrcode,String client_id,String login_type){
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id is null");
        }
        JSONObject rs = oauthCaConfigSerivce.getQueryQRCode(qrcode);
        String code = rs.getString("code");
        JSONObject data = rs.getJSONObject("data");
        String qrCodeStatus = data.getString("qrCodeStatus");
        if(!"1000".equals(code)&&!"LoginQrCodeBeenScan".equals(qrCodeStatus)){
            return ObjEnvelop.getSuccess("error",rs);
        }
        ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
        Map<String, String> parameters = new HashedMap();
        parameters.put("username",data.getString("userIdCardNum"));
        parameters.put("grant_type", "ihealthCode");
        TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
        if (authenticatedClient != null) {
            oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
        }
        OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
        if (token == null) {
            throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
        }
        WlyyUserSimple wlyyUserSimple = userDetailsService.authSuccess(parameters.get("username"));
        wlyyUserSimple.setAccessToken(token.getValue());
        wlyyUserSimple.setTokenType(token.getTokenType());
        wlyyUserSimple.setExpiresIn(token.getExpiresIn());
        wlyyUserSimple.setRefreshToken(token.getRefreshToken().getValue());
        wlyyUserSimple.setUser(parameters.get("username"));
        BaseLoginLogDO baseLoginLogDO = new BaseLoginLogDO();
        userDetailsService.setRolePhth(login_type, token, wlyyUserSimple.getId(), redisTemplate);
        baseLoginLogDO.setUserId(wlyyUserSimple.getId());
        baseLoginLogDO.setCreateTime(new Date());
        String userAgent = JSONObject.toJSONString(wlyyUserSimple);
        baseLoginLogDO.setUserAgent(userAgent);
        baseLoginLogDO.setLoginType(login_type);
        baseLoginLogService.save(baseLoginLogDO);
        rs.put("WlyyUserSimple",wlyyUserSimple);
        rs.remove("data");
        return ObjEnvelop.getSuccess("success",rs);
    }
    @RequestMapping(value = "/oauth/getOauthQRCodeImg", method = RequestMethod.GET)
    public ObjEnvelop getOauthQRCodeImg(){
        try{
@ -771,6 +839,9 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        }
    }
    /**
     * 居民二维码登录
     */
    @RequestMapping(value = "/oauth/checkQRCodeLogin", method = RequestMethod.POST)
    public ObjEnvelop checkQRCodeLogin(String no,String client_id,String login_type){

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

@ -0,0 +1,84 @@
package com.yihu.jw.security.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.ca.OauthCaConfigDO;
import com.yihu.jw.security.dao.OauthCaConfigDao;
import com.yihu.jw.security.utils.qrcode.QRCodeService;
import com.yihu.jw.security.utils.qrcode.QRCodeServiceImplServiceLocator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.net.URL;
/**
 * Created by Trick on 2019/12/25.
 */
@Service
@Transactional
public class OauthCaConfigSerivce {
    private Logger logger = LoggerFactory.getLogger(OauthCaConfigSerivce.class);
    @Autowired
    private OauthCaConfigDao oauthCaConfigDao;
    /**
     * 生成二维码
     * @param sys
     * @return
     */
    public String getQRCode(String sys) {
        try {
            logger.info("生成二维码 getQRCode :"+sys);
            OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findOne("oauth_ca_config");
            QRCodeServiceImplServiceLocator locator = new QRCodeServiceImplServiceLocator();
            URL portAddress = new URL(oauthCaConfigDO.getUrl());
            QRCodeService service = locator.getQRCodeServiceImplPort(portAddress);
            return service.SOF_GetQRCodeBySys(sys);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    /**
     * 查询二维码授权结果
     * @param qrcode
     * @return
     */
    public JSONObject getQueryQRCode(String qrcode){
        try {
            OauthCaConfigDO oauthCaConfigDO = oauthCaConfigDao.findOne("oauth_ca_config");
            QRCodeServiceImplServiceLocator locator = new QRCodeServiceImplServiceLocator();
            URL portAddress = new URL(oauthCaConfigDO.getUrl());
            QRCodeService service = locator.getQRCodeServiceImplPort(portAddress);
            String rs = service.SOF_QueryQRCode(qrcode);
            logger.info("验证二维码 getQueryQRCode :"+rs);
            return JSONObject.parseObject(rs);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    public static void main(String[] args) {
        try {
            QRCodeServiceImplServiceLocator locator = new QRCodeServiceImplServiceLocator();
            URL portAddress = new URL("http://47.100.121.92:8088/PKIQRCode/services/v1?wsdl");
            QRCodeService service = locator.getQRCodeServiceImplPort(portAddress);
            // 旧获取二维码接口
//            System.out.println(service.SOF_GetQRCode());
            // 新获取二维码接口
            System.out.println(service.SOF_GetQRCodeBySys("EMR"));
            // 获取二维码状态接口
            System.out.println(service.SOF_QueryQRCode("oFgFqfz7IDKfBGh93aU507Tj9UoOzJiCJ7pVAqDC8CwkFZmxo8uq3IcvgtY48y5vqRdc7vvVkUuMNH0hN-h3yQ"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

+ 32 - 4
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthWlyyConfigService.java

@ -89,11 +89,37 @@ public class OauthWlyyConfigService {
                    BaseDoctorDO doctorDO = baseDoctorDao.findByIdcard(idcard);
                    if(doctorDO!=null){
                        //判断不充机构信息
                        List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
                        if(hospitalDOs!=null&&hospitalDOs.size()>0){
                            //不新增
                        }else{
                            //补充机构信息
                            BaseDoctorHospitalDO hospitalDO = new BaseDoctorHospitalDO();
                            hospitalDO.setDoctorCode(doctorDO.getId());
                            hospitalDO.setOrgCode(doctorJson.getString("hospital"));
                            hospitalDO.setOrgName(doctorJson.getString("hospitalName"));
                            hospitalDO.setDel("1");
                            baseDoctorHospitalDao.save(hospitalDO);
                        }
                        List<BaseDoctorRoleDO> roleDOs = baseDoctorRoleDao.findByDoctorCode(doctorDO.getId());
                        //判断不充角色信息
                        if(roleDOs!=null&&roleDOs.size()>0){
                            //不新增
                        }else{
                            BaseDoctorRoleDO role = new BaseDoctorRoleDO();
                            role.setDoctorCode(doctorDO.getId());
                            role.setRoleCode("generalDoctor");
                            baseDoctorRoleDao.save(role);
                        }
                        return data;
                    }else{
                        //存储医生全科医生信息
                        BaseDoctorDO doctor = new BaseDoctorDO();
                        doctor.setId(doctorJson.getString("code"));
                        doctor.setName(doctorJson.getString("name"));
                        doctor.setIdcard(doctorJson.getString("idcard"));
                        doctor.setMobile(doctorJson.getString("mobile"));
@ -101,6 +127,8 @@ public class OauthWlyyConfigService {
                        doctor.setBirthday(doctorJson.getDate("birthday"));
                        doctor.setProvinceCode(doctorJson.getString("province"));
                        doctor.setProvinceName(doctorJson.getString("provinceName"));
                        doctor.setTownCode(doctorJson.getString("town"));
                        doctor.setTownName(doctorJson.getString("townName"));
                        doctor.setCityCode(doctorJson.getString("city"));
                        doctor.setCityName(doctorJson.getString("cityName"));
@ -112,18 +140,18 @@ public class OauthWlyyConfigService {
                        doctor.setEnabled(1);
                        doctor.setLocked(0);
                        doctor.setCreateTime(new Date());
                        baseDoctorDao.save(doctor);
                        BaseDoctorDO temp = baseDoctorDao.save(doctor);
                        //机构信息
                        BaseDoctorHospitalDO hospitalDO = new BaseDoctorHospitalDO();
                        hospitalDO.setDoctorCode(doctorJson.getString("code"));
                        hospitalDO.setDoctorCode(temp.getId());
                        hospitalDO.setOrgCode(doctorJson.getString("hospital"));
                        hospitalDO.setOrgName(doctorJson.getString("hospitalName"));
                        hospitalDO.setDel("1");
                        baseDoctorHospitalDao.save(hospitalDO);
                        BaseDoctorRoleDO role = new BaseDoctorRoleDO();
                        role.setDoctorCode(doctorJson.getString("code"));
                        role.setDoctorCode(temp.getId());
                        role.setRoleCode("generalDoctor");
                        baseDoctorRoleDao.save(role);
                        return data;

+ 14 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeService.java

@ -0,0 +1,14 @@
/**
 * QRCodeService.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.security.utils.qrcode;
public interface QRCodeService extends java.rmi.Remote {
    public String SOF_QueryQRCode(String qrCode) throws java.rmi.RemoteException;
    public String SOF_GetQRCode() throws java.rmi.RemoteException;
    public String SOF_GetQRCodeBySys(String sys) throws java.rmi.RemoteException;
}

+ 16 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeServiceImplService.java

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

+ 142 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeServiceImplServiceLocator.java

@ -0,0 +1,142 @@
/**
 * QRCodeServiceImplServiceLocator.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
 */
package com.yihu.jw.security.utils.qrcode;
public class QRCodeServiceImplServiceLocator extends org.apache.axis.client.Service implements QRCodeServiceImplService {
    public QRCodeServiceImplServiceLocator() {
    }
    public QRCodeServiceImplServiceLocator(org.apache.axis.EngineConfiguration config) {
        super(config);
    }
    public QRCodeServiceImplServiceLocator(String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException {
        super(wsdlLoc, sName);
    }
    // Use to get a proxy class for QRCodeServiceImplPort
    private String QRCodeServiceImplPort_address = "http://47.100.121.92:8088/PKIQRCode/services/v1";
    public String getQRCodeServiceImplPortAddress() {
        return QRCodeServiceImplPort_address;
    }
    // The WSDD service name defaults to the port name.
    private String QRCodeServiceImplPortWSDDServiceName = "QRCodeServiceImplPort";
    public String getQRCodeServiceImplPortWSDDServiceName() {
        return QRCodeServiceImplPortWSDDServiceName;
    }
    public void setQRCodeServiceImplPortWSDDServiceName(String name) {
        QRCodeServiceImplPortWSDDServiceName = name;
    }
    public QRCodeService getQRCodeServiceImplPort() throws javax.xml.rpc.ServiceException {
       java.net.URL endpoint;
        try {
            endpoint = new java.net.URL(QRCodeServiceImplPort_address);
        }
        catch (java.net.MalformedURLException e) {
            throw new javax.xml.rpc.ServiceException(e);
        }
        return getQRCodeServiceImplPort(endpoint);
    }
    public QRCodeService getQRCodeServiceImplPort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException {
        try {
            QRCodeServiceImplServiceSoapBindingStub _stub = new QRCodeServiceImplServiceSoapBindingStub(portAddress, this);
            _stub.setPortName(getQRCodeServiceImplPortWSDDServiceName());
            return _stub;
        }
        catch (org.apache.axis.AxisFault e) {
            return null;
        }
    }
    public void setQRCodeServiceImplPortEndpointAddress(String address) {
        QRCodeServiceImplPort_address = address;
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (QRCodeService.class.isAssignableFrom(serviceEndpointInterface)) {
                QRCodeServiceImplServiceSoapBindingStub _stub = new QRCodeServiceImplServiceSoapBindingStub(new java.net.URL(QRCodeServiceImplPort_address), this);
                _stub.setPortName(getQRCodeServiceImplPortWSDDServiceName());
                return _stub;
            }
        }
        catch (Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
    /**
     * For the given interface, get the stub implementation.
     * If this service has no port for the given interface,
     * then ServiceException is thrown.
     */
    public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        if (portName == null) {
            return getPort(serviceEndpointInterface);
        }
        String inputPortName = portName.getLocalPart();
        if ("QRCodeServiceImplPort".equals(inputPortName)) {
            return getQRCodeServiceImplPort();
        }
        else  {
            java.rmi.Remote _stub = getPort(serviceEndpointInterface);
            ((org.apache.axis.client.Stub) _stub).setPortName(portName);
            return _stub;
        }
    }
    public javax.xml.namespace.QName getServiceName() {
        return new javax.xml.namespace.QName("http://webservice.qrcode.pki.jhsec.com.cn/", "QRCodeServiceImplService");
    }
    private java.util.HashSet ports = null;
    public java.util.Iterator getPorts() {
        if (ports == null) {
            ports = new java.util.HashSet();
            ports.add(new javax.xml.namespace.QName("http://webservice.qrcode.pki.jhsec.com.cn/", "QRCodeServiceImplPort"));
        }
        return ports.iterator();
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(String portName, String address) throws javax.xml.rpc.ServiceException {
if ("QRCodeServiceImplPort".equals(portName)) {
            setQRCodeServiceImplPortEndpointAddress(address);
        }
        else
{ // Unknown Port Name
            throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
        }
    }
    /**
    * Set the endpoint address for the specified port name.
    */
    public void setEndpointAddress(javax.xml.namespace.QName portName, String address) throws javax.xml.rpc.ServiceException {
        setEndpointAddress(portName.getLocalPart(), address);
    }
}

+ 214 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeServiceImplServiceSoapBindingStub.java

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

+ 66 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/utils/qrcode/QRCodeServiceProxy.java

@ -0,0 +1,66 @@
package com.yihu.jw.security.utils.qrcode;
public class QRCodeServiceProxy implements QRCodeService {
  private String _endpoint = null;
  private QRCodeService qRCodeService = null;
  
  public QRCodeServiceProxy() {
    _initQRCodeServiceProxy();
  }
  
  public QRCodeServiceProxy(String endpoint) {
    _endpoint = endpoint;
    _initQRCodeServiceProxy();
  }
  
  private void _initQRCodeServiceProxy() {
    try {
      qRCodeService = (new QRCodeServiceImplServiceLocator()).getQRCodeServiceImplPort();
      if (qRCodeService != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)qRCodeService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)qRCodeService)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (qRCodeService != null)
      ((javax.xml.rpc.Stub)qRCodeService)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public QRCodeService getQRCodeService() {
    if (qRCodeService == null)
      _initQRCodeServiceProxy();
    return qRCodeService;
  }
  
  public String SOF_QueryQRCode(String qrCode) throws java.rmi.RemoteException{
    if (qRCodeService == null)
      _initQRCodeServiceProxy();
    return qRCodeService.SOF_QueryQRCode(qrCode);
  }
  public String SOF_GetQRCode() throws java.rmi.RemoteException{
    if (qRCodeService == null)
      _initQRCodeServiceProxy();
    return qRCodeService.SOF_GetQRCode();
  }
  public String SOF_GetQRCodeBySys(String sys) throws java.rmi.RemoteException{
    if (qRCodeService == null)
      _initQRCodeServiceProxy();
    return qRCodeService.SOF_GetQRCodeBySys(sys);
  }
  
  
}

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

@ -0,0 +1,51 @@
package com.yihu.jw.entrance.controller;
import com.yihu.jw.hospital.caauth.CaService;
import com.yihu.jw.restmodel.web.Envelop;
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 2019/12/24.
 */
@RestController
@RequestMapping(value ="/ca")
@Api(value = "ca测试", description = "ca测试", tags = {"ca测试"})
public class CaController extends EnvelopRestEndpoint {
    @Autowired
    private CaService caService;
    @GetMapping(value = "/getQRCodeBySys")
    @ApiOperation(value = "测试二维码")
    public Envelop getQRCodeBySys(@ApiParam(name = "url", value = "url", required = true)
                                  @RequestParam(value = "url") String url,
                                  @ApiParam(name = "name", value = "namespace", required = true)
                                  @RequestParam(value = "name")String name,
                                  @ApiParam(name = "api", value = "api", required = true)
                                  @RequestParam(value = "api")String api,
                                  @ApiParam(name = "sys", value = "系统名", required = true)
                                  @RequestParam(value = "sys")String sys) throws Exception{
        return success(caService.getQRCodeBySys(url,name,api,sys));
    }
    @GetMapping(value = "/queryQRCode")
    @ApiOperation(value = "查询二维码")
    public Envelop queryQRCode(@ApiParam(name = "url", value = "url", required = true)
                                  @RequestParam(value = "url") String url,
                                  @ApiParam(name = "name", value = "namespace", required = true)
                                  @RequestParam(value = "name")String name,
                                  @ApiParam(name = "api", value = "api", required = true)
                                  @RequestParam(value = "api")String api,
                                  @ApiParam(name = "qrCode", value = "二维码验证码", required = true)
                                  @RequestParam(value = "qrCode")String qrCode) throws Exception{
        return success(caService.queryQRCode(url,name,api,qrCode));
    }
}

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

@ -216,8 +216,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public ListEnvelop findDeptByHospital(@ApiParam(name = "orgCode", value = "机构code")
                                          @RequestParam(value = "orgCode", required = true)String orgCode,
                                          @ApiParam(name = "dept", value = "需要置顶部门")
                                          @RequestParam(value = "dept", required = false)String dept) {
        return success(prescriptionService.findDeptByHospital(orgCode,dept));
                                          @RequestParam(value = "dept", required = false)String dept,
                                          @ApiParam(name = "consultDeptFlag", value = "1为查询开通服务部门")
                                          @RequestParam(value = "consultDeptFlag", required = false)String consultDeptFlag) {
        return success(prescriptionService.findDeptByHospital(orgCode,dept,consultDeptFlag));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByHospitalAndDept)