huangzhiyong 7 gadi atpakaļ
vecāks
revīzija
0acabe03f9

+ 8 - 12
hos-broker/src/main/java/com/yihu/hos/broker/configurations/ApplicationConfiguration.java

@ -1,13 +1,9 @@
package com.yihu.hos.broker.configurations;
import org.apache.camel.component.quartz.QuartzComponent;
import org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
 * @created Airhead 2016/8/1.
 */
@ -26,12 +22,12 @@ public class ApplicationConfiguration implements ApplicationListener<EmbeddedSer
    }
    @Bean
    public QuartzComponent quartz(){
        QuartzComponent quartzComponent =  new QuartzComponent();
        Properties properties1 = new Properties();
        properties1.setProperty("propertiesFile", "classPath:quartz.properties");
        quartzComponent.setProperties(properties1);
        return quartzComponent;
    }
//    @Bean
//    public QuartzComponent quartz(){
//        QuartzComponent quartzComponent =  new QuartzComponent();
//        Properties properties1 = new Properties();
//        properties1.setProperty("propertiesFile", "classPath:quartz.properties");
//        quartzComponent.setProperties(properties1);
//        return quartzComponent;
//    }
}

+ 14 - 18
hos-broker/src/main/java/com/yihu/hos/broker/services/camel/CamelStartBoot.java

