Browse Source

Merge remote-tracking branch 'origin/master'

suxiaoyang 6 years ago
parent
commit
558f9d405f

+ 14 - 0
commons-data-elasticsearch/src/main/java/com/yihu/ehr/elasticsearch/ElasticSearchUtil.java

@ -352,6 +352,20 @@ public class ElasticSearchUtil {
        return page(index, type, filters, null, page, size);
    }
    /**
     * 获取文档分页
     * @param index
     * @param type
     * @param filters
     * @param sorts
     * @param page
     * @param size
     * @return
     */
    public Page<Map<String, Object>> pageBySort(String index, String type, String filters, String sorts, int page, int size) {
        return page(index, type, filters, sorts, page, size);
    }
    /**
     * 获取分档分页 - 带分页功能
     * @param index

+ 66 - 33
commons-ehr-constants/src/main/java/com/yihu/ehr/constants/ServiceApi.java

@ -1661,25 +1661,25 @@ public class ServiceApi {
    /**
     * 数据质量监控
     */
    public static class DataQuality{
    public static class DataQuality {
        public static final String PaltformReceiveWarningList = "/dataQuality/warningSetting/receiveWarningList";
        public static final String PaltformReceiveWarningAdd = "/dataQuality/warningSetting/receiveWarningAdd";
        public static final String PaltformReceiveWarningDel = "/dataQuality/warningSetting/receiveWarningDel";
        public static final String PaltformReceiveWarningUpd = "/dataQuality/warningSetting/receiveWarningUpd";
        public static final String PaltformReceiveWarning =    "/dataQuality/warningSetting/receiveWarning/{id}";
        public static final String PaltformReceiveWarningIsExist =    "/dataQuality/warningSetting/receiveWarningIsExist";
        public static final String PaltformReceiveWarningDefault =    "/dataQuality/warningSetting/receiveWarningDefault";
        public static final String PaltformReceiveWarning = "/dataQuality/warningSetting/receiveWarning/{id}";
        public static final String PaltformReceiveWarningIsExist = "/dataQuality/warningSetting/receiveWarningIsExist";
        public static final String PaltformReceiveWarningDefault = "/dataQuality/warningSetting/receiveWarningDefault";
        public static final String PaltformResourceWarningList = "/dataQuality/warningSetting/resourceWarningList";
        public static final String PaltformResourceWarningAdd = "/dataQuality/warningSetting/resourceWarningAdd";
        public static final String PaltformResourceWarningDel = "/dataQuality/warningSetting/resourceWarningDel";
        public static final String PaltformResourceWarningUpd = "/dataQuality/warningSetting/resourceWarningUpd";
        public static final String PaltformResourceWarning =    "/dataQuality/warningSetting/resourceWarning/{id}";
        public static final String PaltformResourceWarning = "/dataQuality/warningSetting/resourceWarning/{id}";
        public static final String PaltformUploadWarningList = "/dataQuality/warningSetting/uploadWarningList";
        public static final String PaltformUploadWarningAdd = "/dataQuality/warningSetting/uploadWarningAdd";
        public static final String PaltformUploadWarningDel = "/dataQuality/warningSetting/uploadWarningDel";
        public static final String PaltformUploadWarningUpd = "/dataQuality/warningSetting/uploadWarningUpd";
        public static final String PaltformUploadWarningIsExist =    "/dataQuality/warningSetting/uploadWarningIsExist";
        public static final String PaltformUploadWarning =    "/dataQuality/warningSetting/uploadWarning/{id}";
        public static final String PaltformUploadWarningIsExist = "/dataQuality/warningSetting/uploadWarningIsExist";
        public static final String PaltformUploadWarning = "/dataQuality/warningSetting/uploadWarning/{id}";
        public static final String DatasetWarningList = "/dataQuality/warningSetting/datasetWarningList";
        public static final String ImportDatasetExcel = "/dataQuality/warningSetting/importDatasetExcel";
        public static final String DatasetWarningListNoPage = "/dataQuality/warningSetting/datasetWarningListNoPage";
@ -1702,7 +1702,7 @@ public class ServiceApi {
        public static final String WarningRecordList = "/dataQuality/warningRecord/warningRecordList";
        public static final String RealTimeMonitorList = "/dataQuality/warningRecord/realTimeMonitorList";
        public static final String WarningRecord =  "/dataQuality/warningRecord/warningRecord/{id}";
        public static final String WarningRecord = "/dataQuality/warningRecord/warningRecord/{id}";
        public static final String WarningRecordUpd = "/dataQuality/warningRecord/warningRecordUpd";
        public static final String WarningQuestionAnalyze = "/dataQuality/warningRecord/warningQuestionAnalyze";
        public static final String WarningQuestionJob = "/dataQuality/warningRecord/WarningQuestionJob";
@ -1718,18 +1718,18 @@ public class ServiceApi {
        public static final String ExportQualityUpload = "/dataQuality/export/exportQualityUpload";
        //首页相关
        public static final String  HomeSummary= "/dataQuality/home/recordList";
        public static final String  HomeAreaDataList= "/dataQuality/home/areaDataList";
        public static final String  HomeOrgDataList= "/dataQuality/home/orgDataList";
        public static final String  HomeDatasetError= "/dataQuality/home/datasetError";
        public static final String  HomeMetadataError= "/dataQuality/home/metadataError";
        public static final String  HomeCompleteAnalyze= "/dataQuality/home/completeAnalyze";
        public static final String  HomeCorrectAnalyze= "/dataQuality/home/correctAnalyze";
        public static final String  HomeInTimeAnalyze= "/dataQuality/home/inTimeAnalyze";
        public static final String  HomeTrend= "/dataQuality/home/trend";
        public static final String HomeSummary = "/dataQuality/home/recordList";
        public static final String HomeAreaDataList = "/dataQuality/home/areaDataList";
        public static final String HomeOrgDataList = "/dataQuality/home/orgDataList";
        public static final String HomeDatasetError = "/dataQuality/home/datasetError";
        public static final String HomeMetadataError = "/dataQuality/home/metadataError";
        public static final String HomeCompleteAnalyze = "/dataQuality/home/completeAnalyze";
        public static final String HomeCorrectAnalyze = "/dataQuality/home/correctAnalyze";
        public static final String HomeInTimeAnalyze = "/dataQuality/home/inTimeAnalyze";
        public static final String HomeTrend = "/dataQuality/home/trend";
        //app端相关
        public static final String  HomeHealthArchiveTrend= "/dataQuality/home/healthArchiveTrend";
        public static final String HomeHealthArchiveTrend = "/dataQuality/home/healthArchiveTrend";
    }
@ -1741,20 +1741,20 @@ public class ServiceApi {
        public static final String datasetWarningList = "/packQcReport/datasetWarningList";
        public static final String resourceSuccess = "/packQcReport/resourceSuccess";
        public static final String resourceSuccessPage = "/packQcReport/resourceSuccessPage";
        public static final String archiveReport= "/packQcReport/archiveReport";
        public static final String dataSetList= "/packQcReport/dataSetList";
        public static final String dataSetListPage= "/packQcReport/dataSetListPage";
        public static final String archiveFailed= "/packQcReport/archiveFailed";
        public static final String archiveFailedPage= "/packQcReport/archiveFailedPage";
        public static final String metadataError= "/packQcReport/metadataError";
        public static final String metadataErrorPage= "/packQcReport/metadataErrorPage";
        public static final String analyzeErrorList= "/packQcReport/analyzeErrorList";
        public static final String metadataErrorList= "/packQcReport/metadataErrorList";
        public static final String metadataErrorDetail= "/packQcReport/metadataErrorDetail";
        public static final String archiveList= "/packQcReport/archiveList";
        public static final String archiveDetail= "/packQcReport/archiveDetail";
        public static final String uploadRecordList= "/packQcReport/uploadRecordList";
        public static final String uploadRecordDetail= "/packQcReport/uploadRecordDetail";
        public static final String archiveReport = "/packQcReport/archiveReport";
        public static final String dataSetList = "/packQcReport/dataSetList";
        public static final String dataSetListPage = "/packQcReport/dataSetListPage";
        public static final String archiveFailed = "/packQcReport/archiveFailed";
        public static final String archiveFailedPage = "/packQcReport/archiveFailedPage";
        public static final String metadataError = "/packQcReport/metadataError";
        public static final String metadataErrorPage = "/packQcReport/metadataErrorPage";
        public static final String analyzeErrorList = "/packQcReport/analyzeErrorList";
        public static final String metadataErrorList = "/packQcReport/metadataErrorList";
        public static final String metadataErrorDetail = "/packQcReport/metadataErrorDetail";
        public static final String archiveList = "/packQcReport/archiveList";
        public static final String archiveDetail = "/packQcReport/archiveDetail";
        public static final String uploadRecordList = "/packQcReport/uploadRecordList";
        public static final String uploadRecordDetail = "/packQcReport/uploadRecordDetail";
    }
    // 政府服务平台首页
@ -1798,4 +1798,37 @@ public class ServiceApi {
    }
    /**
     * 统计视图
     */
    public static class StatisticView {
        /**
         * 视图
         */
        public static class View {
            public static final String Add = "/statisticView/View/add";
            public static final String Delete = "/statisticView/View/delete";
            public static final String GetViewRule = "/statisticView/View/getViewRule";
            public static final String GetViewStatisticData = "/statisticView/View/getViewStatisticData";
        }
        /**
         * 视图维度
         */
        public static class ViewDimension {
            public static final String Add = "/statisticView/ViewDimension/add";
            public static final String Delete = "/statisticView/ViewDimension/delete";
        }
        /**
         * 视图指标
         */
        public static class ViewQuota {
            public static final String Add = "/statisticView/ViewQuota/add";
            public static final String Delete = "/statisticView/ViewQuota/delete";
        }
    }
}

+ 27 - 1
ehr-cloud-parent/pom.xml

@ -156,8 +156,10 @@
        <zbus-version>0.11.5</zbus-version>
        <jolokia-version>1.3.5</jolokia-version>
        <spring-securit-version>4.2.3.RELEASE</spring-securit-version>
        <spring-mongodb-version>1.4.5.RELEASE</spring-mongodb-version>
        <hos-version>1.3.0</hos-version>
        <hos-web-framework>${hos-version}</hos-web-framework>
        <mongo.version>3.2.2</mongo.version>
    </properties>
    <dependencyManagement>
@ -809,17 +811,41 @@
                <artifactId>spring-security-crypto</artifactId>
                <version>${spring-securit-version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-mongodb</artifactId>
                <version>${spring-mongodb-version}</version>
            </dependency>
            <dependency>
                <groupId>com.yihu.ehr</groupId>
                <artifactId>hos-web-framework</artifactId>
                <version>${hos-version}</version>
            </dependency>
          
          	<dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-all</artifactId>
                <version>${version.netty}</version>
            </dependency>
            <dependency>
                <groupId>org.mongodb</groupId>
                <artifactId>mongo-java-driver</artifactId>
                <version>${mongo.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mongodb</groupId>
                <artifactId>mongodb-driver-core</artifactId>
                <version>${mongo.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mongodb</groupId>
                <artifactId>mongodb-driver</artifactId>
                <version>${mongo.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mongodb</groupId>
                <artifactId>bson</artifactId>
                <version>${mongo.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

+ 1 - 0
hos-web-framework/src/main/java/com/yihu/hos/web/framework/constant/SqlConstants.java

@ -14,6 +14,7 @@ public class SqlConstants {
    public static final String FROM = " FROM ";
    public static final String WHERE = " WHERE ";
    public static final String COUNT = " COUNT(*) ";
    public static final String DISTINCT = " DISTINCT ";
    public static final String ASTERISK = "*";
    public static final String IN = " IN ";
    public static final String BETWEEN = " BETWEEN ";

+ 12 - 1
hos-web-framework/src/main/java/com/yihu/hos/web/framework/dao/SQLGeneralDAO.java

@ -24,6 +24,7 @@ import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.orm.hibernate5.LocalSessionFactoryBean;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.persistence.Table;
import java.io.IOException;
@ -821,6 +822,10 @@ public class SQLGeneralDAO implements XSQLGeneralDAO {
    public List searchPage(Class tClass,String dataType, String version, String condition, String order, Integer offset, Integer limit,boolean isStandard) throws IOException {
        return searchPage(tClass,null,dataType,version,condition,order,offset,limit,isStandard);
    }
    public List searchPage(Class tClass,List<String> fields,String dataType, String version, String condition, String order, Integer offset, Integer limit,boolean isStandard) throws IOException {
        String tableName;
        if(isStandard){
            StandardVersion standardVersion = new StandardVersion(version);
@ -878,7 +883,12 @@ public class SQLGeneralDAO implements XSQLGeneralDAO {
                sqlCreator.order(elem.substring(1), value);
            }
        }
        String sql = sqlCreator.selectData(tableName);
        String sql = "";
        if(CollectionUtils.isEmpty(fields)){
            sql = sqlCreator.selectData(tableName);
        }else{
            sql = sqlCreator.selectData(tableName,fields);
        }
        Query query = getQuery(sqlCreator, sql);
        if (limit != null) {
            query.setMaxResults(limit);
@ -889,6 +899,7 @@ public class SQLGeneralDAO implements XSQLGeneralDAO {
        return query.list();
    }
    public boolean isExistByField(Class tClass, String stdVersion,String dataType,String field, Object val) throws IOException {
        return isExistByFields(

+ 43 - 0
hos-web-framework/src/main/java/com/yihu/hos/web/framework/util/sql/SqlCreator.java

@ -146,6 +146,47 @@ public class SqlCreator {
        return sqlBuffer.toString();
    }
    public String selectData(String tabelName,List<String> fileds) {
        setTableName(tabelName);
        for(Object key : transformer.columnToProperty.keySet()){
            itemList.add(StringUtil.toString(key));
        }
        return selectData(fileds);
    }
    public String selectData(List<String> fileds) {
        StringBuilder sqlBuffer = new StringBuilder();
        sqlBuffer.append(SqlConstants.SELECT);
        int i=0;
        for (String item : fileds) {
            if(i==0){
                sqlBuffer.append(SqlConstants.DISTINCT);
                i++;
            }
            sqlBuffer.append(item + SqlConstants.COMMA);
        }
        sqlBuffer.deleteCharAt(sqlBuffer.length() - 1);
        sqlBuffer.append(SqlConstants.FROM + tableName);
        if (!CollectionUtil.isEmpty(conditionList)) {
            sqlBuffer.append(SqlConstants.WHERE);
            sqlBuffer.append("1=1" + SqlConstants.AND);
            for (String condition : conditionList) {
                sqlBuffer.append(condition + SqlConstants.AND);
            }
            sqlBuffer.delete(sqlBuffer.length() - 4, sqlBuffer.length() - 1);
        }
        if (!CollectionUtil.isEmpty(orderList)) {
            for (String order : orderList) {
                sqlBuffer.append(order);
            }
            sqlBuffer.delete(sqlBuffer.length() - 1, sqlBuffer.length());
        }
        return sqlBuffer.toString();
    }
    public String selectData(String tabelName) {
        setTableName(tabelName);
@ -182,6 +223,8 @@ public class SqlCreator {
        return sqlBuffer.toString();
    }
    public String updateDataByTableKey(String tabelName, JsonNode jsonNode) {
        setTableName(tabelName);