新增采集器调度器管理库表设计及代码一键生成
parent
7392fc6bab
commit
705cda8501
Binary file not shown.
@ -0,0 +1,73 @@
|
||||
<assembly 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/assembly-1.0.0.xsd">
|
||||
|
||||
<id>exe</id>
|
||||
<formats>
|
||||
<format>dir</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
|
||||
<fileSets>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/lib</outputDirectory>
|
||||
<directory>${basedir}/target/lib</directory>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/config</outputDirectory>
|
||||
<directory>${basedir}/target/resources</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.xml</include>
|
||||
<include>*.yml</include>
|
||||
<include>*.properties</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/dataConfig</outputDirectory>
|
||||
<directory>${basedir}/target/dataConfig</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.json</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<directory>${basedir}/target/resources/bin</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.bat</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<directory>${basedir}/target/resources/bin</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<directory>${basedir}</directory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>*.exe</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<!-- 将项目启动jar打包到boot目录中 -->
|
||||
<fileSet>
|
||||
<directory>${basedir}/target</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<fileMode>0755</fileMode>
|
||||
<includes>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
@ -0,0 +1,17 @@
|
||||
package com.docus.server;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@EnableFeignClients(basePackages = ("com.docus.core.excel.feign"))
|
||||
@SpringBootApplication(scanBasePackages = {"com.docus"})
|
||||
public class AppRunBootstrap {
|
||||
public static void main(String[] args) {
|
||||
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
|
||||
SpringApplication.run(AppRunBootstrap.class, args);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@
|
||||
package com.docus.server.common.netty.client;
|
||||
|
||||
public class A {
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.docus.server.common.netty.server;
|
||||
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.util.AttributeKey;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* Created by 1-point at 2021/9/8
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ChannelRepository {
|
||||
|
||||
|
||||
private final static Map<String, Channel> CHANNEL_CACHE_MAP = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* 客户端上线
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
*/
|
||||
public void put(String key, Channel value) {
|
||||
//客户端上线
|
||||
CHANNEL_CACHE_MAP.put(key, value);
|
||||
AttributeKey<String> attributeKey = AttributeKey.valueOf("user");
|
||||
value.attr(attributeKey).set(key);
|
||||
//todo 数据库更新工控机状态上线
|
||||
}
|
||||
|
||||
public String getClientKey(Channel channel) {
|
||||
AttributeKey<String> key = AttributeKey.valueOf("user");
|
||||
if (channel.hasAttr(key)) {
|
||||
return channel.attr(key).get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Channel get(String key) {
|
||||
return CHANNEL_CACHE_MAP.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机离线,工控机上所有设备离线
|
||||
*
|
||||
* @param key
|
||||
*/
|
||||
public void remove(String key) {
|
||||
CHANNEL_CACHE_MAP.remove(key);
|
||||
//todo 数据库更新工控机状态离线
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.docus.server.common.netty.server;
|
||||
|
||||
import io.netty.bootstrap.ServerBootstrap;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.EventLoopGroup;
|
||||
import io.netty.channel.nio.NioEventLoopGroup;
|
||||
import io.netty.channel.socket.nio.NioServerSocketChannel;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.annotation.Resource;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
/**
|
||||
* Created by 1-point at 2021/9/7
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class NettyServer {
|
||||
|
||||
/**
|
||||
* boss 线程组用于处理连接工作
|
||||
*/
|
||||
private EventLoopGroup boss;
|
||||
/**
|
||||
* worker 线程组用于数据处理
|
||||
*/
|
||||
private EventLoopGroup worker;
|
||||
|
||||
@Resource
|
||||
private NettyServerProperties serverProperties;
|
||||
|
||||
@Resource
|
||||
private NettyServerInitializer serverInitializer;
|
||||
|
||||
@PostConstruct
|
||||
public void start() throws InterruptedException {
|
||||
boss= new NioEventLoopGroup(serverProperties.getBossThreadCount());
|
||||
worker = new NioEventLoopGroup(serverProperties.getWorkerThreadCount());
|
||||
ServerBootstrap bootstrap = new ServerBootstrap();
|
||||
bootstrap.group(boss, worker)
|
||||
// 指定Channel
|
||||
.channel(NioServerSocketChannel.class)
|
||||
//使用指定的端口设置套接字地址
|
||||
.localAddress(new InetSocketAddress(serverProperties.getPort()))
|
||||
//服务端可连接队列数,对应TCP/IP协议listen函数中backlog参数
|
||||
.option(ChannelOption.SO_BACKLOG, 1024)
|
||||
//设置TCP长连接,一般如果两个小时内没有数据的通信时,TCP会自动发送一个活动探测数据报文
|
||||
.childOption(ChannelOption.SO_KEEPALIVE, true)
|
||||
//将小的数据包包装成更大的帧进行传送,提高网络的负载
|
||||
.childOption(ChannelOption.TCP_NODELAY, true)
|
||||
.childHandler(serverInitializer);
|
||||
ChannelFuture future = bootstrap.bind().sync();
|
||||
if (future.isSuccess()) {
|
||||
log.info("Start netty server successfully");
|
||||
} else {
|
||||
log.error("Start netty server failed");
|
||||
}
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void destroy() throws InterruptedException {
|
||||
boss.shutdownGracefully().sync();
|
||||
worker.shutdownGracefully().sync();
|
||||
log.info("关闭Netty");
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.docus.server.common.netty.server;
|
||||
|
||||
import com.docus.server.common.netty.Payload;
|
||||
import com.docus.server.common.netty.server.handler.NettyBusinessHandler;
|
||||
import com.docus.server.common.netty.server.handler.NettyHeartbeatHandler;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.handler.codec.protobuf.ProtobufDecoder;
|
||||
import io.netty.handler.codec.protobuf.ProtobufEncoder;
|
||||
import io.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder;
|
||||
import io.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender;
|
||||
import io.netty.handler.timeout.IdleStateHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Created by 1-point at 2021/9/7
|
||||
*/
|
||||
@Component
|
||||
public class NettyServerInitializer extends ChannelInitializer<Channel> {
|
||||
|
||||
@Resource
|
||||
private NettyServerProperties serverProperties;
|
||||
|
||||
@Resource
|
||||
private NettyBusinessHandler businessHandler;
|
||||
|
||||
@Resource
|
||||
private ChannelRepository channelRepository;
|
||||
|
||||
@Override
|
||||
protected void initChannel(Channel channel) throws Exception {
|
||||
channel.pipeline()
|
||||
//空闲检测
|
||||
.addLast(new IdleStateHandler(serverProperties.getReaderIdleTimeSeconds(),
|
||||
serverProperties.getWriterIdleTimeSeconds(),
|
||||
serverProperties.getAllIdleTimeSeconds(),
|
||||
TimeUnit.SECONDS)
|
||||
)
|
||||
// 加载加码解码处理器,同时解决粘包拆包问题
|
||||
.addLast(new ProtobufVarint32FrameDecoder())
|
||||
.addLast(new ProtobufDecoder(Payload.Message.getDefaultInstance()))
|
||||
.addLast(new ProtobufVarint32LengthFieldPrepender())
|
||||
.addLast(new ProtobufEncoder())
|
||||
// 加载业务处理器
|
||||
.addLast(new NettyHeartbeatHandler(channelRepository))
|
||||
.addLast(businessHandler);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.docus.server.common.netty.server;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Created by 1-point at 2021/9/7
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = NettyServerProperties.PREFIX)
|
||||
public class NettyServerProperties {
|
||||
|
||||
public static final String PREFIX = "netty.server";
|
||||
|
||||
// 读空闲等待时间
|
||||
private int readerIdleTimeSeconds = 30;
|
||||
|
||||
// 写空闲等待时间
|
||||
private int writerIdleTimeSeconds;
|
||||
|
||||
// 读写空闲等待时间
|
||||
private int allIdleTimeSeconds;
|
||||
|
||||
private Integer port;
|
||||
|
||||
private int bossThreadCount;
|
||||
|
||||
private int workerThreadCount;
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.docus.server.common.netty.server.handler;
|
||||
|
||||
import com.docus.server.common.netty.Payload;
|
||||
import com.docus.server.common.netty.server.ChannelRepository;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.SimpleChannelInboundHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
/**
|
||||
* Created by 1-point at 2021/9/7
|
||||
*/
|
||||
@Slf4j
|
||||
@ChannelHandler.Sharable
|
||||
@Component
|
||||
public class NettyBusinessHandler extends SimpleChannelInboundHandler<Payload.Message> {
|
||||
|
||||
@Resource
|
||||
private ChannelRepository repository;
|
||||
|
||||
@Override
|
||||
protected void channelRead0(ChannelHandlerContext channelHandlerContext, Payload.Message message) {
|
||||
if (message.getCmd() == Payload.Message.type.AUTH) {
|
||||
log.info("接受到工控机<{}>的认证消息:{}", message.getClient(), message.getContent());
|
||||
InetSocketAddress ipSocket = (InetSocketAddress) channelHandlerContext.channel().remoteAddress();
|
||||
String clientIp = ipSocket.getAddress().getHostAddress();
|
||||
log.info("工控机:{},连接上线,IP地址信息:{}", message.getClient(), clientIp);
|
||||
Channel channel = repository.get(message.getClient());
|
||||
if (channel != null && channel.isOpen()) {
|
||||
channel.close();
|
||||
}
|
||||
repository.put(message.getClient(), channelHandlerContext.channel());
|
||||
}
|
||||
if (message.getCmd() == Payload.Message.type.PRINT_DONE) {
|
||||
log.info("接受到打印回馈指令,内容{}", message.getContent());
|
||||
}
|
||||
if (message.getCmd() == Payload.Message.type.WHATEVER) {
|
||||
log.info("收到测试消息:{}", message.getContent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
cause.printStackTrace();
|
||||
Channel channel = ctx.channel();
|
||||
if (channel.isActive()) {
|
||||
ctx.close();
|
||||
}
|
||||
super.exceptionCaught(ctx, cause);
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.docus.server.common.netty.server.handler;
|
||||
|
||||
import com.docus.server.common.netty.Payload;
|
||||
import com.docus.server.common.netty.server.ChannelRepository;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelInboundHandlerAdapter;
|
||||
import io.netty.handler.timeout.IdleState;
|
||||
import io.netty.handler.timeout.IdleStateEvent;
|
||||
import io.netty.util.ReferenceCountUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Created by 1-point at 2021/9/8
|
||||
*/
|
||||
@Slf4j
|
||||
@ChannelHandler.Sharable
|
||||
public class NettyHeartbeatHandler extends ChannelInboundHandlerAdapter {
|
||||
|
||||
@Override
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||
Payload.Message message = (Payload.Message) msg;
|
||||
if (message.getCmd().equals(Payload.Message.type.HEARTBEAT_REQUEST)) {
|
||||
log.info("接收到客户端的心跳");
|
||||
} else {
|
||||
if (ctx.channel().isOpen()) {
|
||||
//触发下一个handler
|
||||
ctx.fireChannelRead(msg);
|
||||
}
|
||||
}
|
||||
ReferenceCountUtil.release(msg);
|
||||
}
|
||||
|
||||
private ChannelRepository repository;
|
||||
|
||||
public NettyHeartbeatHandler(ChannelRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
|
||||
if (evt instanceof IdleStateEvent) {
|
||||
IdleStateEvent event = (IdleStateEvent) evt;
|
||||
if (event.state() == IdleState.READER_IDLE) {
|
||||
String clientId = repository.getClientKey(ctx.channel());
|
||||
//移除工控机缓存,设备离线
|
||||
repository.remove(clientId);
|
||||
log.info("{},关闭这个不活跃通道=================>", clientId);
|
||||
ctx.channel().close();
|
||||
}
|
||||
} else {
|
||||
super.userEventTriggered(ctx, evt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
cause.printStackTrace();
|
||||
String clientId = repository.getClientKey(ctx.channel());
|
||||
log.error("通道发生异常,终端连接:{}", clientId);
|
||||
//移除工控机缓存,设备离线
|
||||
if (clientId != null) {
|
||||
repository.remove(clientId);
|
||||
}
|
||||
if (ctx.channel().isActive()) {
|
||||
ctx.close();
|
||||
}
|
||||
super.exceptionCaught(ctx, cause);
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.docus.server.common.retry;
|
||||
|
||||
public class Q {
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.docus.server.convert;
|
||||
|
||||
import com.docus.infrastructure.web.response.PageResult;
|
||||
import com.docus.server.entity.TaskMessage;
|
||||
import com.docus.server.enums.CollectTypeEnum;
|
||||
import com.docus.server.enums.StateEnum;
|
||||
import com.docus.server.vo.TaskMessageVO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mappings;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface TaskMessageConvert {
|
||||
|
||||
TaskMessageConvert INSTANCE = Mappers.getMapper(TaskMessageConvert.class);
|
||||
|
||||
@Mappings({})
|
||||
TaskMessageVO convert(TaskMessage taskMessage);
|
||||
|
||||
@Mappings({})
|
||||
List<TaskMessageVO> convert(List<TaskMessage> taskMessages);
|
||||
|
||||
@Mappings({})
|
||||
PageResult<TaskMessageVO> convert(PageResult<TaskMessage> pageResult);
|
||||
|
||||
default TaskMessage convert(String json, String xml, CollectTypeEnum collectType, String retryKey, Long id) {
|
||||
TaskMessage taskOriginalMessage = new TaskMessage();
|
||||
taskOriginalMessage.setId(id);
|
||||
taskOriginalMessage.setName(collectType.getDesc());
|
||||
taskOriginalMessage.setMemo(collectType.getDisplay());
|
||||
taskOriginalMessage.setCollectType(collectType);
|
||||
taskOriginalMessage.setRetryKey(retryKey);
|
||||
taskOriginalMessage.setJsonStr(json);
|
||||
taskOriginalMessage.setSource(xml);
|
||||
taskOriginalMessage.setState(StateEnum.OK);
|
||||
return taskOriginalMessage;
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.docus.server.infrastructure.cache;
|
||||
|
||||
import com.docus.server.annotation.CacheLayer;
|
||||
|
||||
@CacheLayer("schetaskCacheLayer")
|
||||
public class TaskCacheLayer {
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
package com.docus.server.infrastructure.client;
|
||||
|
||||
public class DownLoadAPI {
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
#当前项目的根package
|
||||
api.base-package=com.docus.server
|
||||
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://db.docus.cn:3306/docus_archivefile?autoReconnect=true&allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||
spring.datasource.username=docus
|
||||
spring.datasource.password=docus702
|
||||
|
||||
mybatis-plus.type-enums-package=com.docus.server.enums
|
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
|
||||
|
||||
WinSW.exe status|findstr NonExistent && winsw install
|
||||
|
||||
WinSW.exe status|findstr stopped && winsw start
|
@ -0,0 +1,21 @@
|
||||
@echo off
|
||||
|
||||
set deployDir=%1\@project.artifactId@
|
||||
if %deployDir%=="" set deployDir=d:\webroot\@project.artifactId@
|
||||
|
||||
set curr_file=%cd%
|
||||
cd /d %deployDir%
|
||||
call stop.bat
|
||||
sc query @project.artifactId@ |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul
|
||||
cd %curr_file%
|
||||
rd/s/q %deployDir%\lib
|
||||
rd/s/q %deployDir%\dataConfig
|
||||
rd/s/q %deployDir%\config
|
||||
rd/s/q %deployDir%\mybatis.mapper
|
||||
del /s/q %deployDir%\*.jar
|
||||
xcopy /Y/E/I * %deployDir%
|
||||
|
||||
cd /d %deployDir%
|
||||
call auto.bat
|
||||
cd %curr_file%
|
||||
|
@ -0,0 +1,21 @@
|
||||
set java_opts=-Xms512m -Xmx512m
|
||||
set key="java_opts"
|
||||
|
||||
|
||||
rem 文件不存在,就跳过
|
||||
if not exist java-ops.ini goto end
|
||||
|
||||
for /f "tokens=1,2 delims==" %%i in (java-ops.ini) do (
|
||||
if "%%i"==%key% set java_opts=%%j)
|
||||
echo java_opts is : %java_opts%
|
||||
|
||||
:end
|
||||
|
||||
rem 启动java
|
||||
|
||||
java %java_opts% -Dfile.encoding=utf-8 -jar -Dspring.profiles.active=@profile.name@ -Dloader.path=config,lib @project.build.finalName@.jar
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
|
||||
winsw stop
|
@ -0,0 +1,47 @@
|
||||
@echo off
|
||||
|
||||
set curr_file=%cd%
|
||||
|
||||
set parentDir=%1
|
||||
if %parentDir%=="" set deployDir=d:\webroot
|
||||
|
||||
|
||||
set deployDir=%parentDir%\@project.artifactId@
|
||||
|
||||
set backupDir=%parentDir%\backup
|
||||
|
||||
set dateStr=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
|
||||
|
||||
|
||||
cd /d %deployDir%
|
||||
|
||||
call stop.bat
|
||||
sc query @project.artifactId@ |Find "RUNNING" && ping 127.0.0.1 -n 10 >nul
|
||||
|
||||
cd /d %parentDir%
|
||||
|
||||
xcopy /Y/E/I project.artifactId@\lib %backupDir%\%dateStr%\@project.artifactId@lib
|
||||
xcopy /Y/E/I project.artifactId@\config %backupDir%\%dateStr%\@project.artifactId@config
|
||||
xcopy /Y/E/I project.artifactId@\*.jar %backupDir%\%dateStr%\@project.artifactId@
|
||||
xcopy /Y/E/I project.artifactId@\*.bat %backupDir%\%dateStr%\@project.artifactId@
|
||||
xcopy /Y/E/I project.artifactId@\*.exe %backupDir%\%dateStr%\@project.artifactId@
|
||||
xcopy /Y/E/I project.artifactId@\*.xml %backupDir%\%dateStr%\@project.artifactId@
|
||||
|
||||
|
||||
cd %curr_file%
|
||||
|
||||
rd/s/q %deployDir%\lib
|
||||
rd/s/q %deployDir%\config
|
||||
del /s/q %deployDir%\*.jar
|
||||
|
||||
|
||||
xcopy /Y/E/I lib %deployDir%\lib
|
||||
xcopy /Y/E/I config %deployDir%\config
|
||||
xcopy /Y/E/I *.jar %deployDir%
|
||||
xcopy /Y/E/I *.bat %deployDir%
|
||||
xcopy /Y/E/I *.exe %deployDir%
|
||||
xcopy /Y/E/I *.xml %deployDir%
|
||||
|
||||
cd /d %deployDir%
|
||||
call auto.bat
|
||||
cd %curr_file%
|
@ -0,0 +1,10 @@
|
||||
<service>
|
||||
<id>docus-collector-server</id>
|
||||
<name>生产-收集器-服务</name>
|
||||
<description>生产-收集器-服务</description>
|
||||
<startmode>Automatic</startmode>
|
||||
<executable>%BASE%\start.bat</executable>
|
||||
<log mode="none"></log>
|
||||
<depend>nacos</depend>
|
||||
<depend>seata-server</depend>
|
||||
</service>
|
@ -0,0 +1,2 @@
|
||||
# If you use SLF4J. First, you need to tell log4jdbc-log4j2 that you want to use the SLF4J logger
|
||||
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
|
@ -0,0 +1,22 @@
|
||||
<?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.docus.server.infrastructure.mapper.TaskCollectorMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.docus.server.entity.scheduling.management.TaskCollector">
|
||||
<id column="id" property="id"/>
|
||||
<result column="collector_version_id" property="collectorVersionId"/>
|
||||
<result column="collect_language" property="collectLanguage"/>
|
||||
<result column="collect_type" property="collectType"/>
|
||||
<result column="start_mode" property="startMode"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, collector_version_id, collect_language, collect_type, start_mode, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,31 @@
|
||||
<?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.docus.server.infrastructure.mapper.TaskCollectorVersionFileMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.docus.server.entity.scheduling.management.TaskCollectorVersionFile">
|
||||
<id column="id" property="id"/>
|
||||
<result column="task_collector_version_id" property="taskCollectorVersionId"/>
|
||||
<result column="task_collector_id" property="taskCollectorId"/>
|
||||
<result column="file_title" property="fileTitle"/>
|
||||
<result column="image_path" property="imagePath"/>
|
||||
<result column="scan_page" property="scanPage"/>
|
||||
<result column="file_size" property="fileSize"/>
|
||||
<result column="file_type" property="fileType"/>
|
||||
<result column="file_source" property="fileSource"/>
|
||||
<result column="file_storage_type" property="fileStorageType"/>
|
||||
<result column="state" property="state"/>
|
||||
<result column="show_file" property="showFile"/>
|
||||
<result column="file_column_1" property="fileColumn1"/>
|
||||
<result column="original_file_name" property="originalFileName"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, task_collector_version_id, task_collector_id, file_title, image_path, scan_page, file_size, file_type, file_source, file_storage_type, state, show_file, file_column_1, original_file_name, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,25 @@
|
||||
<?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.docus.server.infrastructure.mapper.TaskCollectorVersionLogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.docus.server.entity.scheduling.management.TaskCollectorVersionLog">
|
||||
<id column="id" property="id"/>
|
||||
<result column="task_collector_version_id" property="taskCollectorVersionId"/>
|
||||
<result column="task_collector_id" property="taskCollectorId"/>
|
||||
<result column="operation_module" property="operationModule"/>
|
||||
<result column="operation_type" property="operationType"/>
|
||||
<result column="operation_desc" property="operationDesc"/>
|
||||
<result column="operation_content" property="operationContent"/>
|
||||
<result column="state" property="state"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, task_collector_version_id, task_collector_id, operation_module, operation_type, operation_desc, operation_content, state, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,21 @@
|
||||
<?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.docus.server.infrastructure.mapper.TaskCollectorVersionMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.docus.server.entity.scheduling.management.TaskCollectorVersion">
|
||||
<id column="id" property="id"/>
|
||||
<result column="task_collector_id" property="taskCollectorId"/>
|
||||
<result column="collect_version" property="collectVersion"/>
|
||||
<result column="current_version_flag" property="currentVersionFlag"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, task_collector_id, collect_version, current_version_flag, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?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.docus.server.infrastructure.mapper.TaskSystemParamsMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.docus.server.entity.scheduling.management.TaskSystemParams">
|
||||
<id column="param_code" property="paramCode"/>
|
||||
<result column="param_name" property="paramName"/>
|
||||
<result column="param_info" property="paramInfo"/>
|
||||
<result column="param_value" property="paramValue"/>
|
||||
<result column="param_group" property="paramGroup"/>
|
||||
<result column="sort_no" property="sortNo"/>
|
||||
<result column="need_encrypt" property="needEncrypt"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
param_code, param_name, param_info, param_value, param_group, sort_no, need_encrypt, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,29 @@
|
||||
<?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.docus.server.infrastructure.mapper.TaskTerminatorCollectionRecordMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.docus.server.entity.scheduling.management.TaskTerminatorCollectionRecord">
|
||||
<id column="id" property="id"/>
|
||||
<result column="terminator_id" property="terminatorId"/>
|
||||
<result column="terminator_name" property="terminatorName"/>
|
||||
<result column="retry_key" property="retryKey"/>
|
||||
<result column="collect_type" property="collectType"/>
|
||||
<result column="task_memo" property="taskMemo"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="task_detail_info" property="taskDetailInfo"/>
|
||||
<result column="task_exec_state" property="taskExecState"/>
|
||||
<result column="task_params" property="taskParams"/>
|
||||
<result column="last_task_error_msg" property="lastTaskErrorMsg"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, terminator_id, terminator_name, retry_key, collect_type, task_memo, start_time, end_time, task_detail_info, task_exec_state, task_params, last_task_error_msg, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,27 @@
|
||||
<?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.docus.server.infrastructure.mapper.TaskTerminatorMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.docus.server.entity.scheduling.management.TaskTerminator">
|
||||
<id column="id" property="id"/>
|
||||
<result column="terminator_name" property="terminatorName"/>
|
||||
<result column="retry_key" property="retryKey"/>
|
||||
<result column="terminator_ip" property="terminatorIp"/>
|
||||
<result column="busy_state" property="busyState"/>
|
||||
<result column="online_state" property="onlineState"/>
|
||||
<result column="last_task_exec_time" property="lastTaskExecTime"/>
|
||||
<result column="executing_task_name" property="executingTaskName"/>
|
||||
<result column="last_task_error_msg" property="lastTaskErrorMsg"/>
|
||||
<result column="task_params" property="taskParams"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, terminator_name, retry_key, terminator_ip, busy_state, online_state, last_task_exec_time, executing_task_name, last_task_error_msg, task_params, create_time, update_time
|
||||
</sql>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue