Kaynağa Gözat

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

humingfen 5 yıl önce
ebeveyn
işleme
ea6ed0bf76
21 değiştirilmiş dosya ile 1123 ekleme ve 13 silme
  1. 11 0
      business/base-service/pom.xml
  2. 11 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/SfConfigDao.java
  3. 107 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java
  4. 32 2
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  5. 407 0
      business/base-service/src/main/java/com/yihu/jw/utils/sfutils/HttpClientUtils.java
  6. 67 0
      business/base-service/src/main/java/com/yihu/jw/utils/sfutils/SHAUtils.java
  7. 191 0
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  8. 104 0
      business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java
  9. 60 0
      common/common-entity/src/main/java/com/yihu/jw/entity/sf/SfConfigDO.java
  10. 5 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  11. 7 1
      gateway/ag-basic/src/main/resources/bootstrap.yml
  12. 7 0
      server/svr-authentication/src/main/resources/bootstrap.yml
  13. 2 1
      server/svr-configuration/src/main/resources/application.yml
  14. 12 1
      server/svr-configuration/src/main/resources/bootstrap.yml
  15. 1 1
      svr/svr-internet-hospital-entrance/pom.xml
  16. 2 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/SfRoutePushController.java
  17. 11 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/expressage/ExpressageEndpoint.java
  18. 9 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java
  19. 60 0
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java
  20. 10 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/version/VersionEndpoint.java
  21. 7 0
      svr/svr-internet-hospital/src/main/resources/bootstrap.yml

+ 11 - 0
business/base-service/pom.xml

@ -143,6 +143,17 @@
            <version>4.3.13.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>28.2-jre</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.8</version>
        </dependency>
    </dependencies>
    <build>
        <resources>

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

@ -0,0 +1,11 @@
package com.yihu.jw.hospital.prescription.dao;
import com.yihu.jw.entity.sf.SfConfigDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2020/2/27.
 */
public interface SfConfigDao extends PagingAndSortingRepository<SfConfigDO, String>, JpaSpecificationExecutor<SfConfigDO> {
}

+ 107 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java

@ -1,15 +1,26 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.sf.SfConfigDO;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.entrance.util.SFUtils;
import com.yihu.jw.org.dao.BaseOrgDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientKit;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.sfutils.HttpClientUtils;
import com.yihu.jw.utils.sfutils.SHAUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.network.HttpResponse;
import com.yihu.utils.network.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.entity.ContentType;
import org.apache.http.message.BasicNameValuePair;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
@ -73,6 +84,9 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
    @Autowired
    private OutpatientDao outpatientDao;
    @Autowired
    private SfConfigDao sfConfigDao;
    private PrescriptionExpressageService(){}
    public PrescriptionExpressageService(String sf_url,String sf_code,String sf_check_word){
@ -732,4 +746,97 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
        outpatientExpressageLogDao.save(prescriptionLog);
    }
    public JSONObject addOrder(){
        String json = "{" +
                "    \"orderThirds\": [" +
                "        {" +
                "            \"bspOrderNo\": \"jkzltest05\"," +
                "            \"depositumInfo\": \"西瓜\"," +
                "            \"depositumNo\": \"3\"," +
                "            \"destAddress\": \"白石龙一区175栋\"," +
                "            \"destCity\": \"深圳市\"," +
                "            \"destDistrict\": \"龙华新区\"," +
                "            \"destName\": \"梁飞\"," +
                "            \"destPhone\": \"15986618684\"," +
                "            \"destProvince\": \"广东省\"," +
                "            \"expressType\": \"1\"," +
                "            \"hospitalCode\": \"\"," +
                "            \"monthlyCard\": \"\"," +
                "            \"orderDate\": 1561363194848," +
                "            \"packagesNo\": 1," +
                "            \"parcelWeighs\": \"10\"," +
                "            \"patientIdentityCardNo\": \"411081199102201259\"," +
                "            \"patientName\": \"佩奇\"," +
                "            \"patientPhone\": \"15113149999\"," +
                "            \"payMethod\": 1," +
                "            \"remark\": \"备注\"," +
                "            \"srcAddress\": \"中山大道\"," +
                "            \"srcCity\": \"上海市\"," +
                "            \"srcDistrict\": \"黄浦区\"," +
                "            \"srcName\": \"佩奇\"," +
                "            \"srcPhone\": \"15113149999\"," +
                "            \"productCode\": \"OTHER\"," +
                "            \"srcProvince\": \"上海市\"" +
                "        }" +
                "    ]" +
                " " +
                "}";
        JSONObject j = JSON.parseObject(json);
        return j;
    }
    public void test()throws Exception{
        JSONObject j =  addOrder();
        j.put("version","1.0");
        j.put("timestamp",new Date());
        String sign = SHAUtils.SHA512(j.toJSONString()+"AAAABBBBCCCCDDDD");
        String hospitalCode = "HD000001";
        String url ="http://mrds-admin-ci.sit.sf-express.com:45478/api/open/api/addOrder?hospitalCode="+hospitalCode+"&sign="+sign;
        String rs = HttpClientUtils.doPost(url,j.toJSONString(), ContentType.APPLICATION_JSON);
        System.out.println(rs);
    }
//    public JSONObject addSFOrder(WlyyPrescriptionExpressageDO expressageDO){
//
//        SfConfigDO sfConfigDO = sfConfigDao.findOne("sfconfig");
//
//        JSONObject param = new JSONObject();
//        param.put("timestamp",new Date());
//        param.put("version","1.0");
//        JSONArray orderThirds = new JSONArray();
//        JSONObject order = new JSONObject();
//        order.put("bspOrderNo",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//        order.put("",);
//    }
}

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

@ -50,6 +50,7 @@ import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wlyy.wlyyhttp.WlyyHttpService;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
@ -151,6 +152,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private StringRedisTemplate redisTemplate;
    @Autowired
    private SystemMessageService systemMessageService;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${demo.flag}")
@ -1104,8 +1107,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " JOIN base_doctor_role r ON r.doctor_code = d.id " +
                " WHERE  " +
                " h.org_code = '"+orgCode+"'";
                " h.org_code = '"+orgCode+"'" +
                " AND r.role_code ='specialist'";
        if(StringUtils.isNotBlank(chargeType)){
            totalSql+=" AND d.charge_type ='"+chargeType+"'";
        }
@ -1136,8 +1141,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                " FROM " +
                " base_doctor d " +
                " JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
                " JOIN base_doctor_role r ON r.doctor_code = d.id " +
                " WHERE  " +
                " h.org_code = '"+orgCode+"'";
                " h.org_code = '"+orgCode+"'"+
                " AND r.role_code ='specialist'";
        if(StringUtils.isNotBlank(chargeType)){
            sql+=" AND d.charge_type ='"+chargeType+"'";
        }
@ -1161,6 +1168,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
            }
        }
        logger.info("findDoctorWithMouthWork :"+sql);
        return MixEnvelop.getSuccessListWithPage(BaseHospitalRequestMapping.Prescription.api_success, list, page, size, count);
    }
@ -2415,6 +2423,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                rs.put("deptCode",null);
            }
            //多科室兼容
            rs.put("hospitalList",hospitalDOs);
            //医生角色
            String sql = "SELECT " +
@ -4320,4 +4331,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
       return entranceService.BS10008(idcard,patientId,admitNum,ybcard,demoFlag);
    }
    public List<Map<String,Object>> findDoctorByName(String name){
        String sql ="SELECT " +
                " d.id AS \"id\", " +
                " d.`name` AS \"name\"" +
                " FROM " +
                " base_doctor d " +
                " WHERE " +
                " d. NAME LIKE '%"+name+"%'";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        if(list!=null&&list.size()>0){
            for(int i=0;i<list.size();i++){
                Map<String,Object> d = list.get(i);
                List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByDoctorCode(d.get("id").toString());
                d.put("depts",depts);
            }
        }
        return list;
    }
}

+ 407 - 0
business/base-service/src/main/java/com/yihu/jw/utils/sfutils/HttpClientUtils.java

