This commit is contained in:
USER-20220102CG\noblelift
2023-03-30 17:44:04 +08:00
parent bc47ff43e9
commit bd74d6a3d4

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;
@@ -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);
} }
@@ -903,13 +915,13 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl
JSONObject jo = JSON.parseObject(str); JSONObject jo = JSON.parseObject(str);
if (ObjectUtil.isEmpty(jo)) { if (ObjectUtil.isEmpty(jo)) {
message = "申请空盘出库接口不通"; message = "申请空盘出库接口不通";
requireSucess = true; // requireSucess = true;
} else { } else {
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
message = "申请空盘出库成功"; message = "申请空盘出库成功";
requireSucess = true; requireSucess = true;
} else { } else {
requireSucess = true; // requireSucess = true;
message = "申请空盘出库失败," + jo.get("message").toString(); message = "申请空盘出库失败," + jo.get("message").toString();
} }
} }