Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -120,6 +120,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
//车号
|
//车号
|
||||||
int carno = arr[20];
|
int carno = arr[20];
|
||||||
Instruction link_inst = null;
|
Instruction link_inst = null;
|
||||||
|
Instruction inst = null;
|
||||||
List<Instruction> insts = null;
|
List<Instruction> insts = null;
|
||||||
boolean link_flag = false;
|
boolean link_flag = false;
|
||||||
Device agv_device = null;
|
Device agv_device = null;
|
||||||
@@ -127,7 +128,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno));
|
agv_device = deviceAppService.findDeviceByCode(String.valueOf(carno));
|
||||||
}
|
}
|
||||||
if (ikey != 0) {
|
if (ikey != 0) {
|
||||||
insts = instructionService.findByLinkNum(String.valueOf(ikey));
|
inst = instructionService.findByCodeFromCache(String.valueOf(ikey));
|
||||||
}
|
}
|
||||||
if (!ObjectUtil.isEmpty(link_inst)) {
|
if (!ObjectUtil.isEmpty(link_inst)) {
|
||||||
link_flag = true;
|
link_flag = true;
|
||||||
@@ -143,7 +144,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
|
|
||||||
//开始任务/上报订单号
|
//开始任务/上报订单号
|
||||||
if (phase == 0x01) {
|
if (phase == 0x01) {
|
||||||
for (Instruction inst : insts) {
|
if (!ObjectUtil.isEmpty(inst)) {
|
||||||
inst.setInstruction_status("1");
|
inst.setInstruction_status("1");
|
||||||
inst.setAgv_jobno(String.valueOf(index));
|
inst.setAgv_jobno(String.valueOf(index));
|
||||||
inst.setSend_status("1");
|
inst.setSend_status("1");
|
||||||
@@ -155,7 +156,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
//(无车id及状态)
|
//(无车id及状态)
|
||||||
else if (phase == 0x0A) {
|
else if (phase == 0x0A) {
|
||||||
|
|
||||||
for (Instruction inst : insts) {
|
if (!ObjectUtil.isEmpty(inst)) {
|
||||||
if (!ObjectUtil.isEmpty(inst)) {
|
if (!ObjectUtil.isEmpty(inst)) {
|
||||||
instructionService.finish(inst.getInstruction_id());
|
instructionService.finish(inst.getInstruction_id());
|
||||||
}
|
}
|
||||||
@@ -173,7 +174,7 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
//(需要WCS反馈)
|
//(需要WCS反馈)
|
||||||
else if(phase == 0xFF) {
|
else if(phase == 0xFF) {
|
||||||
|
|
||||||
for (Instruction inst : insts) {
|
if (!ObjectUtil.isEmpty(inst)) {
|
||||||
if (!ObjectUtil.isEmpty(inst)) {
|
if (!ObjectUtil.isEmpty(inst)) {
|
||||||
instructionService.cancelNOSendAgv(inst.getInstruction_id());
|
instructionService.cancelNOSendAgv(inst.getInstruction_id());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
|
|||||||
import org.nl.acs.device.service.DeviceService;
|
import org.nl.acs.device.service.DeviceService;
|
||||||
import org.nl.acs.device_driver.DeviceDriver;
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.ScannerDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.basedriver.standard_scanner.StandardScannerDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
|
import org.nl.acs.ext.wms.data.ApplyLabelingAndBindingRequest;
|
||||||
@@ -122,6 +124,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
String device_code;
|
String device_code;
|
||||||
|
|
||||||
|
String vehicle_code;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Device getDevice() {
|
public Device getDevice() {
|
||||||
@@ -233,6 +237,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
inst_message = "指令号:" + inst.getInstruction_code() + " " + inst.getStart_point_code() + "->" + inst.getNext_point_code() + " 载具号:" + inst.getVehicle_code();
|
||||||
if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||||
|
vehicle_code = inst.getVehicle_code();
|
||||||
|
// Device device = deviceAppservice.findDeviceByCode("BCR1");
|
||||||
|
// StandardScannerDeviceDriver standardScannerDeviceDriver;
|
||||||
|
// if (device.getDeviceDriver() instanceof ScannerDeviceDriver) {
|
||||||
|
// standardScannerDeviceDriver = (StandardScannerDeviceDriver) device.getDeviceDriver();
|
||||||
|
// standardScannerDeviceDriver.writeBarcode(vehicle_code);
|
||||||
|
// }
|
||||||
finish_instruction();
|
finish_instruction();
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
||||||
@@ -325,6 +336,12 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
emptyOut();
|
emptyOut();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 8:
|
||||||
|
//申请AGV任务
|
||||||
|
if (move == 0 && !requireSucess) {
|
||||||
|
applyAgvTask();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -352,10 +369,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map.put("code","to_target");
|
map.put("code","to_target");
|
||||||
map.put("value","0");
|
map.put("value","0");
|
||||||
list.add(map);
|
list.add(map);
|
||||||
// Map map2 = new HashMap();
|
Map map2 = new HashMap();
|
||||||
// map2.put("code","to_task");
|
map2.put("code","to_task");
|
||||||
// map2.put("value","0");
|
map2.put("value","0");
|
||||||
// list.add(map2);
|
list.add(map2);
|
||||||
Map map3 = new HashMap();
|
Map map3 = new HashMap();
|
||||||
map3.put("code","to_command");
|
map3.put("code","to_command");
|
||||||
map3.put("value","0");
|
map3.put("value","0");
|
||||||
@@ -377,7 +394,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map7.put("value","0");
|
map7.put("value","0");
|
||||||
list.add(map7);
|
list.add(map7);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
|
message = null;
|
||||||
|
vehicle_code = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean exe_business() {
|
public boolean exe_business() {
|
||||||
@@ -386,6 +404,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
|
|
||||||
public synchronized boolean finish_instruction() throws Exception {
|
public synchronized boolean finish_instruction() throws Exception {
|
||||||
instructionService.finish(inst);
|
instructionService.finish(inst);
|
||||||
|
// requireSucess = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,6 +455,16 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
mode = "待机";
|
mode = "待机";
|
||||||
} else if (this.getMode() == 3) {
|
} else if (this.getMode() == 3) {
|
||||||
mode = "运行中";
|
mode = "运行中";
|
||||||
|
} else if (this.getMode() == 4) {
|
||||||
|
mode = "申请捆扎中";
|
||||||
|
} else if (this.getMode() == 5) {
|
||||||
|
mode = "申请贴标中";
|
||||||
|
} else if (this.getMode() == 6) {
|
||||||
|
mode = "申请空盘入库中";
|
||||||
|
} else if (this.getMode() == 7) {
|
||||||
|
mode = "申请空盘出库中";
|
||||||
|
} else if (this.getMode() == 8) {
|
||||||
|
mode = "申请AGV任务中";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getMove() == 0) {
|
if (this.getMove() == 0) {
|
||||||
@@ -474,7 +503,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
String requestSucess = data.getString("requireSucess");
|
String requestSucess = data.getString("requireSucess");
|
||||||
if (StrUtil.equals(requestSucess, "0")) {
|
if (StrUtil.equals(requestSucess, "0")) {
|
||||||
this.requireSucess = false;
|
this.requireSucess = false;
|
||||||
} else {
|
} else if(StrUtil.equals(requestSucess, "1")) {
|
||||||
this.requireSucess = true;
|
this.requireSucess = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -510,26 +539,66 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
} else {
|
} else {
|
||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
//container_code
|
//container_code
|
||||||
TaskDto task = taskserver.findByStartCodeAndReady(device_code);
|
TaskDto taskdto = taskserver.findByStartCodeAndReady(device_code);
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(taskdto)) {
|
||||||
// if (!ObjectUtils.isEmpty(instructionService.findByBarcodeFromCache(container_code))) {
|
// if (!ObjectUtils.isEmpty(instructionService.findByBarcodeFromCache(container_code))) {
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
String taskid = task.getTask_id();
|
|
||||||
String taskcode = task.getTask_code();
|
Instruction inst = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
||||||
String vehiclecode = task.getVehicle_code();
|
if(ObjectUtil.isNotEmpty(inst)){
|
||||||
String priority = task.getPriority();
|
List list = new ArrayList();
|
||||||
String start_point_code = task.getStart_point_code();
|
Map map = new HashMap();
|
||||||
String start_device_code = task.getStart_device_code();
|
|
||||||
String route_plan_code = task.getRoute_plan_code();
|
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());
|
||||||
|
list.add(map2);
|
||||||
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code","to_command");
|
||||||
|
map3.put("value","1");
|
||||||
|
list.add(map3);
|
||||||
|
this.writing(list);
|
||||||
|
if( task != Integer.parseInt(inst.getInstruction_code())){
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||||
|
}
|
||||||
|
message = "下发电气任务号成功";
|
||||||
|
requireSucess = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!StrUtil.equals(taskdto.getTask_type(),"5")){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
String taskid = taskdto.getTask_id();
|
||||||
|
String taskcode = taskdto.getTask_code();
|
||||||
|
String vehiclecode = taskdto.getVehicle_code();
|
||||||
|
String priority = taskdto.getPriority();
|
||||||
|
String start_point_code = taskdto.getStart_point_code();
|
||||||
|
String start_device_code = taskdto.getStart_device_code();
|
||||||
|
String route_plan_code = taskdto.getRoute_plan_code();
|
||||||
String next_device_code = "";
|
String next_device_code = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始平均分配
|
* 开始平均分配
|
||||||
*/
|
*/
|
||||||
String this_coevice_code = taskserver.queryAssignedByDevice(device_code, task.getNext_device_code());
|
String this_coevice_code = taskserver.queryAssignedByDevice(device_code, taskdto.getNext_device_code());
|
||||||
if (StrUtil.isEmpty(this_coevice_code)) {
|
if (StrUtil.isEmpty(this_coevice_code)) {
|
||||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, task.getNext_device_code(), route_plan_code);
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, taskdto.getNext_device_code(), route_plan_code);
|
||||||
RouteLineDto routeLineDto = shortPathsList.get(0);
|
RouteLineDto routeLineDto = shortPathsList.get(0);
|
||||||
|
|
||||||
String path = routeLineDto.getPath();
|
String path = routeLineDto.getPath();
|
||||||
@@ -560,16 +629,16 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
|
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
|
||||||
String next_point_code;
|
String next_point_code;
|
||||||
if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) {
|
if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||||
next_point_code = task.getTo_x() + "-" + task.getTo_y() + "-" + task.getTo_z();
|
next_point_code = taskdto.getTo_x() + "-" + taskdto.getTo_y() + "-" + taskdto.getTo_z();
|
||||||
} else {
|
} else {
|
||||||
next_point_code = next_device_code;
|
next_point_code = next_device_code;
|
||||||
}
|
}
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||||
instdto.setRoute_plan_code(route_plan_code);
|
instdto.setRoute_plan_code(route_plan_code);
|
||||||
instdto.setRemark(task.getRemark());
|
instdto.setRemark(taskdto.getRemark());
|
||||||
instdto.setMaterial(task.getMaterial());
|
instdto.setMaterial(taskdto.getMaterial());
|
||||||
instdto.setQuantity(task.getQuantity());
|
instdto.setQuantity(taskdto.getQuantity());
|
||||||
instdto.setTask_id(taskid);
|
instdto.setTask_id(taskid);
|
||||||
instdto.setTask_code(taskcode);
|
instdto.setTask_code(taskcode);
|
||||||
instdto.setVehicle_code(vehiclecode);
|
instdto.setVehicle_code(vehiclecode);
|
||||||
@@ -585,8 +654,8 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
instdto.setExecute_device_code(start_point_code);
|
instdto.setExecute_device_code(start_point_code);
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
//创建指令后修改任务状态
|
//创建指令后修改任务状态
|
||||||
task.setTask_status("1");
|
taskdto.setTask_status("1");
|
||||||
taskserver.update(task);
|
taskserver.update(taskdto);
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||||
|
|
||||||
@@ -604,9 +673,19 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map3.put("value","1");
|
map3.put("value","1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
|
if( task != Integer.parseInt(inst.getInstruction_code())){
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
||||||
|
if(ObjectUtil.isEmpty(inst)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
//当起点为行架任务的时候不需要请求下发
|
||||||
|
if(StrUtil.equals(inst.getInstruction_type(),"6")){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
Device nextdevice = deviceAppservice.findDeviceByCode(inst.getNext_device_code());
|
Device nextdevice = deviceAppservice.findDeviceByCode(inst.getNext_device_code());
|
||||||
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
String next_addr = nextdevice.getExtraValue().get("address").toString();
|
||||||
|
|
||||||
@@ -624,7 +703,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map3.put("value","1");
|
map3.put("value","1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
|
if( task != Integer.parseInt(inst.getInstruction_code())){
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -665,16 +747,18 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
ApplyLabelingAndBindingResponse applyLabelingAndBindingResponse = acsToWmsService.applyLabelingAndBindingRequest(applyLabelingAndBindingRequest);
|
||||||
|
|
||||||
if(applyLabelingAndBindingResponse.getstatus() == 200){
|
if(applyLabelingAndBindingResponse.getstatus() == 200){
|
||||||
|
message ="申请贴标成功";
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
map.put("code","to_command");
|
map.put("code","to_command");
|
||||||
map.put("value","5");
|
map.put("value","5");
|
||||||
list.add(map);
|
list.add(map);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
message ="申请贴标成功";
|
this.writing(list);
|
||||||
|
message ="申请贴标下发电气信号成功";
|
||||||
requireApplyLabelingSuccess = true;
|
requireApplyLabelingSuccess = true;
|
||||||
} else {
|
} else {
|
||||||
message = applyLabelingAndBindingResponse.getMessage();
|
message = "申请贴标失败,"+applyLabelingAndBindingResponse.getMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -742,6 +826,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
map5.put("value","4");
|
map5.put("value","4");
|
||||||
list.add(map5);
|
list.add(map5);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
|
this.writing(list);
|
||||||
message ="申请贴标成功";
|
message ="申请贴标成功";
|
||||||
requireApplyLaStrangulationSuccess = true;
|
requireApplyLaStrangulationSuccess = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -764,20 +849,51 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
this.require_empty_in_time = date;
|
this.require_empty_in_time = date;
|
||||||
|
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
message = "申请任务中...";
|
message = "申请空盘入库任务中...";
|
||||||
JSONObject apply = new JSONObject();
|
JSONObject apply = new JSONObject();
|
||||||
apply.put("device_code", device_code);
|
apply.put("device_code", device_code);
|
||||||
apply.put("type","2");
|
apply.put("type","2");
|
||||||
String str = acsToWmsService.applyTaskToWms(apply);
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
JSONObject jo = JSON.parseObject(str);
|
JSONObject jo = JSON.parseObject(str);
|
||||||
if (ObjectUtil.isEmpty(jo)) {
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
message = "接口不通";
|
message = "申请空盘入库接口不通";
|
||||||
} else {
|
} else {
|
||||||
if (jo.getInteger("status") == 200) {
|
if (jo.getInteger("status") == 200) {
|
||||||
|
message = "申请空盘入库成功";
|
||||||
requireEmptyInSuccess = true;
|
requireEmptyInSuccess = true;
|
||||||
} else {
|
} else {
|
||||||
requireEmptyInSuccess = false;
|
requireEmptyInSuccess = false;
|
||||||
message = jo.get("message").toString();
|
message = "申请空盘入库失败,"+jo.get("message").toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void applyAgvTask() {
|
||||||
|
Date date = new Date();
|
||||||
|
if (date.getTime() - this.require_empty_out_time.getTime() < (long) this.instruction_require_time_out) {
|
||||||
|
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
this.require_empty_out_time = date;
|
||||||
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
|
message = "申请AGV搬运任务中...";
|
||||||
|
JSONObject apply = new JSONObject();
|
||||||
|
apply.put("device_code", device_code);
|
||||||
|
apply.put("type","4");
|
||||||
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
|
JSONObject jo = JSON.parseObject(str);
|
||||||
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
|
message = "申请AGV搬运任务接口不通";
|
||||||
|
} else {
|
||||||
|
if (jo.getInteger("status") == 200) {
|
||||||
|
message = "申请AGV搬运任务成功";
|
||||||
|
requireEmptyOutSuccess = true;
|
||||||
|
} else {
|
||||||
|
requireEmptyOutSuccess = false;
|
||||||
|
message = "申请AGV搬运任务失败,"+jo.get("message").toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -793,20 +909,21 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
} else {
|
} else {
|
||||||
this.require_empty_out_time = date;
|
this.require_empty_out_time = date;
|
||||||
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
|
||||||
message = "申请任务中...";
|
message = "申请空盘出库任务中...";
|
||||||
JSONObject apply = new JSONObject();
|
JSONObject apply = new JSONObject();
|
||||||
apply.put("device_code", device_code);
|
apply.put("device_code", device_code);
|
||||||
apply.put("type","3");
|
apply.put("type","3");
|
||||||
String str = acsToWmsService.applyTaskToWms(apply);
|
String str = acsToWmsService.applyTaskToWms(apply);
|
||||||
JSONObject jo = JSON.parseObject(str);
|
JSONObject jo = JSON.parseObject(str);
|
||||||
if (ObjectUtil.isEmpty(jo)) {
|
if (ObjectUtil.isEmpty(jo)) {
|
||||||
message = "接口不通";
|
message = "申请空盘出库接口不通";
|
||||||
} else {
|
} else {
|
||||||
if (jo.getInteger("status") == 200) {
|
if (jo.getInteger("status") == 200) {
|
||||||
|
message = "申请空盘出库成功";
|
||||||
requireEmptyOutSuccess = true;
|
requireEmptyOutSuccess = true;
|
||||||
} else {
|
} else {
|
||||||
requireEmptyOutSuccess = false;
|
requireEmptyOutSuccess = false;
|
||||||
message = jo.get("message").toString();
|
message = "申请空盘出库失败,"+jo.get("message").toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -815,5 +932,4 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -174,5 +174,10 @@ public class ItemProtocol {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -970,19 +970,66 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
|
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
|
||||||
String start_addr = startDevice.getExtraValue().get("address").toString();
|
String start_addr = startDevice.getExtraValue().get("address").toString();
|
||||||
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
String next_addr = nextDevice.getExtraValue().get("address").toString();
|
||||||
|
List list = new ArrayList();
|
||||||
if (StrUtil.equals(type, "1")) {
|
if (StrUtil.equals(type, "1")) {
|
||||||
this.writing("to_onset1", start_addr);
|
Map map1 = new HashMap();
|
||||||
this.writing("to_target1", next_addr);
|
map1.put("code","to_onset1");
|
||||||
this.writing("to_task1", dto.getInstruction_code());
|
map1.put("value",start_addr);
|
||||||
this.writing("to_command1", "1");
|
list.add(map1);
|
||||||
this.writing("to_type", "1");
|
Map map2 = new HashMap();
|
||||||
|
map2.put("code","to_target1");
|
||||||
|
map2.put("value",next_addr);
|
||||||
|
list.add(map2);
|
||||||
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code","to_task1");
|
||||||
|
map3.put("value",dto.getInstruction_code());
|
||||||
|
list.add(map3);
|
||||||
|
Map map4 = new HashMap();
|
||||||
|
map4.put("code","to_type");
|
||||||
|
map4.put("value","1");
|
||||||
|
list.add(map4);
|
||||||
|
Map map5 = new HashMap();
|
||||||
|
map5.put("code","to_command1");
|
||||||
|
map5.put("value","1");
|
||||||
|
list.add(map5);
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "下发前工位任务");
|
||||||
|
|
||||||
|
// this.writing("to_onset1", start_addr);
|
||||||
|
// this.writing("to_target1", next_addr);
|
||||||
|
// this.writing("to_task1", dto.getInstruction_code());
|
||||||
|
// this.writing("to_command1", "1");
|
||||||
|
// this.writing("to_type", "1");
|
||||||
this.setNow_steps_type1(2);
|
this.setNow_steps_type1(2);
|
||||||
} else if (StrUtil.equals(type, "2")) {
|
} else if (StrUtil.equals(type, "2")) {
|
||||||
this.writing("to_onset2", start_addr);
|
Map map1 = new HashMap();
|
||||||
this.writing("to_target2", next_addr);
|
map1.put("code","to_onset2");
|
||||||
this.writing("to_task2", dto.getInstruction_code());
|
map1.put("value",start_addr);
|
||||||
this.writing("to_command2", "1");
|
list.add(map1);
|
||||||
this.writing("to_type", "2");
|
Map map2 = new HashMap();
|
||||||
|
map2.put("code","to_target2");
|
||||||
|
map2.put("value",next_addr);
|
||||||
|
list.add(map2);
|
||||||
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code","to_task2");
|
||||||
|
map3.put("value",dto.getInstruction_code());
|
||||||
|
list.add(map3);
|
||||||
|
Map map4 = new HashMap();
|
||||||
|
map4.put("code","to_type");
|
||||||
|
map4.put("value","2");
|
||||||
|
list.add(map4);
|
||||||
|
Map map5 = new HashMap();
|
||||||
|
map5.put("code","to_command2");
|
||||||
|
map5.put("value","1");
|
||||||
|
list.add(map5);
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "下发后工位任务");
|
||||||
|
|
||||||
|
// this.writing("to_onset2", start_addr);
|
||||||
|
// this.writing("to_target2", next_addr);
|
||||||
|
// this.writing("to_task2", dto.getInstruction_code());
|
||||||
|
// this.writing("to_command2", "1");
|
||||||
|
// this.writing("to_type", "2");
|
||||||
this.setNow_steps_type2(2);
|
this.setNow_steps_type2(2);
|
||||||
} else if (StrUtil.equals(type, "3")) {
|
} else if (StrUtil.equals(type, "3")) {
|
||||||
String start_device_code2 = dto.getStart_device_code2();
|
String start_device_code2 = dto.getStart_device_code2();
|
||||||
@@ -991,17 +1038,65 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
Device nextDevice2 = deviceAppservice.findDeviceByCode(next_device_code2);
|
Device nextDevice2 = deviceAppservice.findDeviceByCode(next_device_code2);
|
||||||
String start_addr2 = startDevice2.getExtraValue().get("address").toString();
|
String start_addr2 = startDevice2.getExtraValue().get("address").toString();
|
||||||
String next_addr2 = nextDevice2.getExtraValue().get("address").toString();
|
String next_addr2 = nextDevice2.getExtraValue().get("address").toString();
|
||||||
this.writing("to_onset1", start_addr2);
|
|
||||||
this.writing("to_target1", next_addr2);
|
|
||||||
this.writing("to_task1", dto.getInstruction_code());
|
Map map1 = new HashMap();
|
||||||
this.writing("to_command1", "1");
|
map1.put("code","to_onset1");
|
||||||
this.writing("to_onset2", start_addr);
|
map1.put("value",start_addr2);
|
||||||
this.writing("to_target2", next_addr);
|
list.add(map1);
|
||||||
this.writing("to_task2", dto.getInstruction_code());
|
Map map2 = new HashMap();
|
||||||
this.writing("to_command2", "1");
|
map2.put("code","to_target1");
|
||||||
this.writing("to_type", "3");
|
map2.put("value",next_addr2);
|
||||||
|
list.add(map2);
|
||||||
|
Map map3 = new HashMap();
|
||||||
|
map3.put("code","to_task1");
|
||||||
|
map3.put("value",dto.getInstruction_code());
|
||||||
|
list.add(map3);
|
||||||
|
Map map4 = new HashMap();
|
||||||
|
map4.put("code","to_onset2");
|
||||||
|
map4.put("value",start_addr);
|
||||||
|
list.add(map4);
|
||||||
|
Map map5 = new HashMap();
|
||||||
|
map5.put("code","to_target2");
|
||||||
|
map5.put("value",next_addr);
|
||||||
|
list.add(map5);
|
||||||
|
Map map6 = new HashMap();
|
||||||
|
map6.put("code","to_task2");
|
||||||
|
map6.put("value",dto.getInstruction_code());
|
||||||
|
list.add(map6);
|
||||||
|
Map map7 = new HashMap();
|
||||||
|
map7.put("code","to_type");
|
||||||
|
map7.put("value","3");
|
||||||
|
list.add(map7);
|
||||||
|
Map map8 = new HashMap();
|
||||||
|
map8.put("code","to_command1");
|
||||||
|
map8.put("value","1");
|
||||||
|
list.add(map8);
|
||||||
|
Map map9 = new HashMap();
|
||||||
|
map9.put("code","to_command2");
|
||||||
|
map9.put("value","1");
|
||||||
|
list.add(map9);
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "下发双工位任务");
|
||||||
|
|
||||||
|
|
||||||
|
// this.writing("to_onset1", start_addr2);
|
||||||
|
// this.writing("to_target1", next_addr2);
|
||||||
|
// this.writing("to_task1", dto.getInstruction_code());
|
||||||
|
// this.writing("to_command1", "1");
|
||||||
|
// this.writing("to_onset2", start_addr);
|
||||||
|
// this.writing("to_target2", next_addr);
|
||||||
|
// this.writing("to_task2", dto.getInstruction_code());
|
||||||
|
// this.writing("to_command2", "1");
|
||||||
|
// this.writing("to_type", "3");
|
||||||
this.setNow_steps_type3(2);
|
this.setNow_steps_type3(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(task1 != Integer.parseInt(dto.getInstruction_code()) || task2 != Integer.parseInt(dto.getInstruction_code()) ){
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", dto.getInstruction_code() + "再次下发电气信号");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断点位是否设置电气值
|
//判断点位是否设置电气值
|
||||||
@@ -1093,6 +1188,25 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
|||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void writing(List list) {
|
||||||
|
|
||||||
|
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||||
|
Server server = ReadUtil.getServer(opcservcerid);
|
||||||
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
Object ob = list.get(i);
|
||||||
|
JSONObject json = (JSONObject) JSONObject.toJSON(ob);
|
||||||
|
if (!StrUtil.isEmpty(json.getString("value"))) {
|
||||||
|
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
|
+ "." + json.getString("code");
|
||||||
|
itemMap.put(to_param, json.getString("value"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||||
|
ReadUtil.write(itemMap, server);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//将扩展表中的字符串数组数据转换成集合
|
//将扩展表中的字符串数组数据转换成集合
|
||||||
public List<String> getExtraDeviceCodes(String extraName) {
|
public List<String> getExtraDeviceCodes(String extraName) {
|
||||||
String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
|
String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
|
||||||
|
|||||||
@@ -276,10 +276,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
map.put("code","to_target");
|
map.put("code","to_target");
|
||||||
map.put("value","0");
|
map.put("value","0");
|
||||||
list.add(map);
|
list.add(map);
|
||||||
// Map map2 = new HashMap();
|
Map map2 = new HashMap();
|
||||||
// map2.put("code","to_task");
|
map2.put("code","to_task");
|
||||||
// map2.put("value","0");
|
map2.put("value","0");
|
||||||
// list.add(map2);
|
list.add(map2);
|
||||||
Map map3 = new HashMap();
|
Map map3 = new HashMap();
|
||||||
map3.put("code","to_command");
|
map3.put("code","to_command");
|
||||||
map3.put("value","0");
|
map3.put("value","0");
|
||||||
@@ -440,26 +440,63 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
} else {
|
} else {
|
||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
//container_code
|
//container_code
|
||||||
TaskDto task = taskserver.findByContainer(container_code);
|
TaskDto taskdto = taskserver.findByContainer(container_code);
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(taskdto)) {
|
||||||
if (!ObjectUtils.isEmpty(instructionService.findByBarcodeFromCache(container_code))) {
|
if (!ObjectUtils.isEmpty(instructionService.findByTaskcodeAndStatus(taskdto.getTask_code()))) {
|
||||||
return false;
|
Instruction instdto = instructionService.findByTaskcodeAndStatus(taskdto.getTask_code());
|
||||||
|
if (ObjectUtil.isNotEmpty(instdto)) {
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.add(map);
|
||||||
|
Map map2 = new HashMap();
|
||||||
|
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");
|
||||||
|
list.add(map3);
|
||||||
|
this.writing(list);
|
||||||
|
message = "下发电气任务号成功";
|
||||||
|
if(task != Integer.parseInt(instdto.getInstruction_code()) ){
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", instdto.getInstruction_code() + "再次下发电气信号");
|
||||||
|
}
|
||||||
|
requireSucess = true;
|
||||||
|
applySucess = true;
|
||||||
|
} else {
|
||||||
|
message = "任务号:" + taskdto.getTask_code() + "未找到指令";
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
String taskid = task.getTask_id();
|
String taskid = taskdto.getTask_id();
|
||||||
String taskcode = task.getTask_code();
|
String taskcode = taskdto.getTask_code();
|
||||||
String vehiclecode = task.getVehicle_code();
|
String vehiclecode = taskdto.getVehicle_code();
|
||||||
String priority = task.getPriority();
|
String priority = taskdto.getPriority();
|
||||||
String start_point_code = task.getStart_point_code();
|
String start_point_code = taskdto.getStart_point_code();
|
||||||
String start_device_code = task.getStart_device_code();
|
String start_device_code = taskdto.getStart_device_code();
|
||||||
String route_plan_code = task.getRoute_plan_code();
|
String route_plan_code = taskdto.getRoute_plan_code();
|
||||||
String next_device_code = "";
|
String next_device_code = "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始平均分配
|
* 开始平均分配
|
||||||
*/
|
*/
|
||||||
String this_coevice_code = taskserver.queryAssignedByDevice(device_code, task.getNext_device_code());
|
String this_coevice_code = taskserver.queryAssignedByDevice(device_code, taskdto.getNext_device_code());
|
||||||
if (StrUtil.isEmpty(this_coevice_code)) {
|
if (StrUtil.isEmpty(this_coevice_code)) {
|
||||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, task.getNext_device_code(), route_plan_code);
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(start_device_code, taskdto.getNext_device_code(), route_plan_code);
|
||||||
RouteLineDto routeLineDto = shortPathsList.get(0);
|
RouteLineDto routeLineDto = shortPathsList.get(0);
|
||||||
|
|
||||||
String path = routeLineDto.getPath();
|
String path = routeLineDto.getPath();
|
||||||
@@ -490,16 +527,16 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
|
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
|
||||||
String next_point_code;
|
String next_point_code;
|
||||||
if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) {
|
if (StrUtil.equals(deviceAppservice.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||||
next_point_code = task.getTo_x() + "-" + task.getTo_y() + "-" + task.getTo_z();
|
next_point_code = taskdto.getTo_x() + "-" + taskdto.getTo_y() + "-" + taskdto.getTo_z();
|
||||||
} else {
|
} else {
|
||||||
next_point_code = next_device_code;
|
next_point_code = next_device_code;
|
||||||
}
|
}
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||||
instdto.setRoute_plan_code(route_plan_code);
|
instdto.setRoute_plan_code(route_plan_code);
|
||||||
instdto.setRemark(task.getRemark());
|
instdto.setRemark(taskdto.getRemark());
|
||||||
instdto.setMaterial(task.getMaterial());
|
instdto.setMaterial(taskdto.getMaterial());
|
||||||
instdto.setQuantity(task.getQuantity());
|
instdto.setQuantity(taskdto.getQuantity());
|
||||||
instdto.setTask_id(taskid);
|
instdto.setTask_id(taskid);
|
||||||
instdto.setTask_code(taskcode);
|
instdto.setTask_code(taskcode);
|
||||||
instdto.setVehicle_code(vehiclecode);
|
instdto.setVehicle_code(vehiclecode);
|
||||||
@@ -515,21 +552,21 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
instdto.setExecute_device_code(start_point_code);
|
instdto.setExecute_device_code(start_point_code);
|
||||||
instructionService.create(instdto);
|
instructionService.create(instdto);
|
||||||
//创建指令后修改任务状态
|
//创建指令后修改任务状态
|
||||||
task.setTask_status("1");
|
taskdto.setTask_status("1");
|
||||||
taskserver.update(task);
|
taskserver.update(taskdto);
|
||||||
|
|
||||||
|
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
|
|
||||||
if(StrUtil.isNotEmpty(task.getTo_z())){
|
if(StrUtil.isNotEmpty(taskdto.getTo_z())){
|
||||||
if(StrUtil.equals(task.getTo_z(),"01")){
|
if(StrUtil.equals(taskdto.getTo_z(),"01")){
|
||||||
map.put("code","to_target");
|
map.put("code","to_target");
|
||||||
map.put("value","102");
|
map.put("value","102");
|
||||||
} else if(StrUtil.equals(task.getTo_z(),"02")){
|
} else if(StrUtil.equals(taskdto.getTo_z(),"02")){
|
||||||
map.put("code","to_target");
|
map.put("code","to_target");
|
||||||
map.put("value","201");
|
map.put("value","201");
|
||||||
} else if(StrUtil.equals(task.getTo_z(),"03")){
|
} else if(StrUtil.equals(taskdto.getTo_z(),"03")){
|
||||||
map.put("code","to_target");
|
map.put("code","to_target");
|
||||||
map.put("value","301");
|
map.put("value","301");
|
||||||
}
|
}
|
||||||
@@ -544,7 +581,10 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
map3.put("value","1");
|
map3.put("value","1");
|
||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
|
if(task != Integer.parseInt(instdto.getInstruction_code()) ){
|
||||||
|
this.writing(list);
|
||||||
|
logServer.deviceExecuteLog(device_code, "", "", instdto.getInstruction_code() + "再次下发电气信号");
|
||||||
|
}
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
applySucess = true;
|
applySucess = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -624,7 +664,6 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
} else if (this.getMode() == 3) {
|
} else if (this.getMode() == 3) {
|
||||||
mode = "运行中";
|
mode = "运行中";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.getAction() == 0) {
|
if (this.getAction() == 0) {
|
||||||
action = "禁止取放";
|
action = "禁止取放";
|
||||||
} else if (this.getAction() == 1) {
|
} else if (this.getAction() == 1) {
|
||||||
@@ -634,8 +673,6 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
} else if (this.getAction() == 3) {
|
} else if (this.getAction() == 3) {
|
||||||
action = "允许取放";
|
action = "允许取放";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (this.getMove() == 0) {
|
if (this.getMove() == 0) {
|
||||||
move = "无货";
|
move = "无货";
|
||||||
jo.put("hasGoods", false);
|
jo.put("hasGoods", false);
|
||||||
|
|||||||
@@ -231,8 +231,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
jo.put("countdown_house", hongXiangConveyorDeviceDriver.getCountdown_house());
|
jo.put("countdown_house", hongXiangConveyorDeviceDriver.getCountdown_house());
|
||||||
jo.put("countdown_min", hongXiangConveyorDeviceDriver.getCountdown_min());
|
jo.put("countdown_min", hongXiangConveyorDeviceDriver.getCountdown_min());
|
||||||
jo.put("countdown_sec", hongXiangConveyorDeviceDriver.getCountdown_sec());
|
jo.put("countdown_sec", hongXiangConveyorDeviceDriver.getCountdown_sec());
|
||||||
//温度需要除以100 待实现
|
//温度需要除以10
|
||||||
jo.put("temperature", hongXiangConveyorDeviceDriver.getTemperature());
|
jo.put("temperature", hongXiangConveyorDeviceDriver.getTemperature()/10);
|
||||||
jo.put("door", hongXiangConveyorDeviceDriver.getDoor());
|
jo.put("door", hongXiangConveyorDeviceDriver.getDoor());
|
||||||
jo.put("finish", hongXiangConveyorDeviceDriver.getFinish());
|
jo.put("finish", hongXiangConveyorDeviceDriver.getFinish());
|
||||||
jo.put("task", hongXiangConveyorDeviceDriver.getTask());
|
jo.put("task", hongXiangConveyorDeviceDriver.getTask());
|
||||||
@@ -532,15 +532,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
}
|
}
|
||||||
JSONObject start_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + start_device_code2 + "'").uniqueResult(0);
|
JSONObject start_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + start_device_code2 + "'").uniqueResult(0);
|
||||||
if (!ObjectUtil.isEmpty(start_device_json2)) {
|
if (!ObjectUtil.isEmpty(start_device_json2)) {
|
||||||
start_point_code2 = (String) start_device_json2.get("parent_storage_code") == null ? start_device_code2 : (String) start_device_json.get("storage_code");
|
start_point_code2 = (String) start_device_json2.get("parent_storage_code") == null ? start_device_code2 : (String) start_device_json2.get("storage_code");
|
||||||
}
|
}
|
||||||
JSONObject next_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + next_device_code2 + "'").uniqueResult(0);
|
JSONObject next_device_json2 = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + next_device_code2 + "'").uniqueResult(0);
|
||||||
if (!ObjectUtil.isEmpty(next_device_json2)) {
|
if (!ObjectUtil.isEmpty(next_device_json2)) {
|
||||||
next_point_code2 = (String) next_device_json2.get("parent_storage_code") == null ? next_device_code2 : (String) next_device_json.get("storage_code");
|
next_point_code2 = (String) next_device_json2.get("parent_storage_code") == null ? next_device_code2 : (String) next_device_json2.get("storage_code");
|
||||||
}
|
}
|
||||||
JSONObject put_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + put_device_code + "'").uniqueResult(0);
|
JSONObject put_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + put_device_code + "'").uniqueResult(0);
|
||||||
if (!ObjectUtil.isEmpty(put_device_json)) {
|
if (!ObjectUtil.isEmpty(put_device_json)) {
|
||||||
put_point_code = (String) put_device_json.get("parent_storage_code") == null ? put_device_code : (String) next_device_json.get("storage_code");
|
put_point_code = (String) put_device_json.get("parent_storage_code") == null ? put_device_code : (String) put_device_json.get("storage_code");
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotEmpty(start_point_code) && start_point_code.indexOf("-") > 0) {
|
if (StrUtil.isNotEmpty(start_point_code) && start_point_code.indexOf("-") > 0) {
|
||||||
String str[] = start_point_code.split("-");
|
String str[] = start_point_code.split("-");
|
||||||
@@ -707,11 +707,16 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
}
|
}
|
||||||
if (ObjectUtil.isEmpty(errArr)) {
|
if (ObjectUtil.isEmpty(errArr)) {
|
||||||
response.setStatus(200);
|
response.setStatus(200);
|
||||||
|
response.setMessage("success");
|
||||||
} else {
|
} else {
|
||||||
response.setStatus(400);
|
response.setStatus(400);
|
||||||
|
if(ObjectUtil.isNotEmpty(errArr)){
|
||||||
|
response.setMessage(errArr.getJSONObject(0).getString("message"));
|
||||||
|
} else {
|
||||||
|
response.setMessage("false");
|
||||||
|
}
|
||||||
|
response.setErrArr(errArr);
|
||||||
}
|
}
|
||||||
response.setMessage("success");
|
|
||||||
response.setErrArr(errArr);
|
|
||||||
log.info("createFromWms--------------:输出参数:" + JSON.toJSONString(response));
|
log.info("createFromWms--------------:输出参数:" + JSON.toJSONString(response));
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
|
|||||||
@@ -760,7 +760,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void finishAndCreateNextInst(Instruction dto) throws Exception {
|
public void finishAndCreateNextInst(Instruction dto) throws Exception {
|
||||||
dto = foramte(dto);
|
dto = foramte(dto);
|
||||||
String device_code = dto.getNext_device_code();
|
String device_code = dto.getNext_device_code();
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public class OpcUtl {
|
|||||||
|
|
||||||
if (!is_success) {
|
if (!is_success) {
|
||||||
// throw new BusinessException(message.toString());
|
// throw new BusinessException(message.toString());
|
||||||
|
System.out.println("下发信号失败:"+message.toString());
|
||||||
}
|
}
|
||||||
} catch (JIException arg7) {
|
} catch (JIException arg7) {
|
||||||
// throw new BusinessException(arg7);
|
// throw new BusinessException(arg7);
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ ENV = 'production'
|
|||||||
|
|
||||||
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置
|
||||||
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
|
||||||
VUE_APP_BASE_API = 'http://127.0.0.1:8010'
|
VUE_APP_BASE_API = 'http://10.1.3.90:8011'
|
||||||
# 如果接口是 http 形式, wss 需要改为 ws
|
# 如果接口是 http 形式, wss 需要改为 ws
|
||||||
VUE_APP_WS_API = 'ws://127.0.0.1:8010'
|
VUE_APP_WS_API = 'ws://10.1.3.90:8011'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ window.g = {
|
|||||||
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
|
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
|
||||||
},
|
},
|
||||||
prod: {
|
prod: {
|
||||||
VUE_APP_BASE_API: 'http://127.0.0.1:8010'
|
VUE_APP_BASE_API: 'http://10.1.3.90:8011'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,8 @@
|
|||||||
<el-table-column prop="priority" label="任务优先级" />
|
<el-table-column prop="priority" label="任务优先级" />
|
||||||
<el-table-column prop="start_point_code" label="起点" />
|
<el-table-column prop="start_point_code" label="起点" />
|
||||||
<el-table-column prop="next_point_code" label="终点" />
|
<el-table-column prop="next_point_code" label="终点" />
|
||||||
|
<el-table-column prop="start_point_code2" label="起点2" />
|
||||||
|
<el-table-column prop="next_point_code2" label="终点2" />
|
||||||
<el-table-column prop="matarial" label="物料" />
|
<el-table-column prop="matarial" label="物料" />
|
||||||
<el-table-column prop="quantity" label="数量" />
|
<el-table-column prop="quantity" label="数量" />
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
slot="left"
|
slot="left"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
|
:loading="loadingAlldiv"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
slot="left"
|
slot="left"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
|
:loading="loadingAutodiv"
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -177,6 +179,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
slot="left"
|
slot="left"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
|
:loading="loadingSetPoint"
|
||||||
type="warning"
|
type="warning"
|
||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
size="mini"
|
size="mini"
|
||||||
@@ -188,6 +191,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
slot="left"
|
slot="left"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
|
:loading="loadingSetAllPoint"
|
||||||
type="warning"
|
type="warning"
|
||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
:disabled="button5"
|
:disabled="button5"
|
||||||
@@ -282,6 +286,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
|
loadingAlldiv: false,
|
||||||
|
loadingAutodiv: false,
|
||||||
|
loadingSetPoint: false,
|
||||||
areatype: '',
|
areatype: '',
|
||||||
typedisable: false,
|
typedisable: false,
|
||||||
pointshow: false,
|
pointshow: false,
|
||||||
@@ -478,9 +485,13 @@ export default {
|
|||||||
// this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
|
// this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
this.loadingAlldiv = true
|
||||||
checkoutbill.allDiv(this.mstrow).then(res => {
|
checkoutbill.allDiv(this.mstrow).then(res => {
|
||||||
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
this.queryTableDtl()
|
this.queryTableDtl()
|
||||||
|
this.loadingAlldiv = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadingAlldiv = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
oneDiv() {
|
oneDiv() {
|
||||||
@@ -488,10 +499,14 @@ export default {
|
|||||||
// this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
|
// this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
this.loadingAutodiv = true
|
||||||
if (this.currentRow.iostorinvdtl_id !== null) {
|
if (this.currentRow.iostorinvdtl_id !== null) {
|
||||||
this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id
|
this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id
|
||||||
checkoutbill.allDivOne(this.mstrow).then(res => {
|
checkoutbill.allDivOne(this.mstrow).then(res => {
|
||||||
this.queryTableDtl()
|
this.queryTableDtl()
|
||||||
|
this.loadingAutodiv = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadingAutodiv = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -563,18 +578,20 @@ export default {
|
|||||||
this.crud.notify('任务已生成!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('任务已生成!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.loadingSetPoint = true
|
||||||
if (this.currentDis.iostorinvdis_id !== null) {
|
if (this.currentDis.iostorinvdis_id !== null) {
|
||||||
this.currentDis.point_code = this.form2.point_code
|
this.currentDis.point_code = this.form2.point_code
|
||||||
checkoutbill.oneSetPoint2(this.currentDis).then(res => {
|
checkoutbill.oneSetPoint2(this.currentDis).then(res => {
|
||||||
this.queryTableDdis(this.currentDis.iostorinvdtl_id)
|
this.queryTableDdis(this.currentDis.iostorinvdtl_id)
|
||||||
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
this.loadingSetPoint = false
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.currentDis.point_code = ''
|
this.currentDis.point_code = ''
|
||||||
|
this.loadingSetPoint = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
allSetPoint() {
|
allSetPoint() {
|
||||||
debugger
|
|
||||||
if (this.form2.point_code === '') {
|
if (this.form2.point_code === '') {
|
||||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return
|
return
|
||||||
@@ -583,11 +600,14 @@ export default {
|
|||||||
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.loadingSetAllPoint = true
|
||||||
this.currentRow.point_code = this.form2.point_code
|
this.currentRow.point_code = this.form2.point_code
|
||||||
checkoutbill.allSetPoint(this.currentRow).then(res => {
|
checkoutbill.allSetPoint(this.currentRow).then(res => {
|
||||||
this.queryTableDdis(this.currentRow.iostorinvdtl_id)
|
this.queryTableDdis(this.currentRow.iostorinvdtl_id)
|
||||||
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('设置成功!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
|
this.loadingSetAllPoint = false
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
this.loadingSetAllPoint = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
queryTableDtl() {
|
queryTableDtl() {
|
||||||
|
|||||||
@@ -195,6 +195,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
slot="right"
|
slot="right"
|
||||||
class="filter-item"
|
class="filter-item"
|
||||||
|
:loading="loadingConfirm"
|
||||||
type="warning"
|
type="warning"
|
||||||
:disabled="confirm_flag"
|
:disabled="confirm_flag"
|
||||||
icon="el-icon-check"
|
icon="el-icon-check"
|
||||||
@@ -327,6 +328,7 @@ export default {
|
|||||||
del: ['admin', 'checkoutbill:del']
|
del: ['admin', 'checkoutbill:del']
|
||||||
},
|
},
|
||||||
openMoneyDialog: false,
|
openMoneyDialog: false,
|
||||||
|
loadingConfirm: false,
|
||||||
divShow: false,
|
divShow: false,
|
||||||
taskShow: false,
|
taskShow: false,
|
||||||
dis_flag: true,
|
dis_flag: true,
|
||||||
@@ -437,9 +439,13 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
|
this.loadingConfirm = true
|
||||||
checkoutbill.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
checkoutbill.confirm({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
|
||||||
this.querytable()
|
this.querytable()
|
||||||
this.crud.notify('出库成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('出库成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.loadingConfirm = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.loadingConfirm = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
querytable() {
|
querytable() {
|
||||||
|
|||||||
Reference in New Issue
Block a user