add: 内包间日志增加

This commit is contained in:
yanps
2024-01-09 09:30:09 +08:00
parent fefdead3f5
commit fb79480ae1
5 changed files with 60 additions and 27 deletions

View File

@@ -125,7 +125,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
//请求成功标记
Boolean requireSucess = false;
String message = null;
String message = "";
String device_code;
String remark = "";
@@ -138,7 +138,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
@Override
public void execute() {
try {
String message = null;
device_code = this.getDeviceCode();
heartbeat = this.itemProtocol.getHeartbeat();
mode = this.itemProtocol.getMode();
@@ -198,7 +197,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
acsToWmsService.sendDeviceStatus(param);
requireSucess = false;
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode + "复位请求标记:" + requireSucess);
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
// logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
}
if (move != last_move) {
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
@@ -228,7 +227,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
} else {
this.setIsonline(true);
this.setIserror(false);
message = "";
Instruction instruction = null;
List toInstructions;
//纸管库申请任务
@@ -286,24 +284,35 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
//取货完成
private void sucess() {
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
Instruction inst1 = instructionService.findByCode(String.valueOf(task));
String task_code = inst1.getTask_code();
applyManipulatorActionRequest.setAction("1");
applyManipulatorActionRequest.setTask_code1(task_code);
logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈套管工位取货完成");
ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse1.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "套管工位取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 6);
this.writing(map);
message = "套管工位取货完成";
requireSucess = true;
Date date = new Date();
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out);
} else {
requireSucess = false;
message = "套管工位取货失败";
//logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1);
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
Instruction inst1 = instructionService.findByCode(String.valueOf(task1));
if (ObjectUtil.isNotEmpty(inst1)) {
String task_code = inst1.getTask_code();
applyManipulatorActionRequest.setAction("1");
applyManipulatorActionRequest.setTask_code1(task_code);
logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈套管工位取货完成");
ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse1.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "套管工位取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1));
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 6);
this.writing(map);
message = "套管工位取货完成";
remark = "";
requireSucess = true;
} else {
requireSucess = false;
message = "套管工位取货失败";
//logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1);
}
} else {
requireSucess = false;
message = "行架任务号不存在";
}
}
}
@@ -327,6 +336,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴完成反馈完成,返回参数:" + applyManipulatorActionResponse);
message = "套轴完成成功";
remark = null;
} else {
message = applyManipulatorActionResponse.getMessage();
Map<String, Object> map = new LinkedHashMap<>();
@@ -471,7 +481,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
jo.put("material1", material1);
jo.put("material2", material2);
jo.put("isOnline", this.getIsonline());
jo.put("message", ObjectUtil.isNotEmpty(remark) ? "反馈套管失败的原因:" + remark : remark);
jo.put("message", ObjectUtil.isNotEmpty(remark) ? "反馈套管失败的原因:" + remark : message);
return jo;
}

View File

@@ -160,6 +160,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
int flag;
//1点对点 6下卷拔轴 7换轴 8 放轴
String truss_type;
String device_code;
@@ -173,6 +175,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String feedMessage = "";
List<String> getDeviceCodeList = null;
List<String> putDeviceCodeList = null;
@@ -763,6 +766,18 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
} else if (this.getAction() == 8) {
action = "任务完成";
}
String type = "";
if("1".equals(this.truss_type)){
type = "点对点任务";
}else if("6".equals(this.truss_type)){
type = "下卷拔轴任务";
}else if("7".equals(this.truss_type)){
type = "换轴任务";
}else if("8".equals(this.truss_type)){
type = "放轴任务";
}else if("9".equals(this.truss_type)){
type = "异常气胀轴任务";
}
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
@@ -780,6 +795,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("inflatable_shaft_size", this.inflatable_shaft_size);
jo.put("version", this.inflatableShaftVersion);
jo.put("driver_type", "station");
jo.put("notCreateInstMessage", notCreateInstMessage);
jo.put("truss_type", type);
return jo;
}
@@ -835,6 +852,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
//按照优先级排序 优先级相等按照创建时间排序
taskDtos = this.sortTask(taskDtos);
TaskDto taskDto = taskDtos.get(0);
truss_type = taskDto.getTruss_type();
//存在行架->暂存的AGV任务 需要过滤
// 9 行架任务
if (!StrUtil.equals(taskDto.getTask_type(), "9")) {
@@ -909,6 +927,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
}
}
if (!ObjectUtil.isEmpty(task)) {
truss_type = task.getTruss_type();
Device nextdevice = deviceAppService.findDeviceByCode(task.getNext_device_code());
Device startdevice = deviceAppService.findDeviceByCode(task.getStart_device_code());
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver;
@@ -1000,6 +1019,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
notCreateTaskMessage = "";
} else {
notCreateInstMessage = "未找到关联设备的任务,指令无法创建";
return false;
}
return true;
}
@@ -1024,19 +1044,19 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
rgv2.getMode() + "rgv1的move2" + rgv1.getMove2() + "rgv2的move2" + rgv2.getMove2());*/
return true;
} else {
message = "rgv信号不符合";
notCreateInstMessage = "rgv信号不符合";
//logServer.deviceExecuteLog(device_code, "", "", "rgv信号不符合");
}
} else {
message = "关联的站点不是rgv";
notCreateInstMessage = "关联的站点不是rgv";
//logServer.deviceExecuteLog(device_code, "", "", "关联的站点不是rgv");
}
} else {
message = "rgv没有关联站点";
notCreateInstMessage = "rgv没有关联站点";
//logServer.deviceExecuteLog(device_code, "", "", "rgv没有关联站点");
}
} else {
message = "rgv不是普通站点";
notCreateInstMessage = "rgv不是普通站点";
//logServer.deviceExecuteLog(device_code, "", "", "rgv不是普通站点");
}

View File

@@ -288,6 +288,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
jo.put("move2", move2);
jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror());
jo.put("task", this.getTask());
jo.put("qty1", this.getQty1());
jo.put("qty2", this.getQty2());
jo.put("message", this.getMessage());

View File

@@ -644,7 +644,6 @@ export default {
})
getDicts().then(data => {
this.dicts = data
console.log(this.dict.label.task_status[3])
})
},
methods: {

View File

@@ -761,6 +761,9 @@ export default {
} else if (val === 'version') {
const obj = { name: '轴代数', value: data[val] }
this.arr.push(obj)
} else if (val === 'truss_type') {
const obj = { name: '内包间行架任务类型', value: data[val] }
this.arr.push(obj)
}
}
}