作者 王勇

数据仓库服务,搭建环境

  1 +HELP.md
  2 +target/
  3 +!.mvn/wrapper/maven-wrapper.jar
  4 +!**/src/main/**
  5 +!**/src/test/**
  6 +
  7 +### STS ###
  8 +.apt_generated
  9 +.classpath
  10 +.factorypath
  11 +.project
  12 +.settings
  13 +.springBeans
  14 +.sts4-cache
  15 +
  16 +### IntelliJ IDEA ###
  17 +.idea
  18 +*.iws
  19 +*.iml
  20 +*.ipr
  21 +
  22 +### NetBeans ###
  23 +/nbproject/private/
  24 +/nbbuild/
  25 +/dist/
  26 +/nbdist/
  27 +/.nb-gradle/
  28 +build/
  29 +
  30 +### VS Code ###
  31 +.vscode/
  1 +/*
  2 + * Copyright 2007-present the original author or authors.
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * https://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +
  17 +import java.net.*;
  18 +import java.io.*;
  19 +import java.nio.channels.*;
  20 +import java.util.Properties;
  21 +
  22 +public class MavenWrapperDownloader {
  23 +
  24 + private static final String WRAPPER_VERSION = "0.5.6";
  25 + /**
  26 + * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
  27 + */
  28 + private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
  29 + + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
  30 +
  31 + /**
  32 + * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
  33 + * use instead of the default one.
  34 + */
  35 + private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
  36 + ".mvn/wrapper/maven-wrapper.properties";
  37 +
  38 + /**
  39 + * Path where the maven-wrapper.jar will be saved to.
  40 + */
  41 + private static final String MAVEN_WRAPPER_JAR_PATH =
  42 + ".mvn/wrapper/maven-wrapper.jar";
  43 +
  44 + /**
  45 + * Name of the property which should be used to override the default download url for the wrapper.
  46 + */
  47 + private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
  48 +
  49 + public static void main(String args[]) {
  50 + System.out.println("- Downloader started");
  51 + File baseDirectory = new File(args[0]);
  52 + System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
  53 +
  54 + // If the maven-wrapper.properties exists, read it and check if it contains a custom
  55 + // wrapperUrl parameter.
  56 + File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
  57 + String url = DEFAULT_DOWNLOAD_URL;
  58 + if (mavenWrapperPropertyFile.exists()) {
  59 + FileInputStream mavenWrapperPropertyFileInputStream = null;
  60 + try {
  61 + mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
  62 + Properties mavenWrapperProperties = new Properties();
  63 + mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
  64 + url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
  65 + } catch (IOException e) {
  66 + System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
  67 + } finally {
  68 + try {
  69 + if (mavenWrapperPropertyFileInputStream != null) {
  70 + mavenWrapperPropertyFileInputStream.close();
  71 + }
  72 + } catch (IOException e) {
  73 + // Ignore ...
  74 + }
  75 + }
  76 + }
  77 + System.out.println("- Downloading from: " + url);
  78 +
  79 + File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
  80 + if (!outputFile.getParentFile().exists()) {
  81 + if (!outputFile.getParentFile().mkdirs()) {
  82 + System.out.println(
  83 + "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
  84 + }
  85 + }
  86 + System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
  87 + try {
  88 + downloadFileFromURL(url, outputFile);
  89 + System.out.println("Done");
  90 + System.exit(0);
  91 + } catch (Throwable e) {
  92 + System.out.println("- Error downloading");
  93 + e.printStackTrace();
  94 + System.exit(1);
  95 + }
  96 + }
  97 +
  98 + private static void downloadFileFromURL(String urlString, File destination) throws Exception {
  99 + if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
  100 + String username = System.getenv("MVNW_USERNAME");
  101 + char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
  102 + Authenticator.setDefault(new Authenticator() {
  103 + @Override
  104 + protected PasswordAuthentication getPasswordAuthentication() {
  105 + return new PasswordAuthentication(username, password);
  106 + }
  107 + });
  108 + }
  109 + URL website = new URL(urlString);
  110 + ReadableByteChannel rbc;
  111 + rbc = Channels.newChannel(website.openStream());
  112 + FileOutputStream fos = new FileOutputStream(destination);
  113 + fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
  114 + fos.close();
  115 + rbc.close();
  116 + }
  117 +
  118 +}
