Переглянути джерело

Merge branch 'master' of http://192.168.1.220:10080/EHR/svr-eip-admin

huangzhiyong 6 роки тому
батько
коміт
8a1ad10e26

+ 5 - 31
pom.xml

@ -9,7 +9,6 @@
    </parent>
    <artifactId>svr-eip-admin</artifactId>
    <version>1.3.0</version>
    <packaging>war</packaging>
    <name>svr-eip-admin</name>
    <description>EIP微服务</description>
@ -142,35 +141,11 @@
            <artifactId>jxl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <!--=============tilesJSP布局框架 start =============-->
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-extras</artifactId>
            <version>${org.apache.tiles-version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>commons-lang</artifactId>
                    <groupId>commons-lang</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <version>${org.apache.tiles-version}</version>
        </dependency>
        <!--=============tiles end =============-->
        <dependency>
            <groupId>org.apache.xmlgraphics</groupId>
            <artifactId>fop</artifactId>
@ -249,9 +224,8 @@
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-ui-swagger</artifactId>
            <scope>compile</scope>
        </dependency>
        <!-- swagger end -->
        <!--   jxl导出工具-->
        <dependency>
            <groupId>org.apache.poi</groupId>
@ -269,7 +243,6 @@
                </exclusion>
            </exclusions>
        </dependency>
        <!-- swagger end -->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
@ -280,7 +253,6 @@
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>hos-web-framework</artifactId>
            <version>${hos-web-framework}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
@ -319,12 +291,10 @@
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-data-fastdfs</artifactId>
            <version>${version.ehr}</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.ehr</groupId>
            <artifactId>commons-rest-model</artifactId>
            <version>${version.ehr}</version>
            <exclusions>
                <exclusion>
                    <artifactId>poi-ooxml</artifactId>
@ -348,6 +318,10 @@
            <artifactId>commons-data-redis</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-mongodb</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 7 - 15
src/main/java/com/yihu/hos/HosAdminApplication.java

@ -1,13 +1,13 @@
package com.yihu.hos;
import com.yihu.hos.interceptor.WebMvcInterceptor;
import com.yihu.hos.web.framework.util.springutil.SpringBeanUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
@ -16,12 +16,11 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.data.web.config.EnableSpringDataWebSupport;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@EnableWebMvc
@EnableAsync
//@EnableCaching
@EnableDiscoveryClient
@EnableFeignClients
@EnableEurekaClient
@ -30,27 +29,20 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
@SpringBootApplication(scanBasePackages={"com.yihu.ehr","com.yihu.hos"})
@EnableAutoConfiguration(exclude = {MultipartAutoConfiguration.class,
        SecurityAutoConfiguration.class})
public class HosAdminApplication extends WebMvcConfigurerAdapter {
public class HosAdminApplication extends SpringBootServletInitializer {
    public static void main(String[] args) throws Exception {
        SpringApplication application = new SpringApplication(HosAdminApplication.class);
        ApplicationContext run = application.run(args);
//        SpringBeanUtil.setContext(run);
    }
    // 增加拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(webMvcInterceptor());
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(HosAdminApplication.class);
    }
    @Bean
    public SpringBeanUtil springBeanUtil(){return new SpringBeanUtil();}
    @Bean
    public WebMvcInterceptor webMvcInterceptor() {
        return new WebMvcInterceptor();
    }
}

+ 18 - 7
src/main/java/com/yihu/hos/config/WebMvcConfig.java

@ -2,8 +2,10 @@ package com.yihu.hos.config;
import com.yihu.hos.interceptor.WebMvcInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.web.filter.HiddenHttpMethodFilter;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
@ -12,17 +14,26 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 * @vsrsion 1.0
 * Created at 2016/12/26.
 */
//@Configurable
@EnableWebMvc
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {
    @Bean
    public WebMvcInterceptor webMvcInterceptor() {
        return new WebMvcInterceptor();
    }
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new WebMvcInterceptor());
        registry.addInterceptor(webMvcInterceptor());
    }
    @Bean
    public HiddenHttpMethodFilter hiddenHttpMethodFilter() {
        HiddenHttpMethodFilter hiddenHttpMethodFilter= new HiddenHttpMethodFilter();
        return hiddenHttpMethodFilter;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("swagger-ui.html")
                .addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }
}

