38 changed files with 1996 additions and 403 deletions
@ -1,14 +1,33 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<included> |
||||
|
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/> |
||||
|
<property name="LOG_HOME" value="${logPath}"/> |
||||
|
<!-- 按照每天生成日志文件 --> |
||||
|
<appender name="AgvNdcOneDeviceDriver" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> |
||||
|
<!--日志文件输出的文件名--> |
||||
|
<FileNamePattern>${LOG_HOME}/AGVNDC交互/%d{yyyy-MM-dd}.%i.log</FileNamePattern> |
||||
|
<!--日志文件保留天数--> |
||||
|
<maxHistory>15</maxHistory> |
||||
|
<!--单个日志最大容量 至少10MB才能看得出来--> |
||||
|
<maxFileSize>200MB</maxFileSize> |
||||
|
<!--所有日志最多占多大容量--> |
||||
|
<totalSizeCap>2GB</totalSizeCap> |
||||
|
</rollingPolicy> |
||||
|
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
||||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符--> |
||||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern> |
||||
|
<charset>${log.charset}</charset> |
||||
|
</encoder> |
||||
|
|
||||
<?import java.lang.*?> |
</appender> |
||||
<?import java.util.*?> |
|
||||
<?import javafx.scene.*?> |
|
||||
<?import javafx.scene.control.*?> |
|
||||
<?import javafx.scene.layout.*?> |
|
||||
|
|
||||
<AnchorPane xmlns="http://javafx.com/javafx" |
<!-- <logger name="org.nl.start.Init" level="info" additivity="false"> |
||||
xmlns:fx="http://javafx.com/fxml" |
<appender-ref ref="FILE3"/> |
||||
fx:controller="$CONTROLLER_NAME$" |
</logger>--> |
||||
prefHeight="400.0" prefWidth="600.0"> |
|
||||
|
|
||||
</AnchorPane> |
<!-- 打印sql --> |
||||
|
<logger name="org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver" level="info" additivity="false"> |
||||
|
<appender-ref ref="AgvNdcOneDeviceDriver"/> |
||||
|
</logger> |
||||
|
</included> |
||||
|
@ -1,23 +1,23 @@ |
|||||
package org.nl.config; |
//package org.nl.config;
|
||||
|
//
|
||||
import com.alibaba.druid.pool.DruidDataSource; |
//import com.alibaba.druid.pool.DruidDataSource;
|
||||
import lombok.extern.slf4j.Slf4j; |
//import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties; |
//import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean; |
//import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration; |
//import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary; |
//import org.springframework.context.annotation.Primary;
|
||||
|
//
|
||||
import javax.sql.DataSource; |
//import javax.sql.DataSource;
|
||||
|
//
|
||||
@Configuration |
//@Configuration
|
||||
@Slf4j |
//@Slf4j
|
||||
public class DataBaseConfig { |
//public class DataBaseConfig {
|
||||
|
//
|
||||
@Primary |
// @Primary
|
||||
@Bean(name = "dataSource") |
// @Bean(name = "dataSource")
|
||||
@ConfigurationProperties(prefix = "spring.datasource.druid") |
// @ConfigurationProperties(prefix = "spring.datasource.druid")
|
||||
public DataSource dataSource() { |
// public DataSource dataSource() {
|
||||
return new DruidDataSource(); |
// return new DruidDataSource();
|
||||
} |
// }
|
||||
|
//
|
||||
} |
//}
|
||||
|
@ -0,0 +1,41 @@ |
|||||
|
package org.nl.config.lucene; |
||||
|
|
||||
|
/** |
||||
|
* @Author: lyd |
||||
|
* @Description: 定义lucene相关常量 |
||||
|
* @Date: 2023/8/25 |
||||
|
*/ |
||||
|
public class LogMessageConstant { |
||||
|
/** 级别 */ |
||||
|
public final static String FIELD_LEVEL = "level"; |
||||
|
/** 时间 */ |
||||
|
public final static String FIELD_TIMESTAMP = "timestamp"; |
||||
|
/** 类的限定名 */ |
||||
|
public final static String FIELD_CLASS_NAME = "logger"; |
||||
|
/** 线程名 */ |
||||
|
public final static String FIELD_THREAD = "thread"; |
||||
|
/** 日志内容 */ |
||||
|
public final static String FIELD_MESSAGE = "message"; |
||||
|
public final static String FIELD_TRACEID = "tlogTraceId"; |
||||
|
// 定义颜色值
|
||||
|
/** 文本颜色:黑色 */ |
||||
|
public final static String COLOR_BLACK = "\u001B[30m"; |
||||
|
/** 文本颜色:红色 */ |
||||
|
public final static String COLOR_RED = "\u001B[31m"; |
||||
|
/** 文本颜色:绿色 */ |
||||
|
public final static String COLOR_GREEN = "\u001B[32m"; |
||||
|
/** 文本颜色:黄色 */ |
||||
|
public final static String COLOR_YELLOW = "\u001B[33m"; |
||||
|
/** 文本颜色:蓝色 */ |
||||
|
public final static String COLOR_BLUE = "\u001B[34m"; |
||||
|
/** 文本颜色:品红色 */ |
||||
|
public final static String COLOR_MAGENTA = "\u001B[35m"; |
||||
|
/** 文本颜色:青色 */ |
||||
|
public final static String COLOR_CYAN = "\u001B[36m"; |
||||
|
/** 文本颜色:白色 */ |
||||
|
public final static String COLOR_WHITE = "\u001B[37m"; |
||||
|
/** 文本颜色重置 */ |
||||
|
public final static String COLOR_RESET = "\u001B[0m"; |
||||
|
/** 背景颜色:黄色 */ |
||||
|
public final static String BACKGROUND_YELLOW = "\u001B[43m"; |
||||
|
} |
@ -0,0 +1,89 @@ |
|||||
|
package org.nl.config.lucene; |
||||
|
/** |
||||
|
* @author ldjun |
||||
|
* @version 1.0 |
||||
|
* @date 2023年08月24日 13:00 |
||||
|
* @desc desc |
||||
|
*/ |
||||
|
|
||||
|
import ch.qos.logback.classic.spi.ILoggingEvent; |
||||
|
import ch.qos.logback.core.AppenderBase; |
||||
|
import cn.hutool.core.date.DateUtil; |
||||
|
import cn.hutool.core.util.ObjectUtil; |
||||
|
import org.apache.lucene.analysis.Analyzer; |
||||
|
import org.apache.lucene.document.*; |
||||
|
import org.apache.lucene.index.IndexWriter; |
||||
|
import org.apache.lucene.index.IndexWriterConfig; |
||||
|
import org.apache.lucene.store.Directory; |
||||
|
import org.apache.lucene.store.FSDirectory; |
||||
|
import org.wltea.analyzer.lucene.IKAnalyzer; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.nio.file.Paths; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
public class LuceneAppender extends AppenderBase<ILoggingEvent> { |
||||
|
|
||||
|
private Directory index; |
||||
|
private IndexWriter indexWriter; |
||||
|
|
||||
|
@Override |
||||
|
public void start() { |
||||
|
super.start(); |
||||
|
String indexPath = "C:\\lucene\\index"; |
||||
|
try { |
||||
|
index = FSDirectory.open(Paths.get(indexPath)); |
||||
|
} catch (IOException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
|
||||
|
// 初始化 Lucene 索引
|
||||
|
Analyzer analyzer = new IKAnalyzer(); |
||||
|
IndexWriterConfig config = new IndexWriterConfig(analyzer); |
||||
|
try { |
||||
|
indexWriter = new IndexWriter(index, config); |
||||
|
} catch (IOException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
protected void append(ILoggingEvent event) { |
||||
|
String message = event.getFormattedMessage(); |
||||
|
Map<String, String> mdcPropertyMap = event.getMDCPropertyMap(); |
||||
|
Document doc = new Document(); |
||||
|
String formattedDateTime = DateUtil.format(new java.util.Date(event.getTimeStamp()), "yyyy-MM-dd HH:mm:ss.SSS"); |
||||
|
doc.add(new StringField(LogMessageConstant.FIELD_LEVEL, event.getLevel().toString(), Field.Store.YES)); |
||||
|
doc.add(new StringField(LogMessageConstant.FIELD_TIMESTAMP, formattedDateTime,Field.Store.YES)); |
||||
|
doc.add(new StoredField(LogMessageConstant.FIELD_CLASS_NAME, event.getLoggerName())); |
||||
|
doc.add(new StoredField(LogMessageConstant.FIELD_THREAD, event.getThreadName())); |
||||
|
if (ObjectUtil.isNotEmpty(mdcPropertyMap)) { |
||||
|
String traceId = mdcPropertyMap.get(LogMessageConstant.FIELD_TRACEID); |
||||
|
if (ObjectUtil.isNotEmpty(traceId)) { |
||||
|
doc.add(new StringField(LogMessageConstant.FIELD_TRACEID, traceId,Field.Store.YES)); |
||||
|
} else { |
||||
|
doc.add(new StringField(LogMessageConstant.FIELD_TRACEID, "无生成链路ID",Field.Store.YES)); |
||||
|
} |
||||
|
} else { |
||||
|
doc.add(new StringField(LogMessageConstant.FIELD_TRACEID, "无生成链路ID",Field.Store.YES)); |
||||
|
} |
||||
|
doc.add(new TextField(LogMessageConstant.FIELD_MESSAGE, message, Field.Store.YES)); |
||||
|
try { |
||||
|
indexWriter.addDocument(doc); |
||||
|
indexWriter.commit(); |
||||
|
} catch (IOException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void stop() { |
||||
|
super.stop(); |
||||
|
try { |
||||
|
indexWriter.close(); |
||||
|
} catch (IOException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -1,56 +1,56 @@ |
|||||
package org.nl.config.saconfig; |
//package org.nl.config.saconfig;
|
||||
|
//
|
||||
import org.springframework.core.annotation.Order; |
//import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component; |
//import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.cors.CorsConfiguration; |
//import org.springframework.web.cors.CorsConfiguration;
|
||||
|
//
|
||||
import javax.servlet.*; |
//import javax.servlet.*;
|
||||
import javax.servlet.http.HttpServletRequest; |
//import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse; |
//import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException; |
//import java.io.IOException;
|
||||
|
//
|
||||
/** |
///**
|
||||
* 跨域过滤器 |
// * 跨域过滤器
|
||||
* @author kong |
// * @author kong
|
||||
*/ |
// */
|
||||
@Component |
//@Component
|
||||
@Order(-200) |
//@Order(-200)
|
||||
public class CorsFilter implements Filter { |
//public class CorsFilter implements Filter {
|
||||
|
//
|
||||
static final String OPTIONS = "OPTIONS"; |
// static final String OPTIONS = "OPTIONS";
|
||||
|
//
|
||||
@Override |
// @Override
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) |
// public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
|
||||
throws IOException, ServletException { |
// throws IOException, ServletException {
|
||||
HttpServletRequest request = (HttpServletRequest) req; |
// HttpServletRequest request = (HttpServletRequest) req;
|
||||
HttpServletResponse response = (HttpServletResponse) res; |
// HttpServletResponse response = (HttpServletResponse) res;
|
||||
// 允许指定域访问跨域资源
|
// // 允许指定域访问跨域资源
|
||||
response.setHeader("Access-Control-Allow-Origin", "*"); |
// response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
// 允许所有请求方式
|
// // 允许所有请求方式
|
||||
response.setHeader("Access-Control-Allow-Methods", "*"); |
// response.setHeader("Access-Control-Allow-Methods", "*");
|
||||
// 有效时间
|
// // 有效时间
|
||||
response.setHeader("Access-Control-Max-Age", "3600"); |
// response.setHeader("Access-Control-Max-Age", "3600");
|
||||
// 允许的header参数
|
// // 允许的header参数
|
||||
response.setHeader("Access-Control-Allow-Headers", "*"); |
// response.setHeader("Access-Control-Allow-Headers", "*");
|
||||
response.setHeader("Access-Control-Allow-Credentials", "true"); |
// response.setHeader("Access-Control-Allow-Credentials", "true");
|
||||
|
//
|
||||
// 如果是预检请求,直接返回
|
// // 如果是预检请求,直接返回
|
||||
if (OPTIONS.equals(request.getMethod())) { |
// if (OPTIONS.equals(request.getMethod())) {
|
||||
System.out.println("=======================浏览器发来了OPTIONS预检请求=========="); |
// System.out.println("=======================浏览器发来了OPTIONS预检请求==========");
|
||||
response.getWriter().print(""); |
// response.getWriter().print("");
|
||||
return; |
// return;
|
||||
} |
// }
|
||||
|
//
|
||||
// System.out.println("*********************************过滤器被使用**************************");
|
// // System.out.println("*********************************过滤器被使用**************************");
|
||||
chain.doFilter(req, res); |
// chain.doFilter(req, res);
|
||||
} |
// }
|
||||
|
//
|
||||
@Override |
// @Override
|
||||
public void init(FilterConfig filterConfig) { |
// public void init(FilterConfig filterConfig) {
|
||||
} |
// }
|
||||
|
//
|
||||
@Override |
// @Override
|
||||
public void destroy() { |
// public void destroy() {
|
||||
} |
// }
|
||||
|
//
|
||||
} |
//}
|
||||
|
@ -1,9 +0,0 @@ |
|||||
package org.nl.wms.ext.acs.service; |
|
||||
|
|
||||
/** |
|
||||
* @Author: lyd |
|
||||
* @Description: mes请求wms |
|
||||
* @Date: 2023/8/3 |
|
||||
*/ |
|
||||
public interface MesToWmsService { |
|
||||
} |
|
@ -1,15 +0,0 @@ |
|||||
package org.nl.wms.ext.acs.service.impl; |
|
||||
|
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
import org.nl.wms.ext.acs.service.MesToWmsService; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
/** |
|
||||
* @Author: lyd |
|
||||
* @Description: |
|
||||
* @Date: 2023/8/3 |
|
||||
*/ |
|
||||
@Slf4j |
|
||||
@Service |
|
||||
public class MesToWmsServiceImpl implements MesToWmsService { |
|
||||
} |
|
@ -0,0 +1,39 @@ |
|||||
|
package org.nl.wms.ext.mes.controller; |
||||
|
|
||||
|
import cn.dev33.satoken.annotation.SaIgnore; |
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.nl.common.logging.annotation.Log; |
||||
|
import org.nl.wms.ext.mes.service.MesToWmsService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.http.HttpStatus; |
||||
|
import org.springframework.http.ResponseEntity; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @Author: lyd |
||||
|
* @Description: mes请求wms |
||||
|
* @Date: 2023/8/30 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@Api(tags = "mes请求lms") |
||||
|
@RequestMapping("/api/mes") |
||||
|
@Slf4j |
||||
|
@SaIgnore |
||||
|
public class MesToWmsController { |
||||
|
@Autowired |
||||
|
private MesToWmsService mesToWmsService; |
||||
|
|
||||
|
@PostMapping("/downOrder") |
||||
|
@Log("下发工单") |
||||
|
@ApiOperation("下发工单") |
||||
|
@SaIgnore |
||||
|
public ResponseEntity<Object> downOrderForMes(@RequestBody JSONObject param) { |
||||
|
return new ResponseEntity<>(mesToWmsService.downOrderForMes(param), HttpStatus.OK); |
||||
|
} |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package org.nl.wms.ext.mes.service; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
|
||||
|
/** |
||||
|
* @Author: lyd |
||||
|
* @Description: mes请求wms |
||||
|
* @Date: 2023/8/3 |
||||
|
*/ |
||||
|
public interface MesToWmsService { |
||||
|
/** |
||||
|
* mes下发工单 |
||||
|
* @param param |
||||
|
* @return |
||||
|
*/ |
||||
|
JSONObject downOrderForMes(JSONObject param); |
||||
|
} |
@ -1,4 +1,4 @@ |
|||||
package org.nl.wms.ext.acs.service; |
package org.nl.wms.ext.mes.service; |
||||
|
|
||||
/** |
/** |
||||
* @Author: lyd |
* @Author: lyd |
@ -0,0 +1,21 @@ |
|||||
|
package org.nl.wms.ext.mes.service.impl; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.nl.wms.ext.mes.service.MesToWmsService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @Author: lyd |
||||
|
* @Description: |
||||
|
* @Date: 2023/8/3 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Service |
||||
|
public class MesToWmsServiceImpl implements MesToWmsService { |
||||
|
@Override |
||||
|
public JSONObject downOrderForMes(JSONObject param) { |
||||
|
log.info("mes传来工单信息:" + param); |
||||
|
return param; |
||||
|
} |
||||
|
} |
@ -1,7 +1,7 @@ |
|||||
package org.nl.wms.ext.acs.service.impl; |
package org.nl.wms.ext.mes.service.impl; |
||||
|
|
||||
import lombok.extern.slf4j.Slf4j; |
import lombok.extern.slf4j.Slf4j; |
||||
import org.nl.wms.ext.acs.service.WmsToMesService; |
import org.nl.wms.ext.mes.service.WmsToMesService; |
||||
import org.springframework.stereotype.Service; |
import org.springframework.stereotype.Service; |
||||
|
|
||||
/** |
/** |
@ -0,0 +1,11 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> |
||||
|
<properties> |
||||
|
<comment>IK Analyzer 扩展配置</comment> |
||||
|
<!--用户可以在这里配置自己的扩展字典 --> |
||||
|
<entry key="ext_dict">ext.dic;</entry> |
||||
|
|
||||
|
<!--用户可以在这里配置自己的扩展停止词字典--> |
||||
|
<entry key="ext_stopwords">stopword.dic;</entry> |
||||
|
|
||||
|
</properties> |
File diff suppressed because it is too large
@ -1,9 +1,9 @@ |
|||||
window.g = { |
window.g = { |
||||
dev: { |
dev: { |
||||
VUE_APP_BASE_API: 'http://127.0.0.1:8010' |
VUE_APP_BASE_API: 'http://10.93.41.201:8010' |
||||
}, |
}, |
||||
prod: { |
prod: { |
||||
VUE_APP_BASE_API: 'http://127.0.0.1:8010' |
VUE_APP_BASE_API: 'http://10.93.41.201:8010' |
||||
} |
} |
||||
|
|
||||
} |
} |
||||
|
Loading…
Reference in new issue