不能预览此文件类型
  1 +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
  2 +wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--参考文档链接:https://blog.csdn.net/qq_34912478/article/details/80877132-->
  3 +<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
  4 +<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
  5 +<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
  6 +<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
  7 +<configuration scan="true" scanPeriod="10 seconds">
  8 +
  9 + <!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
  10 +
  11 + <contextName>logback</contextName>
  12 + <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
  13 + <property name="log.path" value="./logs" />
  14 +
  15 + <!-- 彩色日志 -->
  16 + <!-- 彩色日志依赖的渲染类 -->
  17 + <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
  18 + <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
  19 + <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
  20 + <!-- 彩色日志格式 -->
  21 + <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
  22 +
  23 +
  24 + <!--输出到控制台-->
  25 + <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
  26 + <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
  27 + <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  28 + <level>debug</level>
  29 + </filter>
  30 + <encoder>
  31 + <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
  32 + <!-- 设置字符集 windows系统这里设置成GBK-->
  33 + <charset>UTF-8</charset>
  34 + </encoder>
  35 + </appender>
  36 +
  37 +
  38 + <!--输出到文件-->
  39 +
  40 + <!-- 时间滚动输出 level为 DEBUG 日志 -->
  41 + <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  42 + <!-- 正在记录的日志文件的路径及文件名 -->
  43 + <file>${log.path}/log_debug.log</file>
  44 + <!--日志文件输出格式-->
  45 + <encoder>
  46 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  47 + <charset>UTF-8</charset> <!-- 设置字符集 -->
  48 + </encoder>
  49 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  50 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  51 + <!-- 日志归档 -->
  52 + <fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  53 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  54 + <maxFileSize>100MB</maxFileSize>
  55 + </timeBasedFileNamingAndTriggeringPolicy>
  56 + <!--日志文件保留天数-->
  57 + <maxHistory>15</maxHistory>
  58 + </rollingPolicy>
  59 + <!-- 此日志文件只记录debug级别的 -->
  60 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  61 + <level>debug</level>
  62 + <onMatch>ACCEPT</onMatch>
  63 + <onMismatch>DENY</onMismatch>
  64 + </filter>
  65 + </appender>
  66 +
  67 + <!-- 时间滚动输出 level为 INFO 日志 -->
  68 + <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  69 + <!-- 正在记录的日志文件的路径及文件名 -->
  70 + <file>${log.path}/log_info.log</file>
  71 + <!--日志文件输出格式-->
  72 + <encoder>
  73 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  74 + <charset>UTF-8</charset>
  75 + </encoder>
  76 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  77 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  78 + <!-- 每天日志归档路径以及格式 -->
  79 + <fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  80 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  81 + <maxFileSize>100MB</maxFileSize>
  82 + </timeBasedFileNamingAndTriggeringPolicy>
  83 + <!--日志文件保留天数-->
  84 + <maxHistory>15</maxHistory>
  85 + </rollingPolicy>
  86 + <!-- 此日志文件只记录info级别的 -->
  87 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  88 + <level>info</level>
  89 + <onMatch>ACCEPT</onMatch>
  90 + <onMismatch>DENY</onMismatch>
  91 + </filter>
  92 + </appender>
  93 +
  94 + <!-- 时间滚动输出 level为 WARN 日志 -->
  95 + <appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  96 + <!-- 正在记录的日志文件的路径及文件名 -->
  97 + <file>${log.path}/log_warn.log</file>
  98 + <!--日志文件输出格式-->
  99 + <encoder>
  100 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  101 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  102 + </encoder>
  103 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  104 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  105 + <fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  106 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  107 + <maxFileSize>100MB</maxFileSize>
  108 + </timeBasedFileNamingAndTriggeringPolicy>
  109 + <!--日志文件保留天数-->
  110 + <maxHistory>15</maxHistory>
  111 + </rollingPolicy>
  112 + <!-- 此日志文件只记录warn级别的 -->
  113 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  114 + <level>warn</level>
  115 + <onMatch>ACCEPT</onMatch>
  116 + <onMismatch>DENY</onMismatch>
  117 + </filter>
  118 + </appender>
  119 +
  120 +
  121 + <!-- 时间滚动输出 level为 ERROR 日志 -->
  122 + <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  123 + <!-- 正在记录的日志文件的路径及文件名 -->
  124 + <file>${log.path}/log_error.log</file>
  125 + <!--日志文件输出格式-->
  126 + <encoder>
  127 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  128 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  129 + </encoder>
  130 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  131 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  132 + <fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  133 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  134 + <maxFileSize>100MB</maxFileSize>
  135 + </timeBasedFileNamingAndTriggeringPolicy>
  136 + <!--日志文件保留天数-->
  137 + <maxHistory>15</maxHistory>
  138 + </rollingPolicy>
  139 + <!-- 此日志文件只记录ERROR级别的 -->
  140 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  141 + <level>ERROR</level>
  142 + <onMatch>ACCEPT</onMatch>
  143 + <onMismatch>DENY</onMismatch>
  144 + </filter>
  145 + </appender>
  146 +
  147 + <!-- 时间滚动输出 level为 trace 日志 -->
  148 + <appender name="TRACE_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  149 + <!-- 正在记录的日志文件的路径及文件名 -->
  150 + <file>${log.path}/log_trace.log</file>
  151 + <!--日志文件输出格式-->
  152 + <encoder>
  153 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
  154 + <charset>UTF-8</charset> <!-- 此处设置字符集 -->
  155 + </encoder>
  156 + <!-- 日志记录器的滚动策略,按日期,按大小记录 -->
  157 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  158 + <fileNamePattern>${log.path}/trace/log-trace-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  159 + <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  160 + <maxFileSize>100MB</maxFileSize>
  161 + </timeBasedFileNamingAndTriggeringPolicy>
  162 + <!--日志文件保留天数-->
  163 + <maxHistory>15</maxHistory>
  164 + </rollingPolicy>
  165 + <!-- 此日志文件只记录trace级别的 -->
  166 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  167 + <level>TRACE</level>
  168 + <onMatch>ACCEPT</onMatch>
  169 + <onMismatch>DENY</onMismatch>
  170 + </filter>
  171 + </appender>
  172 +
  173 +
  174 + <!--
  175 + <logger>用来设置某一个包或者具体的某一个类的日志打印级别、
  176 + 以及指定<appender>。<logger>仅有一个name属性,
  177 + 一个可选的level和一个可选的addtivity属性。
  178 + name:用来指定受此logger约束的某一个包或者具体的某一个类。
  179 + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
  180 + 还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
  181 + 如果未设置此属性,那么当前logger将会继承上级的级别。
  182 + addtivity:是否向上级logger传递打印信息。默认是true。
  183 + -->
  184 + <!--<logger name="org.springframework.web" level="info"/>-->
  185 + <!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>-->
  186 + <!--
  187 + 使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
  188 + 第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
  189 + 第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
  190 + -->
  191 +
  192 +
  193 + <!--
  194 + root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
  195 + level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
  196 + 不能设置为INHERITED或者同义词NULL。默认是DEBUG
  197 + 可以包含零个或多个元素,标识这个appender将会添加到这个logger。
  198 + -->
  199 + <!--<logger name="com.tianbo.analysis" level="trace">-->
  200 + <!--<appender-ref ref="CONSOLE" />-->
  201 + <!--<appender-ref ref="TRACE_FILE" />-->
  202 + <!--<appender-ref ref="DEBUG_FILE" />-->
  203 + <!--<appender-ref ref="INFO_FILE" />-->
  204 + <!--<appender-ref ref="WARN_FILE" />-->
  205 + <!--<appender-ref ref="ERROR_FILE" />-->
  206 + <!--</logger>-->
  207 +
  208 + <!--开发环境:打印控制台-->
  209 + <springProfile name="dev">
  210 + <logger name="org.springframework" level="info"/>
  211 + <logger name="com.sunyo.wlpt.nmms.mapper" level="debug">
  212 + <appender-ref ref="CONSOLE" />
  213 + <appender-ref ref="DEBUG_FILE" />
  214 + </logger>
  215 + <logger name="org.apache.tomcat" level="info" />
  216 + <root level="info">
  217 + <appender-ref ref="CONSOLE" />
  218 + <appender-ref ref="TRACE_FILE" />
  219 + <appender-ref ref="DEBUG_FILE" />
  220 + <appender-ref ref="INFO_FILE" />
  221 + <appender-ref ref="WARN_FILE" />
  222 + <appender-ref ref="ERROR_FILE" />
  223 + </root>
  224 + </springProfile>
  225 +
  226 + <!--生产环境:输出到文件-->
  227 + <springProfile name="pro">
  228 + <logger name="org.springframework" level="INFO"/>
  229 + <root level="info">
  230 + <appender-ref ref="CONSOLE" />
  231 + <appender-ref ref="DEBUG_FILE" />
  232 + <appender-ref ref="INFO_FILE" />
  233 + <appender-ref ref="ERROR_FILE" />
  234 + <appender-ref ref="WARN_FILE" />
  235 + <appender-ref ref="TRACE_FILE" />
  236 + </root>
  237 + </springProfile>
  238 +
  239 +</configuration>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<configuration scan="ture" scanPeriod="60 seconds" debug="false">
  3 +
  4 + <springProperty scope="context" name="appname" source="logback.appname"/>
  5 + <springProperty scope="context" name="logdir" source="logback.logdir"/>
  6 + <!--文件名-->
  7 + <contextName>${appname}</contextName>
  8 +
  9 + <!--输出到控制面板-->
  10 + <appender name="consoleLog1" class="ch.qos.logback.core.ConsoleAppender">
  11 + <!-- layout输出方式输出-->
  12 + <layout class="ch.qos.logback.classic.PatternLayout">
  13 + <pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
  14 + </layout>
  15 + </appender>
  16 + <!--输出到控制面板-->
  17 + <appender name="consoleLog" class="ch.qos.logback.core.ConsoleAppender">
  18 + <encoder>
  19 + <pattern>%d [%thread] %-5level %logger{36} - %msg%n</pattern>
  20 + </encoder>
  21 + </appender>
  22 + <!--输出info级别日志-->
  23 + <appender name="fileInfoLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
  24 + <filter class="ch.qos.logback.classic.filter.LevelFilter">
  25 + <!--过滤 Error-->
  26 + <level>ERROR</level>
  27 + <!--匹配到就禁止-->
  28 + <onMatch>DENY</onMatch>
  29 + <!--没有匹配到就允许-->
  30 + <onMismatch>ACCEPT</onMismatch>
  31 + </filter>
  32 + <!--<File>../logs</File>-->
  33 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  34 + <FileNamePattern>${logdir}/info.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern>
  35 + <maxHistory>100</maxHistory>
  36 + <totalSizeCap>100MB</totalSizeCap>
  37 + </rollingPolicy>
  38 + <encoder>
  39 + <charset>UTF-8</charset>
  40 + <pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>
  41 + </encoder>
  42 + </appender>
  43 + <!--输出Error级别日志-->
  44 + <!--<appender name="fileErrorLog" class="ch.qos.logback.core.rolling.RollingFileAppender">-->
  45 + <!--<filter class="ch.qos.logback.classic.filter.LevelFilter">-->
  46 + <!--&lt;!&ndash;过滤 Error &ndash;&gt;-->
  47 + <!--<level>ERROR</level>-->
  48 + <!--</filter>-->
  49 + <!--&lt;!&ndash;<File>../logs</File>&ndash;&gt;-->
  50 + <!--<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">-->
  51 + <!--<FileNamePattern>${logdir}/error.${appname}.%d{yyyy-MM-dd}.log</FileNamePattern>-->
  52 + <!--<maxHistory>100</maxHistory>-->
  53 + <!--<totalSizeCap>100MB</totalSizeCap>-->
  54 + <!--</rollingPolicy>-->
  55 + <!--<encoder>-->
  56 + <!--<charset>UTF-8</charset>-->
  57 + <!--<pattern>%d [%thread] %-5level %logger{36} %line - %msg%n</pattern>-->
  58 + <!--</encoder>-->
  59 + <!--</appender>-->
  60 + <!--监控下列类的所有日志,定义输出级别-->
  61 + <logger name="java.sql.PreparedStatement" level="DEBUG" additivity="false">
  62 + <appender-ref ref="consoleLog"/>
  63 + </logger>    
  64 + <logger name="java.sql.Connection" level="DEBUG" additivity="false"> 
  65 + <appender-ref ref="consoleLog"/>
  66 + </logger>  
  67 + <logger name="java.sql.Statement" level="DEBUG" additivity="false">
  68 + <appender-ref ref="consoleLog"/>
  69 + </logger>    
  70 + <logger name="com.ibatis" level="DEBUG" additivity="false">
  71 + <appender-ref ref="consoleLog"/>
  72 + </logger>    
  73 + <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" additivity="false">
  74 + <appender-ref ref="consoleLog"/>
  75 + </logger>    
  76 + <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" additivity="false">
  77 + <appender-ref ref="consoleLog"/>
  78 + </logger>    
  79 + <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" additivity="false">
  80 + <appender-ref ref="consoleLog"/>
  81 + </logger> 
  82 + <!--输出-->
  83 + <root level="INFO">
  84 + <appender-ref ref="consoleLog"/>
  85 + <!--<appender-ref ref="consoleLog"/>-->
  86 + <appender-ref ref="fileInfoLog"/>
  87 + <!--<appender-ref ref="fileErrorLog"/>-->
  88 + </root>
  89 +
  90 +</configuration>
