rev:现场测试优化

This commit is contained in:
2025-01-14 10:51:36 +08:00
parent 3b18f47cbf
commit 98d9dfd024
8 changed files with 186 additions and 94 deletions

View File

@@ -308,7 +308,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
log.info("读取关门信号值为:{}", standardAutodoorDeviceDriver.getClose());
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
} else {
log.info("未下发NDC信号原因: 读取光栅信号值为:{}", standardAutodoorDeviceDriver.getClose());
log.info("未下发NDC信号原因: 读取自动门信号值为:{}", standardAutodoorDeviceDriver.getClose());
}
}
else if (device.getDeviceDriver() instanceof RasterDeviceDriver) {

View File

@@ -614,8 +614,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
if (paperTubePickSiteDeviceDriver.getAction() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
@@ -1390,8 +1389,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
if (paperTubePickSiteDeviceDriver.getAction() == 1) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())
@@ -1701,8 +1699,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} catch (Exception e) {
e.printStackTrace();
}
if (paperTubePickSiteDeviceDriver.getAction() == 1
&& paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) {
if (paperTubePickSiteDeviceDriver.getAction() == 0) {
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(this.getDeviceCode())

View File

@@ -315,7 +315,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
} else {
this.require_apply_mxrk_time = date;
if (StrUtil.isNotEmpty(hand_barcode) && StrUtil.isNotEmpty(hand_material_barcode)) {
applyIn(StorageTypeEnum.BOX_IN.getType(), mode);
applyInByHand(StorageTypeEnum.BOX_IN.getType(), mode);
} else if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) {
message = "托盘条码为空、或者子卷码为空";
} else {
@@ -335,7 +335,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
} else {
this.require_apply_zjrk_time = date;
if (StrUtil.isNotEmpty(hand_barcode) && StrUtil.isNotEmpty(hand_material_barcode)) {
applyIn(StorageTypeEnum.STORAGE.getType(), mode);
applyInByHand(StorageTypeEnum.STORAGE.getType(), mode);
} else if (StrUtil.isEmpty(barcode) || StrUtil.isEmpty(material_barcode)) {
message = "托盘条码为空、或者子卷码为空";
} else {
@@ -705,15 +705,79 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
try {
JSONObject param = new JSONObject();
param.put("device_code", device_code);
if (StrUtil.isNotEmpty(hand_barcode)) {
param.put("vehicle_code", hand_barcode);
}
if (StrUtil.isNotEmpty(barcode) && (barcode.startsWith("A") || barcode.startsWith("B"))) {
param.put("vehicle_code", barcode);
}
if (StrUtil.isNotEmpty(material_barcode)) {
param.put("material_barcode", material_barcode);
}
if (mode == 7 && weight != 0) {
param.put("weight", weight);
}
param.put("type", type);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("木箱、子卷入库申请入库任务,参数:" + param)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
HttpResponse httpResponse = acsToWmsService.applyTwo(param);
JSONObject jsonObject = null;
if (ObjectUtil.isNotEmpty(httpResponse)) {
String body = httpResponse.body();
jsonObject = JSONObject.parseObject(body);
}
log.info("wms反馈结果:{}",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) && Integer.valueOf(200).equals(jsonObject.getInteger("status"))) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("木箱、子卷入库申请入库任务,参数,接口返回:" + jsonObject)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
List list1 = new ArrayList();
Map map = new HashMap();
map.put("code", "to_command");
map.put("value", mode);
list1.add(map);
log.error("下发电气--------:{}",map);
this.writing(list1);
requireSucess = true;
} else {
this.iserror = true;
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("木箱、子卷入库申请入库任务,返回参数:" + jsonObject)
.build();
logDto2.setLog_level(4);
message = "木箱、子卷入库申请入库任务报错,返回参数:" + jsonObject;
luceneExecuteLogService.deviceExecuteLog(logDto2);
}
} catch (Exception e) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("木箱、子卷入库申请入库任务,返回参数:" + e.getMessage())
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
}
}
private void applyInByHand(String type, int mode) {
try {
JSONObject param = new JSONObject();
param.put("device_code", device_code);
if (StrUtil.isNotEmpty(hand_barcode)) {
param.put("vehicle_code", hand_barcode);
}
if (StrUtil.isNotEmpty(hand_material_barcode)) {
param.put("material_barcode", hand_material_barcode);
}
@@ -777,6 +841,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
}
/**
* 更新指令状态
*/

View File

@@ -425,12 +425,20 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
return true;
} else {
List<TaskDto> taskDtoList = taskserver.queryTaskByDeviceCode(startDeviceCode);
List<TaskDto> taskDtoList = taskserver.findByTrappedManipulatorReady();
if (ObjectUtil.isNotEmpty(taskDtoList)) {
for (int j = 0; j < taskDtoList.size(); j++) {
List<TaskDto> taskDtosReady = new ArrayList<>();
if (CollUtil.isNotEmpty(taskDtoList)) {
for (TaskDto taskDto1 : taskDtoList) {
if (getDeviceCodeList.contains(taskDto1.getStart_device_code())) {
taskDtosReady.add(taskDto1);
}
}
}
for (int j = 0; j < taskDtosReady.size(); j++) {
//按照优先级排序 优先级相等按照创建时间排序
taskDtoList = this.sortTask(taskDtoList);
task = taskDtoList.get(j);
taskDtosReady = this.sortTask(taskDtosReady);
task = taskDtosReady.get(j);
// 6 行架任务 8烘箱任务
if (!StrUtil.equals(task.getTask_type(), "6")) {
task = null;

View File

@@ -1048,7 +1048,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
public void finish(Instruction dto) {
String now = DateUtil.now();
dto.setInstruction_status(InstructionStatusEnum.FINISHED.getIndex());
dto.setUpdate_time(now);
InstructionMybatis ins = ConvertUtil.convert(dto, InstructionMybatis.class);
instructionMapper.updateById(ins);

View File

@@ -28,9 +28,9 @@ https://juejin.cn/post/6844903775631572999
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--withJansi 参数改为true-->
<withJansi>true</withJansi>
<encoder class="com.yomahub.tlog.core.enhance.logback.AspectLogbackEncoder">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${log.pattern}</pattern>
<!-- <charset>${log.charset}</charset>-->
<charset>${log.charset}</charset>
</encoder>
</appender>
@@ -47,7 +47,7 @@ https://juejin.cn/post/6844903775631572999
<!--所有日志最多占多大容量-->
<totalSizeCap>20GB</totalSizeCap>
</rollingPolicy>
<encoder class="com.yomahub.tlog.core.enhance.logback.AspectLogbackEncoder">
<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>