作者 朱兆平

init

#登录账号
loginname = NMMS
#登录密码
loginpass = NMMS_P
#发送报文目录,相对程序目录
readDirectory = /Users/mrz/Documents/java项目/test
#接收存储报文目录
bakDirectory = kakoRevice
#是否需要发送报文,默认N不发,Y将发送readDirectory下的XML扩展名的报文
isNeedSend = Y
#本地要保存的styp类型,用英文逗号分隔,注意中英文字符
saveStyp = DFDL,ARRE,ONRE,STLS
#IMF MEAT报头配置
RCVR=
TYPE=KAKO
STYP=CARM
AppId=warehouse
\ No newline at end of file
... ...
#log4j=log_api.xml
isneedlog=N
psip=218.28.199.134
#psip=10.50.3.74
psport=7484
encoding=UTF-8
... ...
########Log4j configuration#####################################
log4j.rootLogger=INFO, stdout, fileout
log4j.logger.com.fiscal = INFO
#*******************************
log4j.logger.com.system = INFO
#*******************************
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{MM-dd HH:mm:ss,SSSS}[%p] %m%n
#yyyy-MM-dd HH:mm:ss
log4j.appender.fileout=org.apache.log4j.RollingFileAppender
log4j.appender.fileout.File=logs/imf.log
log4j.appender.fileout.MaxFileSize=50MB
log4j.appender.fileout.MaxBackupIndex=10
log4j.appender.fileout.layout=org.apache.log4j.PatternLayout
log4j.appender.fileout.layout.ConversionPattern=%d{MM-dd HH:mm:ss,SSSS}[%p] %m%n
... ...
... ... @@ -3,19 +3,137 @@
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">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.tianbo</groupId>
<artifactId>imfClient</artifactId>
<version>1.0-SNAPSHOT</version>
<name>imfClient</name>
<description>warehouse for Spring Boot</description>
<properties>
<druid.version>1.1.9</druid.version>
<spring-cloud.version>Greenwich.BUILD-SNAPSHOT</spring-cloud.version>
</properties>
<dependencies>
<!--spring boot-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--clound-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!--数据库-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
</dependency>
<!-- mysql-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<!-- oracle-->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4.0-atlassian-hosted</version>
</dependency>
<!--util依赖-->
<dependency>
<groupId>com.tianbo</groupId>
<artifactId>util</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--util依赖-->
<!--IMF需要的包-->
<!-- https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans -->
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.4.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.ws.commons.schema/XmlSchema -->
<dependency>
<groupId>org.apache.ws.commons.schema</groupId>
<artifactId>XmlSchema</artifactId>
<version>1.4.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/wsdl4j/wsdl4j -->
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.neethi/neethi -->
<dependency>
<groupId>org.apache.neethi</groupId>
<artifactId>neethi</artifactId>
<version>2.0.4</version>
</dependency>
<dependencies>
<!-- LOG -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-jdk14 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.cxf.xjcplugins/cxf-xjc-boolean -->
<dependency>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-boolean</artifactId>
<version>3.2.3</version>
</dependency>
<!--添加本地IMF包-->
<dependency>
<groupId>com.caac</groupId>
... ... @@ -236,11 +354,70 @@
<scope>system</scope>
<systemPath>${project.basedir}/lib/connector.jar</systemPath>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.2.0.BUILD-SNAPSHOT</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<!-- mybatis generator 自动生成代码插件 -->
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/generator/generatorConfig.xml</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</pluginRepository>
</pluginRepositories>
</project>
\ No newline at end of file
... ...
package com.tianbo.imfClient;
import com.caac.imf.api.IMFClient;
import com.tianbo.imfClient.handle.imfClient.handle.imfClient.IMFSaveHandle;
import com.tianbo.imfClient.handle.IMFSaveHandle;
import com.tianbo.imfClient.schedul.IMF_Task;
import org.apache.log4j.Logger;
public class IMF_Reader extends Thread{
... ... @@ -21,7 +22,7 @@ public class IMF_Reader extends Thread{
if (IMF_Task.LOGIN_OK) {
String message = this.client.getMSG();
if (message != null) {
com.tianbo.imfClient.handle.imfClient.IMFSaveHandle imfSaveHandle = new com.tianbo.imfClient.handle.imfClient.IMFSaveHandle();
IMFSaveHandle imfSaveHandle = new IMFSaveHandle();
imfSaveHandle.handle(message);
}
... ...
package com.tianbo.imfClient;
import com.caac.imf.api.IMFClient;
import com.tianbo.warehouse.imf.schedul.IMF_Task;
import com.tianbo.warehouse.util.Date.DateUtil;
import com.tianbo.warehouse.util.IO.FileTool;
import com.tianbo.warehouse.util.XML.MakeImfMeta;
import com.tianbo.imfClient.schedul.IMF_Task;
import com.tianbo.util.Date.DateUtil;
import com.tianbo.util.IO.FileTool;
import com.tianbo.util.XML.MakeImfMeta;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
... ...
/**
* @author mrz
* @email 17966059@qq.com
*/
package com.tianbo.imfClient;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
@EnableScheduling
//@EnableEurekaClient
@EnableTransactionManagement
@MapperScan("com.tianbo.imfClient.dao")
public class WarehouseApplication {
public static void main(String[] args) {
SpringApplication.run(WarehouseApplication.class, args);
}
}
... ...
package com.tianbo.imfClient.controller;
import com.tianbo.imfClient.handle.IO_Log_Handle;
import org.springframework.stereotype.Component;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.CopyOnWriteArraySet;
@ServerEndpoint(value = "/log")
@Component
public class LogWebsockController {
private Process process;
private InputStream inputStream;
//与某个客户端的连接会话,需要通过它来给客户端发送数据
private Session session;
//静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
private static int onlineCount = 0;
//concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
private static CopyOnWriteArraySet<LogWebsockController> webSocketSet = new CopyOnWriteArraySet<LogWebsockController>();
@OnOpen
public void onOpen(Session session){
this.session = session;
webSocketSet.add(this);
addOnlineCount();
try {
process = Runtime.getRuntime().exec("tail -f logs/imf.log");
inputStream = process.getInputStream();
IO_Log_Handle thread = new IO_Log_Handle(inputStream, session);
thread.start();
}catch (IOException e){
e.printStackTrace();
}
}
/**
* WebSocket请求关闭
*/
@OnClose
public void onClose() {
try {
if(inputStream != null) {
inputStream.close();
}
} catch (Exception e) {
e.printStackTrace();
}
if(process != null){
process.destroy();
}
}
@OnError
public void onError(Throwable thr) {
thr.printStackTrace();
}
public static synchronized void addOnlineCount() {
LogWebsockController.onlineCount++;
}
public static synchronized int getOnlineCount() {
return onlineCount;
}
}
... ...
package com.tianbo.imfClient.dao;
import com.tianbo.imfClient.model.T_ETL_MESSAGE;
import java.math.BigDecimal;
public interface T_ETL_MESSAGEMapper {
int deleteByPrimaryKey(BigDecimal fid);
int insert(T_ETL_MESSAGE record);
int insertSelective(T_ETL_MESSAGE record);
T_ETL_MESSAGE selectByPrimaryKey(BigDecimal fid);
int updateByPrimaryKeySelective(T_ETL_MESSAGE record);
int updateByPrimaryKeyWithBLOBs(T_ETL_MESSAGE record);
int updateByPrimaryKey(T_ETL_MESSAGE record);
}
\ No newline at end of file
... ...
package com.tianbo.imfClient.handle;
import com.tianbo.warehouse.model.T_ETL_MESSAGE;
import com.tianbo.warehouse.service.T_ETL_MESSAGEService;
import com.tianbo.warehouse.util.Date.DateUtil;
import com.tianbo.warehouse.util.IO.FileTool;
import com.tianbo.warehouse.util.XML.XML2ENTITY;
import com.tianbo.imfClient.model.T_ETL_MESSAGE;
import com.tianbo.imfClient.service.T_ETL_MESSAGEService;
import com.tianbo.util.Date.DateUtil;
import com.tianbo.util.IO.FileTool;
import com.tianbo.util.XML.XML2ENTITY;
import org.apache.log4j.Logger;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
... ...
package com.tianbo.imfClient.handle;
import javax.websocket.Session;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class IO_Log_Handle extends Thread{
private BufferedReader reader;
private Session session;
public IO_Log_Handle(InputStream in, Session session) {
this.reader = new BufferedReader(new InputStreamReader(in));
this.session = session;
}
@Override
public void run() {
String line;
try {
while((line = reader.readLine()) != null) {
// 将实时日志通过WebSocket发送给客户端,给每一行添加一个HTML换行
session.getBasicRemote().sendText(line + "<br>");
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
... ...
package com.tianbo.imfClient.model;
import java.math.BigDecimal;
import java.util.Date;
public class T_ETL_MESSAGE {
private BigDecimal fid;
private String oper;
private Date sntm;
private String sndr;
private String rcvr;
private String seqn;
private Date ddtm;
private String type;
private String styp;
private String transid;
private String remark;
private Date outtm;
private BigDecimal outflag;
private Date etltim;
private BigDecimal etlflag;
private Date errtm;
private BigDecimal errflag;
private String errlog;
private String appid;
private String content;
public BigDecimal getFid() {
return fid;
}
public void setFid(BigDecimal fid) {
this.fid = fid;
}
public String getOper() {
return oper;
}
public void setOper(String oper) {
this.oper = oper == null ? null : oper.trim();
}
public Date getSntm() {
return sntm;
}
public void setSntm(Date sntm) {
this.sntm = sntm;
}
public String getSndr() {
return sndr;
}
public void setSndr(String sndr) {
this.sndr = sndr == null ? null : sndr.trim();
}
public String getRcvr() {
return rcvr;
}
public void setRcvr(String rcvr) {
this.rcvr = rcvr == null ? null : rcvr.trim();
}
public String getSeqn() {
return seqn;
}
public void setSeqn(String seqn) {
this.seqn = seqn == null ? null : seqn.trim();
}
public Date getDdtm() {
return ddtm;
}
public void setDdtm(Date ddtm) {
this.ddtm = ddtm;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getStyp() {
return styp;
}
public void setStyp(String styp) {
this.styp = styp == null ? null : styp.trim();
}
public String getTransid() {
return transid;
}
public void setTransid(String transid) {
this.transid = transid == null ? null : transid.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getOuttm() {
return outtm;
}
public void setOuttm(Date outtm) {
this.outtm = outtm;
}
public BigDecimal getOutflag() {
return outflag;
}
public void setOutflag(BigDecimal outflag) {
this.outflag = outflag;
}
public Date getEtltim() {
return etltim;
}
public void setEtltim(Date etltim) {
this.etltim = etltim;
}
public BigDecimal getEtlflag() {
return etlflag;
}
public void setEtlflag(BigDecimal etlflag) {
this.etlflag = etlflag;
}
public Date getErrtm() {
return errtm;
}
public void setErrtm(Date errtm) {
this.errtm = errtm;
}
public BigDecimal getErrflag() {
return errflag;
}
public void setErrflag(BigDecimal errflag) {
this.errflag = errflag;
}
public String getErrlog() {
return errlog;
}
public void setErrlog(String errlog) {
this.errlog = errlog;
}
public String getAppid() {
return appid;
}
public void setAppid(String appid) {
this.appid = appid == null ? null : appid.trim();
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content == null ? null : content.trim();
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@ import com.tianbo.imfClient.IMF_Sender;
import com.tianbo.util.IO.FileTool;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
... ... @@ -22,7 +23,7 @@ public class IMF_Task {
public static String isNeedSend = "N";
// @Scheduled(fixedRate = 5000)
@Scheduled(fixedRate = 5000)
private static void start() throws Exception {
PropertyConfigurator.configure("config/log4j.properties");
client = IMFClientFactory.createInstance();
... ...
package com.tianbo.imfClient.service;
import com.tianbo.imfClient.model.T_ETL_MESSAGE;
public interface T_ETL_MESSAGEService {
int insert(T_ETL_MESSAGE record);
int insertSelective(T_ETL_MESSAGE record);
}
... ...
package com.tianbo.imfClient.service.imp;
import com.tianbo.imfClient.dao.T_ETL_MESSAGEMapper;
import com.tianbo.imfClient.model.T_ETL_MESSAGE;
import com.tianbo.imfClient.service.T_ETL_MESSAGEService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("messageService")
public class T_ETL_MESSAGEServiceImp implements T_ETL_MESSAGEService{
@Autowired
private T_ETL_MESSAGEMapper messageMapper;
@Override
public int insert(T_ETL_MESSAGE record){
return messageMapper.insert(record);
}
@Override
public int insertSelective(T_ETL_MESSAGE record){
return messageMapper.insertSelective(record);
}
}
... ...
#服务端口
server.port=7003
server.servlet.context-path=${SERVER_CONTEXTPATH:}
#静态资源,设置上传文件的访问,上传文件的路径,要带斜杠
web.upload-path=upload/
#表示所有的访问经过静态资源路径
springboot.mvc.static-path-pattern=/**
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,file:${web.upload-path}
#服务名
spring.application.name=tianbo.base.dev.devkit
spring.jackson.serialization.fail-on-empty-beans=false
#springboot2.0之后会把Date类型字段自动给转成UTC字符串 如:1990-11-26T16:00:00.000+0000,如果想转成时间戳在application.properties配置文件增加以下配置
#jackson相关配置
spring.jackson.date-format = yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.write-dates-as-timestamps=false
#时区必须要设置
spring.jackson.time-zone=GMT+8
#ALWAYS的意思是即时属性为null,仍然也会输出这个key
spring.jackson.default-property-inclusion=always
#springcloud 基本配置
#eureka主机名,会在控制页面中显示
spring.cloud.features.enabled=false
spring.cloud.discovery.enabled=false
spring.cloud.service-registry.auto-registration.enabled=false
#eureka.instance.hostname=${spring.cloud.client.ip-address}
#eureka服务器页面中status的请求路径
#eureka.instance.status-page-url=http://${eureka.instance.hostname}:${server.port}/index
#eureka注册中心服务器地址
#eureka.client.service-url.defaultZone=http://10.50.3.82:19527/eureka/
#eureka.instance.prefer-ip-address=true
#eureka.instance.instance-id=${spring.cloud.client.ip-address}:${server.port}
#eureka.client.registry-fetch-interval-seconds=30
#eureka.instance.lease-renewal-interval-in-seconds=15
#eureka.instance.lease-expiration-duration-in-seconds=45
#spring.datasource oracle
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
#spring.datasource.driver-class-name=oracle.jdbc.OracleDriver
#spring.datasource.url=jdbc:oracle:thin:@10.50.3.68:1521:CGODW
#spring.datasource.username=CGOETL
#spring.datasource.password=1q2w3e4r
#spring datasource mysql,注意编码配置,缺少数据库编码配置容易引起中文入库乱码
spring.datasource.url=jdbc:mysql://127.0.0.1:3307/statistics?useUnicode=true&characterEncoding=utf8
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.max-idle=10
spring.datasource.max-wait=10000
spring.datasource.min-idle=5
spring.datasource.initial-size=5
#配置初始化大小/最小/最大
spring.datasource.druid.initial-size=1
spring.datasource.druid.min-idle=1
spring.datasource.druid.max-active=20
#获取连接等待超时时间
spring.datasource.druid.max-wait=60000
#一个连接在池中最小生存的时间
spring.datasource.druid.min-evictable-idle-time-millis=300000
#间隔多久进行一次检测,检测需要关闭的空闲连接
spring.datasource.druid.time-between-eviction-runs-millis=60000
#oracle
#spring.datasource.druid.validation-query=SELECT 'x' FROM DUAL
#mysql
spring.datasource.druid.validation-query=SELECT 1 FROM DUAL
spring.datasource.druid.test-while-idle=true
spring.datasource.druid.test-on-borrow=false
spring.datasource.druid.test-on-return=false
spring.datasource.druid.default-auto-commit=true
mybatis.mapper-locations=classpath:mapping/*.xml
mybatis.type-aliases-package=com.tianbo.imfClient.model
pagehelper.helper-dialect=mysql
#pagehelper.auto-dialect=true
#pagehelper.auto-runtime-dialect=true
pagehelper.reasonable=true
pagehelper.support-methods-arguments=true
pagehelper.params=count=countSql
#debug配置
trace=false
debug=true
logging.level.org.apache.tomcat=info
logging.level.com.tianbo.imfClient.dao=DEBUG
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<!-- 数据库驱动:选择你的本地硬盘上面的数据库驱动包-->
<classPathEntry location="/Users/mrz/Downloads/mybatis-generator-core-1.3.2/lib/mysql-connector-java-5.1.25-bin.jar"/>
<!--<classPathEntry location="/Users/mrz/Documents/maven/ojdbc6.jar"/>-->
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="true"/>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--数据库链接URL,用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3307/statistics"
userId="root"
password="">
</jdbcConnection>
<!--<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"-->
<!--connectionURL="jdbc:oracle:thin:@10.50.3.68:1521:CGODW"-->
<!--userId="CGOETL"-->
<!--password="1q2w3e4r">-->
<!--</jdbcConnection>-->
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和
NUMERIC 类型解析为java.math.BigDecimal -->
<!--<javaTypeResolver>-->
<!--<property name="forceBigDecimals" value="true" />-->
<!--</javaTypeResolver>-->
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- 生成模型的包名和位置-->
<javaModelGenerator targetPackage="com.tianbo.imfClient.model" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成映射文件的包名和位置-->
<sqlMapGenerator targetPackage="mapping" targetProject="src/main/resources">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!-- 生成DAO的包名和位置-->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.tianbo.imfClient.dao" targetProject="src/main/java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="attachment" domainObjectName="Attachment" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
\ No newline at end of file
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tianbo.imfClient.dao.T_ETL_MESSAGEMapper">
<resultMap id="BaseResultMap" type="com.tianbo.imfClient.model.T_ETL_MESSAGE">
<id column="FID" jdbcType="DECIMAL" property="fid" />
<result column="OPER" jdbcType="VARCHAR" property="oper" />
<result column="SNTM" jdbcType="TIMESTAMP" property="sntm" />
<result column="SNDR" jdbcType="VARCHAR" property="sndr" />
<result column="RCVR" jdbcType="VARCHAR" property="rcvr" />
<result column="SEQN" jdbcType="VARCHAR" property="seqn" />
<result column="DDTM" jdbcType="TIMESTAMP" property="ddtm" />
<result column="TYPE" jdbcType="VARCHAR" property="type" />
<result column="STYP" jdbcType="VARCHAR" property="styp" />
<result column="TRANSID" jdbcType="VARCHAR" property="transid" />
<result column="REMARK" jdbcType="NVARCHAR" property="remark" />
<result column="OUTTM" jdbcType="TIMESTAMP" property="outtm" />
<result column="OUTFLAG" jdbcType="DECIMAL" property="outflag" />
<result column="ETLTIM" jdbcType="TIMESTAMP" property="etltim" />
<result column="ETLFLAG" jdbcType="DECIMAL" property="etlflag" />
<result column="ERRTM" jdbcType="TIMESTAMP" property="errtm" />
<result column="ERRFLAG" jdbcType="DECIMAL" property="errflag" />
<result column="ERRLOG" jdbcType="NVARCHAR" property="errlog" />
<result column="APPID" jdbcType="VARCHAR" property="appid" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tianbo.imfClient.model.T_ETL_MESSAGE">
<result column="CONTENT" jdbcType="CLOB" property="content" />
</resultMap>
<sql id="Base_Column_List">
FID, OPER, SNTM, SNDR, RCVR, SEQN, DDTM, TYPE, STYP, TRANSID, REMARK, OUTTM, OUTFLAG,
ETLTIM, ETLFLAG, ERRTM, ERRFLAG, ERRLOG, APPID
</sql>
<sql id="Blob_Column_List">
CONTENT
</sql>
<select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from T_ETL_MESSAGE
where FID = #{fid,jdbcType=DECIMAL}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
delete from T_ETL_MESSAGE
where FID = #{fid,jdbcType=DECIMAL}
</delete>
<insert id="insert" parameterType="com.tianbo.imfClient.model.T_ETL_MESSAGE">
insert into T_ETL_MESSAGE (FID, OPER, SNTM,
SNDR, RCVR, SEQN, DDTM,
TYPE, STYP, TRANSID,
REMARK, OUTTM, OUTFLAG,
ETLTIM, ETLFLAG, ERRTM,
ERRFLAG, ERRLOG, APPID,
CONTENT)
values (#{fid,jdbcType=DECIMAL}, #{oper,jdbcType=VARCHAR}, #{sntm,jdbcType=TIMESTAMP},
#{sndr,jdbcType=VARCHAR}, #{rcvr,jdbcType=VARCHAR}, #{seqn,jdbcType=VARCHAR}, #{ddtm,jdbcType=TIMESTAMP},
#{type,jdbcType=VARCHAR}, #{styp,jdbcType=VARCHAR}, #{transid,jdbcType=VARCHAR},
#{remark,jdbcType=NVARCHAR}, #{outtm,jdbcType=TIMESTAMP}, #{outflag,jdbcType=DECIMAL},
#{etltim,jdbcType=TIMESTAMP}, #{etlflag,jdbcType=DECIMAL}, #{errtm,jdbcType=TIMESTAMP},
#{errflag,jdbcType=DECIMAL}, #{errlog,jdbcType=NVARCHAR}, #{appid,jdbcType=VARCHAR},
#{content,jdbcType=CLOB})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.imfClient.model.T_ETL_MESSAGE">
insert into T_ETL_MESSAGE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fid != null">
FID,
</if>
<if test="oper != null">
OPER,
</if>
<if test="sntm != null">
SNTM,
</if>
<if test="sndr != null">
SNDR,
</if>
<if test="rcvr != null">
RCVR,
</if>
<if test="seqn != null">
SEQN,
</if>
<if test="ddtm != null">
DDTM,
</if>
<if test="type != null">
TYPE,
</if>
<if test="styp != null">
STYP,
</if>
<if test="transid != null">
TRANSID,
</if>
<if test="remark != null">
REMARK,
</if>
<if test="outtm != null">
OUTTM,
</if>
<if test="outflag != null">
OUTFLAG,
</if>
<if test="etltim != null">
ETLTIM,
</if>
<if test="etlflag != null">
ETLFLAG,
</if>
<if test="errtm != null">
ERRTM,
</if>
<if test="errflag != null">
ERRFLAG,
</if>
<if test="errlog != null">
ERRLOG,
</if>
<if test="appid != null">
APPID,
</if>
<if test="content != null">
CONTENT,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fid != null">
#{fid,jdbcType=DECIMAL},
</if>
<if test="oper != null">
#{oper,jdbcType=VARCHAR},
</if>
<if test="sntm != null">
#{sntm,jdbcType=TIMESTAMP},
</if>
<if test="sndr != null">
#{sndr,jdbcType=VARCHAR},
</if>
<if test="rcvr != null">
#{rcvr,jdbcType=VARCHAR},
</if>
<if test="seqn != null">
#{seqn,jdbcType=VARCHAR},
</if>
<if test="ddtm != null">
#{ddtm,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="styp != null">
#{styp,jdbcType=VARCHAR},
</if>
<if test="transid != null">
#{transid,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=OTHER},
</if>
<if test="outtm != null">
#{outtm,jdbcType=TIMESTAMP},
</if>
<if test="outflag != null">
#{outflag,jdbcType=DECIMAL},
</if>
<if test="etltim != null">
#{etltim,jdbcType=TIMESTAMP},
</if>
<if test="etlflag != null">
#{etlflag,jdbcType=DECIMAL},
</if>
<if test="errtm != null">
#{errtm,jdbcType=TIMESTAMP},
</if>
<if test="errflag != null">
#{errflag,jdbcType=DECIMAL},
</if>
<if test="errlog != null">
#{errlog,jdbcType=OTHER},
</if>
<if test="appid != null">
#{appid,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=CLOB},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.tianbo.imfClient.model.T_ETL_MESSAGE">
update T_ETL_MESSAGE
<set>
<if test="oper != null">
OPER = #{oper,jdbcType=VARCHAR},
</if>
<if test="sntm != null">
SNTM = #{sntm,jdbcType=TIMESTAMP},
</if>
<if test="sndr != null">
SNDR = #{sndr,jdbcType=VARCHAR},
</if>
<if test="rcvr != null">
RCVR = #{rcvr,jdbcType=VARCHAR},
</if>
<if test="seqn != null">
SEQN = #{seqn,jdbcType=VARCHAR},
</if>
<if test="ddtm != null">
DDTM = #{ddtm,jdbcType=TIMESTAMP},
</if>
<if test="type != null">
TYPE = #{type,jdbcType=VARCHAR},
</if>
<if test="styp != null">
STYP = #{styp,jdbcType=VARCHAR},
</if>
<if test="transid != null">
TRANSID = #{transid,jdbcType=VARCHAR},
</if>
<if test="remark != null">
REMARK = #{remark,jdbcType=OTHER},
</if>
<if test="outtm != null">
OUTTM = #{outtm,jdbcType=TIMESTAMP},
</if>
<if test="outflag != null">
OUTFLAG = #{outflag,jdbcType=DECIMAL},
</if>
<if test="etltim != null">
ETLTIM = #{etltim,jdbcType=TIMESTAMP},
</if>
<if test="etlflag != null">
ETLFLAG = #{etlflag,jdbcType=DECIMAL},
</if>
<if test="errtm != null">
ERRTM = #{errtm,jdbcType=TIMESTAMP},
</if>
<if test="errflag != null">
ERRFLAG = #{errflag,jdbcType=DECIMAL},
</if>
<if test="errlog != null">
ERRLOG = #{errlog,jdbcType=OTHER},
</if>
<if test="appid != null">
APPID = #{appid,jdbcType=VARCHAR},
</if>
<if test="content != null">
CONTENT = #{content,jdbcType=CLOB},
</if>
</set>
where FID = #{fid,jdbcType=DECIMAL}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tianbo.imfClient.model.T_ETL_MESSAGE">
update T_ETL_MESSAGE
set OPER = #{oper,jdbcType=VARCHAR},
SNTM = #{sntm,jdbcType=TIMESTAMP},
SNDR = #{sndr,jdbcType=VARCHAR},
RCVR = #{rcvr,jdbcType=VARCHAR},
SEQN = #{seqn,jdbcType=VARCHAR},
DDTM = #{ddtm,jdbcType=TIMESTAMP},
TYPE = #{type,jdbcType=VARCHAR},
STYP = #{styp,jdbcType=VARCHAR},
TRANSID = #{transid,jdbcType=VARCHAR},
REMARK = #{remark,jdbcType=OTHER},
OUTTM = #{outtm,jdbcType=TIMESTAMP},
OUTFLAG = #{outflag,jdbcType=DECIMAL},
ETLTIM = #{etltim,jdbcType=TIMESTAMP},
ETLFLAG = #{etlflag,jdbcType=DECIMAL},
ERRTM = #{errtm,jdbcType=TIMESTAMP},
ERRFLAG = #{errflag,jdbcType=DECIMAL},
ERRLOG = #{errlog,jdbcType=OTHER},
APPID = #{appid,jdbcType=VARCHAR},
CONTENT = #{content,jdbcType=CLOB}
where FID = #{fid,jdbcType=DECIMAL}
</update>
<update id="updateByPrimaryKey" parameterType="com.tianbo.imfClient.model.T_ETL_MESSAGE">
update T_ETL_MESSAGE
set OPER = #{oper,jdbcType=VARCHAR},
SNTM = #{sntm,jdbcType=TIMESTAMP},
SNDR = #{sndr,jdbcType=VARCHAR},
RCVR = #{rcvr,jdbcType=VARCHAR},
SEQN = #{seqn,jdbcType=VARCHAR},
DDTM = #{ddtm,jdbcType=TIMESTAMP},
TYPE = #{type,jdbcType=VARCHAR},
STYP = #{styp,jdbcType=VARCHAR},
TRANSID = #{transid,jdbcType=VARCHAR},
REMARK = #{remark,jdbcType=OTHER},
OUTTM = #{outtm,jdbcType=TIMESTAMP},
OUTFLAG = #{outflag,jdbcType=DECIMAL},
ETLTIM = #{etltim,jdbcType=TIMESTAMP},
ETLFLAG = #{etlflag,jdbcType=DECIMAL},
ERRTM = #{errtm,jdbcType=TIMESTAMP},
ERRFLAG = #{errflag,jdbcType=DECIMAL},
ERRLOG = #{errlog,jdbcType=OTHER},
APPID = #{appid,jdbcType=VARCHAR}
where FID = #{fid,jdbcType=DECIMAL}
</update>
</mapper>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta content="text/html;charset=UTF-8"/>
<title>登录页面</title>
<link rel="stylesheet" th:href="@{css/bootstrap.min.css}"/>
<style type="text/css">
body {
padding-top: 50px;
}
.starter-template {
padding: 40px 15px;
text-align: center;
}
</style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Spring Security演示</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a th:href="@{/}"> 首页 </a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>
<div class="container">
welcom
</div>
</body>
</html>
\ No newline at end of file
... ...
此 diff 太大无法显示。
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta content="text/html;charset=UTF-8"/>
<title>错误页面</title>
<link rel="stylesheet" th:href="@{css/bootstrap.min.css}"/>
<style type="text/css">
body {
padding-top: 50px;
}
.starter-template {
padding: 40px 15px;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
error
</div>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
<head>
<meta content="text/html;charset=UTF-8"/>
<title sec:authentication="name"></title>
<link rel="stylesheet" th:href="@{css/bootstrap.min.css}" />
<style type="text/css">
body {
padding-top: 50px;
}
.starter-template {
padding: 40px 15px;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
imfclient
</div>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tail log</title>
<script src="/js/jquery.js"></script>
</head>
<body>
<div id="log-container" style="height: 450px; overflow-y: scroll; background: #333; color: #aaa; padding: 10px;">
<div>
</div>
</div>
</body>
<script>
$(document).ready(function() {
// 指定websocket路径
var websocket = new WebSocket('ws://localhost:7003/log');
websocket.onmessage = function(event) {
// 接收服务端的实时日志并添加到HTML页面中
$("#log-container div").append(event.data);
// 滚动条滚动到最低部
$("#log-container").scrollTop($("#log-container div").height() - $("#log-container").height());
};
});
</script>
</body>
</html>
\ No newline at end of file
... ...