Browse Source

fix:查询仙工任务记录数据量太大

master
gengby 1 year ago
parent
commit
7133ca2a00
  1. 23
      hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java
  2. 2
      hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java
  3. 11
      hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java

23
hd/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/AgvServiceImpl.java

@ -638,7 +638,7 @@ public class AgvServiceImpl implements AgvService {
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT);
agvurl = agvurl + ":" + agvport + "/orders?page=1&size=9999";
agvurl = agvurl + ":" + agvport + "/orders?page=1&size=100&orderBy=createTime";
HttpResponse result = HttpRequest.get(agvurl)
.timeout(20000)//超时,毫秒
@ -659,7 +659,7 @@ public class AgvServiceImpl implements AgvService {
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT);
agvurl = agvurl + ":" + agvport + "/orders?page=1&size=9999";
agvurl = agvurl + ":" + agvport + "/orders?page=1&size=100&orderBy=createTime";
HttpResponse result = HttpRequest.get(agvurl)
.timeout(20000)//超时,毫秒
@ -771,8 +771,7 @@ public class AgvServiceImpl implements AgvService {
//1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
@Override
public synchronized String process(String jobno, String type, String address, String action, String processingVehicle)
{
public synchronized String process(String jobno, String type, String address, String action, String processingVehicle) {
{
log.info("查询到AGV请求参数,jobno:{},address:{}", jobno + ",address:" + address + ",type:" + type + ",action:" + action);
//释放AGV资源,继续后续动作
@ -802,10 +801,10 @@ public class AgvServiceImpl implements AgvService {
//
if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) {
standardManipulatorStackingSiteDeviceDriver = (StandardManipulatorStackingSiteDeviceDriver) addressdevice.getDeviceDriver();
if(standardManipulatorStackingSiteDeviceDriver.getMove()==1){
if (standardManipulatorStackingSiteDeviceDriver.getMove() == 1) {
is_feedback = true;
} else {
log.info("设备{} 请求取货,光电信号:{}",addressdevice,standardManipulatorStackingSiteDeviceDriver.getMove());
log.info("设备{} 请求取货,光电信号:{}", addressdevice, standardManipulatorStackingSiteDeviceDriver.getMove());
}
}
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -815,10 +814,10 @@ public class AgvServiceImpl implements AgvService {
if ("PauseOnStation".equals(type)) {
if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) {
standardManipulatorStackingSiteDeviceDriver = (StandardManipulatorStackingSiteDeviceDriver) addressdevice.getDeviceDriver();
if(standardManipulatorStackingSiteDeviceDriver.getMove()==0){
if (standardManipulatorStackingSiteDeviceDriver.getMove() == 0) {
is_feedback = true;
} else {
log.info("设备{} 请求离开,光电信号:{}",addressdevice,standardManipulatorStackingSiteDeviceDriver.getMove());
log.info("设备{} 请求离开,光电信号:{}", addressdevice, standardManipulatorStackingSiteDeviceDriver.getMove());
}
}
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -832,10 +831,10 @@ public class AgvServiceImpl implements AgvService {
if ("EntryRequired".equals(type)) {
if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) {
standardManipulatorStackingSiteDeviceDriver = (StandardManipulatorStackingSiteDeviceDriver) addressdevice.getDeviceDriver();
if(standardManipulatorStackingSiteDeviceDriver.getMove()==0){
if (standardManipulatorStackingSiteDeviceDriver.getMove() == 0) {
is_feedback = true;
} else {
log.info("设备{} 请求放货,光电信号:{}",addressdevice,standardManipulatorStackingSiteDeviceDriver.getMove());
log.info("设备{} 请求放货,光电信号:{}", addressdevice, standardManipulatorStackingSiteDeviceDriver.getMove());
}
}
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
@ -845,10 +844,10 @@ public class AgvServiceImpl implements AgvService {
if ("PauseOnStation".equals(type)) {
if (addressdevice.getDeviceDriver() instanceof StandardManipulatorStackingSiteDeviceDriver) {
standardManipulatorStackingSiteDeviceDriver = (StandardManipulatorStackingSiteDeviceDriver) addressdevice.getDeviceDriver();
if(standardManipulatorStackingSiteDeviceDriver.getMove()==1){
if (standardManipulatorStackingSiteDeviceDriver.getMove() == 1) {
is_feedback = true;
} else {
log.info("设备{} 请求离开,光电信号:{}",addressdevice,standardManipulatorStackingSiteDeviceDriver.getMove());
log.info("设备{} 请求离开,光电信号:{}", addressdevice, standardManipulatorStackingSiteDeviceDriver.getMove());
}
}
if (addressdevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {

2
hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java

@ -40,7 +40,7 @@ public class AgvToAcsServiceImpl implements AgvToAcsService {
//logServer.log("", "waitpointRequest", "erro", param.toString(), String.valueOf(map), "400", "api/agv/waitpointRequest", "");
throw new BadRequestException("请求失败,指令为空!");
}
log.info("任务号:{},请求成功!", inst_code);
log.info("任务号:{},AGV请求ACS接口成功!", inst_code);
//logServer.log(inst_code, "waitpointRequest", "info", param.toString(), String.valueOf(map) + "请求等待点!", "200", "api/agv/waitpointRequest", "");
String task_code = instructionDto.getTask_code();
Map<String, Object> feedMap = new HashMap();

11
hd/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvTaskStatus.java

@ -1,6 +1,6 @@
package org.nl.modules.quartz.task;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
@ -8,22 +8,14 @@ import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.nl.acs.agv.server.AgvService;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device.service.dto.DeviceDto;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.ext.wms.service.AcsToWmsZDService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.utils.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 查询AGV任务状态
*/
@ -60,6 +52,7 @@ public class QueryXZAgvTaskStatus {
//子任务状态 待以后处理
JSONArray blocks = JSONArray.fromObject(one.get("blocks"));
String state = one.getString("state");
log.info("查询到的指令号:{},车号:{}", inst_code, one.getString("vehicle"));
if (!StrUtil.isEmpty(one.getString("vehicle"))) {
String carno = one.getString("vehicle");
inst.setCarno(carno);

Loading…
Cancel
Save