fix: 内包间优化

This commit is contained in:
2024-07-08 13:44:20 +08:00
parent 4f678392e0
commit 447c175049
11 changed files with 80 additions and 37 deletions

View File

@@ -12,6 +12,7 @@ import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.task.enums.ActionTypeEnum;
import org.nl.acs.task.enums.AgvActionTypeEnum;
import org.nl.acs.task.enums.AgvSystemTypeEnum;
import org.nl.common.exception.BadRequestException;
import org.nl.config.lucene.service.LuceneExecuteLogService;
@@ -129,7 +130,9 @@ public class AgvWaitUtil {
}
//诺宝agv调lms更新点位
if (inst.getAgv_system_type().equals(AgvSystemTypeEnum.One_NDC_System_Type.getIndex())) {
applyLmsGetOut(inst);
if (!AgvActionTypeEnum.ORDINARY.getCode().equals(inst.getAgv_action_type())) {
applyLmsGetOut(inst);
}
if (startDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) {
manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) startDevice.getDeviceDriver();
if (manipulatorAgvStationDeviceDriver.getTo_command() != 3) {

View File

@@ -11,14 +11,19 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device_driver.agv.xg_agv_car.XgAgvCarDeviceDriver;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.task.domain.Task;
import org.nl.acs.task.enums.AgvActionTypeEnum;
import org.nl.acs.task.enums.AgvSystemTypeEnum;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.config.SpringContextHolder;
import org.nl.system.service.param.ISysParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
@@ -31,6 +36,10 @@ import java.util.stream.Collectors;
@Component("queryAGVStatus")
public class QueryAGVStatus {
@Autowired
private DeviceAppService deviceAppService;
public void run() {
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
TaskService taskService = SpringContextHolder.getBean(TaskService.class);
@@ -64,6 +73,7 @@ public class QueryAGVStatus {
//执行中
String state = json.getString("state");
String carNo = json.getString("vehicle");
String instructionCode = json.getString("id");
if ("RUNNING".equals(state) || "CREATED".equals(state) || "TOBEDISPATCHED".equals(state) || "WAITING".equals(state)) {
instruction.setInstruction_status("1");
instruction.setCarno(carNo);
@@ -73,6 +83,15 @@ public class QueryAGVStatus {
task.setTask_id(instruction.getTask_id());
instructionService.update(instruction);
taskService.update(task);
if (StrUtil.isNotEmpty(instructionCode)){
Device carCode = deviceAppService.findDeviceByCode(instructionCode);
XgAgvCarDeviceDriver xgAgvCarDeviceDriver;
if (carCode.getDeviceDriver() instanceof XgAgvCarDeviceDriver){
xgAgvCarDeviceDriver = (XgAgvCarDeviceDriver) carCode.getDeviceDriver();
xgAgvCarDeviceDriver.setTaskType(AgvActionTypeEnum.getStatus(instruction.getAgv_action_type()));
}
}
} else if ("FINISHED".equals(state)) {
instruction.setInstruction_status("2");
try {

View File

@@ -936,7 +936,7 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue();
String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue();
agvurl = agvurl + ":" + agvport + "/" + " robotsStatus?vehicles=" + robotCode;
agvurl = agvurl + ":" + agvport + "/" + "robotsStatus?vehicles=" + robotCode;
log.info("根据指定机器人查询状态的请求:{}", agvurl);
HttpResponse result = HttpRequest.get(agvurl)
.timeout(20000)//超时,毫秒

View File

@@ -180,6 +180,11 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device
*/
private int unlock = 0;
/**
* agv二次分配类型1、普通任务 2、取货二次分配 3、防货二次分配 4、取放货二次分配
*/
private String taskType = "";
String device_code = null;
String container;
@@ -241,8 +246,10 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device
map.put("low_battery", low_battery ? "低电量": "正常");
map.put("suspended", suspended ? "订单被暂停,需要人工手动恢复": "正常");
map.put("message", message);
map.put("agv_task_type", taskType);
map.put("unconfirmed_reloc", unconfirmed_reloc ? "未确认定位" : "正常");
map.put("unlock", unlock == 0 ? "控制权在core手上" : unlock == 1 ? "控制权被其他人抢走" : unlock == 2 ?"控制权没有被抢占" : "未知");
JSONObject jo = new JSONObject(map);
return jo;
}

View File

@@ -17,11 +17,9 @@ import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.FeedLmsRealFailed;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.manipulator_cache.ManipulatorCacheDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.trapped_manipulator.InteractionJsonDTO;
import org.nl.acs.enums.VolumeTwoTypeEnum;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
@@ -47,7 +45,6 @@ import org.nl.config.SpringContextHolder;
import org.nl.config.language.LangProcess;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.*;
import java.util.stream.Collectors;
@@ -200,7 +197,14 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
}
//四个点行架任务满轴放货完成后调lms生成rgv任务
if (action == 6 && task > 0 ){
creatAGV();
Integer actionType = ActionTypeEnum.RELEASE_FINISHING.getCode();
creatAGV(actionType,action);
}
//空载具取货完成
if (action == 7 && task > 0 ){
Integer actionType = ActionTypeEnum.IN_FINISHING.getCode();
creatAGV(actionType, action);
}
} catch (Exception var17) {
@@ -274,14 +278,14 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
last_to_type = to_type;
}
private void creatAGV() {
private void creatAGV(Integer actionType, int toCommand) {
Instruction instruction = checkInst();
JSONObject param = new JSONObject();
param.put("taskCode", instruction.getTask_code());
param.put("actionType",ActionTypeEnum.RELEASE_FINISHING.getCode() );
param.put("actionType",actionType );
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("满轴放货完成请求lms,参数:" + task + "--" +ActionTypeEnum.RELEASE_FINISHING.getStatus())
.content("行架取放货完成请求lms,参数:" + task + "--" +ActionTypeEnum.RELEASE_FINISHING.getStatus())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
@@ -290,25 +294,25 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi
if (jo.getInteger("status") == 200) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("满轴放货完成请求lms,参数,接口返回:" + jo)
.content("行架取放货完成请求lms,参数,接口返回:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
Map<String, Object> map1 = new HashMap<>();
List list = new ArrayList();
map1.put("code", "to_command");
map1.put("value", 6);
map1.put("value", toCommand);
list.add(map1);
this.writing(list);
} else {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("满轴放货完成请求lms,返回参数:" + jo)
.content("行架取放货完成请求lms,返回参数:" + jo)
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
throw new BadRequestException("满轴放货完成请求lms返回失败");
throw new BadRequestException("行架取放货完成请求lms返回失败");
}
}

View File

@@ -26,9 +26,9 @@ public enum ActionTypeEnum {
*/
RELEASE_FINISHING(4, "满轴放货完成");
Integer code;
String status;
public static String getStatus(Integer code) {
for (ActionTypeEnum value : values()) {
if (value.code.equals(code)) {

View File

@@ -51,6 +51,7 @@ public class AutoCleanLucenceLog {
String endDate = DateUtil.format(calendar.getTime(), "yyyy-MM-dd HH:mm:ss.SSS");
TermRangeQuery termRangeQuery = new TermRangeQuery("logTime", new BytesRef(startDate), new BytesRef(endDate), true, true);
writer.deleteDocuments(termRangeQuery);
writer.commit();
writer.close();
}
}

View File

@@ -139,7 +139,8 @@ export default {
'Core_error_identifier': 'Core error identifier',
'Current_command_information': 'Current command information',
'The_signal_is_successfully_marked': 'The signal is successfully marked',
'Complement_information': 'Complement information'
'Complement_information': 'Complement information',
'agv_task_type': 'task type'
}
}
}

View File

@@ -139,7 +139,8 @@ export default {
'Core_error_identifier': 'Pengenal kesalahan inti',
'Current_command_information': 'Informasi perintah saat ini',
'The_signal_is_successfully_marked': 'Sinyal berhasil ditandai',
'Complement_information': 'Informasi pelengkap'
'Complement_information': 'Informasi pelengkap',
'agv_task_type': 'Jenis tugas'
}
}
}

View File

@@ -139,7 +139,8 @@ export default {
'Core_error_identifier': 'Core出错标识位',
'Current_command_information': '当前指令信息',
'The_signal_is_successfully_marked': '信号成功标记',
'Complement_information': '补码信息'
'Complement_information': '补码信息',
'agv_task_type': '任务类型'
}
}
}

View File

@@ -9,7 +9,7 @@
/>
</el-select>
<el-row>
<div id="container" className="container" style="min-height: 100%" />
<div id="container" className="container" style="min-height: 100%"/>
</el-row>
<!--点击设备显示信息-->
<el-dialog
@@ -41,10 +41,10 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.bar_code')" label-width="120px">
<el-input v-model="form.hand_barcode" :disabled="false" />
<el-input v-model="form.hand_barcode" :disabled="false"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.request_flag')" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -62,7 +62,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible3" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="80px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.device_status')" label-width="80px">
<el-radio-group v-model="form.hasGoodStatus">
@@ -72,7 +72,7 @@
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('monitor.click.material_code')" prop="material_type" label-width="80px">
<el-input v-model="form.material_type" />
<el-input v-model="form.material_type"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -85,7 +85,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible4" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.disabled_manipulator')" prop="is_disable" label-width="120px">
<el-radio-group v-model="form.is_disable">
@@ -109,7 +109,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible5" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.request_flag')" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -127,10 +127,10 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible7" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.bar_code')" label-width="120px">
<el-input v-model="form.hand_barcode" :disabled="false" />
<el-input v-model="form.hand_barcode" :disabled="false"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.request_flag')" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -154,7 +154,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible6" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item label="申请指令标记" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -179,11 +179,11 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible1" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="80px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.bar_code')" prop="device_code" label-width="80px">
<el-input v-model="form.barcode" :disabled="false" />
<el-input v-model="form.barcode" :disabled="false"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -196,7 +196,7 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible8" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.job_command')" prop="toCommand" label-width="120px">
<el-radio-group v-model="form.toCommand">
@@ -206,13 +206,13 @@
</el-radio-group>
</el-form-item>
<el-form-item :label="$t('monitor.click.keep_out_of_storage')" prop="prohibitInWarehouse" label-width="120px">
<el-switch v-model="form.prohibitInWarehouse" />
<el-switch v-model="form.prohibitInWarehouse"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.no_release')" prop="prohibitOutWarehouse" label-width="120px">
<el-switch v-model="form.prohibitOutWarehouse" />
<el-switch v-model="form.prohibitOutWarehouse"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.stop_task')" prop="stopReceiveTask" label-width="120px">
<el-switch v-model="form.stopReceiveTask" />
<el-switch v-model="form.stopReceiveTask"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.requireSucess')" prop="applySucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -229,13 +229,13 @@
<el-dialog :title="$t('monitor.click.device_setup')" :visible.sync="dialogFormVisible10" width="35%">
<el-form :model="form" size="small">
<el-form-item :label="$t('monitor.click.equipment_number')" prop="device_code" label-width="120px">
<el-input v-model="form.device_code" :disabled="true" />
<el-input v-model="form.device_code" :disabled="true"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.bar_code')" label-width="120px">
<el-input v-model="form.hand_barcode" :disabled="false" />
<el-input v-model="form.hand_barcode" :disabled="false"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.material_code')" label-width="120px">
<el-input v-model="form.hand_material_barcode" :disabled="false" />
<el-input v-model="form.hand_material_barcode" :disabled="false"/>
</el-form-item>
<el-form-item :label="$t('monitor.click.request_flag')" prop="requireSucess" label-width="120px">
<el-radio-group v-model="form.requireSucess">
@@ -779,7 +779,10 @@ export default {
const obj = { name: i18n.t('monitor.click.Whether_or_not_in_the_scene'), value: data[val] }
this.arr.push(obj)
} else if (val === 'disconnect') {
const obj = { name: i18n.t('monitor.click.Whether_or_not_the_connection_is_disconnected'), value: data[val] }
const obj = {
name: i18n.t('monitor.click.Whether_or_not_the_connection_is_disconnected'),
value: data[val]
}
this.arr.push(obj)
} else if (val === 'low_battery') {
const obj = { name: i18n.t('monitor.click.The_state_of_the_robots_battery_level'), value: data[val] }
@@ -799,6 +802,9 @@ export default {
} else if (val === 'type') {
const obj = { name: i18n.t('opc.table_title.type'), value: data[val] }
this.arr.push(obj)
} else if (val === 'agv_task_type') {
const obj = { name: i18n.t('monitor.click.agv_task_type'), value: data[val] }
this.arr.push(obj)
}
}
}