Commit 3bbc4d92 authored by Administrator's avatar Administrator

创建项目

parent 10a6d1b7
Pipeline #1084 failed with stages
...@@ -35,7 +35,10 @@ ...@@ -35,7 +35,10 @@
.Trashes .Trashes
Icon? Icon?
ehthumbs.db ehthumbs.db
Thumbs.db .db
.csv
.xlsx
.xls
# Eclipse generated files # # Eclipse generated files #
.classpath .classpath
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>quant-andy</artifactId>
<groupId>cn.quant.andy</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quant-andy-csv</artifactId>
<name>quant-andy-csv</name>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
package cn.quant.andy.csv;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
import java.io.FileReader;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
/**
* Created by Administrator on 2021/7/19 0019.
*/
public class CSVReader {
public static void read(int term, String file, int skip, CSVRecordHandler handler) throws Exception {
Reader in = new FileReader(file);
// Iterable<CSVRecord> records = CSVFormat.EXCEL.withHeader().parse(in);
Iterable<CSVRecord> records = CSVFormat.DEFAULT.parse(in);
for (CSVRecord record : records) {
if (skip-- > 0) {
continue;
}
String[] arrays = arrays(record);
handler.read(term, record.getRecordNumber(), arrays);
// return;
}
}
private static String[] arrays(CSVRecord record) throws UnsupportedEncodingException {
String[] strings = new String[record.size()];
for (int i = 0, l = record.size(); i < l; i++) {
strings[i] = record.get(i);
}
return strings;
}
public static void main(String[] args) {
// try {
// CSVReader.read(1, "D:\\workspace\\quant-andy\\1.0.0\\quant-andy-server\\template\\WX_2021-06-01_2021-06-30.txt"
// , 1
// , new CSVRecordHandler() {
// @Override
// public void read(int term, long number, String[] record) {
//
// }
// });
// } catch (IOException e) {
// e.printStackTrace();
// }
}
}
package cn.quant.andy.csv;
/**
* Created by Administrator on 2021/7/19 0019.
*/
public interface CSVRecordHandler {
boolean read(int term, long number, String[] record);
}
package cn.quant.andy;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
import org.junit.Test;
import java.io.FileReader;
import java.io.Reader;
/**
* Created by Administrator on 2021/7/15 0015.
*/
public class CVSTest {
@Test
public void read() {
try {
Reader in = new FileReader("D:\\workspace\\quant-andy\\1.0.0\\quant-andy-server\\template\\wx_2021-06-01_2021-06-30.csv");
// Iterable<CSVRecord> records = CSVFormat.EXCEL.withHeader().parse(in);
Iterable<CSVRecord> records = CSVFormat.DEFAULT.parse(in);
int i = 1;
for (CSVRecord record : records) {
StringBuilder builder = new StringBuilder();
builder.append(i++).append(" ");
builder.append(record.get(0)).append(" ");
builder.append(record.get(1)).append(" ");
builder.append(record.get(2)).append(" ");
builder.append(record.get(3)).append(" ");
builder.append(record.get(4)).append(" ");
builder.append(record.get(5)).append(" ");
builder.append(record.get(6)).append(" ");
builder.append(record.get(7));
System.out.println(builder.toString());
}
System.currentTimeMillis();
} catch (Exception e) {
e.printStackTrace();
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>cn.quant.andy</groupId>
<artifactId>quant-andy</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>cn.quant.andy</groupId>
<artifactId>quant-andy-server</artifactId>
<name>quant-andy-server</name>
<packaging>jar</packaging>
<properties>
<skipTests>true</skipTests>
</properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!--quant-->
<dependency>
<groupId>cn.quant.spring.boot</groupId>
<artifactId>quant-spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>cn.quant.andy</groupId>
<artifactId>quant-andy-core</artifactId>
<version>1.0.0</version>
</dependency>
<!--spring cloud-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
<!--dangdang-->
<dependency>
<groupId>com.dangdang</groupId>
<artifactId>elastic-job-lite-spring</artifactId>
<version>2.0.5</version>
<exclusions>
<exclusion>
<groupId>org.apache.curator</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--zookeeper-->
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-client</artifactId>
<version>2.10.0</version>
<exclusions>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--test-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</exclusion>
<exclusion>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>cn.quant.andy.ScheduleApplication</mainClass>
<layout>ZIP</layout>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<assembly>
<id>servers</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>target/bin</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>target/${project.package.name}.jar</source>
<outputDirectory>/</outputDirectory>
<destName>${project.package.name}.jar</destName>
</file>
<file>
<source>target/classes/application-${spring.profiles.active}.properties</source>
<outputDirectory>/classes</outputDirectory>
<destName>application.properties</destName>
</file>
<file>
<source>target/classes/logback-spring.xml</source>
<outputDirectory>/classes</outputDirectory>
<destName>logback-spring.xml</destName>
</file>
</files>
</assembly>
\ No newline at end of file
#!/bin/sh
JAVA="$JAVA_HOME/bin/java"
JAVAPS="$JAVA_HOME/bin/jps"
if $cygwin
then
KILL=/bin/kill
else
KILL=kill
fi
if readlink -f "$0" > /dev/null 2>&1
then
APP_BIN=$(readlink -f $0)
else
APP_BIN=$(pwd -P)
fi
#APP_HOME=${APP_BIN%'/bin'*}
APP_HOME=${APP_BIN%'/'*}
echo "[INFO]Terminate the server; home=$APP_HOME"
CPS=$(ps -e -opid,cmd | grep -i "^[0-9]* .*/java .*-Dapplication.home.dir=$APP_HOME .*${project.name}.*\.jar" | grep -v "grep" | head -n 1 | awk '{print $1}')
if [ -z "$CPS" ]; then
echo "[INFO]server is not running"
exit 1
else
PSID=${CPS%%" /"*}
if [ $PSID -eq 0 ]; then
echo "[ERROR]Not found PID"
exit 1
else
$KILL -15 $PSID
echo "[INFO]Stopped server; home=$APP_HOME; PID=$PSID"
exit 0
fi
fi
\ No newline at end of file
#!/bin/sh
if [ "$JAVA_HOME" != "" ]; then
JAVA="$JAVA_HOME/bin/java"
else
JAVA=java
fi
echo "JAVA: "$JAVA
if readlink -f "$0" > /dev/null 2>&1
then
BIN_PATH=$(readlink -f $0)
else
BIN_PATH=$(pwd -P)
fi
#APP_HOME=${BIN_PATH%"/bin"*}
APP_HOME=${BIN_PATH%"/"*}
echo "APP_HOME: "$APP_HOME
APP_JAR=$(find "$APP_HOME" -maxdepth 1 -name "${project.name}*\.jar" | head -n 1)
if [ -z "$APP_JAR" ]; then
echo "[ERROR]Not found main jar file"
exit 1
fi
echo "APP_JAR: "$APP_JAR
echo "[INFO]Start the server; home=$APP_HOME"
CPS=$(ps -e -opid,cmd | grep -i "^[0-9]* .*/java .*-Dapplication.home.dir=$APP_HOME .*${project.name}.*\.jar" | grep -v "grep" | head -n 1 | awk '{print $1}')
if [ -n "$CRACKPS" ]; then
echo "[ERROR]Server is running;"
exit 1
else
JAVAOPTS="-Xms512m -Xmx1024m -Xmn256m -Xss1024k"
APPOPTS="-Dfile.encoding=UTF-8 -Dapplication.home.dir=$APP_HOME -Dlogging.config=./config/logback-spring.xml"
echo "[INFO]Application options: $APPOPTS"
$JAVA $JAVAOPTS $APPOPTS "-jar" $APP_JAR "--spring.config.file=$APP_HOME/config/application.properties" 2>&1 >/dev/null &
#echo $JAVA $JAVAOPTS "-jar" $APP_JAR
exit 0
fi
\ No newline at end of file
package cn.quant.andy;
import cn.quant.spring.util.ServerUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.env.Environment;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
/**
* <p>Application VM Option:<br/>
* <code>--spring.config.file=${project.build.directory}/config/application-dev.properties </code><br/>
* <code>-Dlogging.config=${project.build.directory}/config/logback-spring.xml</code></p>
* <p>Enable Mybatis Annotation:<br/>
* <code>@org.mybatis.spring.annotation.MapperScan("cn.quant.andy.mapper")</code></p>
* <p>Enable Dubbo Annotation: <br/>
* <code>@org.springframework.context.annotation.ImportResource(locations = {"classpath:application-dubbo.xml"})</code></p>
* <p>Enable JPA Annotation:<br/>
* <code>@EntityScan("cn.quant.andy.jpa.entity")</code><br/>
* <code>@org.springframework.data.jpa.repository.config.EnableJpaRepositories("cn.quant.andy.jpa.repository")</code></p>
* <p>Enable Auditor Aware Annotation:<br/>
* <code>@org.springframework.data.jpa.repository.config.EnableJpaAuditing(auditorAwareRef = "auditorAwareHandler")</code></p>
* Created by hechao on 2020/1/22.<br/>
*/
@ComponentScan
@SpringBootApplication
@EnableAutoConfiguration
@PropertySource(value = {"classpath:config/bootstrap.yml"
, "classpath:config/application.yml"
, "file:${spring.config.file}"})
public class ScheduleApplication {
@Inject
private ApplicationContext context;
@PostConstruct
private void init() throws Exception {
Environment environment = context.getEnvironment();
Logger logger = LoggerFactory.getLogger(ScheduleApplication.class);
logger.info(
"\n---Schedule--------------------------------------------------------------\n" +
"\tServer IP : {}\n" +
"\tConfig File : {}\n" +
"\tSpring Profiles : {}\n" +
"\tRuntime : {}\n" +
"--------------------------------------------------------------------------"
, ServerUtils.getHostAddress()
, environment.getProperty("spring.config.file")
, environment.getActiveProfiles()
, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
}
public static void main(String[] args) throws Exception {
SpringApplication application = new SpringApplication(ScheduleApplication.class);
ConfigurableApplicationContext context = application.run(args);
}
}
\ No newline at end of file
package cn.quant.andy.config;
import cn.quant.mybatis.plugin.MybatisPageInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* Created by Administrator on 2021/7/16 0016.
*/
@Configuration
@MapperScan("cn.quant.andy.jpa.*.mapper")
@EnableTransactionManagement
public class DatabaseConfiguration {
@Bean
public MybatisPageInterceptor mybatisPageInterceptor(){
return new MybatisPageInterceptor();
}
}
package cn.quant.andy.config;
/**
* @author hechao
* @description
* @date 2020/9/29 10:08
* @modify 2020/9/29 10:08 by hechao
*/
public abstract class QuartzTaskProperties {
private String namespace;
private String cron;
private Integer shardingTotalCount;
private String shardingItemParameters;
public String getNamespace() {
return namespace;
}
public void setNamespace(String namespace) {
this.namespace = namespace;
}
public String getCron() {
return cron;
}
public void setCron(String cron) {
this.cron = cron;
}
public Integer getShardingTotalCount() {
return shardingTotalCount;
}
public void setShardingTotalCount(Integer shardingTotalCount) {
this.shardingTotalCount = shardingTotalCount;
}
public String getShardingItemParameters() {
return shardingItemParameters;
}
public void setShardingItemParameters(String shardingItemParameters) {
this.shardingItemParameters = shardingItemParameters;
}
}
package cn.quant.andy.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author hechao
* @description
* @date 2020/9/10 14:33vim
* @modify 2020/9/10 14:33 by hechao
*/
//@Configuration
//@EnableConfigurationProperties({ScheduleRegistryProperties.class})
public class ScheduleConfiguration {
private static final Logger logger = LoggerFactory.getLogger(ScheduleConfiguration.class);
public ScheduleConfiguration(ScheduleRegistryProperties registryProperties) {
logger.info("-->> registry: {}", registryProperties.getRegistry());
}
}
\ No newline at end of file
package cn.quant.andy.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* @author hechao
* @description
* @date 2020/9/29 14:00
* @modify 2020/9/29 14:00 by hechao
*/
@ConfigurationProperties(prefix = "cn.quant.andy")
public class ScheduleRegistryProperties {
private String registry;
public String getRegistry() {
return registry;
}
public void setRegistry(String registry) {
this.registry = registry;
}
}
package cn.quant.andy.dubbo.facade;
/**
* Created by hechao on 2020/2/11.
*/
public interface TestDubboServiceFacade {
void test(TestRequest request);
}
\ No newline at end of file
package cn.quant.andy.dubbo.facade;
import java.io.Serializable;
/**
* Created by hechao on 2020/2/11.
*/
public class TestRequest implements Serializable{
private static final long serialVersionUID = 888372588201987618L;
private String attachment;
public String getAttachment() {
return attachment;
}
public void setAttachment(String attachment) {
this.attachment = attachment;
}
@Override
public String toString() {
return "TestRequest{" +
"attachment='" + attachment + '\'' +
'}';
}
}
/**
* dubbo facade interface and dto
*/
package cn.quant.andy.dubbo.facade;
//package cn.quant.bbr.dubbo.service;
//
//import cn.quant.andy.dubbo.facade.TestDubboServiceFacade;
//import cn.quant.andy.dubbo.facade.TestRequest;
//
///**
// * Created by hechao on 2020/2/11.
// */
//public class TestDubboServiceImpl implements TestDubboServiceFacade {
//
// @Override
// public void test(TestRequest request) {
// System.out.println(request);
// }
//}
\ No newline at end of file
/**
* dubbo service
*/
package cn.quant.andy.dubbo.service;
debug=true
#quant
quant.server.number=1
quant.server.sequencer.operator=TWEPOCH_PLUS
quant.server.sequencer.sequence-bits=8
#Server
server.port=8080
server.servlet.context-path=/
#Spring
spring.profiles.active=dev
spring.application.name=ScheduleApplication
#Devtool
spring.devtools.restart.enabled=true
spring.devtools.livereload.enabled=true
#Database
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/reconciliation-1.0.0?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root
spring.datasource.password=111111
spring.datasource.hikari.minimum-idle=1
spring.datasource.hikari.maximum-pool-size=3
spring.datasource.hikari.data-source-properties.cachePrepStmts=true
spring.datasource.hikari.data-source-properties.prepStmtCacheSize=250
spring.datasource.hikari.data-source-properties.prepStmtCacheSqlLimit=2048
spring.datasource.hikari.data-source-properties.useServerPrepStmts=true
#Mybatis
mybatis.mapper-locations=classpath:mapping/*.xml
mybatis.type-handlers-package=cn.quant.andy.jpa.mybatis.type
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<context:annotation-config/>
<bean id="testDubboService" class="cn.quant.andy.dubbo.service.TestDubboServiceImpl"></bean>
<dubbo:service protocol="dubbo" interface="cn.quant.andy.dubbo.facade.TestDubboServiceFacade"
ref="testDubboService"
version="${cn.quant.andy.dubbo.facade.TestDubboServiceFacade.version}"
timeout="${cn.quant.andy.dubbo.facade.TestDubboServiceFacade.timeout}" retries="0"/>
</beans>
debug=false
#Server
server.port=8080
server.servlet.context-path=/
#Spring
spring.profiles.active=pre
spring.application.name=ScheduleApplication
#Spring Cloud Dataflow
spring.cloud.dataflow.client.server-uri=http://172.17.15.152:9393
#Devtool
spring.devtools.restart.enabled=false
spring.devtools.livereload.enabled=false
#Dubbo
spring.dubbo.application.name=Application
spring.dubbo.registry.address=zookeeper://172.17.15.101:3180?backup=172.17.15.102:3180,172.17.15.103:3180
spring.dubbo.protocol.name=dubbo
spring.dubbo.protocol.port=28080
TestDubboServiceFacade.version=1.0.0
TestDubboServiceFacade.timeout=30000
#Schedule
cn.quant.andy.registry=172.17.15.101:3180,172.17.15.102:3180,172.17.15.103:3180
#ZZRB Batch
cn.quant.andy.dataflow.task.namespace=quant-spring-elastic-job
cn.quant.andy.dataflow.task.task-name=zzrb-credit-pay-batch-cycle-task
#\u6BCF\u5929\u51CC\u66682\u70B9
cn.quant.andy.dataflow.task.cron=0 0 2 * * ? *
#\u6BCF\u5206\u949F
#cn.quant.andyy.dataflow.task.cron=0 0/1 * * * ?
#\u6BCF\u5E741-1
#cn.quant.andyy.dataflow.task.cron=0 0 0 1 1 ? *
cn.quant.andy.dataflow.task.sharding-total-count=1
cn.quant.andy.dataflow.task.sharding-item-parameters=0=a
cn.quant.andy.dataflow.task.page-size=5
cn.quant.andy.dataflow.task.chunk=1
\ No newline at end of file
debug=false
#Server
server.port=8080
server.servlet.context-path=/
#Spring
spring.profiles.active=pro
spring.application.name=ScheduleApplication
#Spring Cloud Dataflow
spring.cloud.dataflow.client.server-uri=http://172.17.15.152:9393
#Devtool
spring.devtools.restart.enabled=false
spring.devtools.livereload.enabled=false
#Dubbo
spring.dubbo.application.name=Application
spring.dubbo.registry.address=zookeeper://172.17.15.101:3180?backup=172.17.15.102:3180,172.17.15.103:3180
spring.dubbo.protocol.name=dubbo
spring.dubbo.protocol.port=28080
TestDubboServiceFacade.version=1.0.0
TestDubboServiceFacade.timeout=30000
#Schedule
cn.quant.andy.registry=172.17.15.101:3180,172.17.15.102:3180,172.17.15.103:3180
#ZZRB Batch
cn.quant.andy.dataflow.task.namespace=quant-spring-elastic-job
cn.quant.andy.dataflow.task.task-name=zzrb-credit-pay-batch-cycle-task
#\u6BCF\u5929\u51CC\u66682\u70B9
cn.quant.andy.dataflow.task.cron=0 0 2 * * ? *
#\u6BCF\u5206\u949F
#cn.quant.andyy.dataflow.task.cron=0 0/1 * * * ?
#\u6BCF\u5E741-1
#cn.quant.andyy.dataflow.task.cron=0 0 0 1 1 ? *
cn.quant.andy.dataflow.task.sharding-total-count=1
cn.quant.andy.dataflow.task.sharding-item-parameters=0=a
cn.quant.andy.dataflow.task.page-size=5
cn.quant.andy.dataflow.task.chunk=1
\ No newline at end of file
debug=true
#Server
server.port=8080
server.servlet.context-path=/
#Spring
spring.profiles.active=test
spring.application.name=ScheduleApplication
#Spring Cloud Dataflow
spring.cloud.dataflow.client.server-uri=http://172.17.15.152:9393
#Devtool
spring.devtools.restart.enabled=true
spring.devtools.livereload.enabled=true
#Dubbo
spring.dubbo.application.name=Application
spring.dubbo.registry.address=zookeeper://172.17.15.101:3180?backup=172.17.15.102:3180,172.17.15.103:3180
spring.dubbo.protocol.name=dubbo
spring.dubbo.protocol.port=28080
TestDubboServiceFacade.version=1.0.0
TestDubboServiceFacade.timeout=30000
#Schedule
cn.quant.andy.registry=172.17.15.101:3180,172.17.15.102:3180,172.17.15.103:3180
#ZZRB Batch
cn.quant.andy.dataflow.task.namespace=quant-spring-elastic-job
cn.quant.andy.dataflow.task.task-name=zzrb-credit-pay-batch-cycle-task
#\u6BCF\u5929\u51CC\u66682\u70B9
cn.quant.andy.dataflow.task.cron=0 0 2 * * ? *
#\u6BCF\u5206\u949F
#cn.quant.andyy.dataflow.task.cron=0 0/1 * * * ?
#\u6BCF\u5E741-1
#cn.quant.andyy.dataflow.task.cron=0 0 0 1 1 ? *
cn.quant.andy.dataflow.task.sharding-total-count=1
cn.quant.andy.dataflow.task.sharding-item-parameters=0=a
cn.quant.andy.dataflow.task.page-size=5
cn.quant.andy.dataflow.task.chunk=1
\ No newline at end of file
___ _ _ ____ _ _ _
/ _ \(_) __ _ _ __ | |__ __ _ ___ / ___| ___| |__ ___ __| |_ _| | ___
| | | | |/ _` | '_ \| '_ \ / _` |/ _ \ ____\___ \ / __| '_ \ / _ \/ _` | | | | |/ _ \
| |_| | | (_| | | | | |_) | (_| | (_) |_____|__) | (__| | | | __/ (_| | |_| | | __/
\__\_\_|\__,_|_| |_|_.__/ \__,_|\___/ |____/ \___|_| |_|\___|\__,_|\__,_|_|\___|
v${project.version}
\ No newline at end of file
# ===================================================================
# Spring Boot configuration.
#
# This configuration will be overriden by the Spring profile you use,
# for example application-dev.yml if you use the "dev" profile.
# ===================================================================
# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ==================================================================
server:
servlet:
session:
cookie:
http-only: true
tomcat:
max-http-header-size: 3145728
spring:
jackson:
serialization:
write_dates_as_timestamps: false
indent_output: true
datasource:
hikari:
minimum-idle: 1
maximum-pool-size: 3
data-source-properties:
cachePrepStmts: true
prepStmtCacheSize: 250
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true
jpa:
show-sql: true
hibernate:
ddl-auto: none
properties:
hibernate.cache.use_query_cache: false
hibernate.cache.use_second_level_cache: false
hibernate.cache.generate_statistics: false
dubbo:
scan: cn.quant.andyy.dubbo
thymeleaf:
cache: false
mode: HTML5
prefix: classpath:/templates/
suffix: .html
encoding: UTF-8
servlet:
content-type: text/html
resources:
add-mappings: true
static-locations: classpath:/static/
favicon:
enabled: false
mvc:
throw-exception-if-no-handler-found: true
view:
prefix: classpath:/view/
suffix: .jsp
static-path-pattern: /**
\ No newline at end of file
# ===================================================================
# Spring Boot configuration.
#
# This configuration will be overriden by the Spring profile you use,
# for example application-dev.yml if you use the "dev" profile.
# ===================================================================
# ===================================================================
# Standard Spring Boot properties.
# Full reference is available at:
# http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
# ==================================================================
spring:
quartz:
jdbc:
initialize-schema: never
flyway:
enabled: false
batch:
initialize-schema: never
cloud:
task:
initialize:
enable: false
messages:
basename: i18n/messages
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
<appender name="ROLLINGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${logging.dir}/${project.name}/${project.name}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${logging.dir}/${project.name}/${project.name}.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>90</maxHistory>
</rollingPolicy>
<encoder>
<charset>utf-8</charset>
<Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}][%p][%X{sessionId}][%X{traceId}][${spring.profiles.active}][%X{userId}][%t|%logger{1.}|%M|%X{ctime}] - %msg %ex{full}%n</Pattern>
</encoder>
</appender>
<appender name="ASYNC_ROLLINGFILE" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>512</queueSize>
<appender-ref ref="ROLLINGFILE"/>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg %ex{full}%n</pattern>
</encoder>
</appender>
<logger name="cn.quant.andy" level="INFO"/>
<logger name="javax.activation" level="ERROR"/>
<logger name="org.quartz.core" level="ERROR"/>
<logger name="org.quartz.simpl" level="ERROR"/>
<logger name="com.zaxxer.hikari.pool" level="ERROR"/>
<logger name="com.alibaba.dubbo.common.extension" level="ERROR"/>
<logger name="org.apache.zookeeper" level="ERROR"/>
<logger name="org.apache.curator" level="ERROR"/>
<logger name="org.apache.catalina.loader" level="ERROR"/>
<logger name="org.apache.catalina.util" level="ERROR"/> <logger name="org.apache.catalina.core" level="ERROR"/>
<logger name="org.hibernate.hql" level="ERROR"/>
<logger name="org.hibernate.loader" level="ERROR"/>
<logger name="org.hibernate.type" level="ERROR"/>
<logger name="org.hibernate.persister" level="ERROR"/>
<logger name="org.hibernate.cfg" level="ERROR"/>
<logger name="org.hibernate.mapping" level="ERROR"/>
<logger name="org.hibernate.jpa.event" level="ERROR"/>
<logger name="org.hibernate.validator.internal" level="ERROR"/>
<logger name="org.hibernate.engine.internal" level="ERROR"/>
<logger name="org.hibernate.boot.model" level="ERROR"/>
<logger name="org.hibernate.boot.internal" level="ERROR"/>
<logger name="org.apache.tomcat.util" level="ERROR"/>
<logger name="org.springframework.orm" level="ERROR"/>
<logger name="org.springframework.jmx" level="ERROR"/>
<logger name="org.springframework.jndi" level="ERROR"/>
<logger name="org.springframework.aop" level="ERROR"/>
<logger name="org.springframework.web" level="ERROR"/>
<logger name="org.springframework.context" level="ERROR"/>
<logger name="org.springframework.core" level="ERROR"/>
<logger name="org.springframework.beans" level="ERROR"/>
<logger name="org.springframework.boot.web" level="ERROR"/>
<logger name="org.springframework.boot.actuate" level="ERROR"/>
<logger name="org.springframework.boot.context" level="ERROR"/>
<logger name="org.springframework.boot.autoconfigure.logging" level="ERROR"/>
<logger name="org.springframework.cloud.task" level="ERROR"/>
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="ASYNC_ROLLINGFILE"/>
</root>
</configuration>
\ No newline at end of file
package cn.quant;
import cn.quant.andy.DataLoader;
import cn.quant.andy.ScheduleApplication;
import cn.quant.andy.jpa.mybatis.mapper.ApplicationProfileMapper;
import cn.quant.andy.jpa.mybatis.mapper.InstitutionProfileMapper;
import cn.quant.andy.service.BalanceService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
/**
* Unit test for simple App.
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {ScheduleApplication.class})
public class AppTest {
@Autowired
private InstitutionProfileMapper institutionProfileEntityMapper;
@Autowired
private ApplicationProfileMapper applicationProfileEntityMapper;
@Autowired
private DataLoader dataLoader;
@Autowired
private BalanceService balanceService;
/**
* Rigorous Test :-)
*/
@Test
public void load() {
try {
dataLoader.load(202107);
} catch (Exception e) {
e.printStackTrace();
}
// HashMap<String, Object> params = new HashMap<>();
// params.put(AVAILABLE_FLAG, true);
// List<InstitutionProfileEntity> all = institutionProfileEntityMapper.findAll(params);
//
// params = new HashMap<>();
// params.put(INSTITUTION_CODE, "WXP");
// InstitutionProfileEntity one = institutionProfileEntityMapper.findOne(params);
// List<ApplicationProfileEntity> all1 = applicationProfileEntityMapper.findAll();
// try {
// importSummaryService.importing(202107);
// } catch (IOException e) {
// e.printStackTrace();
// }
//
System.currentTimeMillis();
}
@Test
public void billing() {
balanceService.billing("INST", 202106);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment