rev:优化拔前行架任务下发以及手动创建指令

This commit is contained in:
2024-06-20 20:01:27 +08:00
parent 06e7f163e2
commit cdd51816fc
9 changed files with 188 additions and 64 deletions

View File

@@ -360,9 +360,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}*/ }*/
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 1) { if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code(); if (standardInspectSiteDeviceDriver.getMove() != 1) {
return false; notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
} }
} }
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
@@ -375,9 +377,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 0) { if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code(); if (standardInspectSiteDeviceDriver.getMove() != 0) {
return false; notCreateInstMessage = "手动创建指令未下发电气信号原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!指令号:" + instruction.getInstruction_code();
return false;
}
} }
} }
if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (nextdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
@@ -503,9 +507,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}*/ }*/
if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 1) { if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电无货,无法生成指令!"; if (standardInspectSiteDeviceDriver.getMove() != 1) {
return false; notCreateInstMessage = "就绪任务未创建指令原因->取货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电无货,无法生成指令!";
return false;
}
} }
} }
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
@@ -525,9 +531,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} }
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
if (standardInspectSiteDeviceDriver.getMove() != 0) { if (ObjectUtil.equal("true", standardInspectSiteDeviceDriver.getExtraValue().get("input_move"))) {
notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电有货,无法生成指令!"; if (standardInspectSiteDeviceDriver.getMove() != 0) {
return false; notCreateInstMessage = "就绪任务未创建指令原因->放货位-烘箱对接位:" + standardInspectSiteDeviceDriver.getDevicecode() + "光电有货,无法生成指令!";
return false;
}
} }
} }

View File

