更新
This commit is contained in:
@@ -22,7 +22,9 @@ import org.nl.acs.device.service.*;
|
||||
import org.nl.acs.device.service.dto.*;
|
||||
import org.nl.acs.device_driver.DeviceDriverDefination;
|
||||
import org.nl.acs.device_driver.ScannerDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.oven_manipulator.OvenGantryManipulatorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling.SiemensConveyorLabelingDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.slit_two_manipulator.SlitTwoManipulatorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
||||
@@ -110,8 +112,8 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
Integer currentPageNumber = page.getPageNumber() + 1;
|
||||
Integer pageMaxSize = page.getPageSize();
|
||||
List<Object> protocolList = objects.stream().skip((currentPageNumber - 1) * pageMaxSize).limit(pageMaxSize).collect(Collectors.toList());
|
||||
json.put("content",protocolList);
|
||||
json.put("totalElements",jsonArray.size());
|
||||
json.put("content", protocolList);
|
||||
json.put("totalElements", jsonArray.size());
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -941,6 +943,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
||||
} else if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
|
||||
SiemensConveyorDeviceDriver siemensConveyorDeviceDriver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
|
||||
siemensConveyorDeviceDriver.setDeviceStatus(form);
|
||||
} else if (device.getDeviceDriver() instanceof SiemensConveyorLabelingDeviceDriver) {
|
||||
SiemensConveyorLabelingDeviceDriver siemensConveyorLabelingDeviceDriver = (SiemensConveyorLabelingDeviceDriver) device.getDeviceDriver();
|
||||
siemensConveyorLabelingDeviceDriver.setDeviceStatus(form);
|
||||
} else if (device.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
|
||||
OvenGantryManipulatorDeviceDriver ovenGantryManipulatorDeviceDriver = (OvenGantryManipulatorDeviceDriver) device.getDeviceDriver();
|
||||
ovenGantryManipulatorDeviceDriver.setDeviceStatus(form);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -820,12 +820,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
jo.put("notCreateTaskMessage", notCreateTaskMessage);
|
||||
jo.put("notCreateInstMessage", notCreateInstMessage);
|
||||
jo.put("feedMessage", feedMessage);
|
||||
jo.put("driver_type", "siemens_conveyor");
|
||||
jo.put("is_click", true);
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDeviceStatus(JSONObject data) {
|
||||
|
||||
String requestSucess = data.getString("requireSucess");
|
||||
if (StrUtil.equals(requestSucess, "0")) {
|
||||
this.requireSucess = false;
|
||||
} else if(StrUtil.equals(requestSucess, "1")) {
|
||||
this.requireSucess = true;
|
||||
}
|
||||
}
|
||||
|
||||
// public void writing(int type, int command) {
|
||||
|
||||
@@ -144,19 +144,19 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
error = this.itemProtocol.getError();
|
||||
task = this.itemProtocol.getTask();
|
||||
if (mode != last_mode) {
|
||||
if( mode == 2){
|
||||
if (mode == 2) {
|
||||
requireSucess = false;
|
||||
requireApplyLabelingSuccess = false;
|
||||
requireApplyLaStrangulationSuccess =false;
|
||||
requireEmptyInSuccess =false;
|
||||
requireEmptyOutSuccess =false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode +"复位请求标记");
|
||||
requireApplyLaStrangulationSuccess = false;
|
||||
requireEmptyInSuccess = false;
|
||||
requireEmptyOutSuccess = false;
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (move != last_move) {
|
||||
if(move == 0 && mode == 2 ){
|
||||
if (move == 0 && mode == 2) {
|
||||
message = null;
|
||||
inst_message = null;
|
||||
this.clearWrite();
|
||||
@@ -177,19 +177,19 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
}
|
||||
|
||||
if ( move != 0 && task > 0) {
|
||||
if (move != 0 && task > 0) {
|
||||
//inst_message
|
||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if (inst != null) {
|
||||
inst_message = "当前指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||
if(mode == 2){
|
||||
if (mode == 2) {
|
||||
if (StrUtil.equals(inst.getInstruction_status(), "1")) {
|
||||
if(StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())){
|
||||
if (StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||
vehicle_code = inst.getVehicle_code();
|
||||
inst.setExecute_device_code(this.device_code);
|
||||
finish_instruction();
|
||||
} else {
|
||||
if(!StrUtil.equals(inst.getExecute_code(),this.device_code)){
|
||||
if (!StrUtil.equals(inst.getExecute_code(), this.device_code)) {
|
||||
inst.setExecute_device_code(this.device_code);
|
||||
instructionService.update(inst);
|
||||
}
|
||||
@@ -331,32 +331,32 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_target");
|
||||
map.put("value","0");
|
||||
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");
|
||||
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");
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "0");
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap();
|
||||
map4.put("code","to_strap_times");
|
||||
map4.put("value","0");
|
||||
map4.put("code", "to_strap_times");
|
||||
map4.put("value", "0");
|
||||
list.add(map4);
|
||||
Map map5 = new HashMap();
|
||||
map5.put("code","to_length");
|
||||
map5.put("value","0");
|
||||
map5.put("code", "to_length");
|
||||
map5.put("value", "0");
|
||||
list.add(map5);
|
||||
Map map6 = new HashMap();
|
||||
map6.put("code","to_weight");
|
||||
map6.put("value","0");
|
||||
map6.put("code", "to_weight");
|
||||
map6.put("value", "0");
|
||||
list.add(map6);
|
||||
Map map7 = new HashMap();
|
||||
map7.put("code","to_height");
|
||||
map7.put("value","0");
|
||||
map7.put("code", "to_height");
|
||||
map7.put("value", "0");
|
||||
list.add(map7);
|
||||
this.writing(list);
|
||||
message = null;
|
||||
@@ -474,7 +474,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
String requestSucess = data.getString("requireSucess");
|
||||
if (StrUtil.equals(requestSucess, "0")) {
|
||||
this.requireSucess = false;
|
||||
} else if(StrUtil.equals(requestSucess, "1")) {
|
||||
} else if (StrUtil.equals(requestSucess, "1")) {
|
||||
this.requireSucess = true;
|
||||
}
|
||||
}
|
||||
@@ -517,33 +517,33 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
// }
|
||||
//需要判断当前设备是否已经存在就绪的指令 如果存在就直接下发 不存在则创建
|
||||
Instruction inst = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
||||
if(ObjectUtil.isNotEmpty(inst)){
|
||||
if (ObjectUtil.isNotEmpty(inst)) {
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
|
||||
if(StrUtil.isNotEmpty(taskdto.getTo_z())){
|
||||
if(StrUtil.equals(taskdto.getTo_z(),"01")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","102");
|
||||
} else if(StrUtil.equals(taskdto.getTo_z(),"02")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","201");
|
||||
} else if(StrUtil.equals(taskdto.getTo_z(),"03")){
|
||||
map.put("code","to_target");
|
||||
map.put("value","301");
|
||||
if (StrUtil.isNotEmpty(taskdto.getTo_z())) {
|
||||
if (StrUtil.equals(taskdto.getTo_z(), "01")) {
|
||||
map.put("code", "to_target");
|
||||
map.put("value", "102");
|
||||
} else if (StrUtil.equals(taskdto.getTo_z(), "02")) {
|
||||
map.put("code", "to_target");
|
||||
map.put("value", "201");
|
||||
} else if (StrUtil.equals(taskdto.getTo_z(), "03")) {
|
||||
map.put("code", "to_target");
|
||||
map.put("value", "301");
|
||||
}
|
||||
}
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code","to_task");
|
||||
map2.put("value",inst.getInstruction_code());
|
||||
map2.put("code", "to_task");
|
||||
map2.put("value", inst.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","1");
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
if( task != Integer.parseInt(inst.getInstruction_code())){
|
||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
}
|
||||
@@ -553,7 +553,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
|
||||
// type 5 输送任务
|
||||
if(!StrUtil.equals(taskdto.getTask_type(),"5")){
|
||||
if (!StrUtil.equals(taskdto.getTask_type(), "5")) {
|
||||
return false;
|
||||
}
|
||||
String taskid = taskdto.getTask_id();
|
||||
@@ -631,30 +631,30 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_target");
|
||||
map.put("value",next_addr);
|
||||
map.put("code", "to_target");
|
||||
map.put("value", next_addr);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code","to_task");
|
||||
map2.put("value",instdto.getInstruction_code());
|
||||
map2.put("code", "to_task");
|
||||
map2.put("value", instdto.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","1");
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
if( task != Integer.parseInt(inst.getInstruction_code())){
|
||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
}
|
||||
} else {
|
||||
//如果不存在则直接找对应指令
|
||||
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
||||
if(ObjectUtil.isEmpty(inst)){
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
return false;
|
||||
}
|
||||
//当起点为行架任务的时候不需要请求下发
|
||||
if(StrUtil.equals(inst.getInstruction_type(),"6")){
|
||||
if (StrUtil.equals(inst.getInstruction_type(), "6")) {
|
||||
return false;
|
||||
}
|
||||
Device nextdevice = deviceAppservice.findDeviceByCode(inst.getNext_device_code());
|
||||
@@ -662,21 +662,21 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_target");
|
||||
map.put("value",next_addr);
|
||||
map.put("code", "to_target");
|
||||
map.put("value", next_addr);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code","to_task");
|
||||
map2.put("value",inst.getInstruction_code());
|
||||
map2.put("code", "to_task");
|
||||
map2.put("value", inst.getInstruction_code());
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_command");
|
||||
map3.put("value","1");
|
||||
map3.put("code", "to_command");
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
if( task != Integer.parseInt(inst.getInstruction_code())){
|
||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -692,17 +692,17 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
} else {
|
||||
this.require_apply_labeling_time = date;
|
||||
String vehicle_code = "";
|
||||
if(task >0 ){
|
||||
if (task > 0) {
|
||||
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
vehicle_code = instruction.getVehicle_code();
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"异常");
|
||||
message = "申请贴标电气设备任务号:"+task+"异常";
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:" + task + "异常");
|
||||
message = "申请贴标电气设备任务号:" + task + "异常";
|
||||
throw new RuntimeException("任务号为空!");
|
||||
}
|
||||
if(StrUtil.isEmpty(vehicle_code)){
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:"+task+"未找到载具号");
|
||||
message = "申请贴标电气设备任务号:"+task+"未找到载具号";
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请贴标电气设备任务号:" + task + "未找到载具号");
|
||||
message = "申请贴标电气设备任务号:" + task + "未找到载具号";
|
||||
throw new RuntimeException("载具号为空!");
|
||||
}
|
||||
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
||||
@@ -717,19 +717,19 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
||||
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||
|
||||
if(applyLabelingAndBindingResponse.getstatus() == 200){
|
||||
message ="申请贴标成功";
|
||||
if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
||||
message = "申请贴标成功";
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_command");
|
||||
map.put("value","5");
|
||||
map.put("code", "to_command");
|
||||
map.put("value", "5");
|
||||
list.add(map);
|
||||
this.writing(list);
|
||||
this.writing(list);
|
||||
message ="申请贴标下发电气信号成功";
|
||||
message = "申请贴标下发电气信号成功";
|
||||
requireApplyLabelingSuccess = true;
|
||||
} else {
|
||||
message = "申请贴标失败,"+applyLabelingAndBindingResponse.getMessage();
|
||||
message = "申请贴标失败," + applyLabelingAndBindingResponse.getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -743,17 +743,17 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
} else {
|
||||
this.require_apply_strangulation_time = date;
|
||||
String vehicle_code = "";
|
||||
if(task >0 ){
|
||||
if (task > 0) {
|
||||
Instruction instruction = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
vehicle_code = instruction.getVehicle_code();
|
||||
} else {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:"+task+"异常");
|
||||
message = "申请捆扎电气设备任务号:"+task+"异常";
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "异常");
|
||||
message = "申请捆扎电气设备任务号:" + task + "异常";
|
||||
throw new RuntimeException("任务号为空!");
|
||||
}
|
||||
if(StrUtil.isEmpty(vehicle_code)){
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:"+task+"未找到载具号");
|
||||
message = "申请捆扎电气设备任务号:"+task+"未找到载具号";
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
logServer.deviceExecuteLog(device_code, "", "", "申请捆扎电气设备任务号:" + task + "未找到载具号");
|
||||
message = "申请捆扎电气设备任务号:" + task + "未找到载具号";
|
||||
throw new RuntimeException("载具号为空!");
|
||||
}
|
||||
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest =
|
||||
@@ -767,8 +767,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
applyLabelingAndBindingRequest.setType("2");
|
||||
applyLabelingAndBindingRequest.setVehicle_code(vehicle_code);
|
||||
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||
if(applyLabelingAndBindingResponse.getstatus() == 200) {
|
||||
if(ObjectUtil.isNotEmpty( applyLabelingAndBindingResponse.getData())){
|
||||
if (applyLabelingAndBindingResponse.getstatus() == 200) {
|
||||
if (ObjectUtil.isNotEmpty(applyLabelingAndBindingResponse.getData())) {
|
||||
Map datas = applyLabelingAndBindingResponse.getData();
|
||||
String length = datas.get("box_length").toString();
|
||||
String width = datas.get("box_width").toString();
|
||||
@@ -777,28 +777,28 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code","to_length");
|
||||
map.put("value",length);
|
||||
map.put("code", "to_length");
|
||||
map.put("value", length);
|
||||
list.add(map);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code","to_weight");
|
||||
map2.put("value",width);
|
||||
map2.put("code", "to_weight");
|
||||
map2.put("value", width);
|
||||
list.add(map2);
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code","to_height");
|
||||
map3.put("value",box_high);
|
||||
map3.put("code", "to_height");
|
||||
map3.put("value", box_high);
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap();
|
||||
map4.put("code","to_strap_times");
|
||||
map4.put("value",bundle_times);
|
||||
map4.put("code", "to_strap_times");
|
||||
map4.put("value", bundle_times);
|
||||
list.add(map4);
|
||||
Map map5 = new HashMap();
|
||||
map5.put("code","to_command");
|
||||
map5.put("value","4");
|
||||
map5.put("code", "to_command");
|
||||
map5.put("value", "4");
|
||||
list.add(map5);
|
||||
this.writing(list);
|
||||
this.writing(list);
|
||||
message ="申请捆扎成功";
|
||||
message = "申请捆扎成功";
|
||||
requireApplyLaStrangulationSuccess = true;
|
||||
} else {
|
||||
message = "未返回尺寸信息";
|
||||
@@ -823,7 +823,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
message = "申请空盘入库任务中...";
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("device_code", device_code);
|
||||
apply.put("type","2");
|
||||
apply.put("type", "2");
|
||||
String str = acsToWmsService.applyTaskToWms(apply);
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
@@ -834,7 +834,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
requireEmptyInSuccess = true;
|
||||
} else {
|
||||
requireEmptyInSuccess = false;
|
||||
message = "申请空盘入库失败,"+jo.get("message").toString();
|
||||
message = "申请空盘入库失败," + jo.get("message").toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -850,10 +850,12 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
} else {
|
||||
this.instruction_require_time = date;
|
||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||
Instruction instruction = instructionService.findByCode(String.valueOf(task));
|
||||
message = "申请AGV搬运任务中...";
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("device_code", device_code);
|
||||
apply.put("type","1");
|
||||
apply.put("type", "4");
|
||||
apply.put("vehicle_code", instruction.getVehicle_code());
|
||||
String str = acsToWmsService.applyTaskToWms(apply);
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
@@ -861,10 +863,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
} else {
|
||||
if (jo.getInteger("status") == 200) {
|
||||
message = "申请AGV搬运任务成功";
|
||||
requireEmptyOutSuccess = true;
|
||||
requireSucess = true;
|
||||
} else {
|
||||
requireEmptyOutSuccess = false;
|
||||
message = "申请AGV搬运任务失败,"+jo.get("message").toString();
|
||||
requireSucess = false;
|
||||
message = "申请AGV搬运任务失败," + jo.get("message").toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -883,7 +885,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
message = "申请空盘出库任务中...";
|
||||
JSONObject apply = new JSONObject();
|
||||
apply.put("device_code", device_code);
|
||||
apply.put("type","3");
|
||||
apply.put("type", "3");
|
||||
String str = acsToWmsService.applyTaskToWms(apply);
|
||||
JSONObject jo = JSON.parseObject(str);
|
||||
if (ObjectUtil.isEmpty(jo)) {
|
||||
@@ -894,7 +896,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
requireEmptyOutSuccess = true;
|
||||
} else {
|
||||
requireEmptyOutSuccess = false;
|
||||
message = "申请空盘出库失败,"+jo.get("message").toString();
|
||||
message = "申请空盘出库失败," + jo.get("message").toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1134,6 +1134,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
map5.put("code", "to_command1");
|
||||
map5.put("value", "1");
|
||||
list.add(map5);
|
||||
HashMap<String, String> map6 = new HashMap<String, String>() {{
|
||||
put("code", "to_command2");
|
||||
put("value", "0");
|
||||
}};
|
||||
list.add(map6);
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "下发前工位任务");
|
||||
|
||||
@@ -1164,6 +1169,11 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
map5.put("code", "to_command2");
|
||||
map5.put("value", "1");
|
||||
list.add(map5);
|
||||
HashMap map6 = new HashMap() {{
|
||||
put("code", "to_command1");
|
||||
put("value", "0");
|
||||
}};
|
||||
list.add(map6);
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "下发后工位任务");
|
||||
|
||||
|
||||
@@ -646,6 +646,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
jo.put("vehicle_code", vehicle_code);
|
||||
jo.put("vehicle_type", vehicle_type);
|
||||
jo.put("storage_task_type", storage_task_type);
|
||||
if (StrUtil.equals("4",task_type)){
|
||||
agv_system_type = "1";
|
||||
}
|
||||
jo.put("agv_system_type", agv_system_type);
|
||||
jo.put("oven_time", (int) Math.ceil(oven_time));
|
||||
jo.put("remark", remark);
|
||||
|
||||
Reference in New Issue
Block a user