rev:现场测试优化

This commit is contained in:
2025-01-27 09:29:49 +08:00
parent fc7ed902a1
commit bd646840ea
3 changed files with 32 additions and 25 deletions

View File

@@ -229,8 +229,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} }
//反馈重量 //反馈重量
if (mode == 3 && action == 5 && move == 0 && StrUtil.isNotEmpty(sub_volume_no) && !requireSucess) { if (mode == 3 && action == 5 && move == 0 && weight > 0 && StrUtil.isNotEmpty(sub_volume_no) && !requireSucess) {
logServer.deviceExecuteLog(this.device_code,"","","反馈重量"); logServer.deviceExecuteLog(this.device_code, "", "", "反馈重量");
ApplyfeedbackSubVolumeWeightRequest applyfeedbackSubVolumeWeightRequest = new ApplyfeedbackSubVolumeWeightRequest(); ApplyfeedbackSubVolumeWeightRequest applyfeedbackSubVolumeWeightRequest = new ApplyfeedbackSubVolumeWeightRequest();
ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse; ApplyfeedbackSubVolumeWeightResponse applyfeedbackSubVolumeWeightResponse;
applyfeedbackSubVolumeWeightRequest.setSub_volume(sub_volume_no); applyfeedbackSubVolumeWeightRequest.setSub_volume(sub_volume_no);
@@ -247,7 +247,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(this.device_code, "", "", "反馈重量,参数:" + param); logServer.deviceExecuteLog(this.device_code, "", "", "反馈重量,参数:" + param);
applyfeedbackSubVolumeWeightResponse = acsToWmsService.applyfeedbackSubVolumeWeight(applyfeedbackSubVolumeWeightRequest); applyfeedbackSubVolumeWeightResponse = acsToWmsService.applyfeedbackSubVolumeWeight(applyfeedbackSubVolumeWeightRequest);
if(applyfeedbackSubVolumeWeightResponse.getCode() == CommonFinalParam.STATUS_OPEN){ if (applyfeedbackSubVolumeWeightResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
//todo:反馈重量 //todo:反馈重量
map.put("to_command", "5"); map.put("to_command", "5");
@@ -259,13 +259,13 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
logDto2.setLog_level(4); logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2); luceneExecuteLogService.deviceExecuteLog(logDto2);
this.requireSucess = true; this.requireSucess = true;
}else{ } else {
LuceneLogDto logDto1 = LuceneLogDto.builder() LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content("反馈LMS子卷重量失败:"+ applyfeedbackSubVolumeWeightResponse.getData()) .content("反馈LMS子卷重量失败:" + applyfeedbackSubVolumeWeightResponse.getData())
.build(); .build();
logDto1.setLog_level(4); logDto1.setLog_level(4);
message = "反馈LMS子卷重量失败:"+ applyfeedbackSubVolumeWeightResponse.getMessage(); message = "反馈LMS子卷重量失败:" + applyfeedbackSubVolumeWeightResponse.getMessage();
luceneExecuteLogService.deviceExecuteLog(logDto1); luceneExecuteLogService.deviceExecuteLog(logDto1);
} }
} else { } else {
@@ -279,10 +279,10 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
if (move != 1) { if (move != 1) {
feedMessage = feedMessage + "move不为有货状态,"; feedMessage = feedMessage + "move不为有货状态,";
} }
if(StrUtil.isEmpty(sub_volume_no)){ if (StrUtil.isEmpty(sub_volume_no)) {
feedMessage = feedMessage + "子卷号为空,"; feedMessage = feedMessage + "子卷号为空,";
} }
if(requireSucess){ if (requireSucess) {
feedMessage = feedMessage + "请求动作未复位!"; feedMessage = feedMessage + "请求动作未复位!";
} }
} }
@@ -338,7 +338,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} else { } else {
if (mode == 2) { if (mode == 2) {
//if (!requireSucess) { //if (!requireSucess) {
String remark = "";; String remark = "";
;
if (mode != 2) { if (mode != 2) {
remark = remark + "工作模式(mode)不是待机状态,"; remark = remark + "工作模式(mode)不是待机状态,";
} }
@@ -502,12 +503,13 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
instructionService.create(instdto); instructionService.create(instdto);
} catch (Exception e) { } catch (Exception e) {
notCreateInstMessage = e.getMessage(); notCreateInstMessage = e.getMessage();
LuceneLogDto logDto = LuceneLogDto.builder() LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code) .device_code(device_code)
.content(device_code+"创建指令时出现异常:" + e.getMessage()) .content(device_code + "创建指令时出现异常:" + e.getMessage())
.build(); .build();
logDto.setLog_level(3); logDto.setLog_level(3);
luceneExecuteLogService.deviceExecuteLog(logDto); return false; luceneExecuteLogService.deviceExecuteLog(logDto);
return false;
} }
//创建指令后修改任务状态 //创建指令后修改任务状态
task.setTask_status(TaskStatusEnum.BUSY.getIndex()); task.setTask_status(TaskStatusEnum.BUSY.getIndex());
@@ -546,8 +548,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} }
private void toDevice(String toOrder,String signal,Map map){ private void toDevice(String toOrder, String signal, Map map) {
if(ObjectUtil.isNotEmpty(toOrder)){ if (ObjectUtil.isNotEmpty(toOrder)) {
map.put(signal, toOrder); map.put(signal, toOrder);
} }
} }
@@ -645,14 +647,14 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
action = LangProcess.msg("universal_releasing"); action = LangProcess.msg("universal_releasing");
} else if (this.getAction() == 4) { } else if (this.getAction() == 4) {
action = LangProcess.msg("universal_releasing_completed"); action = LangProcess.msg("universal_releasing_completed");
}else if (this.getAction() == 5){ } else if (this.getAction() == 5) {
action = "反馈子卷重量"; action = "反馈子卷重量";
}else if (this.getAction() == 0){ } else if (this.getAction() == 0) {
action = "无动作"; action = "无动作";
} }
if(error == 0 && this.itemProtocol.isError){ if (error == 0 && this.itemProtocol.isError) {
iserror = true; iserror = true;
}else if(error == 0 && !(this.itemProtocol.isError)){ } else if (error == 0 && !(this.itemProtocol.isError)) {
iserror = false; iserror = false;
} }
map.put("device_name", this.getDevice().getDevice_name()); map.put("device_name", this.getDevice().getDevice_name());