@@ -224,7 +224,6 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (inst != null) { if (inst != null) {
if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) { if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) {
try { try {
TaskDto dto = taskserver.findByCode(inst.getTask_code());
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
/*if (ObjectUtil.isNotEmpty(dto)){ /*if (ObjectUtil.isNotEmpty(dto)){
String interaction_json = dto.getInteraction_json(); String interaction_json = dto.getInteraction_json();
@@ -257,11 +256,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (mode == 0) { if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
message = LangProcess.msg("universal_off-line"); message = "universal_off-line";
//有报警 //有报警
} else if (error != 0) { } else if (error != 0) {
this.setIserror(true); this.setIserror(true);
message = LangProcess.msg("universal_message3"); message = "universal_message3";
//无报警 //无报警
} else { } else {
this.setIsonline(true); this.setIsonline(true);
@@ -337,6 +336,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
//放货工位 //放货工位
List<String> putDeviceCodeList = this.getExtraDeviceCodes("put_device_code"); List<String> putDeviceCodeList = this.getExtraDeviceCodes("put_device_code");
TaskDto task = null; TaskDto task = null;
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
for (int i = 0; i < getDeviceCodeList.size(); i++) { for (int i = 0; i < getDeviceCodeList.size(); i++) {
String startDeviceCode = getDeviceCodeList.get(i); String startDeviceCode = getDeviceCodeList.get(i);
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode); List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
@@ -344,6 +344,22 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
//按照优先级排序 优先级相等按照创建时间排序 //按照优先级排序 优先级相等按照创建时间排序
taskDtos = this.sortTask(taskDtos); taskDtos = this.sortTask(taskDtos);
TaskDto taskDto = taskDtos.get(0); TaskDto taskDto = taskDtos.get(0);
String startPoint = task.getStart_device_code();
Device startPointDevice = deviceAppService.findDeviceByCode(startPoint);
if (startPointDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startPointDevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
}
String nextDeviceCode = taskDto.getNext_device_code();
Device device = deviceAppService.findDeviceByCode(nextDeviceCode);
if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
}
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code()); Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
String startCode = instruction.getStart_device_code(); String startCode = instruction.getStart_device_code();
String nextCode = instruction.getNext_device_code(); String nextCode = instruction.getNext_device_code();
@@ -380,12 +396,20 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} }
} }
if (!ObjectUtil.isEmpty(task)) { if (!ObjectUtil.isEmpty(task)) {
String startDeviceCode = task.getStart_device_code();
Device start_device = deviceAppService.findDeviceByCode(startDeviceCode);
if (start_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) start_device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
}
String nextDeviceCode = task.getNext_device_code(); String nextDeviceCode = task.getNext_device_code();
Device device = deviceAppService.findDeviceByCode(nextDeviceCode); Device next_device = deviceAppService.findDeviceByCode(nextDeviceCode);
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver; if (next_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) next_device.getDeviceDriver();
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver(); if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0 && plugPullDeviceSiteDeviceDriver.getAction() != 1) notCreateInstMessage = "universal_notCreateInstMessage9";
return false; return false;
} }
String taskId = task.getTask_id(); String taskId = task.getTask_id();
@@ -393,11 +417,9 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String vehicleCode = task.getVehicle_code(); String vehicleCode = task.getVehicle_code();
String priority = task.getPriority(); String priority = task.getPriority();
String startPointCode = task.getStart_point_code(); String startPointCode = task.getStart_point_code();
String startDeviceCode = task.getStart_device_code();
String routePlanCode = task.getRoute_plan_code(); String routePlanCode = task.getRoute_plan_code();
String nextPointCode = task.getNext_point_code(); String nextPointCode = task.getNext_point_code();
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();
instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(routePlanCode); instdto.setRoute_plan_code(routePlanCode);
@@ -680,8 +702,8 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
map.put("is_click", true); map.put("is_click", true);
map.put("message", message); map.put("message", message);
map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
map.put("notCreateTaskMessage", notCreateTaskMessage); map.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage));
map.put("notCreateInstMessage", notCreateInstMessage); map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
/*jo.put("x", xPosition); /*jo.put("x", xPosition);
jo.put("y", yPosition);*/ jo.put("y", yPosition);*/
JSONObject jo = new JSONObject(map); JSONObject jo = new JSONObject(map);

View File

@@ -562,6 +562,16 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (regional(dto.getStart_device_code(), dto.getNext_device_code())) { if (regional(dto.getStart_device_code(), dto.getNext_device_code())) {
throw new BadRequestException(LangProcess.msg("error_regional_max")); throw new BadRequestException(LangProcess.msg("error_regional_max"));
} }
String start_device_code = dto.getStart_device_code();
if (StrUtil.isNotEmpty(dto.getTask_code())) {
List<InstructionMybatis> instructionMybatis = instructionMapper.selectList(Wrappers.lambdaQuery(InstructionMybatis.class)
.eq(InstructionMybatis::getTask_code, dto.getTask_code()));
if (CollUtil.isNotEmpty(instructionMybatis) && instructionMybatis.stream().anyMatch(inst -> inst.getStart_device_code()
.equals(start_device_code))) {
return;
}
}
String currentUsername = SecurityUtils.getCurrentNickName(); String currentUsername = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String now = DateUtil.now();
if (StrUtil.isEmpty(dto.getRoute_plan_code())) { if (StrUtil.isEmpty(dto.getRoute_plan_code())) {
@@ -582,14 +592,22 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (StrUtil.isEmpty(dto.getLink_num())) { if (StrUtil.isEmpty(dto.getLink_num())) {
dto.setIs_send(task.getLink_num()); dto.setIs_send(task.getLink_num());
} }
if (task.getTask_type().equals(CommonFinalParam.ONE) || "2".equals(task.getTask_type())) { // if (task.getTask_type().equals(CommonFinalParam.ONE) || task.getTask_type().equals("2")) {
dto.setInstruction_type(task.getTask_type()); dto.setInstruction_type(task.getTask_type());
} else if (false) { // } else if (false) {
//
} else { // } else {
dto.setInstruction_type("3"); // dto.setInstruction_type("3");
} // }
// 查询是否存在相同指令号
// if (!StrUtil.isEmpty(dto.getVehicle_code() )) {
// Instruction inst_dto = findByContainer(dto.getVehicle_code());
// if (inst_dto != null) {
// log.error("存在相同载具号任务,载具号"+dto.getVehicle_code());
// throw new BadRequestException("存在相同载具号任务!");
// }
// }
// 起点设备与终点设备相同则为初始指令 // 起点设备与终点设备相同则为初始指令
if (StrUtil.equals(task.getStart_device_code(), dto.getStart_device_code())) { if (StrUtil.equals(task.getStart_device_code(), dto.getStart_device_code())) {
if (!StrUtil.equals(dto.getCompound_inst(), "0") if (!StrUtil.equals(dto.getCompound_inst(), "0")
@@ -598,12 +616,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
dto.setCompound_inst_data(task.getCompound_task_data()); dto.setCompound_inst_data(task.getCompound_task_data());
} }
} }
if (StringUtils.isNotBlank(currentUsername)) { dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
dto.setCreate_by(currentUsername); dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
}
if (StringUtils.isNotBlank(currentUsername)) {
dto.setUpdate_by(currentUsername);
}
dto.setUpdate_time(now); dto.setUpdate_time(now);
dto.setCreate_time(now); dto.setCreate_time(now);
dto.setStart_parent_code(task.getStart_parent_code()); dto.setStart_parent_code(task.getStart_parent_code());
@@ -615,18 +629,12 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
Device startdevice = appService.findDeviceByCode(dto.getStart_device_code()); Device startdevice = appService.findDeviceByCode(dto.getStart_device_code());
Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code());
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver; StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("3", dto.getInstruction_code());
}
try { try {
String start_device_code = dto.getStart_device_code(); /*String start_device_code = dto.getStart_device_code();*/
String next_device_code = dto.getNext_device_code(); String next_device_code = dto.getNext_device_code();
String route_plan_code = task.getRoute_plan_code(); String route_plan_code = task.getRoute_plan_code();
List<RouteLineDto> shortPathsList = List<RouteLineDto> shortPathsList =
@@ -642,16 +650,30 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
break; break;
} }
} }
if (ObjectUtil.isEmpty(route) && !(start_device_code.equals(next_device_code))) { if (ObjectUtil.isEmpty(route) && (!start_device_code.equals(next_device_code))) {
throw new BadRequestException(LangProcess.msg("error_isNull", "route")); throw new BadRequestException(LangProcess.msg("error_isNull", "route"));
} }
if (StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) { if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE) && dto.getAgv_system_type().equals(AgvSystemTypeEnum.Two_NDC_System_Type.getIndex())) {
// 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统 // 0为输送、立库任务 1 1楼叉车系统 2 2楼1区域AGV系统 3 2楼2区域AGV系统
if (!StrUtil.equals(task.getAgv_system_type(), "0") if (!StrUtil.equals(task.getAgv_system_type(), "0")
&& ObjectUtil.isNotEmpty(task.getAgv_system_type())) { && ObjectUtil.isNotEmpty(task.getAgv_system_type())) {
NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class);
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto); log.warn("下发AGV指令数据," + "指令号:" + dto.getInstruction_code() + ",AGV系统类型:" + dto.getAgv_system_type()
+ ",AGV指令类型:" + dto.getInstruction_type());
try {
if (StrUtil.isEmpty(dto.getAgv_inst_type()) || StrUtil.isEmpty(dto.getAgv_system_type())) {
log.info("sendAgvInstToNDC 指令校验:" + dto.getInstruction_code() + ",inst_type:" + dto.getInstruction_type()
+ ",inst_system_type:" + dto.getAgv_system_type());
}
ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto);
} catch (Exception e) {
dto.setSend_status("2");
dto.setRemark(e.getMessage());
e.printStackTrace();
log.warn("下发AGV指令异常:" + e);
}
} else { } else {
// Boolean result = createLkInst(task.getStorage_task_type(),dto);
Resp resp = acsToLiKuService.sendInst(task.getStorage_task_type(), dto); Resp resp = acsToLiKuService.sendInst(task.getStorage_task_type(), dto);
if (StrUtil.equals(resp.result, "true")) { if (StrUtil.equals(resp.result, "true")) {
dto.setSend_status("1"); dto.setSend_status("1");
@@ -660,11 +682,53 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
} }
} }
} }
//判断是否是仙工AGV
if (shortPathsList.size() > 0 && StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
Device deviceByCode = deviceAppService.findDeviceByCode(dto.getStart_device_code());
// if (StrUtil.equals(task.getRequest_again_success(), "1")) {
// //追加订单
// HttpResponse result = xiangGongAgvService.addOrderSequences(dto);
// if (ObjectUtils.isEmpty(result) || result.getStatus() != 200) {
// dto.setSend_status("2");
// } else {
// dto.setSend_status("1");
// }
//
// } else
if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.XG_System_Type.getIndex())) {
String interactionJson = task.getInteraction_json();
if (StrUtil.isNotEmpty(interactionJson)){
throw new BadRequestException("agv叉车调整长宽参数为空");
}
InteractionJsonDTO interactionJsonDTO = JSON.parseObject(interactionJson, InteractionJsonDTO.class);
//仙工叉车
HttpResponse response = xiangGongAgvService.sendOrderSequencesToForklift(dto,interactionJsonDTO);
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
dto.setSend_status("2");
} else {
dto.setSend_status("1");
}
} else if (dto.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) {
//一楼agv任务创建运单序列
HttpResponse response = xiangGongAgvService.sendOrderSequencesToXZ(dto);
if (ObjectUtils.isEmpty(response) || response.getStatus() != 200) {
dto.setSend_status("2");
} else {
dto.setSend_status("1");
}
}
}
} catch (Exception e) { } catch (Exception e) {
dto.setSend_status("2"); dto.setSend_status("2");
e.printStackTrace(); log.error(e.getMessage());
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code("创建指令报错")
.content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage())
.build();
logDto.setLog_level(2);
luceneExecuteLogService.deviceExecuteLog(logDto);
throw e;
} }
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class); InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class);
instructionMapper.insert(entity); instructionMapper.insert(entity);
instructions.add(dto); instructions.add(dto);

