Merge remote-tracking branch 'origin/master'

# Conflicts:
#	acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
This commit is contained in:
2024-06-21 09:05:59 +08:00
9 changed files with 127 additions and 55 deletions

View File

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

View File

@@ -224,7 +224,6 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (inst != null) {
if (StrUtil.equals(inst.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) {
try {
TaskDto dto = taskserver.findByCode(inst.getTask_code());
Map<String, Object> map = new LinkedHashMap<>();
/*if (ObjectUtil.isNotEmpty(dto)){
String interaction_json = dto.getInteraction_json();
@@ -257,11 +256,11 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (mode == 0) {
this.setIsonline(false);
message = LangProcess.msg("universal_off-line");
message = "universal_off-line";
//有报警
} else if (error != 0) {
this.setIserror(true);
message = LangProcess.msg("universal_message3");
message = "universal_message3";
//无报警
} else {
this.setIsonline(true);
@@ -337,6 +336,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
//放货工位
List<String> putDeviceCodeList = this.getExtraDeviceCodes("put_device_code");
TaskDto task = null;
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
for (int i = 0; i < getDeviceCodeList.size(); i++) {
String startDeviceCode = getDeviceCodeList.get(i);
List<TaskDto> taskDtos = taskserver.queryTaskByDeviceCodeAndStatus(startDeviceCode);
@@ -344,6 +344,22 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
//按照优先级排序 优先级相等按照创建时间排序
taskDtos = this.sortTask(taskDtos);
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());
String startCode = instruction.getStart_device_code();
String nextCode = instruction.getNext_device_code();
@@ -380,12 +396,20 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
}
}
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();
Device device = deviceAppService.findDeviceByCode(nextDeviceCode);
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0 && plugPullDeviceSiteDeviceDriver.getAction() != 1)
Device next_device = deviceAppService.findDeviceByCode(nextDeviceCode);
if (next_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) next_device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
}
String taskId = task.getTask_id();
@@ -393,11 +417,9 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String vehicleCode = task.getVehicle_code();
String priority = task.getPriority();
String startPointCode = task.getStart_point_code();
String startDeviceCode = task.getStart_device_code();
String routePlanCode = task.getRoute_plan_code();
String nextPointCode = task.getNext_point_code();
Instruction instdto = new Instruction();
instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRoute_plan_code(routePlanCode);
@@ -680,8 +702,8 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
map.put("is_click", true);
map.put("message", message);
map.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError())));
map.put("notCreateTaskMessage", notCreateTaskMessage);
map.put("notCreateInstMessage", notCreateInstMessage);
map.put("notCreateTaskMessage", LangProcess.msg(notCreateTaskMessage));
map.put("notCreateInstMessage", LangProcess.msg(notCreateInstMessage));
/*jo.put("x", xPosition);
jo.put("y", yPosition);*/
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())) {
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 now = DateUtil.now();
if (StrUtil.isEmpty(dto.getRoute_plan_code())) {
@@ -582,14 +592,22 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
if (StrUtil.isEmpty(dto.getLink_num())) {
dto.setIs_send(task.getLink_num());
}
if (task.getTask_type().equals(CommonFinalParam.ONE) || "2".equals(task.getTask_type())) {
dto.setInstruction_type(task.getTask_type());
} else if (false) {
} else {
dto.setInstruction_type("3");
}
// if (task.getTask_type().equals(CommonFinalParam.ONE) || task.getTask_type().equals("2")) {
dto.setInstruction_type(task.getTask_type());
// } else if (false) {
//
// } else {
// 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(dto.getCompound_inst(), "0")
@@ -598,12 +616,8 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
dto.setCompound_inst_data(task.getCompound_task_data());
}
}
if (StringUtils.isNotBlank(currentUsername)) {
dto.setCreate_by(currentUsername);
}
if (StringUtils.isNotBlank(currentUsername)) {
dto.setUpdate_by(currentUsername);
}
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
dto.setUpdate_time(now);
dto.setCreate_time(now);
dto.setStart_parent_code(task.getStart_parent_code());
@@ -615,7 +629,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
Device startdevice = appService.findDeviceByCode(dto.getStart_device_code());
Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code());
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
@@ -626,7 +639,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
}
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 route_plan_code = task.getRoute_plan_code();
List<RouteLineDto> shortPathsList =
@@ -683,7 +696,6 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
luceneExecuteLogService.deviceExecuteLog(logDto);
throw e;
}
InstructionMybatis entity = ConvertUtil.convert(dto, InstructionMybatis.class);
instructionMapper.insert(entity);
instructions.add(dto);

View File

@@ -906,6 +906,8 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
String next_point_code2 = acsTask.getNext_point_code2();
String agv_system_type = acsTask.getAgv_system_type();
String task_type = acsTask.getTask_type();
String start_height = acsTask.getStart_height();
String next_height = acsTask.getNext_height();
/** 开始平均分解校验 */
String this_device_code =
this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
@@ -967,31 +969,37 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
instdto.setNext_device_code2(next_point_code2);
instdto.setNext_point_code2(next_point_code2);
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
// 1、生箔 Itype=1:取空,取满,放空,放满;
// 2、分切 Itype=3取满、取空、放满、放空
// 3、普通任务 Itype=2:取货、放货;
// 4、叉车任务
// 5、输送任务
// 6、行架
// 7、立库
if (StrUtil.equals(task_type, "1")) {
instdto.setAgv_inst_type("1");
//1、生箔 Itype=1:取空,取满,放空,放满;
//2、分切 Itype=3取满、取空、放满、放空
//3、普通任务 Itype=2:取货、放货;
//4、叉车任务
//5、输送任务
//6、行架
//7、立库
if (StrUtil.equals(task_type, CommonFinalParam.ONE)) {
instdto.setAgv_inst_type(CommonFinalParam.ONE);
} else if (StrUtil.equals(task_type, "3")) {
instdto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) {
instdto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) {
instdto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + acsTask.getTask_code() + ",task_type:" + acsTask.getTask_type());
}
} else {
instdto.setAgv_inst_type("4");
}
instructionservice.create2(instdto);
acsTask.setTask_status(CommonFinalParam.ONE);
this.update(acsTask);
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_notCreateInstMessage7=\u6258\u76D8\u7C7B\u578B\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_actionMessage2=\u5141\u8BB8\u53D6\u653E
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_notCreateInstMessage5=Instructions with the same route exist!
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_actionMessage2=Pick-and-place is allowed
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_notCreateInstMessage5=Ada instruksi tentang rute yang sama!
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_actionMessage2=Pick-and-place diperbolehkan
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_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_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_notCreateInstMessage8=\u6761\u7801\u4E3A\u7A7A!

View File

@@ -1,5 +1,5 @@
<template>
<!--检测站点-->
<!--纸管抓取位-->
<div>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
@@ -30,6 +30,7 @@
v-model="plc_id"
placeholder="无"
clearable
filterable
@change="changePlc"
>
<el-option
@@ -131,8 +132,8 @@
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否输入物料" label-width="150px">
<el-switch v-model="form.input_material" />
<el-form-item label="是否需要光电" label-width="150px">
<el-switch v-model="form.input_move" />
</el-form-item>
</el-col>
</el-row>
@@ -221,6 +222,14 @@
/>
</template>
</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">
<template slot="header">
<el-link type="primary" :underline="false" @click.native="test_write1()">测试写</el-link>
@@ -432,6 +441,15 @@ export default {
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() {
testwrite(this.data2, this.opc_id).then(data => {
this.notify('操作成功!', 'success')