@ -0,0 +1,407 @@
package com.yihu.jw.utils.sfutils;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.*;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.client.ResponseHandler;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.config.ConnectionConfig;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.config.SocketConfig;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.ssl.SSLContexts;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.UnknownHostException;
import java.nio.charset.CodingErrorAction;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
public class HttpClientUtils {
    private static Logger logger = LoggerFactory.getLogger(HttpClientUtils.class);
    HttpClientUtils() {
    }
    /**
     * 连接池最大连接数
     */
    private static final int MAX_TOTAL_CONNECTIONS = 4000;
    /**
     * 设置每个路由上的默认连接个数
     */
    private static final int DEFAULT_MAX_PER_ROUTE = 200;
    /**
     * 请求的请求超时时间 单位:毫秒
     */
    private static final int REQUEST_CONNECTION_TIMEOUT = 8 * 1000;
    /**
     * 请求的等待数据超时时间 单位:毫秒
     */
    private static final int REQUEST_SOCKET_TIMEOUT = 8 * 1000;
    /**
     * 请求的连接超时时间 单位:毫秒
     */
    private static final int REQUEST_CONNECTION_REQUEST_TIMEOUT = 5 * 1000;
    /**
     * 连接闲置多久后需要重新检测 单位:毫秒
     */
    private static final int VALIDATE_AFTER_IN_ACTIVITY = 2 * 1000;
    /**
     * 接收数据的等待超时时间,即读超时时间,单位ms
     */
    private static final int SOCKET_CONFIG_SO_TIMEOUT = 5 * 1000;
    /**
     * 重试次数
     */
    private static final int RETRY_COUNT = 5;
    /**
     * 声明为 static volatile,会迫使线程每次读取时作为一个全局变量读取
     */
    private static volatile CloseableHttpClient httpClient = null;
    /**
     * @param uri
     * @return String
     * @description get请求方式
     * @author: long.he01
     */
    public static String doGet(String uri) {
        String responseBody;
        HttpGet httpGet = new HttpGet(uri);
        try {
            httpGet.setConfig(getRequestConfig());
            responseBody = executeRequest(httpGet);
        } catch (IOException e) {
//            logger.eerror("httpclient doGet方法异常{}", e);
            return null;
        } finally {
            httpGet.releaseConnection();
        }
        return responseBody;
    }
    /**
     * @param uri
     * @param params
     * @return string
     * @description 带map参数get请求, 此方法会将map参数拼接到连接地址上。
     */
    public static String doGet(String uri, Map<String, String> params) {
        return doGet(getGetUrlFromParams(uri, params));
    }
    /**
     * @param uri
     * @param params
     * @return String
     * @description 根据map参数拼接完整的url地址
     */
    private static String getGetUrlFromParams(String uri, Map<String, String> params) {
        List<BasicNameValuePair> resultList = params.entrySet().stream().map(innerEntry -> new BasicNameValuePair(innerEntry.getKey(), innerEntry.getValue())).collect(Collectors.toList());
        String paramSectionOfUrl = URLEncodedUtils.format(resultList, Consts.UTF_8);
        StringBuilder resultUrl = new StringBuilder(uri);
        if (StringUtils.isEmpty(uri)) {
            return uri;
        } else {
            if (!StringUtils.isEmpty(paramSectionOfUrl)) {
                if (uri.endsWith("?")) {
                    resultUrl.append(paramSectionOfUrl);
                } else {
                    resultUrl.append("?").append(paramSectionOfUrl);
                }
            }
            return resultUrl.toString();
        }
    }
    /**
     * @param uri
     * @param params
     * @return String
     * @description 带map参数的post请求方法
     */
    public static String doPost(String uri, Map<String, String> params) {
        String responseBody;
        HttpPost httpPost = new HttpPost(uri);
        try {
            List<NameValuePair> nvps = Lists.newArrayList();
            for (Map.Entry<String, String> entry : params.entrySet()) {
                String key = entry.getKey();
                String value = entry.getValue();
                nvps.add(new BasicNameValuePair(key, value));
            }
            httpPost.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8));
            httpPost.setConfig(getRequestConfig());
            responseBody = executeRequest(httpPost);
        } catch (Exception e) {
            logger.error("httpPosttpclient doPost方法异常{}", e);
            return null;
        } finally {
            httpPost.releaseConnection();
        }
        return responseBody;
    }
    /**
     * @param uri
     * @param param
     * @param contentType 根据具体请求情况指定,比如json可以是 ContentType.APPLICATION_JSON
     * @return String
     * @description 带单string参数执行post方法
     */
    /**
     *
     * @param uri
     * @param param 请求参数
     * @param headerParams header参数
     * @param contentType 根据具体请求情况指定,比如json可以是 ContentType.APPLICATION_JSON
     * @return
     * @description 带单string参数执行post方法
     */
    /*public static String doPostWithHeader(String uri, String param, Map<String, Object> headerParams, ContentType contentType) {
        String responseBody;
        HttpPost httpPost = new HttpPost(uri);
        try {
            if (!CollectionUtils.isEmpty(headerParams)) {
                for (Map.Entry<String, Object> entry : headerParams.entrySet()) {
                    httpPost.setHeader(entry.getKey(), entry.getValue().toString());
                }
            }
            StringEntity reqEntity = new StringEntity(param, contentType);
            httpPost.setEntity(reqEntity);
            httpPost.setConfig(getRequestConfig());
            responseBody = executeRequest(httpPost);
        } catch (IOException e) {
            log.error("httpclient doPost方法异常{}", e);
            return null;
        } finally {
            httpPost.releaseConnection();
        }
        return responseBody;
    }*/
    /**
     * @param uri
     * @param param
     * @param contentType 根据具体请求情况指定,比如json可以是 ContentType.APPLICATION_JSON
     * @return String
     * @description 带单string参数执行post方法
     */
    public static String doPost(String uri, String param, ContentType contentType) {
        String responseBody;
        HttpPost httpPost = new HttpPost(uri);
        try {
            StringEntity reqEntity = new StringEntity(param, contentType);
            httpPost.setEntity(reqEntity);
            httpPost.setConfig(getRequestConfig());
            responseBody = executeRequest(httpPost);
        } catch (IOException e) {
            logger.error("errorhttpclient doPost方法异常{}", e);
            return null;
        } finally {
            httpPost.releaseConnection();
        }
        return responseBody;
    }
    /**
     * @return RequestConfig
     * @description: 获得请求配置信息
     */
    private static RequestConfig getRequestConfig() {
        RequestConfig defaultRequestConfig = RequestConfig.custom()
                //.setCookieSpec(CookieSpecs.DEFAULT)
                .setExpectContinueEnabled(true)
                //.setTargetPreferredAuthSchemes(Arrays.asList(AuthSchemes.NTLM, AuthSchemes.DIGEST))
                //.setProxyPreferredAuthSchemes(Arrays.asList(AuthSchemes.BASIC))
                .build();
        return RequestConfig.copy(defaultRequestConfig)
                .setSocketTimeout(REQUEST_CONNECTION_TIMEOUT)
                .setConnectTimeout(REQUEST_SOCKET_TIMEOUT)
                .setConnectionRequestTimeout(REQUEST_CONNECTION_REQUEST_TIMEOUT)
                .build();
    }
    /**
     * @param method
     * @return String
     * @throws IOException
     * @description 通用执行请求方法
     */
    private static String executeRequest(HttpUriRequest method) throws IOException {
        ResponseHandler<String> responseHandler = new ResponseHandler<String>() {
            @Override
            public String handleResponse(final HttpResponse response) throws IOException {
                int status = response.getStatusLine().getStatusCode();
                String result;
                if (status >= HttpStatus.SC_OK && status < HttpStatus.SC_MULTIPLE_CHOICES) {
                    HttpEntity entity = response.getEntity();
                    result = entity != null ? EntityUtils.toString(entity) : null;
                    EntityUtils.consume(entity);
                    return result;
                } else {
                    throw new ClientProtocolException("Unexpected response status: " + status);
                }
            }
        };
        return getHttpClientInstance().execute(method, responseHandler);
    }
    /**
     * @return CloseableHttpClient
     * @description 单例获取httpclient实例
     */
    private static CloseableHttpClient getHttpClientInstance() {
        if (httpClient == null) {
            synchronized (CloseableHttpClient.class) {
                if (httpClient == null) {
                    httpClient = HttpClients.custom().setConnectionManager(initConfig()).setRetryHandler(getRetryHandler()).build();
                }
            }
        }
        return httpClient;
    }
    /**
     * @return HttpRequestRetryHandler
     * @description :获取重试handler
     */
    private static HttpRequestRetryHandler getRetryHandler() {
        // 请求重试处理
        return (exception, executionCount, context) -> {
            if (executionCount >= RETRY_COUNT) {
                // 假设已经重试了5次,就放弃
                return false;
            }
            if (exception instanceof NoHttpResponseException) {
                // 假设server丢掉了连接。那么就重试
                return true;
            }
            if (exception instanceof SSLHandshakeException) {
                // 不要重试SSL握手异常
                return false;
            }
            if (exception instanceof InterruptedIOException) {
                // 超时
                return false;
            }
            if (exception instanceof UnknownHostException) {
                // 目标server不可达
                return false;
            }
            if (exception instanceof SSLException) {
                // SSL握手异常
                return false;
            }
            HttpRequest request = HttpClientContext.adapt(context).getRequest();
            // 假设请求是幂等的,就再次尝试
            return !(request instanceof HttpEntityEnclosingRequest);
        };
    }
    /**
     * @return PoolingHttpClientConnectionManager
     * @description 初始化连接池等配置信息
     */
    private static PoolingHttpClientConnectionManager initConfig() {
        Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create()
                .register("http", PlainConnectionSocketFactory.INSTANCE)
                .register("https", new SSLConnectionSocketFactory(SSLContexts.createSystemDefault()))
                .build();
        PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(socketFactoryRegistry);
        /**
         * 以下参数设置含义分别为:
         * 1 是否立即发送数据,设置为true会关闭Socket缓冲,默认为false
         * 2 是否可以在一个进程关闭Socket后,即使它还没有释放端口,其它进程还可以立即重用端口
         * 3 接收数据的等待超时时间,单位ms
         * 4 关闭Socket时,要么发送完所有数据,要么等待多少秒后,就关闭连接,此时socket.close()是阻塞的
         * 5 开启监视TCP连接是否有效
         * 其中setTcpNoDelay(true)设置是否启用Nagle算法,设置true后禁用Nagle算法,默认为false(即默认启用Nagle算法)。
         * Nagle算法试图通过减少分片的数量来节省带宽。当应用程序希望降低网络延迟并提高性能时,
         * 它们可以关闭Nagle算法,这样数据将会更早地发 送,但是增加了网络消耗。 单位为:毫秒
         */
        SocketConfig socketConfig = SocketConfig.custom()
                .setTcpNoDelay(true)
                .setSoReuseAddress(true)
                .setSoTimeout(SOCKET_CONFIG_SO_TIMEOUT)
                //.setSoLinger(SOCKET_CONFIG_SO_LINGER)
                //.setSoKeepAlive(true)
                .build();
        connManager.setDefaultSocketConfig(socketConfig);
        connManager.setValidateAfterInactivity(VALIDATE_AFTER_IN_ACTIVITY);
        ConnectionConfig connectionConfig = ConnectionConfig.custom()
                .setMalformedInputAction(CodingErrorAction.IGNORE)
                .setUnmappableInputAction(CodingErrorAction.IGNORE)
                .setCharset(Consts.UTF_8)
                .build();
        connManager.setDefaultConnectionConfig(connectionConfig);
        connManager.setDefaultMaxPerRoute(DEFAULT_MAX_PER_ROUTE);
        connManager.setMaxTotal(MAX_TOTAL_CONNECTIONS);
        return connManager;
    }
}

