fix XZAGV

This commit is contained in:
USER-20220102CG\noblelift
2023-05-09 17:09:52 +08:00
parent 414ace75d3
commit 12e8918355
24 changed files with 60 additions and 22 deletions

View File

@@ -600,7 +600,8 @@ public class AgvServiceImpl implements AgvService {
HttpResponse result2 = HttpRequest.get(agvurl2)
.timeout(20000)//超时,毫秒
.execute();
log.info("查询agv状态数据 vehicles:" + result.body());
log.info("查询agv状态数据 vehicleDetails:" + result2.body());
System.out.println("查询agv状态数据:" + result.body());
if (result.getStatus() == 200) {
JSONArray ja = JSONArray.fromObject(result.body());
@@ -612,6 +613,9 @@ public class AgvServiceImpl implements AgvService {
String transportOrder = jo.getString("transportOrder");
JSONObject detailjo = JSONObject.fromObject(result2.body());
JSONObject item = (JSONObject) detailjo.get(name);
if(ObjectUtil.isEmpty(detailjo.get(name))){
continue;
}
String x = item.getString("x");
String y = item.getString("y");
String angle = item.getString("angle");

View File

@@ -33,7 +33,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -69,7 +69,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -79,7 +79,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -74,7 +74,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -84,7 +84,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -101,7 +101,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -96,7 +96,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -79,7 +79,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -72,7 +72,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -74,7 +74,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -75,7 +75,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -79,7 +79,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -87,7 +87,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -95,7 +95,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -94,7 +94,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -72,7 +72,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -190,7 +190,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -74,7 +74,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegerValue(protocol);
if (value == null) {
log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
//log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);

View File

@@ -31,6 +31,7 @@ public class ToAgvDevice {
JSONObject json = new JSONObject();
Map<String, AgvDto> agv_map = agvService.findAllAgvFromCache();
if(ObjectUtil.isEmpty(agv_map)){
System.out.println("AGV设备数据为空无法反馈");
return;
}
JSONArray agv_rows = new JSONArray();

View File

@@ -9,7 +9,7 @@ spring:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:zgln_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hs_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:tg_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root}
# password: ${DB_PWD:P@ssw0rd}
# password: ${DB_PWD:Root.123456}

View File

@@ -3,7 +3,7 @@
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
<property name="LOG_HOME" value="${logPath}"/>
<!-- 按照每天生成日志文件 -->
<appender name="FILE5" class="ch.qos.logback.core.rolling.RollingFileAppender">
<appender name="AgvServiceImpl" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/反馈AGV请求/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
@@ -27,6 +27,6 @@
<!-- 打印sql -->
<logger name="org.nl.acs.agv.server.impl.AgvServiceImpl" level="info" additivity="false">
<appender-ref ref="FILE5"/>
<appender-ref ref="AgvServiceImpl"/>
</logger>
</included>

View File

@@ -0,0 +1,32 @@
<?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="QueryXZAgvDeviceStatus" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<FileNamePattern>${LOG_HOME}/查询仙知AGV设备状态/%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>
</encoder>
</appender>
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
<appender-ref ref="FILE3"/>
</logger>-->
<!-- 打印sql -->
<logger name="org.nl.modules.quartz.task.QueryXZAgvDeviceStatus" level="info" additivity="false">
<appender-ref ref="QueryXZAgvDeviceStatus"/>
</logger>
</included>

View File

@@ -26,6 +26,7 @@ https://juejin.cn/post/6844903775631572999
<include resource="log/QueryXZAgvTaskStatus.xml"/>
<include resource="log/NDCSocketConnectionAutoRun.xml"/>
<include resource="log/ScannerBarcode.xml"/>
<include resource="log/QueryXZAgvDeviceStatus.xml"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">