@ -1,15 +1,11 @@
package com.yihu.hos.broker.services.camel;
import com.yihu.hos.broker.common.log.TracerFormatter;
import com.yihu.hos.broker.services.BrokerServerService;
import com.yihu.hos.broker.util.lang.DynamicClassLoader;
import com.yihu.hos.core.log.Logger;
import com.yihu.hos.core.log.LoggerFactory;
import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.processor.interceptor.DefaultTraceFormatter;
import org.apache.camel.processor.interceptor.Tracer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.stereotype.Component;
@ -39,25 +35,25 @@ public class CamelStartBoot {
        logger.info("Apache Camel Context 启动...");
        try {
            context.setStreamCaching(true); //确保outBody可以消费多次。参考链接:http://camel.apache.org/why-is-my-message-body-empty.html
//            context.setStreamCaching(true); //确保outBody可以消费多次。参考链接:http://camel.apache.org/why-is-my-message-body-empty.html
            context.setUseMDCLogging(true);
            Tracer tracer = new Tracer();
            tracer.setTraceOutExchanges(true);
//            Tracer tracer = new Tracer();
//            tracer.setTraceOutExchanges(true);
            DefaultTraceFormatter formatter = new TracerFormatter();
            formatter.setShowHeaders(true);
            formatter.setShowBody(true);
            formatter.setShowBodyType(true);
            formatter.setShowOutHeaders(true);
            formatter.setShowOutBody(true);
            formatter.setShowOutBodyType(true);
            tracer.setFormatter(formatter);
//            DefaultTraceFormatter formatter = new TracerFormatter();
//            formatter.setShowHeaders(true);
//            formatter.setShowBody(true);
//            formatter.setShowBodyType(true);
//            formatter.setShowOutHeaders(true);
//            formatter.setShowOutBody(true);
//            formatter.setShowOutBodyType(true);
//            tracer.setFormatter(formatter);
            context.addInterceptStrategy(tracer);
            context.setTracing(true);
//            context.addInterceptStrategy(tracer);
//            context.setTracing(true);
            context.getGlobalOptions().put(Exchange.LOG_DEBUG_BODY_STREAMS, "true");
//            context.getGlobalOptions().put(Exchange.LOG_DEBUG_BODY_STREAMS, "true");
            context.start();
            logger.info("Apache Camel Context 启动完成...");

+ 1 - 1
hos-camel2/src/main/java/camel/demo/collect/processor/CollectProcessor0.java

@ -1,4 +1,4 @@
package camel.demo.collect.processor;
package camel.terminal.collect.processor;
import org.apache.camel.Exchange;
import org.apache.camel.Message;

+ 2 - 2
hos-camel2/src/main/java/camel/demo/collect/route/CollectQuartzRoute.java

@ -1,6 +1,6 @@
package camel.demo.collect.route;
package camel.terminal.collect.route;
import camel.demo.collect.processor.CollectProcessor0;
import camel.terminal.collect.processor.CollectProcessor0;
import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;

+ 2 - 2
hos-rest/src/main/java/com/yihu/hos/rest/services/crawler/CrawlerManager.java

@ -156,7 +156,7 @@ public class CrawlerManager {
        RsJobConfig rsJobConfig = datacollect.getJobById(jobId);
        String random = UUID.randomUUID().toString();
        logger.info("质控数据采集上传开始,流水号:" + random + ",jobId:"+jobId);
        logger.info("数据采集上传开始,流水号:" + random + ",jobId:"+jobId);
        Date begin = rsJobConfig.getRepeatStartTime();
        Date end = rsJobConfig.getRepeatEndTime();
@ -196,7 +196,7 @@ public class CrawlerManager {
//            rsJobConfig.setRepeatEndTime(DateUtil.formatYMDToYMDHMS(DateUtil.getSysDateTime().toString()));
        }
        datacollect.updateJob(rsJobConfig);
        logger.info("质控采集上传结束,流水号:" + random + ",jobId:" + jobId + ",message:" + result.getMessage());
        logger.info("采集上传结束,流水号:" + random + ",jobId:" + jobId + ",message:" + result.getMessage());
        return result;
    }

+ 2 - 2
hos-rest/src/main/java/com/yihu/hos/rest/services/crawler/DatacollectManager.java

@ -378,10 +378,10 @@ public class DatacollectManager {
                        if (v1.indexOf('/') > 0) //分
                        {
                            String[] varry = v1.split("/");
                            re = "每隔" + varry[1] + "分";
                            re = "每隔" + varry[1] + "分钟";
                        } else { //时
                            String[] varry = v2.split("/");
                            re = "每隔" + varry[1] + "时";
                            re = "每隔" + varry[1] + "小时";
                        }
                    }
                }

+ 1 - 0
hos-rest/src/main/java/com/yihu/hos/rest/services/crawler/DatacollectService.java

@ -634,6 +634,7 @@ public class DatacollectService {
                JSONObject objCount = db.load(sqlCount);
                if (objCount == null) {
                    if (db.errorMessage.length() > 0) {
                        System.out.println("objCount空链接,datasourceId:"+datasourceId + "config: "+config);
                        throw new Exception(db.errorMessage);
                    } else {
                        throw new Exception("查询异常:" + sqlCount);

+ 6 - 6
hos-rest/src/main/resources/config/http.properties

@ -1,11 +1,11 @@
httpUrl = http://172.19.103.73:10140/api/v1.0
httpCouldUrl = http://172.19.103.73:10400/api/v1.0
httpAdminUrl = http://172.19.103.73:10000/api/v1.0
#httpUrl = http://172.19.103.73:10140/api/v1.0
#httpCouldUrl = http://172.19.103.73:10400/api/v1.0
#httpAdminUrl = http://172.19.103.73:10000/api/v1.0
#httpUrl = http://192.168.1.221:10140/api/v1.0
#httpCouldUrl = http://192.168.1.221:10400/api/v1.0
#httpAdminUrl = http://192.168.1.221:10000/api/v1.0
httpUrl = http://192.168.1.221:10140/api/v1.0
httpCouldUrl = http://172.19.103.73:10400/api/v1.0
httpAdminUrl = http://192.168.1.221:10000/api/v1.0
#  http://172.19.103.73:1443/api/v1.0
#\uFFFD\uFFFDhttps://192.168.131.15:4432/api/v1.0

+ 2 - 2
src/main/java/com/yihu/hos/datacollect/service/DatacollectManager.java

@ -500,10 +500,10 @@ public class DatacollectManager{
                        if (v1.indexOf('/') > 0) //分
                        {
                            String[] varry = v1.split("/");
                            re = "每隔" + varry[1] + "分";
                            re = "每隔" + varry[1] + "分钟";
                        } else { //时
                            String[] varry = v2.split("/");
                            re = "每隔" + varry[1] + "时";
                            re = "每隔" + varry[1] + "小时";
                        }
                    }
                }

+ 2 - 2
src/main/webapp/WEB-INF/ehr/jsp/datacollect/editorJob.jsp

@ -150,10 +150,10 @@
                </div>
                <div id="divIntervalOption0" class="divIntervalOption" style="display: block">
                    <div class="label-left">每隔</div><input type="text" id="txtM" /><div class="label-left">分</div>
                    <div class="label-left">每隔</div><input type="text" id="txtM" /><div class="label-left">分钟</div>
                </div>
                <div id="divIntervalOption1" class="divIntervalOption">
                    <div class="label-left">每隔</div><input type="text" id="txtH" /><div class="label-left">时</div>
                    <div class="label-left">每隔</div><input type="text" id="txtH" /><div class="label-left">小时</div>
                </div>
                <div id="divIntervalOption2" class="divIntervalOption">
                    <div class="label-left">每隔</div><input type="text" id="txtD" /><div class="label-left">天</div>