Compare commits
5 Commits
a326ac143f
...
5c736b266f
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5c736b266f | ||
![]() |
bf598cf6f1 | ||
![]() |
30e724afe8 | ||
![]() |
570852382f | ||
![]() |
ed17f85c80 |
@ -213,6 +213,7 @@ public class CollectionUtils {
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 对比老、新两个列表,找出新增、修改、删除的数据
|
||||
*
|
||||
@ -253,6 +254,39 @@ public class CollectionUtils {
|
||||
return asList(createList, updateList, deleteList);
|
||||
}
|
||||
|
||||
public static <T> List<List<T>> compareLists(List<T> oldList, List<T> newList, BiPredicate<T, T> sameFunc) {
|
||||
List<T> added = new ArrayList<>();
|
||||
List<T> modified = new ArrayList<>();
|
||||
List<T> removed = new ArrayList<>(oldList); // 初始化为旧列表(后续动态移除匹配项)
|
||||
|
||||
// 单次双重循环:处理新增、修改,并动态计算删除列表
|
||||
for (T newItem : newList) {
|
||||
boolean isFound = false;
|
||||
T matchedOldItem = null;
|
||||
Iterator<T> it = removed.iterator(); // 指向待删除列表的迭代器
|
||||
|
||||
// 在待删除列表中查找匹配项
|
||||
while (it.hasNext()) {
|
||||
T oldItem = it.next();
|
||||
if (sameFunc.test(oldItem, newItem)) {
|
||||
isFound = true;
|
||||
matchedOldItem = oldItem;
|
||||
it.remove(); // 移除匹配的旧元素(表示它未被删除)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isFound) {
|
||||
added.add(newItem); // 未找到匹配,加入新增列表
|
||||
} else if (!newItem.equals(matchedOldItem)) {
|
||||
modified.add(newItem); // 找到匹配但内容不同,加入修改列表
|
||||
}
|
||||
}
|
||||
|
||||
// 此时removed中剩余的元素即为需删除的项
|
||||
return Arrays.asList(added, modified, removed);
|
||||
}
|
||||
|
||||
public static boolean containsAny(Collection<?> source, Collection<?> candidates) {
|
||||
return org.springframework.util.CollectionUtils.containsAny(source, candidates);
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.mqtt.api.path;
|
||||
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.RelatedPathNode;
|
||||
import cn.iocoder.yudao.module.mqtt.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "MQTT 服务 - 参数配置")
|
||||
public interface PathPlanningApi {
|
||||
String PREFIX = ApiConstants.PREFIX + "/config";
|
||||
|
||||
@PostMapping(PREFIX + "/synchronousPoint")
|
||||
@Operation(summary = "下发任务给车机")
|
||||
void synchronousPointToPP( @RequestBody RelatedPathNode relatedPathNode, @RequestParam("topic") String topic);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package cn.iocoder.yudao.module.mqtt.api.path.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PositionMapLineDTO {
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28062")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "地图id", example = "20863")
|
||||
private Long positionMapId;
|
||||
|
||||
@Schema(description = "出发点id(点位子表id)", example = "20863")
|
||||
private Long startingPointId;
|
||||
|
||||
@Schema(description = "结束点id(点位子表id)", example = "15890")
|
||||
private Long endPointId;
|
||||
|
||||
@Schema(description = "行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线")
|
||||
private Integer method;
|
||||
|
||||
@Schema(description = "方向 1.单向 2.双向", example = "15890")
|
||||
private Integer direction;
|
||||
|
||||
@Schema(description = "正向限速(m/s)", example = "15890")
|
||||
private BigDecimal forwardSpeedLimit;
|
||||
|
||||
@Schema(description = "反向限速(m/s)", example = "15890")
|
||||
private BigDecimal reverseSpeedLimit;
|
||||
|
||||
@Schema(description = "开始控制点x轴")
|
||||
private String beginControlX;
|
||||
|
||||
@Schema(description = "开始控制点y轴")
|
||||
private String beginControlY;
|
||||
|
||||
@Schema(description = "结束控制点x轴")
|
||||
private String endControlX;
|
||||
|
||||
@Schema(description = "结束控制点y轴")
|
||||
private String endControlY;
|
||||
|
||||
@Schema(description = "膨胀区域前")
|
||||
private BigDecimal expansionZoneFront;
|
||||
|
||||
@Schema(description = "膨胀区域后")
|
||||
private BigDecimal expansionZoneAfter;
|
||||
|
||||
@Schema(description = "膨胀区域左")
|
||||
private BigDecimal expansionZoneLeft;
|
||||
|
||||
@Schema(description = "膨胀区域右")
|
||||
private BigDecimal expansionZoneRight;
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)", example = "15890")
|
||||
private Integer toward;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.mqtt.api.path.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class RelatedPathNode {
|
||||
|
||||
@Schema(description = "楼层", example = "20863")
|
||||
private Integer floor;
|
||||
|
||||
@Schema(description = "区域", example = "20863")
|
||||
private String area;
|
||||
|
||||
@Schema(description = "点位状态(0:新增、1:删除、2:更新)", example = "20863")
|
||||
private Integer pointStatus = 0;
|
||||
|
||||
private List<PositionMapLineDTO> control_nodes;
|
||||
}
|
@ -20,5 +20,5 @@ public interface RobotTaskApi {
|
||||
|
||||
@PostMapping(PREFIX + "/distribute/tasks")
|
||||
@Operation(summary = "下发任务给车机")
|
||||
CommonResult<String> sendTaskToRobot(@Valid @RequestBody List<RobotAcceptTaskDTO> robotTaskDOS );
|
||||
void sendTaskToRobot(@Valid @RequestBody List<RobotAcceptTaskDTO> robotTaskDOS );
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package cn.iododer.yudao.module.mqtt.api.path;
|
||||
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.PathPlanningApi;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.RelatedPathNode;
|
||||
import cn.iododer.yudao.module.mqtt.util.MqttUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.paho.client.mqttv3.MqttException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class PathPlanningApiImpl implements PathPlanningApi {
|
||||
|
||||
@Autowired
|
||||
private MqttUtils mqttUtils;
|
||||
|
||||
@Override
|
||||
public void synchronousPointToPP(RelatedPathNode relatedPathNode, String topic) {
|
||||
try {
|
||||
mqttUtils.pub(topic, JSON.toJSONString(relatedPathNode));
|
||||
log.info("同步给路径规划完成 :{}", topic);
|
||||
} catch (MqttException e) {
|
||||
log.info("同步点位信息给路径规划异常 :{}",e);
|
||||
}
|
||||
}
|
||||
}
|
@ -24,18 +24,14 @@ public class RobotTaskApiImpl implements RobotTaskApi {
|
||||
private MqttUtils mqttUtils;
|
||||
|
||||
@Override
|
||||
public CommonResult<String> sendTaskToRobot(List<RobotAcceptTaskDTO> robotTaskDOS) {
|
||||
String str ="SUCCESS";
|
||||
public void sendTaskToRobot(List<RobotAcceptTaskDTO> robotTaskDOS) {
|
||||
for (RobotAcceptTaskDTO robotTaskDO : robotTaskDOS) {
|
||||
log.info("发送MQTT消息 :{}",JSON.toJSONString(robotTaskDO));
|
||||
try {
|
||||
mqttUtils.pub( robotTaskDO.getTopic(), JSON.toJSONString(robotTaskDO));
|
||||
} catch (Exception e) {
|
||||
log.info("消息发送异常 :{}",e.getMessage());
|
||||
str ="FAIL";
|
||||
}
|
||||
}
|
||||
|
||||
return success(str);
|
||||
}
|
||||
}
|
||||
|
@ -229,4 +229,7 @@ public interface ErrorCodeConstants {
|
||||
// ========== 车辆充电记录 1_002_043_001 ==========
|
||||
ErrorCode CHARGE_LOG_NOT_EXISTS = new ErrorCode(1_002_043_001, "车辆充电记录不存在");
|
||||
|
||||
// ========== 路径规划 1_002_044_001 ==========
|
||||
ErrorCode PATH_PLANNING_NOT_EXISTS = new ErrorCode(1_002_044_001, "不存在需要同步给路径规划的数据");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.system.constant.path;
|
||||
|
||||
/**
|
||||
* 下发给PP的TOPIC
|
||||
*/
|
||||
public class PathPlanningTopicConstant {
|
||||
/**
|
||||
* 同步全部地图点位
|
||||
*/
|
||||
public static String SYNCHRONOUS_ALL_MAP_POINT = "SYNCHRONOUS_MAP_POINT";
|
||||
|
||||
/**
|
||||
* 添加地图点位给PP
|
||||
*/
|
||||
public static String ADD_MAP_POINT = "ADD_MAP_POINT";
|
||||
|
||||
/**
|
||||
* 删除地图点位
|
||||
*/
|
||||
public static String DELETE_MAP_POINT = "DELETE_MAP_POINT";
|
||||
|
||||
/**
|
||||
* 更新地图点位
|
||||
*/
|
||||
public static String UPDATE_MAP_POINT = "UPDATE_MAP_POINT";
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package cn.iocoder.yudao.module.system.constant.robot;
|
||||
|
||||
/**
|
||||
* 下发给车机的TOPIC
|
||||
*/
|
||||
public class RobotTopicConstant {
|
||||
/**
|
||||
* 下发任务给车机的topic (拼接mac地址)
|
||||
*/
|
||||
public static String ROBOT_TASK_TOPIC = "ROBOT_TASK_";
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.bulletinboard;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.bulletinboard.vo.BulletinBoardVO;
|
||||
import cn.iocoder.yudao.module.system.service.bulletinboard.BulletinBoardService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 整体看板")
|
||||
@RestController
|
||||
@RequestMapping("/system/bulletinBoard")
|
||||
public class BulletinBoardController {
|
||||
|
||||
@Resource
|
||||
private BulletinBoardService bulletinBoardService;
|
||||
|
||||
@GetMapping({"/get"})
|
||||
@Operation(summary = "获取整体看板信息")
|
||||
@PermitAll
|
||||
public CommonResult<BulletinBoardVO> get() {
|
||||
BulletinBoardVO vo = bulletinBoardService.getBulletinBoard();
|
||||
return success(vo);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.bulletinboard.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotInformationStatisticsVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotWarnMsgDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class BulletinBoardVO {
|
||||
@Schema(description = "任务状态")
|
||||
private TaskStatusVO taskStatusVO;
|
||||
@Schema(description = "正在执行任务")
|
||||
private List<RobotTaskDO> underway;
|
||||
@Schema(description = "待执行任务")
|
||||
private List<RobotTaskDO> pendingExecution;
|
||||
@Schema(description = "车辆状态")
|
||||
private RobotInformationStatisticsVO statistics;
|
||||
@Schema(description = "车辆异常信息")
|
||||
private List<RobotWarnMsgDO> robotWarnMsgDOS;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.bulletinboard.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class RobotElectricityLevelVO {
|
||||
@Schema(description = "AGV编号")
|
||||
private String robotNo;
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
@Schema(description = "电量")
|
||||
private String batSoc;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.bulletinboard.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class TaskStatusVO {
|
||||
@Schema(description = "待执行")
|
||||
private Integer pendingExecutionNum;
|
||||
@Schema(description = "正在进行")
|
||||
private Integer underwayNum;
|
||||
@Schema(description = "已完成")
|
||||
private Integer completedNum;
|
||||
@Schema(description = "已取消")
|
||||
private Integer cancelledNum;
|
||||
@Schema(description = "异常")
|
||||
private Integer abnormalNum;
|
||||
@Schema(description = "当日任务数")
|
||||
private Integer tasksNumber;
|
||||
|
||||
}
|
@ -1,16 +1,14 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.path;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotInformationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.service.path.PathPlanningService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
@ -26,11 +24,11 @@ public class PathPlanningController {
|
||||
@Resource
|
||||
private PathPlanningService pathPlanningService;
|
||||
|
||||
@PutMapping("/synchronousPoint")
|
||||
@PostMapping("/synchronousPoint")
|
||||
@Operation(summary = "同步全部的点位信息")
|
||||
@PreAuthorize("@ss.hasPermission('robot:information:synchronousPoint')")
|
||||
public CommonResult<String> synchronousPoint() {
|
||||
pathPlanningService.synchronousPoint();
|
||||
public CommonResult<String> synchronousPoint(@RequestBody PositionMapSaveReqVO positionMapSaveReqVO) {
|
||||
pathPlanningService.synchronousPoint(positionMapSaveReqVO);
|
||||
return success("同步完成");
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,12 @@ public class NodeBaseDTO {
|
||||
@Schema(description = "坐标y轴")
|
||||
private String locationY;
|
||||
|
||||
@Schema(description = "实际坐标x轴")
|
||||
private String actualLocationX;
|
||||
|
||||
@Schema(description = "实际坐标y轴")
|
||||
private String actualLocationY;
|
||||
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 --- 后续补充", example = "1")
|
||||
private Integer type;
|
||||
|
||||
|
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.dto;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
public class PositionMapLineDTO {
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28062")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "地图id", example = "20863")
|
||||
private Long positionMapId;
|
||||
|
||||
@Schema(description = "出发点id(点位子表id)", example = "20863")
|
||||
private Long startingPointId;
|
||||
|
||||
@Schema(description = "结束点id(点位子表id)", example = "15890")
|
||||
private Long endPointId;
|
||||
|
||||
@Schema(description = "行走方法 0.直线 1.上左曲线2.上右曲线3.下左曲线 4.下右曲线")
|
||||
private Integer method;
|
||||
|
||||
@Schema(description = "方向 1.单向 2.双向", example = "15890")
|
||||
private Integer direction;
|
||||
|
||||
@Schema(description = "正向限速(m/s)", example = "15890")
|
||||
private BigDecimal forwardSpeedLimit;
|
||||
|
||||
@Schema(description = "反向限速(m/s)", example = "15890")
|
||||
private BigDecimal reverseSpeedLimit;
|
||||
|
||||
@Schema(description = "开始控制点x轴")
|
||||
private String beginControlX;
|
||||
|
||||
@Schema(description = "开始控制点y轴")
|
||||
private String beginControlY;
|
||||
|
||||
@Schema(description = "结束控制点x轴")
|
||||
private String endControlX;
|
||||
|
||||
@Schema(description = "结束控制点y轴")
|
||||
private String endControlY;
|
||||
|
||||
@Schema(description = "膨胀区域前")
|
||||
private BigDecimal expansionZoneFront;
|
||||
|
||||
@Schema(description = "膨胀区域后")
|
||||
private BigDecimal expansionZoneAfter;
|
||||
|
||||
@Schema(description = "膨胀区域左")
|
||||
private BigDecimal expansionZoneLeft;
|
||||
|
||||
@Schema(description = "膨胀区域右")
|
||||
private BigDecimal expansionZoneRight;
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)")
|
||||
private Integer toward;
|
||||
}
|
@ -28,6 +28,15 @@ public class PositionMapLinePageReqVO extends PageParam {
|
||||
@Schema(description = "结束点id(点位子表id)", example = "15890")
|
||||
private Long endPointId;
|
||||
|
||||
@Schema(description = "开始点位x轴", example = "15890")
|
||||
private String startPointX;
|
||||
@Schema(description = "开始点位y轴", example = "15890")
|
||||
private String startPointY;
|
||||
@Schema(description = "结束点位x轴", example = "15890")
|
||||
private String endPointX;
|
||||
@Schema(description = "结束点位y轴", example = "15890")
|
||||
private String endPointY;
|
||||
|
||||
@Schema(description = "开始控制点x轴", example = "15890")
|
||||
private String beginControlX;
|
||||
|
||||
@ -68,4 +77,8 @@ public class PositionMapLinePageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)", example = "15890")
|
||||
private Integer toward;
|
||||
|
||||
}
|
||||
|
@ -29,6 +29,15 @@ public class PositionMapLineRespVO {
|
||||
@ExcelProperty("结束点id(点位子表id)")
|
||||
private Long endPointId;
|
||||
|
||||
@Schema(description = "开始点位x轴", example = "15890")
|
||||
private String startPointX;
|
||||
@Schema(description = "开始点位y轴", example = "15890")
|
||||
private String startPointY;
|
||||
@Schema(description = "结束点位x轴", example = "15890")
|
||||
private String endPointX;
|
||||
@Schema(description = "结束点位y轴", example = "15890")
|
||||
private String endPointY;
|
||||
|
||||
@Schema(description = "开始控制点x轴", example = "15890")
|
||||
@ExcelProperty("开始控制点x轴")
|
||||
private String beginControlX;
|
||||
@ -81,4 +90,8 @@ public class PositionMapLineRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)", example = "15890")
|
||||
@ExcelProperty("车头朝向( 0:正向 1:反向)")
|
||||
private Integer toward;
|
||||
|
||||
}
|
||||
|
@ -25,6 +25,15 @@ public class PositionMapLineSaveReqVO {
|
||||
@Schema(description = "结束点id(点位子表id)", example = "15890")
|
||||
private Long endPointId;
|
||||
|
||||
@Schema(description = "开始点位x轴", example = "15890")
|
||||
private String startPointX;
|
||||
@Schema(description = "开始点位y轴", example = "15890")
|
||||
private String startPointY;
|
||||
@Schema(description = "结束点位x轴", example = "15890")
|
||||
private String endPointX;
|
||||
@Schema(description = "结束点位y轴", example = "15890")
|
||||
private String endPointY;
|
||||
|
||||
@Schema(description = "开始控制点x轴", example = "15890")
|
||||
private String beginControlX;
|
||||
|
||||
@ -61,4 +70,8 @@ public class PositionMapLineSaveReqVO {
|
||||
@Schema(description = "反向限速(m/s)", example = "15890")
|
||||
private BigDecimal reverseSpeedLimit;
|
||||
|
||||
|
||||
@Schema(description = "车头朝向( 0:正向 1:反向)", example = "15890")
|
||||
private Integer toward;
|
||||
|
||||
}
|
||||
|
@ -24,4 +24,7 @@ public class RobotInformationStatisticsVO {
|
||||
@Schema(description = "故障")
|
||||
private Integer fault = 0;
|
||||
|
||||
@Schema(description = "总数")
|
||||
private Integer total = 0;
|
||||
|
||||
}
|
||||
|
@ -94,6 +94,14 @@ public class WareHouseLocationDO extends BaseDO {
|
||||
* 库位坐标y轴
|
||||
*/
|
||||
private String locationY;
|
||||
/**
|
||||
* 实际坐标x轴
|
||||
*/
|
||||
private String actualLocationX;
|
||||
/**
|
||||
* 实际坐标y轴
|
||||
*/
|
||||
private String actualLocationY;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
|
@ -50,6 +50,14 @@ public class DeviceInformationDO extends BaseDO {
|
||||
* 库位坐标y轴
|
||||
*/
|
||||
private String locationY;
|
||||
/**
|
||||
* 实际坐标x轴
|
||||
*/
|
||||
private String actualLocationX;
|
||||
/**
|
||||
* 实际坐标y轴
|
||||
*/
|
||||
private String actualLocationY;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
|
@ -45,6 +45,14 @@ public class ParkingSpotDO extends BaseDO {
|
||||
* 库位坐标y轴
|
||||
*/
|
||||
private String locationY;
|
||||
/**
|
||||
* 实际坐标x轴
|
||||
*/
|
||||
private String actualLocationX;
|
||||
/**
|
||||
* 实际坐标y轴
|
||||
*/
|
||||
private String actualLocationY;
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.dal.dataobject.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
@ -45,6 +46,14 @@ public class PositionMapItemDO extends BaseDO {
|
||||
* 坐标y轴
|
||||
*/
|
||||
private String locationY;
|
||||
/**
|
||||
* 实际坐标x轴
|
||||
*/
|
||||
private String actualLocationX;
|
||||
/**
|
||||
* 实际坐标y轴
|
||||
*/
|
||||
private String actualLocationY;
|
||||
/**
|
||||
* 类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 --- 后续补充
|
||||
*/
|
||||
|
@ -42,6 +42,22 @@ public class PositionMapLineDO extends BaseDO {
|
||||
* 结束点id(点位子表id)
|
||||
*/
|
||||
private Long endPointId;
|
||||
/**
|
||||
* 开始点位x轴
|
||||
*/
|
||||
private String startPointX;
|
||||
/**
|
||||
* 开始点位y轴
|
||||
*/
|
||||
private String startPointY;
|
||||
/**
|
||||
* 结束点位x轴
|
||||
*/
|
||||
private String endPointX;
|
||||
/**
|
||||
* 结束点位y轴
|
||||
*/
|
||||
private String endPointY;
|
||||
/**
|
||||
* 开始控制点x轴
|
||||
*/
|
||||
@ -91,4 +107,8 @@ public class PositionMapLineDO extends BaseDO {
|
||||
*/
|
||||
private BigDecimal reverseSpeedLimit;
|
||||
|
||||
/**
|
||||
* 车头朝向( 0:正向 1:反向)
|
||||
*/
|
||||
private Integer toward;
|
||||
}
|
||||
|
@ -3,10 +3,13 @@ package cn.iocoder.yudao.module.system.dal.mysql.positionmap;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.PositionMapLineDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLinePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓库点位地图连线 Mapper
|
||||
*
|
||||
@ -24,4 +27,9 @@ public interface PositionMapLineMapper extends BaseMapperX<PositionMapLineDO> {
|
||||
.orderByDesc(PositionMapLineDO::getId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看所有的点位地图连线
|
||||
* @return
|
||||
*/
|
||||
List<PositionMapLineDTO> getAllPositionMapLine(PositionMapLineDO positionMapLineDO);
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.enums.line;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* ware_position_map_line表的direction
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DirectionEnum {
|
||||
|
||||
ONE_WAY(1,"单向"),
|
||||
TWO_WAY(2,"双向");
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
|
||||
private final String msg;
|
||||
}
|
@ -12,7 +12,8 @@ public enum RobotTaskDetailStatusEnum {
|
||||
NEW(0),//未开始
|
||||
DOING(1),//执行中
|
||||
DONE(2),//已完成
|
||||
CLOSE(3); //已取消
|
||||
CLOSE(3), //已取消
|
||||
ABNORMAL(4); //异常
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
|
@ -1,14 +0,0 @@
|
||||
package cn.iocoder.yudao.module.system.enums.robot;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RobotTopicEnum {
|
||||
ROBOT_TASK("ROBOT_TASK_"); //下发指令给车机
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final String topic;
|
||||
}
|
@ -1,10 +1,11 @@
|
||||
package cn.iocoder.yudao.module.system.framework.mqtt;
|
||||
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.PathPlanningApi;
|
||||
import cn.iocoder.yudao.module.mqtt.api.task.RobotTaskApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {RobotTaskApi.class})
|
||||
@EnableFeignClients(clients = {RobotTaskApi.class, PathPlanningApi.class})
|
||||
public class MqttConfiguration {
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -66,7 +67,7 @@ public class NodeProcessingContext {
|
||||
strategy.processNodes(positionMapId, nodeBaseDTOS);
|
||||
|
||||
List<PositionMapItemDO> newList = BeanUtil.copyToList(nodeBaseDTOS, PositionMapItemDO.class);
|
||||
List<List<PositionMapItemDO>> list = CollectionUtils.diffList(oldItemList, newList,
|
||||
List<List<PositionMapItemDO>> list = CollectionUtils.compareLists(oldItemList, newList,
|
||||
(oldVal, newVal) -> ObjectUtil.equal(oldVal.getId(), newVal.getId()));
|
||||
positionMapItemService.batchSaveOrEditOrDel(positionMapId, list);
|
||||
}
|
||||
|
@ -32,6 +32,8 @@ public class DeviceStrategyImpl implements NodeProcessingStrategy {
|
||||
DeviceInformationDO deviceInformationDO = JSONUtil.toBean(item.getDataJson(), DeviceInformationDO.class);
|
||||
deviceInformationDO.setLocationX(item.getLocationX());
|
||||
deviceInformationDO.setLocationY(item.getLocationY());
|
||||
deviceInformationDO.setActualLocationX(item.getActualLocationX());
|
||||
deviceInformationDO.setActualLocationY(item.getActualLocationY());
|
||||
|
||||
deviceInformationDO.setPositionMapId(positionMapId);
|
||||
deviceInformationDO.setPositionMapItemId(item.getId());
|
||||
|
@ -38,6 +38,8 @@ public class HouseLocationStrategyImpl implements NodeProcessingStrategy {
|
||||
for (WareHouseLocationDO wareHouseLocationDO : wareHouseLocationDOS) {
|
||||
wareHouseLocationDO.setLocationX(item.getLocationX());
|
||||
wareHouseLocationDO.setLocationY(item.getLocationY());
|
||||
wareHouseLocationDO.setActualLocationX(item.getActualLocationX());
|
||||
wareHouseLocationDO.setActualLocationY(item.getActualLocationY());
|
||||
if (wareHouseLocationDO.getId() == null) {
|
||||
wareHouseLocationDO.setId(getId());
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ public class ParkingSpotStrategyImpl implements NodeProcessingStrategy {
|
||||
}
|
||||
parkingSpotDO.setLocationX(item.getLocationX());
|
||||
parkingSpotDO.setLocationY(item.getLocationY());
|
||||
parkingSpotDO.setActualLocationX(item.getLocationX());
|
||||
parkingSpotDO.setActualLocationY(item.getLocationY());
|
||||
|
||||
parkingSpotDO.setPositionMapId(positionMapId);
|
||||
parkingSpotDO.setPositionMapItemId(item.getId());
|
||||
|
@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.system.service.bulletinboard;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.bulletinboard.vo.BulletinBoardVO;
|
||||
|
||||
/**
|
||||
* 获取看板信息 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface BulletinBoardService {
|
||||
|
||||
/**
|
||||
* 获取看板信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
BulletinBoardVO getBulletinBoard();
|
||||
}
|
@ -0,0 +1,114 @@
|
||||
package cn.iocoder.yudao.module.system.service.bulletinboard;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
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.controller.admin.bulletinboard.vo.BulletinBoardVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.bulletinboard.vo.RobotElectricityLevelVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.bulletinboard.vo.TaskStatusVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotInformationStatisticsVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotWarnMsgDO;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotTaskDetailStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotInformationService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotTaskService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotWarnMsgService;
|
||||
import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 获取看板信息 Service 实现类
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BulletinBoardServiceImpl implements BulletinBoardService {
|
||||
@Resource
|
||||
private RobotTaskService taskService;
|
||||
@Resource
|
||||
private RobotWarnMsgService robotWarnMsgService;
|
||||
@Resource
|
||||
private RobotInformationService robotInformationService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Override
|
||||
public BulletinBoardVO getBulletinBoard() {
|
||||
BulletinBoardVO vo = new BulletinBoardVO();
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<RobotTaskDO> list = taskService.list(new LambdaQueryWrapperX<RobotTaskDO>()
|
||||
.ge(RobotTaskDO::getCreateTime, LocalDateTimeUtil.beginOfDay(now)));
|
||||
Map<Integer, List<RobotTaskDO>> taskMap = list.stream().collect(Collectors.groupingBy(RobotTaskDO::getTaskStatus));
|
||||
// 任务状态
|
||||
TaskStatusVO taskStatusVO = new TaskStatusVO();
|
||||
|
||||
// 正在执行
|
||||
List<RobotTaskDO> underway = taskMap.get(RobotTaskDetailStatusEnum.DOING.getType());
|
||||
//根据时间降序
|
||||
if (CollectionUtil.isNotEmpty(underway)) {
|
||||
underway.sort((o1, o2) -> o2.getStartTime().compareTo(o1.getStartTime()));
|
||||
}
|
||||
// 待执行
|
||||
List<RobotTaskDO> pendingExecution = taskMap.get(RobotTaskDetailStatusEnum.NEW.getType());
|
||||
//根据时间降序
|
||||
if (CollectionUtil.isNotEmpty(pendingExecution)) {
|
||||
pendingExecution.sort((o1, o2) -> o2.getCreateTime().compareTo(o1.getCreateTime()));
|
||||
}
|
||||
// 已完成
|
||||
List<RobotTaskDO> completed = taskMap.get(RobotTaskDetailStatusEnum.DONE.getType());
|
||||
// 已取消
|
||||
List<RobotTaskDO> cancelled = taskMap.get(RobotTaskDetailStatusEnum.CLOSE.getType());
|
||||
taskStatusVO.setPendingExecutionNum(CollectionUtil.isEmpty(pendingExecution) ? 0 : pendingExecution.size());
|
||||
taskStatusVO.setUnderwayNum(CollectionUtil.isEmpty(underway) ? 0 : underway.size());
|
||||
taskStatusVO.setCompletedNum(CollectionUtil.isEmpty(completed) ? 0 : completed.size());
|
||||
taskStatusVO.setCancelledNum(CollectionUtil.isEmpty(cancelled) ? 0 : cancelled.size());
|
||||
int abnormalNum = CollectionUtil.isEmpty(taskMap.get(RobotTaskDetailStatusEnum.ABNORMAL.getType())) ? 0 : taskMap.get(RobotTaskDetailStatusEnum.ABNORMAL.getType()).size();
|
||||
taskStatusVO.setAbnormalNum(abnormalNum);
|
||||
taskStatusVO.setTasksNumber(list.size());
|
||||
vo.setTaskStatusVO(taskStatusVO);
|
||||
|
||||
// 获取车辆异常信息
|
||||
List<RobotWarnMsgDO> robotWarnMsgDOS = robotWarnMsgService.list(new LambdaQueryWrapperX<RobotWarnMsgDO>()
|
||||
.ge(RobotWarnMsgDO::getCreateTime, LocalDateTimeUtil.beginOfDay(now)));
|
||||
|
||||
// 正在执行任务
|
||||
vo.setUnderway(underway);
|
||||
// 待执行任务
|
||||
vo.setPendingExecution(pendingExecution);
|
||||
|
||||
// 车辆状态
|
||||
RobotInformationStatisticsVO statisticsVO = robotInformationService.statisticsInformation();
|
||||
vo.setStatistics(statisticsVO);
|
||||
// 车辆异常信息
|
||||
vo.setRobotWarnMsgDOS(robotWarnMsgDOS);
|
||||
|
||||
List<RobotElectricityLevelVO> robotElectricityLevelVOS = new ArrayList<>();
|
||||
List<RobotInformationDO> allRobot = robotInformationService.getAllRobot();
|
||||
for (RobotInformationDO robotInformationDO : allRobot) {
|
||||
String pose2dKey = RobotTaskChcheConstant.ROBOT_INFORMATION_POSE_BAT_SOC + robotInformationDO.getMacAddress();
|
||||
Object object = redisUtil.get(pose2dKey);
|
||||
RobotStatusDataPoseDTO robotStatusDataPoseDTO = JSONUtil.toBean((String) object, RobotStatusDataPoseDTO.class);
|
||||
if (robotStatusDataPoseDTO != null) {
|
||||
RobotElectricityLevelVO robotElectricityLevelVO = new RobotElectricityLevelVO();
|
||||
robotElectricityLevelVO.setRobotNo(robotInformationDO.getRobotNo());
|
||||
robotElectricityLevelVO.setBatSoc(robotStatusDataPoseDTO.getBat_soc());
|
||||
robotElectricityLevelVOS.add(robotElectricityLevelVO);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.system.service.path;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapSaveReqVO;
|
||||
|
||||
public interface PathPlanningService {
|
||||
void synchronousPoint();
|
||||
void synchronousPoint(PositionMapSaveReqVO positionMapSaveReqVO);
|
||||
}
|
||||
|
@ -1,8 +1,30 @@
|
||||
package cn.iocoder.yudao.module.system.service.path;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.PathPlanningApi;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.PositionMapLineDTO;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.RelatedPathNode;
|
||||
import cn.iocoder.yudao.module.system.constant.path.PathPlanningTopicConstant;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapLineMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.line.DirectionEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.PATH_PLANNING_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 同步信息给车辆
|
||||
@ -12,11 +34,120 @@ import org.springframework.validation.annotation.Validated;
|
||||
public class PathPlanningServiceImpl implements PathPlanningService {
|
||||
|
||||
|
||||
@Resource
|
||||
private PositionMapLineMapper positionMapLineMapper;
|
||||
|
||||
@Resource
|
||||
private PositionMapMapper positionMapMapper;
|
||||
|
||||
public static ExecutorService executor = Executors.newFixedThreadPool(5);
|
||||
|
||||
@Resource
|
||||
private PathPlanningApi pathPlanningApi;
|
||||
|
||||
/**
|
||||
* 同步全部的点位信息
|
||||
*/
|
||||
@Override
|
||||
public void synchronousPoint() {
|
||||
public void synchronousPoint(PositionMapSaveReqVO data) {
|
||||
|
||||
List<PositionMapDO> positionMapDOS = positionMapMapper.selectList(new LambdaQueryWrapperX<PositionMapDO>()
|
||||
.eq(ObjectUtil.isNotEmpty(data.getFloor()), PositionMapDO::getFloor, data.getFloor())
|
||||
.eq(ObjectUtil.isNotEmpty(data.getArea()), PositionMapDO::getArea, data.getArea()));
|
||||
|
||||
PositionMapLineDO positionMapLineDO = new PositionMapLineDO();
|
||||
List<PositionMapLineDTO> positionLines = positionMapLineMapper.getAllPositionMapLine(positionMapLineDO);
|
||||
|
||||
// List<PositionMapLineDO> positionLines = positionMapLineMapper.selectList(new LambdaQueryWrapperX<PositionMapLineDO>());
|
||||
if (ObjectUtil.isEmpty(positionMapDOS) || ObjectUtil.isEmpty(positionLines)) {
|
||||
throw exception(PATH_PLANNING_NOT_EXISTS);
|
||||
}
|
||||
|
||||
Map<Long, List<PositionMapLineDTO>> positionMapLineMap = positionLines.stream()
|
||||
.collect(Collectors.groupingBy(PositionMapLineDTO::getPositionMapId));
|
||||
for (PositionMapDO positionMapDO : positionMapDOS) {
|
||||
RelatedPathNode relatedPathNode = new RelatedPathNode();
|
||||
relatedPathNode.setFloor(positionMapDO.getFloor());
|
||||
relatedPathNode.setArea(positionMapDO.getArea());
|
||||
List<PositionMapLineDTO> positionMapLineDOS = positionMapLineMap.get(positionMapDO.getId());
|
||||
if (ObjectUtil.isEmpty(positionMapLineDOS)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
assembleDataToPP(relatedPathNode,positionMapLineDOS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装数据发送到PP
|
||||
* @param relatedPathNode
|
||||
* @param positionMapLineDOS
|
||||
*/
|
||||
private void assembleDataToPP(RelatedPathNode relatedPathNode, List<PositionMapLineDTO> positionMapLineDOS) {
|
||||
executor.execute(() -> {
|
||||
List<PositionMapLineDTO> list = new ArrayList<>();
|
||||
for (PositionMapLineDTO positionMapLineDO : positionMapLineDOS) {
|
||||
list.add(positionMapLineDO);
|
||||
if (DirectionEnum.ONE_WAY.getType().equals(positionMapLineDO.getDirection())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
PositionMapLineDTO build = PositionMapLineDTO.builder()
|
||||
.id(positionMapLineDO.getId())
|
||||
.positionMapId(positionMapLineDO.getPositionMapId())
|
||||
.startingPointId(positionMapLineDO.getEndPointId())
|
||||
.endPointId(positionMapLineDO.getStartingPointId())
|
||||
.direction(1)
|
||||
.forwardSpeedLimit(positionMapLineDO.getReverseSpeedLimit())
|
||||
.reverseSpeedLimit(positionMapLineDO.getForwardSpeedLimit())
|
||||
.beginControlX(positionMapLineDO.getEndControlX())
|
||||
.beginControlY(positionMapLineDO.getEndControlY())
|
||||
.endControlX(positionMapLineDO.getBeginControlX())
|
||||
.endControlY(positionMapLineDO.getBeginControlY())
|
||||
.expansionZoneFront(positionMapLineDO.getExpansionZoneAfter())
|
||||
.expansionZoneAfter(positionMapLineDO.getExpansionZoneFront())
|
||||
.expansionZoneLeft(positionMapLineDO.getExpansionZoneRight())
|
||||
.expansionZoneRight(positionMapLineDO.getExpansionZoneLeft())
|
||||
.toward(positionMapLineDO.getToward())
|
||||
.build();
|
||||
list.add(build);
|
||||
}
|
||||
|
||||
relatedPathNode.setControl_nodes(list);
|
||||
|
||||
pathPlanningApi.synchronousPointToPP(relatedPathNode, PathPlanningTopicConstant.SYNCHRONOUS_ALL_MAP_POINT);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ public class RobotInformationServiceImpl implements RobotInformationService {
|
||||
}
|
||||
|
||||
if (RobotStatisticsTypeEnum.OFFLINE.getType().equals(pageReqVO.getRobotStatisticsType())
|
||||
&& v.getOnlineStatus().equals(1)) {
|
||||
&& v.getOnlineStatus().equals(0)) {
|
||||
resultList.add(v);
|
||||
continue;
|
||||
}
|
||||
@ -216,8 +216,6 @@ public class RobotInformationServiceImpl implements RobotInformationService {
|
||||
v.setElectricity(robotStatusDataPoseDTO.getBat_soc());
|
||||
v.setFloor(robotStatusDataPoseDTO.getFloor());
|
||||
v.setArea(robotStatusDataPoseDTO.getArea());
|
||||
} else if (ObjectUtil.isEmpty(object)) {
|
||||
//离线
|
||||
v.setOnlineStatus(1);
|
||||
}
|
||||
|
||||
@ -273,32 +271,35 @@ public class RobotInformationServiceImpl implements RobotInformationService {
|
||||
Integer fault = 0;
|
||||
//0:待命、1:任务中、2:锁定、3:离线、4:充电中、5:故障
|
||||
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);
|
||||
if (ObjectUtil.isEmpty(object)) {
|
||||
offline++;
|
||||
} else if (RobotTaskModelEnum.REJECTION.getType().equals(v.getRobotTaskModel())) {
|
||||
doLock++;
|
||||
} else if (RobotStatusEnum.STAND_BY.getType().equals(v.getRobotStatus())) {
|
||||
|
||||
//查看机器人最后做的任务是不是充电
|
||||
RobotTaskDetailDO robotTaskDetailDO = taskDetailMapper.selectOne(new LambdaQueryWrapper<RobotTaskDetailDO>()
|
||||
.eq(RobotTaskDetailDO::getRobotNo, v.getRobotNo())
|
||||
.orderByDesc(RobotTaskDetailDO::getCreateTime)
|
||||
.last("limit 1"));
|
||||
if (ObjectUtil.isNotEmpty(robotTaskDetailDO)
|
||||
&& RobotTaskTypeEnum.CHARGE.getType().equals(robotTaskDetailDO.getTaskType())
|
||||
&& RobotTaskStatusEnum.DOING.getType().equals(robotTaskDetailDO.getTaskStatus())) {
|
||||
charge++;
|
||||
} else {
|
||||
standby++;
|
||||
if (ObjectUtil.isEmpty(object)) {
|
||||
//离线
|
||||
offline++;
|
||||
}
|
||||
|
||||
} else if (RobotStatusEnum.DOING.getType().equals(v.getRobotStatus())) {
|
||||
inTask++;
|
||||
} else {
|
||||
if (RobotTaskModelEnum.REJECTION.getType().equals(v.getRobotTaskModel())) {
|
||||
//锁定
|
||||
doLock++;
|
||||
}
|
||||
//设置异常
|
||||
String errorLevelKey = RobotTaskChcheConstant.ROBOT_ERROR_LEVEL +v.getMacAddress();
|
||||
Object errorLevel = redisUtil.get(errorLevelKey);
|
||||
if (ObjectUtil.isNotEmpty(errorLevel) && Integer.valueOf(errorLevel.toString()).intValue() >= 3) {
|
||||
fault++;
|
||||
}
|
||||
|
||||
if (RobotStatusEnum.STAND_BY.getType().equals(v.getRobotStatus())) {
|
||||
//待命中
|
||||
standby++;
|
||||
}else if (RobotStatusEnum.CHARGE.getType().equals(v.getRobotStatus())) {
|
||||
//充电中
|
||||
charge++;
|
||||
}else {
|
||||
//任务中
|
||||
inTask++;
|
||||
}
|
||||
}
|
||||
info.setStandby(standby);
|
||||
info.setInTask(inTask);
|
||||
@ -306,6 +307,7 @@ public class RobotInformationServiceImpl implements RobotInformationService {
|
||||
info.setOffline(offline);
|
||||
info.setCharge(charge);
|
||||
info.setFault(fault);
|
||||
info.setTotal(existRobot.size());
|
||||
|
||||
return info;
|
||||
}
|
||||
|
@ -8,13 +8,14 @@ import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskPageReq
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 机器人任务主表 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface RobotTaskService {
|
||||
public interface RobotTaskService extends IService<RobotTaskDO> {
|
||||
|
||||
/**
|
||||
* 创建机器人任务主表
|
||||
|
@ -2,7 +2,9 @@ package cn.iocoder.yudao.module.system.service.robot;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.*;
|
||||
@ -19,24 +21,23 @@ import cn.iocoder.yudao.module.system.enums.robot.*;
|
||||
import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
|
||||
import cn.iocoder.yudao.module.system.util.redis.RedissonUtils;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.redisson.api.RLock;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
@ -49,7 +50,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
@Slf4j
|
||||
@Service
|
||||
@Validated
|
||||
public class RobotTaskServiceImpl implements RobotTaskService {
|
||||
public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper,RobotTaskDO> implements RobotTaskService {
|
||||
|
||||
private final String RESULT = "SUCCESS";
|
||||
|
||||
|
@ -7,13 +7,14 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotWarnMsgPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotWarnMsgSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotWarnMsgDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 机器人告警信息 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface RobotWarnMsgService {
|
||||
public interface RobotWarnMsgService extends IService<RobotWarnMsgDO> {
|
||||
|
||||
/**
|
||||
* 创建机器人告警信息
|
||||
|
@ -1,18 +1,16 @@
|
||||
package cn.iocoder.yudao.module.system.service.robot;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotWarnMsgPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotWarnMsgSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotWarnMsgDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotWarnMsgMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.WARN_MSG_NOT_EXISTS;
|
||||
@ -24,7 +22,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.WARN_MSG_N
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class RobotWarnMsgServiceImpl implements RobotWarnMsgService {
|
||||
public class RobotWarnMsgServiceImpl extends ServiceImpl<RobotWarnMsgMapper, RobotWarnMsgDO> implements RobotWarnMsgService {
|
||||
|
||||
@Resource
|
||||
private RobotWarnMsgMapper warnMsgMapper;
|
||||
|
@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.mqtt.api.task.dto.RobotAcceptTaskData;
|
||||
import cn.iocoder.yudao.module.system.api.robot.dto.RobotStatusDataPoseDTO;
|
||||
import cn.iocoder.yudao.module.system.constant.robot.RobotStatusCodeConstant;
|
||||
import cn.iocoder.yudao.module.system.constant.robot.RobotTaskChcheConstant;
|
||||
import cn.iocoder.yudao.module.system.constant.robot.RobotTopicConstant;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.config.vo.CommonConfigVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
@ -405,7 +406,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
RobotAcceptTaskDTO robotTaskDO = new RobotAcceptTaskDTO();
|
||||
robotTaskDO.setOrder_id(taskDetailDO.getId().toString());
|
||||
robotTaskDO.setOrder_type("出库");//未定
|
||||
robotTaskDO.setTopic(RobotTopicEnum.ROBOT_TASK.getTopic()+macAddress);
|
||||
robotTaskDO.setTopic(RobotTopicConstant.ROBOT_TASK_TOPIC+macAddress);
|
||||
|
||||
//1
|
||||
RobotAcceptTaskData taskOne = new RobotAcceptTaskData();
|
||||
@ -473,7 +474,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
RobotAcceptTaskDTO robotTaskDO = new RobotAcceptTaskDTO();
|
||||
robotTaskDO.setOrder_id(taskDetailDO.getId().toString());
|
||||
robotTaskDO.setOrder_type("出库");//未定
|
||||
robotTaskDO.setTopic(RobotTopicEnum.ROBOT_TASK.getTopic()+macAddress);
|
||||
robotTaskDO.setTopic(RobotTopicConstant.ROBOT_TASK_TOPIC+macAddress);
|
||||
|
||||
RobotAcceptTaskData taskOne = new RobotAcceptTaskData();
|
||||
taskOne.setSerial("1");
|
||||
@ -532,7 +533,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
RobotAcceptTaskDTO robotTaskDO = new RobotAcceptTaskDTO();
|
||||
robotTaskDO.setOrder_id(taskDetailDO.getId().toString());
|
||||
robotTaskDO.setOrder_type("出库");//未定
|
||||
robotTaskDO.setTopic(RobotTopicEnum.ROBOT_TASK.getTopic()+macAddress);
|
||||
robotTaskDO.setTopic(RobotTopicConstant.ROBOT_TASK_TOPIC+macAddress);
|
||||
|
||||
//1
|
||||
RobotAcceptTaskData taskOne = new RobotAcceptTaskData();
|
||||
|
@ -2,11 +2,358 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapLineMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO">
|
||||
<!--@Table ware_position_map_line-->
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="positionMapId" column="position_map_id" jdbcType="INTEGER"/>
|
||||
<result property="startingPointId" column="starting_point_id" jdbcType="INTEGER"/>
|
||||
<result property="endPointId" column="end_point_id" jdbcType="INTEGER"/>
|
||||
<result property="beginControlX" column="begin_control_x" jdbcType="VARCHAR"/>
|
||||
<result property="beginControlY" column="begin_control_y" jdbcType="VARCHAR"/>
|
||||
<result property="endControlX" column="end_control_x" jdbcType="VARCHAR"/>
|
||||
<result property="endControlY" column="end_control_y" jdbcType="VARCHAR"/>
|
||||
<result property="expansionZoneFront" column="expansion_zone_front" jdbcType="NUMERIC"/>
|
||||
<result property="expansionZoneAfter" column="expansion_zone_after" jdbcType="NUMERIC"/>
|
||||
<result property="expansionZoneLeft" column="expansion_zone_left" jdbcType="NUMERIC"/>
|
||||
<result property="expansionZoneRight" column="expansion_zone_right" jdbcType="NUMERIC"/>
|
||||
<result property="method" column="method" jdbcType="INTEGER"/>
|
||||
<result property="direction" column="direction" jdbcType="INTEGER"/>
|
||||
<result property="forwardSpeedLimit" column="forward_speed_limit" jdbcType="NUMERIC"/>
|
||||
<result property="reverseSpeedLimit" column="reverse_speed_limit" jdbcType="NUMERIC"/>
|
||||
<result property="creator" column="creator" jdbcType="VARCHAR"/>
|
||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="updater" column="updater" jdbcType="VARCHAR"/>
|
||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="deleted" column="deleted" jdbcType="INTEGER"/>
|
||||
<result property="toward" column="toward" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<!--查询单个-->
|
||||
<select id="queryById" resultMap="BaseResultMap">
|
||||
select
|
||||
id, position_map_id, starting_point_id, end_point_id, begin_control_x, begin_control_y, end_control_x, end_control_y, expansion_zone_front, expansion_zone_after, expansion_zone_left, expansion_zone_right, method, direction, forward_speed_limit, reverse_speed_limit, creator, create_time, updater, update_time, deleted, tenant_id, toward
|
||||
from ware_position_map_line
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<!--查询指定行数据-->
|
||||
<select id="queryAllByLimit" resultMap="BaseResultMap">
|
||||
select
|
||||
id, position_map_id, starting_point_id, end_point_id, begin_control_x, begin_control_y, end_control_x, end_control_y, expansion_zone_front, expansion_zone_after, expansion_zone_left, expansion_zone_right, method, direction, forward_speed_limit, reverse_speed_limit, creator, create_time, updater, update_time, deleted, tenant_id, toward
|
||||
from ware_position_map_line
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="positionMapId != null">
|
||||
and position_map_id = #{positionMapId}
|
||||
</if>
|
||||
<if test="startingPointId != null">
|
||||
and starting_point_id = #{startingPointId}
|
||||
</if>
|
||||
<if test="endPointId != null">
|
||||
and end_point_id = #{endPointId}
|
||||
</if>
|
||||
<if test="beginControlX != null and beginControlX != ''">
|
||||
and begin_control_x = #{beginControlX}
|
||||
</if>
|
||||
<if test="beginControlY != null and beginControlY != ''">
|
||||
and begin_control_y = #{beginControlY}
|
||||
</if>
|
||||
<if test="endControlX != null and endControlX != ''">
|
||||
and end_control_x = #{endControlX}
|
||||
</if>
|
||||
<if test="endControlY != null and endControlY != ''">
|
||||
and end_control_y = #{endControlY}
|
||||
</if>
|
||||
<if test="expansionZoneFront != null">
|
||||
and expansion_zone_front = #{expansionZoneFront}
|
||||
</if>
|
||||
<if test="expansionZoneAfter != null">
|
||||
and expansion_zone_after = #{expansionZoneAfter}
|
||||
</if>
|
||||
<if test="expansionZoneLeft != null">
|
||||
and expansion_zone_left = #{expansionZoneLeft}
|
||||
</if>
|
||||
<if test="expansionZoneRight != null">
|
||||
and expansion_zone_right = #{expansionZoneRight}
|
||||
</if>
|
||||
<if test="method != null">
|
||||
and method = #{method}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
and direction = #{direction}
|
||||
</if>
|
||||
<if test="forwardSpeedLimit != null">
|
||||
and forward_speed_limit = #{forwardSpeedLimit}
|
||||
</if>
|
||||
<if test="reverseSpeedLimit != null">
|
||||
and reverse_speed_limit = #{reverseSpeedLimit}
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
and creator = #{creator}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
and updater = #{updater}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
and deleted = #{deleted}
|
||||
</if>
|
||||
<if test="toward != null">
|
||||
and toward = #{toward}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageable.offset}, #{pageable.pageSize}
|
||||
</select>
|
||||
|
||||
<!--通过实体作为筛选条件查询-->
|
||||
<sql id="base_sql" >
|
||||
id,
|
||||
position_map_id,
|
||||
starting_point_id,
|
||||
end_point_id,
|
||||
begin_control_x,
|
||||
begin_control_y,
|
||||
end_control_x,
|
||||
end_control_y,
|
||||
expansion_zone_front,
|
||||
expansion_zone_after,
|
||||
expansion_zone_left,
|
||||
expansion_zone_right,
|
||||
method,
|
||||
direction,
|
||||
forward_speed_limit,
|
||||
reverse_speed_limit,
|
||||
creator,
|
||||
toward
|
||||
</sql>
|
||||
<!--统计总行数-->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
select count(1)
|
||||
from ware_position_map_line
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="positionMapId != null">
|
||||
and position_map_id = #{positionMapId}
|
||||
</if>
|
||||
<if test="startingPointId != null">
|
||||
and starting_point_id = #{startingPointId}
|
||||
</if>
|
||||
<if test="endPointId != null">
|
||||
and end_point_id = #{endPointId}
|
||||
</if>
|
||||
<if test="beginControlX != null and beginControlX != ''">
|
||||
and begin_control_x = #{beginControlX}
|
||||
</if>
|
||||
<if test="beginControlY != null and beginControlY != ''">
|
||||
and begin_control_y = #{beginControlY}
|
||||
</if>
|
||||
<if test="endControlX != null and endControlX != ''">
|
||||
and end_control_x = #{endControlX}
|
||||
</if>
|
||||
<if test="endControlY != null and endControlY != ''">
|
||||
and end_control_y = #{endControlY}
|
||||
</if>
|
||||
<if test="expansionZoneFront != null">
|
||||
and expansion_zone_front = #{expansionZoneFront}
|
||||
</if>
|
||||
<if test="expansionZoneAfter != null">
|
||||
and expansion_zone_after = #{expansionZoneAfter}
|
||||
</if>
|
||||
<if test="expansionZoneLeft != null">
|
||||
and expansion_zone_left = #{expansionZoneLeft}
|
||||
</if>
|
||||
<if test="expansionZoneRight != null">
|
||||
and expansion_zone_right = #{expansionZoneRight}
|
||||
</if>
|
||||
<if test="method != null">
|
||||
and method = #{method}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
and direction = #{direction}
|
||||
</if>
|
||||
<if test="forwardSpeedLimit != null">
|
||||
and forward_speed_limit = #{forwardSpeedLimit}
|
||||
</if>
|
||||
<if test="reverseSpeedLimit != null">
|
||||
and reverse_speed_limit = #{reverseSpeedLimit}
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
and creator = #{creator}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
and updater = #{updater}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
and deleted = #{deleted}
|
||||
</if>
|
||||
<if test="toward != null">
|
||||
and toward = #{toward}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getAllPositionMapLine"
|
||||
resultType="cn.iocoder.yudao.module.mqtt.api.path.dto.PositionMapLineDTO">
|
||||
select
|
||||
<include refid="base_sql"></include>
|
||||
from
|
||||
ware_position_map_line
|
||||
<where>
|
||||
<if test="id != null">
|
||||
and id = #{id}
|
||||
</if>
|
||||
<if test="positionMapId != null">
|
||||
and position_map_id = #{positionMapId}
|
||||
</if>
|
||||
<if test="startingPointId != null">
|
||||
and starting_point_id = #{startingPointId}
|
||||
</if>
|
||||
<if test="endPointId != null">
|
||||
and end_point_id = #{endPointId}
|
||||
</if>
|
||||
<if test="beginControlX != null and beginControlX != ''">
|
||||
and begin_control_x = #{beginControlX}
|
||||
</if>
|
||||
<if test="beginControlY != null and beginControlY != ''">
|
||||
and begin_control_y = #{beginControlY}
|
||||
</if>
|
||||
<if test="endControlX != null and endControlX != ''">
|
||||
and end_control_x = #{endControlX}
|
||||
</if>
|
||||
<if test="endControlY != null and endControlY != ''">
|
||||
and end_control_y = #{endControlY}
|
||||
</if>
|
||||
<if test="expansionZoneFront != null">
|
||||
and expansion_zone_front = #{expansionZoneFront}
|
||||
</if>
|
||||
<if test="expansionZoneAfter != null">
|
||||
and expansion_zone_after = #{expansionZoneAfter}
|
||||
</if>
|
||||
<if test="expansionZoneLeft != null">
|
||||
and expansion_zone_left = #{expansionZoneLeft}
|
||||
</if>
|
||||
<if test="expansionZoneRight != null">
|
||||
and expansion_zone_right = #{expansionZoneRight}
|
||||
</if>
|
||||
<if test="method != null">
|
||||
and method = #{method}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
and direction = #{direction}
|
||||
</if>
|
||||
<if test="forwardSpeedLimit != null">
|
||||
and forward_speed_limit = #{forwardSpeedLimit}
|
||||
</if>
|
||||
<if test="reverseSpeedLimit != null">
|
||||
and reverse_speed_limit = #{reverseSpeedLimit}
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
and creator = #{creator}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
and create_time = #{createTime}
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
and updater = #{updater}
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
and update_time = #{updateTime}
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
and deleted = #{deleted}
|
||||
</if>
|
||||
<if test="toward != null">
|
||||
and toward = #{toward}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<!--通过主键修改数据-->
|
||||
<update id="updateBySelect">
|
||||
update ware_position_map_line
|
||||
<set>
|
||||
<if test="positionMapId != null">
|
||||
position_map_id = #{positionMapId},
|
||||
</if>
|
||||
<if test="startingPointId != null">
|
||||
starting_point_id = #{startingPointId},
|
||||
</if>
|
||||
<if test="endPointId != null">
|
||||
end_point_id = #{endPointId},
|
||||
</if>
|
||||
<if test="beginControlX != null and beginControlX != ''">
|
||||
begin_control_x = #{beginControlX},
|
||||
</if>
|
||||
<if test="beginControlY != null and beginControlY != ''">
|
||||
begin_control_y = #{beginControlY},
|
||||
</if>
|
||||
<if test="endControlX != null and endControlX != ''">
|
||||
end_control_x = #{endControlX},
|
||||
</if>
|
||||
<if test="endControlY != null and endControlY != ''">
|
||||
end_control_y = #{endControlY},
|
||||
</if>
|
||||
<if test="expansionZoneFront != null">
|
||||
expansion_zone_front = #{expansionZoneFront},
|
||||
</if>
|
||||
<if test="expansionZoneAfter != null">
|
||||
expansion_zone_after = #{expansionZoneAfter},
|
||||
</if>
|
||||
<if test="expansionZoneLeft != null">
|
||||
expansion_zone_left = #{expansionZoneLeft},
|
||||
</if>
|
||||
<if test="expansionZoneRight != null">
|
||||
expansion_zone_right = #{expansionZoneRight},
|
||||
</if>
|
||||
<if test="method != null">
|
||||
method = #{method},
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
direction = #{direction},
|
||||
</if>
|
||||
<if test="forwardSpeedLimit != null">
|
||||
forward_speed_limit = #{forwardSpeedLimit},
|
||||
</if>
|
||||
<if test="reverseSpeedLimit != null">
|
||||
reverse_speed_limit = #{reverseSpeedLimit},
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
creator = #{creator},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime},
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
updater = #{updater},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
<if test="toward != null">
|
||||
toward = #{toward},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user