不能预览此文件类型
  1 +#!/bin/sh
  2 +# ----------------------------------------------------------------------------
  3 +# Licensed to the Apache Software Foundation (ASF) under one
  4 +# or more contributor license agreements. See the NOTICE file
  5 +# distributed with this work for additional information
  6 +# regarding copyright ownership. The ASF licenses this file
  7 +# to you under the Apache License, Version 2.0 (the
  8 +# "License"); you may not use this file except in compliance
  9 +# with the License. You may obtain a copy of the License at
  10 +#
  11 +# https://www.apache.org/licenses/LICENSE-2.0
  12 +#
  13 +# Unless required by applicable law or agreed to in writing,
  14 +# software distributed under the License is distributed on an
  15 +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16 +# KIND, either express or implied. See the License for the
  17 +# specific language governing permissions and limitations
  18 +# under the License.
  19 +# ----------------------------------------------------------------------------
  20 +
  21 +# ----------------------------------------------------------------------------
  22 +# Maven Start Up Batch script
  23 +#
  24 +# Required ENV vars:
  25 +# ------------------
  26 +# JAVA_HOME - location of a JDK home dir
  27 +#
  28 +# Optional ENV vars
  29 +# -----------------
  30 +# M2_HOME - location of maven2's installed home dir
  31 +# MAVEN_OPTS - parameters passed to the Java VM when running Maven
  32 +# e.g. to debug Maven itself, use
  33 +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
  34 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
  35 +# ----------------------------------------------------------------------------
  36 +
  37 +if [ -z "$MAVEN_SKIP_RC" ] ; then
  38 +
  39 + if [ -f /etc/mavenrc ] ; then
  40 + . /etc/mavenrc
  41 + fi
  42 +
  43 + if [ -f "$HOME/.mavenrc" ] ; then
  44 + . "$HOME/.mavenrc"
  45 + fi
  46 +
  47 +fi
  48 +
  49 +# OS specific support. $var _must_ be set to either true or false.
  50 +cygwin=false;
  51 +darwin=false;
  52 +mingw=false
  53 +case "`uname`" in
  54 + CYGWIN*) cygwin=true ;;
  55 + MINGW*) mingw=true;;
  56 + Darwin*) darwin=true
  57 + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
  58 + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
  59 + if [ -z "$JAVA_HOME" ]; then
  60 + if [ -x "/usr/libexec/java_home" ]; then
  61 + export JAVA_HOME="`/usr/libexec/java_home`"
  62 + else
  63 + export JAVA_HOME="/Library/Java/Home"
  64 + fi
  65 + fi
  66 + ;;
  67 +esac
  68 +
  69 +if [ -z "$JAVA_HOME" ] ; then
  70 + if [ -r /etc/gentoo-release ] ; then
  71 + JAVA_HOME=`java-config --jre-home`
  72 + fi
  73 +fi
  74 +
  75 +if [ -z "$M2_HOME" ] ; then
  76 + ## resolve links - $0 may be a link to maven's home
  77 + PRG="$0"
  78 +
  79 + # need this for relative symlinks
  80 + while [ -h "$PRG" ] ; do
  81 + ls=`ls -ld "$PRG"`
  82 + link=`expr "$ls" : '.*-> \(.*\)$'`
  83 + if expr "$link" : '/.*' > /dev/null; then
  84 + PRG="$link"
  85 + else
  86 + PRG="`dirname "$PRG"`/$link"
  87 + fi
  88 + done
  89 +
  90 + saveddir=`pwd`
  91 +
  92 + M2_HOME=`dirname "$PRG"`/..
  93 +
  94 + # make it fully qualified
  95 + M2_HOME=`cd "$M2_HOME" && pwd`
  96 +
  97 + cd "$saveddir"
  98 + # echo Using m2 at $M2_HOME
  99 +fi
  100 +
  101 +# For Cygwin, ensure paths are in UNIX format before anything is touched
  102 +if $cygwin ; then
  103 + [ -n "$M2_HOME" ] &&
  104 + M2_HOME=`cygpath --unix "$M2_HOME"`
  105 + [ -n "$JAVA_HOME" ] &&
  106 + JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
  107 + [ -n "$CLASSPATH" ] &&
  108 + CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
  109 +fi
  110 +
  111 +# For Mingw, ensure paths are in UNIX format before anything is touched
  112 +if $mingw ; then
  113 + [ -n "$M2_HOME" ] &&
  114 + M2_HOME="`(cd "$M2_HOME"; pwd)`"
  115 + [ -n "$JAVA_HOME" ] &&
  116 + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
  117 +fi
  118 +
  119 +if [ -z "$JAVA_HOME" ]; then
  120 + javaExecutable="`which javac`"
  121 + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
  122 + # readlink(1) is not available as standard on Solaris 10.
  123 + readLink=`which readlink`
  124 + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
  125 + if $darwin ; then
  126 + javaHome="`dirname \"$javaExecutable\"`"
  127 + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
  128 + else
  129 + javaExecutable="`readlink -f \"$javaExecutable\"`"
  130 + fi
  131 + javaHome="`dirname \"$javaExecutable\"`"
  132 + javaHome=`expr "$javaHome" : '\(.*\)/bin'`
  133 + JAVA_HOME="$javaHome"
  134 + export JAVA_HOME
  135 + fi
  136 + fi
  137 +fi
  138 +
  139 +if [ -z "$JAVACMD" ] ; then
  140 + if [ -n "$JAVA_HOME" ] ; then
  141 + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
  142 + # IBM's JDK on AIX uses strange locations for the executables
  143 + JAVACMD="$JAVA_HOME/jre/sh/java"
  144 + else
  145 + JAVACMD="$JAVA_HOME/bin/java"
  146 + fi
  147 + else
  148 + JAVACMD="`which java`"
  149 + fi
  150 +fi
  151 +
  152 +if [ ! -x "$JAVACMD" ] ; then
  153 + echo "Error: JAVA_HOME is not defined correctly." >&2
  154 + echo " We cannot execute $JAVACMD" >&2
  155 + exit 1
  156 +fi
  157 +
  158 +if [ -z "$JAVA_HOME" ] ; then
  159 + echo "Warning: JAVA_HOME environment variable is not set."
  160 +fi
  161 +
  162 +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
  163 +
  164 +# traverses directory structure from process work directory to filesystem root
  165 +# first directory with .mvn subdirectory is considered project base directory
  166 +find_maven_basedir() {
  167 +
  168 + if [ -z "$1" ]
  169 + then
  170 + echo "Path not specified to find_maven_basedir"
  171 + return 1
  172 + fi
  173 +
  174 + basedir="$1"
  175 + wdir="$1"
  176 + while [ "$wdir" != '/' ] ; do
  177 + if [ -d "$wdir"/.mvn ] ; then
  178 + basedir=$wdir
  179 + break
  180 + fi
  181 + # workaround for JBEAP-8937 (on Solaris 10/Sparc)
  182 + if [ -d "${wdir}" ]; then
  183 + wdir=`cd "$wdir/.."; pwd`
  184 + fi
  185 + # end of workaround
  186 + done
  187 + echo "${basedir}"
  188 +}
  189 +
  190 +# concatenates all lines of a file
  191 +concat_lines() {
  192 + if [ -f "$1" ]; then
  193 + echo "$(tr -s '\n' ' ' < "$1")"
  194 + fi
  195 +}
  196 +
  197 +BASE_DIR=`find_maven_basedir "$(pwd)"`
  198 +if [ -z "$BASE_DIR" ]; then
  199 + exit 1;
  200 +fi
  201 +
  202 +##########################################################################################
  203 +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
  204 +# This allows using the maven wrapper in projects that prohibit checking in binary data.
  205 +##########################################################################################
  206 +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
  207 + if [ "$MVNW_VERBOSE" = true ]; then
  208 + echo "Found .mvn/wrapper/maven-wrapper.jar"
  209 + fi
  210 +else
  211 + if [ "$MVNW_VERBOSE" = true ]; then
  212 + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
  213 + fi
  214 + if [ -n "$MVNW_REPOURL" ]; then
  215 + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
  216 + else
  217 + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
  218 + fi
  219 + while IFS="=" read key value; do
  220 + case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
  221 + esac
  222 + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
  223 + if [ "$MVNW_VERBOSE" = true ]; then
  224 + echo "Downloading from: $jarUrl"
  225 + fi
  226 + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
  227 + if $cygwin; then
  228 + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
  229 + fi
  230 +
  231 + if command -v wget > /dev/null; then
  232 + if [ "$MVNW_VERBOSE" = true ]; then
  233 + echo "Found wget ... using wget"
  234 + fi
  235 + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
  236 + wget "$jarUrl" -O "$wrapperJarPath"
  237 + else
  238 + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
  239 + fi
  240 + elif command -v curl > /dev/null; then
  241 + if [ "$MVNW_VERBOSE" = true ]; then
  242 + echo "Found curl ... using curl"
  243 + fi
  244 + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
  245 + curl -o "$wrapperJarPath" "$jarUrl" -f
  246 + else
  247 + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
  248 + fi
  249 +
  250 + else
  251 + if [ "$MVNW_VERBOSE" = true ]; then
  252 + echo "Falling back to using Java to download"
  253 + fi
  254 + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
  255 + # For Cygwin, switch paths to Windows format before running javac
  256 + if $cygwin; then
  257 + javaClass=`cygpath --path --windows "$javaClass"`
  258 + fi
  259 + if [ -e "$javaClass" ]; then
  260 + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
  261 + if [ "$MVNW_VERBOSE" = true ]; then
  262 + echo " - Compiling MavenWrapperDownloader.java ..."
  263 + fi
  264 + # Compiling the Java class
  265 + ("$JAVA_HOME/bin/javac" "$javaClass")
  266 + fi
  267 + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
  268 + # Running the downloader
  269 + if [ "$MVNW_VERBOSE" = true ]; then
  270 + echo " - Running MavenWrapperDownloader.java ..."
  271 + fi
  272 + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
  273 + fi
  274 + fi
  275 + fi
  276 +fi
  277 +##########################################################################################
  278 +# End of extension
  279 +##########################################################################################
  280 +
  281 +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
  282 +if [ "$MVNW_VERBOSE" = true ]; then
  283 + echo $MAVEN_PROJECTBASEDIR
  284 +fi
  285 +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
  286 +
  287 +# For Cygwin, switch paths to Windows format before running java
  288 +if $cygwin; then
  289 + [ -n "$M2_HOME" ] &&
  290 + M2_HOME=`cygpath --path --windows "$M2_HOME"`
  291 + [ -n "$JAVA_HOME" ] &&
  292 + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
  293 + [ -n "$CLASSPATH" ] &&
  294 + CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
  295 + [ -n "$MAVEN_PROJECTBASEDIR" ] &&
  296 + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
  297 +fi
  298 +
  299 +# Provide a "standardized" way to retrieve the CLI args that will
  300 +# work with both Windows and non-Windows executions.
  301 +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
  302 +export MAVEN_CMD_LINE_ARGS
  303 +
  304 +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
  305 +
  306 +exec "$JAVACMD" \
  307 + $MAVEN_OPTS \
  308 + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
  309 + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
  310 + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
  1 +@REM ----------------------------------------------------------------------------
  2 +@REM Licensed to the Apache Software Foundation (ASF) under one
  3 +@REM or more contributor license agreements. See the NOTICE file
  4 +@REM distributed with this work for additional information
  5 +@REM regarding copyright ownership. The ASF licenses this file
  6 +@REM to you under the Apache License, Version 2.0 (the
  7 +@REM "License"); you may not use this file except in compliance
  8 +@REM with the License. You may obtain a copy of the License at
  9 +@REM
  10 +@REM https://www.apache.org/licenses/LICENSE-2.0
  11 +@REM
  12 +@REM Unless required by applicable law or agreed to in writing,
  13 +@REM software distributed under the License is distributed on an
  14 +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15 +@REM KIND, either express or implied. See the License for the
  16 +@REM specific language governing permissions and limitations
  17 +@REM under the License.
  18 +@REM ----------------------------------------------------------------------------
  19 +
  20 +@REM ----------------------------------------------------------------------------
  21 +@REM Maven Start Up Batch script
  22 +@REM
  23 +@REM Required ENV vars:
  24 +@REM JAVA_HOME - location of a JDK home dir
  25 +@REM
  26 +@REM Optional ENV vars
  27 +@REM M2_HOME - location of maven2's installed home dir
  28 +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
  29 +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
  30 +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
  31 +@REM e.g. to debug Maven itself, use
  32 +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
  33 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
  34 +@REM ----------------------------------------------------------------------------
  35 +
  36 +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
  37 +@echo off
  38 +@REM set title of command window
  39 +title %0
  40 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
  41 +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
  42 +
  43 +@REM set %HOME% to equivalent of $HOME
  44 +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
  45 +
  46 +@REM Execute a user defined script before this one
  47 +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
  48 +@REM check for pre script, once with legacy .bat ending and once with .cmd ending
  49 +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
  50 +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
  51 +:skipRcPre
  52 +
  53 +@setlocal
  54 +
  55 +set ERROR_CODE=0
  56 +
  57 +@REM To isolate internal variables from possible post scripts, we use another setlocal
  58 +@setlocal
  59 +
  60 +@REM ==== START VALIDATION ====
  61 +if not "%JAVA_HOME%" == "" goto OkJHome
  62 +
  63 +echo.
  64 +echo Error: JAVA_HOME not found in your environment. >&2
  65 +echo Please set the JAVA_HOME variable in your environment to match the >&2
  66 +echo location of your Java installation. >&2
  67 +echo.
  68 +goto error
  69 +
  70 +:OkJHome
  71 +if exist "%JAVA_HOME%\bin\java.exe" goto init
  72 +
  73 +echo.
  74 +echo Error: JAVA_HOME is set to an invalid directory. >&2
  75 +echo JAVA_HOME = "%JAVA_HOME%" >&2
  76 +echo Please set the JAVA_HOME variable in your environment to match the >&2
  77 +echo location of your Java installation. >&2
  78 +echo.
  79 +goto error
  80 +
  81 +@REM ==== END VALIDATION ====
  82 +
  83 +:init
  84 +
  85 +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
  86 +@REM Fallback to current working directory if not found.
  87 +
  88 +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
  89 +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
  90 +
  91 +set EXEC_DIR=%CD%
  92 +set WDIR=%EXEC_DIR%
  93 +:findBaseDir
  94 +IF EXIST "%WDIR%"\.mvn goto baseDirFound
  95 +cd ..
  96 +IF "%WDIR%"=="%CD%" goto baseDirNotFound
  97 +set WDIR=%CD%
  98 +goto findBaseDir
  99 +
  100 +:baseDirFound
  101 +set MAVEN_PROJECTBASEDIR=%WDIR%
  102 +cd "%EXEC_DIR%"
  103 +goto endDetectBaseDir
  104 +
  105 +:baseDirNotFound
  106 +set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
  107 +cd "%EXEC_DIR%"
  108 +
  109 +:endDetectBaseDir
  110 +
  111 +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
  112 +
  113 +@setlocal EnableExtensions EnableDelayedExpansion
  114 +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
  115 +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
  116 +
  117 +:endReadAdditionalConfig
  118 +
  119 +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
  120 +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
  121 +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
  122 +
  123 +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
  124 +
  125 +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
  126 + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
  127 +)
  128 +
  129 +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
  130 +@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
  131 +if exist %WRAPPER_JAR% (
  132 + if "%MVNW_VERBOSE%" == "true" (
  133 + echo Found %WRAPPER_JAR%
  134 + )
  135 +) else (
  136 + if not "%MVNW_REPOURL%" == "" (
  137 + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
  138 + )
  139 + if "%MVNW_VERBOSE%" == "true" (
  140 + echo Couldn't find %WRAPPER_JAR%, downloading it ...
  141 + echo Downloading from: %DOWNLOAD_URL%
  142 + )
  143 +
  144 + powershell -Command "&{"^
  145 + "$webclient = new-object System.Net.WebClient;"^
  146 + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
  147 + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
  148 + "}"^
  149 + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
  150 + "}"
  151 + if "%MVNW_VERBOSE%" == "true" (
  152 + echo Finished downloading %WRAPPER_JAR%
  153 + )
  154 +)
  155 +@REM End of extension
  156 +
  157 +@REM Provide a "standardized" way to retrieve the CLI args that will
  158 +@REM work with both Windows and non-Windows executions.
  159 +set MAVEN_CMD_LINE_ARGS=%*
  160 +
  161 +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
  162 +if ERRORLEVEL 1 goto error
  163 +goto end
  164 +
  165 +:error
  166 +set ERROR_CODE=1
  167 +
  168 +:end
  169 +@endlocal & set ERROR_CODE=%ERROR_CODE%
  170 +
  171 +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
  172 +@REM check for post script, once with legacy .bat ending and once with .cmd ending
  173 +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
  174 +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
  175 +:skipRcPost
  176 +
  177 +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
  178 +if "%MAVEN_BATCH_PAUSE%" == "on" pause
  179 +
  180 +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
  181 +
  182 +exit /B %ERROR_CODE%
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  4 + <modelVersion>4.0.0</modelVersion>
  5 + <parent>
  6 + <groupId>org.springframework.boot</groupId>
  7 + <artifactId>spring-boot-starter-parent</artifactId>
  8 + <version>2.1.7.RELEASE</version>
  9 + <relativePath/> <!-- lookup parent from repository -->
  10 + </parent>
  11 + <groupId>com.sunyo</groupId>
  12 + <artifactId>data_warehouse</artifactId>
  13 + <version>0.0.1-SNAPSHOT</version>
  14 + <name>data_warehouse</name>
  15 + <description>消费者数据仓库</description>
  16 +
  17 + <properties>
  18 + <java.version>1.8</java.version>
  19 + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  20 + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  21 + <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
  22 + </properties>
  23 +
  24 + <dependencies>
  25 + <!-- SpringBoot start -->
  26 + <dependency>
  27 + <groupId>org.springframework.boot</groupId>
  28 + <artifactId>spring-boot-starter</artifactId>
  29 + </dependency>
  30 +
  31 + <dependency>
  32 + <groupId>org.springframework.boot</groupId>
  33 + <artifactId>spring-boot-starter-web</artifactId>
  34 + </dependency>
  35 +
  36 + <!--引入quartz定时框架-->
  37 + <dependency>
  38 + <groupId>org.springframework.boot</groupId>
  39 + <artifactId>spring-boot-starter-quartz</artifactId>
  40 + </dependency>
  41 + <!-- SpringBoot end -->
  42 +
  43 + <!-- Security start -->
  44 + <!--<dependency>
  45 + <groupId>org.springframework.boot</groupId>
  46 + <artifactId>spring-boot-starter-security</artifactId>
  47 + </dependency>-->
  48 + <!-- Security end -->
  49 +
  50 + <!-- SpringCloud start -->
  51 + <dependency>
  52 + <groupId>org.springframework.cloud</groupId>
  53 + <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
  54 + </dependency>
  55 +
  56 + <dependency>
  57 + <groupId>org.springframework.cloud</groupId>
  58 + <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
  59 + </dependency>
  60 +
  61 + <dependency>
  62 + <groupId>org.springframework.cloud</groupId>
  63 + <artifactId>spring-cloud-starter-openfeign</artifactId>
  64 + </dependency>
  65 +
  66 + <dependency>
  67 + <groupId>org.springframework.cloud</groupId>
  68 + <artifactId>spring-cloud-starter-zipkin</artifactId>
  69 + </dependency>
  70 +
  71 + <dependency>
  72 + <groupId>de.codecentric</groupId>
  73 + <artifactId>spring-boot-admin-starter-client</artifactId>
  74 + <version>2.2.0</version>
  75 + </dependency>
  76 + <dependency>
  77 + <groupId>org.springframework.boot</groupId>
  78 + <artifactId>spring-boot-starter-actuator</artifactId>
  79 + </dependency>
  80 + <!-- SpringCloud end -->
  81 +
  82 + <!-- database start -->
  83 + <dependency>
  84 + <groupId>org.mybatis.spring.boot</groupId>
  85 + <artifactId>mybatis-spring-boot-starter</artifactId>
  86 + <version>2.1.1</version>
  87 + </dependency>
  88 +
  89 + <dependency>
  90 + <groupId>com.github.pagehelper</groupId>
  91 + <artifactId>pagehelper-spring-boot-starter</artifactId>
  92 + <version>1.2.12</version>
  93 + </dependency>
  94 +
  95 + <dependency>
  96 + <groupId>com.alibaba</groupId>
  97 + <artifactId>druid-spring-boot-starter</artifactId>
  98 + <version>1.1.9</version>
  99 + </dependency>
  100 + <!-- database end -->
  101 +
  102 + <!-- tools start -->
  103 + <dependency>
  104 + <groupId>org.projectlombok</groupId>
  105 + <artifactId>lombok</artifactId>
  106 + <optional>true</optional>
  107 + </dependency>
  108 +
  109 + <dependency>
  110 + <groupId>log4j</groupId>
  111 + <artifactId>log4j</artifactId>
  112 + <version>1.2.17</version>
  113 + </dependency>
  114 +
  115 + <dependency>
  116 + <groupId>io.springfox</groupId>
  117 + <artifactId>springfox-swagger2</artifactId>
  118 + <version>2.9.2</version>
  119 + </dependency>
  120 + <dependency>
  121 + <groupId>io.springfox</groupId>
  122 + <artifactId>springfox-swagger-ui</artifactId>
  123 + <version>2.9.2</version>
  124 + </dependency>
  125 + <dependency>
  126 + <groupId>io.swagger</groupId>
  127 + <artifactId>swagger-annotations</artifactId>
  128 + <version>1.5.22</version>
  129 + </dependency>
  130 + <dependency>
  131 + <groupId>io.swagger</groupId>
  132 + <artifactId>swagger-models</artifactId>
  133 + <version>1.5.22</version>
  134 + </dependency>
  135 +
  136 + <dependency>
  137 + <groupId>com.alibaba</groupId>
  138 + <artifactId>fastjson</artifactId>
  139 + <version>1.2.49</version>
  140 + </dependency>
  141 + <dependency>
  142 + <groupId>joda-time</groupId>
  143 + <artifactId>joda-time</artifactId>
  144 + <version>2.10.5</version>
  145 + </dependency>
  146 + <!-- tools end -->
  147 +
  148 + <!-- test start -->
  149 + <dependency>
  150 + <groupId>org.springframework.boot</groupId>
  151 + <artifactId>spring-boot-starter-test</artifactId>
  152 + <scope>test</scope>
  153 + <exclusions>
  154 + <exclusion>
  155 + <groupId>org.junit.vintage</groupId>
  156 + <artifactId>junit-vintage-engine</artifactId>
  157 + </exclusion>
  158 + </exclusions>
  159 + </dependency>
  160 + <!-- test end -->
  161 + </dependencies>
  162 +
  163 + <dependencyManagement>
  164 + <dependencies>
  165 + <dependency>
  166 + <groupId>org.springframework.cloud</groupId>
  167 + <artifactId>spring-cloud-dependencies</artifactId>
  168 + <version>${spring-cloud.version}</version>
  169 + <type>pom</type>
  170 + <scope>import</scope>
  171 + </dependency>
  172 + </dependencies>
  173 + </dependencyManagement>
  174 +
  175 + <build>
  176 + <plugins>
  177 + <plugin>
  178 + <groupId>org.springframework.boot</groupId>
  179 + <artifactId>spring-boot-maven-plugin</artifactId>
  180 + <configuration>
  181 + <mainClass>com.sunyo.wlpt.data.warehouse.DataWarehouseApplication</mainClass>
  182 + </configuration>
  183 + </plugin>
  184 + </plugins>
  185 + </build>
  186 +
  187 + <repositories>
  188 + <repository>
  189 + <id>spring-snapshots</id>
  190 + <name>Spring Snapshots</name>
  191 + <url>https://repo.spring.io/snapshot</url>
  192 + <snapshots>
  193 + <enabled>true</enabled>
  194 + </snapshots>
  195 + </repository>
  196 + <repository>
  197 + <id>spring-milestones</id>
  198 + <name>Spring Milestones</name>
  199 + <url>https://repo.spring.io/milestone</url>
  200 + <snapshots>
  201 + <enabled>false</enabled>
  202 + </snapshots>
  203 + </repository>
  204 + </repositories>
  205 +
  206 +</project>
  1 +package com.sunyo.wlpt.data.warehouse;
  2 +
  3 +import org.mybatis.spring.annotation.MapperScan;
  4 +import org.springframework.boot.SpringApplication;
  5 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  6 +import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
  7 +import org.springframework.cloud.openfeign.EnableFeignClients;
  8 +import org.springframework.scheduling.annotation.EnableScheduling;
  9 +import org.springframework.transaction.annotation.EnableTransactionManagement;
  10 +
  11 +@EnableScheduling
  12 +@SpringBootApplication
  13 +@MapperScan("com.sunyo.wlpt.data.warehouse.mapper")
  14 +@EnableFeignClients
  15 +@EnableEurekaClient
  16 +@EnableTransactionManagement
  17 +public class DataWarehouseApplication {
  18 +
  19 + public static void main(String[] args) {
  20 + SpringApplication.run(DataWarehouseApplication.class, args);
  21 + }
  22 +
  23 +}
  1 +package com.sunyo.wlpt.data.warehouse.commons;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonFormat;
  4 +import lombok.AllArgsConstructor;
  5 +import lombok.Data;
  6 +import lombok.NoArgsConstructor;
  7 +
  8 +import java.io.Serializable;
  9 +import java.math.BigDecimal;
  10 +import java.util.Date;
  11 +
  12 +/**
  13 + * @author 子诚
  14 + * Description:实体类:新舱单——理货信息.最终返回结果类
  15 + * 时间:2020/5/20 10:40
  16 + */
  17 +@Data
  18 +@AllArgsConstructor
  19 +@NoArgsConstructor
  20 +public class ResultExitData implements Serializable {
  21 +
  22 + private static final long serialVersionUID = -260680809813827352L;
  23 +
  24 + /**
  25 + * 1.id
  26 + */
  27 + private String autoId;
  28 +
  29 + /**
  30 + * 2.运单号
  31 + */
  32 + private String waybillNoMaster;
  33 +
  34 + /**
  35 + * 3.航班号
  36 + */
  37 + private String flightNo;
  38 +
  39 + /**
  40 + * 4.航班日期
  41 + */
  42 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  43 + private Date flightDate;
  44 +
  45 + /**
  46 + * 5.航段
  47 + */
  48 + private String segment;
  49 +
  50 + /**
  51 + * 6.航班起始站
  52 + */
  53 + private String originatingStation;
  54 +
  55 + /**
  56 + * 7.航班目的站
  57 + */
  58 + private String destinationStation;
  59 +
  60 + /**
  61 + * 8.理货件数
  62 + */
  63 + private String tallyTotalPiece;
  64 +
  65 + /**
  66 + * 9.理货重量
  67 + */
  68 + private String tallyTotalWeight;
  69 +
  70 + /**
  71 + * 10.承运人二字码
  72 + */
  73 + private String carrier;
  74 +
  75 + /**
  76 + * 11.发货人名称
  77 + */
  78 + private String shipperName;
  79 +
  80 + /**
  81 + * 12.收货人名称
  82 + */
  83 + private String consigneeName;
  84 +
  85 + /**
  86 + * 13.货物目的站
  87 + */
  88 + private String aimStation;
  89 + /**
  90 + * 14.国家代码
  91 + */
  92 + private String country;
  93 +
  94 + /**
  95 + * 15.航班目的区域,中文描述,所属洲
  96 + */
  97 + private String areaDescChn;
  98 +
  99 + /**
  100 + * 16.代理人全称
  101 + */
  102 + private String fullName;
  103 +
  104 + /**
  105 + * 17.货主类型
  106 + * 111 = 发货代理
  107 + * 222 = 订舱代理
  108 + * 333 = 操作代理/结算代理
  109 + */
  110 + private String theShipperType;
  111 +
  112 + /**
  113 + * 18.品名
  114 + */
  115 + private String sdCargoName;
  116 +
  117 + /**
  118 + * 19.二级类名称
  119 + */
  120 + private String twoTypeName;
  121 +
  122 + /**
  123 + * 20.一级类名称
  124 + */
  125 + private String typeName;
  126 +
  127 + /**
  128 + * 21.航空公司
  129 + */
  130 + private String airCompany;
  131 +
  132 + /**
  133 + * 22.机型
  134 + */
  135 + private String cfTp;
  136 +
  137 + /**
  138 + * 23.机号
  139 + */
  140 + private String cfNo;
  141 +
  142 + /**
  143 + * 24.航班(起飞)时间
  144 + */
  145 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  146 + private Date flightTime;
  147 +
  148 + /**
  149 + * 25.航班计划日期
  150 + */
  151 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
  152 + private Date flightPlanDate;
  153 +
  154 + /**
  155 + * 26.航班计划时间
  156 + */
  157 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  158 + private Date flightPlanTime;
  159 +
  160 + /**
  161 + * 27.计费重量
  162 + */
  163 + private BigDecimal totalGrossWeightMeasure;
  164 +
  165 + /**
  166 + * 28.体积
  167 + */
  168 + private BigDecimal volumeMeasure;
  169 +
  170 +
  171 +}
  1 +package com.sunyo.wlpt.data.warehouse.controller;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.commons.ResultExitData;
  4 +import com.sunyo.wlpt.data.warehouse.domain.TxdUdep;
  5 +import com.sunyo.wlpt.data.warehouse.domain.TxdUfoh;
  6 +import com.sunyo.wlpt.data.warehouse.service.TxdUdepService;
  7 +import com.sunyo.wlpt.data.warehouse.service.TxdUfohService;
  8 +import org.springframework.web.bind.annotation.*;
  9 +
  10 +import javax.annotation.Resource;
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * @author 子诚
  15 + * Description:获取数据仓库服务的相关数据
  16 + * 时间:2020/5/25 9:19
  17 + */
  18 +@CrossOrigin
  19 +@RequestMapping("data")
  20 +@RestController
  21 +public class DataWareHouseController {
  22 +
  23 + @Resource
  24 + private TxdUdepService txdUdepService;
  25 +
  26 + @Resource
  27 + private TxdUfohService txdUfohService;
  28 +
  29 + /**
  30 + * 获取数据仓库服务的相关数据.
  31 + *
  32 + * @param resultList {@link ResultExitData}
  33 + * @return
  34 + */
  35 + @PutMapping("/getInfo")
  36 + public List<ResultExitData> getInfo(@RequestBody List<ResultExitData> resultList) {
  37 + System.out.println("开始调用数据仓库服务");
  38 + System.out.println("长度为" + resultList.size());
  39 + for (int i = 0, resultSize = resultList.size(); i < resultSize; i++) {
  40 + ResultExitData result = resultList.get(i);
  41 + System.out.println(i + "运单号" + result.getWaybillNoMaster());
  42 +
  43 + /**
  44 + * 根据运单号,获取 TxdUdep 中的体积
  45 + */
  46 + List<TxdUdep> txdUdeps = txdUdepService.getTxdUdepInfo(result.getWaybillNoMaster());
  47 + if (txdUdeps != null && txdUdeps.size() > 0) {
  48 + //设置体积
  49 + result.setVolumeMeasure(txdUdeps.get(0).getVolumeMeasure());
  50 + }
  51 + /**
  52 + * 根据运单号,获取计费重量
  53 + */
  54 + List<TxdUfoh> txdUfoInfo = txdUfohService.getTxdUfoInfo(result.getWaybillNoMaster());
  55 + if (txdUfoInfo != null && txdUfoInfo.size() > 0) {
  56 + //设置计费重量
  57 + result.setTotalGrossWeightMeasure(txdUfoInfo.get(0).getTotalGrossWeightMeasure());
  58 + }
  59 + }
  60 + System.out.println("数据仓库服务,调用完毕");
  61 + return resultList;
  62 + }
  63 +}
  1 +package com.sunyo.wlpt.data.warehouse.domain;
  2 +
  3 +import java.io.Serializable;
  4 +import java.math.BigDecimal;
  5 +
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Data;
  8 +import lombok.NoArgsConstructor;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:数据仓库——出港理货
  13 + * 时间:2020/5/25 14:12
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@NoArgsConstructor
  18 +public class TxdUdep implements Serializable {
  19 +
  20 + private static final long serialVersionUID = 4995753127963045175L;
  21 +
  22 + /**
  23 + * 运单号
  24 + */
  25 + private String trId;
  26 +
  27 + /**
  28 + * 体积
  29 + */
  30 + private BigDecimal volumeMeasure;
  31 +}
  1 +package com.sunyo.wlpt.data.warehouse.domain;
  2 +
  3 +import java.io.Serializable;
  4 +import java.math.BigDecimal;
  5 +
  6 +import lombok.AllArgsConstructor;
  7 +import lombok.Data;
  8 +import lombok.NoArgsConstructor;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:数据仓库出港理货
  13 + * 时间:2020/5/25 14:19
  14 + */
  15 +@Data
  16 +@AllArgsConstructor
  17 +@NoArgsConstructor
  18 +public class TxdUfoh implements Serializable {
  19 +
  20 + private static final long serialVersionUID = -8169644012291021274L;
  21 +
  22 + /**
  23 + * 运单号
  24 + */
  25 + private String tcdId;
  26 +
  27 + /**
  28 + * 计费重量
  29 + */
  30 + private BigDecimal totalGrossWeightMeasure;
  31 +
  32 +}
  1 +package com.sunyo.wlpt.data.warehouse.feign;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.commons.ResultExitData;
  4 +import org.springframework.cloud.openfeign.FeignClient;
  5 +import org.springframework.stereotype.Component;
  6 +import org.springframework.web.bind.annotation.GetMapping;
  7 +import org.springframework.web.bind.annotation.RequestParam;
  8 +
  9 +import java.util.Date;
  10 +import java.util.List;
  11 +
  12 +/**
  13 + * @author 子诚
  14 + * Description:
  15 + * 时间:2020/5/25 9:48
  16 + */
  17 +@Component
  18 +@FeignClient(value = "cgonms-provide", fallback = GetCgoNmsFeignHystrix.class)
  19 +public interface GetCgoNmsFeign {
  20 + /**
  21 + * 根据航班日期、航班号,获取出出港业务统计数据
  22 + *
  23 + * @param flightDate 航班日期
  24 + * @param flightNo 航班号
  25 + * @return {@link ResultExitData}
  26 + */
  27 + @GetMapping("/cgonms/getInfo")
  28 + public List<ResultExitData> getData(
  29 + @RequestParam(value = "flightDate", required = false) Date flightDate,
  30 + @RequestParam(value = "flightNo", required = false) String flightNo);
  31 +}
  1 +package com.sunyo.wlpt.data.warehouse.feign;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.commons.ResultExitData;
  4 +import org.springframework.stereotype.Service;
  5 +
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +/**
  10 + * @author 子诚
  11 + * Description:GetCgoNmsFeign的熔断器
  12 + * 时间:2020/5/25 9:48
  13 + */
  14 +@Service
  15 +public class GetCgoNmsFeignHystrix implements GetCgoNmsFeign{
  16 +
  17 + /**
  18 + * 熔断器方法
  19 + *
  20 + * @param flightDate 航班日期
  21 + * @param flightNo 航班号
  22 + * @return
  23 + */
  24 + @Override
  25 + public List<ResultExitData> getData(Date flightDate, String flightNo) {
  26 + System.out.println("与 新舱单服务 断开连接");
  27 + return null;
  28 + }
  29 +}
  1 +package com.sunyo.wlpt.data.warehouse.mapper;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.domain.TxdUdep;
  4 +import org.apache.ibatis.annotations.Mapper;
  5 +
  6 +import java.util.List;
  7 +
  8 +/**
  9 + * @author 子诚
  10 + * Description:
  11 + * 时间:2020/5/25 14:12
  12 + */
  13 +@Mapper
  14 +public interface TxdUdepMapper {
  15 + /**
  16 + * 根据运单号,查询体积
  17 + *
  18 + * @param waybillNoMaster 运单号
  19 + * @return {@link TxdUdep}
  20 + */
  21 + List<TxdUdep> getTxdUdepInfo(String waybillNoMaster);
  22 +}
  1 +package com.sunyo.wlpt.data.warehouse.mapper;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.domain.TxdUfoh;
  4 +import org.apache.ibatis.annotations.Mapper;
  5 +
  6 +import java.util.List;
  7 +
  8 +/**
  9 + * @author 子诚
  10 + * Description:
  11 + * 时间:2020/5/25 14:19
  12 + */
  13 +@Mapper
  14 +public interface TxdUfohMapper {
  15 + /**
  16 + * 根据运单号,查询计费重量
  17 + *
  18 + * @param waybillNoMaster 运单号
  19 + * @return {@link TxdUfoh}
  20 + */
  21 + List<TxdUfoh> getTxdUfoInfo(String waybillNoMaster);
  22 +}
  1 +package com.sunyo.wlpt.data.warehouse.schedule;
  2 +
  3 +import org.quartz.*;
  4 +import org.springframework.context.annotation.Bean;
  5 +import org.springframework.context.annotation.Configuration;
  6 +
  7 +/**
  8 + * @author 子诚
  9 + * Description:Quartz定时配置类
  10 + * 时间:2020/5/25 9:40
  11 + */
  12 +@Configuration
  13 +public class QuartzConfig {
  14 + /**
  15 + * 指定具体的定时任务类.
  16 + *
  17 + * @return
  18 + */
  19 + @Bean
  20 + public JobDetail uploadTaskDetail() {
  21 + return JobBuilder.newJob(QuartzTask.class).withIdentity("QuartzTask").storeDurably().build();
  22 + }
  23 +
  24 + @Bean
  25 + public Trigger uploadTaskTrigger() {
  26 + /**
  27 + * 这里设定触发执行的方式
  28 + * 每天4点执行任务
  29 + */
  30 + CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule("0 0 4 * * ?");
  31 + // 返回任务触发器
  32 + return TriggerBuilder.newTrigger().forJob(uploadTaskDetail())
  33 + .withIdentity("QuartzTask")
  34 + .withSchedule(scheduleBuilder)
  35 + .build();
  36 + }
  37 +}
  1 +package com.sunyo.wlpt.data.warehouse.schedule;
  2 +
  3 +import org.quartz.JobExecutionContext;
  4 +import org.quartz.JobExecutionException;
  5 +import org.springframework.scheduling.quartz.QuartzJobBean;
  6 +
  7 +import java.util.Calendar;
  8 +import java.util.Date;
  9 +
  10 +/**
  11 + * @author 子诚
  12 + * Description:定时任务类
  13 + * 时间:2020/5/25 9:38
  14 + */
  15 +public class QuartzTask extends QuartzJobBean {
  16 + /**
  17 + * 创建需要被定时执行的方法
  18 + *
  19 + * @param jobExecutionContext
  20 + * @throws JobExecutionException
  21 + */
  22 + @Override
  23 + protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
  24 + //每天凌晨四点查询昨天的数据
  25 + }
  26 +
  27 + /**
  28 + * 返回昨天.
  29 + *
  30 + * @param today
  31 + * @return
  32 + */
  33 + public Date yesterday(Date today) {
  34 + Calendar calendar = Calendar.getInstance();
  35 + calendar.setTime(today);
  36 + calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 1);
  37 + return calendar.getTime();
  38 + }
  39 +
  40 +
  41 +}
  1 +package com.sunyo.wlpt.data.warehouse.service;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.domain.TxdUdep;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * @author 子诚
  9 + * Description:
  10 + * 时间:2020/5/25 14:12
  11 + */
  12 +public interface TxdUdepService {
  13 +
  14 + /**
  15 + * 根据运单号,查询体积
  16 + *
  17 + * @param waybillNoMaster 运单号
  18 + * @return {@link TxdUdep}
  19 + */
  20 + List<TxdUdep> getTxdUdepInfo(String waybillNoMaster);
  21 +}
  1 +package com.sunyo.wlpt.data.warehouse.service;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.domain.TxdUfoh;
  4 +
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * @author 子诚
  9 + * Description:
  10 + * 时间:2020/5/25 14:18
  11 + */
  12 +public interface TxdUfohService {
  13 +
  14 + /**
  15 + * 根据运单号,查询计费重量
  16 + *
  17 + * @param waybillNoMaster 运单号
  18 + * @return {@link TxdUfoh}
  19 + */
  20 + List<TxdUfoh> getTxdUfoInfo(String waybillNoMaster);
  21 +}
  22 +
  1 +package com.sunyo.wlpt.data.warehouse.service.impl;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.domain.TxdUdep;
  4 +import org.springframework.stereotype.Service;
  5 +import javax.annotation.Resource;
  6 +import com.sunyo.wlpt.data.warehouse.mapper.TxdUdepMapper;
  7 +import com.sunyo.wlpt.data.warehouse.service.TxdUdepService;
  8 +
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * @author 子诚
  13 + * Description:
  14 + * 时间:2020/5/25 14:12
  15 + */
  16 +@Service
  17 +public class TxdUdepServiceImpl implements TxdUdepService{
  18 +
  19 + @Resource
  20 + private TxdUdepMapper txdUdepMapper;
  21 +
  22 + @Override
  23 + public List<TxdUdep> getTxdUdepInfo(String waybillNoMaster) {
  24 + return txdUdepMapper.getTxdUdepInfo(waybillNoMaster);
  25 + }
  26 +}
  1 +package com.sunyo.wlpt.data.warehouse.service.impl;
  2 +
  3 +import com.sunyo.wlpt.data.warehouse.domain.TxdUfoh;
  4 +import org.springframework.stereotype.Service;
  5 +
  6 +import javax.annotation.Resource;
  7 +
  8 +import com.sunyo.wlpt.data.warehouse.mapper.TxdUfohMapper;
  9 +import com.sunyo.wlpt.data.warehouse.service.TxdUfohService;
  10 +
  11 +import java.util.List;
  12 +
  13 +/**
  14 + * @author 子诚
  15 + * Description:
  16 + * 时间:2020/5/25 14:18
  17 + */
  18 +@Service
  19 +public class TxdUfohServiceImpl implements TxdUfohService {
  20 +
  21 + @Resource
  22 + private TxdUfohMapper txdUfohMapper;
  23 +
  24 + @Override
  25 + public List<TxdUfoh> getTxdUfoInfo(String waybillNoMaster) {
  26 + return txdUfohMapper.getTxdUfoInfo(waybillNoMaster);
  27 + }
  28 +}
  29 +
  1 +server:
  2 + port: 9004
  3 +
  4 +# spring
  5 +spring:
  6 + application:
  7 + name: data-warehouse
  8 + datasource:
  9 + type: com.alibaba.druid.pool.DruidDataSource
  10 + driver-class-name: oracle.jdbc.OracleDriver
  11 + url: jdbc:oracle:thin:@192.168.1.4:10068:CGODW
  12 + username: CGOETL
  13 + password: 1q2w3e4r
  14 +
  15 + initial-size: 10
  16 + max-active: 50
  17 + min-idle: 5
  18 + max-wait: 60000
  19 + profiles:
  20 + active: dev
  21 + jackson:
  22 + default-property-inclusion: ALWAYS
  23 + time-zone: GMT+8
  24 + date-format: yyyy-MM-dd
  25 + # security:
  26 + # user:
  27 + # name: admin
  28 + # password: 123456
  29 + # \u94FE\u8DEF\u8FFD\u8E2A\u914D\u7F6E
  30 + zipkin:
  31 + base-url: http://192.168.1.63:9411
  32 + sleuth:
  33 + sampler:
  34 + probability: 1
  35 +
  36 +# mybatis\u914D\u7F6E
  37 +mybatis:
  38 + mapper-locations: classpath:mapper/*.xml
  39 + type-aliases-package: com.sunyo.wlpt.data.warehouse.domain
  40 +
  41 +# \u65E5\u5FD7\u6253\u5370
  42 +#logging:
  43 +# config: config/logback-dev.xml
  44 +# level:
  45 +# com.sunyo.wlpt.data.warehouse.mapper: debug
  46 +#logback:
  47 +# appname: data-warehouse
  48 +# logdir: ./log
  49 +
  50 +
  51 +#eureka client
  52 +eureka:
  53 + instance:
  54 + status-page-url: http://${eureka.instance.hostname}:${server.port}/index
  55 + prefer-ip-address: true
  56 + instance-id: ${spring.cloud.client.ip-address}:${server.port}
  57 + hostname: ${spring.cloud.client.ip-address}
  58 + # metadata-map:
  59 + # user:
  60 + # name: "admin"
  61 + # passwoed: "123456"
  62 + client:
  63 + healthcheck:
  64 + enabled: true
  65 + service-url:
  66 + defaultZone: http://192.168.1.53:12345/eureka/
  67 +
  68 +feign:
  69 + hystrix:
  70 + enabled: false
  71 + client:
  72 + config:
  73 + default:
  74 + connectTimeout: 60000000 # feign \u7684\u8D85\u65F6\u8BBE\u7F6E
  75 + readTimeout: 60000000
  76 +# boot admin
  77 +management:
  78 + endpoints:
  79 + enabled-by-default: true
  80 + web:
  81 + exposure:
  82 + include: ["*"]
  83 + endpoint:
  84 + health:
  85 + show-details: always
  86 + shutdown:
  87 + enabled: true
  88 +
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sunyo.wlpt.data.warehouse.mapper.TxdUdepMapper">
  4 + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.data.warehouse.domain.TxdUdep">
  5 + <!--@mbg.generated-->
  6 + <!--@Table T_TXD_UDEP-->
  7 + <result column="TR_ID" jdbcType="VARCHAR" property="trId"/>
  8 + <result column="AS_GROSSVOLUMEMEASURE" jdbcType="DECIMAL" property="volumeMeasure"/>
  9 + </resultMap>
  10 + <sql id="Base_Column_List">
  11 + <!--@mbg.generated-->
  12 + TR_ID, AS_GROSSVOLUMEMEASURE
  13 + </sql>
  14 + <select id="getTxdUdepInfo" parameterType="java.lang.String"
  15 + resultMap="BaseResultMap">
  16 + select
  17 + <include refid="Base_Column_List"/>
  18 + from T_TXD_UDEP
  19 + where TR_ID = #{waybillNoMaster,jdbcType=VARCHAR}
  20 + </select>
  21 +</mapper>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.sunyo.wlpt.data.warehouse.mapper.TxdUfohMapper">
  4 + <resultMap id="BaseResultMap" type="com.sunyo.wlpt.data.warehouse.domain.TxdUfoh">
  5 + <!--@mbg.generated-->
  6 + <!--@Table T_TXD_UFOH-->
  7 + <result column="TOTALGROSSWEIGHTMEASURE" jdbcType="DECIMAL" property="totalGrossWeightMeasure"/>
  8 + <result column="TCD_ID" jdbcType="VARCHAR" property="tcdId"/>
  9 + </resultMap>
  10 + <sql id="Base_Column_List">
  11 + <!--@mbg.generated-->
  12 + TOTALGROSSWEIGHTMEASURE, TCD_ID
  13 + </sql>
  14 + <select id="getTxdUfoInfo" parameterType="java.lang.String"
  15 + resultMap="BaseResultMap">
  16 + select
  17 + <include refid="Base_Column_List"/>
  18 + from T_TXD_UFOH
  19 + where TCD_ID = #{waybillNoMaster,jdbcType=VARCHAR}
  20 +
  21 + </select>
  22 +</mapper>