+ 8 - 8
src/main/java/com/yihu/hos/ehr/standard/cdatype/controller/CdaTypeEndPoint.java

@ -44,7 +44,7 @@ public class CdaTypeEndPoint extends EnvelopRestEndPoint {
    }
    @RequestMapping(value = ServiceApi.Standards.TypesChildren, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.TypesChildren,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "根据父级类别获取父级类别所在以下所有子集类别(包括当前父级列表)")
    public List<MCDAType> getChildIncludeSelfByParentIdsAndKey(
            @ApiParam(name = "patient_ids", value = "父级id")
@ -83,7 +83,7 @@ public class CdaTypeEndPoint extends EnvelopRestEndPoint {
//        return (List<MCDAType>)convertToModels(cdaTypeList,new ArrayList<MCDAType>(cdaTypeList.size()),MCDAType.class,"");
//    }
    @RequestMapping(value = ServiceApi.Standards.Types, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.Types,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "标准类别分页搜索")
    public Collection<MCDAType> searchType(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,name,secret,url,createTime")
@ -104,7 +104,7 @@ public class CdaTypeEndPoint extends EnvelopRestEndPoint {
        return convertToModels(list, new ArrayList<>(list.size()), MCDAType.class, fields);
    }
    @RequestMapping(value = ServiceApi.Standards.NoPageTypes, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.NoPageTypes,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "标准字典不分页搜索")
    public List<MCDAType> searchSourcesWithoutPaging(
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
@ -115,7 +115,7 @@ public class CdaTypeEndPoint extends EnvelopRestEndPoint {
    @RequestMapping(value = ServiceApi.Standards.Type, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.Type,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "根据id获取CDAType")
    public MCDAType getCdaTypeById(
            @ApiParam(name = "id", value = "id")
@ -127,7 +127,7 @@ public class CdaTypeEndPoint extends EnvelopRestEndPoint {
    @RequestMapping(value = ServiceApi.Standards.Types, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestMapping(value = ServiceApi.Standards.Types, method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "新增CDAType")
    public MCDAType saveCDAType(
            @ApiParam(name = "model", value = "model")
@ -141,7 +141,7 @@ public class CdaTypeEndPoint extends EnvelopRestEndPoint {
    }
    @RequestMapping(value = ServiceApi.Standards.Type,method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestMapping(value = ServiceApi.Standards.Type,method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_UTF8_VALUE,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改CDAType")
    public MCDAType updateCDAType(
            @ApiParam(name = "id", value = "编号")
@ -185,7 +185,7 @@ public class CdaTypeEndPoint extends EnvelopRestEndPoint {
        return cdaTypeManager.deleteCdaType(childrenIds);
    }
    @RequestMapping(value = ServiceApi.Standards.TypeOther, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.TypeOther, produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.GET)
    @ApiOperation(value = "获取cdaType列表(不包含本身)")
    public List<MCDAType> getOtherCDAType(
            @ApiParam(name = "id", value = "cdaType编号")
@ -195,7 +195,7 @@ public class CdaTypeEndPoint extends EnvelopRestEndPoint {
    }
    @RequestMapping(value = ServiceApi.Standards.TypeParent, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.TypeParent, produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.GET)
    @ApiOperation(value = "根据当前类别获取自己的父级以及同级以及同级所在父级类别列表")
    public List<MCDAType> getCdaTypeExcludeSelfAndChildren(
            @ApiParam(name = "id", value = "id")

+ 6 - 5
src/main/java/com/yihu/hos/ehr/standard/cdaversion/controller/VersionEndPoint.java

@ -12,6 +12,7 @@ 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.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@ -57,7 +58,7 @@ public class VersionEndPoint extends ExtendEndPoint<MSTDVersion> {
        return cdaVersion;
    }
    @RequestMapping(value = ServiceApi.Standards.Versions, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.Versions,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "适配采集标准")
    public Collection<MSTDVersion> searchCDAVersions(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "version,versionName,commitTime,baseVersion,inStage")
@ -93,7 +94,7 @@ public class VersionEndPoint extends ExtendEndPoint<MSTDVersion> {
    //新增标准版本的最新版本信息
    @RequestMapping(value = ServiceApi.Standards.Versions, method = RequestMethod.POST)
    @RequestMapping(value = ServiceApi.Standards.Versions,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.POST)
    @ApiOperation(value = "新增cda版本")
    public MSTDVersion addVersion(
            @ApiParam(name = "userLoginCode", value = "用户登录名")
@ -157,7 +158,7 @@ public class VersionEndPoint extends ExtendEndPoint<MSTDVersion> {
    }
    @RequestMapping(value = ServiceApi.Standards.Version, method = RequestMethod.PUT)
    @RequestMapping(value = ServiceApi.Standards.Version,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.PUT)
    @ApiOperation(value = "修改版本信息")
    public MSTDVersion updateVersion(
            @ApiParam(name = "version", value = "版本号", defaultValue = "")
@ -200,7 +201,7 @@ public class VersionEndPoint extends ExtendEndPoint<MSTDVersion> {
        return num > 0;
    }
    @RequestMapping(value = ServiceApi.Standards.Version, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.Version,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "获取版本信息")
    public MSTDVersion getVersion(
            @ApiParam(name = "version", value = "版本号", defaultValue = "")
@ -219,7 +220,7 @@ public class VersionEndPoint extends ExtendEndPoint<MSTDVersion> {
    }
    @RequestMapping(value = ServiceApi.Standards.VersionLatest, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.VersionLatest,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "获取最新版本")
    public MSTDVersion getLatestVersion()throws Exception {
        STDVersion cdaVersion = versionService.getLatestVersion();

+ 10 - 10
src/main/java/com/yihu/hos/ehr/standard/datasets/controller/DataSetEndPoint.java

@ -39,7 +39,7 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
    private StdDatasetService dataSetService;
    @RequestMapping(value = ServiceApi.Standards.DataSets, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.DataSets,produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.GET)
    @ApiOperation(value = "查询数据集的方法")
    public Collection<MStdDataSet> searchDataSets(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "")
@ -49,9 +49,9 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) int size,
            @RequestParam(value = "size", required = false) Integer size,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) int page,
            @RequestParam(value = "page", required = false) Integer page,
            @ApiParam(name = "version", value = "版本", defaultValue = "")
            @RequestParam(value = "version") String version,
            HttpServletRequest request,
@ -65,7 +65,7 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
    }
    @RequestMapping(value = ServiceApi.Standards.NoPageDataSets, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.NoPageDataSets, produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.GET)
    @ApiOperation(value = "标准数据集不分页搜索")
    public Collection<MStdDataSet> searchSourcesWithoutPaging(
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
@ -106,7 +106,7 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
    }
    @RequestMapping(value = ServiceApi.Standards.DataSet, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.DataSet,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "获取数据集信息")
    public MStdDataSet getDataSet(
            @ApiParam(name = "id", value = "数据集编号", defaultValue = "")
@ -117,7 +117,7 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
        return getModel(dataSetService.retrieve(StdDataSetModel.class,ver.getDataSetTableName() ,id));
    }
    @RequestMapping(value = ServiceApi.Standards.DataSetsIds, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.DataSetsIds, produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.GET)
    @ApiOperation(value = "根据数据集ids(用逗号隔开)获取数据集信息")
    public Collection<MStdDataSet> getDataSets(
            @ApiParam(name = "ids", value = "数据集编号", defaultValue = "")
@ -128,7 +128,7 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
        return convertToModels(list, new ArrayList<>(list.size()), MStdDataSet.class, "");
    }
    @RequestMapping(value = ServiceApi.Standards.DataSets, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestMapping(value = ServiceApi.Standards.DataSets, method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "新增数据集信息")
    public MStdDataSet saveDataSet(
            @ApiParam(name = "version", value = "标准版本", defaultValue = "")
@ -146,7 +146,7 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
    }
    @RequestMapping(value = ServiceApi.Standards.DataSet, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestMapping(value = ServiceApi.Standards.DataSet, method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_UTF8_VALUE,consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "修改数据集信息")
    public MStdDataSet updateDataSet(
            @ApiParam(name = "version", value = "标准版本", defaultValue = "")
@ -171,7 +171,7 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
    }
    @RequestMapping(value = ServiceApi.Standards.DataSetsName, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.DataSetsName,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "获取数据集 id-name : map集")
    public Map<Long,String> getDataSetMapByIds(
            @ApiParam(name = "version", value = "版本号", defaultValue = "")
@ -200,7 +200,7 @@ public class DataSetEndPoint extends ExtendEndPoint<MStdDataSet> {
        return true;
    }
    @RequestMapping(value = ServiceApi.Standards.AdaptMeta, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.AdaptMeta,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "获取ehr适配的数据元", notes = "获取ehr适配的数据元")
    public List<Map<String, Object>> getEhrAdapterMetadata( @RequestParam(value = "version")String version){
        return dataSetService.getEhrAdapterMetadata(version);

+ 6 - 6
src/main/java/com/yihu/hos/ehr/standard/datasets/controller/MetaDataEndPoint.java

@ -47,7 +47,7 @@ public class MetaDataEndPoint extends ExtendEndPoint<MStdMetaData> {
    private StdMetadataService metaDataService;
    @RequestMapping(value = ServiceApi.Standards.MetaDatas, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.MetaDatas,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "查询数据元")
    public Collection<MStdMetaData> searchMetaDatas(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "")
@ -115,7 +115,7 @@ public class MetaDataEndPoint extends ExtendEndPoint<MStdMetaData> {
    }
    @RequestMapping(value = ServiceApi.Standards.MetaData, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.MetaData,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "获取数据元")
    public MStdMetaData getMetaData(
            @ApiParam(name = "id", value = "数据元编号", defaultValue = "")
@ -126,7 +126,7 @@ public class MetaDataEndPoint extends ExtendEndPoint<MStdMetaData> {
        return getModel(metaDataService.retrieve(StdMetaDataModel.class,ver.getMetaDataTableName(),id));
    }
    @RequestMapping(value = ServiceApi.Standards.MetaDatasWithDataSet, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.MetaDatasWithDataSet,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.GET)
    @ApiOperation(value = "根据数据集id获取数据元")
    public Collection<MStdMetaData> getMetaDataByDataSetId(
            @ApiParam(name = "data_set_id", value = "数据元编号", defaultValue = "")
@ -137,7 +137,7 @@ public class MetaDataEndPoint extends ExtendEndPoint<MStdMetaData> {
        return convertToModels(list, new ArrayList<>(list.size()), MStdMetaData.class, "");
    }
    @RequestMapping(value = ServiceApi.Standards.MetaData, method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestMapping(value = ServiceApi.Standards.MetaData, method = RequestMethod.PUT,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新数据元")
    public MStdMetaData updataMetaSet(
            @ApiParam(name = "version", value = "版本", defaultValue = "")
@ -158,7 +158,7 @@ public class MetaDataEndPoint extends ExtendEndPoint<MStdMetaData> {
    }
    @RequestMapping(value = ServiceApi.Standards.MetaDatas, method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @RequestMapping(value = ServiceApi.Standards.MetaDatas, method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "新增数据元")
    public MStdMetaData saveMetaSet(
            @ApiParam(name = "version", value = "版本", defaultValue = "")
@ -200,7 +200,7 @@ public class MetaDataEndPoint extends ExtendEndPoint<MStdMetaData> {
    }
    @RequestMapping(value = ServiceApi.Standards.MetaDatasName, method = RequestMethod.POST)
    @RequestMapping(value = ServiceApi.Standards.MetaDatasName,produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.POST)
    @ApiOperation(value = "获取数据元 id-name : map集")
    public Map<Long,Object> getMetaDataMapByIds(
            @ApiParam(name = "parmModel", value = "参数模型", defaultValue = "")

+ 1 - 1
src/main/java/com/yihu/hos/ehr/standard/document/controller/DocumentEndPoint.java

@ -258,7 +258,7 @@ public class DocumentEndPoint extends ExtendEndPoint<MCDADocument> {
        return list;
    }
    @RequestMapping(value = ServiceApi.Standards.DocumentDataSetList, method = RequestMethod.GET)
    @RequestMapping(value = ServiceApi.Standards.DocumentDataSetList,produces = MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.GET)
    Map<String,List<MCdaDataSet>> getCDADataSetByCDAIdList(
            @RequestParam(value = "version") String version,
            @RequestParam(value = "document_Id") String[] cdaDocumentId){

+ 40 - 9
src/main/java/com/yihu/hos/standard/controller/AdapterCenterEndPoint.java

@ -6,12 +6,17 @@ import com.yihu.hos.standard.model.adapter.*;
import com.yihu.hos.standard.service.adapter.*;
import com.yihu.hos.web.framework.model.standard.AdapterVersion;
import com.yihu.hos.web.framework.util.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.sf.json.JSONArray;
import net.sf.json.JsonConfig;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@ -27,6 +32,7 @@ import java.util.List;
@RestController("AdapterCenterEndPoint")
@RequestMapping(value = MicroServices.ApiVersion.Version1_0+"/adapterCenter")
@Api(protocols = "https", description = "适配数据管理", tags = {"适配数据管理"})
public class AdapterCenterEndPoint extends BaseController {
    @Autowired
    private AdapterSchemeService adapterSchemeService;
@ -40,8 +46,10 @@ public class AdapterCenterEndPoint extends BaseController {
    private AdapterDictService adapterDictService;
    @Autowired
    private AdapterDictEntryService adapterDictEntryService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @RequestMapping("/schema/list")
    @RequestMapping(value="/schema/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取版本号列表",  produces = "application/json", notes = "获取版本号列表")
    public String getSchema(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                              @RequestParam(value = "filters", required = false) String filters) throws ParseException {
@ -51,7 +59,7 @@ public class AdapterCenterEndPoint extends BaseController {
    }
    @RequestMapping("/version/list")
    @RequestMapping(value="/version/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取版本号列表",  produces = "application/json", notes = "获取版本号列表")
    public String getVersions(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                              @RequestParam(value = "filters", required = false) String filters) throws ParseException {
@ -62,7 +70,7 @@ public class AdapterCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping("/dataset/list")
    @RequestMapping(value="/dataset/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取适配数据集列表",  produces = "application/json", notes = "获取适配数据集列表")
    public String getDatasetList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                             @RequestParam(value = "filters", required = false) String filters,
@ -73,7 +81,7 @@ public class AdapterCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping("/metadata/list")
    @RequestMapping(value = "/metadata/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取适配数据元列表",  produces = "application/json", notes = "获取适配数据元列表")
    public String getMetadataList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                          @RequestParam(value = "filters", required = false) String filters,
@ -84,7 +92,7 @@ public class AdapterCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping("/dict/list")
    @RequestMapping(value = "/dict/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取标准字典列表",  produces = "application/json", notes = "获取标准字典列表")
    public String getDictList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                                  @RequestParam(value = "filters", required = false) String filters,
@ -95,7 +103,7 @@ public class AdapterCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping("/dictItem/list")
    @RequestMapping(value = "/dictItem/list", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "获取标准字典项列表",  produces = "application/json", notes = "获取标准字典项列表")
    public String getDictItemList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                                  @RequestParam(value = "filters", required = false) String filters,
@ -106,8 +114,7 @@ public class AdapterCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping("/dataset/pageList")
    @RequestMapping(value="/dataset/pageList", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "分页获取适配数据集列表",  produces = "application/json", notes = "分页获取适配数据集列表")
    public Collection<AdapterDatasetModel> datasetPageList(
            @ApiParam(name = "version", value = "版本", defaultValue = "")
@ -131,7 +138,7 @@ public class AdapterCenterEndPoint extends BaseController {
        return convertToModels(ls, new ArrayList<>(ls.size()), AdapterDatasetModel.class, fields);
    }
    @RequestMapping("/metadata/pageList")
    @RequestMapping(value="/metadata/pageList", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "分页获取适配数据元列表",  produces = "application/json", notes = "分页获取适配数据元列表")
    public Collection<AdapterMetadataModel> metadataPageList(
            @ApiParam(name = "version", value = "版本", defaultValue = "")
@ -156,5 +163,29 @@ public class AdapterCenterEndPoint extends BaseController {
    }
    @RequestMapping(value="/last/adapterVersion" ,method = RequestMethod.GET)
    @ApiOperation(value = "获取2家机构适配的最新版本号",  notes = "获取2家机构适配的最新版本号")
    public String getLastAdapterVersion(
                            @ApiParam(name = "originOrgCode", value = "源机构编码[eip的机构表]如,jkzl", defaultValue = "")
                            @RequestParam(value = "originOrgCode") String originOrgCode,
                            @ApiParam(name = "targetOrgCode", value = "目标机构编码[eip的机构表],如上传 江西省平台的机构编码", defaultValue = "")
                            @RequestParam(value = "targetOrgCode") String targetOrgCode){
        String sql = String.format("select id from adapter_scheme where adapter_publisher_org_code='%s' and std_publisher_org_code='%s'",originOrgCode,targetOrgCode);
        List<Long> idList = jdbcTemplate.queryForList(sql,Long.class);
        String version = "";
        if(CollectionUtils.isNotEmpty(idList)){
            String ids = "";
            for(Long id:idList){
                ids+=","+id;
            }
            ids = ids.substring(1,ids.length());
            List<String> versions = jdbcTemplate.queryForList("select version from adapter_scheme_version where scheme_id in ("+ids+") and publish_status=1 order by publish_time desc",String.class);
            if(CollectionUtils.isNotEmpty(versions)){
                version = versions.get(0);
            }
        }
        return version;
    }
}

+ 1 - 1
src/main/java/com/yihu/hos/standard/controller/StandardController.java

@ -199,7 +199,7 @@ public class StandardController extends BaseController {
    @RequestMapping(value = "/getLastStandByOrgCode", method = RequestMethod.GET)
    @ApiOperation(value = "获取某个机构已发布的最新版本号", response = DictionaryResult.class,  notes = "获取某个机构已发布的最新版本号")
    @ApiOperation(value = "获取某个机构已发布的最新版本号",  notes = "获取某个机构已发布的最新版本号")
    public String getLastStandByOrgCode(@ApiParam(value="机构code")
            @RequestParam(value = "orgCode") String orgCode){
        String ver = standardService.getLastStandByOrgCode(orgCode);

+ 85 - 14
src/main/java/com/yihu/hos/standard/controller/StdCenterEndPoint.java

@ -4,6 +4,7 @@ import com.yihu.hos.config.JsonDateValueProcessor;
import com.yihu.hos.core.constants.MicroServices;
import com.yihu.hos.standard.model.standard.*;
import com.yihu.hos.standard.service.standard.*;
import com.yihu.hos.web.framework.model.Envelop;
import com.yihu.hos.web.framework.model.standard.StandardVersion;
import com.yihu.hos.web.framework.util.controller.BaseController;
import io.swagger.annotations.Api;
@ -52,7 +53,7 @@ public class StdCenterEndPoint extends BaseController {
    private String defaultOrgCode;
    @RequestMapping(value="/stdInfo/list",method = RequestMethod.GET)
    @RequestMapping(value="/stdInfo/list",method = RequestMethod.GET,produces = "application/json")
    @ApiOperation(value = "获取版本列表",  produces = "application/json", notes = "获取版本列表")
    public String getStdInfo(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                              @RequestParam(value = "filters", required = false) String filters) throws ParseException {
@ -62,7 +63,7 @@ public class StdCenterEndPoint extends BaseController {
    }
    @RequestMapping(value="/version/list",method = RequestMethod.GET)
    @RequestMapping(value="/version/list",method = RequestMethod.GET,produces = "application/json")
    @ApiOperation(value = "获取版本号列表",  produces = "application/json", notes = "获取版本号列表")
    public String getVersions(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                                 @RequestParam(value = "filters", required = false) String filters) throws ParseException {
@ -73,7 +74,7 @@ public class StdCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping(value="/dataset/list",method = RequestMethod.GET)
    @RequestMapping(value="/dataset/list",method = RequestMethod.GET,produces = "application/json")
    @ApiOperation(value = "获取数据集列表",  produces = "application/json", notes = "获取数据集列表")
    public String getDatasetList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                             @RequestParam(value = "filters", required = false) String filters,
@ -84,7 +85,7 @@ public class StdCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping(value="/metadata/list",method = RequestMethod.GET)
    @RequestMapping(value="/metadata/list",method = RequestMethod.GET,produces = "application/json")
    @ApiOperation(value = "获取数据元列表",  produces = "application/json", notes = "获取数据元列表")
    public String getMetadataList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                          @RequestParam(value = "filters", required = false) String filters,
@ -95,7 +96,7 @@ public class StdCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping(value="/dict/list",method = RequestMethod.GET)
    @RequestMapping(value="/dict/list",method = RequestMethod.GET,produces = "application/json")
    @ApiOperation(value = "获取标准字典列表",  produces = "application/json", notes = "获取标准字典列表")
    public String getDictList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                                  @RequestParam(value = "filters", required = false) String filters,
@ -108,7 +109,7 @@ public class StdCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping(value="/dictItem/list",method = RequestMethod.GET)
    @RequestMapping(value="/dictItem/list",method = RequestMethod.GET,produces = "application/json")
    @ApiOperation(value = "获取标准字典项列表",  produces = "application/json", notes = "获取标准字典项列表")
    public String getDictItemList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                                  @RequestParam(value = "filters", required = false) String filters,
@ -119,7 +120,7 @@ public class StdCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping(value="/datasetIndex/list",method = RequestMethod.GET)
    @RequestMapping(value="/datasetIndex/list",method = RequestMethod.GET,produces = "application/json")
    @ApiOperation(value = "获取标准索引列表",  produces = "application/json", notes = "获取标准索引列表")
    public String getDatasetIndexList(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                                  @RequestParam(value = "filters", required = false) String filters,
@ -130,7 +131,7 @@ public class StdCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping(value="/relation/list",method = RequestMethod.GET)
    @RequestMapping(value="/relation/list",method = RequestMethod.GET,produces = "application/json")
    @ApiOperation(value = "获取版本号列表",  produces = "application/json", notes = "获取版本号列表")
    public String getRelation(@ApiParam(name = "version", value = "版本", defaultValue = "")
                              @RequestParam(value = "version") String version,
@ -141,19 +142,89 @@ public class StdCenterEndPoint extends BaseController {
        return json.toString();
    }
    @RequestMapping(value="/lastDictItem/list",method = RequestMethod.GET)
    @RequestMapping(value="/lastDictItem/list",method = RequestMethod.GET, produces = "application/json")
    @ApiOperation(value = "根据字典code,获取健康之路最新的字典项",  produces = "application/json", notes = "根据字典code,获取健康之路最新的字典项")
    public List getLastDictItem(@ApiParam(name = "code", value = "字典code", defaultValue = "")
                              @RequestParam(value = "code") String code) throws IOException {
    public Envelop getLastDictItem(@ApiParam(name = "code", value = "字典code", defaultValue = "")
                                @RequestParam(value = "code") String code,
                                   @ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                                @RequestParam(value = "filters", required = false) String filters,
                                   @RequestParam(value = "sorts", required = false) String sorts,
                                   @RequestParam(value = "size", required = false) Integer size,
                                   @RequestParam(value = "page", required = false) Integer page) throws IOException {
        List result = new ArrayList();
        String ver = standardService.getLastStandByOrgCode(defaultOrgCode);
        int total = 0;
        String condition = "";
        if(StringUtils.isNotBlank(ver)){
            List<StdDictionaryModel> list = stdDictService.searchPage(StdDictionaryModel.class, StandardVersion.DictTable,ver, "code="+code, null, null, null,true);
            if(CollectionUtils.isNotEmpty(list)){
                Long id = list.get(0).getId();
                result = stdDictEntryService.searchPage(StdDictionaryEntryModel.class, StandardVersion.DictEntryTable,ver, "dictId="+id, null, null, null,true);
                String ids ="";
                for (StdDictionaryModel model:list){
                    ids+= ","+model.getId();
                }
                ids = ids.substring(1,ids.length());
                if(StringUtils.isBlank(filters)){
                    condition = "dictId="+ids;
                }else{
                    condition = "dictId="+ids+";"+filters;
                }
                result = stdDictEntryService.searchPage(StdDictionaryEntryModel.class, StandardVersion.DictEntryTable,ver, condition, null, page, size,true);
            }
        }
        return result;
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(true);
        envelop.setDetailModelList(result);
        total = stdDictEntryService.searchPage(StdDictionaryEntryModel.class, StandardVersion.DictEntryTable,ver, condition, null, null, null,true).size();
        if(size!=null && page!=null && size!=0){
            envelop.setCurrPage(page);
            envelop.setPageSize(size);
            envelop.setTotalPage(total % size > 0 ? total / size + 1 : total / size);
        }
        envelop.setTotalCount(total);
        return envelop;
    }
    @RequestMapping(value="/lastVersionDrug/list",method = RequestMethod.GET, produces = "application/json")
    @ApiOperation(value = "去重,获取最新版本号的药品名称",  produces = "application/json", notes = "去重,获取最新版本号的药品名称")
    public Envelop getLastVersionDrug(@ApiParam(name = "filters", value = "过滤器,为空检索所有条件", defaultValue = "")
                                @RequestParam(value = "filters", required = false) String filters,
                                @RequestParam(value = "size", required = false) Integer size,
                                @RequestParam(value = "page", required = false) Integer page) throws IOException {
        List result = new ArrayList();
        String ver = standardService.getLastStandByOrgCode(defaultOrgCode);
        int total = 0;
        String condition = "";
        if(StringUtils.isNotBlank(ver)){
            List<StdDictionaryModel> list = stdDictService.searchPage(StdDictionaryModel.class, StandardVersion.DictTable,ver, "code=STD_MEDICINE,CV08.50.301", null, null, null,true);
            if(CollectionUtils.isNotEmpty(list)){
                String ids ="";
                for (StdDictionaryModel model:list){
                    ids+= ","+model.getId();
                }
                ids = ids.substring(1,ids.length());
                List<String> fileds = new ArrayList<>();
                fileds.add("value");
                if(StringUtils.isBlank(filters)){
                    condition = "dictId="+ids;
                }else{
                    condition = "dictId="+ids+";"+filters;
                }
                result = stdDictEntryService.searchPage(StdDictionaryEntryModel.class,fileds, StandardVersion.DictEntryTable,ver, condition, null, page, size,true);
            }
        }
        Envelop envelop = new Envelop();
        envelop.setSuccessFlg(true);
        envelop.setDetailModelList(result);
        List<String> fileds = new ArrayList<>();
        fileds.add("value");
        total = stdDictEntryService.searchPage(StdDictionaryEntryModel.class, fileds, StandardVersion.DictEntryTable, ver, condition, null, null, null, true).size();
        if(size!=null && page!=null && size!=0){
            envelop.setCurrPage(page);
            envelop.setPageSize(size);
            envelop.setTotalPage(total % size > 0 ? total / size + 1 : total / size);
        }
        envelop.setTotalCount(total);
        return envelop;
    }
}

+ 7 - 1
src/main/resources/application.yml

@ -52,11 +52,17 @@ fast-dfs:
    secret-key: FastDFS1234567890
org_code: jkzl
info:
  app:
    name: SVR-EIP-ADMIN
    description: EHR Platform Microservice.
    version: 1.0.0
---
spring:
  profiles: dev
  datasource:
    url: jdbc:mysql://172.19.103.57:8066/global_db?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true
    url: jdbc:mysql://172.19.103.57:8066/hos1?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true
    username: hos
    password: 123456