+ 67 - 0
business/base-service/src/main/java/com/yihu/jw/utils/sfutils/SHAUtils.java

@ -0,0 +1,67 @@
package com.yihu.jw.utils.sfutils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.security.provider.SHA;
import java.security.MessageDigest;
/**
 * @className SHAUtils
 * @description  加密算法
 **/
public class SHAUtils {
    private static Logger logger = LoggerFactory.getLogger(SHAUtils.class);
    private static SHA instance = new SHA();
    private SHAUtils() {
    }
    public static SHA getInstance() {
        return instance;
    }
    public static String SHA1(String str) {
        return SHA(str,"SHA1");
    }
    public static String SHA512(String str) {
        return SHA(str,"SHA-512");
    }
    /**
     * SHA-1 加密
     *
     * @param str
     * @return
     */
    public static String SHA(String str,String algorithm) {
        if (str == null || str.length() == 0) {
            return null;
        }
        char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
        try {
            MessageDigest mdTemp = MessageDigest.getInstance(algorithm);
            mdTemp.update(str.getBytes("UTF-8"));
            byte[] md = mdTemp.digest();
            int j = md.length;
            char buf[] = new char[j * 2];
            int k = 0;
            for (byte byte0 : md) {
                buf[k++] = hexDigits[byte0 >>> 4 & 0xf];
                buf[k++] = hexDigits[byte0 & 0xf];
            }
            return new String(buf);
        } catch (Exception e) {
            logger.info("SHA 加密失败:{}",e);
            return null;
        }
    }
}

