opt: agv偏移实现两个点位调整,设备信号优化
This commit is contained in:
@@ -121,4 +121,16 @@ public interface AcsConfig {
|
||||
* 日志级别
|
||||
*/
|
||||
String LOGLEVEL = "log_level";
|
||||
/**
|
||||
* AGV偏移量A点
|
||||
*/
|
||||
String OFFSET_A = "offSet_A";
|
||||
/**
|
||||
* AGV偏移量B点
|
||||
*/
|
||||
String OFFSET_B = "offSet_B";
|
||||
/**
|
||||
* 选择A点还是B点
|
||||
*/
|
||||
String CHOOSE = "choose";
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.agv.server.NDCAgvService;
|
||||
import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun;
|
||||
import org.nl.acs.common.base.CommonFinalParam;
|
||||
@@ -39,6 +40,7 @@ import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.impl.TaskServiceImpl;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.config.lucene.enums.LogTypeEnum;
|
||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
@@ -310,6 +312,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
||||
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
||||
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
||||
String choose = paramService.findByCode(AcsConfig.CHOOSE).getValue();
|
||||
String length1 = rangingStationsDeviceDriver.getLength1();
|
||||
String length2 = rangingStationsDeviceDriver.getLength2();
|
||||
Float len1 = 0.0F;
|
||||
@@ -318,6 +322,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
len1 = Float.parseFloat(length1);
|
||||
len2 = Float.parseFloat(length2);
|
||||
}
|
||||
if("A".equals(choose)){
|
||||
String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue();
|
||||
if(ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)){
|
||||
Integer integer = Integer.valueOf(offSet_A);
|
||||
len1 = len1 - integer;
|
||||
}
|
||||
}else if("B".equals(choose)){
|
||||
String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue();
|
||||
if(ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)){
|
||||
Integer integer = Integer.valueOf(offSet_B);
|
||||
len1 = integer + len1;
|
||||
}
|
||||
}
|
||||
if(len1 * len2 < 1 ){
|
||||
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
||||
if (roundedNumber == 0) {
|
||||
|
||||
@@ -20,8 +20,8 @@ public class ItemProtocol {
|
||||
public static String item_to_target = "to_target";
|
||||
public static String item_to_task = "to_task";
|
||||
public static String item_weight = "weight";
|
||||
public static String item_material_type = "material_type";
|
||||
public static String item_barcode = "barcode";
|
||||
/*public static String item_material_type = "material_type";
|
||||
public static String item_barcode = "barcode";*/
|
||||
|
||||
private StandardInspectSiteDeviceDriver driver;
|
||||
|
||||
@@ -50,13 +50,13 @@ public class ItemProtocol {
|
||||
}
|
||||
|
||||
|
||||
public int getMaterialType() {
|
||||
/*public int getMaterialType() {
|
||||
return this.getOpcIntegerValue(item_material_type);
|
||||
}
|
||||
|
||||
public int getBarcode() {
|
||||
return this.getOpcIntegerValue(item_barcode);
|
||||
}
|
||||
}*/
|
||||
|
||||
public int getToCommand() {
|
||||
return this.getOpcIntegerValue(item_to_command);
|
||||
@@ -98,9 +98,9 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_mode, "工作状态", "DB600.B2", Boolean.valueOf(true)));
|
||||
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3"));
|
||||
list.add(new ItemDto(item_action, "取放信号", "DB600.B4"));
|
||||
list.add(new ItemDto(item_material_type, "物料类型", "DB600.D6"));
|
||||
/*list.add(new ItemDto(item_material_type, "物料类型", "DB600.D6"));*/
|
||||
list.add(new ItemDto(item_error, "报警信号", "DB600.B7"));
|
||||
list.add(new ItemDto(item_barcode, "条码", "DB600.D8"));
|
||||
/*list.add(new ItemDto(item_barcode, "条码", "DB600.D8"));*/
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,8 +178,8 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
move = this.itemProtocol.getMove();
|
||||
hasGoods = this.itemProtocol.getMove();
|
||||
action = this.itemProtocol.getAction();
|
||||
material_type = this.itemProtocol.getMaterialType();
|
||||
barcode = this.itemProtocol.getBarcode();
|
||||
/*material_type = this.itemProtocol.getMaterialType();
|
||||
barcode = this.itemProtocol.getBarcode();*/
|
||||
if (mode != last_mode) {
|
||||
this.setRequireSucess(false);
|
||||
if (mode == 2) {
|
||||
|
||||
@@ -27,9 +27,9 @@ public class ItemProtocol {
|
||||
//报警
|
||||
public static String item_error = "error";
|
||||
//x轴坐标
|
||||
public static String item_x_position = "x_position";
|
||||
public static String item_x_position = "x";
|
||||
//y轴坐标
|
||||
public static String item_y_position = "y_position";
|
||||
public static String item_y_position = "y";
|
||||
|
||||
//下发命令
|
||||
public static String item_to_command = "to_command";
|
||||
|
||||
@@ -18,9 +18,9 @@ public class ItemProtocol {
|
||||
//工作模式
|
||||
public static String item_mode = "mode";
|
||||
//光电信号
|
||||
public static String item_move = "move";
|
||||
public static String item_move = "move1";
|
||||
//动作信号
|
||||
public static String item_action = "action";
|
||||
public static String item_action = "action1";
|
||||
//任务号
|
||||
public static String item_task = "task";
|
||||
//报警
|
||||
|
||||
@@ -164,6 +164,8 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
String device_code;
|
||||
|
||||
String message = null;
|
||||
private Date instruction_require_time = new Date();
|
||||
private int instruction_require_time_out = 3000;
|
||||
|
||||
@Override
|
||||
public Device getDevice() {
|
||||
@@ -300,56 +302,62 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 申请套管
|
||||
*/
|
||||
private synchronized void apply_casing(int mode) throws Exception {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_ONE);
|
||||
//气涨轴尺寸
|
||||
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
Map<String, String> data = applyPlugPullSitResponse.getData();
|
||||
String number = data.get("number");
|
||||
String leftSize = data.get("leftSize");
|
||||
String rightSize = data.get("rightSize");
|
||||
//套管1物料
|
||||
String to_material1 = data.get("left");
|
||||
//套管2物料
|
||||
String to_material2 = data.get("right");
|
||||
//套管1规格
|
||||
String to_spec1 = data.get("leftSpec");
|
||||
//套管2规格
|
||||
String to_spec2 = data.get("rightSpec");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
//下发纸管信息
|
||||
|
||||
map.put("to_material1", to_material1);
|
||||
map.put("to_material2", to_material2);
|
||||
|
||||
if (StrUtil.isNotEmpty(leftSize)){
|
||||
map.put("to_size1", leftSize);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(rightSize)){
|
||||
map.put("to_size2", rightSize);
|
||||
}
|
||||
map.put("to_spec1", to_spec1);
|
||||
if (ObjectUtil.isNotEmpty(to_spec2)) {
|
||||
map.put("to_spec2", to_spec2);
|
||||
}
|
||||
map.put("to_command", mode);
|
||||
map.put("to_qty1", number);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "申请套管成功";
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请套管失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_ONE);
|
||||
//气涨轴尺寸
|
||||
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
Map<String, String> data = applyPlugPullSitResponse.getData();
|
||||
String number = data.get("number");
|
||||
String leftSize = data.get("leftSize");
|
||||
String rightSize = data.get("rightSize");
|
||||
//套管1物料
|
||||
String to_material1 = data.get("left");
|
||||
//套管2物料
|
||||
String to_material2 = data.get("right");
|
||||
//套管1规格
|
||||
String to_spec1 = data.get("leftSpec");
|
||||
//套管2规格
|
||||
String to_spec2 = data.get("rightSpec");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
//下发纸管信息
|
||||
|
||||
map.put("to_material1", to_material1);
|
||||
map.put("to_material2", to_material2);
|
||||
|
||||
if (StrUtil.isNotEmpty(leftSize)) {
|
||||
map.put("to_size1", leftSize);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(rightSize)) {
|
||||
map.put("to_size2", rightSize);
|
||||
}
|
||||
map.put("to_spec1", to_spec1);
|
||||
if (ObjectUtil.isNotEmpty(to_spec2)) {
|
||||
map.put("to_spec2", to_spec2);
|
||||
}
|
||||
map.put("to_command", mode);
|
||||
map.put("to_qty1", number);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "申请套管成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请套管失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,28 +365,34 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 套管完成
|
||||
*/
|
||||
private synchronized void bushingSucess(int mode) throws Exception {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
//上报规格和重量
|
||||
applyPlugPullSiteRequest.setWeight1(String.valueOf(weight1));
|
||||
applyPlugPullSiteRequest.setMaterial1(String.valueOf(material1));
|
||||
applyPlugPullSiteRequest.setWeight2(String.valueOf(weight2));
|
||||
applyPlugPullSiteRequest.setMaterial2(String.valueOf(material2));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_TWO);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "套管完成成功";
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请套管失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
//上报规格和重量
|
||||
applyPlugPullSiteRequest.setWeight1(String.valueOf(weight1));
|
||||
applyPlugPullSiteRequest.setMaterial1(String.valueOf(material1));
|
||||
applyPlugPullSiteRequest.setWeight2(String.valueOf(weight2));
|
||||
applyPlugPullSiteRequest.setMaterial2(String.valueOf(material2));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_TWO);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "套管完成成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请套管失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -387,27 +401,33 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 拔轴完成
|
||||
*/
|
||||
private synchronized void pullShaftSucess(int mode) throws Exception {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "拔轴完成成功";
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "拔轴完成失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "拔轴完成成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "拔轴完成失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,55 +435,61 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 申请拔轴
|
||||
*/
|
||||
private synchronized void applyPullShaft(int mode) throws Exception {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setQzz_no(String.valueOf(barcode));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FOUR);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
Map<String, String> data = applyPlugPullSitResponse.getData();
|
||||
//拔管1物料
|
||||
Object to_material3 = data.get("currentLeft");
|
||||
//拔管2物料
|
||||
Object to_material4 = data.get("currentRight");
|
||||
//拔管1尺寸
|
||||
Object to_size3 = data.get("currentLeftSize");
|
||||
//拔管2尺寸
|
||||
Object to_size4 = data.get("currentRightSize");
|
||||
//拔管1规格
|
||||
Object to_spec3 = data.get("currentLeftSpec");
|
||||
//拔管2规格
|
||||
Object to_spec4 = data.get("currentRightSpec");
|
||||
Object to_qty2 = data.get("pullCount");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_material3", to_material3);
|
||||
if (ObjectUtil.isNotEmpty(to_material4)) {
|
||||
map.put("to_material4", to_material4);
|
||||
}
|
||||
map.put("to_size3", to_size3);
|
||||
if (ObjectUtil.isNotEmpty(to_size4)) {
|
||||
map.put("to_size4", to_size4);
|
||||
}
|
||||
map.put("to_spec3", to_spec3);
|
||||
if (ObjectUtil.isNotEmpty(to_spec4)) {
|
||||
map.put("to_spec4", to_spec4);
|
||||
}
|
||||
map.put("to_qty2", to_qty2);
|
||||
map.put("to_qzz_type", size);
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "申请拔轴成功";
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请拔轴失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setQzz_no(String.valueOf(barcode));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FOUR);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
Map<String, String> data = applyPlugPullSitResponse.getData();
|
||||
//拔管1物料
|
||||
Object to_material3 = data.get("currentLeft");
|
||||
//拔管2物料
|
||||
Object to_material4 = data.get("currentRight");
|
||||
//拔管1尺寸
|
||||
Object to_size3 = data.get("currentLeftSize");
|
||||
//拔管2尺寸
|
||||
Object to_size4 = data.get("currentRightSize");
|
||||
//拔管1规格
|
||||
Object to_spec3 = data.get("currentLeftSpec");
|
||||
//拔管2规格
|
||||
Object to_spec4 = data.get("currentRightSpec");
|
||||
Object to_qty2 = data.get("pullCount");
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_material3", to_material3);
|
||||
if (ObjectUtil.isNotEmpty(to_material4)) {
|
||||
map.put("to_material4", to_material4);
|
||||
}
|
||||
map.put("to_size3", to_size3);
|
||||
if (ObjectUtil.isNotEmpty(to_size4)) {
|
||||
map.put("to_size4", to_size4);
|
||||
}
|
||||
map.put("to_spec3", to_spec3);
|
||||
if (ObjectUtil.isNotEmpty(to_spec4)) {
|
||||
map.put("to_spec4", to_spec4);
|
||||
}
|
||||
map.put("to_qty2", to_qty2);
|
||||
map.put("to_qzz_type", size);
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "申请拔轴成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", 99);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
message = "申请拔轴失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,24 +497,30 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
* 缓存线已满,生成行架任务
|
||||
*/
|
||||
private synchronized void applyTask(int mode) throws Exception {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "生成行架任务成功";
|
||||
requireSucess = true;
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
requireSucess = true;
|
||||
message = "申请行架任务失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "生成行架任务成功";
|
||||
requireSucess = true;
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
requireSucess = true;
|
||||
message = "申请行架任务失败";
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,7 +664,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
jo.put("mode", mode);
|
||||
jo.put("move", move);
|
||||
/*jo.put("action", action);*/
|
||||
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
|
||||
jo.put("error", ErrorUtil.getDictDetail("cbj_error_type", String.valueOf(this.getError())));
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("isError", this.getIserror());
|
||||
jo.put("message", message);
|
||||
|
||||
@@ -27,9 +27,9 @@ public class ItemProtocol {
|
||||
//报警
|
||||
public static String item_error = "error";
|
||||
//x轴坐标
|
||||
public static String item_x_position = "x_position";
|
||||
public static String item_x_position = "x";
|
||||
//y轴坐标
|
||||
public static String item_y_position = "y_position";
|
||||
public static String item_y_position = "y";
|
||||
|
||||
//下发命令
|
||||
public static String item_to_command = "to_command";
|
||||
@@ -42,7 +42,7 @@ public class ItemProtocol {
|
||||
//是否拔轴
|
||||
public static String item_to_pull = "to_pull";
|
||||
//是否套轴
|
||||
public static String item_to_sleeve = "to_sleeve";
|
||||
public static String item_to_sleeve = "is_bushing";
|
||||
//尺寸
|
||||
public static String item_to_size = "to_size";
|
||||
|
||||
|
||||
@@ -32,9 +32,9 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_walk_y = "walk_y";
|
||||
//x坐标
|
||||
public static String item_x_position = "x_position";
|
||||
public static String item_x_position = "x";
|
||||
//动作信号
|
||||
public static String item_y_position = "y_position";
|
||||
public static String item_y_position = "y";
|
||||
/**
|
||||
* 报警
|
||||
*/
|
||||
|
||||
@@ -224,20 +224,26 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl
|
||||
* 取消称重
|
||||
*/
|
||||
public synchronized void cancelWeight() {
|
||||
GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest();
|
||||
GetWasteFoilWeightResponse getWasteFoilWeightResponse;
|
||||
getWasteFoilWeightRequest.setDevice_code(device_code);
|
||||
getWasteFoilWeightRequest.setType("3");
|
||||
getWasteFoilWeightRequest.setLastWeight(String.valueOf(old_weight));
|
||||
getWasteFoilWeightRequest.setCurrentWeight(String.valueOf(weight));
|
||||
getWasteFoilWeightRequest.setWeightGap(String.valueOf(gap_weight));
|
||||
getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest);
|
||||
if (getWasteFoilWeightResponse.getstatus()==200){
|
||||
feedbackSucess = true;
|
||||
message = "取消称重成功...";
|
||||
}else {
|
||||
feedbackSucess = false;
|
||||
message = "取消称重失败";
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest();
|
||||
GetWasteFoilWeightResponse getWasteFoilWeightResponse;
|
||||
getWasteFoilWeightRequest.setDevice_code(device_code);
|
||||
getWasteFoilWeightRequest.setType("3");
|
||||
getWasteFoilWeightRequest.setLastWeight(String.valueOf(old_weight));
|
||||
getWasteFoilWeightRequest.setCurrentWeight(String.valueOf(weight));
|
||||
getWasteFoilWeightRequest.setWeightGap(String.valueOf(gap_weight));
|
||||
getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest);
|
||||
if (getWasteFoilWeightResponse.getstatus() == 200) {
|
||||
feedbackSucess = true;
|
||||
message = "取消称重成功...";
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "取消称重失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,17 +251,23 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl
|
||||
* 申请任务
|
||||
*/
|
||||
public synchronized void applyTask() {
|
||||
GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest();
|
||||
GetWasteFoilWeightResponse getWasteFoilWeightResponse;
|
||||
getWasteFoilWeightRequest.setDevice_code(device_code);
|
||||
getWasteFoilWeightRequest.setType("4");
|
||||
getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest);
|
||||
if (getWasteFoilWeightResponse.getstatus()==200){
|
||||
feedbackSucess = true;
|
||||
message = "申请任务成功...";
|
||||
}else {
|
||||
feedbackSucess = false;
|
||||
message = "申请任务失败";
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return;
|
||||
} else {
|
||||
GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest();
|
||||
GetWasteFoilWeightResponse getWasteFoilWeightResponse;
|
||||
getWasteFoilWeightRequest.setDevice_code(device_code);
|
||||
getWasteFoilWeightRequest.setType("4");
|
||||
getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest);
|
||||
if (getWasteFoilWeightResponse.getstatus() == 200) {
|
||||
feedbackSucess = true;
|
||||
message = "申请任务成功...";
|
||||
} else {
|
||||
feedbackSucess = false;
|
||||
message = "申请任务失败";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ public class OnlineUserService {
|
||||
String tokenValue = StpUtil.getTokenValue();
|
||||
SaCookieConfig cfg = SaManager.getConfig().getCookie();
|
||||
SaCookie cookie = new SaCookie()
|
||||
.setName(StpUtil.getTokenValue())
|
||||
.setName("Authorization")
|
||||
.setValue(tokenValue)
|
||||
.setMaxAge(-1)
|
||||
.setDomain(cfg.getDomain())
|
||||
|
||||
Reference in New Issue
Block a user