fix : 现场问题解决

This commit is contained in:
ls
2024-10-10 10:09:22 +08:00
parent 4a884d986f
commit db2a3f6eda
10 changed files with 134 additions and 60 deletions

View File

@@ -211,7 +211,7 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device
@Override @Override
public void execute() { public void execute() {
try { try {
getAgvStatus(); // getAgvStatus();
} catch (Exception e) { } catch (Exception e) {
message = "获取机器人状态报错"; message = "获取机器人状态报错";
} }

View File

@@ -236,7 +236,25 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
if (container_type == 0) { if (container_type == 0) {
message = "托盘类型为空"; message = "托盘类型为空";
} else { } else {
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode); //已经存在空托入库的任务
TaskDto byStarCodeAndExcute = taskserver.findByStarCodeAndExcute(device_code);
if (byStarCodeAndExcute != null) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("已经存在空托入库的任务")
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
List list1 = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
map.put("value", mode);
list1.add(map);
this.writing(list1);
this.requireSucess = true;
}else {
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
}
} }
} }
@@ -624,6 +642,12 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
jsonObject = JSONObject.parseObject(body); jsonObject = JSONObject.parseObject(body);
} }
message = "申请空托盘出入库,参数,接口返回:" + jsonObject; message = "申请空托盘出入库,参数,接口返回:" + jsonObject;
LuceneLogDto logDto3 = LuceneLogDto.builder()
.device_code(device_code)
.content("测试申请空托盘出入库,参数,接口返回:" + jsonObject)
.build();
logDto3.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto3);
if (ObjectUtil.isNotNull(jsonObject) && jsonObject.getInteger("status") == 200) { if (ObjectUtil.isNotNull(jsonObject) && jsonObject.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)

View File

@@ -366,6 +366,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:" logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
+ instructionReady.getInstruction_code() + ",指令起点:" + instructionReady.getStart_device_code() + instructionReady.getInstruction_code() + ",指令起点:" + instructionReady.getStart_device_code()
+ ",指令终点:" + instructionReady.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString() + ",指令执行失败:" + e.getMessage()); + ",指令终点:" + instructionReady.getNext_device_code() + ",交互参数:" + interactionJsonDTO.toString() + ",指令执行失败:" + e.getMessage());
this.setRequireSucess(true);
return false; return false;
} }
this.setRequireSucess(true); this.setRequireSucess(true);
@@ -410,7 +411,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
taskDto = dto; taskDto = dto;
}else { }else {
forceMove(nextDevice); // forceMove(nextDevice);
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content("当前任务号:" + dto.getTask_code() + " " + next_device_code + "当前move值为" + beltConveyorDeviceDriverEnd.getMove() + "当前mode值为"+beltConveyorDeviceDriverEnd.getMode()) .content("当前任务号:" + dto.getTask_code() + " " + next_device_code + "当前move值为" + beltConveyorDeviceDriverEnd.getMove() + "当前mode值为"+beltConveyorDeviceDriverEnd.getMode())

View File

@@ -180,13 +180,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
.execute(); .execute();
} catch (Exception e) { } catch (Exception e) {
String msg = e.getMessage(); String msg = e.getMessage();
log.info("applyTaskToWms-----输出参数{}", msg); log.info("applyTaskToWmsError-----请求异常输出参数{}", msg);
//网络不通 //网络不通
} }
log.info("applyTaskToWms-----输出参数{}", result2.body()); log.info("applyTaskToWms-----输出参数{}", result2.body());
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTwo", String.valueOf(result2.getStatus()),
JSON.toJSONString(param), String.valueOf(result2.body()), "二期入库申请任务");
luceneLogService.interfaceExecuteLog(luceneLogDto);
return result2; return result2;
} finally { } finally {

View File

@@ -501,4 +501,6 @@ public interface InstructionService extends CommonService<InstructionMybatis> {
List<Instruction> findByNextCode(String nextDeviceCode); List<Instruction> findByNextCode(String nextDeviceCode);
List<Instruction> findReadyIns(); List<Instruction> findReadyIns();
Instruction findByStarCodeAndExcute(String deviceCode);
} }

