rev:现场代码优化
This commit is contained in:
@@ -29,10 +29,18 @@ public interface TaskConfigService {
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param task_config_id ID
|
||||
* @return Address
|
||||
* @return TaskConfigDto
|
||||
*/
|
||||
TaskConfigDto findById(String task_config_id);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param startCode
|
||||
* @return TaskConfigDto
|
||||
*/
|
||||
TaskConfigDto findByStartCode(String startCode);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,6 +54,17 @@ public class TaskConfigServiceImpl implements TaskConfigService {
|
||||
return obj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaskConfigDto findByStartCode(String startCode) {
|
||||
WQLObject wo = WQLObject.getWQLObject("task_config");
|
||||
JSONObject json = wo.query("point_code1 ='" + startCode + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(json)) {
|
||||
return null;
|
||||
}
|
||||
final TaskConfigDto obj = json.toJavaObject(TaskConfigDto.class);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void create(TaskConfigDto dto) {
|
||||
|
||||
@@ -156,7 +156,6 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
public void execute() {
|
||||
|
||||
try {
|
||||
Thread.sleep(2000);
|
||||
this.devicecode = this.getDevice().getDevice_code();
|
||||
if (this.reqTakeRequireSuccess && ObjectUtil.isNotEmpty(this.reqTakeInstCode)) {
|
||||
Instruction instruction = instructionService.findByCodeFromCache(this.reqTakeInstCode);
|
||||
|
||||
@@ -140,7 +140,6 @@ public class StandardOrdinarySiteDeviceDriver extends AbstractDeviceDriver imple
|
||||
@Override
|
||||
public void execute() {
|
||||
try {
|
||||
Thread.sleep(2000);
|
||||
this.devicecode = this.getDevice().getDevice_code();
|
||||
if (this.reqTakeRequireSuccess && ObjectUtil.isNotEmpty(this.reqTakeInstCode)) {
|
||||
Instruction instruction = instructionService.findByCodeFromCache(this.reqTakeInstCode);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package org.nl.acs.ext.wms.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.modules.layout.mapLayout.dto.AgvStatus;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface NDCToAcsService {
|
||||
|
||||
@@ -10,4 +13,11 @@ public interface NDCToAcsService {
|
||||
* @return
|
||||
*/
|
||||
JSONObject agvCallback(JSONObject requestParam) throws Exception;
|
||||
|
||||
/**
|
||||
* 查询所有AGV
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map<String, AgvStatus> findAllAgvFromCache();
|
||||
}
|
||||
|
||||
@@ -19,9 +19,14 @@ 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.modules.layout.mapLayout.dto.AgvStatus;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -34,6 +39,8 @@ public class NDCToAcsServiceImpl implements NDCToAcsService {
|
||||
@Autowired
|
||||
private DeviceAppService deviceAppService;
|
||||
|
||||
Map<String, AgvStatus> AGVDeviceStatus = new HashMap();
|
||||
|
||||
@Override
|
||||
public JSONObject agvCallback(JSONObject requestParam) throws Exception{
|
||||
JSONObject resp = new JSONObject();
|
||||
@@ -99,10 +106,30 @@ public class NDCToAcsServiceImpl implements NDCToAcsService {
|
||||
case RELEASE_COMPLETE:
|
||||
if (TaskPhaseEnum.PICKUP_REQUEST_OR_RESPONSE.getValue().equals(taskPhase) || TaskPhaseEnum.PICKUP_COMPLETE.getValue().equals(taskPhase)){
|
||||
device = deviceAppService.findDeviceByCode(instruction.getStart_point_code());
|
||||
AgvStatus agvStatus = AgvStatus.builder()
|
||||
.carId(instruction.getCarno())
|
||||
.action(TaskPhaseEnum.PICKUP_REQUEST_OR_RESPONSE.getValue().equals(taskPhase)?"AGV请求取货上报" : "AGV取货完成上报")
|
||||
.actionInfo(TaskPhaseEnum.PICKUP_REQUEST_OR_RESPONSE.getValue().equals(taskPhase)?"AGV请求取货上报" : "AGV取货完成上报").build();
|
||||
if (AGVDeviceStatus.containsKey(instruction.getCarno())){
|
||||
AGVDeviceStatus.remove(instruction.getCarno());
|
||||
AGVDeviceStatus.put(instruction.getCarno(),agvStatus);
|
||||
}else {
|
||||
AGVDeviceStatus.put(instruction.getCarno(),agvStatus);
|
||||
}
|
||||
}
|
||||
//taskPhase 请求放货上报,放货完成上报
|
||||
if (TaskPhaseEnum.RELEASE_REQUEST_OR_RESPONSE.getValue().equals(taskPhase)||TaskPhaseEnum.RELEASE_COMPLETE.getValue().equals(taskPhase)){
|
||||
device = deviceAppService.findDeviceByCode(instruction.getNext_point_code());
|
||||
AgvStatus agvStatus = AgvStatus.builder()
|
||||
.carId(instruction.getCarno())
|
||||
.action(TaskPhaseEnum.RELEASE_REQUEST_OR_RESPONSE.getValue().equals(taskPhase)?"AGV请求放货上报":"AGV放货完成上报")
|
||||
.actionInfo(TaskPhaseEnum.RELEASE_REQUEST_OR_RESPONSE.getValue().equals(taskPhase)?"AGV请求放货上报":"AGV放货完成上报").build();
|
||||
if (AGVDeviceStatus.containsKey(instruction.getCarno())){
|
||||
AGVDeviceStatus.remove(instruction.getCarno());
|
||||
AGVDeviceStatus.put(instruction.getCarno(),agvStatus);
|
||||
}else {
|
||||
AGVDeviceStatus.put(instruction.getCarno(),agvStatus);
|
||||
}
|
||||
}
|
||||
if (device == null){
|
||||
resp.put("code", "400");
|
||||
@@ -183,6 +210,17 @@ public class NDCToAcsServiceImpl implements NDCToAcsService {
|
||||
else if (MsgTypeEnum.AGV_POWER_RPT.getValue().equals(type)){
|
||||
int agvId = params.getIntValue("agvId");
|
||||
int stateValue = params.getIntValue("stateValue");
|
||||
AgvStatus agvStatus = AgvStatus.builder()
|
||||
.carId(String.valueOf(agvId))
|
||||
.action("AGV电量上报")
|
||||
.actionInfo("AGV电量上报")
|
||||
.power(stateValue).build();
|
||||
if (AGVDeviceStatus.containsKey(String.valueOf(agvId))){
|
||||
AGVDeviceStatus.remove(String.valueOf(agvId));
|
||||
AGVDeviceStatus.put(String.valueOf(agvId),agvStatus);
|
||||
}else {
|
||||
AGVDeviceStatus.put(String.valueOf(agvId),agvStatus);
|
||||
}
|
||||
resp.put("code", "200");
|
||||
resp.put("message", "更新指令执行中成功");
|
||||
log.info("---响应kit请求---"+resp.toString());
|
||||
@@ -195,6 +233,22 @@ public class NDCToAcsServiceImpl implements NDCToAcsService {
|
||||
int yLocation = params.getIntValue("yLocation");
|
||||
int angle = params.getIntValue("angle");
|
||||
int speed = params.getIntValue("speed");
|
||||
AgvStatus agvStatus = AgvStatus.builder()
|
||||
.status(String.valueOf(stateValue))
|
||||
.carId(String.valueOf(agvId))
|
||||
.action("AGV状态上报")
|
||||
.actionInfo("AGV状态上报")
|
||||
.icon("/Users/mima0000/Desktop/car.png")
|
||||
.fileId("3029")
|
||||
.x(new Random().nextInt(1189) + 100)
|
||||
.y(new Random().nextInt(1189) + 100)
|
||||
.angle(new Random().nextInt(160) + 10).build();
|
||||
if (AGVDeviceStatus.containsKey(String.valueOf(agvId))){
|
||||
AGVDeviceStatus.remove(String.valueOf(agvId));
|
||||
AGVDeviceStatus.put(String.valueOf(agvId),agvStatus);
|
||||
}else {
|
||||
AGVDeviceStatus.put(String.valueOf(agvId),agvStatus);
|
||||
}
|
||||
resp.put("code", "200");
|
||||
resp.put("message", "更新指令执行中成功");
|
||||
log.info("---响应kit请求---"+resp.toString());
|
||||
@@ -213,4 +267,9 @@ public class NDCToAcsServiceImpl implements NDCToAcsService {
|
||||
log.info("---响应kit请求---"+resp.toString());
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, AgvStatus> findAllAgvFromCache() {
|
||||
return AGVDeviceStatus;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.dto.TaskQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -135,8 +136,8 @@ public class TaskController {
|
||||
@ApiOperation("导出任务")
|
||||
@GetMapping(value = "/download")
|
||||
//@PreAuthorize("@el.check('task:list')")
|
||||
public void download(HttpServletResponse response, Map whereJson) throws IOException {
|
||||
taskService.download(taskService.queryAll(whereJson), response);
|
||||
public void download(HttpServletResponse response, TaskQuery query) throws IOException {
|
||||
taskService.download1(query, response);
|
||||
}
|
||||
|
||||
@Log("一体机触发任务")
|
||||
|
||||
@@ -5,6 +5,7 @@ package org.nl.acs.task.service;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.dto.TaskQuery;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -26,7 +27,7 @@ public interface TaskService {
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
Map<String, Object> queryAll(Map whereJson,Pageable page);
|
||||
|
||||
/**
|
||||
* 在缓存中查询所有任务列表
|
||||
@@ -66,7 +67,7 @@ public interface TaskService {
|
||||
* @param whereJson 条件参数
|
||||
* @return List<AcsTaskDto>
|
||||
*/
|
||||
List<TaskDto> queryAll(Map whereJson);
|
||||
List<TaskDto> queryAll(TaskQuery query);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
@@ -349,4 +350,5 @@ public interface TaskService {
|
||||
|
||||
List<TaskDto> queryAllByCache();
|
||||
|
||||
void download1(TaskQuery query, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.acs.task.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class TaskQuery implements Serializable {
|
||||
private String task_code;
|
||||
private String vehicle_code;
|
||||
private String material_type;
|
||||
private String status;
|
||||
private String point_code;
|
||||
private String createTime;
|
||||
private String end_time;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.task.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
@@ -35,6 +36,7 @@ import org.nl.acs.task.TaskInstructionLock;
|
||||
import org.nl.acs.task.service.TaskFeedbackService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.dto.TaskQuery;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
@@ -281,10 +283,41 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaskDto> queryAll(Map whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_task");
|
||||
JSONArray arr = wo.query().getResultJSONArray(0);
|
||||
List<TaskDto> list = arr.toJavaList(TaskDto.class);
|
||||
public List<TaskDto> queryAll(TaskQuery query) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "2");
|
||||
String task_code = query.getTask_code();
|
||||
String vehicle_code = query.getVehicle_code();
|
||||
String material_type = query.getMaterial_type();
|
||||
String status = query.getStatus();
|
||||
String point_code = query.getPoint_code();
|
||||
String create_time = query.getCreateTime();
|
||||
String end_time = query.getEnd_time();
|
||||
if (!StrUtil.isEmpty(task_code)) {
|
||||
map.put("task_code", task_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(vehicle_code)) {
|
||||
map.put("vehicle_code", vehicle_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(material_type)) {
|
||||
map.put("material_type", material_type);
|
||||
}
|
||||
if (!StrUtil.isEmpty(status)) {
|
||||
map.put("status", status);
|
||||
}
|
||||
if (!StrUtil.isEmpty(point_code)) {
|
||||
map.put("point_code", point_code);
|
||||
}
|
||||
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
|
||||
map.put("create_time", create_time);
|
||||
map.put("end_time", end_time);
|
||||
}
|
||||
JSONObject jsonObject1 =
|
||||
WQL.getWO("QTASK_QUERY")
|
||||
.addParamMap(map)
|
||||
.pageQuery(0,1000, "create_time desc");
|
||||
JSONArray array = jsonObject1.getJSONArray("content");
|
||||
List<TaskDto> list = array.toJavaList(TaskDto.class);
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -1693,4 +1726,28 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
public List<TaskDto> queryAllByCache() {
|
||||
return this.tasks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download1(TaskQuery query, HttpServletResponse response) throws IOException {
|
||||
List<TaskDto> taskDtos = taskService.queryAll(query);
|
||||
if (CollUtil.isEmpty(taskDtos)){
|
||||
throw new RuntimeException("没有数据!");
|
||||
}
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (int i = 0; i < taskDtos.size(); i++) {
|
||||
TaskDto taskDto = taskDtos.get(i);
|
||||
Device startDevice = deviceAppService.findDeviceByCode(taskDto.getStart_device_code());
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(taskDto.getNext_device_code());
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
mp.put("任务编号", taskDto.getTask_code());
|
||||
mp.put("起点编码", taskDto.getStart_device_code());
|
||||
mp.put("起点名称", startDevice.getDevice_name());
|
||||
mp.put("终点编码", taskDto.getNext_device_code());
|
||||
mp.put("终点名称", nextDevice.getDevice_name());
|
||||
mp.put("创建时间", taskDto.getCreate_time());
|
||||
mp.put("完成时间", taskDto.getUpdate_time());
|
||||
list.add(mp);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package org.nl.hand.rest;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.acs.device.service.TaskConfigService;
|
||||
import org.nl.acs.device.service.dto.TaskConfigDto;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.TableDataInfo;
|
||||
import org.nl.hand.service.PadService;
|
||||
@@ -27,6 +30,7 @@ import java.util.Map;
|
||||
public class PadController {
|
||||
|
||||
private final PadService padService;
|
||||
private final TaskConfigService taskConfigService;
|
||||
|
||||
@PostMapping("/list")
|
||||
@Log("任务列表")
|
||||
@@ -86,15 +90,27 @@ public class PadController {
|
||||
@PostMapping("/slj")
|
||||
@Log("三联件配送")
|
||||
public ResponseEntity<Object> sendSLJ(@RequestBody TaskPad taskPad) {
|
||||
HashMap<String,String> mapping = MapOf.of("E504020-04", "E504021-04", "E504021-04", "E504020-04",
|
||||
"E504020-02", "E504022-04", "E504020-02", "E504022-04");
|
||||
String point = taskPad.getPoint();
|
||||
String endPoint = mapping.get(point);
|
||||
if (StringUtils.isEmpty(endPoint)){
|
||||
TaskConfigDto taskConfigDto = taskConfigService.findByStartCode(point);
|
||||
if (ObjectUtil.isEmpty(taskConfigDto)){
|
||||
throw new BadRequestException(point+"当前点位没有对应映射点");
|
||||
}
|
||||
taskPad.setStart(point);
|
||||
taskPad.setEnd(endPoint);
|
||||
taskPad.setEnd(taskConfigDto.getPoint_code2());
|
||||
padService.callTask(taskPad);
|
||||
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/ycxb")
|
||||
@Log("油车线边配送")
|
||||
public ResponseEntity<Object> sendYCXB(@RequestBody TaskPad taskPad) {
|
||||
String point = taskPad.getPoint();
|
||||
TaskConfigDto taskConfigDto = taskConfigService.findByStartCode(point);
|
||||
if (ObjectUtil.isEmpty(taskConfigDto)){
|
||||
throw new BadRequestException(point+"当前点位没有对应映射点");
|
||||
}
|
||||
taskPad.setStart(point);
|
||||
taskPad.setEnd(taskConfigDto.getPoint_code2());
|
||||
padService.callTask(taskPad);
|
||||
return new ResponseEntity<>(TableDataInfo.build(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -199,30 +199,36 @@ public class PadServiceImpl implements PadService {
|
||||
|
||||
@Override
|
||||
public void signalInteract(TaskPad pad) {
|
||||
String 安全交互位 = pad.getPoint();
|
||||
String 载具号 = pad.getVehicle_code();
|
||||
String 交互类型 = pad.getType();
|
||||
Device device = deviceAppService.findDeviceByCode(安全交互位);
|
||||
String point = pad.getPoint();
|
||||
String vehicle_code = pad.getVehicle_code();
|
||||
String type = pad.getType();
|
||||
Device device = deviceAppService.findDeviceByCode(point);
|
||||
if (device ==null){
|
||||
throw new BadRequestException("当前安全交互位未配置驱动信息"+安全交互位);
|
||||
throw new BadRequestException("当前安全交互位未配置驱动信息"+point);
|
||||
}
|
||||
Object url = device.getExtraValue().get("address");
|
||||
if (url == null) {
|
||||
throw new BadRequestException("当前安全交互位未配置交互地址"+安全交互位);
|
||||
throw new BadRequestException("当前安全交互位未配置交互地址"+point);
|
||||
}
|
||||
HashMap of = MapOf.of("point", 安全交互位
|
||||
, "type", 交互类型
|
||||
, "containerCode", 载具号
|
||||
HashMap of = MapOf.of("point", point
|
||||
, "type", type
|
||||
, "containerCode", vehicle_code
|
||||
, "url", url);
|
||||
//1.请求取货2取货完成3请求放货4放货完成
|
||||
HttpResponse result = null;
|
||||
switch (交互类型){
|
||||
switch (type){
|
||||
case "1":
|
||||
case "3":
|
||||
if (type.equals("3")){
|
||||
of.put("type", "2");
|
||||
}
|
||||
result = acsToHJXService.actionRequest(new JSONObject(of));
|
||||
break;
|
||||
case "2":
|
||||
case "4":
|
||||
if (type.equals("2")){
|
||||
of.put("type", "3");
|
||||
}
|
||||
result = acsToHJXService.actionFinish(new JSONObject(of));
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.modules.layout.mapLayout.controller;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.acs.ext.wms.service.NDCToAcsService;
|
||||
import org.nl.common.utils.query.PageQuery;
|
||||
import org.nl.modules.layout.mapLayout.dao.AgvLayoutMapQuery;
|
||||
import org.nl.modules.layout.mapLayout.dto.AgvLayoutMapDto;
|
||||
@@ -15,10 +16,7 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 地图布局Controller
|
||||
@@ -30,6 +28,8 @@ public class AgvLayoutMapController {
|
||||
|
||||
@Autowired
|
||||
private AgvLayoutMapService agvLayoutMapService;
|
||||
@Autowired
|
||||
private NDCToAcsService ndcToAcsService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@@ -81,27 +81,33 @@ public class AgvLayoutMapController {
|
||||
@SaIgnore
|
||||
public ResponseEntity<AgvLayoutMapDto> initLayout(Long id) {
|
||||
AgvLayoutMapDto agvLayoutMapDto = agvLayoutMapService.initLayoutMap(id);
|
||||
return new ResponseEntity<>(agvLayoutMapDto,HttpStatus.OK);
|
||||
return new ResponseEntity<>(agvLayoutMapDto, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("status")
|
||||
@SaIgnore
|
||||
public ResponseEntity<List> status(String carId) {
|
||||
Map<String, AgvStatus> map = ndcToAcsService.findAllAgvFromCache();
|
||||
// Map<String,AgvStatus> map = new HashMap<>();
|
||||
List<AgvStatus> list = new ArrayList<>();
|
||||
for (int i = 0; i < 4; i++) {
|
||||
AgvStatus build = AgvStatus.builder()
|
||||
.status("2")
|
||||
.carId(String.valueOf(i + 1))
|
||||
.action("请求取货")
|
||||
.actionInfo("申请取货中")
|
||||
.taskCode("33876")
|
||||
.icon("/Users/mima0000/Desktop/car.png")
|
||||
.fileId("3029")
|
||||
.x(new Random().nextInt(1189) + 100)
|
||||
.y(new Random().nextInt(1189) + 100)
|
||||
.power(66)
|
||||
.angle(new Random().nextInt(160) + 10).build();
|
||||
list.add(build);
|
||||
for (AgvStatus status : map.values()) {
|
||||
list.add(status);
|
||||
}
|
||||
return new ResponseEntity<>(list,HttpStatus.OK);
|
||||
// for (int i = 0; i < 4; i++) {
|
||||
// AgvStatus build = AgvStatus.builder()
|
||||
// .status("2")
|
||||
// .carId(String.valueOf(i + 1))
|
||||
// .action("请求取货")
|
||||
// .actionInfo("申请取货中")
|
||||
// .taskCode("33876")
|
||||
// .icon("/Users/mima0000/Desktop/car.png")
|
||||
// .fileId("3029")
|
||||
// .x(new Random().nextInt(1189) + 100)
|
||||
// .y(new Random().nextInt(1189) + 100)
|
||||
// .power(66)
|
||||
// .angle(new Random().nextInt(160) + 10).build();
|
||||
// list.add(build);
|
||||
// }
|
||||
return new ResponseEntity<>(list, HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user