Compare commits

..

No commits in common. "a326ac143f69f54227d5a0ea13bcd5c7dc107cfb" and "c1a17a839bc362ad465c6a7bf852b1d9ace30fac" have entirely different histories.

27 changed files with 136 additions and 399 deletions

View File

@ -16,8 +16,7 @@ public enum NodeTypeEnum {
DEVICE(3, "设备点"), DEVICE(3, "设备点"),
PARKING(4, "停车点"), PARKING(4, "停车点"),
CHANGE(5, "区域变更点"), CHANGE(5, "区域变更点"),
WAIT(6, "等待点"), WAIT(6, "等待点");
TEXT(7, "文字点");
/** /**
* 类型 * 类型

View File

@ -57,12 +57,6 @@ public abstract class AbstractWebSocketMessageSender implements WebSocketMessage
WebSocketSession session = sessionManager.getSession(sessionId); WebSocketSession session = sessionManager.getSession(sessionId);
if (session != null) { if (session != null) {
sessions = Collections.singletonList(session); sessions = Collections.singletonList(session);
} else {
// -- 这里用于获取地图的webSocket
session = sessionManager.getMapSession(sessionId);
if (session != null){
sessions = Collections.singletonList(session);
}
} }
} else if (userType != null && userId != null) { } else if (userType != null && userId != null) {
sessions = (List<WebSocketSession>) sessionManager.getSessionList(userType, userId); sessions = (List<WebSocketSession>) sessionManager.getSessionList(userType, userId);

View File

@ -33,14 +33,6 @@ public interface WebSocketSessionManager {
*/ */
WebSocketSession getSession(String id); WebSocketSession getSession(String id);
/**
* 根据 地图 +"_"+ 获取session
*
* @param key
* @return
*/
WebSocketSession getMapSession(String key);
/** /**
* 获得指定用户类型的 Session 列表 * 获得指定用户类型的 Session 列表
* *

View File

@ -1,14 +1,15 @@
package cn.iocoder.yudao.framework.websocket.core.session; package cn.iocoder.yudao.framework.websocket.core.session;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.http.HttpUtil;
import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.websocket.core.util.WebSocketFrameworkUtils; import cn.iocoder.yudao.framework.websocket.core.util.WebSocketFrameworkUtils;
import org.springframework.web.socket.WebSocketSession; import org.springframework.web.socket.WebSocketSession;
import java.nio.charset.StandardCharsets; import java.util.ArrayList;
import java.util.*; import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
@ -22,37 +23,22 @@ public class WebSocketSessionManagerImpl implements WebSocketSessionManager {
/** /**
* id WebSocketSession 映射 * id WebSocketSession 映射
* <p> *
* keySession 编号 * keySession 编号
*/ */
private final ConcurrentMap<String, WebSocketSession> idSessions = new ConcurrentHashMap<>(); private final ConcurrentMap<String, WebSocketSession> idSessions = new ConcurrentHashMap<>();
/** /**
* user WebSocketSession 映射 * user WebSocketSession 映射
* <p> *
* key1用户类型 * key1用户类型
* key2用户编号 * key2用户编号
*/ */
private final ConcurrentMap<Integer, ConcurrentMap<Long, CopyOnWriteArrayList<WebSocketSession>>> userSessions private final ConcurrentMap<Integer, ConcurrentMap<Long, CopyOnWriteArrayList<WebSocketSession>>> userSessions
= new ConcurrentHashMap<>(); = new ConcurrentHashMap<>();
/**
* 地图 WebSocketSession 映射
* <p>
* key地图地址 +'_'+
*/
private final ConcurrentMap<String, WebSocketSession> mapSessions = new ConcurrentHashMap<>();
@Override @Override
public void addSession(WebSocketSession session) { public void addSession(WebSocketSession session) {
// 解析 session Url 中参数
Map<String, String> paramMap = HttpUtil.decodeParamMap(String.valueOf(session.getUri()), StandardCharsets.UTF_8);
String type = paramMap.get("type");
// -- 如果是地图里面过来的
if ("map".equals(type)) {
mapSessions.put(paramMap.get("floor") + "_" + paramMap.get("area"), session);
} else {
// 添加到 idSessions // 添加到 idSessions
idSessions.put(session.getId(), session); idSessions.put(session.getId(), session);
// 添加到 userSessions // 添加到 userSessions
@ -76,17 +62,9 @@ public class WebSocketSessionManagerImpl implements WebSocketSessionManager {
} }
sessions.add(session); sessions.add(session);
} }
}
@Override @Override
public void removeSession(WebSocketSession session) { public void removeSession(WebSocketSession session) {
// 解析 session Url 中参数
Map<String, String> paramMap = HttpUtil.decodeParamMap(String.valueOf(session.getUri()), StandardCharsets.UTF_8);
String type = paramMap.get("type");
// -- 如果是地图里面过来的
if ("map".equals(type)) {
mapSessions.remove(paramMap.get("floor") + "_" + paramMap.get("area"), session);
} else {
// 移除从 idSessions // 移除从 idSessions
idSessions.remove(session.getId()); idSessions.remove(session.getId());
// 移除从 idSessions // 移除从 idSessions
@ -104,18 +82,12 @@ public class WebSocketSessionManagerImpl implements WebSocketSessionManager {
userSessionsMap.remove(user.getId(), sessions); userSessionsMap.remove(user.getId(), sessions);
} }
} }
}
@Override @Override
public WebSocketSession getSession(String id) { public WebSocketSession getSession(String id) {
return idSessions.get(id); return idSessions.get(id);
} }
@Override
public WebSocketSession getMapSession(String key) {
return mapSessions.get(key);
}
@Override @Override
public Collection<WebSocketSession> getSessionList(Integer userType) { public Collection<WebSocketSession> getSessionList(Integer userType) {
ConcurrentMap<Long, CopyOnWriteArrayList<WebSocketSession>> userSessionsMap = userSessions.get(userType); ConcurrentMap<Long, CopyOnWriteArrayList<WebSocketSession>> userSessionsMap = userSessions.get(userType);

View File

@ -1,14 +0,0 @@
package cn.iocoder.yudao.module.system.api.robot.dto;
import lombok.Data;
/**
* 楼层区域
*/
@Data
public class FloorZoneDTO {
//地图所在楼
public String floor;
//地图所在区
public String area;
}

View File

@ -9,11 +9,6 @@ import java.util.List;
*/ */
@Data @Data
public class RobotStatusDataDTO { public class RobotStatusDataDTO {
/**
* 楼层区域
*/
public FloorZoneDTO floor_zone;
/** /**
* 机器人位姿 * 机器人位姿
*/ */

View File

@ -9,7 +9,6 @@ import lombok.Data;
public class RobotStatusDataPoseDTO { public class RobotStatusDataPoseDTO {
public String y; public String y;
public String x; public String x;
//弧度
public String yaw; public String yaw;
//楼层 //楼层
public String floor; public String floor;

View File

@ -1,61 +0,0 @@
package cn.iocoder.yudao.module.system.api.robot;
import cn.hutool.core.map.MapUtil;
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@Component
@Slf4j
public class RequestProcessor {
private final ConcurrentHashMap<String, ConcurrentHashMap<String, String>> cache = new ConcurrentHashMap<>();
private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
@Resource
public WebSocketSenderApi webSocketSenderApi;
public RequestProcessor() {
// 每秒执行一次 - 处理并发送数据 - 避免数据丢失
scheduler.scheduleAtFixedRate(this::processAndSend, 1, 1, TimeUnit.SECONDS);
}
public void handleRequest(String map, String mac, String data) {
cache.computeIfAbsent(map, k -> new ConcurrentHashMap<>()).put(mac, data);
}
private void processAndSend() {
Map<String, ConcurrentHashMap<String, String>> snapshot = new ConcurrentHashMap<>(cache); // 创建快照
cache.clear(); // 先清理缓存
for (Map.Entry<String, ConcurrentHashMap<String, String>> entry : snapshot.entrySet()) {
if (!MapUtil.isEmpty(entry.getValue())) {
sendData(entry.getKey(), entry.getValue());
}
}
}
private void sendData(String map, Map<String, String> data) {
// -- 发送给对应的websocket
// System.out.println("key:" + map + "发送数据:" + data);
log.info("key:" + map + "发送数据:" + data);
webSocketSenderApi.sendObject(map, "map_push", data);
}
public void shutdown() {
scheduler.shutdown();
}
@PreDestroy
public void destroy() {
// 在Bean销毁前关闭去啊
shutdown();
}
}

View File

@ -54,12 +54,8 @@ public class RobotStatusApiImpl implements RobotStatusApi {
@Value("${zn.robot_error_level_time:30}") @Value("${zn.robot_error_level_time:30}")
private Long robotErrorLevelTime; private Long robotErrorLevelTime;
@Resource
private RequestProcessor processor;
/** /**
* 更新机器人点位/异常/能否做任务 * 更新机器人点位/异常/能否做任务
*
* @param robotStatusDataDTO * @param robotStatusDataDTO
* @return * @return
*/ */
@ -72,31 +68,26 @@ public class RobotStatusApiImpl implements RobotStatusApi {
return; return;
} }
String taskStatusKey = RobotTaskChcheConstant.ROBOT_TASK_STATUS + robotStatusDataDTO.getMac(); String taskStatusKey = RobotTaskChcheConstant.ROBOT_TASK_STATUS +robotStatusDataDTO.getMac();
String cargoDetectedKey = RobotTaskChcheConstant.ROBOT_CARGO_DETECTED + robotStatusDataDTO.getMac(); String cargoDetectedKey = RobotTaskChcheConstant.ROBOT_CARGO_DETECTED +robotStatusDataDTO.getMac();
String pose2dKey = RobotTaskChcheConstant.ROBOT_INFORMATION_POSE_BAT_SOC + robotStatusDataDTO.getMac(); String pose2dKey = RobotTaskChcheConstant.ROBOT_INFORMATION_POSE_BAT_SOC +robotStatusDataDTO.getMac();
redisUtil.set(taskStatusKey, robotStatusDataDTO.getData().getTask_status(), robotPositionCacheTime); redisUtil.set(taskStatusKey, robotStatusDataDTO.getData().getTask_status(),robotPositionCacheTime);
redisUtil.set(cargoDetectedKey, robotStatusDataDTO.getData().getCargo_detected(), robotPositionCacheTime); redisUtil.set(cargoDetectedKey,robotStatusDataDTO.getData().getCargo_detected(),robotPositionCacheTime);
Object object = redisUtil.get(pose2dKey); Object object = redisUtil.get(pose2dKey);
RobotStatusDataPoseDTO robotStatusDataPoseDTO = JSONUtil.toBean((String) object, RobotStatusDataPoseDTO.class); RobotStatusDataPoseDTO robotStatusDataPoseDTO= JSONUtil.toBean((String)object, RobotStatusDataPoseDTO.class);
robotStatusDataPoseDTO.setX(robotStatusDataDTO.getData().getPose2d().getX()); robotStatusDataPoseDTO.setX(robotStatusDataDTO.getData().getPose2d().getX());
robotStatusDataPoseDTO.setY(robotStatusDataDTO.getData().getPose2d().getY()); robotStatusDataPoseDTO.setY(robotStatusDataDTO.getData().getPose2d().getY());
robotStatusDataPoseDTO.setYaw(robotStatusDataDTO.getData().getPose2d().getYaw()); robotStatusDataPoseDTO.setYaw(robotStatusDataDTO.getData().getPose2d().getYaw());
robotStatusDataPoseDTO.setFloor(robotStatusDataDTO.getData().getFloor_zone().getFloor()); robotStatusDataPoseDTO.setFloor(robotStatusDataDTO.getData().getPose2d().getFloor());
robotStatusDataPoseDTO.setArea(robotStatusDataDTO.getData().getFloor_zone().getArea()); robotStatusDataPoseDTO.setArea(robotStatusDataDTO.getData().getPose2d().getArea());
redisUtil.set(pose2dKey, JSON.toJSONString(robotStatusDataPoseDTO), robotPositionCacheTime); redisUtil.set(pose2dKey,JSON.toJSONString(robotStatusDataPoseDTO),robotPositionCacheTime);
// 合并请求 - 这里接受到的数据都丢给 RequestProcessor - 再整合数据通过WebSocket丢给前端
processor.handleRequest(robotStatusDataPoseDTO.getFloor() + "_" + robotStatusDataPoseDTO.getArea(),
robotStatusDataDTO.getMac(), JSONUtil.toJsonStr(robotStatusDataDTO.getData().getPose2d()));
if (ObjectUtil.isNotNull(robotStatusDataDTO.getData().getErr_code())) { if (ObjectUtil.isNotNull(robotStatusDataDTO.getData().getErr_code())) {
List<RobotStatusDataErrorDTO> errCode = robotStatusDataDTO.getData().getErr_code(); List<RobotStatusDataErrorDTO> errCode = robotStatusDataDTO.getData().getErr_code();
String robotNo = robotInformationService.getRobotNoByMac(robotStatusDataDTO.getMac()); String robotNo = robotInformationService.getRobotNoByMac(robotStatusDataDTO.getMac());
if (ObjectUtil.isNull(robotNo)) { if (ObjectUtil.isNull(robotNo)) {
log.info("查不到机器人编号 :{}", robotStatusDataDTO.getMac()); log.info("查不到机器人编号 :{}",robotStatusDataDTO.getMac());
return; return;
} }
@ -116,7 +107,7 @@ public class RobotStatusApiImpl implements RobotStatusApi {
List<RobotWarnMsgDO> warnMsgDOS = new ArrayList<>(); List<RobotWarnMsgDO> warnMsgDOS = new ArrayList<>();
//机器人异常等级 //机器人异常等级
String errorLevelKey = RobotTaskChcheConstant.ROBOT_ERROR_LEVEL + robotStatusDataDTO.getMac(); String errorLevelKey = RobotTaskChcheConstant.ROBOT_ERROR_LEVEL +robotStatusDataDTO.getMac();
Object errorLevel = redisUtil.get(errorLevelKey); Object errorLevel = redisUtil.get(errorLevelKey);
Integer level = ObjectUtil.isEmpty(errorLevel) ? 0 : Integer.valueOf(errorLevel.toString()); Integer level = ObjectUtil.isEmpty(errorLevel) ? 0 : Integer.valueOf(errorLevel.toString());
@ -128,7 +119,7 @@ public class RobotStatusApiImpl implements RobotStatusApi {
List<RobotWarnCodeMappingDO> mappingDOS = warnCodeMapping.get(robotStatusData.getError_code()); List<RobotWarnCodeMappingDO> mappingDOS = warnCodeMapping.get(robotStatusData.getError_code());
if (ObjectUtil.isEmpty(mappingDOS)) { if (ObjectUtil.isEmpty(mappingDOS)) {
log.info("当前告警类型查不到对应的告警信息 :{}", robotStatusData.getError_code()); log.info("当前告警类型查不到对应的告警信息 :{}",robotStatusData.getError_code());
continue; continue;
} }
RobotWarnMsgDO warnMsg = RobotWarnMsgDO.builder().warnLevel(Integer.valueOf(robotStatusData.getCode_level())) RobotWarnMsgDO warnMsg = RobotWarnMsgDO.builder().warnLevel(Integer.valueOf(robotStatusData.getCode_level()))
@ -140,11 +131,12 @@ public class RobotStatusApiImpl implements RobotStatusApi {
.build(); .build();
warnMsgDOS.add(warnMsg); warnMsgDOS.add(warnMsg);
} }
redisUtil.set(errorLevelKey, level, robotErrorLevelTime); redisUtil.set(errorLevelKey,level,robotErrorLevelTime);
warnMsgMapper.insertBatch(warnMsgDOS); warnMsgMapper.insertBatch(warnMsgDOS);
} }
} }
} }

View File

@ -82,8 +82,8 @@ public class HouseAreaController {
@GetMapping("/getHouseAreaList") @GetMapping("/getHouseAreaList")
@Operation(summary = "获得全部库区") @Operation(summary = "获得全部库区")
@PreAuthorize("@ss.hasPermission('ware:house-area:query')") @PreAuthorize("@ss.hasPermission('ware:house-area:query')")
public CommonResult<List<HouseAreaRespVO>> getHouseAreaList(@RequestParam Long positionMapId) { public CommonResult<List<HouseAreaRespVO>> getHouseAreaList() {
List<HouseAreaDO> list = houseAreaService.getHouseAreaList(positionMapId); List<HouseAreaDO> list = houseAreaService.getHouseAreaList();
return success(BeanUtils.toBean(list, HouseAreaRespVO.class)); return success(BeanUtils.toBean(list, HouseAreaRespVO.class));
} }

View File

@ -84,7 +84,7 @@ public class DeviceInformationController {
@PostMapping("/mapBindDeviceInfo") @PostMapping("/mapBindDeviceInfo")
@Operation(summary = "地图绑定设备") @Operation(summary = "地图绑定设备")
public CommonResult<Boolean> mapBindDeviceInfo(@Valid @RequestBody MapBindDeviceInfoDTO dto) { public CommonResult<Boolean> mapBindDeviceInfo(@Valid MapBindDeviceInfoDTO dto) {
informationService.mapBindDeviceInfo(dto); informationService.mapBindDeviceInfo(dto);
return success(true); return success(true);
} }

View File

@ -13,7 +13,6 @@ import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMa
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO; import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
import cn.iocoder.yudao.module.system.handler.mapnode.NodeProcessingContext; import cn.iocoder.yudao.module.system.handler.mapnode.NodeProcessingContext;
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService; import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -44,12 +43,6 @@ public class PositionMapItemController {
@Resource @Resource
private NodeProcessingContext nodeProcessingContext; private NodeProcessingContext nodeProcessingContext;
@GetMapping("/getMapItemId")
@Operation(summary = "获取节点id")
public CommonResult<String> getMapItemId() {
return success(String.valueOf(IdWorker.getId()));
}
// -- 前端给所有的节点信息 - // -- 前端给所有的节点信息 -
@PostMapping("/batchSaveOrEditOrDel") @PostMapping("/batchSaveOrEditOrDel")
@Operation(summary = "批量新增编辑删除节点") @Operation(summary = "批量新增编辑删除节点")

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.positionmap;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineRespVO; import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineRespVO;
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineSaveReqVO; import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO; import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO;

View File

@ -1,12 +1,11 @@
package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo; package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo; package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -28,30 +27,6 @@ public class PositionMapLinePageReqVO extends PageParam {
@Schema(description = "结束点id(点位子表id)", example = "15890") @Schema(description = "结束点id(点位子表id)", example = "15890")
private Long endPointId; private Long endPointId;
@Schema(description = "开始控制点x轴", example = "15890")
private String beginControlX;
@Schema(description = "开始控制点y轴", example = "15890")
private String beginControlY;
@Schema(description = "结束控制点x轴", example = "15890")
private String endControlX;
@Schema(description = "结束控制点y轴", example = "15890")
private String endControlY;
@Schema(description = "膨胀区域前", example = "15890")
private BigDecimal expansionZoneFront;
@Schema(description = "膨胀区域后", example = "15890")
private BigDecimal expansionZoneAfter;
@Schema(description = "膨胀区域左", example = "15890")
private BigDecimal expansionZoneLeft;
@Schema(description = "膨胀区域右", example = "15890")
private BigDecimal expansionZoneRight;
@Schema(description = "行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线") @Schema(description = "行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线")
private Integer method; private Integer method;

View File

@ -29,38 +29,6 @@ public class PositionMapLineRespVO {
@ExcelProperty("结束点id(点位子表id)") @ExcelProperty("结束点id(点位子表id)")
private Long endPointId; private Long endPointId;
@Schema(description = "开始控制点x轴", example = "15890")
@ExcelProperty("开始控制点x轴")
private String beginControlX;
@Schema(description = "开始控制点y轴", example = "15890")
@ExcelProperty("开始控制点y轴")
private String beginControlY;
@Schema(description = "结束控制点x轴", example = "15890")
@ExcelProperty("结束控制点x轴")
private String endControlX;
@Schema(description = "结束控制点y轴", example = "15890")
@ExcelProperty("结束控制点y轴")
private String endControlY;
@Schema(description = "膨胀区域前", example = "15890")
@ExcelProperty("膨胀区域前")
private BigDecimal expansionZoneFront;
@Schema(description = "膨胀区域后", example = "15890")
@ExcelProperty("膨胀区域后")
private BigDecimal expansionZoneAfter;
@Schema(description = "膨胀区域左", example = "15890")
@ExcelProperty("膨胀区域左")
private BigDecimal expansionZoneLeft;
@Schema(description = "膨胀区域右", example = "15890")
@ExcelProperty("膨胀区域右")
private BigDecimal expansionZoneRight;
@Schema(description = "行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线") @Schema(description = "行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线")
@ExcelProperty("行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线") @ExcelProperty("行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线")
private Integer method; private Integer method;

View File

@ -1,6 +1,5 @@
package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo; package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
@ -25,30 +24,6 @@ public class PositionMapLineSaveReqVO {
@Schema(description = "结束点id(点位子表id)", example = "15890") @Schema(description = "结束点id(点位子表id)", example = "15890")
private Long endPointId; private Long endPointId;
@Schema(description = "开始控制点x轴", example = "15890")
private String beginControlX;
@Schema(description = "开始控制点y轴", example = "15890")
private String beginControlY;
@Schema(description = "结束控制点x轴", example = "15890")
private String endControlX;
@Schema(description = "结束控制点y轴", example = "15890")
private String endControlY;
@Schema(description = "膨胀区域前", example = "15890")
private BigDecimal expansionZoneFront;
@Schema(description = "膨胀区域后", example = "15890")
private BigDecimal expansionZoneAfter;
@Schema(description = "膨胀区域左", example = "15890")
private BigDecimal expansionZoneLeft;
@Schema(description = "膨胀区域右", example = "15890")
private BigDecimal expansionZoneRight;
@Schema(description = "行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线") @Schema(description = "行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线")
private Integer method; private Integer method;

View File

@ -1,30 +1,32 @@
package cn.iocoder.yudao.module.system.controller.admin.robot; package cn.iocoder.yudao.module.system.controller.admin.robot;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.*; import cn.iocoder.yudao.module.system.controller.admin.robot.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotInformationDO; import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotInformationDO;
import cn.iocoder.yudao.module.system.service.robot.RobotInformationService; import cn.iocoder.yudao.module.system.service.robot.RobotInformationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import org.springframework.validation.annotation.Validated;
import javax.validation.Valid; import org.springframework.security.access.prepost.PreAuthorize;
import java.io.IOException; import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT; import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 车辆信息") @Tag(name = "管理后台 - 车辆信息")
@RestController @RestController

View File

@ -6,10 +6,7 @@ import cn.iocoder.yudao.module.system.framework.sms.core.enums.SmsChannelEnum;
import cn.iocoder.yudao.module.system.service.sms.SmsSendService; import cn.iocoder.yudao.module.system.service.sms.SmsSendService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.annotation.security.PermitAll; import javax.annotation.security.PermitAll;
@ -33,6 +30,7 @@ public class SmsCallbackController {
smsSendService.receiveSmsStatus(SmsChannelEnum.ALIYUN.getCode(), text); smsSendService.receiveSmsStatus(SmsChannelEnum.ALIYUN.getCode(), text);
return success(true); return success(true);
} }
@PostMapping("/tencent") @PostMapping("/tencent")
@PermitAll @PermitAll
@Operation(summary = "腾讯云短信的回调", description = "参见 https://cloud.tencent.com/document/product/382/52077 文档") @Operation(summary = "腾讯云短信的回调", description = "参见 https://cloud.tencent.com/document/product/382/52077 文档")

View File

@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -42,38 +41,6 @@ public class PositionMapLineDO extends BaseDO {
* 结束点id(点位子表id) * 结束点id(点位子表id)
*/ */
private Long endPointId; private Long endPointId;
/**
* 开始控制点x轴
*/
private String beginControlX;
/**
* 开始控制点y轴
*/
private String beginControlY;
/**
* 结束控制点x轴
*/
private String endControlX;
/**
* 结束控制点y轴
*/
private String endControlY;
/**
* 膨胀区域前
*/
private BigDecimal expansionZoneFront;
/**
* 膨胀区域后
*/
private BigDecimal expansionZoneAfter;
/**
* 膨胀区域左
*/
private BigDecimal expansionZoneLeft;
/**
* 膨胀区域右
*/
private BigDecimal expansionZoneRight;
/** /**
* 行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线 * 行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线
*/ */

View File

@ -50,8 +50,6 @@ public class NodeProcessingContext {
strategyMap.put(NodeTypeEnum.CHANGE.getType(), mapNodeStrategyImpl); strategyMap.put(NodeTypeEnum.CHANGE.getType(), mapNodeStrategyImpl);
// 等待点 // 等待点
strategyMap.put(NodeTypeEnum.WAIT.getType(), mapNodeStrategyImpl); strategyMap.put(NodeTypeEnum.WAIT.getType(), mapNodeStrategyImpl);
// 文字点
strategyMap.put(NodeTypeEnum.TEXT.getType(), mapNodeStrategyImpl);
// todo 可以继续添加更多的策略 - 新增实现即可 // todo 可以继续添加更多的策略 - 新增实现即可
} }

View File

@ -64,5 +64,5 @@ public interface HouseAreaService {
* 获得全部库区 * 获得全部库区
* @return * @return
*/ */
List<HouseAreaDO> getHouseAreaList(Long positionMapId); List<HouseAreaDO> getHouseAreaList();
} }

View File

@ -14,6 +14,7 @@ import cn.iocoder.yudao.module.system.controller.admin.positionmap.dto.PositionM
import cn.iocoder.yudao.module.system.dal.dataobject.housearea.HouseAreaDO; import cn.iocoder.yudao.module.system.dal.dataobject.housearea.HouseAreaDO;
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO; import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO; import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotModelDO;
import cn.iocoder.yudao.module.system.dal.mysql.housearea.HouseAreaMapper; import cn.iocoder.yudao.module.system.dal.mysql.housearea.HouseAreaMapper;
import cn.iocoder.yudao.module.system.service.houselocation.HouseLocationService; import cn.iocoder.yudao.module.system.service.houselocation.HouseLocationService;
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService; import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
@ -156,10 +157,10 @@ public class HouseAreaServiceImpl implements HouseAreaService {
} }
@Override @Override
public List<HouseAreaDO> getHouseAreaList(Long positionMapId) { public List<HouseAreaDO> getHouseAreaList() {
return houseAreaMapper.selectList(new LambdaQueryWrapper<HouseAreaDO>() List<HouseAreaDO> list = houseAreaMapper.selectList(new LambdaQueryWrapper<HouseAreaDO>()
.eq(HouseAreaDO::getPositionMapId, positionMapId)
.orderByAsc(HouseAreaDO::getId)); .orderByAsc(HouseAreaDO::getId));
return list;
} }
} }

View File

@ -72,11 +72,9 @@ public class PositionMapItemServiceImpl extends ServiceImpl<PositionMapItemMappe
public void batchSaveOrEditOrDel(Long positionMapId, List<List<PositionMapItemDO>> list) { public void batchSaveOrEditOrDel(Long positionMapId, List<List<PositionMapItemDO>> list) {
//批量添加修改删除 //批量添加修改删除
if (isNotEmpty(list.get(0))) { if (isNotEmpty(list.get(0))) {
list.get(0).forEach(a -> a.setPositionMapId(positionMapId));
positionMapItemMapper.insertBatch(list.get(0)); positionMapItemMapper.insertBatch(list.get(0));
} }
if (isNotEmpty(list.get(1))) { if (isNotEmpty(list.get(1))) {
list.get(1).forEach(a -> a.setPositionMapId(positionMapId));
positionMapItemMapper.updateBatch(list.get(1)); positionMapItemMapper.updateBatch(list.get(1));
} }
if (isNotEmpty(list.get(2))) { if (isNotEmpty(list.get(2))) {

View File

@ -1,12 +1,12 @@
package cn.iocoder.yudao.module.system.service.robot; package cn.iocoder.yudao.module.system.service.robot;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.*; import cn.iocoder.yudao.module.system.controller.admin.robot.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotInformationDO; import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotInformationDO;
import javax.validation.Valid;
import java.util.List;
/** /**
* 车辆信息 Service 接口 * 车辆信息 Service 接口
* *
@ -54,30 +54,27 @@ public interface RobotInformationService {
/** /**
* 统计车辆待命/任务中/离线 * 统计车辆待命/任务中/离线
*
* @return * @return
*/ */
RobotInformationStatisticsVO statisticsInformation(); RobotInformationStatisticsVO statisticsInformation();
/** /**
* 查询能正常使用的车辆 * 查询能正常使用的车辆
*
* @return * @return
*/ */
List<RobotInformationDO> getCanUseRobot(); List<RobotInformationDO> getCanUseRobot();
/** /**
* 查询所有车辆 * 查询所有车辆
*
* @return * @return
*/ */
List<RobotInformationDO> getAllRobot(); List<RobotInformationDO> getAllRobot();
/** /**
* 查询机器人编号 * 查询机器人编号
*
* @param mac * @param mac
* @return * @return
*/ */
String getRobotNoByMac(String mac); String getRobotNoByMac(String mac);
} }

View File

@ -3,8 +3,6 @@ package cn.iocoder.yudao.module.system.service.robot;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.api.robot.dto.RobotStatusDataPoseDTO; import cn.iocoder.yudao.module.system.api.robot.dto.RobotStatusDataPoseDTO;
import cn.iocoder.yudao.module.system.constant.robot.RobotTaskChcheConstant; import cn.iocoder.yudao.module.system.constant.robot.RobotTaskChcheConstant;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.*; import cn.iocoder.yudao.module.system.controller.admin.robot.vo.*;
@ -21,12 +19,13 @@ import cn.iocoder.yudao.module.system.enums.robot.information.RobotStatisticsTyp
import cn.iocoder.yudao.module.system.util.redis.RedisUtil; import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import java.util.*;
import java.util.ArrayList; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import java.util.List; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import java.util.Set;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
@ -107,7 +106,7 @@ public class RobotInformationServiceImpl implements RobotInformationService {
// 更新 // 更新
RobotInformationDO updateObj = BeanUtils.toBean(updateReqVO, RobotInformationDO.class); RobotInformationDO updateObj = BeanUtils.toBean(updateReqVO, RobotInformationDO.class);
informationMapper.updateById(updateObj); informationMapper.updateById(updateObj);
redisUtil.set(RobotTaskChcheConstant.ROBOT_GET_ROBOTNO_BY_MAC + updateObj.getMacAddress(), updateObj.getRobotNo()); redisUtil.set(RobotTaskChcheConstant.ROBOT_GET_ROBOTNO_BY_MAC + updateObj.getMacAddress(),updateObj.getRobotNo());
} }
@Override @Override
@ -192,7 +191,7 @@ public class RobotInformationServiceImpl implements RobotInformationService {
} }
} }
dataPage.setList(resultList); dataPage.setList(resultList);
} else { }else {
dataPage.setList(targetList); dataPage.setList(targetList);
} }
@ -201,29 +200,28 @@ public class RobotInformationServiceImpl implements RobotInformationService {
/** /**
* 设置状态和信息 * 设置状态和信息
*
* @param v * @param v
*/ */
private void setMsgAndRobotStatus(RobotInformationPageRespVO v) { private void setMsgAndRobotStatus(RobotInformationPageRespVO v) {
String pose2dKey = RobotTaskChcheConstant.ROBOT_INFORMATION_POSE_BAT_SOC + v.getMacAddress(); String pose2dKey = RobotTaskChcheConstant.ROBOT_INFORMATION_POSE_BAT_SOC +v.getMacAddress();
Object object = redisUtil.get(pose2dKey); Object object = redisUtil.get(pose2dKey);
RobotStatusDataPoseDTO robotStatusDataPoseDTO = JSONUtil.toBean((String) object, RobotStatusDataPoseDTO.class); RobotStatusDataPoseDTO robotStatusDataPoseDTO= JSONUtil.toBean((String)object, RobotStatusDataPoseDTO.class);
String robotDoingActionKey = RobotTaskChcheConstant.ROBOT_QUERY_DOING_ACTION + v.getMacAddress(); String robotDoingActionKey = RobotTaskChcheConstant.ROBOT_QUERY_DOING_ACTION +v.getMacAddress();
Object action = redisUtil.get(robotDoingActionKey); Object action = redisUtil.get(robotDoingActionKey);
if (ObjectUtil.isNotEmpty(object) && ObjectUtil.isNotEmpty(robotStatusDataPoseDTO)) { if (ObjectUtil.isNotEmpty(object) && ObjectUtil.isNotEmpty(robotStatusDataPoseDTO)) {
v.setElectricity(robotStatusDataPoseDTO.getBat_soc()); v.setElectricity(robotStatusDataPoseDTO.getBat_soc());
v.setFloor(robotStatusDataPoseDTO.getFloor()); v.setFloor(robotStatusDataPoseDTO.getFloor());
v.setArea(robotStatusDataPoseDTO.getArea()); v.setArea(robotStatusDataPoseDTO.getArea());
} else if (ObjectUtil.isEmpty(object)) { }else if (ObjectUtil.isEmpty(object)) {
//离线 //离线
v.setOnlineStatus(1); v.setOnlineStatus(1);
} }
v.setRobotEssenceStatus(v.getRobotTaskModel()); v.setRobotEssenceStatus(v.getRobotTaskModel());
//设置异常 //设置异常
String errorLevelKey = RobotTaskChcheConstant.ROBOT_ERROR_LEVEL + v.getMacAddress(); String errorLevelKey = RobotTaskChcheConstant.ROBOT_ERROR_LEVEL +v.getMacAddress();
Object errorLevel = redisUtil.get(errorLevelKey); Object errorLevel = redisUtil.get(errorLevelKey);
if (ObjectUtil.isNotEmpty(errorLevel) && Integer.valueOf(errorLevel.toString()).intValue() >= 3) { if (ObjectUtil.isNotEmpty(errorLevel) && Integer.valueOf(errorLevel.toString()).intValue() >= 3) {
v.setRobotEssenceStatus(2); v.setRobotEssenceStatus(2);
@ -233,18 +231,18 @@ public class RobotInformationServiceImpl implements RobotInformationService {
//待命中 //待命中
v.setRobotTaskStatus(0); v.setRobotTaskStatus(0);
v.setMsg("车辆正在待命中"); v.setMsg("车辆正在待命中");
} else if (RobotStatusEnum.CHARGE.getType().equals(v.getRobotStatus())) { }else if (RobotStatusEnum.CHARGE.getType().equals(v.getRobotStatus())) {
//充电中 //充电中
v.setRobotTaskStatus(2); v.setRobotTaskStatus(2);
v.setMsg("车辆正在充电"); v.setMsg("车辆正在充电");
} else { }else {
//任务中 //任务中
v.setRobotTaskStatus(1); v.setRobotTaskStatus(1);
if (RobotStatusEnum.DOING.getType().equals(v.getRobotStatus()) && ObjectUtil.isNotEmpty(action)) { if (RobotStatusEnum.DOING.getType().equals(v.getRobotStatus()) && ObjectUtil.isNotEmpty(action)) {
v.setRobotStatus(1); v.setRobotStatus(1);
CommandTypeEnum commandType = CommandTypeEnum.getCommandType(String.valueOf(action)); CommandTypeEnum commandType = CommandTypeEnum.getCommandType(String.valueOf(action));
if (ObjectUtil.isNotEmpty(commandType)) { if (ObjectUtil.isNotEmpty(commandType)) {
v.setMsg("车辆正在" + commandType.getMsg()); v.setMsg("车辆正在"+commandType.getMsg());
} }
} }
} }
@ -253,7 +251,6 @@ public class RobotInformationServiceImpl implements RobotInformationService {
/** /**
* 统计车辆待命/任务中/离线 * 统计车辆待命/任务中/离线
*
* @return * @return
*/ */
@Override @Override
@ -273,13 +270,13 @@ public class RobotInformationServiceImpl implements RobotInformationService {
Integer fault = 0; Integer fault = 0;
//0待命1任务中2锁定3离线4:充电中5:故障 //0待命1任务中2锁定3离线4:充电中5:故障
for (RobotInformationDO v : existRobot) { for (RobotInformationDO v : existRobot) {
String pose2dKey = RobotTaskChcheConstant.ROBOT_INFORMATION_POSE_BAT_SOC + v.getMacAddress(); String pose2dKey = RobotTaskChcheConstant.ROBOT_INFORMATION_POSE_BAT_SOC +v.getMacAddress();
Object object = redisUtil.get(pose2dKey); Object object = redisUtil.get(pose2dKey);
if (ObjectUtil.isEmpty(object)) { if (ObjectUtil.isEmpty(object)) {
offline++; offline++;
} else if (RobotTaskModelEnum.REJECTION.getType().equals(v.getRobotTaskModel())) { }else if (RobotTaskModelEnum.REJECTION.getType().equals(v.getRobotTaskModel())) {
doLock++; doLock++;
} else if (RobotStatusEnum.STAND_BY.getType().equals(v.getRobotStatus())) { }else if (RobotStatusEnum.STAND_BY.getType().equals(v.getRobotStatus())) {
//查看机器人最后做的任务是不是充电 //查看机器人最后做的任务是不是充电
RobotTaskDetailDO robotTaskDetailDO = taskDetailMapper.selectOne(new LambdaQueryWrapper<RobotTaskDetailDO>() RobotTaskDetailDO robotTaskDetailDO = taskDetailMapper.selectOne(new LambdaQueryWrapper<RobotTaskDetailDO>()
@ -290,11 +287,11 @@ public class RobotInformationServiceImpl implements RobotInformationService {
&& RobotTaskTypeEnum.CHARGE.getType().equals(robotTaskDetailDO.getTaskType()) && RobotTaskTypeEnum.CHARGE.getType().equals(robotTaskDetailDO.getTaskType())
&& RobotTaskStatusEnum.DOING.getType().equals(robotTaskDetailDO.getTaskStatus())) { && RobotTaskStatusEnum.DOING.getType().equals(robotTaskDetailDO.getTaskStatus())) {
charge++; charge++;
} else { }else {
standby++; standby++;
} }
} else if (RobotStatusEnum.DOING.getType().equals(v.getRobotStatus())) { }else if (RobotStatusEnum.DOING.getType().equals(v.getRobotStatus())) {
inTask++; inTask++;
} else { } else {
fault++; fault++;
@ -311,6 +308,7 @@ public class RobotInformationServiceImpl implements RobotInformationService {
} }
/** /**
*
* @return * @return
*/ */
@Override @Override
@ -328,7 +326,6 @@ public class RobotInformationServiceImpl implements RobotInformationService {
/** /**
* 根据mac查询机器人编号 * 根据mac查询机器人编号
*
* @param mac * @param mac
* @return * @return
*/ */
@ -347,7 +344,7 @@ public class RobotInformationServiceImpl implements RobotInformationService {
.eq(RobotInformationDO::getMacAddress, mac) .eq(RobotInformationDO::getMacAddress, mac)
.last("limit 1")); .last("limit 1"));
if (ObjectUtil.isNotEmpty(robotInformationDO)) { if (ObjectUtil.isNotEmpty(robotInformationDO)) {
redisUtil.set(RobotTaskChcheConstant.ROBOT_GET_ROBOTNO_BY_MAC + mac, robotInformationDO.getRobotNo()); redisUtil.set(RobotTaskChcheConstant.ROBOT_GET_ROBOTNO_BY_MAC + mac,robotInformationDO.getRobotNo());
return robotInformationDO.getRobotNo(); return robotInformationDO.getRobotNo();
} }
return ""; return "";

View File

@ -58,7 +58,7 @@ spring:
primary: master primary: master
datasource: datasource:
master: master:
url: jdbc:mysql://47.97.8.94:3306/zn_wcs?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&allowMultiQueries=true # MySQL Connector/J 8.X 连接的示例 url: jdbc:mysql://47.97.8.94:3306/zn_wcs?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
@ -72,7 +72,7 @@ spring:
# password: SYSDBA # DM 连接的示例 # password: SYSDBA # DM 连接的示例
slave: # 模拟从库,可根据自己需要修改 slave: # 模拟从库,可根据自己需要修改
lazy: true # 开启懒加载,保证启动速度 lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://47.97.8.94:3306/zn_wcs?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true&allowMultiQueries=true url: jdbc:mysql://47.97.8.94:3306/zn_wcs?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
username: root username: root
password: yhtkj@2024! password: yhtkj@2024!