|
|
@ -2,14 +2,11 @@ package org.nl.acs.device_driver.basedriver.standard_inspect_site; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.http.HttpResponse; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import lombok.Data; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
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_driver.DeviceDriver; |
|
|
|
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.monitor.DeviceStageMonitor; |
|
|
|
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.route.service.RouteLineService; |
|
|
|
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.openscada.opc.lib.da.Server; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
import java.util.HashMap; |
|
|
@ -139,11 +133,17 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp |
|
|
|
move = this.itemProtocol.getMove(); |
|
|
|
task = this.itemProtocol.getTask(); |
|
|
|
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) { |
|
|
|
this.requireSucess = false; |
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception var17) { |
|
|
|
return; |
|
|
|
} |
|
|
@ -178,6 +178,7 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp |
|
|
|
JSONObject param = new JSONObject(); |
|
|
|
param.put("device_code", this.devicecode); |
|
|
|
param.put("is_have", this.move); |
|
|
|
log.info(this.devicecode + "检测到货位光电信号变动,开始反馈WMS"); |
|
|
|
this.shipDeviceUpdate(param); |
|
|
|
} |
|
|
|
} |
|
|
@ -338,10 +339,10 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp |
|
|
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); |
|
|
|
} else { |
|
|
|
this.instruction_require_time = date; |
|
|
|
|
|
|
|
JSONObject response = acsToWmsService.shipDeviceUpdate(param); |
|
|
|
// if (20000 == response.getIntValue("code")) {
|
|
|
|
this.requireSucess = true; |
|
|
|
log.info(this.devicecode + "检测到货位光电信号变动,反馈WMS成功!"); |
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|