This commit is contained in:
2023-03-28 10:24:54 +08:00
parent 5f0b3c40e9
commit 9fcdfac1ee
9 changed files with 973 additions and 864 deletions

View File

@@ -15,6 +15,8 @@ import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.monitor.DeviceStageMonitor;
@@ -55,6 +57,8 @@ public class HongXiangStationDeviceDriver extends AbstractOpcDeviceDriver implem
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
@Autowired @Autowired
AgvService agvService = SpringContextHolder.getBean(AgvService.class); AgvService agvService = SpringContextHolder.getBean(AgvService.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
private Date instruction_require_time = new Date(); private Date instruction_require_time = new Date();
private Date instruction_finished_time = new Date(); private Date instruction_finished_time = new Date();

View File

@@ -19,6 +19,9 @@ import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -62,6 +65,8 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
@Autowired @Autowired
AgvService agvService = SpringContextHolder.getBean(AgvService.class); AgvService agvService = SpringContextHolder.getBean(AgvService.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
private Date instruction_require_time = new Date(); private Date instruction_require_time = new Date();
private Date instruction_finished_time = new Date(); private Date instruction_finished_time = new Date();
@@ -159,7 +164,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
currentB = this.itemProtocol.getItem_currentB(); currentB = this.itemProtocol.getItem_currentB();
currentC = this.itemProtocol.getItem_currentC(); currentC = this.itemProtocol.getItem_currentC();
to_temperature = this.itemProtocol.getItem_to_temperature(); to_temperature = this.itemProtocol.getItem_to_temperature();
if(door != last_door){ if (door != last_door) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号door" + last_door + "->" + door); logServer.deviceExecuteLog(this.device_code, "", "", "信号door" + last_door + "->" + door);
} }
if (mode != last_mode) { if (mode != last_mode) {
@@ -170,6 +175,15 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
thingToNothing(); thingToNothing();
} }
} }
if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
dto.setError_code(String.valueOf(error));
dto.setError_info(ErrorUtil.getDictDetail("hx_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
}
if (finish != last_finish) { if (finish != last_finish) {
if (finish == 1) { if (finish == 1) {
logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireSucess:" + requireSucess); logServer.deviceExecuteLog(device_code, "", "", "开始请求标记复位`此时请求标记值为requireSucess:" + requireSucess);
@@ -360,15 +374,15 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
applyLabelingAndBindingRequest.setDevice_code(start_point_code); applyLabelingAndBindingRequest.setDevice_code(start_point_code);
applyLabelingAndBindingRequest.setType("3"); applyLabelingAndBindingRequest.setType("3");
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
logServer.deviceExecuteLog(this.device_code, "", "", "烘拷完成,请求参数:"+JSON.toJSONString(applyLabelingAndBindingRequest)); logServer.deviceExecuteLog(this.device_code, "", "", "烘拷完成,请求参数:" + JSON.toJSONString(applyLabelingAndBindingRequest));
if (applyLabelingAndBindingResponse.getstatus() == 200) { if (applyLabelingAndBindingResponse.getstatus() == 200) {
requireSucess = true; requireSucess = true;
message = "烘箱完成反馈LMS成功..."; message = "烘箱完成反馈LMS成功...";
logServer.deviceExecuteLog(this.device_code, "", "", "烘拷完成请求成功,响应参数:"+JSON.toJSONString(applyLabelingAndBindingResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "烘拷完成请求成功,响应参数:" + JSON.toJSONString(applyLabelingAndBindingResponse));
} else { } else {
requireSucess = true; requireSucess = true;
message = "烘箱完成反馈LMS失败"+String.valueOf(applyLabelingAndBindingResponse); message = "烘箱完成反馈LMS失败" + String.valueOf(applyLabelingAndBindingResponse);
logServer.deviceExecuteLog(this.device_code, "", "", "烘拷完成请求失败,响应参数:"+JSON.toJSONString(applyLabelingAndBindingResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "烘拷完成请求失败,响应参数:" + JSON.toJSONString(applyLabelingAndBindingResponse));
} }
return true; return true;
} }

View File

@@ -22,6 +22,9 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -61,7 +64,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl"); AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
@Autowired @Autowired
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
//工作模式 //工作模式
int mode = 0; int mode = 0;
int last_mode = 0; int last_mode = 0;
@@ -162,6 +166,13 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
logServer.deviceExecuteLog(this.device_code, "", "", "信号action" + last_action + "->" + action); logServer.deviceExecuteLog(this.device_code, "", "", "信号action" + last_action + "->" + action);
} }
if (error != last_error) { if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
dto.setError_code(String.valueOf(error));
dto.setError_info(ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }

View File

@@ -27,6 +27,9 @@ import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -74,6 +77,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired @Autowired
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
//当前指令 //当前指令
Instruction inst = null; Instruction inst = null;
@@ -191,6 +196,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction" + last_carrier_direction + "->" + carrier_direction); logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction" + last_carrier_direction + "->" + carrier_direction);
} }
if (error != last_error) { if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
dto.setError_code(String.valueOf(error));
dto.setError_info(ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }

View File

@@ -23,6 +23,9 @@ import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -69,6 +72,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired @Autowired
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
//当前指令 //当前指令
Instruction inst = null; Instruction inst = null;
@@ -162,7 +167,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
} }
if (move != last_move) { if (move != last_move) {
message = null; message = null;
if (move == 0 ) { if (move == 0) {
inst_message = null; inst_message = null;
requireSucess = false; requireSucess = false;
this.clearWrite(); this.clearWrite();
@@ -175,6 +180,13 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction" + last_carrier_direction + "->" + carrier_direction); logServer.deviceExecuteLog(this.device_code, "", "", "信号carrier_direction" + last_carrier_direction + "->" + carrier_direction);
} }
if (error != last_error) { if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
dto.setError_code(String.valueOf(error));
dto.setError_info(ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }
@@ -203,7 +215,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
} }
} else { } else {
// logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,反馈失败,查询不到指令号:" + task); // logServer.deviceExecuteLog(device_code, "", "", "输送线任务开始反馈任务状态,反馈失败,查询不到指令号:" + task);
message = "输送线任务反馈状态,查询不到指令号:" + task +"指令已完成"; message = "输送线任务反馈状态,查询不到指令号:" + task + "指令已完成";
inst_message = null; inst_message = null;
} }
} }
@@ -483,10 +495,10 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
if (ObjectUtil.isEmpty(instruction)) { if (ObjectUtil.isEmpty(instruction)) {
//instruction = instructionService.findByCode(String.valueOf(task)); //instruction = instructionService.findByCode(String.valueOf(task));
message ="任务号:"+task +"未找到对应立库指令,请检查"; message = "任务号:" + task + "未找到对应立库指令,请检查";
return false; return false;
} }
if(StrUtil.equals(instruction.getInstruction_status(),"1")){ if (StrUtil.equals(instruction.getInstruction_status(), "1")) {
if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) { if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
vehicle_code = inst.getVehicle_code(); vehicle_code = inst.getVehicle_code();
inst.setExecute_device_code(this.device_code); inst.setExecute_device_code(this.device_code);
@@ -622,7 +634,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
instructionService.create(instdto); instructionService.create(instdto);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("指令创建失败!",e.getMessage()); log.error("指令创建失败!", e.getMessage());
return false; return false;
} }
//创建指令后修改任务状态 //创建指令后修改任务状态
@@ -747,7 +759,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
String vehicle_code = ""; String vehicle_code = "";
if (task > 0) { if (task > 0) {
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task)); Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
if(ObjectUtil.isEmpty(instruction)){ if (ObjectUtil.isEmpty(instruction)) {
message = "申请捆扎电气设备任务号:" + task + "未找到对应指令"; message = "申请捆扎电气设备任务号:" + task + "未找到对应指令";
throw new RuntimeException("该电气任务号未找到对应指令!"); throw new RuntimeException("该电气任务号未找到对应指令!");
} }
@@ -859,8 +871,8 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
this.instruction_require_time = date; this.instruction_require_time = date;
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
Instruction instruction = instructionService.findByCode(String.valueOf(task)); Instruction instruction = instructionService.findByCode(String.valueOf(task));
if(ObjectUtil.isEmpty(instruction)){ if (ObjectUtil.isEmpty(instruction)) {
message = "指令号"+task+"未找到对应指令"; message = "指令号" + task + "未找到对应指令";
return; return;
} }
message = "申请AGV搬运任务中..."; message = "申请AGV搬运任务中...";

View File

@@ -22,6 +22,9 @@ import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -40,7 +43,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.*; import java.util.*;
/** 西门子-输送机驱动-贴标 */ /**
* 西门子-输送机驱动-贴标
*/
@Slf4j @Slf4j
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
@@ -51,9 +56,12 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
@Autowired DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class); @Autowired
@Autowired RouteLineService routelineserver = SpringContextHolder.getBean(RouteLineService.class); DeviceService deviceservice = SpringContextHolder.getBean(DeviceService.class);
@Autowired TaskService taskserver = SpringContextHolder.getBean(TaskService.class); @Autowired
RouteLineService routelineserver = SpringContextHolder.getBean(RouteLineService.class);
@Autowired
TaskService taskserver = SpringContextHolder.getBean(TaskService.class);
@Autowired @Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class); DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
@@ -61,13 +69,18 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
@Autowired @Autowired
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class); RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
@Autowired ParamService paramService = SpringContextHolder.getBean(ParamService.class); @Autowired
@Autowired AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class); ParamService paramService = SpringContextHolder.getBean(ParamService.class);
@Autowired
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
@Autowired @Autowired
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); @Autowired
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
// 当前指令 // 当前指令
Instruction inst = null; Instruction inst = null;
int heartbeat = 0; int heartbeat = 0;
@@ -104,7 +117,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
private Date require_empty_in_time = new Date(); private Date require_empty_in_time = new Date();
private Date require_empty_out_time = new Date(); private Date require_empty_out_time = new Date();
private int instruction_require_time_out =3000; private int instruction_require_time_out = 3000;
// 行架机械手申请任务成功标识 // 行架机械手申请任务成功标识
boolean requireSucess = false; boolean requireSucess = false;
boolean requireApplyLabelingSuccess = false; boolean requireApplyLabelingSuccess = false;
@@ -174,6 +187,13 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
"信号carrier_direction" + last_carrier_direction + "->" + carrier_direction); "信号carrier_direction" + last_carrier_direction + "->" + carrier_direction);
} }
if (error != last_error) { if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
dto.setError_code(String.valueOf(error));
dto.setError_info(ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog( logServer.deviceExecuteLog(
this.device_code, "", "", "信号error" + last_error + "->" + error); this.device_code, "", "", "信号error" + last_error + "->" + error);
@@ -489,7 +509,9 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
this.control(itemMap); this.control(itemMap);
} }
/** 请求指令 */ /**
* 请求指令
*/
public synchronized boolean instruction_require() { public synchronized boolean instruction_require() {
Date date = new Date(); Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() if (date.getTime() - this.instruction_require_time.getTime()
@@ -733,7 +755,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
applyLabelingAndBindingRequest.setWeight(String.valueOf((float) weight / 100)); applyLabelingAndBindingRequest.setWeight(String.valueOf((float) weight / 100));
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse =
acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest); acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,请求参数:"+JSON.toJSONString(applyLabelingAndBindingRequest)); logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,请求参数:" + JSON.toJSONString(applyLabelingAndBindingRequest));
if (applyLabelingAndBindingResponse.getstatus() == 200) { if (applyLabelingAndBindingResponse.getstatus() == 200) {
message = "申请贴标成功"; message = "申请贴标成功";
@@ -745,11 +767,11 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
this.writing(list); this.writing(list);
this.writing(list); this.writing(list);
message = "申请贴标下发电气信号成功"; message = "申请贴标下发电气信号成功";
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,返回参数:"+JSON.toJSONString(applyLabelingAndBindingResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,返回参数:" + JSON.toJSONString(applyLabelingAndBindingResponse));
requireSucess = true; requireSucess = true;
} else { } else {
message = "申请贴标失败," + applyLabelingAndBindingResponse.getMessage(); message = "申请贴标失败," + applyLabelingAndBindingResponse.getMessage();
logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,返回参数:"+JSON.toJSONString(applyLabelingAndBindingResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "申请贴标,返回参数:" + JSON.toJSONString(applyLabelingAndBindingResponse));
} }
} }

View File

@@ -23,6 +23,9 @@ import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -69,6 +72,8 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired @Autowired
NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
//当前指令 //当前指令
Instruction inst = null; Instruction inst = null;
int heartbeat = 0; int heartbeat = 0;
@@ -146,7 +151,15 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getTo_command(); to_command = this.itemProtocol.getTo_command();
if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
dto.setError_code(String.valueOf(error));
dto.setError_info(ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
}
} catch (Exception var17) { } catch (Exception var17) {
var17.printStackTrace(); var17.printStackTrace();
inst_message = var17.getMessage(); inst_message = var17.getMessage();
@@ -174,7 +187,6 @@ public class SiemensOneFloorAGVConveyorDeviceDriver extends AbstractOpcDeviceDri
} }
public void clearWrite() { public void clearWrite() {
List list = new ArrayList(); List list = new ArrayList();

View File

@@ -19,6 +19,9 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -58,7 +61,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
//分切行架机械手是否禁用 0否 1是 //分切行架机械手是否禁用 0否 1是
private int is_disable = 0; private int is_disable = 0;
@@ -190,6 +194,13 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
logServer.deviceExecuteLog(this.device_code, "", "", "信号type" + last_type + "->" + type); logServer.deviceExecuteLog(this.device_code, "", "", "信号type" + last_type + "->" + type);
} }
if (error != last_error) { if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
dto.setError_code(String.valueOf(error));
dto.setError_info(ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }
@@ -639,8 +650,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
feedMessage = e.getMessage(); feedMessage = e.getMessage();
System.out.println("11111111:"+e.getMessage()); System.out.println("11111111:" + e.getMessage());
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + e.getMessage()+ ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol) ); logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + e.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol));
} }
if (mode == 0) { if (mode == 0) {

View File

@@ -22,6 +22,9 @@ import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse; import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.ErrorUtil;
import org.nl.acs.history.service.DeviceErrorLogService;
import org.nl.acs.history.service.dto.DeviceErrorLogDto;
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -67,7 +70,8 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
@Autowired @Autowired
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class); AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsService.class);
@Autowired
DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
@Autowired @Autowired
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
String container; String container;
@@ -221,6 +225,13 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_move + "->" + move); logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_move + "->" + move);
} }
if (error != last_error) { if (error != last_error) {
if (error != 0) {
DeviceErrorLogDto dto = new DeviceErrorLogDto();
dto.setDevice_code(device_code);
dto.setError_code(String.valueOf(error));
dto.setError_info(ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(error)));
deviceErrorLogService.create(dto);
}
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + "->" + error);
} }
if (plcbarcode_length != last_plcbarcode_length) { if (plcbarcode_length != last_plcbarcode_length) {