fix: 申请成功后下发命令、堆垛机报警重试
This commit is contained in:
@@ -1,11 +1,9 @@
|
|||||||
package org.nl.acs.device_driver.one_conveyor.fold_disc_site;
|
package org.nl.acs.device_driver.one_conveyor.fold_disc_site;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpResponse;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -21,8 +19,6 @@ import org.nl.acs.device_driver.FeedLmsRealFailed;
|
|||||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||||
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.device_driver.led.led_screen.LedScreenDeviceDriver;
|
|
||||||
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO;
|
|
||||||
import org.nl.acs.enums.StorageTypeEnum;
|
import org.nl.acs.enums.StorageTypeEnum;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
import org.nl.acs.history.ErrorUtil;
|
import org.nl.acs.history.ErrorUtil;
|
||||||
@@ -39,10 +35,8 @@ import org.nl.acs.route.service.RouteLineService;
|
|||||||
import org.nl.acs.route.service.dto.RouteLineDto;
|
import org.nl.acs.route.service.dto.RouteLineDto;
|
||||||
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
import org.nl.acs.route.service.impl.RouteLineServiceImpl;
|
||||||
import org.nl.acs.task.enums.TaskStatusEnum;
|
import org.nl.acs.task.enums.TaskStatusEnum;
|
||||||
import org.nl.acs.task.enums.TaskTypeEnum;
|
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
import org.nl.common.exception.BadRequestException;
|
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
import org.nl.config.language.LangProcess;
|
import org.nl.config.language.LangProcess;
|
||||||
@@ -233,25 +227,15 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
|
|
||||||
//申请空托盘入库
|
//申请空托盘入库
|
||||||
if (mode == 9 && move == 1 && !requireSucess){
|
if (mode == 9 && move == 1 && !requireSucess){
|
||||||
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType());
|
applyEmptyTask(StorageTypeEnum.DISKS_IN.getType(), mode);
|
||||||
List list1 = new ArrayList();
|
|
||||||
Map map = new HashMap();
|
|
||||||
map.put("code", "to_command");
|
|
||||||
map.put("value", 9);
|
|
||||||
list1.add(map);
|
|
||||||
this.writing(list1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//申请空托盘出库
|
//申请空托盘出库
|
||||||
if (mode == 8 && move == 1 && !requireSucess){
|
if (mode == 8 && move == 1 && !requireSucess){
|
||||||
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType());
|
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(),mode);
|
||||||
List list1 = new ArrayList();
|
|
||||||
Map map = new HashMap();
|
|
||||||
map.put("code", "to_command");
|
|
||||||
map.put("value", 8);
|
|
||||||
list1.add(map);
|
|
||||||
this.writing(list1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -543,7 +527,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyEmptyTask(String type) {
|
private void applyEmptyTask(String type, int mode) {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if (date.getTime() - this.require_apply_strangulation_time.getTime()
|
if (date.getTime() - this.require_apply_strangulation_time.getTime()
|
||||||
< (long) this.instruction_require_time_out) {
|
< (long) this.instruction_require_time_out) {
|
||||||
@@ -553,7 +537,6 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
try {
|
try {
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", device_code);
|
param.put("device_code", device_code);
|
||||||
param.put("vehicle_code", barcode);
|
|
||||||
param.put("container_type", container_type);
|
param.put("container_type", container_type);
|
||||||
param.put("type", type);
|
param.put("type", type);
|
||||||
LuceneLogDto logDto = LuceneLogDto.builder()
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
||||||
@@ -571,6 +554,12 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
.build();
|
.build();
|
||||||
logDto.setLog_level(4);
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||||
|
List list1 = new ArrayList();
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code", "to_command");
|
||||||
|
map.put("value", mode);
|
||||||
|
list1.add(map);
|
||||||
|
this.writing(list1);
|
||||||
this.requireSucess = true;
|
this.requireSucess = true;
|
||||||
}else {
|
}else {
|
||||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||||
|
|||||||
@@ -285,24 +285,14 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
List toInstructions;
|
List toInstructions;
|
||||||
//木箱入库申请入库任务
|
//木箱入库申请入库任务
|
||||||
if (mode == 6 && !requireSucess){
|
if (mode == 6 && !requireSucess){
|
||||||
applyIn(StorageTypeEnum.BOX_IN.getType());
|
applyIn(StorageTypeEnum.BOX_IN.getType(),mode);
|
||||||
List list1 = new ArrayList();
|
|
||||||
Map map = new HashMap();
|
|
||||||
map.put("code", "to_command");
|
|
||||||
map.put("value", 6);
|
|
||||||
list1.add(map);
|
|
||||||
this.writing(list1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//子卷入库申请入库任务
|
//子卷入库申请入库任务
|
||||||
if (mode == 7 && !requireSucess){
|
if (mode == 7 && !requireSucess){
|
||||||
applyIn(StorageTypeEnum.STORAGE.getType());
|
applyIn(StorageTypeEnum.STORAGE.getType(),mode);
|
||||||
List list1 = new ArrayList();
|
|
||||||
Map map = new HashMap();
|
|
||||||
map.put("code", "to_command");
|
|
||||||
map.put("value", 7);
|
|
||||||
list1.add(map);
|
|
||||||
this.writing(list1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//申请入库指令、异常位指令
|
//申请入库指令、异常位指令
|
||||||
@@ -385,7 +375,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyIn(String type) {
|
private void applyIn(String type, int mode) {
|
||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
if (date.getTime() - this.require_apply_strangulation_time.getTime()
|
if (date.getTime() - this.require_apply_strangulation_time.getTime()
|
||||||
< (long) this.instruction_require_time_out) {
|
< (long) this.instruction_require_time_out) {
|
||||||
@@ -411,6 +401,12 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
.content("木箱入库申请入库任务,参数,接口返回:" + jo)
|
.content("木箱入库申请入库任务,参数,接口返回:" + jo)
|
||||||
.build();
|
.build();
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||||
|
List list1 = new ArrayList();
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code", "to_command");
|
||||||
|
map.put("value", mode);
|
||||||
|
list1.add(map);
|
||||||
|
this.writing(list1);
|
||||||
this.requireSucess = true;
|
this.requireSucess = true;
|
||||||
}else {
|
}else {
|
||||||
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
LuceneLogDto logDto2 = LuceneLogDto.builder()
|
||||||
|
|||||||
@@ -804,12 +804,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
//维修解警后重新向堆垛机下发指令
|
//维修解警后重新向堆垛机下发指令
|
||||||
// Instruction instructionErro = checkInst();
|
Instruction instructionErro = checkInst();
|
||||||
// if (ObjectUtil.isNotEmpty(instructionErro)&&InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status())){
|
if (ObjectUtil.isNotEmpty(instructionErro)&&InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status())){
|
||||||
// List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
// pakagePLCData(list, String.valueOf(z),String.valueOf(x),String.valueOf(y),instructionErro.getExecute_code(),task);
|
pakagePLCData(list, String.valueOf(z),String.valueOf(x),String.valueOf(y),instructionErro.getExecute_code(),task);
|
||||||
// return true;
|
return true;
|
||||||
// }
|
}
|
||||||
|
|
||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
//暂停任务
|
//暂停任务
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import org.nl.acs.device.domain.Device;
|
|||||||
import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver;
|
import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver;
|
||||||
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.BoxPackageManipulatorDeviceDriver;
|
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.BoxPackageManipulatorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.conveyor.box_palletizing_manipulator.BoxPalletizingManipulatorDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.box_palletizing_manipulator.BoxPalletizingManipulatorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.paper_tube_device2.PaperTubeConveyor2DeviceDriver;
|
import org.nl.acs.device_driver.paper_tube_device2.PaperTubeConveyor2DeviceDriver;
|
||||||
@@ -619,6 +620,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
//子卷称重位
|
//子卷称重位
|
||||||
SubvolumeWeighingStationDriver subvolumeWeighingStationDriver;
|
SubvolumeWeighingStationDriver subvolumeWeighingStationDriver;
|
||||||
|
|
||||||
|
//拆叠盘位
|
||||||
|
FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver;
|
||||||
|
|
||||||
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
|
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver;
|
||||||
if (datas.size() == 0) {
|
if (datas.size() == 0) {
|
||||||
throw new BadRequestException("缺少输入参数!");
|
throw new BadRequestException("缺少输入参数!");
|
||||||
@@ -760,6 +764,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
jo.put("action", subvolumeWeighingStationDriver.getAction());
|
jo.put("action", subvolumeWeighingStationDriver.getAction());
|
||||||
jo.put("weight", subvolumeWeighingStationDriver.getWeight());
|
jo.put("weight", subvolumeWeighingStationDriver.getWeight());
|
||||||
jo.put("error", subvolumeWeighingStationDriver.getError());
|
jo.put("error", subvolumeWeighingStationDriver.getError());
|
||||||
|
}else if (device.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) {
|
||||||
|
foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) device.getDeviceDriver();
|
||||||
|
jo.put("device_code", parent_device_code);
|
||||||
|
jo.put("move", foldDiscSiteDeviceDriver.getMove());
|
||||||
|
jo.put("mode", foldDiscSiteDeviceDriver.getMode());
|
||||||
|
jo.put("qty", foldDiscSiteDeviceDriver.getQty());
|
||||||
|
jo.put("container_type", foldDiscSiteDeviceDriver.getContainer_type());
|
||||||
|
jo.put("error", foldDiscSiteDeviceDriver.getError());
|
||||||
} else {
|
} else {
|
||||||
jo.put("device_code", parent_device_code);
|
jo.put("device_code", parent_device_code);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user