瀏覽代碼

日志 sql线程更新

chenweida 9 年之前
父節點
當前提交
4bb1bdb398

+ 4 - 4
Hos-Resource-Mini-helper/src/main/java/com.yihu.ehr/thread/LogThread.java

@ -79,11 +79,11 @@ public class LogThread implements Runnable {
                            ")";
                    db.execute(sql);
                }
                LogUtil.info("初始化参数成功orgCode:" + orgCode + "---systemCode:" + systemCode);
            } catch (Exception e) {
                LogUtil.error("初始化参数失败:" + e.getMessage());
            }
        }
        LogUtil.info("初始化参数成功orgCode:" + orgCode + "---systemCode:" + systemCode);
    }
@ -117,9 +117,9 @@ public class LogThread implements Runnable {
    public String getLogFile() {
        String home = System.getProperty("catalina.home").replace('\\', '/');
        String srcPath = home.substring(0, home.lastIndexOf('/') + 1) + "log";
        String filePath=srcPath+File.separator+logFileName;
        ZipUtil.zip(srcPath,filePath);
        String srcPath = home.substring(0, home.lastIndexOf('/') + 1) + File.separator + "log4j";
        String filePath = srcPath + File.separator + logFileName;
        ZipUtil.zip(srcPath, filePath);
        LogUtil.info("日志文件路径:" + filePath);
        File file = new File(filePath);
        if (file.exists()) {

+ 8 - 8
Hos-Resource-Mini-helper/src/main/java/com.yihu.ehr/thread/SQLThread.java

@ -26,7 +26,7 @@ public class SQLThread implements Runnable {
    private DBHelper db = new DBHelper();
    private DBHelper localdb = null;
    private String token;
    private boolean flag=true;
    private boolean flag = true;
    @Override
    public void run() {
@ -69,20 +69,20 @@ public class SQLThread implements Runnable {
                }
                if (listSYSTEM != null && listSYSTEM.size() > 0) {
                    systemCode = listSYSTEM.get(0).getString("param_value");
                }else{
                } else {
                    String sql = "insert into system_param (id,param_key,param_value) values " +
                            "('" + UUID.randomUUID() + "'," +
                            " 'SYSTEM_CODE' ," +
                            " '"+ThreadConfig.SYSTEM_CODE+"'" +
                            " '" + ThreadConfig.SYSTEM_CODE + "'" +
                            ")";
                    db.execute(sql);
                }
                LogUtil.info("初始化参数成功orgCode:" + orgCode + "---systemCode:" + systemCode);
            } catch (Exception e) {
                LogUtil.error("初始化参数失败:" + e.getMessage());
            }
        }
        LogUtil.info("初始化参数成功orgCode:" + orgCode + "---systemCode:" + systemCode);
    }
    /**
@ -127,9 +127,9 @@ public class SQLThread implements Runnable {
            List<NameValuePair> formParams = new ArrayList<NameValuePair>();
            formParams.add(new BasicNameValuePair("id", id));
            if(flag){
            if (flag) {
                formParams.add(new BasicNameValuePair("message", "执行失败"));
            }else{
            } else {
                formParams.add(new BasicNameValuePair("message", "执行成功"));
            }
            formParams.add(new BasicNameValuePair("result", resultObj));
@ -166,10 +166,10 @@ public class SQLThread implements Runnable {
        try {
            List<org.json.JSONObject> locallist = localdb.query(sql);
            LogUtil.info("执行语句得到数据数目:" + locallist.size());
            flag=true;
            flag = true;
            return locallist.toString();
        } catch (Exception e) {
            flag=false;
            flag = false;
            LogUtil.error("执行语句失败:" + e.getMessage());
            return "";
        }

+ 1 - 1
Hos-Resource-Mini-helper/target/maven-archiver/pom.properties

@ -1,5 +1,5 @@
#Generated by Maven
#Tue Mar 15 15:11:16 CST 2016
#Wed Mar 16 12:50:34 CST 2016
version=1.0-SNAPSHOT
groupId=ehr
artifactId=Hos-Resource-Mini-Helper