修改地图添加校验
This commit is contained in:
parent
7a1627711c
commit
0a16b93ace
@ -245,6 +245,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode THERE_ARE_ALREADY_STORAGE_LOCATIONS_IN_OTHER_STORAGE_AREAS = new ErrorCode(1_002_038_008, "已有库位在其它区域内");
|
ErrorCode THERE_ARE_ALREADY_STORAGE_LOCATIONS_IN_OTHER_STORAGE_AREAS = new ErrorCode(1_002_038_008, "已有库位在其它区域内");
|
||||||
ErrorCode MAP_DOES_NOT_EXIST_AGV = new ErrorCode(1_002_038_009, "此楼层区域不存在车辆需要暂停或恢复");
|
ErrorCode MAP_DOES_NOT_EXIST_AGV = new ErrorCode(1_002_038_009, "此楼层区域不存在车辆需要暂停或恢复");
|
||||||
ErrorCode MAP_EXIST_TASK_EXIST_TASK = new ErrorCode(1_002_038_010, "修改地图:此楼层区域存在处理中的任务或者库位上还有货物");
|
ErrorCode MAP_EXIST_TASK_EXIST_TASK = new ErrorCode(1_002_038_010, "修改地图:此楼层区域存在处理中的任务或者库位上还有货物");
|
||||||
|
ErrorCode MAP_EXIST_BINDING_POINT = new ErrorCode(1_002_038_011, "修改地图:此楼层区域的地图交换点尚未解绑");
|
||||||
|
|
||||||
// ========== 机器人自动移库 1-002-039-000 ==========
|
// ========== 机器人自动移库 1-002-039-000 ==========
|
||||||
ErrorCode TASK_AUTO_MOVE_NOT_EXISTS = new ErrorCode(1_002_039_001, "车辆自动移库不存在");
|
ErrorCode TASK_AUTO_MOVE_NOT_EXISTS = new ErrorCode(1_002_039_001, "车辆自动移库不存在");
|
||||||
|
@ -322,6 +322,7 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RobotSkuInfoDTO robotSkuInfo = new RobotSkuInfoDTO();
|
RobotSkuInfoDTO robotSkuInfo = new RobotSkuInfoDTO();
|
||||||
|
robotSkuInfo.setHaveSku(ZeroOneEnum.ONE.getType());
|
||||||
robotSkuInfo.setSkuNumber(wareHouseLocationDO.getSkuNumber());
|
robotSkuInfo.setSkuNumber(wareHouseLocationDO.getSkuNumber());
|
||||||
robotSkuInfo.setSkuInfo(wareHouseLocationDO.getSkuInfo());
|
robotSkuInfo.setSkuInfo(wareHouseLocationDO.getSkuInfo());
|
||||||
redisUtil.set(RobotTaskChcheConstant.ROBOT_TASK_SKU_INFO + robotCompleteTaskDTO.getMac(), JSON.toJSONString(robotSkuInfo));
|
redisUtil.set(RobotTaskChcheConstant.ROBOT_TASK_SKU_INFO + robotCompleteTaskDTO.getMac(), JSON.toJSONString(robotSkuInfo));
|
||||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.api.robot.processor;
|
|||||||
|
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
|
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
|
||||||
|
import cn.iocoder.yudao.module.system.constant.webSocket.WebSocketConstant;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -47,7 +48,7 @@ public class RequestProcessor {
|
|||||||
// -- 发送给对应的websocket
|
// -- 发送给对应的websocket
|
||||||
// System.out.println("key:" + map + "发送数据:" + data);
|
// System.out.println("key:" + map + "发送数据:" + data);
|
||||||
// log.info("key:" + map + "发送数据:" + data);
|
// log.info("key:" + map + "发送数据:" + data);
|
||||||
webSocketSenderApi.sendObject(map, "map_push", data);
|
webSocketSenderApi.sendObject(map, WebSocketConstant.MAP_PUSH, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void shutdown() {
|
public void shutdown() {
|
||||||
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
|
|||||||
import cn.iocoder.yudao.module.system.api.robot.vo.RobotInformationVO;
|
import cn.iocoder.yudao.module.system.api.robot.vo.RobotInformationVO;
|
||||||
import cn.iocoder.yudao.module.system.constant.area.FloorAreaConstant;
|
import cn.iocoder.yudao.module.system.constant.area.FloorAreaConstant;
|
||||||
import cn.iocoder.yudao.module.system.constant.robot.RobotTaskChcheConstant;
|
import cn.iocoder.yudao.module.system.constant.robot.RobotTaskChcheConstant;
|
||||||
|
import cn.iocoder.yudao.module.system.constant.webSocket.WebSocketConstant;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.robot.task.TaskAssignDTO;
|
import cn.iocoder.yudao.module.system.controller.admin.robot.task.TaskAssignDTO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
||||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapService;
|
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapService;
|
||||||
@ -85,7 +86,7 @@ public class ScheduledTasks {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// log.info("3D发送数据:{}", JSON.toJSONString(map));
|
// log.info("3D发送数据:{}", JSON.toJSONString(map));
|
||||||
webSocketSenderApi.sendObject(key, "3d_map_push", map);
|
webSocketSenderApi.sendObject(key, WebSocketConstant.THREE_D_MAP_PUSH, map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,11 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class RobotSkuInfoDTO {
|
public class RobotSkuInfoDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1:有物料, 0:没有物料
|
||||||
|
*/
|
||||||
|
private Integer haveSku = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物料信息
|
* 物料信息
|
||||||
*/
|
*/
|
||||||
|
@ -7,4 +7,14 @@ public class WebSocketConstant {
|
|||||||
* webSocket推送车机要走的点位id
|
* webSocket推送车机要走的点位id
|
||||||
*/
|
*/
|
||||||
public static String PLANNING_MOVE_POSE = "planning_move_pose";
|
public static String PLANNING_MOVE_POSE = "planning_move_pose";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3D地图的信息
|
||||||
|
*/
|
||||||
|
public static String THREE_D_MAP_PUSH = "3d_map_push";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 推送地图点位信息
|
||||||
|
*/
|
||||||
|
public static String MAP_PUSH = "map_push";
|
||||||
}
|
}
|
||||||
|
@ -145,4 +145,10 @@ public interface PositionMapItemService extends IService<PositionMapItemDO> {
|
|||||||
* @param mapId
|
* @param mapId
|
||||||
*/
|
*/
|
||||||
void deleteByMapId(Long mapId);
|
void deleteByMapId(Long mapId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验此地图的交换点,有没有被其他地图绑定
|
||||||
|
* @param mapId
|
||||||
|
*/
|
||||||
|
void checkHaveBindChangePoint(Long mapId);
|
||||||
}
|
}
|
||||||
|
@ -12,26 +12,36 @@ import cn.iocoder.yudao.module.system.controller.admin.log.vo.UserOperationLogSa
|
|||||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.dto.PositionMapConditionDTO;
|
import cn.iocoder.yudao.module.system.controller.admin.positionmap.dto.PositionMapConditionDTO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemPageReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemPageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotWarnMsgSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionChangePointBindingDO;
|
||||||
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.mysql.positionmap.PositionChangePointBindingMapper;
|
||||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapItemMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapItemMapper;
|
||||||
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
|
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
|
||||||
import cn.iocoder.yudao.module.system.enums.item.PositionMapItemEnum;
|
import cn.iocoder.yudao.module.system.enums.item.PositionMapItemEnum;
|
||||||
import cn.iocoder.yudao.module.system.enums.item.UseStatusEnum;
|
import cn.iocoder.yudao.module.system.enums.item.UseStatusEnum;
|
||||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.robot.RobotWarnMsgService;
|
||||||
import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
|
import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.hutool.core.collection.CollUtil.isNotEmpty;
|
import static cn.hutool.core.collection.CollUtil.isNotEmpty;
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.MAP_EXIST_BINDING_POINT;
|
||||||
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.MAP_EXIST_TASK_EXIST_TASK;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库点位地图子表 Service 实现类
|
* 仓库点位地图子表 Service 实现类
|
||||||
@ -50,6 +60,12 @@ public class PositionMapItemServiceImpl extends ServiceImpl<PositionMapItemMappe
|
|||||||
@Resource
|
@Resource
|
||||||
private UserOperationLogService userOperationLogService;
|
private UserOperationLogService userOperationLogService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RobotWarnMsgService warnMsgService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PositionChangePointBindingMapper positionChangePointBindingMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createPositionMapItem(PositionMapItemSaveReqVO createReqVO) {
|
public Long createPositionMapItem(PositionMapItemSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
@ -211,4 +227,43 @@ public class PositionMapItemServiceImpl extends ServiceImpl<PositionMapItemMappe
|
|||||||
positionMapItemMapper.deleteByMapId(mapId);
|
positionMapItemMapper.deleteByMapId(mapId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验此地图的交换点,有没有被其他地图绑定
|
||||||
|
* @param mapId
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void checkHaveBindChangePoint(Long mapId) {
|
||||||
|
List<PositionMapItemDO> list = positionMapItemMapper.selectList(new LambdaQueryWrapperX<PositionMapItemDO>()
|
||||||
|
.eq(PositionMapItemDO::getPositionMapId, mapId)
|
||||||
|
.eq(PositionMapItemDO::getType,PositionMapItemEnum.CHANGE.getType()));
|
||||||
|
if (ObjectUtil.isEmpty(list)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> ids = list.stream().map(PositionMapItemDO::getId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<PositionChangePointBindingDO> bindingList = positionChangePointBindingMapper.selectList(new LambdaQueryWrapperX<PositionChangePointBindingDO>()
|
||||||
|
.ne(PositionChangePointBindingDO::getPositionMapId, mapId)
|
||||||
|
.in(PositionChangePointBindingDO::getEndPointId, ids));
|
||||||
|
|
||||||
|
if (ObjectUtil.isEmpty(bindingList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Long> sortNums = bindingList.stream().map(PositionChangePointBindingDO::getStartingPointSortNum).collect(Collectors.toList());
|
||||||
|
|
||||||
|
warnMsgService.sendWarnMsgToWebsocket(MAP_EXIST_TASK_EXIST_TASK.getMsg());
|
||||||
|
RobotWarnMsgSaveReqVO warnMsgSaveReqVO = new RobotWarnMsgSaveReqVO();
|
||||||
|
String locationStr = StringUtils.join(sortNums, ",");
|
||||||
|
if (locationStr.length() > 160) {
|
||||||
|
locationStr = locationStr.substring(0,160);
|
||||||
|
}
|
||||||
|
warnMsgSaveReqVO.setWarnMsg(MAP_EXIST_BINDING_POINT.getMsg()+locationStr);
|
||||||
|
warnMsgSaveReqVO.setWarnLevel(4);
|
||||||
|
warnMsgSaveReqVO.setWarnCode("MAP");
|
||||||
|
warnMsgSaveReqVO.setSolveTime(LocalDateTime.now());
|
||||||
|
warnMsgService.createWarnMsg(warnMsgSaveReqVO);
|
||||||
|
throw exception(MAP_EXIST_BINDING_POINT);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -249,6 +249,7 @@ public class PositionMapServiceImpl extends ServiceImpl<PositionMapMapper, Posit
|
|||||||
warnMsgService.createWarnMsg(warnMsgSaveReqVO);
|
warnMsgService.createWarnMsg(warnMsgSaveReqVO);
|
||||||
throw exception(MAP_EXIST_TASK_EXIST_TASK);
|
throw exception(MAP_EXIST_TASK_EXIST_TASK);
|
||||||
}
|
}
|
||||||
|
positionMapItemService.checkHaveBindChangePoint(positionMap.getId());
|
||||||
positionMapItemService.deleteByMapId(positionMap.getId());
|
positionMapItemService.deleteByMapId(positionMap.getId());
|
||||||
positionMapLineService.deleteByMapId(positionMap.getId());
|
positionMapLineService.deleteByMapId(positionMap.getId());
|
||||||
houseLocationService.deleteHouseLocationByMapId(positionMap.getId());
|
houseLocationService.deleteHouseLocationByMapId(positionMap.getId());
|
||||||
|
@ -116,7 +116,7 @@ public class RobotWorkingHoursStatisticsServiceImpl extends ServiceImpl<RobotWor
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建这台车的空闲时间
|
* 创建这台车的空闲时间
|
||||||
*
|
* 别改事务传播
|
||||||
* @param robotNo
|
* @param robotNo
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<update id="deleteHouseAreaByMapId">
|
<update id="deleteHouseAreaByMapId">
|
||||||
update ware_house_area
|
update ware_house_area
|
||||||
set deleted = '1'
|
set deleted = 1
|
||||||
where position_map_id = #{mapId}
|
where position_map_id = #{mapId}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<update id="deleteHouseLaneByMapId">
|
<update id="deleteHouseLaneByMapId">
|
||||||
update ware_house_lane
|
update ware_house_lane
|
||||||
set deleted = '1'
|
set deleted = 1
|
||||||
where position_map_id = #{mapId}
|
where position_map_id = #{mapId}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
update
|
update
|
||||||
ware_house_location
|
ware_house_location
|
||||||
set
|
set
|
||||||
deleted = '1'
|
deleted = 1
|
||||||
where
|
where
|
||||||
map_id = #{mapId}
|
map_id = #{mapId}
|
||||||
</update>
|
</update>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
update
|
update
|
||||||
device_information
|
device_information
|
||||||
set
|
set
|
||||||
deleted = '1'
|
deleted = 1
|
||||||
where
|
where
|
||||||
position_map_id = #{mapId}
|
position_map_id = #{mapId}
|
||||||
</update>
|
</update>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<update id="deleteParkingByMapId">
|
<update id="deleteParkingByMapId">
|
||||||
update ware_parking_spot
|
update ware_parking_spot
|
||||||
set deleted = '1'
|
set deleted = 1
|
||||||
where position_map_id = #{mapId}
|
where position_map_id = #{mapId}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<update id="deleteBindIngByMapId">
|
<update id="deleteBindIngByMapId">
|
||||||
update ware_position_change_point_binding
|
update ware_position_change_point_binding
|
||||||
set deleted = '1'
|
set deleted = 1
|
||||||
where position_map_id = #{mapId}
|
where position_map_id = #{mapId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@
|
|||||||
</delete>
|
</delete>
|
||||||
<update id="deleteByMapId">
|
<update id="deleteByMapId">
|
||||||
update ware_position_map_item
|
update ware_position_map_item
|
||||||
set deleted = '1'
|
set deleted = 1
|
||||||
where position_map_id = #{mapId}
|
where position_map_id = #{mapId}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<update id="deleteByMapId">
|
<update id="deleteByMapId">
|
||||||
update ware_position_map_line
|
update ware_position_map_line
|
||||||
set deleted = '1'
|
set deleted = 1
|
||||||
where position_map_id = #{mapId}
|
where position_map_id = #{mapId}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user