add:日志

This commit is contained in:
2025-10-20 16:00:12 +08:00
parent ee95726bd8
commit 1dfc984b83
2 changed files with 201 additions and 48 deletions

View File

@@ -111,6 +111,51 @@ public class ItemProtocol {
return this.getOpcStringValue(item_to_material); return this.getOpcStringValue(item_to_material);
} }
public String getTo_spec() {
return this.getOpcStringValue(item_to_spec);
}
public String getTo_qty() {
return this.getOpcStringValue(item_to_qty);
}
public String getTo_material1() {
return this.getOpcStringValue(item_to_material1);
}
public String getTo_spec1() {
return this.getOpcStringValue(item_to_spec1);
}
public String getTo_qty1() {
return this.getOpcStringValue(item_to_qty1);
}
public String getTo_material2() {
return this.getOpcStringValue(item_to_material2);
}
public String getTo_spec2() {
return this.getOpcStringValue(item_to_spec2);
}
public String getTo_qty2() {
return this.getOpcStringValue(item_to_qty2);
}
public String getTo_material3() {
return this.getOpcStringValue(item_to_material3);
}
public String getTo_spec3() {
return this.getOpcStringValue(item_to_spec3);
}
public String getTo_qty3() {
return this.getOpcStringValue(item_to_qty3);
}
Boolean isonline; Boolean isonline;
@@ -169,4 +214,5 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_qty3, "下发BH-19物料数量", "DB2.W8")); list.add(new ItemDto(item_to_qty3, "下发BH-19物料数量", "DB2.W8"));
return list; return list;
} }
} }

View File

@@ -100,37 +100,37 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
String to_material = null; String to_material = null;
String last_to_material = null; String last_to_material = null;
//下发物料规格 //下发物料规格
int to_spec=0; String to_spec = null;
int last_to_spec=0; String last_to_spec = null;
//下发物料数量 //下发物料数量
int to_qty=0; String to_qty = null;
int last_to_qty=0; String last_to_qty = null;
//下发物料类型 //下发物料类型
String to_material1 = null; String to_material1 = null;
String last_to_material1 = null; String last_to_material1 = null;
//下发物料规格 //下发物料规格
int to_spec1=0; String to_spec1 = null;
int last_to_spec1=0; String last_to_spec1 = null;
//下发物料数量 //下发物料数量
int to_qty1=0; String to_qty1 = null;
int last_to_qty1=0;//下发物料类型 String last_to_qty1 = null;//下发物料类型
String to_material2 = null; String to_material2 = null;
String last_to_material2 = null; String last_to_material2 = null;
//下发物料规格 //下发物料规格
int to_spec2=0; String to_spec2 = null;
int last_to_spec2=0; String last_to_spec2 = null;
//下发物料数量 //下发物料数量
int to_qty2=0; String to_qty2 = null;
int last_to_qty2=0;//下发物料类型 String last_to_qty2 = null;//下发物料类型
String to_material3 = null; String to_material3 = null;
String last_to_material3 = null; String last_to_material3 = null;
//下发物料规格 //下发物料规格
int to_spec3=0; String to_spec3 = null;
int last_to_spec3=0; String last_to_spec3 = null;
//下发物料数量 //下发物料数量
int to_qty3=0; String to_qty3 = null;
int last_to_qty3=0; String last_to_qty3 = null;
//管芯编码 //管芯编码
String paper_code = null; String paper_code = null;
@@ -172,6 +172,104 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
paper_code = this.itemProtocol.getPaperCode(); paper_code = this.itemProtocol.getPaperCode();
paper_location = this.itemProtocol.getPaperLocation(); paper_location = this.itemProtocol.getPaperLocation();
to_spec = this.itemProtocol.getTo_spec();
to_qty = this.itemProtocol.getTo_qty();
to_material = this.itemProtocol.getTo_material();
to_spec1 = this.itemProtocol.getTo_spec1();
to_qty1 = this.itemProtocol.getTo_qty1();
to_material1 = this.itemProtocol.getTo_material1();
to_spec2 = this.itemProtocol.getTo_spec2();
to_qty2 = this.itemProtocol.getTo_qty2();
to_material2 = this.itemProtocol.getTo_material2();
to_spec3 = this.itemProtocol.getTo_spec3();
to_qty3 = this.itemProtocol.getTo_qty3();
to_material3 = this.itemProtocol.getTo_material3();
if (!StrUtil.equals(to_spec, last_to_spec)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_spec, 由" + last_to_spec + "->" + to_spec)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_qty, last_to_qty)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_qty, 由" + last_to_qty + "->" + to_qty)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_material, last_to_material)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_material, 由" + last_to_material + "->" + to_material)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_spec1, last_to_spec1)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_spec1, 由" + last_to_spec1 + "->" + to_spec1)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_qty1, last_to_qty1)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_qty1, 由" + last_to_qty1 + "->" + to_qty1)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_material1, last_to_material1)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_material1, 由" + last_to_material1 + "->" + to_material1)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_spec2, last_to_spec2)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_spec2, 由" + last_to_spec2 + "->" + to_spec2)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_qty2, last_to_qty2)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_qty2, 由" + last_to_qty2 + "->" + to_qty2)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_material2, last_to_material2)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_material2, 由" + last_to_material2 + "->" + to_material2)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_spec3, last_to_spec3)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_spec3, 由" + last_to_spec3 + "->" + to_spec3)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_qty3, last_to_qty3)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_qty3, 由" + last_to_qty3 + "->" + to_qty3)
.log_level(4)
.build());
}
if (!StrUtil.equals(to_material3, last_to_material3)) {
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
.device_code(device_code)
.content("信号: to_material3, 由" + last_to_material3 + "->" + to_material3)
.log_level(4)
.build());
}
if (mode != last_mode) { if (mode != last_mode) {
this.setRequireSucess(false); this.setRequireSucess(false);
if (mode == 2) { if (mode == 2) {
@@ -246,6 +344,15 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
last_to_spec = to_spec; last_to_spec = to_spec;
last_to_material = to_material; last_to_material = to_material;
last_to_qty = to_qty; last_to_qty = to_qty;
last_to_spec1 = to_spec1;
last_to_material1 = to_material1;
last_to_qty1 = to_qty1;
last_to_spec2 = to_spec2;
last_to_material2 = to_material2;
last_to_qty2 = to_qty2;
last_to_spec3 = to_spec3;
last_to_material3 = to_material3;
last_to_qty3 = to_qty3;
} }
private boolean feedbackDie() { private boolean feedbackDie() {
@@ -370,7 +477,8 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
String action = ""; String action = "";
jo.put("device_name", this.getDevice().getDevice_name()); jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move);jo.put("action", action); jo.put("move", move);
jo.put("action", action);
jo.put("isOnline", true); jo.put("isOnline", true);
jo.put("error", ErrorUtil.getDictDetail("gxhj_error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("gxhj_error_type", String.valueOf(this.getError())));
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
@@ -383,5 +491,4 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
} }
} }