Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -240,6 +240,9 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
|
||||
if (mode != last_mode) {
|
||||
requireSucess = false;
|
||||
if(mode == 2){
|
||||
clearWrite();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -341,6 +344,31 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
|
||||
}
|
||||
|
||||
public void clearWrite() {
|
||||
List list = new ArrayList<>();
|
||||
Map map = new HashMap<>();
|
||||
map.put("code","to_target");
|
||||
map.put("value","0");
|
||||
list.add(map);
|
||||
Map map2 = new HashMap<>();
|
||||
map2.put("code","to_task");
|
||||
map2.put("value","0");
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap<>();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","0");
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap<>();
|
||||
map4.put("code","to_container_type");
|
||||
map4.put("value","0");
|
||||
list.add(map4);
|
||||
|
||||
this.writing(list);
|
||||
message=null;
|
||||
vehicle_code=null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void writing(int command) {
|
||||
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||
|
||||
@@ -25,10 +25,6 @@ public class ItemProtocol {
|
||||
public static String item_error = "error";
|
||||
//物料
|
||||
public static String item_material = "material";
|
||||
//物料直径
|
||||
public static String item_size = "size";
|
||||
//物料长度
|
||||
public static String item_len = "len";
|
||||
//明细数量
|
||||
public static String item_Itemized_qty = "Itemized_qty";
|
||||
|
||||
@@ -36,11 +32,9 @@ public class ItemProtocol {
|
||||
public static String item_to_command = "to_command";
|
||||
//下发物料类型
|
||||
public static String item_to_material = "to_material";
|
||||
//下发命令
|
||||
public static String item_to_size = "to_size";
|
||||
//下发命令
|
||||
public static String item_to_len = "to_len";
|
||||
//下发命令
|
||||
//下发物料规格
|
||||
public static String item_to_spec = "to_spec";
|
||||
//下发物料数量
|
||||
public static String item_to_qty = "to_qty";
|
||||
|
||||
private PaperTubePickSiteDeviceDriver driver;
|
||||
@@ -75,13 +69,6 @@ public class ItemProtocol {
|
||||
return this.getOpcStringValue(item_material);
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return this.getOpcIntegerValue(item_size);
|
||||
}
|
||||
|
||||
public int getLen() {
|
||||
return this.getOpcIntegerValue(item_len);
|
||||
}
|
||||
|
||||
public int getItemized_qty() {
|
||||
return this.getOpcIntegerValue(item_Itemized_qty);
|
||||
@@ -95,17 +82,6 @@ public class ItemProtocol {
|
||||
return this.getOpcStringValue(item_to_material);
|
||||
}
|
||||
|
||||
public int getTo_size() {
|
||||
return this.getOpcIntegerValue(item_to_size);
|
||||
}
|
||||
|
||||
public int getTo_len() {
|
||||
return this.getOpcIntegerValue(item_to_len);
|
||||
}
|
||||
|
||||
public int getTo_qty() {
|
||||
return this.getOpcIntegerValue(item_to_qty);
|
||||
}
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
@@ -141,8 +117,6 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_error, "报警", "DB1001.B4"));
|
||||
list.add(new ItemDto(item_qty, "总数量", "DB1001.B5"));
|
||||
list.add(new ItemDto(item_material, "物料类型", "DB1.B6"));
|
||||
list.add(new ItemDto(item_size, "物料直径", "DB1.B7"));
|
||||
list.add(new ItemDto(item_len, "物料长度", "DB1.B8"));
|
||||
list.add(new ItemDto(item_Itemized_qty, "物料明细数量", "DB1.B9"));
|
||||
return list;
|
||||
}
|
||||
@@ -151,8 +125,7 @@ public class ItemProtocol {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0"));
|
||||
list.add(new ItemDto(item_to_material, "下发物料类型", "DB2.W2"));
|
||||
list.add(new ItemDto(item_to_size, "下发物料直径", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_len, "下发物料长度", "DB2.W6"));
|
||||
list.add(new ItemDto(item_to_spec, "下发物料规格", "DB2.W4"));
|
||||
list.add(new ItemDto(item_to_qty, "下发物料数量", "DB2.W8"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -73,12 +73,6 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
//物料类型
|
||||
String material = null;
|
||||
String last_material = null;
|
||||
//物料直径
|
||||
int size =0;
|
||||
int last_size =0;
|
||||
//物料长度
|
||||
int len = 0;
|
||||
int last_len = 0;
|
||||
//物料明细数量
|
||||
int Itemized_qty = 0;
|
||||
int last_Itemized_qty = 0;
|
||||
@@ -94,12 +88,9 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
//下发物料类型
|
||||
String to_material =null;
|
||||
String last_to_material =null;
|
||||
//下发物料直径
|
||||
int to_size = 0;
|
||||
int last_to_size = 0;
|
||||
//下发物料长度
|
||||
int to_len=0;
|
||||
int last_to_len=0;
|
||||
//下发物料规格
|
||||
int to_spec=0;
|
||||
int last_to_spec=0;
|
||||
//下发物料数量
|
||||
int to_qty=0;
|
||||
int last_to_qty=0;
|
||||
@@ -141,10 +132,6 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
this.writing(0);
|
||||
}
|
||||
}
|
||||
if (move != last_move) {
|
||||
}
|
||||
if (error != last_error) {
|
||||
}
|
||||
} catch (Exception var17) {
|
||||
return;
|
||||
}
|
||||
@@ -196,7 +183,17 @@ public class PaperTubePickSiteDeviceDriver extends AbstractOpcDeviceDriver imple
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
last_mode = mode;
|
||||
last_action = action;
|
||||
last_move = move;
|
||||
last_qty = qty;
|
||||
last_error =error;
|
||||
last_material = material;
|
||||
last_Itemized_qty = Itemized_qty;
|
||||
last_to_command = to_command;
|
||||
last_to_spec = to_spec;
|
||||
last_to_material = to_material;
|
||||
last_to_qty = to_qty;
|
||||
}
|
||||
|
||||
protected void thingToNothing() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.device_driver.rgv;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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_move = "move";
|
||||
public static String item_move = "move1";
|
||||
//动作信号
|
||||
public static String item_action = "action";
|
||||
//行走列
|
||||
@@ -68,8 +69,8 @@ ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
}
|
||||
|
||||
public int getBarcode() {
|
||||
return this.getOpcIntegerValue(item_barcode);
|
||||
public String getBarcode() {
|
||||
return this.getOpcStringValue(item_barcode);
|
||||
}
|
||||
|
||||
public int getTask() {
|
||||
@@ -90,8 +91,8 @@ ItemProtocol {
|
||||
}
|
||||
|
||||
|
||||
public int getTo_sub_volume_no(){
|
||||
return this.getOpcIntegerValue(item_to_sub_volume_no);
|
||||
public String getTo_sub_volume_no(){
|
||||
return this.getOpcStringValue(item_to_sub_volume_no);
|
||||
}
|
||||
|
||||
Boolean isonline;
|
||||
@@ -108,6 +109,16 @@ ItemProtocol {
|
||||
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() {
|
||||
ArrayList<ItemDto> list = new ArrayList<>();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.B0"));
|
||||
|
||||
@@ -93,8 +93,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
int task = 0;
|
||||
int last_task = 0;
|
||||
//气涨轴条码
|
||||
int barcode = 0;
|
||||
int last_barcode = 0;
|
||||
String barcode;
|
||||
String last_barcode;
|
||||
|
||||
|
||||
int heartbeat = 0;
|
||||
@@ -109,8 +109,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
int last_to_task = 0;
|
||||
|
||||
|
||||
int to_sub_volume_no = 0;
|
||||
int last_to_sub_volume_no = 0;
|
||||
String to_sub_volume_no;
|
||||
String last_to_sub_volume_no;
|
||||
|
||||
Boolean isonline = true;
|
||||
int hasGoods = 0;
|
||||
@@ -264,10 +264,14 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
|
||||
if (applyManipulatorActionResponse.getCode() == 200) {
|
||||
Map<String, String> data = applyManipulatorActionResponse.getData();
|
||||
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");//子卷号
|
||||
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_command", "1");
|
||||
map.put("to_is_labeling",StrUtil.isNotEmpty(to_is_labeling)?"0":"1");
|
||||
this.writing(map);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse);
|
||||
message = "申请行架任务成功";
|
||||
|
||||
@@ -324,6 +324,9 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
if (!command.equals(last_command)){
|
||||
requireSucess=true;
|
||||
if (command==0){
|
||||
clearWrite();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -666,6 +669,33 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
}
|
||||
|
||||
public void clearWrite() {
|
||||
List list = new ArrayList<>();
|
||||
Map map = new HashMap<>();
|
||||
map.put("code","to_x");
|
||||
map.put("value","0");
|
||||
list.add(map);
|
||||
Map map2 = new HashMap<>();
|
||||
map2.put("code","to_y");
|
||||
map2.put("value","0");
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap<>();
|
||||
map3.put("code","to_z");
|
||||
map3.put("value","0");
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap<>();
|
||||
map4.put("code","to_command");
|
||||
map4.put("value","0");
|
||||
list.add(map4);
|
||||
Map map5 = new HashMap<>();
|
||||
map4.put("code","to_task");
|
||||
map4.put("value","0");
|
||||
list.add(map4);
|
||||
|
||||
this.writing(list);
|
||||
message=null;
|
||||
}
|
||||
|
||||
private void updateData2(String poinCode, Instruction instruction, Device point, String[] split) {
|
||||
Instruction instructionUpdate = checkInst();
|
||||
TaskDto taskUpdate = new TaskDto();
|
||||
|
||||
@@ -42,9 +42,9 @@ public class ItemProtocol {
|
||||
public static String item_to_command = "to_command";
|
||||
//气涨轴类型
|
||||
public static String item_to_qzz_type = "to_qzz_type";
|
||||
//套管纸管1规格
|
||||
//套管纸管1编码
|
||||
public static String item_to_material1 = "to_material1";
|
||||
//套管纸管2规格
|
||||
//套管纸管2编码
|
||||
public static String item_to_material2 = "to_material2";
|
||||
//套管纸管数量
|
||||
public static String item_to_qty1 = "to_qty1";
|
||||
@@ -52,9 +52,9 @@ public class ItemProtocol {
|
||||
public static String item_to_size1 = "to_size1";
|
||||
//套管纸管2尺寸
|
||||
public static String item_to_size2 = "to_size2";
|
||||
//拔轴纸管1规格
|
||||
//拔轴纸管1编码
|
||||
public static String item_to_material3 = "to_material3";
|
||||
//拔轴纸管2规格
|
||||
//拔轴纸管2编码
|
||||
public static String item_to_material4 = "to_material4";
|
||||
//拔轴纸管数量
|
||||
public static String item_to_qty2 = "to_qty2";
|
||||
@@ -62,6 +62,12 @@ public class ItemProtocol {
|
||||
public static String item_to_size3 = "to_size3";
|
||||
//拔轴纸管2尺寸
|
||||
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;
|
||||
|
||||
@@ -95,11 +101,11 @@ public class ItemProtocol {
|
||||
|
||||
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 int getWeight2(){ return this.getOpcIntegerValue(item_weight2);}
|
||||
public Float getWeight2(){ return this.getOpcFloatValue(item_weight2);}
|
||||
|
||||
public int getSize(){ return this.getOpcIntegerValue(item_size);}
|
||||
|
||||
@@ -217,17 +223,21 @@ public class ItemProtocol {
|
||||
public static List<ItemDto> getWriteableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
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_material2, "套管纸管2规格", "DB10.String656.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_qty1, "套管纸管数量", "DB10.W6"));
|
||||
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_size2, "套管纸管2尺寸", "DB10.W12"));
|
||||
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_material1, "拔轴纸管1编码", "DB10.String602.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_size1, "拔轴纸管1尺寸", "DB10.W10"));
|
||||
list.add(new ItemDto(item_to_size2, "下发纸管2尺寸", "DB10.W12"));
|
||||
list.add(new ItemDto(item_to_size3, "拔轴纸管1尺寸", "DB10.W10"));
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,14 +98,14 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
String barcode = null;
|
||||
String lastBarcode = null;
|
||||
//纸管1重量
|
||||
int weight1 = 0;
|
||||
int lastWeight1 = 0;
|
||||
Float weight1 = 0.0F;
|
||||
Float lastWeight1 = 0.0F;
|
||||
//纸管1规格
|
||||
String material1 = null;
|
||||
String lastMaterial1 = null;
|
||||
//纸管2重量
|
||||
int weight2 = 0;
|
||||
int lastWeight2 = 0;
|
||||
Float weight2 = 0.0F;
|
||||
Float lastWeight2 = 0.0F;
|
||||
//纸管2规格
|
||||
String material2 = null;
|
||||
String lastMaterial2 = null;
|
||||
@@ -160,7 +160,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
*/
|
||||
int flag;
|
||||
|
||||
String deviceCode;
|
||||
String device_code;
|
||||
|
||||
String message = null;
|
||||
|
||||
@@ -177,7 +177,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
|
||||
@Override
|
||||
public void execute() throws Exception {
|
||||
deviceCode = this.getDeviceCode();
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getMode();
|
||||
move = this.itemProtocol.getMove();
|
||||
action = this.itemProtocol.getAction();
|
||||
@@ -298,7 +298,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
private synchronized void apply_casing(int mode) throws Exception {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_ONE);
|
||||
//气涨轴尺寸
|
||||
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
||||
@@ -336,7 +336,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
map.put("to_qty1", number);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "申请套管成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
@@ -345,7 +345,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
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 {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
//上报规格和重量
|
||||
applyPlugPullSiteRequest.setWeight1(String.valueOf(weight1));
|
||||
applyPlugPullSiteRequest.setMaterial1(String.valueOf(material1));
|
||||
@@ -365,7 +365,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
|
||||
this.writeSignal(mode);
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "套管完成成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
@@ -374,7 +374,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
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 {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
@@ -394,7 +394,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "拔轴完成成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
@@ -403,7 +403,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
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 {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
||||
applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode));
|
||||
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) {
|
||||
@@ -450,7 +450,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "申请拔轴成功";
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
@@ -459,7 +459,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
this.writing(map);
|
||||
requireSucess = true;
|
||||
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 {
|
||||
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
|
||||
ApplyPlugPullSitResponse applyPlugPullSitResponse;
|
||||
applyPlugPullSiteRequest.setDevice_code(deviceCode);
|
||||
applyPlugPullSiteRequest.setDevice_code(device_code);
|
||||
applyPlugPullSiteRequest.setSize(String.valueOf(size));
|
||||
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE);
|
||||
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
|
||||
@@ -477,14 +477,14 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command", mode);
|
||||
this.writing(map);
|
||||
logServer.deviceExecuteLog(this.deviceCode, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
|
||||
message = "生成行架任务成功";
|
||||
requireSucess = true;
|
||||
} else {
|
||||
message = applyPlugPullSitResponse.getMessage();
|
||||
requireSucess = true;
|
||||
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"));
|
||||
}
|
||||
}
|
||||
logServer.deviceExecuteLog(deviceCode, "", "", "下发电气信号:" + itemMap);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
@@ -540,7 +540,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
this.checkcontrol(itemMap);
|
||||
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
@@ -634,7 +634,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
// itemMap.put(to_param, Integer.parseInt(value));
|
||||
this.control(itemMap);
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(deviceCode)
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.acs.common.base.CommonFinalParam;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.device.service.DeviceExtraService;
|
||||
@@ -224,7 +225,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
try {
|
||||
TaskDto dto = taskserver.findByCode(inst.getTask_code());
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
if (ObjectUtil.isNotEmpty(dto)){
|
||||
/*if (ObjectUtil.isNotEmpty(dto)){
|
||||
String interaction_json = dto.getInteraction_json();
|
||||
if (ObjectUtil.isNotEmpty(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_barcode", jsonObject.getString("qzz_no"));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
map.put("to_command", "5");
|
||||
this.writing(map);
|
||||
finish_instruction(inst);
|
||||
@@ -361,68 +362,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
String startAddr = startDevice.getExtraValue().get("address").toString();
|
||||
String nextAddr = nextDevice.getExtraValue().get("address").toString();
|
||||
String interaction_json = taskDto.getInteraction_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_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);
|
||||
Map<String, Object> map = toStringObjectMap(instruction, startAddr, nextAddr, interaction_json);
|
||||
this.writing(map);
|
||||
this.setRequireSucess(true);
|
||||
return true;
|
||||
@@ -500,68 +440,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
String startAddr = startDevice.getExtraValue().get("address").toString();
|
||||
String nextAddr = nextDevice.getExtraValue().get("address").toString();
|
||||
String interaction_json = task.getInteraction_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_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);
|
||||
Map<String, Object> map = toStringObjectMap(instdto, startAddr, nextAddr, interaction_json);
|
||||
this.writing(map);
|
||||
this.setRequireSucess(true);
|
||||
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){
|
||||
String interactionJson = taskDto.getInteraction_json();
|
||||
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
|
||||
@@ -661,7 +611,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
String mode = "";
|
||||
String move = "";
|
||||
String action = "";
|
||||
String walk_y = "";
|
||||
String walkY = "";
|
||||
if (this.getMode() == 0) {
|
||||
mode = LangProcess.msg("universal_off-line");
|
||||
} else if (this.getMode() == 1) {
|
||||
|
||||
@@ -27,11 +27,15 @@ 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_weight = "weight";
|
||||
/**
|
||||
* 子卷号
|
||||
*/
|
||||
public static String item_sub_volume_no = "sub_volume_no";
|
||||
|
||||
//下发命令
|
||||
public static String item_to_command = "to_command";
|
||||
@@ -60,6 +64,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_move);
|
||||
}
|
||||
|
||||
public String getSub_volume_no() {
|
||||
return this.getOpcStringValue(item_sub_volume_no);
|
||||
}
|
||||
|
||||
public int getAction() {
|
||||
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_error, "报警信号", "DB13.B5"));
|
||||
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_y_position, "y坐标", "DB13.REAL14"));
|
||||
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.ExecutableDeviceDriver;
|
||||
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.service.DeviceErrorLogService;
|
||||
import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl;
|
||||
@@ -69,6 +75,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class);
|
||||
@Autowired
|
||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
@Autowired
|
||||
AcsToWmsService acsToWmsService = SpringContextHolder.getBean(AcsToWmsServiceImpl.class);
|
||||
|
||||
//工作模式
|
||||
int mode = 0;
|
||||
@@ -99,6 +107,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
float weight = 0;
|
||||
float last_weight = 0;
|
||||
|
||||
String sub_volume_no;
|
||||
|
||||
int heartbeat = 0;
|
||||
int last_heartbeat = 0;
|
||||
int to_command = 0;
|
||||
@@ -165,6 +175,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
move = this.itemProtocol.getMove();
|
||||
action = this.itemProtocol.getAction();
|
||||
walk_y = this.itemProtocol.getWalk_y();
|
||||
sub_volume_no = this.itemProtocol.getSub_volume_no();
|
||||
error = this.itemProtocol.getError();
|
||||
task = this.itemProtocol.getTask();
|
||||
heartbeat = this.itemProtocol.getHeartbeat();
|
||||
@@ -203,16 +214,24 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
}
|
||||
|
||||
//反馈重量
|
||||
if (mode == 3 && action == 5 && move == 0 && task > 0 && !requireSucess) {
|
||||
Instruction inst2 = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if (ObjectUtil.isNotEmpty(inst2)) {
|
||||
if (mode == 3 && action == 5 && move == 0 && StrUtil.isNotEmpty(sub_volume_no) && !requireSucess) {
|
||||
ApplyfeedbackSubVolumeWeightRequest applyfeedbackSubVolumeWeightRequest = new ApplyfeedbackSubVolumeWeightRequest();
|
||||
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<>();
|
||||
//todo:反馈重量
|
||||
map.put("to_command", "5");
|
||||
this.writing(map);
|
||||
this.requireSucess = true;
|
||||
} else {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "未反馈电气信号原因:当前步骤不为允许取货(now_steps_type!=3)");
|
||||
}else{
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("反馈LMS子卷重量失败:"+ applyPlugPullSitResponse.getMessage())
|
||||
.build();
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
}
|
||||
} else {
|
||||
feedMessage = "行架机械手:";
|
||||
|
||||
@@ -50,4 +50,13 @@ public class ApplyPlugPullSiteRequest extends BaseRequest {
|
||||
* 尺寸 3,6寸
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* 向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
|
||||
public ApplyManipulatorActionResponse applyManipulatorActionRequest(ApplyManipulatorActionRequest param) {
|
||||
log.info("向LMS申请反馈,请求参数{}", param);
|
||||
@@ -512,7 +548,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
return JSONObject.toJavaObject(map, ApplyManipulatorActionResponse.class);
|
||||
}
|
||||
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);
|
||||
}
|
||||
return applyManipulatorActionResponse;
|
||||
|
||||
Reference in New Issue
Block a user