看板初版

This commit is contained in:
psh
2024-04-17 16:13:13 +08:00
parent 72e14e618c
commit 7b20aca842
11 changed files with 209 additions and 67 deletions

View File

@@ -19,6 +19,11 @@ public class ItemProtocol {
public static String item_weight = "weight";
public static String item_sub_tray = "sub_tray";
public static String item_mother_tray = "mother_tray";
public static String item_error_code="error_code";
public static String item_device_type="device_type";
public static String item_frame_type="frame_type";
public static String item_mother_type="mother_type";
public static String item_sub_type="sub_type";
public static String item_to_command = "to_command";
public static String item_to_target = "to_target";
public static String item_to_task = "to_task";
@@ -60,6 +65,26 @@ public class ItemProtocol {
return this.getOpcStringValue(item_mother_tray);
}
public Integer getErrorCode() {
return this.getOpcIntegerValue(item_error_code);
}
public Integer getDeviceType() {
return this.getOpcIntegerValue(item_device_type);
}
public Integer getFrameType() {
return this.getOpcIntegerValue(item_frame_type);
}
public Integer getMotherType() {
return this.getOpcIntegerValue(item_mother_type);
}
public Integer getSubType() {
return this.getOpcIntegerValue(item_sub_type);
}
public int getToCommand() {
return this.getOpcIntegerValue(item_to_command);
}

View File

@@ -23,10 +23,7 @@ import org.nl.acs.task.service.mapper.TaskMapper;
import org.nl.config.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 检测站点驱动
@@ -130,6 +127,17 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
String devicecode;
int device_type=0;
int last_device_type=0;
int frame_type=0;
int last_frame_type=0;
int mother_type=0;
int last_mother_type=0;
int sub_type=0;
int last_sub_type=0;
int error_code=0;
int last_error_code=0;
@Override
public Device getDevice() {
return this.device;
@@ -149,6 +157,11 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
weight = this.itemProtocol.getWeight();
mother_tray = this.itemProtocol.getMotherTray();
sub_tray = this.itemProtocol.getSubTray();
device_type = this.itemProtocol.getDeviceType();
frame_type = this.itemProtocol.getFrameType();
mother_type = this.itemProtocol.getMotherType();
sub_type = this.itemProtocol.getSubType();
error_code = this.itemProtocol.getErrorCode();
if (mode != last_mode) {
this.setRequireSucess(false);
if(mode==2){
@@ -159,10 +172,56 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
if (error != last_error) {
}
if (mode != last_mode) {
this.setRequireSucess(false);
if (move != last_move) {
JSONObject json = new JSONObject();
json.put("point_qty", move);
acsToWmsService.notify(json);
}
if (!Objects.equals(mother_tray, last_mother_tray)) {
JSONObject json = new JSONObject();
json.put("mother_tray", mother_tray);
acsToWmsService.notify(json);
}
if (!Objects.equals(sub_tray, last_sub_tray)) {
JSONObject json = new JSONObject();
json.put("sub_tray", sub_tray);
acsToWmsService.notify(json);
}
if (device_type != last_device_type) {
JSONObject json = new JSONObject();
json.put("device_type", device_type);
acsToWmsService.notify(json);
}
if (frame_type != last_frame_type) {
JSONObject json = new JSONObject();
json.put("frame_type", frame_type);
acsToWmsService.notify(json);
}
if (mother_type != last_mother_type) {
JSONObject json = new JSONObject();
json.put("sub_type", sub_type);
acsToWmsService.notify(json);
}
if (sub_type != last_sub_type) {
JSONObject json = new JSONObject();
json.put("sub_type", sub_type);
acsToWmsService.notify(json);
}
if (error_code != last_error_code) {
JSONObject json = new JSONObject();
json.put("error", error_code);
acsToWmsService.notify(json);
}
} catch (Exception var17) {
return;
@@ -222,6 +281,11 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
last_sub_tray = sub_tray;
last_mother_tray = mother_tray;
last_action = action;
last_device_type=device_type;
last_frame_type=frame_type;
last_mother_type=mother_type;
last_sub_type=sub_type;
last_error_code=error_code;
}

View File

@@ -126,7 +126,7 @@ public interface AcsToWmsService {
/**
* ACS向WMS反馈任务状态
*/
String notify(BaseRequest request);
String notify(JSONObject param);
/**
* 任务阶段反馈最新点位

View File

@@ -580,12 +580,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
@Override
public String notify(BaseRequest requestParam) {
public String notify(JSONObject param) {
try {
MDC.put(log_file_type, log_type);
String api = addressService.findByCode("notify").getMethods_url();
log.info("notify-----输入参数{}", JSON.toJSONString(requestParam, SerializerFeature.DisableCircularReferenceDetect));
String result = LmsUtil.notifyAcs(api, requestParam);
log.info("notify-----输入参数{}", param);
String result = LmsUtil.notifyAcs(api, param);
log.info("notify-----输出参数{}", result);
return result;
} finally {