Browse Source

fix XZAGV

master
汪菘 2 years ago
parent
commit
12e8918355
  1. 6
      hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java
  2. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/feedback_agv_status_site/ItemProtocol.java
  3. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/machines_site/ItemProtocol.java
  4. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ndxy_special/ItemProtocol.java
  5. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ndxy_special_two/ItemProtocol.java
  6. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java
  7. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_plcscanner/ItemProtocol.java
  8. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/ItemProtocol.java
  9. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_monitor/ItemProtocol.java
  10. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_emptypallet_site/ItemProtocol.java
  11. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java
  12. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java
  13. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_manipulator_inspect_site/ItemProtocol.java
  14. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_manipulator_stacking_site/ItemProtocol.java
  15. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_photoelectric_inspect_site/ItemProtocol.java
  16. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_rgv/ItemProtocol.java
  17. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_special_inspect_site/ItemProtocol.java
  18. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/whxr/whxr_weighing/ItemProtocol.java
  19. 2
      hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ykbk_special/ItemProtocol.java
  20. 1
      hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/ToAgvDevice.java
  21. 2
      hd/nladmin-system/src/main/resources/config/application-dev.yml
  22. 4
      hd/nladmin-system/src/main/resources/log/AgvServiceImpl.xml
  23. 32
      hd/nladmin-system/src/main/resources/log/QueryXZAgvDeviceStatus.xml
  24. 1
      hd/nladmin-system/src/main/resources/logback-spring.xml

6
hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java

@ -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");

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/feedback_agv_status_site/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/machines_site/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ndxy_special/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ndxy_special_two/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_plcscanner/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_control_with_scanner/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_conveyor_monitor/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_emptypallet_site/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_inspect_site_smart200/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_manipulator_inspect_site/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_manipulator_stacking_site/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_photoelectric_inspect_site/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_rgv/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/standard_special_inspect_site/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/whxr/whxr_weighing/ItemProtocol.java

@ -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);

2
hd/nladmin-system/src/main/java/org/nl/acs/device_driver/ykbk_special/ItemProtocol.java

@ -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);

1
hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/ToAgvDevice.java

@ -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();

2
hd/nladmin-system/src/main/resources/config/application-dev.yml

@ -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}

4
hd/nladmin-system/src/main/resources/log/AgvServiceImpl.xml

@ -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>

32
hd/nladmin-system/src/main/resources/log/QueryXZAgvDeviceStatus.xml

@ -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>

1
hd/nladmin-system/src/main/resources/logback-spring.xml

@ -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">

Loading…
Cancel
Save