|
@ -2,14 +2,11 @@ package org.nl.acs.device_driver.basedriver.standard_inspect_site; |
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.date.DateUtil; |
|
|
import cn.hutool.core.util.IdUtil; |
|
|
import cn.hutool.core.util.IdUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import cn.hutool.core.util.StrUtil; |
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import lombok.Data; |
|
|
import lombok.Data; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; |
|
|
|
|
|
import org.nl.acs.device.service.DeviceService; |
|
|
import org.nl.acs.device.service.DeviceService; |
|
|
import org.nl.acs.device_driver.DeviceDriver; |
|
|
import org.nl.acs.device_driver.DeviceDriver; |
|
|
import org.nl.acs.device_driver.RouteableDeviceDriver; |
|
|
import org.nl.acs.device_driver.RouteableDeviceDriver; |
|
@ -20,8 +17,6 @@ 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.monitor.DeviceStageMonitor; |
|
|
import org.nl.acs.monitor.DeviceStageMonitor; |
|
|
import org.nl.acs.opc.Device; |
|
|
import org.nl.acs.opc.Device; |
|
|
import org.nl.acs.opc.DeviceAppService; |
|
|
|
|
|
import org.nl.acs.opc.DeviceAppServiceImpl; |
|
|
|
|
|
import org.nl.acs.opc.WcsConfig; |
|
|
import org.nl.acs.opc.WcsConfig; |
|
|
import org.nl.acs.route.service.RouteLineService; |
|
|
import org.nl.acs.route.service.RouteLineService; |
|
|
import org.nl.acs.route.service.dto.RouteLineDto; |
|
|
import org.nl.acs.route.service.dto.RouteLineDto; |
|
@ -32,7 +27,6 @@ import org.nl.modules.wql.core.bean.WQLObject; |
|
|
import org.nl.modules.wql.util.SpringContextHolder; |
|
|
import org.nl.modules.wql.util.SpringContextHolder; |
|
|
import org.openscada.opc.lib.da.Server; |
|
|
import org.openscada.opc.lib.da.Server; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.http.HttpStatus; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
import java.util.Date; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
@ -139,11 +133,17 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp |
|
|
move = this.itemProtocol.getMove(); |
|
|
move = this.itemProtocol.getMove(); |
|
|
task = this.itemProtocol.getTask(); |
|
|
task = this.itemProtocol.getTask(); |
|
|
hasGoods = this.itemProtocol.getMove(); |
|
|
hasGoods = this.itemProtocol.getMove(); |
|
|
|
|
|
if (devicecode.contains("F2TBJ")) { |
|
|
|
|
|
if (move != last_move) { |
|
|
|
|
|
log.info(this.devicecode + ",检测到货位信号的值由" + last_move + "->" + move); |
|
|
|
|
|
} |
|
|
|
|
|
if (mode != last_mode) { |
|
|
|
|
|
log.info(this.devicecode + ",检测到货位工作模式的值由" + last_mode + "->" + mode); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
if (move != last_move) { |
|
|
if (move != last_move) { |
|
|
this.requireSucess = false; |
|
|
this.requireSucess = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} catch (Exception var17) { |
|
|
} catch (Exception var17) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
@ -178,6 +178,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp |
|
|
JSONObject param = new JSONObject(); |
|
|
JSONObject param = new JSONObject(); |
|
|
param.put("device_code", this.devicecode); |
|
|
param.put("device_code", this.devicecode); |
|
|
param.put("is_have", this.move); |
|
|
param.put("is_have", this.move); |
|
|
|
|
|
log.info(this.devicecode + "检测到货位光电信号变动,开始反馈WMS"); |
|
|
this.shipDeviceUpdate(param); |
|
|
this.shipDeviceUpdate(param); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -338,11 +339,11 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp |
|
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); |
|
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); |
|
|
} else { |
|
|
} else { |
|
|
this.instruction_require_time = date; |
|
|
this.instruction_require_time = date; |
|
|
|
|
|
|
|
|
JSONObject response = acsToWmsService.shipDeviceUpdate(param); |
|
|
JSONObject response = acsToWmsService.shipDeviceUpdate(param); |
|
|
// if (20000 == response.getIntValue("code")) {
|
|
|
// if (20000 == response.getIntValue("code")) {
|
|
|
this.requireSucess = true; |
|
|
this.requireSucess = true; |
|
|
// }
|
|
|
log.info(this.devicecode + "检测到货位光电信号变动,反馈WMS成功!"); |
|
|
|
|
|
// }
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|