fix: 限高,kep报错等修改

This commit is contained in:
2024-05-23 19:45:46 +08:00
parent c19dbfe11d
commit b8891aabf4
11 changed files with 195 additions and 135 deletions

View File

@@ -93,8 +93,8 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
int move = 0; int move = 0;
int last_move = 0; int last_move = 0;
//托盘方向 //托盘方向
int carrier_direction = 0; int container_direction = 0;
int last_carrier_direction = 0; int last_container_direction = 0;
//报警信号 //报警信号
int error = 0; int error = 0;
int last_error = 0; int last_error = 0;
@@ -179,7 +179,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode(); mode = this.itemProtocol.getMode();
move = this.itemProtocol.getMove(); move = this.itemProtocol.getMove();
carrier_direction = this.itemProtocol.getCarrier_direction(); container_direction = this.itemProtocol.getContainer_direction();
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
to_command = this.itemProtocol.getTo_command(); to_command = this.itemProtocol.getTo_command();
@@ -264,7 +264,6 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
} }
last_mode = mode; last_mode = mode;
last_move = move; last_move = move;
last_carrier_direction = carrier_direction;
last_error = error; last_error = error;
last_task = task; last_task = task;
last_heartbeat = heartbeat; last_heartbeat = heartbeat;
@@ -619,9 +618,9 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
map.put("hasGoods", true); map.put("hasGoods", true);
} }
if (this.carrier_direction == 1) { if (this.container_direction == 1) {
carrier_direction = LangProcess.msg("universal_forward_rotation"); carrier_direction = LangProcess.msg("universal_forward_rotation");
} else if (this.carrier_direction == 2) { } else if (this.container_direction == 2) {
carrier_direction = LangProcess.msg("universal_rollback"); carrier_direction = LangProcess.msg("universal_rollback");
} }
String requireSucess = LangProcess.msg("universal_actionMessage4"); String requireSucess = LangProcess.msg("universal_actionMessage4");

View File

