Browse Source

修改反馈wms点位状态

master
龚宝雄 3 weeks ago
parent
commit
8c0a9a3da3
  1. 2
      acs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/standard_inspect/ItemProtocol.java
  2. 2
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/ItemProtocol.java
  3. 19
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java
  4. 3
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java
  5. 6
      acs/nladmin-system/src/main/java/org/nl/modules/system/service/dto/ParamDto.java
  6. 6
      acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/ParamServiceImpl.java

2
acs/nladmin-system/src/main/java/org/nl/acs/device/device_driver/standard_inspect/ItemProtocol.java

@ -34,7 +34,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) { public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol); Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) { if (value == null) {
log.error("读取错误!"); log.error(this.driver.getDevice().getDevice_code()+"信号读取错误!");
} else { } else {
return value; return value;
} }

2
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_autodoor/ItemProtocol.java

@ -45,7 +45,7 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) { public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol); Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) { if (value == null) {
log.error("读取错误!"); log.error(this.driver.getDevicecode()+"信号读取错误!");
} else { } else {
return value; return value;
} }

19
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_inspect_site/StandardInspectSiteDeviceDriver.java

@ -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,10 +339,10 @@ 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成功!");
// } // }
} }
} }

3
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java

@ -24,8 +24,6 @@ import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -551,7 +549,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
return JSONObject.parseObject(result.body()); return JSONObject.parseObject(result.body());
} }
} catch (Throwable ignored) { } catch (Throwable ignored) {
} finally { } finally {
MDC.remove(log_file_type); MDC.remove(log_file_type);
} }

6
acs/nladmin-system/src/main/java/org/nl/modules/system/service/dto/ParamDto.java

@ -14,11 +14,11 @@ public class ParamDto implements Serializable {
private String id; private String id;
private String code; private String code="";
private String name; private String name="";
private String value; private String value="";
private String remark; private String remark;

6
acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/ParamServiceImpl.java

@ -5,6 +5,7 @@ package org.nl.modules.system.service.impl;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
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 com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -67,7 +68,10 @@ public class ParamServiceImpl implements ParamService {
public ParamDto findByCode(String code) { public ParamDto findByCode(String code) {
WQLObject wo = WQLObject.getWQLObject("sys_param"); WQLObject wo = WQLObject.getWQLObject("sys_param");
JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0); JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
final ParamDto obj = json.toJavaObject(ParamDto.class);; if (ObjectUtil.isEmpty(json)) {
return new ParamDto();
}
final ParamDto obj = json.toJavaObject(ParamDto.class);
return obj; return obj;
} }

Loading…
Cancel
Save