opt: 内包间联调优化
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.acs.device_driver.rgv;
|
package org.nl.acs.device_driver.rgv;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
|
||||||
@@ -17,7 +18,7 @@ ItemProtocol {
|
|||||||
//工作模式
|
//工作模式
|
||||||
public static String item_mode = "mode";
|
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 = "action";
|
||||||
//行走列
|
//行走列
|
||||||
@@ -68,8 +69,8 @@ ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_error);
|
return this.getOpcIntegerValue(item_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBarcode() {
|
public String getBarcode() {
|
||||||
return this.getOpcIntegerValue(item_barcode);
|
return this.getOpcStringValue(item_barcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTask() {
|
public int getTask() {
|
||||||
@@ -90,8 +91,8 @@ ItemProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getTo_sub_volume_no(){
|
public String getTo_sub_volume_no(){
|
||||||
return this.getOpcIntegerValue(item_to_sub_volume_no);
|
return this.getOpcStringValue(item_to_sub_volume_no);
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean isonline;
|
Boolean isonline;
|
||||||
@@ -108,6 +109,16 @@ ItemProtocol {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getOpcStringValue(String protocol) {
|
||||||
|
String value = this.driver.getStringValue(protocol);
|
||||||
|
if (StrUtil.isBlank(value)) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
return "0";
|
||||||
|
}
|
||||||
|
|
||||||
public static List<ItemDto> getReadableItemDtos() {
|
public static List<ItemDto> getReadableItemDtos() {
|
||||||
ArrayList<ItemDto> list = new ArrayList<>();
|
ArrayList<ItemDto> list = new ArrayList<>();
|
||||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
|||||||
int task = 0;
|
int task = 0;
|
||||||
int last_task = 0;
|
int last_task = 0;
|
||||||
//气涨轴条码
|
//气涨轴条码
|
||||||
int barcode = 0;
|
String barcode;
|
||||||
int last_barcode = 0;
|
String last_barcode;
|
||||||
|
|
||||||
|
|
||||||
int heartbeat = 0;
|
int heartbeat = 0;
|
||||||
@@ -109,8 +109,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
|||||||
int last_to_task = 0;
|
int last_to_task = 0;
|
||||||
|
|
||||||
|
|
||||||
int to_sub_volume_no = 0;
|
String to_sub_volume_no;
|
||||||
int last_to_sub_volume_no = 0;
|
String last_to_sub_volume_no;
|
||||||
|
|
||||||
Boolean isonline = true;
|
Boolean isonline = true;
|
||||||
int hasGoods = 0;
|
int hasGoods = 0;
|
||||||
@@ -264,10 +264,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
|||||||
if (applyManipulatorActionResponse.getCode() == 200) {
|
if (applyManipulatorActionResponse.getCode() == 200) {
|
||||||
Map<String, String> data = applyManipulatorActionResponse.getData();
|
Map<String, String> data = applyManipulatorActionResponse.getData();
|
||||||
String point_code2 = data.get("point_code2");//目标站点
|
String point_code2 = data.get("point_code2");//目标站点
|
||||||
|
Device deviceByCode = deviceAppService.findDeviceByCode(point_code2);
|
||||||
|
String address = deviceByCode.getExtraValue().get("address").toString();
|
||||||
String material_code = data.get("material_code");//子卷号
|
String material_code = data.get("material_code");//子卷号
|
||||||
map.put("to_target", point_code2);
|
String to_is_labeling = data.get("to_is_labeling");//是否贴标
|
||||||
|
map.put("to_target", address);
|
||||||
map.put("to_sub_volume_no", material_code);
|
map.put("to_sub_volume_no", material_code);
|
||||||
map.put("to_command", "1");
|
map.put("to_command", "1");
|
||||||
|
map.put("to_is_labeling",StrUtil.isNotEmpty(to_is_labeling)?"0":"1");
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse);
|
||||||
message = "申请行架任务成功";
|
message = "申请行架任务成功";
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ public class ItemProtocol {
|
|||||||
public static String item_to_command = "to_command";
|
public static String item_to_command = "to_command";
|
||||||
//气涨轴类型
|
//气涨轴类型
|
||||||
public static String item_to_qzz_type = "to_qzz_type";
|
public static String item_to_qzz_type = "to_qzz_type";
|
||||||
//套管纸管1规格
|
//套管纸管1编码
|
||||||
public static String item_to_material1 = "to_material1";
|
public static String item_to_material1 = "to_material1";
|
||||||
//套管纸管2规格
|
//套管纸管2编码
|
||||||
public static String item_to_material2 = "to_material2";
|
public static String item_to_material2 = "to_material2";
|
||||||
//套管纸管数量
|
//套管纸管数量
|
||||||
public static String item_to_qty1 = "to_qty1";
|
public static String item_to_qty1 = "to_qty1";
|
||||||
@@ -52,9 +52,9 @@ public class ItemProtocol {
|
|||||||
public static String item_to_size1 = "to_size1";
|
public static String item_to_size1 = "to_size1";
|
||||||
//套管纸管2尺寸
|
//套管纸管2尺寸
|
||||||
public static String item_to_size2 = "to_size2";
|
public static String item_to_size2 = "to_size2";
|
||||||
//拔轴纸管1规格
|
//拔轴纸管1编码
|
||||||
public static String item_to_material3 = "to_material3";
|
public static String item_to_material3 = "to_material3";
|
||||||
//拔轴纸管2规格
|
//拔轴纸管2编码
|
||||||
public static String item_to_material4 = "to_material4";
|
public static String item_to_material4 = "to_material4";
|
||||||
//拔轴纸管数量
|
//拔轴纸管数量
|
||||||
public static String item_to_qty2 = "to_qty2";
|
public static String item_to_qty2 = "to_qty2";
|
||||||
@@ -62,6 +62,12 @@ public class ItemProtocol {
|
|||||||
public static String item_to_size3 = "to_size3";
|
public static String item_to_size3 = "to_size3";
|
||||||
//拔轴纸管2尺寸
|
//拔轴纸管2尺寸
|
||||||
public static String item_to_size4 = "to_size4";
|
public static String item_to_size4 = "to_size4";
|
||||||
|
//套轴纸管1规格
|
||||||
|
public static String item_to_spec1 = "to_spec1";
|
||||||
|
public static String item_to_spec2 = "to_spec2";
|
||||||
|
public static String item_to_spec3 = "to_spec3";
|
||||||
|
public static String item_to_spec4 = "to_spec4";
|
||||||
|
|
||||||
|
|
||||||
private PlugPullDeviceSiteDeviceDriver driver;
|
private PlugPullDeviceSiteDeviceDriver driver;
|
||||||
|
|
||||||
@@ -95,11 +101,11 @@ public class ItemProtocol {
|
|||||||
|
|
||||||
public String getBarcode(){ return this.getOpcStringValue(item_barcode);}
|
public String getBarcode(){ return this.getOpcStringValue(item_barcode);}
|
||||||
|
|
||||||
public int getWeight1(){ return this.getOpcIntegerValue(item_weight1);}
|
public Float getWeight1(){ return this.getOpcFloatValue(item_weight1);}
|
||||||
|
|
||||||
public String getMaterial1(){ return this.getOpcStringValue(item_material1);}
|
public String getMaterial1(){ return this.getOpcStringValue(item_material1);}
|
||||||
|
|
||||||
public int getWeight2(){ return this.getOpcIntegerValue(item_weight2);}
|
public Float getWeight2(){ return this.getOpcFloatValue(item_weight2);}
|
||||||
|
|
||||||
public int getSize(){ return this.getOpcIntegerValue(item_size);}
|
public int getSize(){ return this.getOpcIntegerValue(item_size);}
|
||||||
|
|
||||||
@@ -217,17 +223,21 @@ public class ItemProtocol {
|
|||||||
public static List<ItemDto> getWriteableItemDtos() {
|
public static List<ItemDto> getWriteableItemDtos() {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
list.add(new ItemDto(item_to_command, "下发命令", "DB10.W0"));
|
list.add(new ItemDto(item_to_command, "下发命令", "DB10.W0"));
|
||||||
list.add(new ItemDto(item_to_material1, "套管纸管1规格", "DB10.String602.60"));
|
list.add(new ItemDto(item_to_material1, "套管纸管1编码", "DB10.String602.60"));
|
||||||
list.add(new ItemDto(item_to_material2, "套管纸管2规格", "DB10.String656.60"));
|
list.add(new ItemDto(item_to_material2, "套管纸管2编码", "DB10.String656.60"));
|
||||||
list.add(new ItemDto(item_to_qty1, "套管纸管数量", "DB10.W6"));
|
list.add(new ItemDto(item_to_qty1, "套管纸管数量", "DB10.W6"));
|
||||||
list.add(new ItemDto(item_to_qzz_type, "气胀轴类型", "DB10.W8"));
|
list.add(new ItemDto(item_to_qzz_type, "气胀轴类型", "DB10.W8"));
|
||||||
list.add(new ItemDto(item_to_size1, "套管纸管1尺寸", "DB10.W10"));
|
list.add(new ItemDto(item_to_size1, "套管纸管1尺寸", "DB10.W10"));
|
||||||
list.add(new ItemDto(item_to_size2, "套管纸管2尺寸", "DB10.W12"));
|
list.add(new ItemDto(item_to_size2, "套管纸管2尺寸", "DB10.W12"));
|
||||||
list.add(new ItemDto(item_to_material1, "拔轴纸管1规格", "DB10.String602.60"));
|
list.add(new ItemDto(item_to_material1, "拔轴纸管1编码", "DB10.String602.60"));
|
||||||
list.add(new ItemDto(item_to_material2, "拔轴纸管2规格", "DB10.String656.60"));
|
list.add(new ItemDto(item_to_material2, "拔轴纸管2编码", "DB10.String656.60"));
|
||||||
list.add(new ItemDto(item_to_qty2, "拔轴纸管数量", "DB10.W6"));
|
list.add(new ItemDto(item_to_qty2, "拔轴纸管数量", "DB10.W6"));
|
||||||
list.add(new ItemDto(item_to_size1, "拔轴纸管1尺寸", "DB10.W10"));
|
list.add(new ItemDto(item_to_size3, "拔轴纸管1尺寸", "DB10.W10"));
|
||||||
list.add(new ItemDto(item_to_size2, "下发纸管2尺寸", "DB10.W12"));
|
list.add(new ItemDto(item_to_size4, "拔轴纸管2尺寸", "DB10.W12"));
|
||||||
|
list.add(new ItemDto(item_to_spec1, "套轴纸管1规格", "DB10.W12"));
|
||||||
|
list.add(new ItemDto(item_to_spec2, "套轴纸管2规格", "DB10.W12"));
|
||||||
|
list.add(new ItemDto(item_to_spec3, "拔轴纸管1规格", "DB10.W12"));
|
||||||
|
list.add(new ItemDto(item_to_spec4, "拔轴纸管2规格", "DB10.W12"));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,14 +98,14 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
String barcode = null;
|
String barcode = null;
|
||||||
String lastBarcode = null;
|
String lastBarcode = null;
|
||||||
//纸管1重量
|
//纸管1重量
|
||||||
int weight1 = 0;
|
Float weight1 = 0.0F;
|
||||||
int lastWeight1 = 0;
|
Float lastWeight1 = 0.0F;
|
||||||
//纸管1规格
|
//纸管1规格
|
||||||
String material1 = null;
|
String material1 = null;
|
||||||
String lastMaterial1 = null;
|
String lastMaterial1 = null;
|
||||||
//纸管2重量
|
//纸管2重量
|
||||||
int weight2 = 0;
|
Float weight2 = 0.0F;
|
||||||
int lastWeight2 = 0;
|
Float lastWeight2 = 0.0F;
|
||||||
//纸管2规格
|
//纸管2规格
|
||||||
String material2 = null;
|
String material2 = null;
|
||||||
String lastMaterial2 = null;
|
String lastMaterial2 = null;
|
||||||
@@ -160,7 +160,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
*/
|
*/
|
||||||
int flag;
|
int flag;
|
||||||
|
|
||||||
String deviceCode;
|
String device_code;
|
||||||
|
|
||||||
String message = null;
|
String message = null;
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() throws Exception {
|
public void execute() throws Exception {
|
||||||
deviceCode = this.getDeviceCode();
|
device_code = this.getDeviceCode();
|
||||||
mode = this.itemProtocol.getMode();
|
mode = this.itemProtocol.getMode();
|
||||||
move = this.itemProtocol.getMove();
|
move = this.itemProtocol.getMove();
|
||||||
action = this.itemProtocol.getAction();
|
action = this.itemProtocol.getAction();
|
||||||
@@ -298,7 +298,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
private synchronized void apply_casing(int mode) throws Exception {
|
private synchronized void apply_casing(int mode) throws Exception {
|
||||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_ONE);
|
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_ONE);
|
||||||
//气涨轴尺寸
|
//气涨轴尺寸
|
||||||
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
||||||
@@ -336,7 +336,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
map.put("to_qty1", number);
|
map.put("to_qty1", number);
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
|
||||||
message = "申请套管成功";
|
message = "申请套管成功";
|
||||||
} else {
|
} else {
|
||||||
message = applyPlugPullSitResponse.getMessage();
|
message = applyPlugPullSitResponse.getMessage();
|
||||||
@@ -345,7 +345,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
this.writing(map);
|
this.writing(map);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
message = "申请套管失败";
|
message = "申请套管失败";
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +355,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
private synchronized void bushingSucess(int mode) throws Exception {
|
private synchronized void bushingSucess(int mode) throws Exception {
|
||||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||||
//上报规格和重量
|
//上报规格和重量
|
||||||
applyPlugPullSiteRequest.setWeight1(String.valueOf(weight1));
|
applyPlugPullSiteRequest.setWeight1(String.valueOf(weight1));
|
||||||
applyPlugPullSiteRequest.setMaterial1(String.valueOf(material1));
|
applyPlugPullSiteRequest.setMaterial1(String.valueOf(material1));
|
||||||
@@ -365,7 +365,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||||
this.writeSignal(mode);
|
this.writeSignal(mode);
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
|
||||||
message = "套管完成成功";
|
message = "套管完成成功";
|
||||||
} else {
|
} else {
|
||||||
message = applyPlugPullSitResponse.getMessage();
|
message = applyPlugPullSitResponse.getMessage();
|
||||||
@@ -374,7 +374,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
this.writing(map);
|
this.writing(map);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
message = "申请套管失败";
|
message = "申请套管失败";
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -385,7 +385,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
private synchronized void pullShaftSucess(int mode) throws Exception {
|
private synchronized void pullShaftSucess(int mode) throws Exception {
|
||||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||||
applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode));
|
applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode));
|
||||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE);
|
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE);
|
||||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||||
@@ -394,7 +394,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
map.put("to_command", mode);
|
map.put("to_command", mode);
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||||
message = "拔轴完成成功";
|
message = "拔轴完成成功";
|
||||||
} else {
|
} else {
|
||||||
message = applyPlugPullSitResponse.getMessage();
|
message = applyPlugPullSitResponse.getMessage();
|
||||||
@@ -403,7 +403,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
this.writing(map);
|
this.writing(map);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
message = "拔轴完成失败";
|
message = "拔轴完成失败";
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -413,8 +413,8 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
private synchronized void applyPullShaft(int mode) throws Exception {
|
private synchronized void applyPullShaft(int mode) throws Exception {
|
||||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||||
applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode));
|
applyPlugPullSiteRequest.setQzz_no(String.valueOf(barcode));
|
||||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FOUR);
|
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FOUR);
|
||||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||||
@@ -450,7 +450,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
map.put("to_command", mode);
|
map.put("to_command", mode);
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||||
message = "申请拔轴成功";
|
message = "申请拔轴成功";
|
||||||
} else {
|
} else {
|
||||||
message = applyPlugPullSitResponse.getMessage();
|
message = applyPlugPullSitResponse.getMessage();
|
||||||
@@ -459,7 +459,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
this.writing(map);
|
this.writing(map);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
message = "申请拔轴失败";
|
message = "申请拔轴失败";
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -469,7 +469,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
private synchronized void applyTask(int mode) throws Exception {
|
private synchronized void applyTask(int mode) throws Exception {
|
||||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||||
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
||||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE);
|
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE);
|
||||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||||
@@ -477,14 +477,14 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
map.put("to_command", mode);
|
map.put("to_command", mode);
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||||
message = "生成行架任务成功";
|
message = "生成行架任务成功";
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
} else {
|
} else {
|
||||||
message = applyPlugPullSitResponse.getMessage();
|
message = applyPlugPullSitResponse.getMessage();
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
message = "申请行架任务失败";
|
message = "申请行架任务失败";
|
||||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,9 +519,9 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
itemMap.put(to_param, json.getString("value"));
|
itemMap.put(to_param, json.getString("value"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号:" + itemMap);
|
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(deviceCode)
|
.device_code(device_code)
|
||||||
.content("下发多个电气信号" + itemMap)
|
.content("下发多个电气信号" + itemMap)
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -540,7 +540,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
this.checkcontrol(itemMap);
|
this.checkcontrol(itemMap);
|
||||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(deviceCode)
|
.device_code(device_code)
|
||||||
.content("下发多个电气信号" + itemMap)
|
.content("下发多个电气信号" + itemMap)
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
@@ -634,7 +634,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
// itemMap.put(to_param, Integer.parseInt(value));
|
// itemMap.put(to_param, Integer.parseInt(value));
|
||||||
this.control(itemMap);
|
this.control(itemMap);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
.device_code(deviceCode)
|
.device_code(device_code)
|
||||||
.content("下发多个电气信号" + itemMap)
|
.content("下发多个电气信号" + itemMap)
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ 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.jetbrains.annotations.NotNull;
|
||||||
import org.nl.acs.common.base.CommonFinalParam;
|
import org.nl.acs.common.base.CommonFinalParam;
|
||||||
import org.nl.acs.device.domain.Device;
|
import org.nl.acs.device.domain.Device;
|
||||||
import org.nl.acs.device.service.DeviceExtraService;
|
import org.nl.acs.device.service.DeviceExtraService;
|
||||||
@@ -224,7 +225,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
try {
|
try {
|
||||||
TaskDto dto = taskserver.findByCode(inst.getTask_code());
|
TaskDto dto = taskserver.findByCode(inst.getTask_code());
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
if (ObjectUtil.isNotEmpty(dto)){
|
/*if (ObjectUtil.isNotEmpty(dto)){
|
||||||
String interaction_json = dto.getInteraction_json();
|
String interaction_json = dto.getInteraction_json();
|
||||||
if (ObjectUtil.isNotEmpty(interaction_json)){
|
if (ObjectUtil.isNotEmpty(interaction_json)){
|
||||||
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(interaction_json);
|
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(interaction_json);
|
||||||
@@ -233,7 +234,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
map.put("to_size", jsonObject.getString("qzz_size"));
|
map.put("to_size", jsonObject.getString("qzz_size"));
|
||||||
map.put("to_barcode", jsonObject.getString("qzz_no"));
|
map.put("to_barcode", jsonObject.getString("qzz_no"));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
map.put("to_command", "5");
|
map.put("to_command", "5");
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
finish_instruction(inst);
|
finish_instruction(inst);
|
||||||
@@ -361,68 +362,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
String startAddr = startDevice.getExtraValue().get("address").toString();
|
String startAddr = startDevice.getExtraValue().get("address").toString();
|
||||||
String nextAddr = nextDevice.getExtraValue().get("address").toString();
|
String nextAddr = nextDevice.getExtraValue().get("address").toString();
|
||||||
String interaction_json = taskDto.getInteraction_json();
|
String interaction_json = taskDto.getInteraction_json();
|
||||||
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
|
Map<String, Object> map = toStringObjectMap(instruction, startAddr, nextAddr, interaction_json);
|
||||||
//套管1物料
|
|
||||||
Object to_material1 = jsonObject.get("left");
|
|
||||||
//套管2物料
|
|
||||||
Object to_material2 = jsonObject.get("right");
|
|
||||||
//套管1规格
|
|
||||||
Object to_spec1 = jsonObject.get("leftSpec");
|
|
||||||
//套管2规格
|
|
||||||
Object to_spec2 = jsonObject.get("rightSpec");
|
|
||||||
//套管1尺寸
|
|
||||||
Object to_size1 = jsonObject.get("leftSize");
|
|
||||||
//套管2尺寸
|
|
||||||
Object to_size2 = jsonObject.get("rightSize");
|
|
||||||
//拔管1物料
|
|
||||||
Object to_material3 = jsonObject.get("currentLeft");
|
|
||||||
//拔管2物料
|
|
||||||
Object to_material4 = jsonObject.get("currentRight");
|
|
||||||
//拔管1尺寸
|
|
||||||
Object to_size3 = jsonObject.get("currentLeftSize");
|
|
||||||
//拔管2尺寸
|
|
||||||
Object to_size4 = jsonObject.get("currentRightSize");
|
|
||||||
//拔管1规格
|
|
||||||
Object to_spec3 = jsonObject.get("currentLeftSpec");
|
|
||||||
//拔管2规格
|
|
||||||
Object to_spec4 = jsonObject.get("currentRightSpec");
|
|
||||||
|
|
||||||
//套管数量
|
|
||||||
Object to_qty1 = jsonObject.get("casingCount");
|
|
||||||
//拔管数量
|
|
||||||
Object to_qty2 = jsonObject.get("pullCount");
|
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
|
||||||
map.put("to_command", CommonFinalParam.ONE);
|
|
||||||
map.put("to_onset", startAddr);
|
|
||||||
map.put("to_task", instruction.getInstruction_code());
|
|
||||||
map.put("to_target", nextAddr);
|
|
||||||
//toTranscription(taskDto,map);
|
|
||||||
map.put("to_material1", to_material1);
|
|
||||||
if (ObjectUtil.isNotEmpty(to_material2)) {
|
|
||||||
map.put("to_material2", to_material2);
|
|
||||||
}
|
|
||||||
map.put("to_spec1", to_spec1);
|
|
||||||
if (ObjectUtil.isNotEmpty(to_spec2)) {
|
|
||||||
map.put("to_spec2", to_spec2);
|
|
||||||
}
|
|
||||||
map.put("to_size1", to_size1);
|
|
||||||
if (ObjectUtil.isNotEmpty(to_size2)) {
|
|
||||||
map.put("to_size2", to_size2);
|
|
||||||
}
|
|
||||||
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_qty1", to_qty1);
|
|
||||||
map.put("to_qty2", to_qty2);
|
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
this.setRequireSucess(true);
|
this.setRequireSucess(true);
|
||||||
return true;
|
return true;
|
||||||
@@ -500,68 +440,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
String startAddr = startDevice.getExtraValue().get("address").toString();
|
String startAddr = startDevice.getExtraValue().get("address").toString();
|
||||||
String nextAddr = nextDevice.getExtraValue().get("address").toString();
|
String nextAddr = nextDevice.getExtraValue().get("address").toString();
|
||||||
String interaction_json = task.getInteraction_json();
|
String interaction_json = task.getInteraction_json();
|
||||||
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
|
Map<String, Object> map = toStringObjectMap(instdto, startAddr, nextAddr, interaction_json);
|
||||||
//套管1物料
|
|
||||||
Object to_material1 = jsonObject.get("left");
|
|
||||||
//套管2物料
|
|
||||||
Object to_material2 = jsonObject.get("right");
|
|
||||||
//套管1规格
|
|
||||||
Object to_spec1 = jsonObject.get("leftSpec");
|
|
||||||
//套管2规格
|
|
||||||
Object to_spec2 = jsonObject.get("rightSpec");
|
|
||||||
//套管1尺寸
|
|
||||||
Object to_size1 = jsonObject.get("leftSize");
|
|
||||||
//套管2尺寸
|
|
||||||
Object to_size2 = jsonObject.get("rightSize");
|
|
||||||
//拔管1物料
|
|
||||||
Object to_material3 = jsonObject.get("currentLeft");
|
|
||||||
//拔管2物料
|
|
||||||
Object to_material4 = jsonObject.get("currentRight");
|
|
||||||
//拔管1尺寸
|
|
||||||
Object to_size3 = jsonObject.get("currentLeftSize");
|
|
||||||
//拔管2尺寸
|
|
||||||
Object to_size4 = jsonObject.get("currentRightSize");
|
|
||||||
//拔管1规格
|
|
||||||
Object to_spec3 = jsonObject.get("currentLeftSpec");
|
|
||||||
//拔管2规格
|
|
||||||
Object to_spec4 = jsonObject.get("currentRightSpec");
|
|
||||||
|
|
||||||
//套管数量
|
|
||||||
Object to_qty1 = jsonObject.get("casingCount");
|
|
||||||
//拔管数量
|
|
||||||
Object to_qty2 = jsonObject.get("pullCount");
|
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
|
||||||
map.put("to_command", CommonFinalParam.ONE);
|
|
||||||
map.put("to_onset", startAddr);
|
|
||||||
map.put("to_task", instdto.getInstruction_code());
|
|
||||||
map.put("to_target", nextAddr);
|
|
||||||
//toTranscription(taskDto,map);
|
|
||||||
map.put("to_material1", to_material1);
|
|
||||||
if (ObjectUtil.isNotEmpty(to_material2)) {
|
|
||||||
map.put("to_material2", to_material2);
|
|
||||||
}
|
|
||||||
map.put("to_spec1", to_spec1);
|
|
||||||
if (ObjectUtil.isNotEmpty(to_spec2)) {
|
|
||||||
map.put("to_spec2", to_spec2);
|
|
||||||
}
|
|
||||||
map.put("to_size1", to_size1);
|
|
||||||
if (ObjectUtil.isNotEmpty(to_size2)) {
|
|
||||||
map.put("to_size2", to_size2);
|
|
||||||
}
|
|
||||||
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_qty1", to_qty1);
|
|
||||||
map.put("to_qty2", to_qty2);
|
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
this.setRequireSucess(true);
|
this.setRequireSucess(true);
|
||||||
notCreateInstMessage = "";
|
notCreateInstMessage = "";
|
||||||
@@ -573,6 +452,77 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private Map<String, Object> toStringObjectMap(Instruction instdto, String startAddr, String nextAddr, String interaction_json) {
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
|
||||||
|
//套管1物料
|
||||||
|
Object to_material1 = jsonObject.get("left");
|
||||||
|
//套管2物料
|
||||||
|
Object to_material2 = jsonObject.get("right");
|
||||||
|
//套管1规格
|
||||||
|
Object to_spec1 = jsonObject.get("leftSpec");
|
||||||
|
//套管2规格
|
||||||
|
Object to_spec2 = jsonObject.get("rightSpec");
|
||||||
|
//套管1尺寸
|
||||||
|
Object to_size1 = jsonObject.get("leftSize");
|
||||||
|
//套管2尺寸
|
||||||
|
Object to_size2 = jsonObject.get("rightSize");
|
||||||
|
//拔管1物料
|
||||||
|
Object to_material3 = jsonObject.get("currentLeft");
|
||||||
|
//拔管2物料
|
||||||
|
Object to_material4 = jsonObject.get("currentRight");
|
||||||
|
//拔管1尺寸
|
||||||
|
Object to_size3 = jsonObject.get("currentLeftSize");
|
||||||
|
//拔管2尺寸
|
||||||
|
Object to_size4 = jsonObject.get("currentRightSize");
|
||||||
|
//拔管1规格
|
||||||
|
Object to_spec3 = jsonObject.get("currentLeftSpec");
|
||||||
|
//拔管2规格
|
||||||
|
Object to_spec4 = jsonObject.get("currentRightSpec");
|
||||||
|
|
||||||
|
//套管数量
|
||||||
|
Object to_qty1 = jsonObject.get("casingCount");
|
||||||
|
//拔管数量
|
||||||
|
Object to_qty2 = jsonObject.get("pullCount");
|
||||||
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
map.put("to_pull", jsonObject.getString("is_pulling"));
|
||||||
|
map.put("is_bushing", jsonObject.getString("is_bushing"));
|
||||||
|
map.put("to_size", jsonObject.getString("qzz_size"));
|
||||||
|
map.put("to_barcode", jsonObject.getString("qzz_no"));
|
||||||
|
map.put("to_command", CommonFinalParam.ONE);
|
||||||
|
map.put("to_onset", startAddr);
|
||||||
|
map.put("to_task", instdto.getInstruction_code());
|
||||||
|
map.put("to_target", nextAddr);
|
||||||
|
//toTranscription(taskDto,map);
|
||||||
|
map.put("to_material1", to_material1);
|
||||||
|
if (ObjectUtil.isNotEmpty(to_material2)) {
|
||||||
|
map.put("to_material2", to_material2);
|
||||||
|
}
|
||||||
|
map.put("to_spec1", to_spec1);
|
||||||
|
if (ObjectUtil.isNotEmpty(to_spec2)) {
|
||||||
|
map.put("to_spec2", to_spec2);
|
||||||
|
}
|
||||||
|
map.put("to_size1", to_size1);
|
||||||
|
if (ObjectUtil.isNotEmpty(to_size2)) {
|
||||||
|
map.put("to_size2", to_size2);
|
||||||
|
}
|
||||||
|
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_qty1", to_qty1);
|
||||||
|
map.put("to_qty2", to_qty2);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
private void toTranscription(TaskDto taskDto,Map map){
|
private void toTranscription(TaskDto taskDto,Map map){
|
||||||
String interactionJson = taskDto.getInteraction_json();
|
String interactionJson = taskDto.getInteraction_json();
|
||||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||||
|
|||||||
@@ -27,11 +27,15 @@ public class ItemProtocol {
|
|||||||
//报警
|
//报警
|
||||||
public static String item_error = "error";
|
public static String item_error = "error";
|
||||||
//x轴坐标
|
//x轴坐标
|
||||||
public static String item_x_position = "x_position";
|
public static String item_x_position = "x";
|
||||||
//y轴坐标
|
//y轴坐标
|
||||||
public static String item_y_position = "y_position";
|
public static String item_y_position = "y";
|
||||||
//重量
|
//重量
|
||||||
public static String item_weight = "weight";
|
public static String item_weight = "weight";
|
||||||
|
/**
|
||||||
|
* 子卷号
|
||||||
|
*/
|
||||||
|
public static String item_sub_volume_no = "sub_volume_no";
|
||||||
|
|
||||||
//下发命令
|
//下发命令
|
||||||
public static String item_to_command = "to_command";
|
public static String item_to_command = "to_command";
|
||||||
@@ -60,6 +64,10 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_move);
|
return this.getOpcIntegerValue(item_move);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSub_volume_no() {
|
||||||
|
return this.getOpcStringValue(item_sub_volume_no);
|
||||||
|
}
|
||||||
|
|
||||||
public int getAction() {
|
public int getAction() {
|
||||||
return this.getOpcIntegerValue(item_action);
|
return this.getOpcIntegerValue(item_action);
|
||||||
}
|
}
|
||||||
@@ -156,6 +164,7 @@ public class ItemProtocol {
|
|||||||
list.add(new ItemDto(item_walk_y, "行走列", "DB13.B4"));
|
list.add(new ItemDto(item_walk_y, "行走列", "DB13.B4"));
|
||||||
list.add(new ItemDto(item_error, "报警信号", "DB13.B5"));
|
list.add(new ItemDto(item_error, "报警信号", "DB13.B5"));
|
||||||
list.add(new ItemDto(item_task, "任务号", "DB13.D6"));
|
list.add(new ItemDto(item_task, "任务号", "DB13.D6"));
|
||||||
|
list.add(new ItemDto(item_sub_volume_no, "子卷号", "DB13.D6"));
|
||||||
list.add(new ItemDto(item_x_position, "x坐标", "DB13.REAL10"));
|
list.add(new ItemDto(item_x_position, "x坐标", "DB13.REAL10"));
|
||||||
list.add(new ItemDto(item_y_position, "y坐标", "DB13.REAL14"));
|
list.add(new ItemDto(item_y_position, "y坐标", "DB13.REAL14"));
|
||||||
list.add(new ItemDto(item_weight, "重量", "DB13.REAL16"));
|
list.add(new ItemDto(item_weight, "重量", "DB13.REAL16"));
|
||||||
|
|||||||
@@ -19,6 +19,12 @@ import org.nl.acs.device_driver.RouteableDeviceDriver;
|
|||||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.InteractionJsonDTO;
|
import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.InteractionJsonDTO;
|
||||||
|
import org.nl.acs.ext.wms.data.ApplyPlugPullSitResponse;
|
||||||
|
import org.nl.acs.ext.wms.data.ApplyPlugPullSiteRequest;
|
||||||
|
import org.nl.acs.ext.wms.data.ApplyfeedbackSubVolumeWeightRequest;
|
||||||
|
import org.nl.acs.ext.wms.data.ApplyfeedbackSubVolumeWeightResponse;
|
||||||
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
|
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||||
import org.nl.acs.history.ErrorUtil;
|
import org.nl.acs.history.ErrorUtil;
|
||||||
import org.nl.acs.history.service.DeviceErrorLogService;
|
import org.nl.acs.history.service.DeviceErrorLogService;
|
||||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||||
@@ -69,6 +75,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||||
|
@Autowired
|
||||||
|
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
||||||
|
|
||||||
//工作模式
|
//工作模式
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
@@ -99,6 +107,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
float weight = 0;
|
float weight = 0;
|
||||||
float last_weight = 0;
|
float last_weight = 0;
|
||||||
|
|
||||||
|
String sub_volume_no;
|
||||||
|
|
||||||
int heartbeat = 0;
|
int heartbeat = 0;
|
||||||
int last_heartbeat = 0;
|
int last_heartbeat = 0;
|
||||||
int to_command = 0;
|
int to_command = 0;
|
||||||
@@ -165,6 +175,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
move = this.itemProtocol.getMove();
|
move = this.itemProtocol.getMove();
|
||||||
action = this.itemProtocol.getAction();
|
action = this.itemProtocol.getAction();
|
||||||
walk_y = this.itemProtocol.getWalk_y();
|
walk_y = this.itemProtocol.getWalk_y();
|
||||||
|
sub_volume_no = this.itemProtocol.getSub_volume_no();
|
||||||
error = this.itemProtocol.getError();
|
error = this.itemProtocol.getError();
|
||||||
task = this.itemProtocol.getTask();
|
task = this.itemProtocol.getTask();
|
||||||
heartbeat = this.itemProtocol.getHeartbeat();
|
heartbeat = this.itemProtocol.getHeartbeat();
|
||||||
@@ -203,16 +214,24 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
|||||||
}
|
}
|
||||||
|
|
||||||
//反馈重量
|
//反馈重量
|
||||||
if (mode == 3 && action == 5 && move == 0 && task > 0 && !requireSucess) {
|
if (mode == 3 && action == 5 && move == 0 && StrUtil.isNotEmpty(sub_volume_no) && !requireSucess) {
|
||||||
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
ApplyfeedbackSubVolumeWeightRequest applyfeedbackSubVolumeWeightRequest = new ApplyfeedbackSubVolumeWeightRequest();
|
||||||
if (ObjectUtil.isNotEmpty(inst2)) {
|
ApplyfeedbackSubVolumeWeightResponse applyPlugPullSitResponse;
|
||||||
|
applyfeedbackSubVolumeWeightRequest.setSub_volume(sub_volume_no);
|
||||||
|
applyfeedbackSubVolumeWeightRequest.setWeight1(String.valueOf(weight));
|
||||||
|
applyPlugPullSitResponse = acsToWmsService.applyfeedbackSubVolumeWeight(applyfeedbackSubVolumeWeightRequest);
|
||||||
|
if(applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN){
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
//todo:反馈重量
|
//todo:反馈重量
|
||||||
map.put("to_command", "5");
|
map.put("to_command", "5");
|
||||||
this.writing(map);
|
this.writing(map);
|
||||||
this.requireSucess = true;
|
this.requireSucess = true;
|
||||||
} else {
|
}else{
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "未反馈电气信号原因:当前步骤不为允许取货(now_steps_type!=3)");
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
|
.device_code(device_code)
|
||||||
|
.content("反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage())
|
||||||
|
.build();
|
||||||
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
feedMessage = "行架机械手:";
|
feedMessage = "行架机械手:";
|
||||||
|
|||||||
@@ -50,4 +50,13 @@ public class ApplyPlugPullSiteRequest extends BaseRequest {
|
|||||||
* 尺寸 3,6寸
|
* 尺寸 3,6寸
|
||||||
*/
|
*/
|
||||||
private String size;
|
private String size;
|
||||||
|
/**
|
||||||
|
* 气胀轴条码
|
||||||
|
*/
|
||||||
|
private String qzz_no;
|
||||||
|
/**
|
||||||
|
* 子卷号
|
||||||
|
*/
|
||||||
|
private String sub_volume;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package org.nl.acs.ext.wms.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ApplyfeedbackSubVolumeWeightRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子卷号
|
||||||
|
*/
|
||||||
|
private String sub_volume;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子卷重量
|
||||||
|
*/
|
||||||
|
private String weight1;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package org.nl.acs.ext.wms.data;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ApplyfeedbackSubVolumeWeightResponse extends BaseResponse {
|
||||||
|
|
||||||
|
private Map<String, String> data = new HashMap();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -164,6 +164,13 @@ public interface AcsToWmsService {
|
|||||||
*/
|
*/
|
||||||
ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param);
|
ApplyPlugPullSitResponse applyPlugPullSiteRequest(ApplyPlugPullSiteRequest param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向LMS反馈子卷重量
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询站点有无货状态
|
* 查询站点有无货状态
|
||||||
|
|||||||
@@ -485,6 +485,42 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeight(ApplyfeedbackSubVolumeWeightRequest param) {
|
||||||
|
log.info("向LMS申请反馈,请求参数{}",param);
|
||||||
|
try {
|
||||||
|
MDC.put(log_file_type, log_type);
|
||||||
|
ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse = new ApplyfeedbackSubVolumeWeightResponse();
|
||||||
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
|
||||||
|
AddressDto addressDto = addressService.findByCode("applyfeedbackSubVolumeWeightRequest");
|
||||||
|
String methods_url = addressDto.getMethods_url();
|
||||||
|
String url = wmsUrl + methods_url;
|
||||||
|
log.info("applyfeedbackSubVolumeWeightRequest----请求参数:{}", JSONObject.toJSONString(param));
|
||||||
|
try {
|
||||||
|
// String result = "";
|
||||||
|
String result = HttpRequest.post(url)
|
||||||
|
.body(JSON.toJSONString(param))
|
||||||
|
.execute().body();
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
|
log.info("applyfeedbackSubVolumeWeightRequest----返回参数{}", result);
|
||||||
|
applyfeedbackSubVolumeWeightResponse = JSONObject.toJavaObject(jsonObject, ApplyfeedbackSubVolumeWeightResponse.class);
|
||||||
|
} catch (Exception e) {
|
||||||
|
JSONObject map = new JSONObject();
|
||||||
|
map.put("status", 400);
|
||||||
|
map.put("message", e.getMessage());
|
||||||
|
return JSONObject.toJavaObject(map, ApplyfeedbackSubVolumeWeightResponse.class);
|
||||||
|
}
|
||||||
|
LuceneLogDto luceneLogDto = new LuceneLogDto("applyfeedbackSubVolumeWeightRequest", String.valueOf(applyfeedbackSubVolumeWeightResponse.getCode()),
|
||||||
|
JSON.toJSONString(param), String.valueOf(applyfeedbackSubVolumeWeightResponse.getMessage()), "ACS向LMS申请套管");
|
||||||
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
|
}
|
||||||
|
return applyfeedbackSubVolumeWeightResponse;
|
||||||
|
} finally {
|
||||||
|
MDC.remove(log_file_type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) {
|
public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) {
|
||||||
log.info("向LMS申请反馈,请求参数{}", param);
|
log.info("向LMS申请反馈,请求参数{}", param);
|
||||||
@@ -512,7 +548,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class);
|
return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class);
|
||||||
}
|
}
|
||||||
LuceneLogDto luceneLogDto = new LuceneLogDto("ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()),
|
LuceneLogDto luceneLogDto = new LuceneLogDto("ApplyManipulatorActionRequest", String.valueOf(applyManipulatorActionResponse.getCode()),
|
||||||
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈");
|
JSON.toJSONString(param), String.valueOf(applyManipulatorActionResponse), "ACS向LMS申请反馈子卷重量");
|
||||||
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
luceneLogService.interfaceExecuteLog(luceneLogDto);
|
||||||
}
|
}
|
||||||
return applyManipulatorActionResponse;
|
return applyManipulatorActionResponse;
|
||||||
|
|||||||
Reference in New Issue
Block a user