+ 191 - 0
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -28,6 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import javax.xml.soap.SAAJMetaFactory;
import java.security.acl.LastOwnerException;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -976,6 +978,17 @@ public class StatisticsEsService {
        return filesize + "%";
    }
    public String getTwoRange(int first, int second, int i) {
        if (second == 0 && first > 0) {
            return "100%";
        } else if (second == 0 && first == 0) {
            return "0%";
        }
        float size = (float) (first * 100) / second;
        DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
        String filesize = df.format(size);
        return filesize + "%";
    }
    public Double getDoubleRange(Double first, Double second, int i) {
        if (second == 0 && first > 0) {
@ -1723,5 +1736,183 @@ public class StatisticsEsService {
    }
    /**
     * 医生排班
     * @param startTime
     * @param endTime
     * @param index
     * @param level
     * @param area
     * @return
     * @throws Exception
     */
    public JSONObject getScheduleTotal(String startTime,String endTime,String index,Integer level, String area) throws Exception {
        JSONObject jsonObject = new JSONObject();
        String condition = "";
        if (SaveModel.cityLevel.equalsIgnoreCase(level.toString())){
            condition +="";
        }else if (SaveModel.OrgLevel.equalsIgnoreCase(level.toString())){
            condition +=" and dh.org_code ='"+area+"' ";
        }else if (SaveModel.townLevel.equalsIgnoreCase(level.toString())){
            condition +=" ";
        }else if (SaveModel.deptLevel.equalsIgnoreCase(level.toString())){
            condition +=" and dh.dept_code = '"+area+"'";
        }else if (SaveModel.doctorLevel.equalsIgnoreCase(level.toString())){
            condition +=" and dh.doctor_code = '"+area+"'";
        }
        String sql = "SELECT COUNT(*) total FROM `base_doctor_role` dr LEFT JOIN base_doctor_hospital dh ON dr.doctor_code = dh.doctor_code where dr.role_code='specialist' "+condition;
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        Long doctorCount = 0L;
        if (mapList!=null&&mapList.size()!=0){
            doctorCount = Long.parseLong(mapList.get(0).get("total").toString());
        }
        List<SaveModel> saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, SaveModel.interval_day);
        Set<String> set = new HashSet<>();
        Long days = 0L;
        for (SaveModel saveModel1:saveModels){
            if(saveModel1.getResult1()!=0){
                days+=1;
            }
        }
        List<SaveModel> saveModels1 = elasticsearchUtil.findDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, SaveModel.interval_day,SaveModel.doctorLevel);
        for (SaveModel saveModel1:saveModels1){
            if(saveModel1.getResult1()!=0){
                set.add(saveModel1.getDoctor());
            }
        }
        Integer total = set.size();
        jsonObject.put("rate",getTwoRange(total,doctorCount.intValue(),0));//排班比例
        jsonObject.put("doctorCount",doctorCount);
        jsonObject.put("days",days);
        jsonObject.put("total",total);
        return  jsonObject;
    }
    /**
     * 通用查询曲线
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param interval 1按日统计,2按周统计,3按月统计
     * @return
     * @throws Exception
     */
    public JSONObject getScheduleLine(String startDate, String endDate, String area, int level, String index,int interval) throws Exception {
        //问诊量
        JSONObject object = new JSONObject();
        if (interval==1){
            JSONArray array = dateTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL,null);
            object.put("data",array);
        }else if (interval==2){
            JSONArray array = weekTotalStatistics(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }else if (interval==3){
            JSONArray array = monthTotalStatistics2(startDate,endDate,area,level,index,null,SaveModel.timeLevel_ZL);
            object.put("data",array);
        }
        return object;
    }
    public JSONObject getScheduleList(String startTime,String endTime,String index,int level, String area, String lowLevel) throws Exception {
        JSONObject result1 = new JSONObject();
        List<SaveModel> total = elasticsearchUtil.findDateQuotaLevel0(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL,null, lowLevel);
        List<SaveModel> total1 = elasticsearchUtil.findDateQuotaLevel0AndPaibanList(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL,null, lowLevel);
        Map<String, Object> totalMap = new HashMap<>();
        String low_level = StringUtils.isEmpty(lowLevel) ? String.valueOf(level + 1) : lowLevel;
        List<String> codes = new ArrayList<>();
        for (SaveModel saveModel:total){
            for (SaveModel saveModel1:total1){
                if (SaveModel.doctorLevel.equals(low_level)) {
                    if (saveModel.getDoctor().equalsIgnoreCase(saveModel1.getDoctor())){
                        saveModel.setResult1(saveModel1.getResult1());
                        saveModel.setResult2(saveModel1.getResult2());
                        codes.add(saveModel1.getDoctor());
                    }
                } else if (SaveModel.deptLevel.equals(low_level)) {
                    if (saveModel.getDept().equalsIgnoreCase(saveModel1.getDept())){
                        saveModel.setResult1(saveModel1.getResult1());
                        saveModel.setResult2(saveModel1.getResult2());
                        codes.add(saveModel1.getDept());
                    }
                }else if (SaveModel.OrgLevel.equals(low_level)) {
                    if (saveModel.getHospital().equalsIgnoreCase(saveModel1.getHospital())){
                        saveModel.setResult1(saveModel1.getResult1());
                        saveModel.setResult2(saveModel1.getResult2());
                        codes.add(saveModel1.getHospital());
                    }
                }
            }
        }
        for (SaveModel saveModel:total){
            if (SaveModel.doctorLevel.equals(low_level)) {
                if (!codes.contains(saveModel.getDoctor())){
                    saveModel.setResult1(0.0);
                    saveModel.setResult2(0.0);
                }
            } else if (SaveModel.deptLevel.equals(low_level)) {
                if (!codes.contains(saveModel.getDept())){
                    saveModel.setResult1(0.0);
                    saveModel.setResult2(0.0);
                }
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                if (!codes.contains(saveModel.getHospital())){
                    saveModel.setResult1(0.0);
                    saveModel.setResult2(0.0);
                }
            }
        }
        for (SaveModel saveModel : total) {
            if (SaveModel.doctorLevel.equals(low_level)) {
                totalMap.put(saveModel.getDoctor(), saveModel);
            } else if (SaveModel.deptLevel.equals(low_level)) {
                totalMap.put(saveModel.getDept(), saveModel);
            }else if (SaveModel.OrgLevel.equals(low_level)) {
                totalMap.put(saveModel.getHospital(), saveModel);
            }
        }
        ;
        List<Map<String, Object>> resultMaps = new ArrayList<>();
        for (String key : totalMap.keySet()) {
            Map<String, Object> rs = new HashMap<>();
            SaveModel totalRs = (SaveModel) totalMap.get(key);
            if (totalRs == null) {
                continue;
            }
            //合并结果集
            Double totalNm = totalRs.getResult2();//总人数
            Double scoreNm = totalRs.getResult1();//总分数
            if (SaveModel.doctorLevel.equals(low_level)) {
                rs.put("name", totalRs.getDoctorName());
            } else if (SaveModel.deptLevel.equals(low_level)) {
                rs.put("name", totalRs.getDeptName());
            } else if (SaveModel.OrgLevel.equals(low_level)) {
                rs.put("name", totalRs.getHospitalName());
            }
            rs.put("total", totalNm);
            rs.put("scoreRate",getDoubleRange(scoreNm,totalNm,0));
            rs.put("code", key);
            resultMaps.add(rs);
        }
        //根据为回复数排序
        Collections.sort(resultMaps, new Comparator<Map<String, Object>>() {
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                return (Double) o1.get("total") < (Double) o2.get("total") ? 1 : ((Double) o1.get("total") == (Double) o2.get("total") ? 0 : -1);
            }
        });
        result1.put("resultList", resultMaps);
        return result1;
    }
}