@@ -27,7 +27,7 @@ public class ItemProtocol {
/** /**
* 托盘方向 * 托盘方向
*/ */
public static String item_carrier_direction = "carrier_direction"; public static String item_container_direction = "container_direction";
/** /**
* 载具类型 * 载具类型
@@ -99,8 +99,8 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_move); return this.getOpcIntegerValue(item_move);
} }
public int getCarrier_direction() { public int getContainer_direction() {
return this.getOpcIntegerValue(item_carrier_direction); return this.getOpcIntegerValue(item_container_direction);
} }
public int getError() { public int getError() {
@@ -160,7 +160,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0")); list.add(new ItemDto(item_heartbeat, "心跳", "DB600.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB600.B2")); list.add(new ItemDto(item_mode, "工作模式", "DB600.B2"));
list.add(new ItemDto(item_move, "光电信号", "DB600.B3")); list.add(new ItemDto(item_move, "光电信号", "DB600.B3"));
list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB600.B4")); list.add(new ItemDto(item_container_direction, "托盘方向", "DB600.B4"));
list.add(new ItemDto(item_action, "动作信号", "DB600.B5")); list.add(new ItemDto(item_action, "动作信号", "DB600.B5"));
list.add(new ItemDto(item_error, "报警信号", "DB600.B6")); list.add(new ItemDto(item_error, "报警信号", "DB600.B6"));
list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B7")); list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B7"));

View File

@@ -240,6 +240,16 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
} }
if (error == 20){
applyErrorHeight();
List list2 = new ArrayList();
Map map2 = new HashMap();
map2.put("code", "to_command");
map2.put("value", 23);
list2.add(map2);
this.writing(list2);
}
if(move !=last_move){ if(move !=last_move){
if (ObjectUtil.isNotEmpty(inst)){ if (ObjectUtil.isNotEmpty(inst)){
if (move==0){ if (move==0){
@@ -359,6 +369,55 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
last_barcode = barcode; last_barcode = barcode;
} }
private void applyErrorHeight() {
Date date = new Date();
if (date.getTime() - this.require_apply_strangulation_time.getTime()
< (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return;
} else {
try {
JSONObject param = new JSONObject();
param.put("device_code", device_code);
param.put("vehicle_code", barcode);
param.put("material_barcode", material_barcode);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("申请高度等级,参数:" + param)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
String response = acsToWmsService.getBoxInfo(param);
JSONObject jo = JSON.parseObject(response);
if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请高度等级,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
String heightLevel = jo.getString("heightLevel");
List list1 = new ArrayList();
Map map = new HashMap();
map.put("code", "to_height_level");
map.put("value", heightLevel);
list1.add(map);
this.writing(list1);
this.requireSucess = true;
}else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请高度等级,返回参数:" + jo.getString("body"))
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
private void applyBoxReturnTask(String type, int mode) { private void applyBoxReturnTask(String type, int mode) {
Date date = new Date(); Date date = new Date();
if (date.getTime() - this.require_apply_strangulation_time.getTime() if (date.getTime() - this.require_apply_strangulation_time.getTime()

View File

@@ -178,9 +178,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
to_onset = this.itemProtocol.getTo_onset(); to_onset = this.itemProtocol.getTo_onset();
x = this.itemProtocol.getX(); x = this.itemProtocol.getX();
y = this.itemProtocol.getY(); y = this.itemProtocol.getY();
to_seq = this.itemProtocol.getTo_seq();
to_max_no = this.itemProtocol.getTo_max_no(); to_max_no = this.itemProtocol.getTo_max_no();
to_direction = this.itemProtocol.getTo_direction();
to_last = this.itemProtocol.getTo_last(); to_last = this.itemProtocol.getTo_last();
to_len = this.itemProtocol.getTo_len(); to_len = this.itemProtocol.getTo_len();

View File

@@ -83,15 +83,9 @@ public class ItemProtocol {
*/ */
public static String item_to_max_no = "to_max_no"; public static String item_to_max_no = "to_max_no";
/**
* 子卷摆放方向
*/
public static String item_to_direction = "to_direction";
/**
* 下发木箱工位顺序
*/
public static String item_to_seq = "to_seq";
/** /**
* 下发是否最后子卷 * 下发是否最后子卷
*/ */
@@ -165,15 +159,10 @@ public class ItemProtocol {
return this.getOpcFloatValue(item_y); return this.getOpcFloatValue(item_y);
} }
public int getTo_seq(){
return this.getOpcIntegerValue(item_to_seq);
}
public int getTo_max_no(){ public int getTo_max_no(){
return this.getOpcIntegerValue(item_to_max_no); return this.getOpcIntegerValue(item_to_max_no);
} }
public int getTo_direction(){
return this.getOpcIntegerValue(item_to_direction);
}
public int getTo_last(){ public int getTo_last(){
return this.getOpcIntegerValue(item_to_last_one); return this.getOpcIntegerValue(item_to_last_one);
@@ -249,8 +238,6 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4")); list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4"));
list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6")); list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6"));
list.add(new ItemDto(item_to_max_no, "木箱最大数量", "DB2.D8")); list.add(new ItemDto(item_to_max_no, "木箱最大数量", "DB2.D8"));
list.add(new ItemDto(item_to_direction, "子卷摆放方向", "DB2.D10"));
list.add(new ItemDto(item_to_seq, "下发木箱工位顺序", "DB2.W12"));
list.add(new ItemDto(item_to_last_one, "下发是否最后子卷", "DB2.W14")); list.add(new ItemDto(item_to_last_one, "下发是否最后子卷", "DB2.W14"));
list.add(new ItemDto(item_to_len, "下发子卷长度", "DB2.W16")); list.add(new ItemDto(item_to_len, "下发子卷长度", "DB2.W16"));
list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB601.STRING1.50")); list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB601.STRING1.50"));

View File

@@ -96,6 +96,13 @@ public class ItemProtocol {
*/ */
public static String item_to_layer = "to_layer"; public static String item_to_layer = "to_layer";
/**
*下发高度等级
*/
public static String item_to_height_level = "to_height_level";
private BoxStorageManipulatorDeviceDriver driver; private BoxStorageManipulatorDeviceDriver driver;
@@ -230,6 +237,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_height, "木箱高度", "DB601.W18")); list.add(new ItemDto(item_to_height, "木箱高度", "DB601.W18"));
list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB601.STRING1.50")); list.add(new ItemDto(item_to_barcode, "下发木箱条码", "DB601.STRING1.50"));
list.add(new ItemDto(item_to_layer, "下发木箱层数", "DB601.W22")); list.add(new ItemDto(item_to_layer, "下发木箱层数", "DB601.W22"));
list.add(new ItemDto(item_to_height_level, "下发高度等级", "DB601.W24"));
return list; return list;
} }
} }

View File

@@ -88,10 +88,7 @@ public class ItemProtocol {
*/ */
public static String item_forkCargo = "forkCargo"; public static String item_forkCargo = "forkCargo";
/**
* 货叉位置信号
*/
public static String item_forkLocation = "forkLocation";
/** /**
@@ -102,10 +99,7 @@ public class ItemProtocol {
* 特殊开关量2 * 特殊开关量2
*/ */
public static String item_special2 = "special2"; public static String item_special2 = "special2";
/**
* 托盘条码
*/
public static String item_trayCode = "trayCode";
/** /**
* 水箱和消防缓存位有无货 * 水箱和消防缓存位有无货
*/ */
@@ -235,9 +229,6 @@ public class ItemProtocol {
return this.getOpcFloatValue(item_forkCargo); return this.getOpcFloatValue(item_forkCargo);
} }
public float getItem_forkLocation() {
return this.getOpcFloatValue(item_forkLocation);
}
@@ -249,9 +240,6 @@ public class ItemProtocol {
return this.getOpcFloatValue(item_special2); return this.getOpcFloatValue(item_special2);
} }
public int[] getItem_trayCode() {
return this.getOpcIntegerArrayValue(item_trayCode);
}
public float getItem_storage_cache() { public float getItem_storage_cache() {
return this.getOpcFloatValue(item_storage_cache); return this.getOpcFloatValue(item_storage_cache);
@@ -350,10 +338,8 @@ public class ItemProtocol {
list.add(new ItemDto(item_distancey, "起升激光数值", "DB101.D44")); list.add(new ItemDto(item_distancey, "起升激光数值", "DB101.D44"));
list.add(new ItemDto(item_cargoError, "载货台超限信号", "DB101.B43")); list.add(new ItemDto(item_cargoError, "载货台超限信号", "DB101.B43"));
list.add(new ItemDto(item_forkCargo, "货叉探货信号", "DB101.B48")); list.add(new ItemDto(item_forkCargo, "货叉探货信号", "DB101.B48"));
list.add(new ItemDto(item_forkLocation, "货叉位置信号", "DB101.B49"));
list.add(new ItemDto(item_special1, "特殊开关量1", "DB101.B10")); list.add(new ItemDto(item_special1, "特殊开关量1", "DB101.B10"));
list.add(new ItemDto(item_special2, "特殊开关量2", "DB101.B11")); list.add(new ItemDto(item_special2, "特殊开关量2", "DB101.B11"));
list.add(new ItemDto(item_trayCode, "托盘条码", "DB101.B30.20"));
list.add(new ItemDto(item_storage_cache, "水箱和消防缓存位有无货", "DB101.B50")); list.add(new ItemDto(item_storage_cache, "水箱和消防缓存位有无货", "DB101.B50"));
list.add(new ItemDto(item_stacker_rpm, "速度(转/分钟)", "DB101.W52")); list.add(new ItemDto(item_stacker_rpm, "速度(转/分钟)", "DB101.W52"));
list.add(new ItemDto(item_stacker_electricCurrent, "电流", "DB101.W54")); list.add(new ItemDto(item_stacker_electricCurrent, "电流", "DB101.W54"));

View File

@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.*; import java.util.*;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors;
/** /**
* 单工位堆垛机驱动 * 单工位堆垛机驱动
@@ -93,6 +94,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
*/ */
private boolean stopReceiveTask = false; private boolean stopReceiveTask = false;
/** /**
* 心跳 * 心跳
*/ */
@@ -173,11 +175,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
*/ */
Float forkCargo = 0F; Float forkCargo = 0F;
Float last_forkCargo = 0F; Float last_forkCargo = 0F;
/**
* 货叉位置信号
*/
Float forkLocation = 0F;
Float last_forkLocation = 0F;
/** /**
* 货叉动作信号 * 货叉动作信号
*/ */
@@ -193,11 +191,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
*/ */
Float special2 = 0F; Float special2 = 0F;
Float last_special2 = 0F; Float last_special2 = 0F;
/**
* 托盘条码
*/
int[] trayCode;
int[] last_trayCode;
/** /**
* 水箱和消防缓存位有无货 * 水箱和消防缓存位有无货
*/ */
@@ -288,6 +282,11 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
*/ */
Instruction inst = null; Instruction inst = null;
/**
* 同排移库后的出库指令
*/
Instruction errorInst = null;
/** /**
* 入库异常错误限制 * 入库异常错误限制
*/ */
@@ -318,10 +317,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
distancey = this.itemProtocol.getItem_distancey(); distancey = this.itemProtocol.getItem_distancey();
cargoError = this.itemProtocol.getItem_cargoError(); cargoError = this.itemProtocol.getItem_cargoError();
forkCargo = this.itemProtocol.getItem_forkCargo(); forkCargo = this.itemProtocol.getItem_forkCargo();
forkLocation = this.itemProtocol.getItem_forkLocation();
special1 = this.itemProtocol.getItem_special1(); special1 = this.itemProtocol.getItem_special1();
special2 = this.itemProtocol.getItem_special2(); special2 = this.itemProtocol.getItem_special2();
trayCode = this.itemProtocol.getItem_trayCode();
storage_cache = this.itemProtocol.getItem_storage_cache(); storage_cache = this.itemProtocol.getItem_storage_cache();
if (!command.equals(last_command)) { if (!command.equals(last_command)) {
@@ -369,7 +366,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
message = "one_message7"; message = "one_message7";
} else { } else {
if (error != 0) { if (error != 0) {
updateEXcuteMessage(error.toString());
//满入空出或者浅货位阻挡 //满入空出或者浅货位阻挡
erroBlock(); erroBlock();
} }
@@ -460,15 +456,35 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
message = "universal_releasing_completed"; message = "universal_releasing_completed";
if (updateCommand("11")) break; if (updateCommand("11")) break;
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
List list5 = new ArrayList();
map.put("code", "to_command"); map.put("code", "to_command");
map.put("value", 11); map.put("value", 11);
list.add(map); list5.add(map);
this.writing(list5);
Instruction inst = checkInst(); Instruction inst = checkInst();
try { try {
finish_instruction(inst); if ("3".equals(inst.getPriority()) && errorInst != null) {
//存在同排移库做完后直接出库
String start_device_code = errorInst.getStart_device_code();
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
List listError = new ArrayList();
pakageCommand(listError, "1", errorInst.getInstruction_code());
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) {
pakagePlc(errorInst, listError);
}
if (ObjectUtil.isNotEmpty(listError)) {
this.writing(listError);
}
finish_instruction(inst);
errorInst = null;
}else {
finish_instruction(inst);
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
requireSucess = false; requireSucess = false;
break; break;
case 6: case 6:
@@ -521,24 +537,11 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
last_distancey = distancey; last_distancey = distancey;
last_cargoError = cargoError; last_cargoError = cargoError;
last_forkCargo = forkCargo; last_forkCargo = forkCargo;
last_forkLocation = forkLocation;
last_forkAction = forkAction; last_forkAction = forkAction;
last_special1 = special1; last_special1 = special1;
last_special2 = special2; last_special2 = special2;
last_trayCode = trayCode;
last_storage_cache = storage_cache; last_storage_cache = storage_cache;
/*last_stacker_rpm = stacker_rpm;
last_stacker_electricCurrent = stacker_electricCurrent;
last_stacker_runing_time = stacker_runing_time;
last_stacker_workingHours = stacker_workingHours;
last_cargo_rpm = cargo_rpm;
last_cargo_electric_Current = cargo_electric_Current;
last_cargo_workingHour = cargo_workingHour;
last_cargo_runingTimes = cargo_runingTimes;
last_fork_rpm = fork_rpm;
last_fork_electric_Current = fork_electric_Current;
last_fork_workingHours = fork_workingHours;
last_fork_runingTimes = fork_runingTimes;*/
} }
private void updateEXcuteMessage(String string) { private void updateEXcuteMessage(String string) {
@@ -588,6 +591,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
message = "universal_message3"; message = "universal_message3";
//指定库位满入 //指定库位满入
if (error == 5 && count < WcsConfig.stacker_error_in_count) { if (error == 5 && count < WcsConfig.stacker_error_in_count) {
updateEXcuteMessage(error.toString());
applyUpdatePointCode(StandarStirageErroEnum.FILL.getType()); applyUpdatePointCode(StandarStirageErroEnum.FILL.getType());
//相同任务时限制加一 //相同任务时限制加一
if (Objects.equals(task, last_task)) { if (Objects.equals(task, last_task)) {
@@ -598,6 +602,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
if (error == 6) { if (error == 6) {
try { try {
updateEXcuteMessage(error.toString());
applyUpdatePointCode(StandarStirageErroEnum.VOIDANCE.getType()); applyUpdatePointCode(StandarStirageErroEnum.VOIDANCE.getType());
} catch (Exception e) { } catch (Exception e) {
@@ -607,16 +612,17 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
//浅货位有货 //浅货位有货
if (error == 16) { if (error == 16) {
updateEXcuteMessage(error.toString());
//放货 //放货
if (forkCargo == 2 && count < WcsConfig.stacker_error_in_count) { if (forkCargo == 2 && count < WcsConfig.stacker_error_in_count) {
//相同任务时限制加一 //相同任务时限制加一
if (Objects.equals(task, last_task)) { if (Objects.equals(task, last_task)) {
count++; count++;
} }
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_OUT.getType()); applyUpdatePointCode(StandarStirageErroEnum.BLOCK_IN.getType());
} else if (forkCargo == 0) { } else if (forkCargo == 0) {
//取货 //取货
applyUpdatePointCode(StandarStirageErroEnum.BLOCK_IN.getType()); applyUpdatePointCode(StandarStirageErroEnum.BLOCK_OUT.getType());
} }
} }
@@ -674,7 +680,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) { if (type.equals(StandarStirageErroEnum.BLOCK_IN.getType()) || type.equals(StandarStirageErroEnum.FILL.getType())) {
updateData2(poinCode, instruction, point, split,vehicleCode); updateData2(poinCode, point, split, vehicleCode);
List list = new ArrayList(); List list = new ArrayList();
String x = point.getExtraValue().get("x").toString(); String x = point.getExtraValue().get("x").toString();
String y = split[1]; String y = split[1];
@@ -682,7 +688,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
pakagePLCData(list, x, y, z, "2", task.toString()); pakagePLCData(list, x, y, z, "2", task.toString());
} }
if (type.equals(StandarStirageErroEnum.VOIDANCE.getType())) { if (type.equals(StandarStirageErroEnum.VOIDANCE.getType())) {
updateData1(poinCode, instruction, point, split,vehicleCode); updateData1(poinCode, point, split, vehicleCode);
List list = new ArrayList(); List list = new ArrayList();
String x = point.getExtraValue().get("x").toString(); String x = point.getExtraValue().get("x").toString();
String y = split[1]; String y = split[1];
@@ -692,19 +698,14 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
//取货潜货位阻挡做完移库任务 //取货潜货位阻挡做完移库任务
if (type.equals(StandarStirageErroEnum.BLOCK_OUT.getType())) { if (type.equals(StandarStirageErroEnum.BLOCK_OUT.getType())) {
//获取出库指令更新其优先级和状态 errorInst = checkInst();
Instruction instruction1 = checkInst();
instruction1.setPriority("2");
instruction1.setInstruction_status("0");
instructionService.update(instruction1);
} }
} catch (Exception e) { } catch (Exception e) {
this.requireSucess = true; this.requireSucess = true;
e.printStackTrace(); e.printStackTrace();
} }
this.requireSucess = true; // this.requireSucess = true;
} else { } else {
LuceneLogDto logDto2 = LuceneLogDto.builder() LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
@@ -716,7 +717,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
} }
private void updateData1(String poinCode, Instruction instruction, Device point, String[] split, String vehicleCode) { private void updateData1(String poinCode, Device point, String[] split, String vehicleCode) {
Instruction instructionUpdate = checkInst(); Instruction instructionUpdate = checkInst();
TaskDto taskUpdate = new TaskDto(); TaskDto taskUpdate = new TaskDto();
instructionUpdate.setStart_point_code(poinCode); instructionUpdate.setStart_point_code(poinCode);
@@ -782,7 +783,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
message = null; message = null;
} }
private void updateData2(String poinCode, Instruction instruction, Device point, String[] split, String vehicleCode) { private void updateData2(String poinCode, Device point, String[] split, String vehicleCode) {
Instruction instructionUpdate = checkInst(); Instruction instructionUpdate = checkInst();
TaskDto taskUpdate = new TaskDto(); TaskDto taskUpdate = new TaskDto();
instructionUpdate.setNext_point_code(poinCode); instructionUpdate.setNext_point_code(poinCode);
@@ -870,6 +871,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
this.notCreateInstMessage = "任务暂停"; this.notCreateInstMessage = "任务暂停";
return false; return false;
} }
//输入:指令类型多种\ 指令状态多种\ //输入:指令类型多种\ 指令状态多种\
Instruction instruction1 = new Instruction(); Instruction instruction1 = new Instruction();
instruction1.setInstruction_status("0"); instruction1.setInstruction_status("0");
@@ -904,6 +906,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
} }
} }
if (CollUtil.isEmpty(instructionList) || instructionList.size() < 1) { if (CollUtil.isEmpty(instructionList) || instructionList.size() < 1) {
return false; return false;
} }
@@ -923,28 +927,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
} }
List list = new ArrayList(); List list = new ArrayList();
pakageCommand(list, "1", inst.getInstruction_code()); pakageCommand(list, "1", inst.getInstruction_code());
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name()) && !prohibitInWarehouse) { packagePlcCoordinate(startDevice, list);
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) {
HashMap map4 = new HashMap();
map4.put("code", "to_x");
map4.put("value", startDevice.getExtraValue().get("z"));
list.add(map4);
}
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x"))) {
HashMap map5 = new HashMap();
map5.put("code", "to_z");
map5.put("value", startDevice.getExtraValue().get("x"));
list.add(map5);
}
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y"))) {
HashMap map6 = new HashMap();
map6.put("code", "to_y");
map6.put("value", startDevice.getExtraValue().get("y"));
list.add(map6);
}
}
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) { if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name()) && !prohibitOutWarehouse) {
pakagePlc(inst, list); pakagePlc(inst, list);
} }
@@ -957,7 +941,31 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
return true; return true;
} }
private void pakagePlc(Instruction inst, List list) { private void packagePlcCoordinate(Device startDevice, List list) {
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name()) && !prohibitInWarehouse) {
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("z"))) {
HashMap map4 = new HashMap();
map4.put("code", "to_x");
map4.put("value", startDevice.getExtraValue().get("z"));
list.add(map4);
}
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("x"))) {
HashMap map5 = new HashMap();
map5.put("code", "to_z");
map5.put("value", startDevice.getExtraValue().get("x"));
list.add(map5);
}
if (ObjectUtil.isNotEmpty(startDevice.getExtraValue().get("y"))) {
HashMap map6 = new HashMap();
map6.put("code", "to_y");
map6.put("value", startDevice.getExtraValue().get("y"));
list.add(map6);
}
}
}
private void pakagePlc(Instruction inst, List list) {
HashMap map4 = new HashMap(); HashMap map4 = new HashMap();
map4.put("code", "to_y"); map4.put("code", "to_y");
map4.put("value", inst.getFrom_z()); map4.put("value", inst.getFrom_z());

View File

@@ -190,4 +190,6 @@ public interface AcsToWmsService {
* @return * @return
*/ */
GetWasteFoilWeightResponse feedbackWeight(GetWasteFoilWeightRequest param); GetWasteFoilWeightResponse feedbackWeight(GetWasteFoilWeightRequest param);
String getBoxInfo(JSONObject param);
} }

