فهرست منبع

采集原始数据BUG修改

hzp 9 سال پیش
والد
کامیت
bc666a4227

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

@ -465,10 +465,11 @@ public class DatacollectService implements IDatacollectService {
                }
                strSql += strWhere;
                //总条数和最大值查询
                String sqlCount = "select count(1) as COUNT,max(" + maxKey + ") as MAX_KEYVALUE from (" + strSql+")";
                JSONObject obj = db.load(sqlCount);
                if(obj==null)
                //总条数
                String sqlCount = "select count(1) as COUNT from (" + strSql+")";
                String sqlMax = "select max(" + maxKey + ") as MAX_KEYVALUE from " + adapterTableName + strWhere;
                JSONObject objCount = db.load(sqlCount);
                if(objCount==null)
                {
                    if(db.errorMessage.length()>0)
                    {
@ -479,7 +480,7 @@ public class DatacollectService implements IDatacollectService {
                    }
                }
                else{
                    int count = obj.getInt("COUNT");
                    int count = objCount.getInt("COUNT");
                    if(count==0) //0条记录,无需采集
                    {
@ -487,8 +488,11 @@ public class DatacollectService implements IDatacollectService {
                    }
                    else
                    {
                        //获取最大值
                        JSONObject objMax = db.load(sqlMax);
                        int successCount = 0;
                        String maxKeyvalue = obj.optString("MAX_KEYVALUE");
                        String maxKeyvalue = objMax.optString("MAX_KEYVALUE");
                        //修改最大值
                        if(maxKeyvalue!=null&& maxKeyvalue.length()>0)
                        {
@ -685,9 +689,10 @@ public class DatacollectService implements IDatacollectService {
                    }
                    strSql += strWhere;
                    //总条数和最大值查询
                    String sqlCount = "select count(1) as COUNT,max(" + maxKey + ") as MAX_KEYVALUE from (" + strSql +")";
                    String sqlCount = "select count(1) as COUNT from (" + strSql+")";
                    String sqlMax = "select max(" + maxKey + ") as MAX_KEYVALUE from " + adapterTableName + strWhere;
                    //webservice获取数据//获取总条数和最大值
                    //webservice获取数据总条数
                    String strCount = WebserviceUtil.request(url,"ExcuteSQL",new Object[]{"",sqlCount});
                    List<JSONObject> dataCount = getListFromXml(strCount);
@ -698,8 +703,12 @@ public class DatacollectService implements IDatacollectService {
                            message = "0条记录,无需采集。";
                        }
                        else {
                            //webservice获取最大值
                            String strMax = WebserviceUtil.request(url,"ExcuteSQL",new Object[]{"",sqlMax});
                            List<JSONObject> dataMax = getListFromXml(strCount);
                            int successCount = 0;
                            String maxKeyvalue = dataCount.get(0).getString("MAX_KEYVALUE");
                            String maxKeyvalue = dataMax.get(0).getString("MAX_KEYVALUE");
                            //修改最大值
                            if (maxKeyvalue != null && maxKeyvalue.length() > 0) {
                                datacollectLogDao.updateJobDatasetKeyvalue(ds.getId(), maxKeyvalue);

+ 4 - 9
Hos-resource/src/main/resources/spring/applicationContext.xml

@ -36,15 +36,10 @@
    <!--Hibernate 数据库配置-->
    <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <!--
        <property name="url"
                  value="jdbc:mysql://172.19.103.50:3306/healtharchive?useUnicode=true&amp;characterEncoding=UTF-8"/>
        <property name="username" value="fujian"/>
        <property name="password" value="fujian"/>
        -->
        <property name="url" value="jdbc:mysql://192.168.1.220:3306/hos2_resource?useUnicode=true&amp;characterEncoding=UTF-8"/>
        <property name="username" value="hos2"/>
        <property name="password" value="hos2"/>
        <property name="url" value="jdbc:mysql://172.19.103.71:3306/esb?useUnicode=true&amp;characterEncoding=UTF-8"/>
        <property name="username" value="hos"/>
        <property name="password" value="hos"/>
        <property name="initialSize" value="1"/>
        <property name="maxTotal" value="100"/>
        <property name="maxIdle" value="50"/>