Browse Source

Merge branch 'master' of http://192.168.1.220:10080/esb/esb

yingjie 9 years ago
parent
commit
ec332bf9b7

+ 0 - 25
Hos-resource/pom.xml

@ -125,31 +125,6 @@
            <artifactId>ehr-dbhelper</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.core</groupId>
            <artifactId>ehr-dbhelper</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.core</groupId>
            <artifactId>ehr-dbhelper</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.core</groupId>
            <artifactId>ehr-dbhelper</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.core</groupId>
            <artifactId>ehr-dbhelper</artifactId>
            <version>1.1.7</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.core</groupId>
            <artifactId>ehr-dbhelper</artifactId>
            <version>1.1.5</version>
        </dependency>
    </dependencies>
    <build>

+ 9 - 2
Hos-resource/src/main/java/com/yihu/ehr/datacollect/dao/DatacollectDao.java

@ -144,12 +144,19 @@ public class DatacollectDao extends SQLGeneralDAO implements IDatacollectDao {
     */
    public List<DtoJobDataset> getDatacollectDataset(String jobId) throws Exception
    {
        //通过jobId获取机构版本号
        String sqlVersion ="select a.adapter_std_version\n" +
                "from rs_job_config c,(SELECT s.adapter_std_version,v.version from adapter_scheme s,adapter_scheme_version v where s.id=v.scheme_id) a\n" +
                "where a.version = c.scheme_version\n" +
                "and c.id='"+jobId+"'";
        String version = super.scalarBySql(sqlVersion,String.class);
        String sql = "select d.*,\n" +
                "t.datasource_id,t.datasource_name,t.config,t.type,t.org_code\n" +
                "from rs_job_dataset d\n" +
                "LEFT JOIN (select s.dataset_id,s.datasource_id,ss.name as datasource_name,ss.config,ss.type,ss.org_code \n" +
                "\tfrom rs_datasource_dataset s,(select ds.id,ds.name,ds.config,ds.type,o.code as org_code from system_datasource ds,system_organization o where ds.org_id=o.id) ss where s.datasource_id=ss.id) t \n" +
                "on d.job_dataset_id = t.dataset_id\n" +
                "\tfrom rs_datasource_dataset s,(select ds.id,ds.name,ds.config,ds.type,o.code as org_code from system_datasource ds,system_organization o where ds.org_id=o.id) ss where s.datasource_id=ss.id and s.Std_version='"+version+"') t \n" +
                "on d.job_dataset_id = t.dataset_id \n" +
                "where d.job_id='"+jobId+"'\n" +
                "order by d.sort";
        return super.queryListBySql(sql,DtoJobDataset.class);

+ 29 - 18
Hos-resource/src/main/java/com/yihu/ehr/datacollect/service/DatacollectService.java

@ -274,13 +274,19 @@ public class DatacollectService implements IDatacollectService {
                for(int i=0; i< colList.length();i++)
                {
                    JSONObject col = colList.getJSONObject(i);
                    strSql+= ","+col.optString("adapterMetadataCode") +" as " + col.optString("stdMetadataCode") ;
                    String adapterMetadataCode = col.optString("adapterMetadataCode");
                    if(adapterMetadataCode.length()>0)
                    {
                        strSql+= ","+adapterMetadataCode +" as " + col.optString("stdMetadataCode") ;
                    }
                }
                strSql += " from " +adapterTableName +" where 1=1 ";
                strSql += " from " +adapterTableName;
                String strWhere = " where 1=1";
                //采集范围
                if(condition!=null && condition.length()>0)
                {
                    strSql += getCondition(dbType,condition);
                    strWhere += getCondition(dbType,condition);
                }
                //增量采集
                String maxKey = "0";
@ -296,25 +302,38 @@ public class DatacollectService implements IDatacollectService {
                            keyDate = DateConvert.toDate(keyvalue);
                        }
                        //根据数据库类型获取时间sql
                        strSql += " and "+ key + ">'"+getDateSqlByDBType(dbType,keyDate)+"'";
                        strSql += " order by "+ key;
                        strWhere += " and "+ key + ">'"+getDateSqlByDBType(dbType,keyDate)+"'";
                        strWhere += " order by "+ key;
                    }
                    else if(keytype.toUpperCase().equals("VARCHAR")) //字符串类型
                    {
                        maxKey = getToNumberSqlByDBType(dbType,key);
                        if(keyvalue!=null && keyvalue.length()>0) {
                            strSql += " and "+ maxKey + ">'" + keyvalue + "'";
                            strWhere += " and "+ maxKey + ">'" + keyvalue + "'";
                        }
                        strSql += " order by "+ maxKey;
                        strWhere += " order by "+ maxKey;
                    }
                    else{
                        if(keyvalue!=null && keyvalue.length()>0) {
                            strSql += " and "+ key + ">'" + keyvalue + "'";
                            strWhere += " and "+ key + ">'" + keyvalue + "'";
                        }
                        strSql += " order by "+ key;
                        strWhere += " order by "+ key;
                    }
                }
                JSONObject obj = db.load("select count(1) as count,max(" + maxKey + ") as max_num from (" + strSql + ")");
                strSql += strWhere;
                String sqlCount = "select count(1) as count,max(" + maxKey + ") as max_num from " + adapterTableName + strWhere;
                JSONObject obj = db.load(sqlCount);
                if(obj==null)
                {
                    if(db.errorMessage.length()>0)
                    {
                        return db.errorMessage;
                    }
                    else{
                        return "查询异常:"+sqlCount;
                    }
                }
                int count = obj.getInt("COUNT");
                if(count==0) //0条记录,无需采集
                {
@ -349,14 +368,6 @@ public class DatacollectService implements IDatacollectService {
                    detail.setJobDatasetRows(rows);
                    detail.setSchemeVersion(schemeVersion);
                    //最大值
                    if(i==countPage-1)
                    {
                        Object max = db.scalar("select max("+getToNumberSqlByDBType(dbType,key)+") from (" + sql + ")");
                        if(max!=null)
                            maxKeyvalue = String.valueOf(max);
                    }
                    List<JSONObject> list = db.query(sql);
                    String message = intoMongodb(list,schemeVersion,stdTableName,colList); //错误信息

+ 2 - 0
Hos-resource/src/main/java/com/yihu/ehr/system/dao/BaseDictDao.java

@ -102,6 +102,8 @@ public class BaseDictDao extends SQLGeneralDAO implements IBaseDictDao {
            sql +=" where " + Where;
        }
        sql += " order by " + valueCole;
        List<DictItem> list = super.queryListBySql(sql,DictItem.class);
        DictionaryResult re = new DictionaryResult(tableName);

+ 0 - 1
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/datacollect/editorJob.jsp

@ -40,7 +40,6 @@
    .inlineDialog .l-dialog-tl,.inlineDialog .l-dialog-tc,.inlineDialog .l-dialog-tr,.inlineDialog .l-dialog-tc-inner{height:0px;overflow: hidden}
    .inlineDialog .l-dialog-table tr,.inlineDialog .l-dialog-table td{border:0px;}
    .wizard > .content{height:410px;}
</style>
<%--按步执行面板--%>

+ 8 - 3
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/datacollect/editorJobJs.jsp

@ -47,13 +47,10 @@
                    }
                },
                onFinishing:function(c,a){
                    debugger
                    editorJob.setCheckVal();
                    return me.verify(4);
                },
                onFinished:function(c,a){
                    editorJob.setCheckVal();
                    me.save();
                },
                onCanceled:function(){
@ -101,6 +98,7 @@
                checkbox:true,
                height:340,
                width:360,
                hideHeader:true,
                isChecked:function(row){
                    if($("#txtSchemeVersion").val()==row.version)
                    {
@ -645,7 +643,10 @@
        //保存操作
        save:function(){
            var me = this;
            me.setCheckVal();
            var data = me.getData();
            //按钮失效
            $("a[href='#finish']").unbind("click");
            $.ajax({ //ajax处理
                type: "POST",
@ -662,10 +663,14 @@
                    }
                    else{
                        $.ligerDialog.error(data.message);
                        //按钮恢复
                        $("a[href='#finish']").bind("click",function(){editorJob.save();});
                    }
                },
                error :function(data){
                    $.ligerDialog.error("Status:"+data.status +"(" +data.statusText+")");
                    //按钮恢复
                    $("a[href='#finish']").bind("click",function(){editorJob.save();});
                }
            });
        },

+ 2 - 2
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/system/datasource/editorSourceJs.jsp

@ -50,8 +50,8 @@
                            $("#ip").val((configStr.split("\/")[2]).split(":")[0]);
                            $("#port").val((configStr.split("\/")[2]).split(":")[1]);
                            $("#dataSourceName").val((configStr.split("\/")[3]).split("?")[0]);
                            $("#userName").val((configStr.split("\/")[3]).split("?")[1].split(";")[0].split("=")[1]);
                            $("#password").val((configStr.split("\/")[3]).split("?")[1].split(";")[1].split("=")[1]);
                            $("#userName").val((configStr.split("\/")[3]).split("?")[1].split("&")[0].split("=")[1]);
                            $("#password").val((configStr.split("\/")[3]).split("?")[1].split("&")[1].split("=")[1]);
                        }else{
                            $("#ip").val(configStr.split("\/")[3].split(":")[0]);
                            $("#port").val(configStr.split("\/")[3].split(":")[1]);

+ 0 - 21
Hos-resource/src/main/webapp/WEB-INF/ehr/jsp/system/user/editorUserCss.jsp

@ -1,21 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8" %>
<%@include file="/WEB-INF/ehr/commons/jsp/commonInclude.jsp" %>
<style>
    #div_wrapper #div_wrapper_right .div_wrapper_right_top .m-form-inline .m-form-group {
        margin-bottom: 0px;
    }
    #div_wrapper #div_wrapper_right .div_wrapper_right_top .m-form-inline .m-form-group span {
        line-height: 2
    }
    #div_wrapper #div_wrapper_right .div_wrapper_right_top .m-form-inline .m-form-group center hr {
        height: 1px;
        border: none;
        border-top: 1px solid #2d9bd2;
        margin-top: 0px;
        margin-bottom: 0px
    }
</style>

+ 15 - 4
Hos-resource/src/main/webapp/develop/lib/ligerui/custom/ligerOverwrite.js

@ -283,6 +283,18 @@
            h = g._calculateGridBodyHeight(h);
            if (h > 0)
            {
                /** 列表高度计算bug修改 **/
                var gridHeaderHeight = (p.headerRowHeight+1) * (g._columnMaxLevel - 1) + p.headerRowHeight + 1;
                /***********************/
                /******** 隐藏表头 add by hzp at 2016-05-05 ************/
                if(p.hideHeader)
                {
                    h += 41;
                    g.gridheader.hide();
                    gridHeaderHeight = 0;
                }
                /*****************************************************/
                g.gridbody.height(h);
                if (p.frozen)
                {
@ -293,16 +305,15 @@
                    {
                        if (h > 6)
                            g.f.gridbody.height(h - 6);
                    } else
                    }
                    else
                    {
                        g.f.gridbody.height(h);
                    }
                    /********************************************/
                }
                /** 列表高度计算bug修改 **/
                var gridHeaderHeight = (p.headerRowHeight+1) * (g._columnMaxLevel - 1) + p.headerRowHeight + 1;
                /***********************/
                g.gridview.height(h + gridHeaderHeight);
            }
            g._updateHorizontalScrollStatus.ligerDefer(g, 10);