View File

@@ -2053,6 +2053,16 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
return instructionsList; return instructionsList;
} }
@Override
public Instruction findByStarCodeAndExcute(String start_code) {
Optional<Instruction> optionalInstruction = instructions.stream()
.filter(instruction -> StrUtil.equals(instruction.getStart_device_code(), start_code)
&& StrUtil.equals(instruction.getInstruction_status(), InstructionStatusEnum.READY.getIndex()))
.findFirst();
return optionalInstruction.orElse(null);
}
private boolean regional(String start_device_code, String next_device_code) { private boolean regional(String start_device_code, String next_device_code) {
Device startdevice = deviceAppService.findDeviceByCode(start_device_code); Device startdevice = deviceAppService.findDeviceByCode(start_device_code);

View File

@@ -446,6 +446,13 @@ public interface TaskService extends CommonService<Task> {
TaskDto findByCodeAndExcute(String start_code,String next_code); TaskDto findByCodeAndExcute(String start_code,String next_code);
/**
* 查询起点执行的任务
* @param start_code
* @return
*/
TaskDto findByStarCodeAndExcute(String start_code);
/** /**
* 根据终点设备编号查询当前是否有就绪任务 * 根据终点设备编号查询当前是否有就绪任务
* *

View File

@@ -1005,6 +1005,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
routeLineService.getShortPathLines( routeLineService.getShortPathLines(
start_device_code, acsTask.getNext_device_code(), route_plan_code); start_device_code, acsTask.getNext_device_code(), route_plan_code);
Device startDevice = deviceAppService.findDeviceByCode(start_device_code); Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
RouteLineDto routeLineDto = shortPathsList.get(0); RouteLineDto routeLineDto = shortPathsList.get(0);
String path = routeLineDto.getPath(); String path = routeLineDto.getPath();
String type = routeLineDto.getType(); String type = routeLineDto.getType();
@@ -1014,7 +1015,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
for (int m = 0; m < pathlist.size(); m++) { for (int m = 0; m < pathlist.size(); m++) {
if (pathlist.get(m).equals(start_device_code)) { if (pathlist.get(m).equals(start_device_code)) {
//起点为货架跳过堆垛机 //起点为货架跳过堆垛机
if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) { if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver || nextDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver ) {
index = m + 2; index = m + 2;
}else { }else {
index = m + 1; index = m + 1;
@@ -1231,6 +1232,17 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
} }
@Override
public TaskDto findByStarCodeAndExcute(String start_code) {
Optional<TaskDto> optionalTask = tasks.stream()
.filter(task -> StrUtil.equals(task.getStart_device_code(), start_code)
&& (StrUtil.equals(task.getTask_status(), TaskStatusEnum.BUSY.getIndex())||StrUtil.equals(task.getTask_status(), TaskStatusEnum.READY.getIndex())))
.findFirst();
return optionalTask.orElse(null);
}
@Override @Override
public TaskDto findByEndCodeAndReady(String device_code) { public TaskDto findByEndCodeAndReady(String device_code) {
Optional<TaskDto> optionalTask = tasks.stream() Optional<TaskDto> optionalTask = tasks.stream()

View File

@@ -1,22 +1,29 @@
server: server:
port: 8010 port: 8011
#配置数据源 #配置数据源
spring: spring:
messages:
basename: language/login/login,language/error/error,language/buss/buss,language/monitor/universal/universal,language/monitor/one_device/one_device,language/monitor/two_device/two_device,language/task/task
datasource: datasource:
druid: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.4.121}:${DB_PORT:3306}/${DB_NAME:yy_lms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root} username: ${DB_USER:root}
password: ${DB_PWD:123456} password: ${DB_PWD:NLABC&hl123}
# password: ${DB_PWD:p@ssw0rd}
# 初始连接数 # 初始连接数
initial-size: 5 initial-size: 5
# 最小连接数 # 最小连接数
min-idle: 15 min-idle: 15
# 最大连接数 # 最大连接数
max-active: 60 max-active: 30
# 超时时间(以秒数为单位)
remove-abandoned-timeout: 180
# 获取连接超时时间 # 获取连接超时时间
max-wait: 5000 max-wait: 3000
# 连接有效性检测时间 # 连接有效性检测时间
time-between-eviction-runs-millis: 60000 time-between-eviction-runs-millis: 60000
# 连接在池中最小生存的时间 # 连接在池中最小生存的时间
@@ -36,11 +43,8 @@ spring:
enabled: true enabled: true
stat-view-servlet: stat-view-servlet:
enabled: true enabled: true
# 控制台管理用户名和密码
url-pattern: /druid/* url-pattern: /druid/*
reset-enable: false reset-enable: false
login-username: admin
login-password: 123456
filter: filter:
stat: stat:
enabled: true enabled: true
@@ -51,24 +55,30 @@ spring:
wall: wall:
config: config:
multi-statement-allow: true multi-statement-allow: true
flyway:
# 是否启用flyway
enabled: true
# 编码格式默认UTF-8
encoding: UTF-8
# 迁移sql脚本文件存放路径默认db/migration
locations: classpath:db/migration
# 迁移sql脚本文件名称的前缀默认V
sql-migration-prefix: V
# 迁移sql脚本文件名称的分隔符默认2个下划线__
sql-migration-separator: __
# 迁移sql脚本文件名称的后缀
sql-migration-suffixes: .sql
# 迁移时是否进行校验默认true
validate-on-migrate: true
# 当迁移发现数据库非空且存在没有元数据的表时自动执行基准迁移新建schema_version表
baseline-on-migrate: true
redis: redis:
#数据库索引 #数据库索引
database: ${REDIS_DB:2}
host: ${REDIS_HOST:127.0.0.1} host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379} port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:} # password: ${REDIS_PWD:}
#连接超时时间
timeout: 5000
redisson:
config: |
threads: 4
nettyThreads: 4
singleServerConfig:
database: 1
connectionMinimumIdleSize: 8
connectionPoolSize: 8
address: redis://127.0.0.1:6379
idleConnectionTimeout: 10000
timeout: 3000
# 登录相关配置 # 登录相关配置
login: login:
# 登录缓存 # 登录缓存
@@ -87,36 +97,19 @@ login:
heigth: 36 heigth: 36
# 内容长度 # 内容长度
length: 2 length: 2
# 字体名称,为空则使用默认字体,如遇到线上乱码,设置其他字体即可 # 字体名称,为空则使用默认字体
font-name: font-name:
# 字体大小 # 字体大小
font-size: 25 font-size: 25
#jwt #是否允许生成代码生产环境设置为false
jwt: generator:
header: Authorization enabled: true
# 令牌前缀
token-start-with: Bearer
# 必须使用最少88位的Base64对该令牌进行编码
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
# 令牌过期时间 此处单位/毫秒 默认2小时可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
token-validity-in-seconds: 7200000
# 在线用户key
online-key: online-token-
# 验证码
code-key: code-key-
# token 续期检查时间范围默认30分钟单位默认毫秒在token即将过期的一段时间内用户操作了则给用户的token续期
detect: 1800000
# 续期时间范围,默认 1小时这里单位毫秒
renew: 3600000
# IP 本地解析 # IP 本地解析
ip: ip:
local-parsing: true local-parsing: true
#是否允许生成代码生产环境设置为false
generator:
enabled: false
# 文件存储路径 # 文件存储路径
file: file:
mac: mac:
@@ -133,8 +126,11 @@ file:
avatarMaxSize: 5 avatarMaxSize: 5
logging: logging:
file: file:
path: /app/jar/logs path: D:\acs_log # /Users/onepiece/myFile/acs_logs
config: classpath:logback-spring.xml config: classpath:logback-spring.xml
lucene:
index:
path: /lucene
# Sa-Token配置 # Sa-Token配置
sa-token: sa-token:
@@ -155,10 +151,35 @@ sa-token:
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
# token 前缀 # token 前缀
token-prefix: Bearer token-prefix: Bearer
is-read-cookie: false sso:
is-read-body: false # Ticket有效期 (单位: 秒),默认五分钟
ticket-timeout: 300
# 所有允许的授权回调地址
allow-url: "*"
# 是否打开单点注销功能
is-slo: true
# ------- SSO-模式三相关配置 下面的配置在SSO模式三并且 is-slo=true 时打开)
# 是否打开模式三
isHttp: true
# 接口调用秘钥用于SSO模式三的单点注销功能
secretkey: kQwIOrYvnXmSDkwEiFngrKidMcdrgKor
# ---- 除了以上配置项,你还需要为 Sa-Token 配置http请求处理器文档有步骤说明
is-read-cookie: true
is-print: false
# 未登录 StpUtil.getTokenSession() 设置值,获取值 @SaIgnore 得忽略接口
token-session-check-login: false
alone-redis:
# Redis数据库索引默认为0
database: 2
# Redis服务器地址
host: 127.0.0.1
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码默认为空
password:
# 连接超时时间
timeout: 10s
agvToAcs:
agvToAcs: addr: http://10.1.3.96:8011
addr: http://http://10.1.3.96:8011

View File

@@ -72,7 +72,7 @@ spring:
waitForTasksToCompleteOnShutdown: true # 参考spring线程池设计优雅关闭线程池默认true waitForTasksToCompleteOnShutdown: true # 参考spring线程池设计优雅关闭线程池默认true
awaitTerminationSeconds: 5 # 优雅关闭线程池时阻塞等待线程池中任务执行时间默认3单位s awaitTerminationSeconds: 5 # 优雅关闭线程池时阻塞等待线程池中任务执行时间默认3单位s
preStartAllCoreThreads: false # 是否预热所有核心线程默认false preStartAllCoreThreads: false # 是否预热所有核心线程默认false
runTimeout: 2000 # 任务执行超时阈值单位ms默认0不统计 runTimeout: 5000 # 任务执行超时阈值单位ms默认0不统计
queueTimeout: 1000 # 任务在队列等待超时阈值单位ms默认0不统计 queueTimeout: 1000 # 任务在队列等待超时阈值单位ms默认0不统计
- threadPoolName: scheduled_pool # 线程池名称,必填 - threadPoolName: scheduled_pool # 线程池名称,必填
threadPoolAliasName: scheduled_thread # 线程池别名,可选 threadPoolAliasName: scheduled_thread # 线程池别名,可选
@@ -89,7 +89,7 @@ spring:
waitForTasksToCompleteOnShutdown: true # 参考spring线程池设计优雅关闭线程池默认true waitForTasksToCompleteOnShutdown: true # 参考spring线程池设计优雅关闭线程池默认true
awaitTerminationSeconds: 5 # 优雅关闭线程池时阻塞等待线程池中任务执行时间默认3单位s awaitTerminationSeconds: 5 # 优雅关闭线程池时阻塞等待线程池中任务执行时间默认3单位s
preStartAllCoreThreads: false # 是否预热所有核心线程默认false preStartAllCoreThreads: false # 是否预热所有核心线程默认false
runTimeout: 2000 # 任务执行超时阈值单位ms默认0不统计 runTimeout: 5000 # 任务执行超时阈值单位ms默认0不统计
queueTimeout: 1000 # 任务在队列等待超时阈值单位ms默认0不统计 queueTimeout: 1000 # 任务在队列等待超时阈值单位ms默认0不统计
task: task:
pool: pool: