fix: 装箱修改
This commit is contained in:
@@ -38,11 +38,9 @@ import org.nl.config.SpringContextHolder;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.config.lucene.service.LuceneExecuteLogService;
|
||||
import org.nl.config.lucene.service.dto.LuceneLogDto;
|
||||
import org.nl.config.thread.ThreadPoolExecutorUtil;
|
||||
import org.openscada.opc.lib.da.Server;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* 一楼申请开箱位、贴标位
|
||||
@@ -211,7 +209,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
message = "指令信息不存在或者任务托盘码为空,无法开盖";
|
||||
return;
|
||||
}
|
||||
applyUnbox(instruction.getVehicle_code());
|
||||
applyUnbox(instruction);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -242,7 +240,7 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
last_to_height = to_height;
|
||||
}
|
||||
|
||||
private Boolean applyUnbox(String vehicleCode) {
|
||||
private Boolean applyUnbox(Instruction instruction) {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.require_apply_strangulation_time.getTime()
|
||||
< (long) this.instruction_require_time_out) {
|
||||
@@ -252,8 +250,8 @@ public class UnBoxLableConveyorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
try {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("device_code", device_code);
|
||||
param.put("material_barcode", vehicleCode);
|
||||
param.put("task", task);
|
||||
param.put("material_barcode", instruction.getVehicle_code());
|
||||
param.put("task", instruction.getTask_code());
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
.content("木箱开盖,参数:" + param)
|
||||
|
||||
@@ -118,6 +118,9 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
int to_len = 0;
|
||||
int last_to_len = 0;
|
||||
|
||||
int to_have_or_not = 0;
|
||||
int last_to_have_or_not = 0;
|
||||
|
||||
Boolean isonline = true;
|
||||
int hasGoods = 0;
|
||||
String message = "";
|
||||
@@ -182,6 +185,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
to_max_no = this.itemProtocol.getTo_max_no();
|
||||
to_last = this.itemProtocol.getTo_last();
|
||||
to_len = this.itemProtocol.getTo_len();
|
||||
to_have_or_not = this.itemProtocol.getTo_have_or_not();
|
||||
|
||||
if (mode != last_mode) {
|
||||
|
||||
@@ -388,8 +392,9 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
Map<String, Object> map10 = new HashMap<>();
|
||||
Map<String, Object> map11 = new HashMap<>();
|
||||
Map<String, Object> map12 = new HashMap<>();
|
||||
Map<String, Object> map13 = new HashMap<>();
|
||||
try {
|
||||
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instruction.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10,map11,map12);
|
||||
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instruction.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10,map11,map12,map13);
|
||||
} catch (Exception e) {
|
||||
|
||||
logServer.deviceExecuteLog(device_code, "", "", "当前设备:" + device_code + ",下发指令:"
|
||||
@@ -473,8 +478,9 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
Map<String, Object> map10 = new HashMap<>();
|
||||
Map<String, Object> map11 = new HashMap<>();
|
||||
Map<String, Object> map12 = new HashMap<>();
|
||||
Map<String, Object> map13 = new HashMap<>();
|
||||
try {
|
||||
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instdto.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10, map11,map12);
|
||||
pushPLC(map1, map2, next_addr, map3, start_addr, map4, instdto.getInstruction_code(), interactionJsonDTO, map5, map6, map7, map8,map9,map10, map11,map12,map13);
|
||||
} catch (Exception e) {
|
||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||
.device_code(device_code)
|
||||
@@ -495,7 +501,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
}
|
||||
|
||||
private void pushPLC(Map<String, Object> map1, Map<String, Object> map2, String next_addr, Map<String, Object> map3, String start_addr, Map<String, Object> map4, String task, InteractionJsonDTO interactionJsonDTO, Map<String, Object> map5, Map<String, Object> map6, Map<String, Object> map7, Map<String, Object> map8,Map<String, Object> map9,Map<String, Object> map10,Map<String, Object> map11,Map<String, Object> map12) {
|
||||
private void pushPLC(Map<String, Object> map1, Map<String, Object> map2, String next_addr, Map<String, Object> map3, String start_addr, Map<String, Object> map4, String task, InteractionJsonDTO interactionJsonDTO, Map<String, Object> map5, Map<String, Object> map6, Map<String, Object> map7, Map<String, Object> map8, Map<String, Object> map9, Map<String, Object> map10, Map<String, Object> map11, Map<String, Object> map12, Map<String, Object> map13) {
|
||||
List list = new ArrayList();
|
||||
map1.put("code", "to_command");
|
||||
map1.put("value", 1);
|
||||
@@ -547,6 +553,11 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
map12.put("value", interactionJsonDTO.getFrpModel());
|
||||
list.add(map12);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getIsHave())) {
|
||||
map13.put("code", "to_have_or_not");
|
||||
map13.put("value", interactionJsonDTO.getIsHave());
|
||||
list.add(map13);
|
||||
}
|
||||
}
|
||||
this.writing(list);
|
||||
luceneExecuteLogService.deviceExecuteLog(LuceneLogDto.builder()
|
||||
|
||||
@@ -46,4 +46,9 @@ public class InteractionJsonDTO {
|
||||
* 高度等级
|
||||
*/
|
||||
private String frpModel;
|
||||
|
||||
/**
|
||||
* 是否有货
|
||||
*/
|
||||
private String isHave;
|
||||
}
|
||||
|
||||
@@ -95,6 +95,12 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_to_barcode = "to_barcode";
|
||||
|
||||
|
||||
/**
|
||||
*是否有货
|
||||
*/
|
||||
public static String item_to_have_or_not = "to_have_or_not";
|
||||
|
||||
/**
|
||||
*下发子卷长度
|
||||
*/
|
||||
@@ -174,6 +180,10 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_len);
|
||||
}
|
||||
|
||||
public int getTo_have_or_not(){
|
||||
return this.getOpcIntegerValue(item_to_have_or_not);
|
||||
}
|
||||
|
||||
public int getFrpModel(){
|
||||
return this.getOpcIntegerValue(item_frpModel);
|
||||
}
|
||||
@@ -198,6 +208,8 @@ public class ItemProtocol {
|
||||
return this.getOpcStringValue(item_to_barcode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getOpcStringValue(String protocol) {
|
||||
String value = this.driver.getStringValue(protocol);
|
||||
if (StrUtil.isEmpty(value)) {
|
||||
|
||||
Reference in New Issue
Block a user