View File

@@ -901,6 +901,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
String next_point_code2 = acsTask.getNext_point_code2(); String next_point_code2 = acsTask.getNext_point_code2();
String agv_system_type = acsTask.getAgv_system_type(); String agv_system_type = acsTask.getAgv_system_type();
String task_type = acsTask.getTask_type(); String task_type = acsTask.getTask_type();
String start_height = acsTask.getStart_height();
String next_height = acsTask.getNext_height();
/** 开始平均分解校验 */ /** 开始平均分解校验 */
String this_device_code = String this_device_code =
this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code()); this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
@@ -962,31 +964,37 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
instdto.setNext_device_code2(next_point_code2); instdto.setNext_device_code2(next_point_code2);
instdto.setNext_point_code2(next_point_code2); instdto.setNext_point_code2(next_point_code2);
instdto.setAgv_system_type(agv_system_type); instdto.setAgv_system_type(agv_system_type);
instdto.setAgv_inst_type(CommonFinalParam.ONE); instdto.setStart_height(start_height);
instdto.setNext_height(next_height);
if (!StrUtil.equals(agv_system_type, "1")) { //判断agv系统
//1、1楼叉车系统
//2、2楼1区域AGV系统
//3、2楼2区域AGV系统 -已废弃
if (StrUtil.equals(agv_system_type, CommonFinalParam.TWO)) {
// task_type // task_type
// 1、生箔 Itype=1:取空,取满,放空,放满; //1、生箔 Itype=1:取空,取满,放空,放满;
// 2、分切 Itype=3取满、取空、放满、放空 //2、分切 Itype=3取满、取空、放满、放空
// 3、普通任务 Itype=2:取货、放货; //3、普通任务 Itype=2:取货、放货;
// 4、叉车任务 //4、叉车任务
// 5、输送任务 //5、输送任务
// 6、行架 //6、行架
// 7、立库 //7、立库
if (StrUtil.equals(task_type, "1")) { if (StrUtil.equals(task_type, CommonFinalParam.ONE)) {
instdto.setAgv_inst_type("1"); instdto.setAgv_inst_type(CommonFinalParam.ONE);
} else if (StrUtil.equals(task_type, "3")) { } else if (StrUtil.equals(task_type, "3")) {
instdto.setAgv_inst_type("2"); instdto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) { } else if (StrUtil.equals(task_type, "2")) {
instdto.setAgv_inst_type("3"); instdto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) { } else if (StrUtil.equals(task_type, "8")) {
instdto.setAgv_inst_type("2"); instdto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + acsTask.getTask_code() + ",task_type:" + acsTask.getTask_type());
} }
} else { } else {
instdto.setAgv_inst_type("4"); instdto.setAgv_inst_type("4");
} }
instructionservice.create2(instdto); instructionservice.create2(instdto);
acsTask.setTask_status(CommonFinalParam.ONE); acsTask.setTask_status(CommonFinalParam.ONE);
this.update(acsTask); this.update(acsTask);
return instdto; return instdto;

View File

@@ -57,6 +57,7 @@ universal_notCreateInstMessage5=\u5B58\u5728\u76F8\u540C\u8DEF\u7EBF\u7684\u6307
universal_notCreateInstMessage6=\u4E0B\u4E00\u4E2A\u8BBE\u5907\u4E0D\u662F\u8F93\u9001\u7EBF\u6307\u4EE4! universal_notCreateInstMessage6=\u4E0B\u4E00\u4E2A\u8BBE\u5907\u4E0D\u662F\u8F93\u9001\u7EBF\u6307\u4EE4!
universal_notCreateInstMessage7=\u6258\u76D8\u7C7B\u578B\u4E3A\u7A7A! universal_notCreateInstMessage7=\u6258\u76D8\u7C7B\u578B\u4E3A\u7A7A!
universal_notCreateInstMessage8=\u6761\u7801\u4E3A\u7A7A! universal_notCreateInstMessage8=\u6761\u7801\u4E3A\u7A7A!
universal_notCreateInstMessage9=\u63D2\u62D4\u8F74\u5DE5\u4F4D\u6761\u4EF6\u4E0D\u6EE1\u8DB3\uFF0C\u65E0\u6CD5\u751F\u6210\u6307\u4EE4!
universal_actionMessage1=\u4E0D\u5141\u8BB8\u53D6\u653E universal_actionMessage1=\u4E0D\u5141\u8BB8\u53D6\u653E
universal_actionMessage2=\u5141\u8BB8\u53D6\u653E universal_actionMessage2=\u5141\u8BB8\u53D6\u653E
universal_actionMessage3=\u5141\u8BB8\u79BB\u5F00 universal_actionMessage3=\u5141\u8BB8\u79BB\u5F00

View File

@@ -54,6 +54,7 @@ universal_notCreateInstMessage3=The device is in standby mode or is not allowed
universal_notCreateInstMessage4=ddj interface bit is in stock, cannot generate command! universal_notCreateInstMessage4=ddj interface bit is in stock, cannot generate command!
universal_notCreateInstMessage5=Instructions with the same route exist! universal_notCreateInstMessage5=Instructions with the same route exist!
universal_notCreateInstMessage6=The next device is not a conveyor line directive! universal_notCreateInstMessage6=The next device is not a conveyor line directive!
universal_notCreateInstMessage9=The plugging and unplugging shaft station conditions are not met, and the instruction cannot be generated!
universal_actionMessage1=Pick-and-place is not permitted universal_actionMessage1=Pick-and-place is not permitted
universal_actionMessage2=Pick-and-place is allowed universal_actionMessage2=Pick-and-place is allowed
universal_actionMessage3=Permission to leave universal_actionMessage3=Permission to leave

View File

@@ -54,6 +54,7 @@ universal_notCreateInstMessage3=Siaga perangkat atau tidak diizinkan masuk
universal_notCreateInstMessage4=DDJ mendarat di dok, tidak ada perintah yang diberikan! universal_notCreateInstMessage4=DDJ mendarat di dok, tidak ada perintah yang diberikan!
universal_notCreateInstMessage5=Ada instruksi tentang rute yang sama! universal_notCreateInstMessage5=Ada instruksi tentang rute yang sama!
universal_notCreateInstMessage6=Perangkat berikutnya bukan arahan jalur konveyor! universal_notCreateInstMessage6=Perangkat berikutnya bukan arahan jalur konveyor!
universal_notCreateInstMessage9=Kondisi stasiun poros penyumbatan dan pencabutan tidak terpenuhi, dan instruksi tidak dapat dibuat!
universal_actionMessage1=Pick-and-place tidak diizinkan universal_actionMessage1=Pick-and-place tidak diizinkan
universal_actionMessage2=Pick-and-place diperbolehkan universal_actionMessage2=Pick-and-place diperbolehkan
universal_actionMessage3=Izin untuk pergi universal_actionMessage3=Izin untuk pergi

View File

@@ -59,6 +59,7 @@ universal_notCreateInstMessage3=\u8BBE\u5907\u5F85\u673A\u6216\u4E0D\u5141\u8BB8
universal_notCreateInstMessage4=ddj\u5BF9\u63A5\u4F4D\u6709\u8D27,\u65E0\u6CD5\u751F\u6210\u6307\u4EE4! universal_notCreateInstMessage4=ddj\u5BF9\u63A5\u4F4D\u6709\u8D27,\u65E0\u6CD5\u751F\u6210\u6307\u4EE4!
universal_notCreateInstMessage5=\u5B58\u5728\u76F8\u540C\u8DEF\u7EBF\u7684\u6307\u4EE4! universal_notCreateInstMessage5=\u5B58\u5728\u76F8\u540C\u8DEF\u7EBF\u7684\u6307\u4EE4!
universal_notCreateInstMessage6=\u4E0B\u4E00\u4E2A\u8BBE\u5907\u4E0D\u662F\u8F93\u9001\u7EBF\u6307\u4EE4! universal_notCreateInstMessage6=\u4E0B\u4E00\u4E2A\u8BBE\u5907\u4E0D\u662F\u8F93\u9001\u7EBF\u6307\u4EE4!
universal_notCreateInstMessage9=\u63D2\u62D4\u8F74\u5DE5\u4F4D\u6761\u4EF6\u4E0D\u6EE1\u8DB3\uFF0C\u65E0\u6CD5\u751F\u6210\u6307\u4EE4!
universal_notCreateInstMessage7=\u6258\u76D8\u7C7B\u578B\u4E3A\u7A7A! universal_notCreateInstMessage7=\u6258\u76D8\u7C7B\u578B\u4E3A\u7A7A!
universal_notCreateInstMessage8=\u6761\u7801\u4E3A\u7A7A! universal_notCreateInstMessage8=\u6761\u7801\u4E3A\u7A7A!

View File

@@ -1,5 +1,5 @@
<template> <template>
<!--检测站点--> <!--纸管抓取位-->
<div> <div>
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
@@ -30,6 +30,7 @@
v-model="plc_id" v-model="plc_id"
placeholder="无" placeholder="无"
clearable clearable
filterable
@change="changePlc" @change="changePlc"
> >
<el-option <el-option
@@ -131,8 +132,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="是否输入物料" label-width="150px"> <el-form-item label="是否需要光电" label-width="150px">
<el-switch v-model="form.input_material" /> <el-switch v-model="form.input_move" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -221,6 +222,14 @@
/> />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="dbr_value2">
<template slot="header">
<el-link type="primary" :underline="false" @click.native="test_read2()">测试读</el-link>
</template>
<template slot-scope="scope">
<el-input v-model="data2[scope.$index].dbr_value" size="mini" class="edit-input" />
</template>
</el-table-column>
<el-table-column prop="dbw_value"> <el-table-column prop="dbw_value">
<template slot="header"> <template slot="header">
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link> <el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
@@ -432,6 +441,15 @@ export default {
console.log(err.response.data.message) console.log(err.response.data.message)
}) })
}, },
test_read2() {
testRead(this.data2, this.opc_id).then(data => {
this.data2 = data
console.log(this.data2)
this.notify('操作成功!', 'success')
}).catch(err => {
console.log(err.response.data.message)
})
},
test_write1() { test_write1() {
testwrite(this.data2, this.opc_id).then(data => { testwrite(this.data2, this.opc_id).then(data => {
this.notify('操作成功!', 'success') this.notify('操作成功!', 'success')