+ 104 - 0
business/es-service/src/main/java/com/yihu/jw/es/util/ElasticsearchUtil.java

@ -377,6 +377,107 @@ public class ElasticsearchUtil {
    }
    /**
     * 按照医生人数统计-不重复
     * 获取所有指标的增量、到达量
     * 备注:原来接口的一级指标对应现在的
     *
     * @param startDate 开始时间
     * @param endDate   结束时间
     * @param area      区域code
     * @param level     等级
     * @param index     指标
     * @param timeLevel 1增量 2到达量
     * @param interval  1日 2周 3月
     * @param lowLevel  下一级区域等级
     * @return
     * @throws Exception
     */
    public List findDateQuotaLevel0AndPaibanList(String startDate, String endDate, String area, int level, String index, String timeLevel, String interval, String lowLevel) throws Exception {
        //时间格式转换  yyyy-MM-dd转成 2017-07-17T00:00:00+0800
        if (StringUtils.isNotEmpty(startDate)) {
            if (startDate.length() > 10) {
                startDate = changeTime(startDate);
            } else {
                startDate = changeDate(startDate);
            }
        }
        if (StringUtils.isNotEmpty(endDate)) {
            if (endDate.length() > 10) {
                endDate = changeTime(endDate);
            } else {
                endDate = changeDate(endDate);
            }
        }
        StringBuffer sql = new StringBuffer();
        StringBuffer groupBy = new StringBuffer();
        String low_level = level + "";
        if (StringUtils.isNotEmpty(lowLevel)) {
            low_level = lowLevel;
        }
        if (SaveModel.doctorLevel.equals(low_level)) {
            sql.append("select doctor,doctorName,count(doctor) result1, count(doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by doctor,doctorName");
        }else if (SaveModel.deptLevel.equals(low_level)) {
            sql.append("select dept,deptName,count(DISTINCT doctor) result1, count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by dept,deptName");
        } else if (SaveModel.OrgLevel.equals(low_level)) {
            sql.append("select hospital,hospitalName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by hospital,hospitalName");
        } else if (SaveModel.townLevel.equals(low_level)) {
            sql.append("select town,townName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by town,townName");
        } else if (SaveModel.cityLevel.equals(low_level)) {
            sql.append("select city,cityName,count(DISTINCT doctor) result1,count(DISTINCT doctor) result2 from " + esIndex + " where ");
            groupBy.append("  group by city,cityName");
        }
        if (StringUtils.isNotEmpty(area)) {
            if (SaveModel.doctorLevel.equals(level + "")) {
                sql.append(" doctor='" + area + "'");
            }else if (SaveModel.deptLevel.equals(level + "")) {
                sql.append(" dept='" + area + "'");
            } else if (SaveModel.OrgLevel.equals(level + "")) {
                sql.append(" hospital='" + area + "'");
            } else if (SaveModel.townLevel.equals(level + "")) {
                sql.append(" town='" + area + "'");
            } else if (SaveModel.cityLevel.equals(level + "")) {
                sql.append(" city='" + area + "'");
            }
            sql.append(" and ");
        }
//        sql.append(" quotaCode='" + index + "'  ");
        sql.append(" quotaCode in(" + index + ")  ");
        sql.append(" and timeLevel='" + timeLevel + "'  ");
        sql.append(" and areaLevel='6'");
        sql.append(" and result1<>0 ");
        if (StringUtils.isNotEmpty(startDate)) {
            sql.append(" and quotaDate>='" + startDate + "'");
        }
        if (StringUtils.isNotEmpty(endDate)) {
            sql.append(" and quotaDate<='" + endDate + "'");
        }
        //根据时间维度分组
        if (StringUtils.isNotEmpty(interval)) {
            if (SaveModel.interval_month.equals(interval)) {
                groupBy.append(" ,date_histogram(field='quotaDate','interval'='month','time_zone'='+08:00','alias'='quotaDate') ");
            } else if (SaveModel.interval_week.equals(interval)) {
                groupBy.append(" ,date_histogram(field='quotaDate','interval'='week','time_zone'='+08:00','alias'='quotaDate') ");
            } else if (SaveModel.interval_day.equals(interval)) {
                groupBy.append(" ,date_histogram(field='quotaDate','interval'='1d','time_zone'='+08:00','alias'='quotaDate') ");
            }
        }
        sql.append(groupBy);
        return excute(sql.toString(), SaveModel.class, "", "");
    }
    /**
     * 一级指标查询列表
     * 获取一级指标的增量、到达量
@ -832,6 +933,9 @@ public class ElasticsearchUtil {
        }
    }
    /**
     * 1级维度
     * 查询某一天某一个1级维度的某个1级维度下的指标 例如查询65岁以上患者

+ 60 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/sf/SfConfigDO.java

@ -0,0 +1,60 @@
package com.yihu.jw.entity.sf;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2020/2/27.
 */