View File

@@ -596,6 +596,46 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
} }
@Override
public String getBoxInfo(JSONObject param) {
try {
MDC.put(log_file_type, log_type);
log.info("applyTaskToWms-----输入参数{}", param);
String wmsurl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("getBoxInfo");
String url = wmsurl + addressDto.getMethods_url();
HttpResponse result2 = null;
try {
result2 = HttpRequest.post(url)
.header("Authorization", token)
.body(String.valueOf(param))
.execute();
} catch (Exception e) {
String msg = e.getMessage();
log.info("applyTaskToWms-----输出参数{}", msg);
//网络不通
}
if(ObjectUtil.isEmpty(result2)){
log.info("applyTaskToWms-----输出参数{}", "返回结果为空");
return null;
}
String type = "";
if (result2.getStatus() == 200) {
type = "info";
} else {
type = "error";
}
log.info("applyTaskToWms-----输出参数{}", result2.body());
LuceneLogDto luceneLogDto = new LuceneLogDto(4,"applyTaskToWms", String.valueOf(result2.getStatus()),
JSON.toJSONString(param), String.valueOf(result2.body()), "二期发货申请捆扎、贴标");
luceneLogService.interfaceExecuteLog(luceneLogDto);
return result2.body();
} finally {
MDC.remove(log_file_type);
}
}
@Override @Override
public JSONObject queryStationState(Instruction inst) { public JSONObject queryStationState(Instruction inst) {

View File

@@ -254,33 +254,6 @@ public class CreateDDJInst {
instdto.setTo_z(taskDto.getTo_z()); instdto.setTo_z(taskDto.getTo_z());
instdto.setTo_y(taskDto.getTo_y()); instdto.setTo_y(taskDto.getTo_y());
} }
//判断agv系统
//1、1楼叉车系统
//2、2楼1区域AGV系统
//3、2楼2区域AGV系统 -已废弃
if (!StrUtil.equals(agv_system_type, CommonFinalParam.ONE)) {
// task_type
//1、生箔 Itype=1:取空,取满,放空,放满;
//2、分切 Itype=3取满、取空、放满、放空
//3、普通任务 Itype=2:取货、放货;
//4、叉车任务
//5、输送任务
//6、行架
//7、立库
if (StrUtil.equals(task_type, CommonFinalParam.ONE)) {
instdto.setAgv_inst_type(CommonFinalParam.ONE);
} else if (StrUtil.equals(task_type, "3")) {
instdto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) {
instdto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) {
instdto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + taskDto.getTask_code() + ",task_type:" + taskDto.getTask_type());
}
} else {
instdto.setAgv_inst_type("4");
}
try { try {
instructionService.create(instdto); instructionService.create(instdto);
} catch (Exception e) { } catch (Exception e) {