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

View File

@@ -587,7 +587,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
.device_code("创建指令报错")
.content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage())
.build();
logDto.setLog_level(2);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
throw e;
}
@@ -765,7 +765,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
.device_code("创建指令报错")
.content("任务号" + dto.getTask_code() + "报错原因:" + e.getMessage())
.build();
logDto.setLog_level(2);
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
throw e;
}
@@ -1188,7 +1188,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
this.create(instdto);
} catch (Exception e) {
e.printStackTrace();
log.error("完成并创建下一条指令", e.getMessage());
log.error("完成并创建下一条指令{}", e.getMessage());
}
}
@@ -1251,7 +1251,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
this.create(instdto);
} catch (Exception e) {
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.route.service.RouteLineService;
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.TaskTypeEnum;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.common.utils.CodeUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.config.SpringContextHolder;
import org.nl.config.lucene.service.LuceneExecuteLogService;
@@ -134,6 +136,9 @@ public class AutoCreateInst {
Instruction instdto = new Instruction();
instdto.setInstruction_type(task_type);
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.setRemark(acsTask.getRemark());
instdto.setMaterial(acsTask.getMaterial());