@Entity
@Table(name = "sf_config")
public class SfConfigDO extends UuidIdentityEntity {
    private String host;
    private String port;
    private String hospitalCode;
    private String secretKey;
    private String remark;
    public String getHost() {
        return host;
    }
    public void setHost(String host) {
        this.host = host;
    }
    public String getPort() {
        return port;
    }
    public void setPort(String port) {
        this.port = port;
    }
    public String getHospitalCode() {
        return hospitalCode;
    }
    public void setHospitalCode(String hospitalCode) {
        this.hospitalCode = hospitalCode;
    }
    public String getSecretKey() {
        return secretKey;
    }
    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
}

+ 5 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -344,6 +344,8 @@ public class BaseHospitalRequestMapping {
        public static final String setRecord = "/setRecord";
        public static final String findPatientRecord = "/findPatientRecord";
        public static final String findDoctorByName = "/findDoctorByName";
    }
@ -654,6 +656,9 @@ public class BaseHospitalRequestMapping {
        public static final String scoreHead = "/scoreHead";
        public static final String scoreLine = "/scoreLine";
        public static final String scoreList = "/scoreList";
        public static final String scheduleHead = "/scheduleHead";
        public static final String scheduleLine = "/scheduleLine";
        public static final String scheduleList = "/scheduleList";
    }

+ 7 - 1
gateway/ag-basic/src/main/resources/bootstrap.yml

@ -33,7 +33,13 @@ spring:
    config:
      uri: ${wlyy-spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy-spring.config.label:jwdev}
---
spring:
  profiles: qytest
  cloud:
    config:
      uri: ${wlyy-spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy-spring.config.label:jwdev}
---
spring:
  profiles: jwprod

+ 7 - 0
server/svr-authentication/src/main/resources/bootstrap.yml

@ -22,6 +22,13 @@ spring:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: qytest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: jwprod
  cloud:

+ 2 - 1
server/svr-configuration/src/main/resources/application.yml