View File

@@ -587,7 +587,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
.device_code("创建指令报错") .device_code("创建指令报错")
.content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage()) .content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage())
.build(); .build();
logDto.setLog_level(2); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
throw e; throw e;
} }
@@ -765,7 +765,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
.device_code("创建指令报错") .device_code("创建指令报错")
.content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage()) .content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage())
.build(); .build();
logDto.setLog_level(2); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
throw e; throw e;
} }
@@ -1188,7 +1188,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
this.create(instdto); this.create(instdto);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("完成并创建下一条指令", e.getMessage()); log.error("完成并创建下一条指令{}", e.getMessage());
} }
} }
@@ -1251,7 +1251,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
this.create(instdto); this.create(instdto);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("完成并创建下一条指令", e.getMessage()); log.error("完成并创建下一条指令{}", e.getMessage());
} }
} }

View File

@@ -20,10 +20,12 @@ import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.route.service.RouteLineService; 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.task.enums.AgvSystemTypeEnum;
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.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.utils.CodeUtil;
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.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.LuceneExecuteLogService;
@@ -134,6 +136,9 @@ public class AutoCreateInst {
Instruction instdto = new Instruction(); Instruction instdto = new Instruction();
instdto.setInstruction_type(task_type); instdto.setInstruction_type(task_type);
instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setInstruction_id(IdUtil.simpleUUID());
if (acsTask.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())){
instdto.setInstruction_code(CodeUtil.getNewCode("INSTRUCT_NO"));
}
instdto.setRoute_plan_code(route_plan_code); instdto.setRoute_plan_code(route_plan_code);
instdto.setRemark(acsTask.getRemark()); instdto.setRemark(acsTask.getRemark());
instdto.setMaterial(acsTask.getMaterial()); instdto.setMaterial(acsTask.getMaterial());