add:堆垛机任务数量控制
This commit is contained in:
@@ -696,7 +696,13 @@ public class AppearanceInspectionScannerConveyorDeviceDriver extends AbstractOpc
|
|||||||
this.requireTime = currentTimeMillis;
|
this.requireTime = currentTimeMillis;
|
||||||
LOCK.lock();
|
LOCK.lock();
|
||||||
try {
|
try {
|
||||||
|
List<TaskDto> taskDtoBusys = taskService.findInstsByNextDeviceCode(deviceCode);
|
||||||
Device cacheDevice = deviceAppService.findDeviceByCode(deviceCode);
|
Device cacheDevice = deviceAppService.findDeviceByCode(deviceCode);
|
||||||
|
Integer maxInstNum = Optional.ofNullable(cacheDevice.getExtraValue().get("maxInstNum")).map(Object::toString).map(Integer::parseInt).orElse(2);
|
||||||
|
if (taskDtoBusys.size() >= maxInstNum) {
|
||||||
|
this.unExecutedMessage = "查询出库任务,当前终点: " + deviceCode + ", 指令数量大于设定最大值: " + maxInstNum;
|
||||||
|
return;
|
||||||
|
}
|
||||||
List<String> checkoutStartDeviceCode = new ArrayList<>();
|
List<String> checkoutStartDeviceCode = new ArrayList<>();
|
||||||
if (cacheDevice.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) {
|
if (cacheDevice.getDeviceDriver() instanceof AppearanceInspectionScannerConveyorDeviceDriver) {
|
||||||
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) cacheDevice.getDeviceDriver();
|
AppearanceInspectionScannerConveyorDeviceDriver appearanceInspectionScannerConveyorDeviceDriver = (AppearanceInspectionScannerConveyorDeviceDriver) cacheDevice.getDeviceDriver();
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ public enum ErrorEnum {
|
|||||||
ERROR_35(35, "减速开关信号异常"),
|
ERROR_35(35, "减速开关信号异常"),
|
||||||
ERROR_36(36, "防撞开关被触碰"),
|
ERROR_36(36, "防撞开关被触碰"),
|
||||||
ERROR_37(37, "防撞激光被遮挡"),
|
ERROR_37(37, "防撞激光被遮挡"),
|
||||||
ERROR_38(38, "高货物禁止放入矮库位");
|
ERROR_38(38, "高货物禁止放入矮库位"),
|
||||||
|
ERROR_40(40, "水平定位曲线故障"),
|
||||||
|
ERROR_41(41, "起升定位曲线故障");
|
||||||
|
|
||||||
private int code;
|
private int code;
|
||||||
private String desc;
|
private String desc;
|
||||||
|
|||||||
@@ -589,4 +589,6 @@ public interface InstructionService extends CommonService<InstructionMybatis> {
|
|||||||
List<Instruction> findReadyInstByXDeviceCode(List<String> xDeviceCodeList, String noY);
|
List<Instruction> findReadyInstByXDeviceCode(List<String> xDeviceCodeList, String noY);
|
||||||
|
|
||||||
Instruction findByNextPointCode(String nextPointCode);
|
Instruction findByNextPointCode(String nextPointCode);
|
||||||
|
|
||||||
|
List<Instruction> findInstsByNextDeviceCode(String deviceCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1031,7 +1031,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
instdto.setPriority(acsTask.getPriority());
|
instdto.setPriority(acsTask.getPriority());
|
||||||
instdto.setInstruction_status(InstructionStatusEnum.READY.getIndex());
|
instdto.setInstruction_status(InstructionStatusEnum.READY.getIndex());
|
||||||
instdto.setExecute_device_code(dto.getNext_device_code());
|
instdto.setExecute_device_code(dto.getNext_device_code());
|
||||||
if (StrUtil.equals(instdto.getStart_device_code(),"3204")){
|
if (StrUtil.equals(instdto.getStart_device_code(), "3204")) {
|
||||||
instdto.setInstruction_type(InstTypeEnum.CTU_IN_TASK.getCode());
|
instdto.setInstruction_type(InstTypeEnum.CTU_IN_TASK.getCode());
|
||||||
instdto.setAgv_system_type(AgvSystemTypeEnum.HK_SYSTEM_TYPE.getCode());
|
instdto.setAgv_system_type(AgvSystemTypeEnum.HK_SYSTEM_TYPE.getCode());
|
||||||
}
|
}
|
||||||
@@ -1599,10 +1599,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
if (inst == null) {
|
if (inst == null) {
|
||||||
throw new BadRequestException("指令不存在");
|
throw new BadRequestException("指令不存在");
|
||||||
}
|
}
|
||||||
if (!StrUtil.equals(inst.getSend_status(),"2")){
|
if (!StrUtil.equals(inst.getSend_status(), "2")) {
|
||||||
throw new BadRequestException("该指令已成功执行,重新下发失败!");
|
throw new BadRequestException("该指令已成功执行,重新下发失败!");
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(inst.getAgv_system_type(),AgvSystemTypeEnum.XG_SYSTEM_TYPE.getCode())){
|
if (StrUtil.equals(inst.getAgv_system_type(), AgvSystemTypeEnum.XG_SYSTEM_TYPE.getCode())) {
|
||||||
UnifiedResponse<JSONObject> resp = xiangGongAgvService.sendOrderSequencesToXZ(inst);
|
UnifiedResponse<JSONObject> resp = xiangGongAgvService.sendOrderSequencesToXZ(inst);
|
||||||
if (!resp.isSuccess()) {
|
if (!resp.isSuccess()) {
|
||||||
inst.setRemark(resp.getMessage());
|
inst.setRemark(resp.getMessage());
|
||||||
@@ -1610,7 +1610,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
} else {
|
} else {
|
||||||
inst.setSend_status("1");
|
inst.setSend_status("1");
|
||||||
}
|
}
|
||||||
} else if (StrUtil.equals(inst.getAgv_system_type(),AgvSystemTypeEnum.HK_SYSTEM_TYPE.getCode())){
|
} else if (StrUtil.equals(inst.getAgv_system_type(), AgvSystemTypeEnum.HK_SYSTEM_TYPE.getCode())) {
|
||||||
List<Map<String, String>> positionCodePath = new ArrayList<>();
|
List<Map<String, String>> positionCodePath = new ArrayList<>();
|
||||||
if (StrUtil.equals(InstTypeEnum.CTU_IN_TASK.getCode(), inst.getInstruction_type())) {
|
if (StrUtil.equals(InstTypeEnum.CTU_IN_TASK.getCode(), inst.getInstruction_type())) {
|
||||||
StorageCell storageCell = storageCellService.getOne(new LambdaQueryWrapper<StorageCell>().eq(StorageCell::getStorage_code, inst.getNext_point_code()));
|
StorageCell storageCell = storageCellService.getOne(new LambdaQueryWrapper<StorageCell>().eq(StorageCell::getStorage_code, inst.getNext_point_code()));
|
||||||
@@ -2406,4 +2406,13 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
|||||||
.orElse(null);
|
.orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Instruction> findInstsByNextDeviceCode(String deviceCode) {
|
||||||
|
return Optional.ofNullable(this.instructions)
|
||||||
|
.orElse(new CopyOnWriteArrayList<>())
|
||||||
|
.stream()
|
||||||
|
.filter(inst -> inst.getNext_device_code().equals(deviceCode))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -408,4 +408,7 @@ public interface TaskService extends CommonService<Task> {
|
|||||||
TaskDto findFrontBindTask(TaskDto frontTask, String backNoY);
|
TaskDto findFrontBindTask(TaskDto frontTask, String backNoY);
|
||||||
|
|
||||||
void cancelNoSendWms(String task_id);
|
void cancelNoSendWms(String task_id);
|
||||||
|
|
||||||
|
|
||||||
|
List<TaskDto> findInstsByNextDeviceCode(String deviceCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1535,4 +1535,14 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
|||||||
//移除任务缓存信息
|
//移除任务缓存信息
|
||||||
this.removeByCodeFromCache(entity.getTask_code());
|
this.removeByCodeFromCache(entity.getTask_code());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TaskDto> findInstsByNextDeviceCode(String deviceCode) {
|
||||||
|
return Optional.ofNullable(this.tasks)
|
||||||
|
.orElse(new CopyOnWriteArrayList<>())
|
||||||
|
.stream()
|
||||||
|
.filter(taskDto -> taskDto.getNext_device_code().equals(deviceCode))
|
||||||
|
.filter(taskDto -> taskDto.getTask_status().equals(TaskStatusEnum.BUSY.getIndex()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,8 +204,14 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="自动申请AGV任务:" label-width="150px">
|
<el-form-item label="最大指令数量:" label-width="100px">
|
||||||
<el-switch v-model="form.applyTask" />
|
<!-- <el-switch v-model="form.applyTask" />-->
|
||||||
|
<el-input
|
||||||
|
v-model.number="form.maxInstNum"
|
||||||
|
type="number"
|
||||||
|
:min="1"
|
||||||
|
:step="1"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</span>
|
</span>
|
||||||
@@ -512,7 +518,8 @@ export default {
|
|||||||
samePoint: false,
|
samePoint: false,
|
||||||
scanApplyTask: false,
|
scanApplyTask: false,
|
||||||
applyTask: false,
|
applyTask: false,
|
||||||
isFront: false
|
isFront: false,
|
||||||
|
maxInstNum: 1
|
||||||
},
|
},
|
||||||
rules: {}
|
rules: {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user