@ -15,12 +15,13 @@ eureka:
    healthcheck:
      enabled: false #启动监控检查,
    serviceUrl: # 默认正式线地址
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka  # 测试环境
#      defaultZone: http://jw:jkzl@172.16.1.42:8761/eureka # 中山医院
#      defaultZone: http://jw:jkzl@192.0.33.26:8762/eureka
#      defaultZone: http://jw:jkzl@192.168.33.199:8761/eureka
#      defaultZone: http://jw:jkzl@172.16.100.63:8761/eureka  # 心脏中心外网
#      defaultZone: http://jw:jkzl@192.168.120.210:8761/eureka  # 心脏中心外网
      defaultZone: http://jw:jkzl@192.168.33.199:8761/eureka  # 眼科医院
#      defaultZone: http://jw:jkzl@192.168.33.199:8761/eureka  # 眼科医院
  instance:
    #eurika使用IP不使用host
    prefer-ip-address: true

+ 12 - 1
server/svr-configuration/src/main/resources/bootstrap.yml

@ -26,7 +26,18 @@ spring:
          uri: ${wlyy.spring.config.git.uri:http://192.168.1.220:10080/Amoy2/wlyy2.0.config.git}
          basedir: /usr/local/wlyy2.0-config
        default-label: ${wlyy.spring.config.git.label:jwdev}
---
spring:
  profiles: qytest
##git配置
  cloud:
    config:
      failFast: true #启动快速失败 即链接不到配置服务就启动失败
      server:
        git:
          uri: ${wlyy.spring.config.git.uri:http://192.168.1.220:10080/Amoy2/wlyy2.0.config.git}
          basedir: /usr/local/wlyy2.0-config
        default-label: ${wlyy.spring.config.git.label:jwdev}
---
spring:
  profiles: jwprod

+ 1 - 1
svr/svr-internet-hospital-entrance/pom.xml

@ -12,7 +12,7 @@
    <groupId>com.yihu.jw</groupId>
    <artifactId>svr-internet-hospital-entrance</artifactId>
    <packaging>war</packaging>
    <packaging>jar</packaging>
    <version>${parent.version}</version>
    <dependencies>

+ 2 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/third/SfRoutePushController.java

@ -50,4 +50,6 @@ public class SfRoutePushController extends EnvelopRestEndpoint {
            return failed(failedxml);
        }
    }
}

+ 11 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/expressage/ExpressageEndpoint.java

@ -181,4 +181,15 @@ public class ExpressageEndpoint extends EnvelopRestEndpoint {
    }
    @RequestMapping(value="/test",method = RequestMethod.GET)
    @ApiOperation("test")
    public Envelop test(String test){
        try {
            sfexpressService.test();
            return success("ok");
        }catch (Exception e) {
            return failed("异常," + e.getMessage());
        }
    }
}

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

@ -931,4 +931,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                     @RequestParam(value = "ybcard",required = false)String ybcard)throws Exception{
        return success(prescriptionService.findPatientRecord(idcard,patient,admitNum,ybcard));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findDoctorByName)
    @ApiOperation(value = "获取医生信息")
    public ListEnvelop findDoctorByName(@ApiParam(name = "name", value = "医生名称")
                                        @RequestParam(value = "name",required = false)String name) {
        return success(prescriptionService.findDoctorByName(name));
    }
}

+ 60 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/statistics/EsStatisticsEndpoint.java

@ -443,4 +443,64 @@ public class EsStatisticsEndpoint extends EnvelopRestEndpoint {
        return success(result);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.scheduleHead)
    @ApiOperation(value = "排班头部")
    public ObjEnvelop getScheduleTotal(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getScheduleTotal(startDate, endDate,index,level,area);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.scheduleLine)
    @ApiOperation(value = "排班曲线")
    public ObjEnvelop getScheduleLine(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = true)Integer interval) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getScheduleLine(startDate, endDate,area,level,index,interval);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
    @GetMapping(value = BaseHospitalRequestMapping.Statistics.scheduleList)
    @ApiOperation(value = "排班表格")
    public ObjEnvelop getScheduleList(
            @RequestParam(required = true) String startDate,
            @RequestParam(required = true) String endDate,
            @RequestParam(required = true) String area,
            @RequestParam(required = true) int level,
            @RequestParam(required = true) String index,
            @RequestParam(required = true)String levelCode) {
        JSONObject result = new JSONObject();
        try {
            result= statisticsEsService.getScheduleList(startDate, endDate,index,level,area,levelCode);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return success(result);
    }
}

+ 10 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/version/VersionEndpoint.java

@ -7,10 +7,13 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.version.service.AppVersionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections.map.HashedMap;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
 * Created by Trick on 2020/2/24.
 */
@ -44,13 +47,13 @@ public class VersionEndpoint extends EnvelopRestEndpoint {
                    return success("已是最新版本!");
                }
            } else {
                JSONObject json = new JSONObject();
                json.put("version_int", temp.getVersionInt());
                json.put("version_str", temp.getVersionStr());
                json.put("url", temp.getUrl());
                json.put("info", temp.getInfo());
                json.put("size", temp.getSize());
                return success("读取版本号成功!", json);
                Map<String,Object> map = new HashedMap();
                map.put("version_int", temp.getVersionInt());
                map.put("version_str", temp.getVersionStr());
                map.put("url", temp.getUrl());
                map.put("info", temp.getInfo());
                map.put("size", temp.getSize());
                return success("读取版本号成功!", map);
            }
    }

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

@ -22,6 +22,13 @@ spring:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: qytest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring: