Merge branch 'dev' of http://git.znkjfw.com/ak/zn-cloud-wcs into dev
This commit is contained in:
commit
cc3bcd958f
@ -21,7 +21,8 @@ public enum NodeTypeEnum {
|
||||
PARKING(4, "停车点"),
|
||||
CHANGE(5, "区域变更点"),
|
||||
WAIT(6, "等待点"),
|
||||
TEXT(7, "文字点");
|
||||
TEXT(7, "文字点"),
|
||||
CHECK(8, "检测点");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
|
@ -18,6 +18,7 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@ -146,7 +147,35 @@ public class RemoteControllerProcessor {
|
||||
|
||||
msg = msg + " " + crcOne + " " + crcTwo;
|
||||
|
||||
remoteControllerSocket.setMsg(msg);
|
||||
remoteControllerSocket.setMsg(hexStringToByteArray(msg));
|
||||
}
|
||||
|
||||
public String hexStringToByteArray(String hexString) {
|
||||
// 移除所有空格(包括中间和两端的空格)
|
||||
String cleaned = hexString.replaceAll("\\s", "");
|
||||
|
||||
// 验证字符串长度是否为偶数
|
||||
if (cleaned.length() % 2 != 0) {
|
||||
throw new IllegalArgumentException("无效的十六进制字符串长度: " + cleaned.length());
|
||||
}
|
||||
|
||||
// 创建结果字节数组
|
||||
byte[] byteArray = new byte[cleaned.length() / 2];
|
||||
|
||||
for (int i = 0; i < cleaned.length(); i += 2) {
|
||||
// 提取两个连续的十六进制字符
|
||||
String hexPair = cleaned.substring(i, i + 2);
|
||||
|
||||
try {
|
||||
// 将十六进制字符串转换为字节
|
||||
byteArray[i / 2] = (byte) Integer.parseInt(hexPair, 16);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IllegalArgumentException("无效的十六进制字符: " + hexPair);
|
||||
}
|
||||
}
|
||||
|
||||
String str = Arrays.toString(byteArray);
|
||||
return str.substring(1, str.length() - 1);
|
||||
}
|
||||
|
||||
public void remoteCache(RemoteRobotTransferDTO dto, String ip) {
|
||||
@ -223,7 +252,10 @@ public class RemoteControllerProcessor {
|
||||
try {
|
||||
os = socket.getOutputStream();
|
||||
String str = remoteControllerSocketDTO.getMsg();
|
||||
os.write(remoteControllerSocketDTO.getMsg().getBytes());
|
||||
String[] split = str.split(",");
|
||||
for (String meg : split) {
|
||||
os.write(Integer.parseInt(meg.trim()));
|
||||
}
|
||||
log.info("socket推送的数据 :{}", str);
|
||||
} catch (IOException e) {
|
||||
log.error("socket发送异常 :{}", e);
|
||||
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.remote.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class HexConverter {
|
||||
|
||||
public static byte[] hexStringToByteArray(String hexString) {
|
||||
// 移除所有空格(包括中间和两端的空格)
|
||||
String cleaned = hexString.replaceAll("\\s", "");
|
||||
|
||||
// 验证字符串长度是否为偶数
|
||||
if (cleaned.length() % 2 != 0) {
|
||||
throw new IllegalArgumentException("无效的十六进制字符串长度: " + cleaned.length());
|
||||
}
|
||||
|
||||
// 创建结果字节数组
|
||||
byte[] byteArray = new byte[cleaned.length() / 2];
|
||||
|
||||
for (int i = 0; i < cleaned.length(); i += 2) {
|
||||
// 提取两个连续的十六进制字符
|
||||
String hexPair = cleaned.substring(i, i + 2);
|
||||
|
||||
try {
|
||||
// 将十六进制字符串转换为字节
|
||||
byteArray[i / 2] = (byte) Integer.parseInt(hexPair, 16);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IllegalArgumentException("无效的十六进制字符: " + hexPair);
|
||||
}
|
||||
}
|
||||
|
||||
return byteArray;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String input = "AA 55 13 04 01 88 88 02 C0 A8 09 09 0f 27 01 78 01 78 01 78 EE 27"; // 可以测试 "ab c5 ef" 或 "A B C 5 E F"
|
||||
|
||||
try {
|
||||
byte[] result = hexStringToByteArray(input);
|
||||
|
||||
// 格式化输出为 {0xAB, 0xC5, 0xEF} 形式
|
||||
StringBuilder sb = new StringBuilder("{");
|
||||
for (int i = 0; i < result.length; i++) {
|
||||
// 使用 & 0xFF 将字节转换为无符号整数
|
||||
sb.append(String.format("0x%02X", result[i] & 0xFF));
|
||||
if (i < result.length - 1) sb.append(", ");
|
||||
}
|
||||
sb.append("}");
|
||||
|
||||
System.out.println("输入: \"" + input + "\"");
|
||||
System.out.println("十六进制数组: " + sb.toString());
|
||||
System.out.println("字节数组内容: " + Arrays.toString(result));
|
||||
|
||||
} catch (IllegalArgumentException e) {
|
||||
System.err.println("错误: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -55,8 +55,11 @@ logging:
|
||||
remote:
|
||||
cockpit: # 远遥控制车辆IP和端口
|
||||
- controllerPort: 9000
|
||||
controllerIp: 127.0.0.1
|
||||
ipcIp: 10.10.7.132
|
||||
controllerIp: 10.10.100.19
|
||||
ipcIp: 10.10.100.19
|
||||
- controllerPort: 9000
|
||||
controllerIp: 10.10.100.19
|
||||
ipcIp: 10.10.5.26
|
||||
msg: AA 55 13 04 01 88 88 # 驾舱socket头信息
|
||||
cockpit-time-out: 120 # 驾舱超时报警时间
|
||||
industrial-control-time-out: 120 # 工控通信超时报警时间
|
||||
|
@ -168,6 +168,8 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode INFORMATION_MAC_EXIST = new ErrorCode(1_002_029_002, "此Mac地址已经存在");
|
||||
ErrorCode INFORMATION_MAC_INPUT = new ErrorCode(1_002_029_003, "请输入Mac地址");
|
||||
ErrorCode INFORMATION_BIND_MAP = new ErrorCode(1_002_029_004, "设备已经绑定在地图上,请先在地图上解绑");
|
||||
ErrorCode INFORMATION_FLIP_BINDING = new ErrorCode(1_002_029_005, "翻转机需要绑定取货点位");
|
||||
ErrorCode INFORMATION_FLIP_NEED_BINDING_CHECK = new ErrorCode(1_002_029_006, "翻转机需要绑定检测区取放货点位");
|
||||
|
||||
// ========== 线库/巷道 1-002-030-000 ==========
|
||||
ErrorCode HOUSE_LANE_NOT_EXISTS = new ErrorCode(1-002-030-001, "线库不存在");
|
||||
@ -338,4 +340,10 @@ public interface ErrorCodeConstants {
|
||||
|
||||
//========== 车辆行走路线耗时记录 1_002_061_001 ==========
|
||||
ErrorCode TASK_LINE_TIME_CONSUMING_NOT_EXISTS = new ErrorCode(1_002_061_001, "车辆行走路线耗时记录不存在");
|
||||
|
||||
// ========== 取货点位 1_002_062_001 ==========
|
||||
ErrorCode HOUSE_TAKE_POINT_NOT_EXISTS = new ErrorCode(1_002_062_001, "取货点位不存在");
|
||||
|
||||
// ========== 取货点位绑定 1_002_063_001 ==========
|
||||
ErrorCode HOUSE_TAKE_POINT_BINDING_NOT_EXISTS = new ErrorCode(1_002_063_001, "取货点位绑定不存在");
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.infra.api.websocket.WebSocketSenderApi;
|
||||
import cn.iocoder.yudao.module.mqtt.api.common.CommonApi;
|
||||
import cn.iocoder.yudao.module.system.api.path.vo.RobotClosePathPlantingDTO;
|
||||
import cn.iocoder.yudao.module.system.api.robot.dto.FloorZoneDTO;
|
||||
import cn.iocoder.yudao.module.system.api.robot.dto.RobotCommandStateDTO;
|
||||
@ -16,13 +15,13 @@ import cn.iocoder.yudao.module.system.api.robot.websocket.WsWareHouseLocationDTO
|
||||
import cn.iocoder.yudao.module.system.config.mqtt.util.MqttUtils;
|
||||
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
|
||||
import cn.iocoder.yudao.module.system.constant.CommonConstant;
|
||||
import cn.iocoder.yudao.module.system.constant.area.FloorAreaConstant;
|
||||
import cn.iocoder.yudao.module.system.constant.path.PathPlanningChcheConstant;
|
||||
import cn.iocoder.yudao.module.system.constant.path.PathPlanningTopicConstant;
|
||||
import cn.iocoder.yudao.module.system.constant.robot.RobotExecutionStateConstant;
|
||||
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.log.vo.RobotTaskDetailActionLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.log.RobotTaskDetailActionLogDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.*;
|
||||
@ -38,9 +37,10 @@ import cn.iocoder.yudao.module.system.enums.robot.actionlog.ActionStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.charge.ChargeTaskStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotStatusCodeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotTaskStageEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.RobotTaskEventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.EventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.mq.message.task.TaskDistributionMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.producer.task.TaskDistributionProducer;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.information.DeviceInformationService;
|
||||
import cn.iocoder.yudao.module.system.service.log.RobotTaskDetailActionLogService;
|
||||
import cn.iocoder.yudao.module.system.service.path.PathPlanningService;
|
||||
@ -52,7 +52,6 @@ import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -63,8 +62,6 @@ import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import static cn.iocoder.yudao.module.system.service.robot.RobotInformationServiceImpl.key;
|
||||
|
||||
@Slf4j
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
@ -128,6 +125,9 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
@Resource
|
||||
private DeviceInformationService deviceInformationService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@Resource
|
||||
private TaskDistributionProducer taskDistributionProducer;
|
||||
|
||||
@ -286,7 +286,7 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
addTaskDetailActionDoneLog(robotCompleteTaskDTO, robotTaskDetail);
|
||||
|
||||
TaskDistributionMessage mess = new TaskDistributionMessage(this, robotCompleteTaskDTO.getOrderId() + "",
|
||||
RobotTaskEventTypeEnum.DONE.getType());
|
||||
EventTypeEnum.TASK_DONE.getType());
|
||||
taskDistributionProducer.sendSmsSendMessage(mess);
|
||||
}
|
||||
|
||||
@ -322,20 +322,34 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
if (ObjectUtil.isEmpty(robotTaskDetailDO) || ObjectUtil.isEmpty(robotTaskDetailDO.getToLocationId())) {
|
||||
return;
|
||||
}
|
||||
WareHouseLocationDO toWareHouseLocation = locationMapper.selectById(robotTaskDetailDO.getToLocationId());
|
||||
if (ObjectUtil.isEmpty(toWareHouseLocation)) {
|
||||
return;
|
||||
String actualLocationX = null;
|
||||
String actualLocationY = null;
|
||||
if (ReleaseTakeEnum.isLocation(robotTaskDetailDO.getReleaseType())) {
|
||||
WareHouseLocationDO toWareHouseLocation = locationMapper.selectById(robotTaskDetailDO.getToLocationId());
|
||||
if (ObjectUtil.isEmpty(toWareHouseLocation)) {
|
||||
return;
|
||||
}
|
||||
//查询最近一起取货任务
|
||||
WareHouseLocationDO fromWareHouseLocation = getFromLocation(robotTaskDetailDO);
|
||||
if (ObjectUtil.isNotEmpty(fromWareHouseLocation)) {
|
||||
toWareHouseLocation.setSkuNumber(fromWareHouseLocation.getSkuNumber());
|
||||
toWareHouseLocation.setSkuInfo(fromWareHouseLocation.getSkuInfo());
|
||||
}
|
||||
toWareHouseLocation.setLocationLock(LocationLockEnum.YES.getType());
|
||||
toWareHouseLocation.setLocationUseStatus(LocationUseStatusEnum.YES.getType());
|
||||
locationMapper.updateById(toWareHouseLocation);
|
||||
actualLocationX = toWareHouseLocation.getActualLocationX();
|
||||
actualLocationY = toWareHouseLocation.getActualLocationY();
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(robotTaskDetailDO.getReleaseType())) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(robotTaskDetailDO.getToLocationId());
|
||||
if (ObjectUtil.isEmpty(houseTakePoint)) {
|
||||
return;
|
||||
}
|
||||
actualLocationX = houseTakePoint.getActualLocationX();
|
||||
actualLocationY = houseTakePoint.getActualLocationY();
|
||||
}
|
||||
//查询最近一起取货任务
|
||||
WareHouseLocationDO fromWareHouseLocation = getFromLocation(robotTaskDetailDO);
|
||||
if (ObjectUtil.isNotEmpty(fromWareHouseLocation)) {
|
||||
toWareHouseLocation.setSkuNumber(fromWareHouseLocation.getSkuNumber());
|
||||
toWareHouseLocation.setSkuInfo(fromWareHouseLocation.getSkuInfo());
|
||||
}
|
||||
toWareHouseLocation.setLocationLock(LocationLockEnum.YES.getType());
|
||||
toWareHouseLocation.setLocationUseStatus(LocationUseStatusEnum.YES.getType());
|
||||
locationMapper.updateById(toWareHouseLocation);
|
||||
pushWareLocation(toWareHouseLocation, robotCompleteTaskDTO.getMac(), ZeroOneEnum.ONE.getType());
|
||||
|
||||
pushWareLocation(actualLocationX,actualLocationY, robotCompleteTaskDTO.getMac(), ZeroOneEnum.ONE.getType());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -376,25 +390,47 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
if (ObjectUtil.isEmpty(robotTaskDetailDO) || ObjectUtil.isEmpty(robotTaskDetailDO.getFromLocationId())) {
|
||||
return;
|
||||
}
|
||||
WareHouseLocationDO wareHouseLocationDO = locationMapper.selectById(robotTaskDetailDO.getFromLocationId());
|
||||
if (ObjectUtil.isEmpty(wareHouseLocationDO)) {
|
||||
return;
|
||||
|
||||
Long skuNumber = null;
|
||||
String skuInfo = null;
|
||||
Integer locationStorey = null;
|
||||
|
||||
if (ReleaseTakeEnum.isLocation(robotTaskDetailDO.getTakeType())) {
|
||||
WareHouseLocationDO wareHouseLocationDO = locationMapper.selectById(robotTaskDetailDO.getFromLocationId());
|
||||
if (ObjectUtil.isEmpty(wareHouseLocationDO)) {
|
||||
return;
|
||||
}
|
||||
skuNumber = wareHouseLocationDO.getSkuNumber();
|
||||
skuInfo = wareHouseLocationDO.getSkuInfo();
|
||||
locationStorey = wareHouseLocationDO.getLocationStorey();
|
||||
|
||||
wareHouseLocationDO.setSkuInfo(null);
|
||||
wareHouseLocationDO.setSkuNumber(0L);
|
||||
wareHouseLocationDO.setLocationLock(LocationLockEnum.YES.getType());
|
||||
wareHouseLocationDO.setLocationUseStatus(LocationUseStatusEnum.NO.getType());
|
||||
locationMapper.updateById(wareHouseLocationDO);
|
||||
pushWareLocation(wareHouseLocationDO.getActualLocationX(),wareHouseLocationDO.getActualLocationY(), robotCompleteTaskDTO.getMac(), ZeroOneEnum.ZERO.getType());
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(robotTaskDetailDO.getTakeType())) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(robotTaskDetailDO.getFromLocationId());
|
||||
if (ObjectUtil.isEmpty(houseTakePoint)) {
|
||||
return;
|
||||
}
|
||||
houseTakePoint.setSkuInfo(null);
|
||||
houseTakePoint.setSkuNumber(0L);
|
||||
houseTakePoint.setPointStatus(ZeroOneEnum.ZERO.getType());
|
||||
houseTakePointService.updateById(houseTakePoint);
|
||||
pushWareLocation(houseTakePoint.getActualLocationX(),houseTakePoint.getActualLocationY(), robotCompleteTaskDTO.getMac(), ZeroOneEnum.ZERO.getType());
|
||||
}
|
||||
|
||||
RobotSkuInfoDTO robotSkuInfo = new RobotSkuInfoDTO();
|
||||
robotSkuInfo.setHaveSku(ZeroOneEnum.ONE.getType());
|
||||
robotSkuInfo.setSkuNumber(wareHouseLocationDO.getSkuNumber());
|
||||
robotSkuInfo.setSkuInfo(wareHouseLocationDO.getSkuInfo());
|
||||
robotSkuInfo.setLocationStorey(wareHouseLocationDO.getLocationStorey());
|
||||
robotSkuInfo.setSkuNumber(skuNumber);
|
||||
robotSkuInfo.setSkuInfo(skuInfo);
|
||||
robotSkuInfo.setLocationStorey(locationStorey);
|
||||
redisUtil.set(RobotTaskChcheConstant.ROBOT_TASK_SKU_INFO + robotCompleteTaskDTO.getMac(), JSON.toJSONString(robotSkuInfo));
|
||||
wareHouseLocationDO.setSkuInfo(null);
|
||||
wareHouseLocationDO.setSkuNumber(0L);
|
||||
wareHouseLocationDO.setLocationLock(LocationLockEnum.YES.getType());
|
||||
wareHouseLocationDO.setLocationUseStatus(LocationUseStatusEnum.NO.getType());
|
||||
locationMapper.updateById(wareHouseLocationDO);
|
||||
pushWareLocation(wareHouseLocationDO, robotCompleteTaskDTO.getMac(), ZeroOneEnum.ZERO.getType());
|
||||
}
|
||||
|
||||
public void pushWareLocation(WareHouseLocationDO wareHouseLocationDO, String mac, Integer type) {
|
||||
public void pushWareLocation(String actualLocationX,String actualLocationY, String mac, Integer type) {
|
||||
String floorAreaKey = RobotTaskChcheConstant.ROBOT_FLOOR_AREA + mac;
|
||||
Object floorAreaObject = redisUtil.get(floorAreaKey);
|
||||
if (ObjectUtil.isEmpty(floorAreaObject)) {
|
||||
@ -403,8 +439,8 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
FloorZoneDTO floorZoneDTO = JSONUtil.toBean((String) floorAreaObject, FloorZoneDTO.class);
|
||||
String floorAreaStr = floorZoneDTO.getFloor() + CommonConstant.SYMBOL + floorZoneDTO.getArea();
|
||||
WsWareHouseLocationDTO wsWareHouseLocation = new WsWareHouseLocationDTO();
|
||||
wsWareHouseLocation.setActualLocationX(wareHouseLocationDO.getActualLocationX());
|
||||
wsWareHouseLocation.setActualLocationY(wareHouseLocationDO.getActualLocationY());
|
||||
wsWareHouseLocation.setActualLocationX(actualLocationX);
|
||||
wsWareHouseLocation.setActualLocationY(actualLocationY);
|
||||
wsWareHouseLocation.setType(type);
|
||||
wsWareHouseLocation.setFloor(floorZoneDTO.getFloor());
|
||||
wsWareHouseLocation.setArea(floorZoneDTO.getArea());
|
||||
@ -445,7 +481,7 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
PPCloseOrder(robotCompleteTaskDTO);
|
||||
// taskService.closeTaskDetail(robotCompleteTaskDTO.getOrderId().toString(),robotCompleteTaskDTO.getMac());
|
||||
String robotNo = robotInformationService.getRobotNoByMac(robotCompleteTaskDTO.getMac());
|
||||
|
||||
String taskNo = taskDetailService.getTaskNoByDetailId(robotCompleteTaskDTO.getOrderId());
|
||||
String msg = null;
|
||||
RobotTaskDetailDO robotTaskDetailDO = robotTaskDetailMapper.selectById(robotCompleteTaskDTO.getOrderId());
|
||||
if (PathTaskTypeEnum.TAKE_RELEASE.getType().equals(robotCompleteTaskDTO.getOrderType())
|
||||
@ -462,7 +498,6 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
detailDO.setOccurError(ZeroOneEnum.ZERO.getType());
|
||||
// robotTaskDetailMapper.updateById(robotTaskDetailDO);
|
||||
robotTaskDetailMapper.updateRobotDetailById(detailDO);
|
||||
String taskNo = taskDetailService.getTaskNoByDetailId(robotCompleteTaskDTO.getOrderId());
|
||||
msg = robotNo + "_" + "车辆发生异常,重新分配其他车辆执行此任务" + taskNo + " - " + robotTaskDetailDO.getFromLocationNo();
|
||||
}
|
||||
}
|
||||
@ -498,16 +533,14 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
}*/
|
||||
|
||||
String solve = "";
|
||||
String taskNo = "";
|
||||
if (ObjectUtil.isEmpty(msg)) {
|
||||
taskNo = taskDetailService.getTaskNoByDetailId(robotCompleteTaskDTO.getOrderId());
|
||||
solve = " 并且到任务列表关闭任务 " + taskNo;
|
||||
taskDetailService.setTaskDetailError(robotCompleteTaskDTO.getOrderId());
|
||||
} else {
|
||||
robotInformationService.lockRobot(robotNo);
|
||||
}
|
||||
|
||||
msg = ObjectUtil.isEmpty(msg) ? robotNo + "_" + robotCompleteTaskDTO.getMessage() : msg;
|
||||
msg = ObjectUtil.isEmpty(msg) ? taskNo +" 车辆编号_"+ robotNo + "_" + robotCompleteTaskDTO.getMessage() : msg;
|
||||
|
||||
RobotWarnMsgDO warnMsg = RobotWarnMsgDO.builder().warnLevel(4)
|
||||
.warnCode(robotCompleteTaskDTO.getStatusCode())
|
||||
@ -560,15 +593,15 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|
||||
RobotTaskDetailDO robotTaskDetailDO = robotTaskDetailMapper.selectById(robotCompleteTaskDTO.getOrderId());
|
||||
List<RobotTaskDetailDO> taskDetails = robotTaskDetailMapper.queryByTaskId(robotTaskDetailDO.getRobotTaskId());
|
||||
boolean done =
|
||||
taskDetails.stream().noneMatch(v -> (v.getTaskStatus().equals(RobotTaskDetailStatusEnum.NEW.getType()) ||
|
||||
v.getTaskStatus().equals(RobotTaskDetailStatusEnum.DOING.getType())));
|
||||
taskDetails.stream().noneMatch(v -> (v.getTaskStatus().equals(RobotTaskDetailStatusEnum.NEW.getType())
|
||||
|| v.getTaskStatus().equals(RobotTaskDetailStatusEnum.DOING.getType())));
|
||||
if (done) {
|
||||
RobotTaskDO robotTaskDO = new RobotTaskDO();
|
||||
robotTaskDO.setId(taskDetails.get(0).getRobotTaskId());
|
||||
robotTaskDO.setEndTime(LocalDateTime.now());
|
||||
robotTaskDO.setTaskStatus(RobotTaskDetailStatusEnum.DONE.getType());
|
||||
robotTaskMapper.updateRobot(robotTaskDO);
|
||||
taskCycleMapper.deletByRobotTaskId(taskDetails.get(0).getRobotTaskId());
|
||||
// taskCycleMapper.deletByRobotTaskId(taskDetails.get(0).getRobotTaskId());
|
||||
}
|
||||
return robotTaskDetailDO;
|
||||
}
|
||||
|
@ -6,14 +6,17 @@ import cn.iocoder.yudao.module.system.api.robot.vo.RobotUpdatePalletHeightDTO;
|
||||
import cn.iocoder.yudao.module.system.constant.CommonConstant;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotWarnMsgDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseLocationMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskDetailMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotWarnMsgMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.ReleaseTakeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotTaskTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotWarnType;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotCommandTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotInformationService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -45,6 +48,9 @@ public class RobotUpdatePalletHeightApiImpl implements RobotUpdatePalletHeightAp
|
||||
@Autowired
|
||||
private RobotInformationService robotInformationService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
public static String WARN_CODE = "100001";
|
||||
|
||||
@Override
|
||||
@ -123,6 +129,25 @@ public class RobotUpdatePalletHeightApiImpl implements RobotUpdatePalletHeightAp
|
||||
return;
|
||||
}
|
||||
|
||||
if (ReleaseTakeEnum.isLocation(robotTaskDetailDO.getReleaseType())) {
|
||||
setDropLocation(data,robotTaskDetailDO);
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(robotTaskDetailDO.getReleaseType())) {
|
||||
setDropPoint(data,robotTaskDetailDO);
|
||||
}
|
||||
}
|
||||
|
||||
private void setDropPoint(RobotUpdatePalletHeightDTO data, RobotTaskDetailDO robotTaskDetailDO) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(robotTaskDetailDO.getToLocationId());
|
||||
houseTakePoint.setTotalHeight(new BigDecimal(data.getGoodsHeight()));
|
||||
houseTakePointService.updateById(houseTakePoint);
|
||||
WareHouseTakePointDO pointDO = new WareHouseTakePointDO();
|
||||
pointDO.setPositionMapItemId(houseTakePoint.getPositionMapItemId());
|
||||
pointDO.setTrayHeight(new BigDecimal(data.getGoodsHeight()));
|
||||
pointDO.setLocationStorey(houseTakePoint.getLocationStorey()-1);
|
||||
houseTakePointService.updateHouseTakePointByItemIdAndStorey(pointDO);
|
||||
}
|
||||
|
||||
public void setDropLocation(RobotUpdatePalletHeightDTO data,RobotTaskDetailDO robotTaskDetailDO) {
|
||||
WareHouseLocationDO firstStorey = houseLocationMapper.selectById(robotTaskDetailDO.getToLocationId());
|
||||
if (ObjectUtil.isEmpty(firstStorey)) {
|
||||
return;
|
||||
@ -144,5 +169,4 @@ public class RobotUpdatePalletHeightApiImpl implements RobotUpdatePalletHeightAp
|
||||
houseLocationMapper.updateById(storeyList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,20 +7,18 @@ import cn.iocoder.yudao.module.system.constant.robot.RobotExecutionStateConstant
|
||||
import cn.iocoder.yudao.module.system.controller.admin.log.vo.RobotOperationLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskDetailMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.path.PathIsReachEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.CommandTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotTaskDetailStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotTaskTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotTaskStageEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.WorkProgressEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.RobotTaskEventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.EventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.mq.message.task.TaskDistributionMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.producer.task.TaskDistributionProducer;
|
||||
import cn.iocoder.yudao.module.system.service.log.RobotOperationLogService;
|
||||
import cn.iocoder.yudao.module.system.service.path.PathPlanningService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotInformationService;
|
||||
import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -71,7 +69,7 @@ public class RobotWorkStatusApiImpl implements RobotWorkStatusApi {
|
||||
operationLogService.createOperationLog(createReqVO);
|
||||
|
||||
TaskDistributionMessage mess = new TaskDistributionMessage(this,message,
|
||||
RobotTaskEventTypeEnum.TIME.getType());
|
||||
EventTypeEnum.TASK_TIME.getType());
|
||||
taskDistributionProducer.sendSmsSendMessage(mess);
|
||||
|
||||
if ((CommandTypeEnum.WORK_PICK_UP_GOODS_MOVE_TO_CHECK.getType().equals(data.getCommandType())
|
||||
|
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointBindingService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
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 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 = "管理后台 - 取货点位绑定")
|
||||
@RestController
|
||||
@RequestMapping("/system/ware/house-take-point-binding")
|
||||
@Validated
|
||||
public class WareHouseTakePointBindingController {
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointBindingService houseTakePointBindingService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建取货点位绑定")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:create')")
|
||||
public CommonResult<Long> createHouseTakePointBinding(@Valid @RequestBody WareHouseTakePointBindingSaveReqVO createReqVO) {
|
||||
return success(houseTakePointBindingService.createHouseTakePointBinding(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新取货点位绑定")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:update')")
|
||||
public CommonResult<Boolean> updateHouseTakePointBinding(@Valid @RequestBody WareHouseTakePointBindingSaveReqVO updateReqVO) {
|
||||
houseTakePointBindingService.updateHouseTakePointBinding(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除取货点位绑定")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:delete')")
|
||||
public CommonResult<Boolean> deleteHouseTakePointBinding(@RequestParam("id") Long id) {
|
||||
houseTakePointBindingService.deleteHouseTakePointBinding(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得取货点位绑定")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:query')")
|
||||
public CommonResult<WareHouseTakePointBindingRespVO> getHouseTakePointBinding(@RequestParam("id") Long id) {
|
||||
WareHouseTakePointBindingDO houseTakePointBinding = houseTakePointBindingService.getHouseTakePointBinding(id);
|
||||
return success(BeanUtils.toBean(houseTakePointBinding, WareHouseTakePointBindingRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得取货点位绑定分页")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:query')")
|
||||
public CommonResult<PageResult<WareHouseTakePointBindingRespVO>> getHouseTakePointBindingPage(@Valid WareHouseTakePointBindingPageReqVO pageReqVO) {
|
||||
PageResult<WareHouseTakePointBindingDO> pageResult = houseTakePointBindingService.getHouseTakePointBindingPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WareHouseTakePointBindingRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出取货点位绑定 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point-binding:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportHouseTakePointBindingExcel(@Valid WareHouseTakePointBindingPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<WareHouseTakePointBindingDO> list = houseTakePointBindingService.getHouseTakePointBindingPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "取货点位绑定.xls", "数据", WareHouseTakePointBindingRespVO.class,
|
||||
BeanUtils.toBean(list, WareHouseTakePointBindingRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
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 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 = "管理后台 - 取货点位")
|
||||
@RestController
|
||||
@RequestMapping("/system/ware/house-take-point")
|
||||
@Validated
|
||||
public class WareHouseTakePointController {
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建取货点位")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point:create')")
|
||||
public CommonResult<Long> createHouseTakePoint(@Valid @RequestBody WareHouseTakePointSaveReqVO createReqVO) {
|
||||
return success(houseTakePointService.createHouseTakePoint(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新取货点位")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point:update')")
|
||||
public CommonResult<Boolean> updateHouseTakePoint(@Valid @RequestBody WareHouseTakePointSaveReqVO updateReqVO) {
|
||||
houseTakePointService.updateHouseTakePoint(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除取货点位")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point:delete')")
|
||||
public CommonResult<Boolean> deleteHouseTakePoint(@RequestParam("id") Long id) {
|
||||
houseTakePointService.deleteHouseTakePoint(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得取货点位")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point:query')")
|
||||
public CommonResult<WareHouseTakePointRespVO> getHouseTakePoint(@RequestParam("id") Long id) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(id);
|
||||
return success(BeanUtils.toBean(houseTakePoint, WareHouseTakePointRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得取货点位分页")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point:query')")
|
||||
public CommonResult<PageResult<WareHouseTakePointRespVO>> getHouseTakePointPage(@Valid WareHouseTakePointPageReqVO pageReqVO) {
|
||||
PageResult<WareHouseTakePointDO> pageResult = houseTakePointService.getHouseTakePointPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WareHouseTakePointRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "获得取货点位集合")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point:list')")
|
||||
public CommonResult<List<WareHouseTakePointRespVO>> getHouseTakePointList(@RequestBody WareHouseTakePointSaveReqVO updateReqVO) {
|
||||
List<WareHouseTakePointDO> list = houseTakePointService.getHouseTakePointList(updateReqVO);
|
||||
return success(BeanUtils.toBean(list, WareHouseTakePointRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出取货点位 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-take-point:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportHouseTakePointExcel(@Valid WareHouseTakePointPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<WareHouseTakePointDO> list = houseTakePointService.getHouseTakePointPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "取货点位.xls", "数据", WareHouseTakePointRespVO.class,
|
||||
BeanUtils.toBean(list, WareHouseTakePointRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -8,8 +8,8 @@ import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class WareHouseLocationVO {
|
||||
@Schema(description = "放货类型(1:库位、2:线库、 3:区域、 4:点位)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "类型(1:库位、2:线库、 3:区域、4:点位)不能为空")
|
||||
@Schema(description = "放货类型(1:库位、2:线库、 3:区域、 4:路线的点位、 5:取放货的点位)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "类型(1:库位、2:线库、 3:区域、4:路线的点位、 5:取放货的点位)不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "位置", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位绑定分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WareHouseTakePointBindingPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "类型, 0:设备", example = "2")
|
||||
private Integer bindingType;
|
||||
|
||||
@Schema(description = "设备id", example = "3876")
|
||||
private Long bindingId;
|
||||
|
||||
@Schema(description = "取货点位表id", example = "20371")
|
||||
private Long takePointId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位绑定 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WareHouseTakePointBindingRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16028")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型, 0:设备", example = "2")
|
||||
@ExcelProperty("类型, 0:设备")
|
||||
private Integer bindingType;
|
||||
|
||||
@Schema(description = "设备id", example = "3876")
|
||||
@ExcelProperty("设备id")
|
||||
private Long bindingId;
|
||||
|
||||
@Schema(description = "取货点位表id", example = "20371")
|
||||
@ExcelProperty("取货点位表id")
|
||||
private Long takePointId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位绑定新增/修改 Request VO")
|
||||
@Data
|
||||
public class WareHouseTakePointBindingSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16028")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型, 0:设备", example = "2")
|
||||
private Integer bindingType;
|
||||
|
||||
@Schema(description = "设备id", example = "3876")
|
||||
private Long bindingId;
|
||||
|
||||
@Schema(description = "取货点位表id", example = "20371")
|
||||
private Long takePointId;
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class WareHouseTakePointPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "点位类型名称", example = "李四")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型, 0:翻转机设备, 1:普通取放货点位'", example = "2")
|
||||
private Integer pointType;
|
||||
|
||||
@Schema(description = "总高度")
|
||||
private BigDecimal totalHeight;
|
||||
|
||||
@Schema(description = "托盘高度")
|
||||
private BigDecimal trayHeight;
|
||||
|
||||
@Schema(description = "点位状态, 0:空闲, 1:有货", example = "2")
|
||||
private Integer pointStatus;
|
||||
|
||||
@Schema(description = "地图id", example = "25285")
|
||||
private Long positionMapId;
|
||||
|
||||
@Schema(description = "地图字表节点id", example = "527")
|
||||
private Long positionMapItemId;
|
||||
|
||||
@Schema(description = "实际坐标x轴")
|
||||
private String actualLocationX;
|
||||
|
||||
@Schema(description = "实际坐标y轴")
|
||||
private String actualLocationY;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "层数")
|
||||
private Integer locationStorey;
|
||||
|
||||
@Schema(description = "排序的位置,越大越优先堆放")
|
||||
private Long locationNumber;
|
||||
|
||||
@Schema(description = "巷道id(不关联其他表), 检测区的唯一就可以")
|
||||
private Long laneId;
|
||||
|
||||
@Schema(description = "物料信息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
private Long skuNumber;
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WareHouseTakePointRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11573")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "点位类型名称", example = "李四")
|
||||
@ExcelProperty("点位类型名称")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型, 0:翻转机设备, 1:普通取放货点位'", example = "2")
|
||||
@ExcelProperty("点位类型, 0:翻转机设备, 1:普通取放货点位'")
|
||||
private Integer pointType;
|
||||
|
||||
@Schema(description = "总高度")
|
||||
@ExcelProperty("总高度")
|
||||
private BigDecimal totalHeight;
|
||||
|
||||
@Schema(description = "托盘高度")
|
||||
@ExcelProperty("托盘高度")
|
||||
private BigDecimal trayHeight;
|
||||
|
||||
@Schema(description = "点位状态, 0:空闲, 1:有货", example = "2")
|
||||
@ExcelProperty("点位状态, 0:空闲, 1:有货")
|
||||
private Integer pointStatus;
|
||||
|
||||
@Schema(description = "地图id", example = "25285")
|
||||
@ExcelProperty("地图id")
|
||||
private Long positionMapId;
|
||||
|
||||
@Schema(description = "地图字表节点id", example = "527")
|
||||
@ExcelProperty("地图字表节点id")
|
||||
private Long positionMapItemId;
|
||||
|
||||
@Schema(description = "实际坐标x轴")
|
||||
@ExcelProperty("实际坐标x轴")
|
||||
private String actualLocationX;
|
||||
|
||||
@Schema(description = "实际坐标y轴")
|
||||
@ExcelProperty("实际坐标y轴")
|
||||
private String actualLocationY;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "层数")
|
||||
@ExcelProperty("层数")
|
||||
private Integer locationStorey;
|
||||
|
||||
@Schema(description = "排序的位置,越大越优先堆放")
|
||||
@ExcelProperty("排序的位置,越大越优先堆放")
|
||||
private Long locationNumber;
|
||||
|
||||
@Schema(description = "巷道id(不关联其他表), 检测区的唯一就可以")
|
||||
@ExcelProperty("巷道id(不关联其他表), 检测区的唯一就可以")
|
||||
private Long laneId;
|
||||
|
||||
@Schema(description = "物料信息")
|
||||
@ExcelProperty("物料信息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
@ExcelProperty("物料数量")
|
||||
private Long skuNumber;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.houselocation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 取货点位新增/修改 Request VO")
|
||||
@Data
|
||||
public class WareHouseTakePointSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11573")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "点位类型名称", example = "李四")
|
||||
private String pointName;
|
||||
|
||||
@Schema(description = "点位类型, 0:翻转机设备, 1:普通取放货点位'", example = "2")
|
||||
private Integer pointType;
|
||||
|
||||
@Schema(description = "总高度")
|
||||
private BigDecimal totalHeight;
|
||||
|
||||
@Schema(description = "托盘高度")
|
||||
private BigDecimal trayHeight;
|
||||
|
||||
@Schema(description = "点位状态, 0:空闲, 1:有货", example = "2")
|
||||
private Integer pointStatus;
|
||||
|
||||
@Schema(description = "地图id", example = "25285")
|
||||
private Long positionMapId;
|
||||
|
||||
@Schema(description = "地图字表节点id", example = "527")
|
||||
private Long positionMapItemId;
|
||||
|
||||
@Schema(description = "实际坐标x轴")
|
||||
private String actualLocationX;
|
||||
|
||||
@Schema(description = "实际坐标y轴")
|
||||
private String actualLocationY;
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11573")
|
||||
private List<Long> ids;
|
||||
|
||||
@Schema(description = "层数")
|
||||
private Integer locationStorey;
|
||||
|
||||
@Schema(description = "排序的位置,越大越优先堆放")
|
||||
private Long locationNumber;
|
||||
|
||||
@Schema(description = "巷道id(不关联其他表), 检测区的唯一就可以")
|
||||
private Long laneId;
|
||||
|
||||
@Schema(description = "物料信息")
|
||||
private String skuInfo;
|
||||
|
||||
@Schema(description = "物料数量")
|
||||
private Long skuNumber;
|
||||
|
||||
}
|
@ -71,8 +71,8 @@ public class DeviceInformationController {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('device:information:query')")
|
||||
public CommonResult<DeviceInformationRespVO> getInformation(@RequestParam("id") Long id) {
|
||||
DeviceInformationDO information = informationService.getInformation(id);
|
||||
return success(BeanUtils.toBean(information, DeviceInformationRespVO.class));
|
||||
DeviceInformationRespVO information = informationService.getInformation(id);
|
||||
return success(information);
|
||||
}
|
||||
|
||||
@GetMapping("/getCameraCode")
|
||||
|
@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 设备信息 DTO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@ -17,6 +19,9 @@ public class DeviceInformationDTO {
|
||||
@Schema(description = "设备类型 字典device_type", example = "2")
|
||||
private Integer deviceType;
|
||||
|
||||
@Schema(description = "设备类型 字典deviceTypes", example = "2")
|
||||
private List<Integer> deviceTypes;
|
||||
|
||||
@Schema(description = "设备状态(1:在线、2:离线、 3:异常)", example = "1")
|
||||
private Integer deviceStatus;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class DeviceInformationPageReqVO extends PageParam {
|
||||
@Schema(description = "深度")
|
||||
private BigDecimal locationDeep;
|
||||
|
||||
//1:充电桩,2:输送线,3:码垛机,4:自动门,5:提升机,6:信号灯,7:按钮盒,8:拆垛机, 9:摄像头
|
||||
//1:充电桩,2:输送线,3:码垛机,4:自动门,5:提升机,6:信号灯,7:按钮盒,8:拆垛机, 9:摄像头,10 :翻转机
|
||||
@Schema(description = "设备类型 字典device_type", example = "2")
|
||||
private Integer deviceType;
|
||||
|
||||
@ -101,4 +101,7 @@ public class DeviceInformationPageReqVO extends PageParam {
|
||||
@Schema(description = "摄像头编号")
|
||||
private String cameraCode;
|
||||
|
||||
@Schema(description = "ware_house_take_point的id")
|
||||
private Long takePointId;
|
||||
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class DeviceInformationRespVO {
|
||||
@ExcelProperty("深度")
|
||||
private BigDecimal locationDeep;
|
||||
|
||||
//1:充电桩,2:输送线,3:码垛机,4:自动门,5:提升机,6:信号灯,7:按钮盒,8:拆垛机, 9:摄像头
|
||||
//1:充电桩,2:输送线,3:码垛机,4:自动门,5:提升机,6:信号灯,7:按钮盒,8:拆垛机, 9:摄像头,10 :翻转机
|
||||
@Schema(description = "设备类型 字典device_type", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("设备类型 字典device_type")
|
||||
private Integer deviceType;
|
||||
@ -135,4 +135,17 @@ public class DeviceInformationRespVO {
|
||||
@Schema(description = "摄像头编号")
|
||||
@ExcelProperty("摄像头编号")
|
||||
private String cameraCode;
|
||||
|
||||
@Schema(description = "ware_house_take_point的id")
|
||||
@ExcelProperty("ware_house_take_point的id")
|
||||
private Long takePointId;
|
||||
|
||||
@Schema(description = "检测点的id")
|
||||
private List<Long> checkPointIds;
|
||||
|
||||
/*@Schema(description = "取货点位")
|
||||
private WareHouseTakePointDO takeWareHouseTakePointDO;
|
||||
|
||||
@Schema(description = "检测区的取货点位")
|
||||
private List<WareHouseTakePointDO> checkPointBindingList;*/
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class DeviceInformationSaveReqVO {
|
||||
@Schema(description = "深度")
|
||||
private BigDecimal locationDeep;
|
||||
|
||||
//1:充电桩,2:输送线,3:码垛机,4:自动门,5:提升机,6:信号灯,7:按钮盒,8:拆垛机 9:摄像头
|
||||
//1:充电桩,2:输送线,3:码垛机,4:自动门,5:提升机,6:信号灯,7:按钮盒,8:拆垛机 9:摄像头,10 :翻转机
|
||||
@Schema(description = "设备类型 字典device_type", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "设备类型不能为空")
|
||||
private Integer deviceType;
|
||||
@ -100,4 +100,10 @@ public class DeviceInformationSaveReqVO {
|
||||
|
||||
@Schema(description = "摄像头编号")
|
||||
private String cameraCode;
|
||||
|
||||
@Schema(description = "ware_house_take_point的id")
|
||||
private Long takePointId;
|
||||
|
||||
@Schema(description = "检测点的id")
|
||||
private List<Long> checkPointIds;
|
||||
}
|
||||
|
@ -18,13 +18,14 @@ import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMa
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.EventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.handler.mapnode.NodeProcessingContext;
|
||||
import cn.iocoder.yudao.module.system.mq.message.map.MapMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.producer.map.MapProducer;
|
||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapLineService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotTaskService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -43,6 +44,7 @@ import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "管理后台 - 仓库点位地图子表")
|
||||
@RestController
|
||||
@ -66,7 +68,7 @@ public class PositionMapItemController {
|
||||
private RobotTaskService taskService;
|
||||
|
||||
@Resource
|
||||
private PathApi pathApi;
|
||||
private MapProducer mapProducer;
|
||||
|
||||
// -- 前端给所有的节点信息 -
|
||||
@PostMapping("/batchSaveOrEditOrDel")
|
||||
@ -93,7 +95,9 @@ public class PositionMapItemController {
|
||||
.nickName(SecurityFrameworkUtils.getLoginUserNickname()).build();
|
||||
userOperationLogService.createUserOperationLog(operationLog);
|
||||
|
||||
pathApi.pathInitData();
|
||||
MapMessage mes = new MapMessage(this, positionMapId + "",
|
||||
EventTypeEnum.MAP_UPDATE.getType());
|
||||
mapProducer.sendSmsSendMessage(mes);
|
||||
|
||||
return success(true);
|
||||
}
|
||||
@ -139,7 +143,7 @@ public class PositionMapItemController {
|
||||
@PostMapping("/lineAddItem")
|
||||
@Operation(summary = "线上加点保存点位")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-item:lineAddItem')")
|
||||
public CommonResult<Map<String,Object>> lineAddItem(@Valid @RequestBody List<PositionMapItemNodeDTO> list) {
|
||||
public CommonResult<Map<String, Object>> lineAddItem(@Valid @RequestBody List<PositionMapItemNodeDTO> list) {
|
||||
|
||||
PositionMapItemSaveReqVO positionMapItem = BeanUtils.toBean(list.get(0), PositionMapItemSaveReqVO.class);
|
||||
positionMapItemService.createPositionMapItem(positionMapItem);
|
||||
@ -153,7 +157,7 @@ public class PositionMapItemController {
|
||||
itemIds.add(positionMapLineDO.getEndPointId());
|
||||
}
|
||||
|
||||
Map<Long,Long> sortNumMap = positionMapItemService.getSortNumMapByIds(itemIds);
|
||||
Map<Long, Long> sortNumMap = positionMapItemService.getSortNumMapByIds(itemIds);
|
||||
|
||||
for (PositionMapLineDO positionMapLineDO : lineList) {
|
||||
positionMapLineDO.setPositionMapId(positionMapItem.getPositionMapId());
|
||||
@ -161,9 +165,9 @@ public class PositionMapItemController {
|
||||
positionMapLineDO.setEndPointSortNum(sortNumMap.get(positionMapLineDO.getEndPointId()).intValue());
|
||||
}
|
||||
positionMapLineService.batchSaveLines(lineList);
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("ITEM",positionMapItemService.getPositionMapItem(positionMapItem.getId()));
|
||||
map.put("LINE",lineList);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("ITEM", positionMapItemService.getPositionMapItem(positionMapItem.getId()));
|
||||
map.put("LINE", lineList);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public class NodeBaseDTO {
|
||||
@Schema(description = "点位自增排序")
|
||||
private Long sortNum;
|
||||
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 --- 后续补充", example = "1")
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 7.检测点 --- 后续补充", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "对应各个类型的独有属性Json格式 例如({库位长度:1,库位宽度:2,库位方向:单向})", example = "1")
|
||||
|
@ -37,7 +37,7 @@ public class PositionMapItemPageReqVO extends PageParam {
|
||||
@Schema(description = "点位自增排序")
|
||||
private Long sortNum;
|
||||
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 --- 后续补充", example = "1")
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 7.文字点 8.检测点 --- 后续补充", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "对应各个类型的独有属性Json格式 例如({库位长度:1,库位宽度:2,库位方向:单向})", example = "1")
|
||||
|
@ -48,8 +48,8 @@ public class PositionMapItemRespVO {
|
||||
@Schema(description = "实际坐标y轴")
|
||||
private String actualLocationY;
|
||||
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 --- 后续补充", example = "1")
|
||||
@ExcelProperty("类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 --- 后续补充")
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 7.文字点 8.检测点 --- 后续补充", example = "1")
|
||||
@ExcelProperty("类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 7.文字点 8.检测点 --- 后续补充")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "点位自增排序")
|
||||
|
@ -31,7 +31,7 @@ public class PositionMapItemSaveReqVO {
|
||||
@Schema(description = "点位自增排序")
|
||||
private Long sortNum;
|
||||
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 --- 后续补充", example = "1")
|
||||
@Schema(description = "类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 7.文字点 8.检测点 --- 后续补充", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "对应各个类型的独有属性Json格式 例如({库位长度:1,库位宽度:2,库位方向:单向})", example = "1")
|
||||
|
@ -18,8 +18,8 @@ public class RobotTaskDetailAddVO {
|
||||
@NotNull(message = "放货类型(1:库位、2:线库、 3:区域、 4:点位)不能为空")
|
||||
private Integer releaseType;
|
||||
|
||||
@Schema(description = "取货类型(1:库位、2:线库、 3:区域)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "取货类型(1:库位、2:线库、 3:区域)不能为空")
|
||||
@Schema(description = "取货类型(1:库位、2:线库、 3:区域、 4:点位)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "取货类型(1:库位、2:线库、 3:区域、4:点位)不能为空")
|
||||
private Integer takeType;
|
||||
|
||||
@Schema(description = "放货库位/线库/区域", requiredMode = Schema.RequiredMode.REQUIRED, example = "6223")
|
||||
|
@ -34,7 +34,7 @@ public class RobotWarnMsgSaveReqVO {
|
||||
private String warnSolve;
|
||||
|
||||
@Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "结束时间不能为空")
|
||||
// @NotNull(message = "结束时间不能为空")
|
||||
private LocalDateTime solveTime;
|
||||
|
||||
@Schema(description = "是否已读(0:未读, 1:已读)")
|
||||
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.houselocation;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 取货点位绑定 DO
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@TableName("ware_house_take_point_binding")
|
||||
@KeySequence("ware_house_take_point_binding_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WareHouseTakePointBindingDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 类型, 0:设备
|
||||
*/
|
||||
private Integer bindingType;
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
private Long bindingId;
|
||||
/**
|
||||
* 取货点位表id
|
||||
*/
|
||||
private Long takePointId;
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.houselocation;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 取货点位 DO
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@TableName("ware_house_take_point")
|
||||
@KeySequence("ware_house_take_point_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WareHouseTakePointDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 点位类型名称
|
||||
*/
|
||||
private String pointName;
|
||||
/**
|
||||
* 点位类型 0:翻转机设备, 1:普通取放货点位
|
||||
*/
|
||||
private Integer pointType;
|
||||
/**
|
||||
* 总高度
|
||||
*/
|
||||
private BigDecimal totalHeight;
|
||||
/**
|
||||
* 托盘高度
|
||||
*/
|
||||
private BigDecimal trayHeight;
|
||||
/**
|
||||
* 点位状态, 0:空闲, 1:有货
|
||||
*/
|
||||
private Integer pointStatus;
|
||||
/**
|
||||
* 地图id
|
||||
*/
|
||||
private Long positionMapId;
|
||||
/**
|
||||
* 地图字表节点id
|
||||
*/
|
||||
private Long positionMapItemId;
|
||||
/**
|
||||
* 实际坐标x轴
|
||||
*/
|
||||
private String actualLocationX;
|
||||
/**
|
||||
* 实际坐标y轴
|
||||
*/
|
||||
private String actualLocationY;
|
||||
/**
|
||||
* 层数
|
||||
*/
|
||||
private Integer locationStorey;
|
||||
/**
|
||||
* 排序的位置,越大越优先堆放
|
||||
*/
|
||||
private Long locationNumber;
|
||||
/**
|
||||
* 巷道id(不关联其他表), 检测区的唯一就可以
|
||||
*/
|
||||
private Long laneId;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private String skuInfo;
|
||||
/**
|
||||
* 物料数量
|
||||
*/
|
||||
private Long skuNumber;
|
||||
|
||||
}
|
@ -67,7 +67,7 @@ public class DeviceInformationDO extends BaseDO {
|
||||
*/
|
||||
private BigDecimal locationDeep;
|
||||
/**
|
||||
* 1:充电桩,2:输送线,3:码垛机,4:自动门,5:提升机,6:信号灯,7:按钮盒,8:拆垛机, 9:摄像头
|
||||
* 1:充电桩,2:输送线,3:码垛机,4:自动门,5:提升机,6:信号灯,7:按钮盒,8:拆垛机, 9:摄像头 ,10 :翻转机
|
||||
* 设备类型 字典device_type
|
||||
*/
|
||||
private Integer deviceType;
|
||||
@ -144,4 +144,9 @@ public class DeviceInformationDO extends BaseDO {
|
||||
* 摄像头编号
|
||||
*/
|
||||
private String cameraCode;
|
||||
|
||||
/**
|
||||
* ware_house_take_point的id
|
||||
*/
|
||||
private Long takePointId;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class PositionMapItemDO extends BaseDO {
|
||||
*/
|
||||
private Long sortNum;
|
||||
/**
|
||||
* 类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 --- 后续补充
|
||||
* 类型 1.路径点位 2.库位点 3.充电桩 4.停车点 5.区域变更点 6.等待点 7.文字点 8.检测点--- 后续补充
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
|
@ -36,11 +36,11 @@ public class RobotTaskDetailDO extends BaseDO {
|
||||
*/
|
||||
private Integer taskType;
|
||||
/**
|
||||
* 放货类型(1:库位、2:线库、 3:区域)
|
||||
* 放货类型(1:库位、2:线库、 3:区域、 4:点位)
|
||||
*/
|
||||
private Integer releaseType;
|
||||
/**
|
||||
* 取货类型(1:库位、2:线库、 3:区域)
|
||||
* 取货类型(1:库位、2:线库、 3:区域、 4:点位)
|
||||
*/
|
||||
private Integer takeType;
|
||||
/**
|
||||
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.houselocation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 取货点位绑定 Mapper
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Mapper
|
||||
public interface WareHouseTakePointBindingMapper extends BaseMapperX<WareHouseTakePointBindingDO> {
|
||||
|
||||
default PageResult<WareHouseTakePointBindingDO> selectPage(WareHouseTakePointBindingPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WareHouseTakePointBindingDO>()
|
||||
.eqIfPresent(WareHouseTakePointBindingDO::getBindingType, reqVO.getBindingType())
|
||||
.eqIfPresent(WareHouseTakePointBindingDO::getBindingId, reqVO.getBindingId())
|
||||
.eqIfPresent(WareHouseTakePointBindingDO::getTakePointId, reqVO.getTakePointId())
|
||||
.betweenIfPresent(WareHouseTakePointBindingDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(WareHouseTakePointBindingDO::getId));
|
||||
}
|
||||
|
||||
void deleteByBindingId(@Param("bindingId") Long bindingId);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.houselocation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 取货点位 Mapper
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Mapper
|
||||
public interface WareHouseTakePointMapper extends BaseMapperX<WareHouseTakePointDO> {
|
||||
|
||||
default PageResult<WareHouseTakePointDO> selectPage(WareHouseTakePointPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WareHouseTakePointDO>()
|
||||
.likeIfPresent(WareHouseTakePointDO::getPointName, reqVO.getPointName())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPointType, reqVO.getPointType())
|
||||
.eqIfPresent(WareHouseTakePointDO::getTotalHeight, reqVO.getTotalHeight())
|
||||
.eqIfPresent(WareHouseTakePointDO::getTrayHeight, reqVO.getTrayHeight())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPointStatus, reqVO.getPointStatus())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPositionMapId, reqVO.getPositionMapId())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPositionMapItemId, reqVO.getPositionMapItemId())
|
||||
.eqIfPresent(WareHouseTakePointDO::getActualLocationX, reqVO.getActualLocationX())
|
||||
.eqIfPresent(WareHouseTakePointDO::getActualLocationY, reqVO.getActualLocationY())
|
||||
.betweenIfPresent(WareHouseTakePointDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(WareHouseTakePointDO::getId));
|
||||
}
|
||||
|
||||
void setTakePointMapIdEmpty(@Param("positionMapId") Long positionMapId,
|
||||
@Param("ids") List<Long> ids);
|
||||
|
||||
void updateHouseTakePointByItemIdAndStorey(WareHouseTakePointDO pointDO);
|
||||
}
|
@ -98,4 +98,12 @@ public interface PositionMapItemMapper extends BaseMapperX<PositionMapItemDO> {
|
||||
/*@MapKey("id")
|
||||
Map<Long, Long> selectSortNumByIds(@Param("ids") List<Long> ids);*/
|
||||
List<PositionMapItemDO> selectSortNumByIds(@Param("ids") List<Long> ids);
|
||||
|
||||
/**
|
||||
* 设置点位使用中
|
||||
*
|
||||
* @param id
|
||||
* @param robotNo
|
||||
*/
|
||||
void setMapItemUse(@Param("id") Long id, @Param("robotNo") String robotNo);
|
||||
}
|
||||
|
@ -15,7 +15,8 @@ public enum DeviceTypeEnum {
|
||||
SIGNAL_LIGHT(6, "信号灯"),
|
||||
BUTTON_BOX(7, "按钮盒"),
|
||||
DISMANTLING_MACHINE(8, "拆垛机"),
|
||||
CAMERA(9, "摄像头");
|
||||
CAMERA(9, "摄像头"),
|
||||
FLIP(10, "翻转机");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
@ -41,6 +42,8 @@ public enum DeviceTypeEnum {
|
||||
return 10;
|
||||
}if (BUTTON_BOX.type.equals(type)) {
|
||||
return 11;
|
||||
}if (FLIP.type.equals(type)) {
|
||||
return 14;
|
||||
}else {
|
||||
return 12;
|
||||
}
|
||||
|
@ -11,7 +11,10 @@ public enum PositionMapItemEnum {
|
||||
CHARGE(3,"充电桩"),
|
||||
STOP(4,"停车点"),
|
||||
CHANGE(5,"区域变更点"),
|
||||
WAIT(6,"等待点");
|
||||
WAIT(6,"等待点"),
|
||||
TEXT(7,"文字点"),
|
||||
CHECK(8,"检测点");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
|
@ -0,0 +1,16 @@
|
||||
package cn.iocoder.yudao.module.system.enums.map;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PointTypeEnum {
|
||||
FLIP(0,"翻转机设备"),
|
||||
TAKE(1,"普通取放货点位");
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
private final String msg;
|
||||
}
|
@ -12,7 +12,8 @@ public enum ReleaseTakeEnum {
|
||||
|
||||
TO_LOCATION(1, "库位"),
|
||||
TO_LANE(2, "线库"),
|
||||
TO_AREA(3, "区域");
|
||||
TO_AREA(3, "区域"),
|
||||
TO_POINT(4, "取放货的点位");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
@ -22,4 +23,13 @@ public enum ReleaseTakeEnum {
|
||||
* 说明
|
||||
*/
|
||||
private final String msg;
|
||||
|
||||
public static Boolean isLocation(Integer type) {
|
||||
if (TO_LOCATION.getType().equals(type)
|
||||
|| TO_LANE.getType().equals(type)
|
||||
|| TO_AREA.getType().equals(type)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.enums.robot.task;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RobotTakeEnum {
|
||||
TO_LOCATION(1, "库位"),
|
||||
TO_LANE(2, "线库"),
|
||||
TO_AREA(3, "区域"),
|
||||
TO_LINE_POINT(4, "路线的点位"),
|
||||
TO_POINT(5, "取放货的点位");
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private final String msg;
|
||||
}
|
@ -5,10 +5,11 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RobotTaskEventTypeEnum {
|
||||
DISTRIBUTION("DISTRIBUTION","任务分配"),
|
||||
DONE("DONE","任务完成"),
|
||||
TIME("TIME","统计时间");
|
||||
public enum EventTypeEnum {
|
||||
TASK_DISTRIBUTION("DISTRIBUTION","任务分配"),
|
||||
TASK_DONE("DONE","任务完成"),
|
||||
TASK_TIME("TIME","统计时间"),
|
||||
MAP_UPDATE("MAP_UPDATE","修改地图");
|
||||
/**
|
||||
* 类型
|
||||
*/
|
@ -34,6 +34,8 @@ public class NodeProcessingContext {
|
||||
@Autowired
|
||||
@Lazy
|
||||
private DeviceStrategyImpl deviceStrategyImpl;
|
||||
@Autowired
|
||||
private CheckStrategyImpl checkStrategyImpl;
|
||||
|
||||
/**
|
||||
* 项目启动时 初始化策略
|
||||
@ -54,6 +56,8 @@ public class NodeProcessingContext {
|
||||
strategyMap.put(NodeTypeEnum.WAIT.getType(), mapNodeStrategyImpl);
|
||||
// 文字点
|
||||
strategyMap.put(NodeTypeEnum.TEXT.getType(), mapNodeStrategyImpl);
|
||||
// 检测点
|
||||
strategyMap.put(NodeTypeEnum.CHECK.getType(), checkStrategyImpl);
|
||||
// todo 可以继续添加更多的策略 - 新增实现即可
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.system.handler.mapnode.strategy;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.dto.NodeBaseDTO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.enums.map.PointTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.baomidou.mybatisplus.core.toolkit.IdWorker.getId;
|
||||
|
||||
@Component
|
||||
public class CheckStrategyImpl implements NodeProcessingStrategy{
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@Override
|
||||
public void processNodes(Long positionMapId, List<NodeBaseDTO> nodeBaseDTOS) {
|
||||
// -- 策略3 处理设备点
|
||||
// -- 将data里面的json 数据转为实体类 - 再对比节点id - 然后做新增删除修改操作
|
||||
List<WareHouseTakePointDO> newList = new ArrayList<>();
|
||||
// -- 拿到这个地图所绑定的设备 -
|
||||
|
||||
WareHouseTakePointSaveReqVO reqVO = new WareHouseTakePointSaveReqVO();
|
||||
reqVO.setPositionMapId(positionMapId);
|
||||
reqVO.setPointType(PointTypeEnum.TAKE.getType());
|
||||
List<WareHouseTakePointDO> oldList = houseTakePointService.getHouseTakePointList(reqVO);
|
||||
for (NodeBaseDTO item : nodeBaseDTOS) {
|
||||
if (item.getId() == null) {
|
||||
item.setId(getId());
|
||||
}
|
||||
item.setPositionMapId(positionMapId);
|
||||
if(ObjectUtil.isEmpty(item.getDataJson())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<WareHouseTakePointDO> wareHouseTakePointDOS = JSONUtil.toList(item.getDataJson(), WareHouseTakePointDO.class);
|
||||
|
||||
for (WareHouseTakePointDO wareHouseTakePointDO : wareHouseTakePointDOS) {
|
||||
wareHouseTakePointDO.setPointType(PointTypeEnum.TAKE.getType());
|
||||
wareHouseTakePointDO.setPositionMapId(positionMapId);
|
||||
wareHouseTakePointDO.setPositionMapItemId(item.getId());
|
||||
newList.add(wareHouseTakePointDO);
|
||||
}
|
||||
item.setDataJson(JSONUtil.toJsonStr(wareHouseTakePointDOS));
|
||||
}
|
||||
|
||||
List<List<WareHouseTakePointDO>> list = CollectionUtils.compareLists(oldList, newList,
|
||||
(oldVal, newVal) -> ObjectUtil.equal(oldVal.getId(), newVal.getId()));
|
||||
houseTakePointService.batchEditOrDel(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.system.mq.consumer.map;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.module.system.api.path.PathApi;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.information.DeviceInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.remote.RemoteControllerInformationDO;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.map.PointTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.EventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.mq.message.map.MapMessage;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.information.DeviceInformationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class MapConsumer {
|
||||
|
||||
@Resource
|
||||
private PathApi pathApi;
|
||||
|
||||
@Resource
|
||||
private DeviceInformationService deviceInformationService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@EventListener
|
||||
@Async
|
||||
public void onMessage(MapMessage message) {
|
||||
if (EventTypeEnum.MAP_UPDATE.getType().equals(message.getEventType())) {
|
||||
pathApi.pathInitData();
|
||||
Long mapId = Long.valueOf(message.getMessage());
|
||||
List<DeviceInformationDO> devices = deviceInformationService.getDeviceInfoBindByMapId(mapId);
|
||||
if (ObjectUtil.isEmpty(devices)) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<Long> takePointIds = new ArrayList<>();
|
||||
List<WareHouseTakePointDO> takePointDOS = new ArrayList<>();
|
||||
for (DeviceInformationDO device : devices) {
|
||||
if (!DeviceTypeEnum.FLIP.getType().equals(device.getDeviceType()) || ObjectUtil.isNotEmpty(device.getTakePointId())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
takePointIds.add(device.getTakePointId());
|
||||
|
||||
}
|
||||
houseTakePointService.setTakePointMapIdEmpty(mapId, takePointIds);
|
||||
|
||||
if (ObjectUtil.isEmpty(takePointIds)) {
|
||||
return;
|
||||
}
|
||||
|
||||
WareHouseTakePointSaveReqVO reqVO = new WareHouseTakePointSaveReqVO();
|
||||
reqVO.setIds(takePointIds);
|
||||
List<WareHouseTakePointDO> houseTakePointList = houseTakePointService.getHouseTakePointList(reqVO);
|
||||
|
||||
Map<Long, WareHouseTakePointDO> pointMap = houseTakePointList.stream().collect(Collectors.toMap(WareHouseTakePointDO::getId, Function.identity()));
|
||||
|
||||
for (DeviceInformationDO device : devices) {
|
||||
if (!DeviceTypeEnum.FLIP.getType().equals(device.getDeviceType()) || ObjectUtil.isEmpty(device.getTakePointId())) {
|
||||
continue;
|
||||
}
|
||||
WareHouseTakePointDO wareHouseTakePointDO = pointMap.get(device.getId());
|
||||
wareHouseTakePointDO.setPositionMapId(mapId);
|
||||
wareHouseTakePointDO.setActualLocationX(device.getActualLocationX());
|
||||
wareHouseTakePointDO.setActualLocationY(device.getActualLocationY());
|
||||
takePointDOS.add(wareHouseTakePointDO);
|
||||
}
|
||||
houseTakePointService.updateBatchById(takePointDOS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.mq.consumer.remote;
|
||||
|
||||
import cn.iocoder.yudao.module.system.mq.message.RemoteSendMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.message.remote.RemoteSendMessage;
|
||||
import cn.iocoder.yudao.module.system.service.remote.RemoteControllerInformationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.event.EventListener;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.system.mq.consumer.task;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.system.api.robot.vo.RobotWorkStatusDTO;
|
||||
@ -13,9 +12,10 @@ import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.CommandTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotTaskTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.WorkProgressEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.RobotTaskEventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.EventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.mq.message.task.TaskDistributionMessage;
|
||||
import cn.iocoder.yudao.module.system.service.log.RobotTaskTimeConsumingService;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotTaskDetailService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotTaskService;
|
||||
import cn.iocoder.yudao.module.system.service.statistics.RobotWorkingHoursStatisticsService;
|
||||
@ -31,8 +31,6 @@ import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@ -53,12 +51,15 @@ public class TaskDistributionConsumer {
|
||||
@Resource
|
||||
private RobotWorkingHoursStatisticsService robotWorkingHoursStatisticsService;
|
||||
|
||||
@Resource
|
||||
private PositionMapItemService positionMapItemService;
|
||||
|
||||
@EventListener
|
||||
@Async
|
||||
public void onMessage(TaskDistributionMessage message) {
|
||||
log.info("111111, 任务 : {}", JSON.toJSONString(message));
|
||||
TenantContextHolder.setTenantId(1L);
|
||||
if (RobotTaskEventTypeEnum.DISTRIBUTION.getType().equals(message.getEventType())) {
|
||||
if (EventTypeEnum.TASK_DISTRIBUTION.getType().equals(message.getEventType())) {
|
||||
RobotTaskDetailDO taskDetail = robotTaskDetailService.getTaskDetail(Long.valueOf(message.getMessage()));
|
||||
robotWorkingHoursStatisticsService.createFreeTime(taskDetail.getRobotNo());
|
||||
RobotTaskDO task = taskService.getTask(taskDetail.getRobotTaskId());
|
||||
@ -71,12 +72,16 @@ public class TaskDistributionConsumer {
|
||||
.setToLocationNo(taskDetail.getToLocationNo())
|
||||
.setRobotNo(taskDetail.getRobotNo());
|
||||
robotTaskTimeConsumingService.createRobotTaskTimeConsuming(data);
|
||||
} else if (RobotTaskEventTypeEnum.TIME.getType().equals(message.getEventType())) {
|
||||
} else if (EventTypeEnum.TASK_TIME.getType().equals(message.getEventType())) {
|
||||
RobotWorkStatusDTO data = JSON.parseObject(message.getMessage(), RobotWorkStatusDTO.class);
|
||||
addTaskTimeLog(data);
|
||||
} else if (RobotTaskEventTypeEnum.DONE.getType().equals(message.getEventType())) {
|
||||
} else if (EventTypeEnum.TASK_DONE.getType().equals(message.getEventType())) {
|
||||
String orderId = message.getMessage();
|
||||
String endTime = DateUtils.getYearMonthDayHourMinuteSecon();
|
||||
/*try {
|
||||
Thread.sleep(2000);
|
||||
} catch (Exception e) {
|
||||
}*/
|
||||
RobotTaskDetailDO taskDetail = robotTaskDetailService.getTaskDetail(Long.valueOf(orderId));
|
||||
if (RobotTaskTypeEnum.TAKE_RELEASE.getType().equals(taskDetail.getTaskType())) {
|
||||
takeRelease(taskDetail, endTime, orderId);
|
||||
@ -86,6 +91,8 @@ public class TaskDistributionConsumer {
|
||||
takeTask(taskDetail, endTime, orderId);
|
||||
} else if (RobotTaskTypeEnum.RELEASE.getType().equals(taskDetail.getTaskType())) {
|
||||
releaseTask(taskDetail, endTime, orderId);
|
||||
}else if (RobotTaskTypeEnum.MOVE_TO_POINT.getType().equals(taskDetail.getTaskType())) {
|
||||
positionMapItemService.setMapItemUse(taskDetail.getReleaseId(),taskDetail.getRobotNo());
|
||||
}
|
||||
|
||||
}
|
||||
@ -185,7 +192,7 @@ public class TaskDistributionConsumer {
|
||||
*/
|
||||
private void addTaskTimeLog(RobotWorkStatusDTO data) {
|
||||
if (CommandTypeEnum.WORK_PICK_UP_GOODS.getType().equals(data.getCommandType())
|
||||
&& WorkProgressEnum.FORK_AND_TILT_INIT.getType().equals(data.getWorkProgress())
|
||||
&& WorkProgressEnum.FORK_AND_TILT.getType().equals(data.getWorkProgress())
|
||||
&& RobotExecutionStateConstant.DOING.equals(Integer.valueOf(data.getExecutionState()))) {
|
||||
startPickUp(data);
|
||||
} else if (CommandTypeEnum.WORK_PICK_UP_GOODS.getType().equals(data.getCommandType())
|
||||
|
@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.system.mq.message.map;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
public class MapMessage extends ApplicationEvent {
|
||||
|
||||
private String msg;
|
||||
private String eventType;
|
||||
public MapMessage(Object source, String msg,String eventType) {
|
||||
super(source);
|
||||
this.msg = msg;
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public String getEventType() {
|
||||
return eventType;
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.system.mq.message;
|
||||
package cn.iocoder.yudao.module.system.mq.message.remote;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.mq.producer.map;
|
||||
|
||||
import cn.iocoder.yudao.module.system.mq.message.map.MapMessage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MapProducer {
|
||||
|
||||
@Resource
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
public void sendSmsSendMessage(MapMessage message) {
|
||||
applicationContext.publishEvent(message);
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.mq.producer.remote;
|
||||
|
||||
import cn.iocoder.yudao.module.system.mq.message.RemoteSendMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.message.remote.RemoteSendMessage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.system.mq.producer.task;
|
||||
|
||||
import cn.iocoder.yudao.module.system.mq.message.RemoteSendMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.message.task.TaskDistributionMessage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
@ -9,10 +9,13 @@ import cn.iocoder.yudao.module.system.constant.CommonConstant;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.log.vo.UserOperationLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseLocationMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.LocationEnableEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.LocationLockEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.LocationUseStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.ReleaseTakeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotTakeEnum;
|
||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -21,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
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.function.Function;
|
||||
@ -46,6 +50,9 @@ public class HouseLocationServiceImpl extends ServiceImpl<WareHouseLocationMappe
|
||||
@Resource
|
||||
private UserOperationLogService userOperationLogService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createHouseLocation(WareHouseLocationSaveReqVO createReqVO) {
|
||||
@ -70,7 +77,7 @@ public class HouseLocationServiceImpl extends ServiceImpl<WareHouseLocationMappe
|
||||
|
||||
String str = getChangeInfo(wareHouseLocationDO, updateObj);
|
||||
|
||||
if(ObjectUtil.isEmpty(str)) {
|
||||
if (ObjectUtil.isEmpty(str)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -112,11 +119,11 @@ public class HouseLocationServiceImpl extends ServiceImpl<WareHouseLocationMappe
|
||||
}
|
||||
|
||||
if (!wareHouseLocationDO.getLocationLock().equals(updateReqVO.getLocationLock())
|
||||
&& LocationLockEnum.NO.getType().equals(updateReqVO.getLocationLock())) {
|
||||
str = str + " 设置库位锁定状态为锁定" ;
|
||||
}else if (!wareHouseLocationDO.getLocationLock().equals(updateReqVO.getLocationLock())
|
||||
&& LocationLockEnum.NO.getType().equals(updateReqVO.getLocationLock())) {
|
||||
str = str + " 设置库位锁定状态为锁定";
|
||||
} else if (!wareHouseLocationDO.getLocationLock().equals(updateReqVO.getLocationLock())
|
||||
&& LocationLockEnum.YES.getType().equals(updateReqVO.getLocationLock())) {
|
||||
str = str + " 设置库位锁定状态为正常" ;
|
||||
str = str + " 设置库位锁定状态为正常";
|
||||
}
|
||||
|
||||
return str;
|
||||
@ -149,7 +156,28 @@ public class HouseLocationServiceImpl extends ServiceImpl<WareHouseLocationMappe
|
||||
|
||||
@Override
|
||||
public List<WareHouseLocationRespVO> getLocationByName(WareHouseLocationVO requestVO) {
|
||||
return houseLocationMapper.getLocationByName(requestVO);
|
||||
if (RobotTakeEnum.TO_LOCATION.getType().equals(requestVO.getType())
|
||||
|| RobotTakeEnum.TO_LANE.getType().equals(requestVO.getType())
|
||||
|| RobotTakeEnum.TO_LINE_POINT.getType().equals(requestVO.getType())
|
||||
|| RobotTakeEnum.TO_AREA.getType().equals(requestVO.getType())) {
|
||||
return houseLocationMapper.getLocationByName(requestVO);
|
||||
} else if (RobotTakeEnum.TO_POINT.getType().equals(requestVO.getType())) {
|
||||
WareHouseTakePointSaveReqVO reqVO = new WareHouseTakePointSaveReqVO();
|
||||
reqVO.setPointName(requestVO.getLocationNo());
|
||||
List<WareHouseTakePointDO> houseTakePointList = houseTakePointService.getHouseTakePointList(reqVO);
|
||||
if (ObjectUtil.isEmpty(houseTakePointList)) {
|
||||
return null;
|
||||
}
|
||||
List<WareHouseLocationRespVO> list = new ArrayList<>();
|
||||
for (WareHouseTakePointDO wareHouseTakePointDO : houseTakePointList) {
|
||||
WareHouseLocationRespVO houseLocationRespVO = new WareHouseLocationRespVO();
|
||||
houseLocationRespVO.setId(wareHouseTakePointDO.getId());
|
||||
houseLocationRespVO.setLocationNo(wareHouseTakePointDO.getPointName());
|
||||
list.add(houseLocationRespVO);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -182,6 +210,7 @@ public class HouseLocationServiceImpl extends ServiceImpl<WareHouseLocationMappe
|
||||
|
||||
/**
|
||||
* 获取这个地图对应的库位和坐标信息
|
||||
*
|
||||
* @param mapId
|
||||
* @return
|
||||
*/
|
||||
@ -197,6 +226,7 @@ public class HouseLocationServiceImpl extends ServiceImpl<WareHouseLocationMappe
|
||||
|
||||
/**
|
||||
* 查询有货或者有锁定的库位
|
||||
*
|
||||
* @param mapId
|
||||
* @return
|
||||
*/
|
||||
|
@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.system.service.houselocation;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 取货点位绑定 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface WareHouseTakePointBindingService extends IService<WareHouseTakePointBindingDO> {
|
||||
|
||||
/**
|
||||
* 创建取货点位绑定
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createHouseTakePointBinding(@Valid WareHouseTakePointBindingSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新取货点位绑定
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateHouseTakePointBinding(@Valid WareHouseTakePointBindingSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除取货点位绑定
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteHouseTakePointBinding(Long id);
|
||||
|
||||
/**
|
||||
* 获得取货点位绑定
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 取货点位绑定
|
||||
*/
|
||||
WareHouseTakePointBindingDO getHouseTakePointBinding(Long id);
|
||||
|
||||
/**
|
||||
* 获得取货点位绑定分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 取货点位绑定分页
|
||||
*/
|
||||
PageResult<WareHouseTakePointBindingDO> getHouseTakePointBindingPage(WareHouseTakePointBindingPageReqVO pageReqVO);
|
||||
|
||||
void createHouseTakePointBindings(List<WareHouseTakePointBindingDO> list);
|
||||
|
||||
void deleteByBindingId(Long id);
|
||||
|
||||
List<WareHouseTakePointBindingDO> getByBindingId(Long id);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.system.service.houselocation;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointBindingSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseTakePointBindingMapper;
|
||||
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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.HOUSE_TAKE_POINT_BINDING_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 取货点位绑定 Service 实现类
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class WareHouseTakePointBindingServiceImpl extends ServiceImpl<WareHouseTakePointBindingMapper, WareHouseTakePointBindingDO> implements WareHouseTakePointBindingService {
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointBindingMapper houseTakePointBindingMapper;
|
||||
|
||||
@Override
|
||||
public Long createHouseTakePointBinding(WareHouseTakePointBindingSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
WareHouseTakePointBindingDO houseTakePointBinding = BeanUtils.toBean(createReqVO, WareHouseTakePointBindingDO.class);
|
||||
houseTakePointBindingMapper.insert(houseTakePointBinding);
|
||||
// 返回
|
||||
return houseTakePointBinding.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHouseTakePointBinding(WareHouseTakePointBindingSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateHouseTakePointBindingExists(updateReqVO.getId());
|
||||
// 更新
|
||||
WareHouseTakePointBindingDO updateObj = BeanUtils.toBean(updateReqVO, WareHouseTakePointBindingDO.class);
|
||||
houseTakePointBindingMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteHouseTakePointBinding(Long id) {
|
||||
// 校验存在
|
||||
validateHouseTakePointBindingExists(id);
|
||||
// 删除
|
||||
houseTakePointBindingMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateHouseTakePointBindingExists(Long id) {
|
||||
if (houseTakePointBindingMapper.selectById(id) == null) {
|
||||
throw exception(HOUSE_TAKE_POINT_BINDING_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WareHouseTakePointBindingDO getHouseTakePointBinding(Long id) {
|
||||
return houseTakePointBindingMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WareHouseTakePointBindingDO> getHouseTakePointBindingPage(WareHouseTakePointBindingPageReqVO pageReqVO) {
|
||||
return houseTakePointBindingMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createHouseTakePointBindings(List<WareHouseTakePointBindingDO> list) {
|
||||
houseTakePointBindingMapper.insert(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByBindingId(Long id) {
|
||||
houseTakePointBindingMapper.deleteByBindingId(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WareHouseTakePointBindingDO> getByBindingId(Long bindingId) {
|
||||
return houseTakePointBindingMapper.selectList(new LambdaQueryWrapperX<WareHouseTakePointBindingDO>()
|
||||
.eq(WareHouseTakePointBindingDO::getBindingId, bindingId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.system.service.houselocation;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 取货点位 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface WareHouseTakePointService extends IService<WareHouseTakePointDO> {
|
||||
|
||||
/**
|
||||
* 创建取货点位
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createHouseTakePoint(@Valid WareHouseTakePointSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新取货点位
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateHouseTakePoint(@Valid WareHouseTakePointSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除取货点位
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteHouseTakePoint(Long id);
|
||||
|
||||
/**
|
||||
* 获得取货点位
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 取货点位
|
||||
*/
|
||||
WareHouseTakePointDO getHouseTakePoint(Long id);
|
||||
|
||||
/**
|
||||
* 获得取货点位分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 取货点位分页
|
||||
*/
|
||||
PageResult<WareHouseTakePointDO> getHouseTakePointPage(WareHouseTakePointPageReqVO pageReqVO);
|
||||
|
||||
List<WareHouseTakePointDO> getHouseTakePointList(WareHouseTakePointSaveReqVO updateReqVO);
|
||||
|
||||
void setTakePointMapIdEmpty(Long mapId,List<Long> ids);
|
||||
|
||||
void batchEditOrDel(List<List<WareHouseTakePointDO>> list);
|
||||
|
||||
WareHouseTakePointDO getHouseTakePointByItemIdAndStorey(Long positionMapItemId, int locationStorey);
|
||||
|
||||
void updateHouseTakePointByItemIdAndStorey(WareHouseTakePointDO pointDO);
|
||||
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package cn.iocoder.yudao.module.system.service.houselocation;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.houselocation.vo.WareHouseTakePointSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.parkingspot.ParkingSpotDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseTakePointMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
|
||||
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.module.system.enums.ErrorCodeConstants.HOUSE_TAKE_POINT_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 取货点位 Service 实现类
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class WareHouseTakePointServiceImpl extends ServiceImpl<WareHouseTakePointMapper, WareHouseTakePointDO> implements WareHouseTakePointService {
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointMapper houseTakePointMapper;
|
||||
|
||||
@Override
|
||||
public Long createHouseTakePoint(WareHouseTakePointSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
WareHouseTakePointDO houseTakePoint = BeanUtils.toBean(createReqVO, WareHouseTakePointDO.class);
|
||||
houseTakePointMapper.insert(houseTakePoint);
|
||||
// 返回
|
||||
return houseTakePoint.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHouseTakePoint(WareHouseTakePointSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateHouseTakePointExists(updateReqVO.getId());
|
||||
// 更新
|
||||
WareHouseTakePointDO updateObj = BeanUtils.toBean(updateReqVO, WareHouseTakePointDO.class);
|
||||
houseTakePointMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteHouseTakePoint(Long id) {
|
||||
// 校验存在
|
||||
validateHouseTakePointExists(id);
|
||||
// 删除
|
||||
houseTakePointMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateHouseTakePointExists(Long id) {
|
||||
if (houseTakePointMapper.selectById(id) == null) {
|
||||
throw exception(HOUSE_TAKE_POINT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WareHouseTakePointDO getHouseTakePoint(Long id) {
|
||||
return houseTakePointMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WareHouseTakePointDO> getHouseTakePointPage(WareHouseTakePointPageReqVO pageReqVO) {
|
||||
return houseTakePointMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WareHouseTakePointDO> getHouseTakePointList(WareHouseTakePointSaveReqVO reqVO) {
|
||||
return houseTakePointMapper.selectList(new LambdaQueryWrapperX<WareHouseTakePointDO>()
|
||||
.likeIfPresent(WareHouseTakePointDO::getPointName, reqVO.getPointName())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPointType, reqVO.getPointType())
|
||||
.inIfPresent(WareHouseTakePointDO::getId, reqVO.getIds())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPointStatus, reqVO.getPointStatus())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPositionMapId, reqVO.getPositionMapId())
|
||||
.eqIfPresent(WareHouseTakePointDO::getLocationStorey, reqVO.getLocationStorey())
|
||||
.eqIfPresent(WareHouseTakePointDO::getPositionMapItemId, reqVO.getPositionMapItemId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTakePointMapIdEmpty(Long mapId,List<Long> ids) {
|
||||
houseTakePointMapper.setTakePointMapIdEmpty(mapId,ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchEditOrDel(List<List<WareHouseTakePointDO>> list) {
|
||||
//批量添加、修改、删除
|
||||
if (isNotEmpty(list.get(0))) {
|
||||
houseTakePointMapper.insertBatch(list.get(0));
|
||||
}
|
||||
if (isNotEmpty(list.get(1))) {
|
||||
houseTakePointMapper.updateBatch(list.get(1));
|
||||
}
|
||||
if (isNotEmpty(list.get(2))) {
|
||||
houseTakePointMapper.deleteByIds(convertList(list.get(2), WareHouseTakePointDO::getId));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WareHouseTakePointDO getHouseTakePointByItemIdAndStorey(Long positionMapItemId, int locationStorey) {
|
||||
return houseTakePointMapper.selectOne(new LambdaQueryWrapperX<WareHouseTakePointDO>()
|
||||
.eq(WareHouseTakePointDO::getPositionMapItemId, positionMapItemId)
|
||||
.eq(WareHouseTakePointDO::getLocationStorey, locationStorey));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHouseTakePointByItemIdAndStorey(WareHouseTakePointDO pointDO) {
|
||||
houseTakePointMapper.updateHouseTakePointByItemIdAndStorey(pointDO);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -49,7 +49,7 @@ public interface DeviceInformationService extends IService<DeviceInformationDO>
|
||||
* @param id 编号
|
||||
* @return 设备信息
|
||||
*/
|
||||
DeviceInformationDO getInformation(Long id);
|
||||
DeviceInformationRespVO getInformation(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备信息分页
|
||||
|
@ -16,17 +16,21 @@ import cn.iocoder.yudao.module.system.controller.admin.information.vo.DeviceInfo
|
||||
import cn.iocoder.yudao.module.system.controller.admin.log.vo.UserOperationLogSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointBindingDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.information.DeviceInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.information.DeviceInformationMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceAttributeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.PictureConfigEnum;
|
||||
import cn.iocoder.yudao.module.system.service.config.CommonConfigService;
|
||||
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointBindingService;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotWarnMsgService;
|
||||
@ -96,6 +100,12 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
@Autowired
|
||||
private ZnConfigConstant znConfigConstant;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointBindingService houseTakePointBindingService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@Override
|
||||
public Long createInformation(DeviceInformationSaveReqVO createReqVO) {
|
||||
// -- 先判断库里是否有相通的mac地址数据
|
||||
@ -114,11 +124,20 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
createReqVO.setUrl(dictDataDO.getRemark());
|
||||
}
|
||||
|
||||
List<WareHouseTakePointBindingDO> list = new ArrayList<>();
|
||||
if (DeviceTypeEnum.CAMERA.getType().equals(createReqVO.getDeviceType())) {
|
||||
try {
|
||||
createReqVO.setCameraCode(AESEncryptionUtil.getEncrypt(createReqVO.getCameraCode(), znConfigConstant.getCameraSecretKey()));
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}else if (DeviceTypeEnum.FLIP.getType().equals(createReqVO.getDeviceType())) {
|
||||
if (ObjectUtil.isEmpty(createReqVO.getTakePointId())) {
|
||||
throw exception(INFORMATION_FLIP_BINDING);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(createReqVO.getCheckPointIds())) {
|
||||
throw exception(INFORMATION_FLIP_NEED_BINDING_CHECK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 插入
|
||||
@ -126,6 +145,16 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
information.setDeviceStatus(1);
|
||||
informationMapper.insert(information);
|
||||
|
||||
|
||||
for (Long takePointId : createReqVO.getCheckPointIds()) {
|
||||
WareHouseTakePointBindingDO data = new WareHouseTakePointBindingDO();
|
||||
data.setBindingId(information.getId());
|
||||
data.setBindingType(ZeroOneEnum.ZERO.getType());
|
||||
data.setTakePointId(takePointId);
|
||||
list.add(data);
|
||||
}
|
||||
|
||||
houseTakePointBindingService.createHouseTakePointBindings(list);
|
||||
UserOperationLogSaveReqVO operationLog = UserOperationLogSaveReqVO.builder()
|
||||
.operateAction("新增设备 " + createReqVO.getDeviceNo())
|
||||
.nickName(SecurityFrameworkUtils.getLoginUserNickname()).build();
|
||||
@ -178,6 +207,18 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
positionMapItemService.updateById(positionMapItem);
|
||||
}
|
||||
|
||||
List<WareHouseTakePointBindingDO> list = new ArrayList<>();
|
||||
if (ObjectUtil.isNotEmpty(updateReqVO.getCheckPointIds())) {
|
||||
for (Long takePointId : updateReqVO.getCheckPointIds()) {
|
||||
WareHouseTakePointBindingDO data = new WareHouseTakePointBindingDO();
|
||||
data.setBindingId(updateReqVO.getId());
|
||||
data.setBindingType(ZeroOneEnum.ZERO.getType());
|
||||
data.setTakePointId(takePointId);
|
||||
list.add(data);
|
||||
}
|
||||
}
|
||||
houseTakePointBindingService.deleteByBindingId(updateReqVO.getId());
|
||||
houseTakePointBindingService.createHouseTakePointBindings(list);
|
||||
UserOperationLogSaveReqVO operationLog = UserOperationLogSaveReqVO.builder()
|
||||
.operateAction("更新设备信息 " + updateReqVO.getDeviceNo())
|
||||
.nickName(SecurityFrameworkUtils.getLoginUserNickname()).build();
|
||||
@ -210,15 +251,31 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceInformationDO getInformation(Long id) {
|
||||
public DeviceInformationRespVO getInformation(Long id) {
|
||||
// 校验存在
|
||||
validateInformationExists(id);
|
||||
DeviceInformationDO deviceInformationDO = informationMapper.selectById(id);
|
||||
String deviceKey = DeviceChcheConstant.DEVICE_LAST_TIME + deviceInformationDO.getMacAddress();
|
||||
Object object = redisUtil.get(deviceKey);
|
||||
DeviceInformationRespVO device = BeanUtils.toBean(deviceInformationDO, DeviceInformationRespVO.class);
|
||||
|
||||
if (DeviceTypeEnum.FLIP.getType().equals(deviceInformationDO.getDeviceType())) {
|
||||
// WareHouseTakePointDO takeWareHouseTakePointDO = houseTakePointService.getById(deviceInformationDO.getTakePointId());
|
||||
device.setTakePointId(deviceInformationDO.getTakePointId());
|
||||
List<WareHouseTakePointBindingDO> bindingDOS = houseTakePointBindingService.getByBindingId(id);
|
||||
if (ObjectUtil.isNotEmpty(bindingDOS)) {
|
||||
List<Long> pointIds = bindingDOS.stream().map(WareHouseTakePointBindingDO::getTakePointId).collect(Collectors.toList());
|
||||
/*WareHouseTakePointSaveReqVO reqVO = new WareHouseTakePointSaveReqVO();
|
||||
reqVO.setIds(pointIds);
|
||||
List<WareHouseTakePointDO> houseTakePointList = houseTakePointService.getHouseTakePointList(reqVO);
|
||||
device.setCheckPointBindingList(houseTakePointList);*/
|
||||
device.setCheckPointIds(pointIds);
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(object)) {
|
||||
deviceInformationDO.setDeviceStatus(DeviceStatusEnum.OFF_LINE.getType());
|
||||
return deviceInformationDO;
|
||||
return device;
|
||||
}
|
||||
try {
|
||||
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
@ -228,7 +285,7 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
} catch (Exception e) {
|
||||
log.info("查询设备最后通讯时间异常 :{}", e.getMessage());
|
||||
}
|
||||
return deviceInformationDO;
|
||||
return device;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -269,6 +326,7 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
|
||||
.isNull(dto.getUnboundFlag() != null && dto.getUnboundFlag() == 1, DeviceInformationDO::getPositionMapId)
|
||||
.eq(dto.getPositionMapId() != null, DeviceInformationDO::getPositionMapId, dto.getPositionMapId())
|
||||
.eq(dto.getDeviceType() != null, DeviceInformationDO::getDeviceType, dto.getDeviceType())
|
||||
.in(dto.getDeviceTypes() != null, DeviceInformationDO::getDeviceType, dto.getDeviceTypes())
|
||||
.eq(dto.getDeviceStatus() != null, DeviceInformationDO::getDeviceStatus, dto.getDeviceStatus())
|
||||
.eq(dto.getDeviceEnable() != null, DeviceInformationDO::getDeviceEnable, dto.getDeviceEnable())
|
||||
);
|
||||
|
@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.system.controller.admin.log.vo.RobotTaskLineTimeC
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.log.RobotTaskLineTimeConsumingDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.log.RobotTaskLineTimeConsumingMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
|
||||
import cn.iocoder.yudao.module.system.service.robot.RobotTaskDetailService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -97,11 +98,14 @@ public class RobotTaskLineTimeConsumingServiceImpl extends ServiceImpl<RobotTask
|
||||
RobotTaskDetailDO taskDetail = robotTaskDetailService.getTaskDetail(orderId);
|
||||
List<RobotTaskLineTimeConsumingDO> addList = new ArrayList<>();
|
||||
for (RobotTaskLineTimeConsumingDetailDTO v : list) {
|
||||
if ((ZeroOneEnum.ZERO.getType()+"").equals(v.getTimeConsuming())) {
|
||||
continue;
|
||||
}
|
||||
RobotTaskLineTimeConsumingDO line = BeanUtils.toBean(v, RobotTaskLineTimeConsumingDO.class);
|
||||
line.setTaskNo(taskNo);
|
||||
line.setTaskDetailId(orderId);
|
||||
line.setRobotNo(taskDetail.getRobotNo());
|
||||
line.setTotalTimeConsuming(v.getTimeConsuming());
|
||||
line.setTotalTimeConsuming(String.format("%.2f", Double.valueOf(v.getTimeConsuming())));
|
||||
line.setFromSortNum(getSpit(line.getFromSortNum()));
|
||||
line.setToSortNum(getSpit(line.getToSortNum()));
|
||||
if (ObjectUtil.isNotEmpty(v.getTimeConsuming()) && ObjectUtil.isNotEmpty(v.getTotalDistance())) {
|
||||
|
@ -32,11 +32,6 @@ public class PlanningRobotWalkingDistanceServiceImpl implements MqttService {
|
||||
if (!str.contains(".")) {
|
||||
return str;
|
||||
}
|
||||
String[] split = str.split("\\.");
|
||||
String decimal = split[1];
|
||||
if (split[1].length() > 2) {
|
||||
decimal = split[1].substring(0, 2);
|
||||
}
|
||||
return split[0] + "." + decimal;
|
||||
return String.format("%.2f", Double.valueOf(str));
|
||||
}
|
||||
}
|
@ -154,4 +154,11 @@ public interface PositionMapItemService extends IService<PositionMapItemDO> {
|
||||
void checkHaveBindChangePoint(Long mapId);
|
||||
|
||||
PositionMapConfigDTO getCheckDistance();
|
||||
|
||||
/**
|
||||
* 设置点位使用中
|
||||
* @param releaseId
|
||||
* @param robotNo
|
||||
*/
|
||||
void setMapItemUse(Long releaseId, String robotNo);
|
||||
}
|
||||
|
@ -281,4 +281,9 @@ public class PositionMapItemServiceImpl extends ServiceImpl<PositionMapItemMappe
|
||||
return configDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMapItemUse(Long releaseId, String robotNo) {
|
||||
positionMapItemMapper.setMapItemUse(releaseId,robotNo);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import cn.iocoder.yudao.module.system.api.remote.dto.RemoteTaskTransferDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.remote.vo.RemoteControllerInformationPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.remote.vo.RemoteControllerInformationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.remote.RemoteControllerInformationDO;
|
||||
import cn.iocoder.yudao.module.system.mq.message.RemoteSendMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.message.remote.RemoteSendMessage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
|
@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.system.service.remote;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.mqtt.api.common.CommonApi;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.PathPosedsDTO;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.PathToRobotDTO;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.remote.RemotePathPlanningDTO;
|
||||
import cn.iocoder.yudao.module.mqtt.api.path.dto.remote.RobotModeDTO;
|
||||
@ -29,7 +27,6 @@ import cn.iocoder.yudao.module.system.dal.dataobject.log.RobotTaskDetailActionLo
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.remote.RemoteControllerInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotMapStopDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.config.CommonConfigMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.remote.RemoteControllerInformationMapper;
|
||||
@ -45,7 +42,7 @@ import cn.iocoder.yudao.module.system.enums.robot.remote.RemoteOperationModeEnum
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotCommandTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotTaskManualInterventionEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotTaskStageEnum;
|
||||
import cn.iocoder.yudao.module.system.mq.message.RemoteSendMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.message.remote.RemoteSendMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.producer.remote.RemoteControllerProducer;
|
||||
import cn.iocoder.yudao.module.system.service.log.RobotTaskDetailActionLogService;
|
||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||
|
@ -38,6 +38,7 @@ import cn.iocoder.yudao.module.system.controller.admin.statistics.dto.RobotStatu
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tool.dto.CleanAgvDTO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.information.DeviceInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.informationmapassociation.InformationMapAssociationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.log.RobotTaskDetailActionLogDO;
|
||||
@ -62,6 +63,7 @@ import cn.iocoder.yudao.module.system.enums.path.PathTaskTypeToRobotEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.redis.RobotCacheLockEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.LocationLockEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.LocationUseStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.ReleaseTakeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotTaskDetailStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotTaskModelEnum;
|
||||
@ -71,6 +73,7 @@ import cn.iocoder.yudao.module.system.enums.robot.charge.ChargeModelEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.information.RobotStatisticsTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotCommandTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotTaskStageEnum;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.informationmapassociation.InformationMapAssociationService;
|
||||
import cn.iocoder.yudao.module.system.service.log.RobotTaskDetailActionLogService;
|
||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||
@ -185,6 +188,9 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
|
||||
@Lazy
|
||||
private RobotMapStopService mapStopService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createInformation(RobotInformationSaveReqVO createReqVO) {
|
||||
@ -1343,7 +1349,7 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
|
||||
TaskRobotNoLimittationAreaDTO taskRobotNoLimittationAreaDTO =
|
||||
robotPathPlanningService.getRobotNoLimitationArea(Collections.singletonList(robotInformationDO)).get(0);
|
||||
|
||||
List<TaskRobotNoLimittationAreaDTO> robotNoLimitions = Arrays.asList(taskRobotNoLimittationAreaDTO);
|
||||
List<TaskRobotNoLimittationAreaDTO> robotNoLimitions = Collections.singletonList(taskRobotNoLimittationAreaDTO);
|
||||
pathPlanning.setRobotNoLimitationAreaDTOS(robotNoLimitions);
|
||||
|
||||
resendToPPData(pathPlanning, actionLog, robotInformationDO, false);
|
||||
@ -1456,14 +1462,21 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
|
||||
pathPlanning.setTakeOffsetHeight(null);
|
||||
pathPlanning.setTakeOffsetHeight(null);
|
||||
pathPlanning.setTaskType(PathTaskTypeToRobotEnum.DROP_OFF_GOODS.getType());
|
||||
WareHouseLocationDO wareHouseLocation = wareHouseLocationMapper.selectById(robotTaskDetail.getFromLocationId());
|
||||
if (wareHouseLocation.getTaskId().equals(robotTaskDetail.getTakeId()) && LocationLockEnum.NO.getType().equals(wareHouseLocation.getLocationLock())) {
|
||||
wareHouseLocation.setSkuInfo(null);
|
||||
wareHouseLocation.setSkuNumber(0L);
|
||||
wareHouseLocation.setLocationLock(LocationLockEnum.YES.getType());
|
||||
wareHouseLocation.setLocationUseStatus(LocationUseStatusEnum.NO.getType());
|
||||
wareHouseLocationMapper.updateById(wareHouseLocation);
|
||||
if(ReleaseTakeEnum.isLocation(robotTaskDetail.getTakeType())) {
|
||||
WareHouseLocationDO wareHouseLocation = wareHouseLocationMapper.selectById(robotTaskDetail.getFromLocationId());
|
||||
if (wareHouseLocation.getTaskId().equals(robotTaskDetail.getTakeId()) && LocationLockEnum.NO.getType().equals(wareHouseLocation.getLocationLock())) {
|
||||
wareHouseLocation.setSkuInfo(null);
|
||||
wareHouseLocation.setSkuNumber(0L);
|
||||
wareHouseLocation.setLocationLock(LocationLockEnum.YES.getType());
|
||||
wareHouseLocation.setLocationUseStatus(LocationUseStatusEnum.NO.getType());
|
||||
wareHouseLocationMapper.updateById(wareHouseLocation);
|
||||
}
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(robotTaskDetail.getTakeType())) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(robotTaskDetail.getFromLocationId());
|
||||
houseTakePoint.setPointStatus(ZeroOneEnum.ZERO.getType());
|
||||
houseTakePointService.updateById(houseTakePoint);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,6 @@ 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.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.mqtt.api.common.CommonApi;
|
||||
import cn.iocoder.yudao.module.mqtt.api.task.dto.*;
|
||||
import cn.iocoder.yudao.module.mqtt.enums.task.ExecutionTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.api.path.vo.RobotClosePathPlantingDTO;
|
||||
@ -30,6 +29,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.cycle.TaskCycleDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.housearea.HouseAreaDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselane.WareHouseLaneDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.information.DeviceInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.log.RobotTaskDetailActionLogDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
@ -42,14 +42,12 @@ import cn.iocoder.yudao.module.system.dal.mysql.housearea.HouseAreaMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.houselane.WareHouseLaneMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.houselocation.WareHouseLocationMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.information.DeviceInformationMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.log.RobotTaskDetailActionLogMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotChargeLogMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotInformationMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskDetailMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.device.DeviceUseStatusEnum;
|
||||
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.path.PathTaskTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.redis.RobotCacheLockEnum;
|
||||
@ -61,16 +59,15 @@ import cn.iocoder.yudao.module.system.enums.robot.task.RobotCommandTypeEnum;
|
||||
//import cn.iocoder.yudao.module.system.service.robot.job.RobotCommonTaskService;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotTaskManualInterventionEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.RobotTaskStageEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.RobotTaskEventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.task.event.EventTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.mq.message.task.TaskDistributionMessage;
|
||||
import cn.iocoder.yudao.module.system.mq.producer.remote.RemoteControllerProducer;
|
||||
import cn.iocoder.yudao.module.system.mq.producer.task.TaskDistributionProducer;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.information.DeviceInformationService;
|
||||
import cn.iocoder.yudao.module.system.service.log.RobotTaskDetailActionLogService;
|
||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
|
||||
import cn.iocoder.yudao.module.system.service.robot.simulation.RobotSimulationService;
|
||||
import cn.iocoder.yudao.module.system.service.statistics.RobotWorkingHoursStatisticsService;
|
||||
import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
|
||||
import cn.iocoder.yudao.module.system.util.redis.RedissonUtils;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@ -82,7 +79,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.redisson.api.RLock;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -152,9 +148,6 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
@Resource
|
||||
private DeviceInformationMapper deviceInformationMapper;
|
||||
|
||||
/*@Resource
|
||||
private CommonApi commonApi;*/
|
||||
|
||||
@Autowired
|
||||
private MqttUtils mqttUtils;
|
||||
|
||||
@ -182,6 +175,9 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
@Resource
|
||||
private TaskDistributionProducer taskDistributionProducer;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createTask(RobotTaskSaveReqVO createReqVO) throws InterruptedException {
|
||||
@ -387,10 +383,10 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
locationMapper.updateLocationLockList(list, task.getId(), LocationLockEnum.NO.getType());
|
||||
});
|
||||
|
||||
if (znConfigConstant.getDoCycle() && ObjectUtil.isNotEmpty(createReqVO.getDoCycle())
|
||||
/*if (znConfigConstant.getDoCycle() && ObjectUtil.isNotEmpty(createReqVO.getDoCycle())
|
||||
&& ZeroOneEnum.ONE.getType().equals(createReqVO.getDoCycle().intValue())) {
|
||||
addCycle(task.getId(), createReqVO.getTaskDetailList());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -653,7 +649,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
|
||||
try {
|
||||
TaskDistributionMessage mess = new TaskDistributionMessage(this, taskAssignDTO.getOrderId() + "",
|
||||
RobotTaskEventTypeEnum.DISTRIBUTION.getType());
|
||||
EventTypeEnum.TASK_DISTRIBUTION.getType());
|
||||
taskDistributionProducer.sendSmsSendMessage(mess);
|
||||
} catch (Exception e) {
|
||||
log.info(e.getMessage());
|
||||
@ -995,6 +991,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
robotTaskDetailAddVo.setFromLocationNumber(stockList.get(i).getLocationNumber());
|
||||
robotTaskDetailAddVo.setFromMapItemId(stockList.get(i).getMapItemId());
|
||||
robotTaskDetailAddVo.setToMapItemId(releaseStockList.get(i).getMapItemId());
|
||||
robotTaskDetailAddVo.setToLocationNumber(releaseStockList.get(i).getLocationNumber());
|
||||
robotTaskDetailAddVo.setRobotTaskId(taskId);
|
||||
robotTaskDetailAddVo.setPriority(robotTaskVo.getPriority());
|
||||
robotTaskDetailAddVo.setFromLocationStorey(stockList.get(i).getLocationStorey());
|
||||
@ -1027,7 +1024,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
releaseMapItemIds = new ArrayList<>();
|
||||
}
|
||||
|
||||
if (znConfigConstant.getDoCycle()) {
|
||||
/*if (znConfigConstant.getDoCycle()) {
|
||||
List<TaskCycleDO> taskCycleDOS = taskCycleMapper.selectList(new LambdaQueryWrapper<TaskCycleDO>());
|
||||
if (ObjectUtil.isNotEmpty(taskCycleDOS)) {
|
||||
List<Long> mapItemIds =
|
||||
@ -1035,7 +1032,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
takeMapItemIds.addAll(mapItemIds);
|
||||
releaseMapItemIds.addAll(mapItemIds);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
List<WareHouseLocationDO> wareHouseLocationDOS = locationMapper.selectList(new LambdaQueryWrapper<WareHouseLocationDO>()
|
||||
.eq(WareHouseLocationDO::getLocationEnable, LocationEnableEnum.NO.getType()));
|
||||
if (ObjectUtil.isNotEmpty(wareHouseLocationDOS)) {
|
||||
@ -1252,6 +1249,17 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
}
|
||||
checkToLocationNoneTask(locationDO, chooseLocationIds);
|
||||
releaseMapItemIds.add(locationDO.getMapItemId());
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(robotTaskVo.getTakeType())) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(robotTaskVo.getTakeId());
|
||||
if (ZeroOneEnum.ONE.getType().equals(houseTakePoint.getPointStatus())) {
|
||||
throw exception0(TASK_CREATE_FAIL.getCode(), "此放货点位有库存 " + houseTakePoint.getPointName());
|
||||
}
|
||||
robotTaskVo.setToLocationNo(houseTakePoint.getPointName());
|
||||
robotTaskVo.setToLocationId(robotTaskVo.getTakeId());
|
||||
robotTaskVo.setToLocationStorey(houseTakePoint.getLocationStorey());
|
||||
robotTaskVo.setToLaneId(houseTakePoint.getLaneId());
|
||||
robotTaskVo.setToLocationNumber(houseTakePoint.getLocationNumber());
|
||||
robotTaskVo.setToMapItemId(houseTakePoint.getPositionMapItemId());
|
||||
} else {
|
||||
if (ReleaseTakeEnum.TO_LANE.getType().equals(robotTaskVo.getReleaseType()) && ObjectUtil.isEmpty(laneIds)
|
||||
&& ObjectUtil.isNotEmpty(skuInfo)) {
|
||||
@ -1332,6 +1340,17 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
|
||||
}
|
||||
checkFromLocationNoneTask(locationDO, chooseLocationIds);
|
||||
takeMapItemIds.add(locationDO.getMapItemId());
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(robotTaskVo.getTakeType())) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(robotTaskVo.getTakeId());
|
||||
if (ZeroOneEnum.ZERO.getType().equals(houseTakePoint.getPointStatus())) {
|
||||
throw exception0(TASK_CREATE_FAIL.getCode(), "此取货点位没库存 " + houseTakePoint.getPointName());
|
||||
}
|
||||
robotTaskVo.setFromLocationNo(houseTakePoint.getPointName());
|
||||
robotTaskVo.setFromLocationId(robotTaskVo.getTakeId());
|
||||
robotTaskVo.setFromLocationStorey(houseTakePoint.getLocationStorey());
|
||||
robotTaskVo.setFromLaneId(houseTakePoint.getLaneId());
|
||||
robotTaskVo.setFromLocationNumber(houseTakePoint.getLocationNumber());
|
||||
robotTaskVo.setFromMapItemId(houseTakePoint.getPositionMapItemId());
|
||||
} else {
|
||||
WareHouseLocationDO wareHouseLocationDO =
|
||||
locationMapper.selectByTypeAndId(LocationUseStatusEnum.YES.getType(), robotTaskVo.getTakeType(),
|
||||
|
@ -133,9 +133,9 @@ public class CycleServiceImpl implements CycleService {
|
||||
List<RobotTaskDetailAddVO> bean = BeanUtils.toBean(taskDetails, RobotTaskDetailAddVO.class);
|
||||
Map<Long, List<RobotTaskDetailAddVO>> taskDetailMap =
|
||||
bean.stream().collect(Collectors.groupingBy(RobotTaskDetailAddVO::getRobotTaskId));
|
||||
taskDetailMap.forEach((k,v) ->{
|
||||
/*taskDetailMap.forEach((k,v) ->{
|
||||
robotTaskService.addCycle(k,v);
|
||||
});
|
||||
});*/
|
||||
taskCycleMapper.deletByRobotTaskIds(taskIds);
|
||||
setTaskUnDo();
|
||||
}
|
||||
|
@ -107,6 +107,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
|
||||
CommonConfigVO chargeConfig = JSONUtil.toBean(commonConfigDO.getConfigStr(), CommonConfigVO.class);
|
||||
|
||||
List<RobotInformationDO> taskRobots = new ArrayList<>();
|
||||
for (RobotInformationDO robot : robots) {
|
||||
|
||||
if (ObjectUtil.isNotEmpty(remoteRobotNos) && remoteRobotNos.contains(robot.getRobotNo())) {
|
||||
@ -163,6 +164,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
Boolean b = remainingElectricityBigger(chargeConfig, robot);
|
||||
if (b) {
|
||||
robot.setRobotStatus(RobotStatusEnum.STAND_BY.getType());
|
||||
taskRobots.add(robot);
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,10 +173,10 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
|| RobotStatusEnum.LAST_TASK_IS_TAKE.getType().equals(v.getRobotStatus())))
|
||||
.collect(Collectors.toList());*/
|
||||
|
||||
/*if (robots.isEmpty()) {
|
||||
if (taskRobots.isEmpty()) {
|
||||
log.info("暂无可用的机器人,可能正在充电,可能车机上报不允许接任务");
|
||||
return pair;
|
||||
}*/
|
||||
}
|
||||
|
||||
log.info("完成查找车子");
|
||||
|
||||
@ -197,16 +199,16 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
|
||||
|
||||
if (ObjectUtil.isEmpty(montageTaskIds) && ObjectUtil.isEmpty(singleTaskIds)) {
|
||||
log.info("暂无需要处理的主任务");
|
||||
return ImmutablePair.of(robots, null);
|
||||
return ImmutablePair.of(taskRobots, null);
|
||||
}
|
||||
|
||||
List<RobotTaskDetailDO> taskDetails = getTaskDetail(montageTaskIds, singleTaskIds);
|
||||
|
||||
if (taskDetails.isEmpty()) {
|
||||
log.info("暂无需要处理的明细任务");
|
||||
return ImmutablePair.of(robots, null);
|
||||
return ImmutablePair.of(taskRobots, null);
|
||||
}
|
||||
return ImmutablePair.of(robots, taskDetails);
|
||||
return ImmutablePair.of(taskRobots, taskDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.system.constant.robot.RobotStatusCodeConstant;
|
||||
import cn.iocoder.yudao.module.system.constant.robot.RobotTaskChcheConstant;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailAddVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotChargeLogDO;
|
||||
@ -38,6 +39,7 @@ import cn.iocoder.yudao.module.system.enums.redis.RobotCacheLockEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.*;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.charge.ChargeModelEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.information.ChargeTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
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.job.DistributeTasksService;
|
||||
@ -105,6 +107,9 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
@Lazy
|
||||
private RobotInformationService informationService;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
/**
|
||||
* 下发任务给PP
|
||||
*/
|
||||
@ -124,7 +129,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
List<RobotTaskDetailDO> taskDetailDOS = robotAndTaskDetails.getRight();
|
||||
if (ObjectUtil.isEmpty(taskDetailDOS)) {
|
||||
log.info("--不存在需要执行的任务--派车辆去等待点");
|
||||
// moveRobotToWait(robots);
|
||||
moveRobotToWait(robots);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -412,16 +417,31 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
List<TaskToPathPlanningDTO> pathPlanningList = new ArrayList<>();
|
||||
|
||||
Set<Long> locationIds = new HashSet<>();
|
||||
Set<Long> fromLocationIds = taskDetailDOS.stream().map(RobotTaskDetailDO::getFromLocationId).collect(Collectors.toSet());
|
||||
Set<Long> toLocationIds = taskDetailDOS.stream().map(RobotTaskDetailDO::getToLocationId).collect(Collectors.toSet());
|
||||
|
||||
Set<Long> fromLocationIds = new HashSet<>();
|
||||
Set<Long> toLocationIds = new HashSet<>();
|
||||
|
||||
for (RobotTaskDetailDO taskDetailDO : taskDetailDOS) {
|
||||
if (ReleaseTakeEnum.isLocation(taskDetailDO.getTakeType()) && ObjectUtil.isNotEmpty(taskDetailDO.getFromLocationId())) {
|
||||
fromLocationIds.add(taskDetailDO.getFromLocationId());
|
||||
}
|
||||
|
||||
if (ReleaseTakeEnum.isLocation(taskDetailDO.getTakeType()) && ObjectUtil.isNotEmpty(taskDetailDO.getToLocationId())) {
|
||||
toLocationIds.add(taskDetailDO.getToLocationId());
|
||||
}
|
||||
}
|
||||
|
||||
locationIds.addAll(fromLocationIds);
|
||||
locationIds.addAll(toLocationIds);
|
||||
|
||||
List<WareHouseLocationDO> locations = locationMapper.selectList(new LambdaQueryWrapperX<WareHouseLocationDO>()
|
||||
.in(WareHouseLocationDO::getId, locationIds));
|
||||
Map<Long, WareHouseLocationDO> locationDOMap = new HashMap<>();
|
||||
if (ObjectUtil.isNotEmpty(locationIds)) {
|
||||
List<WareHouseLocationDO> locations = locationMapper.selectList(new LambdaQueryWrapperX<WareHouseLocationDO>()
|
||||
.in(WareHouseLocationDO::getId, locationIds));
|
||||
|
||||
Map<Long, WareHouseLocationDO> locationDOMap =
|
||||
locations.stream().collect(Collectors.toMap(v -> v.getId(), Function.identity()));
|
||||
locationDOMap =
|
||||
locations.stream().collect(Collectors.toMap(v -> v.getId(), Function.identity()));
|
||||
}
|
||||
|
||||
//能执行此任务的机器人 和 不能走的区域
|
||||
Pair<List<TaskRobotNoLimittationAreaDTO>, Map<String, TaskRobotNoLimittationAreaDTO>> pair = getRobotLimitationArea(robots);
|
||||
@ -462,7 +482,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
if (RobotTaskTypeEnum.PARK.getType().equals(taskDetailDO.getTaskType())
|
||||
&& (ObjectUtil.isEmpty(waitIds) || waitIds.size() < i)) {
|
||||
log.info("停车任务,没有多余的空闲点位 :{}", taskDetailDO.getId());
|
||||
return;
|
||||
continue;
|
||||
} else if (RobotTaskTypeEnum.PARK.getType().equals(taskDetailDO.getTaskType())) {
|
||||
pathPlanning.setWaitIds(waitIds);
|
||||
i++;
|
||||
@ -470,19 +490,9 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
moveToPoint(pathPlanning, taskDetailDO);
|
||||
}
|
||||
|
||||
String mac = informationService.getMacByRobotNo(taskDetailDO.getRobotNo());
|
||||
String cargoDetectedKey = RobotTaskChcheConstant.ROBOT_CARGO_DETECTED + mac;
|
||||
Object cargoDetected = redisUtil.get(cargoDetectedKey);
|
||||
log.info("传感器是否按下 :{}", cargoDetected);
|
||||
/* if (ObjectUtil.isNotEmpty(cargoDetected) && (RobotStatusCodeConstant.CARGO_DETECTED.equals(Boolean.parseBoolean(String.valueOf(cargoDetected)))
|
||||
&& !RobotTaskTypeEnum.RELEASE.getType().equals(taskDetailDO.getTaskType()))) {
|
||||
log.info("车机上报传感器为空, 或者 被按下且任务非仅放货任务 :{} ,任务id :{}", taskDetailDO.getRobotNo(), taskDetailDO.getId());
|
||||
if (!cargoDetected(taskDetailDO)) {
|
||||
continue;
|
||||
} else if (ObjectUtil.isNotEmpty(cargoDetected) && !RobotStatusCodeConstant.CARGO_DETECTED.equals(Boolean.parseBoolean(String.valueOf(cargoDetected)))
|
||||
&& RobotTaskTypeEnum.RELEASE.getType().equals(taskDetailDO.getTaskType())) {
|
||||
log.info("仅放货任务,传感器未被按下,所以不执行任务 :{}, 任务id :{}", taskDetailDO.getRobotNo(), taskDetailDO.getId());
|
||||
continue;
|
||||
}*/
|
||||
}
|
||||
|
||||
List<TaskRobotNoLimittationAreaDTO> robotNoLimitions = null;
|
||||
if (ObjectUtil.isEmpty(taskDetailDO.getRobotNo())) {
|
||||
@ -510,9 +520,14 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
pathPlanning.setTakeLocationNumber(Math.abs(znConfigConstant.getLocationNumberReduce() - taskDetailDO.getFromLocationNumber()));
|
||||
pathPlanning.setTakePointId(String.valueOf(fromLocation.getMapItemId()));
|
||||
|
||||
pathPlanningSetTakeHeight(pathPlanning, fromLocation);
|
||||
pathPlanningSetTakeForksHeight(pathPlanning, fromLocation);
|
||||
pathPlanning.setTakeLevel(fromLocation.getLocationStorey());
|
||||
if (isLocation(taskDetailDO.getTakeType())) {
|
||||
pathPlanningSetTakeHeight(pathPlanning, fromLocation);
|
||||
pathPlanningSetTakeForksHeight(pathPlanning, fromLocation);
|
||||
pathPlanning.setTakeLevel(fromLocation.getLocationStorey());
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(taskDetailDO.getTakeType())) {
|
||||
pathPlanningSetPointTakeHeight(pathPlanning, taskDetailDO);
|
||||
}
|
||||
|
||||
pathPlanning.setTakeOffsetHeight(znConfigConstant.getRobotConfig().getOffsetHeight());
|
||||
if (ObjectUtil.isNotEmpty(taskDetailDO.getFromLaneId())) {
|
||||
pathPlanning.setTakeGroupId("LINE_" + taskDetailDO.getFromLaneId());
|
||||
@ -525,8 +540,13 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
pathPlanning.setReleaseLocationNumber(taskDetailDO.getToLocationNumber());
|
||||
pathPlanning.setReleasePointId(String.valueOf(toLocation.getMapItemId()));
|
||||
|
||||
pathPlanningSetReleaseHeight(pathPlanning, toLocation);
|
||||
pathPlanning.setReleaseLevel(toLocation.getLocationStorey());
|
||||
if (isLocation(taskDetailDO.getTakeType())) {
|
||||
pathPlanningSetReleaseHeight(pathPlanning, toLocation);
|
||||
pathPlanning.setReleaseLevel(toLocation.getLocationStorey());
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(taskDetailDO.getTakeType())) {
|
||||
pathPlanningSetPointReleaseHeight(pathPlanning, taskDetailDO);
|
||||
}
|
||||
|
||||
pathPlanning.setReleaseOffsetHeight(znConfigConstant.getRobotConfig().getOffsetHeight());
|
||||
if (ObjectUtil.isNotEmpty(taskDetailDO.getToLaneId())) {
|
||||
pathPlanning.setReleaseGroupId("LINE_" + taskDetailDO.getToLaneId());
|
||||
@ -548,6 +568,90 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean cargoDetected(RobotTaskDetailDO taskDetailDO) {
|
||||
|
||||
if (ObjectUtil.isEmpty(taskDetailDO.getRobotNo())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String mac = informationService.getMacByRobotNo(taskDetailDO.getRobotNo());
|
||||
String cargoDetectedKey = RobotTaskChcheConstant.ROBOT_CARGO_DETECTED + mac;
|
||||
Object cargoDetected = redisUtil.get(cargoDetectedKey);
|
||||
log.info("车辆编号 :{}, 传感器是否按下 :{}",taskDetailDO.getRobotNo(), cargoDetected);
|
||||
/*if (ObjectUtil.isNotEmpty(cargoDetected) && (RobotStatusCodeConstant.CARGO_DETECTED.equals(Boolean.parseBoolean(String.valueOf(cargoDetected)))
|
||||
&& !RobotTaskTypeEnum.RELEASE.getType().equals(taskDetailDO.getTaskType()))) {
|
||||
log.info("车机上报传感器为空, 或者 被按下且任务非仅放货任务 :{} ,任务id :{}", taskDetailDO.getRobotNo(), taskDetailDO.getId());
|
||||
return false;
|
||||
} else if (ObjectUtil.isNotEmpty(cargoDetected) && !RobotStatusCodeConstant.CARGO_DETECTED.equals(Boolean.parseBoolean(String.valueOf(cargoDetected)))
|
||||
&& RobotTaskTypeEnum.RELEASE.getType().equals(taskDetailDO.getTaskType())) {
|
||||
log.info("仅放货任务,传感器未被按下,所以不执行任务 :{}, 任务id :{}", taskDetailDO.getRobotNo(), taskDetailDO.getId());
|
||||
return false;
|
||||
}*/
|
||||
return true;
|
||||
}
|
||||
|
||||
private void pathPlanningSetPointReleaseHeight(TaskToPathPlanningDTO pathPlanning, RobotTaskDetailDO taskDetailDO) {
|
||||
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(taskDetailDO.getToLocationId());
|
||||
pathPlanning.setReleaseLevel(houseTakePoint.getLocationStorey());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(houseTakePoint.getTrayHeight())) {
|
||||
pathPlanning.setReleaseHeight(houseTakePoint.getTrayHeight().doubleValue());
|
||||
} else if (ZeroOneEnum.ONE.getType().equals(houseTakePoint.getLocationStorey())) {
|
||||
pathPlanning.setReleaseHeight(0.0);
|
||||
} else {
|
||||
WareHouseTakePointDO nextHouseTakePoint =
|
||||
houseTakePointService.getHouseTakePointByItemIdAndStorey(houseTakePoint.getPositionMapItemId(),
|
||||
houseTakePoint.getLocationStorey() - 1);
|
||||
if (ObjectUtil.isNotEmpty(nextHouseTakePoint) && ObjectUtil.isNotEmpty(nextHouseTakePoint.getTotalHeight())) {
|
||||
pathPlanning.setReleaseHeight(nextHouseTakePoint.getTotalHeight().doubleValue());
|
||||
return;
|
||||
}
|
||||
|
||||
Integer locationStorey = houseTakePoint.getLocationStorey() - 1;
|
||||
double height = locationStorey * znConfigConstant.getRobotConfig().getDefaultTrayHeight();
|
||||
log.info("放货设置默认高度 :{}", height);
|
||||
pathPlanning.setReleaseHeight(height);
|
||||
}
|
||||
}
|
||||
|
||||
private void pathPlanningSetPointTakeHeight(TaskToPathPlanningDTO pathPlanning, RobotTaskDetailDO taskDetailDO) {
|
||||
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(taskDetailDO.getFromLocationId());
|
||||
pathPlanning.setTakeLevel(houseTakePoint.getLocationStorey());
|
||||
if (ObjectUtil.isNotEmpty(houseTakePoint.getTotalHeight())) {
|
||||
pathPlanning.setTakeHeight(Double.valueOf(houseTakePoint.getTotalHeight() + ""));
|
||||
} else {
|
||||
Integer locationStorey = houseTakePoint.getLocationStorey();
|
||||
double height = locationStorey * znConfigConstant.getRobotConfig().getDefaultTrayHeight();
|
||||
log.info("取货设置默认取货高度 :{}", height);
|
||||
pathPlanning.setTakeHeight(height);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(houseTakePoint.getTrayHeight())) {
|
||||
pathPlanning.setDetectHeight(houseTakePoint.getTrayHeight().doubleValue());
|
||||
} else if (ZeroOneEnum.ONE.getType().equals(houseTakePoint.getLocationStorey())) {
|
||||
pathPlanning.setDetectHeight(0.03);
|
||||
} else {
|
||||
Integer locationStorey = houseTakePoint.getLocationStorey() - 1;
|
||||
double height = locationStorey * znConfigConstant.getRobotConfig().getDefaultTrayHeight();
|
||||
BigDecimal d1 = new BigDecimal("0.01");
|
||||
BigDecimal d2 = new BigDecimal(height + "");
|
||||
double detectHeight = d2.subtract(d1).doubleValue();
|
||||
log.info("设置取货默认抬叉高度 :{}", detectHeight);
|
||||
pathPlanning.setDetectHeight(detectHeight);
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean isLocation(Integer takeType) {
|
||||
if (ReleaseTakeEnum.TO_LOCATION.getType().equals(takeType)
|
||||
|| ReleaseTakeEnum.TO_LANE.getType().equals(takeType)
|
||||
|| ReleaseTakeEnum.TO_AREA.getType().equals(takeType)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void pathPlanningSetTakeForksHeight(TaskToPathPlanningDTO pathPlanning, WareHouseLocationDO fromLocation) {
|
||||
if (ZeroOneEnum.ONE.getType().equals(fromLocation.getLocationStorey())) {
|
||||
pathPlanning.setDetectHeight(0.03);
|
||||
@ -555,12 +659,12 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
}
|
||||
|
||||
WareHouseLocationDO nextLocation = locationMapper.selectOne(new LambdaQueryWrapperX<WareHouseLocationDO>()
|
||||
.eq(WareHouseLocationDO::getId, fromLocation.getMapItemId())
|
||||
.eq(WareHouseLocationDO::getMapItemId, fromLocation.getMapItemId())
|
||||
.eq(WareHouseLocationDO::getLocationStorey, fromLocation.getLocationStorey() - 1)
|
||||
.last("limit 1"));
|
||||
if (ObjectUtil.isNotEmpty(nextLocation) && ObjectUtil.isNotEmpty(nextLocation.getLocationTotalHeight())) {
|
||||
|
||||
BigDecimal d1 = new BigDecimal("0.12");
|
||||
BigDecimal d1 = new BigDecimal("0.01");
|
||||
BigDecimal d2 = nextLocation.getLocationTotalHeight();
|
||||
double detectHeight = d2.subtract(d1).doubleValue();
|
||||
pathPlanning.setDetectHeight(detectHeight);
|
||||
@ -569,7 +673,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
|
||||
Integer locationStorey = fromLocation.getLocationStorey() - 1;
|
||||
double height = locationStorey * znConfigConstant.getRobotConfig().getDefaultTrayHeight();
|
||||
BigDecimal d1 = new BigDecimal("0.12");
|
||||
BigDecimal d1 = new BigDecimal("0.01");
|
||||
BigDecimal d2 = new BigDecimal(height + "");
|
||||
double detectHeight = d2.subtract(d1).doubleValue();
|
||||
log.info("设置取货默认抬叉高度 :{}", detectHeight);
|
||||
@ -590,7 +694,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
|
||||
}
|
||||
|
||||
WareHouseLocationDO nextLocation = locationMapper.selectOne(new LambdaQueryWrapperX<WareHouseLocationDO>()
|
||||
.eq(WareHouseLocationDO::getId, toLocation.getMapItemId())
|
||||
.eq(WareHouseLocationDO::getMapItemId, toLocation.getMapItemId())
|
||||
.eq(WareHouseLocationDO::getLocationStorey, toLocation.getLocationStorey() - 1)
|
||||
.last("limit 1"));
|
||||
if (ObjectUtil.isNotEmpty(nextLocation) && ObjectUtil.isNotEmpty(nextLocation.getLocationTotalHeight())) {
|
||||
|
@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.cycle.TaskCycleDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.housearea.HouseAreaDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselane.WareHouseLaneDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseTakePointDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
|
||||
@ -27,6 +28,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotChargeLogMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotInformationMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskDetailMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.redis.RobotCacheLockEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.LocationEnableEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.LocationLockEnum;
|
||||
@ -34,6 +36,7 @@ import cn.iocoder.yudao.module.system.enums.robot.LocationUseStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.MoveAllEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.ReleaseTakeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.RobotTaskTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.WareHouseTakePointService;
|
||||
import cn.iocoder.yudao.module.system.service.information.DeviceInformationService;
|
||||
import cn.iocoder.yudao.module.system.service.log.RobotTaskDetailActionLogService;
|
||||
import cn.iocoder.yudao.module.system.service.log.UserOperationLogService;
|
||||
@ -69,7 +72,7 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.TASK_CREAT
|
||||
@Slf4j
|
||||
@Service
|
||||
@Validated
|
||||
public class RobotSimulationServiceImpl implements RobotSimulationService{
|
||||
public class RobotSimulationServiceImpl implements RobotSimulationService {
|
||||
|
||||
@Resource
|
||||
private RobotTaskMapper taskMapper;
|
||||
@ -101,6 +104,9 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
|
||||
@Autowired
|
||||
private ZnConfigConstant znConfigConstant;
|
||||
|
||||
@Resource
|
||||
private WareHouseTakePointService houseTakePointService;
|
||||
|
||||
@Override
|
||||
public void createTask(RobotTaskSaveReqVO createReqVO) {
|
||||
|
||||
@ -108,7 +114,7 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
|
||||
if (ObjectUtil.isEmpty(createReqVO.getTaskNo())) {
|
||||
String incrementByKey = redisUtil.getIncrementByKey(RobotCacheLockEnum.TASK_NO.getKey());
|
||||
createReqVO.setTaskNo(znConfigConstant.getTaskNo() + DateUtils.getYearMonthDay() + incrementByKey);
|
||||
}else {
|
||||
} else {
|
||||
List<RobotTaskDO> taskDOS = taskMapper.selectList(new LambdaQueryWrapperX<RobotTaskDO>()
|
||||
.eq(RobotTaskDO::getTaskNo, createReqVO.getTaskNo()));
|
||||
if (ObjectUtil.isNotEmpty(taskDOS)) {
|
||||
@ -116,7 +122,7 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
|
||||
}
|
||||
}
|
||||
|
||||
log.info("111111创建一个不校验的任务 :{}",createReqVO.getTaskNo());
|
||||
log.info("111111创建一个不校验的任务 :{}", createReqVO.getTaskNo());
|
||||
|
||||
RobotTaskDO task = BeanUtils.toBean(createReqVO, RobotTaskDO.class);
|
||||
task.setRemainingCycleNumber(task.getCycleNumber());
|
||||
@ -299,6 +305,14 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
|
||||
robotTaskVo.setFromLocationNumber(locationDO.getLocationNumber());
|
||||
robotTaskVo.setFromMapItemId(locationDO.getMapItemId());
|
||||
takeMapItemIds.add(locationDO.getMapItemId());
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(robotTaskVo.getTakeType())) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(robotTaskVo.getTakeId());
|
||||
robotTaskVo.setFromLocationNo(houseTakePoint.getPointName());
|
||||
robotTaskVo.setFromLocationId(robotTaskVo.getTakeId());
|
||||
robotTaskVo.setFromLocationStorey(houseTakePoint.getLocationStorey());
|
||||
robotTaskVo.setFromLaneId(houseTakePoint.getLaneId());
|
||||
robotTaskVo.setFromLocationNumber(houseTakePoint.getLocationNumber());
|
||||
robotTaskVo.setFromMapItemId(houseTakePoint.getPositionMapItemId());
|
||||
} else {
|
||||
WareHouseLocationDO wareHouseLocationDO =
|
||||
locationMapper.selectByTypeAndId(LocationUseStatusEnum.YES.getType(), robotTaskVo.getTakeType(),
|
||||
@ -475,6 +489,7 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
|
||||
robotTaskDetailAddVo.setRobotTaskId(taskId);
|
||||
robotTaskDetailAddVo.setPriority(robotTaskVo.getPriority());
|
||||
robotTaskDetailAddVo.setFromLocationStorey(stockList.get(i).getLocationStorey());
|
||||
robotTaskDetailAddVo.setToLocationNumber(releaseStockList.get(i).getLocationNumber());
|
||||
robotTaskDetailAddVo.setToLocationStorey(releaseStockList.get(i).getLocationStorey());
|
||||
addTaskDetailList.add(robotTaskDetailAddVo);
|
||||
|
||||
@ -497,6 +512,14 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
|
||||
robotTaskVo.setToLocationNumber(locationDO.getLocationNumber());
|
||||
robotTaskVo.setToMapItemId(locationDO.getMapItemId());
|
||||
releaseMapItemIds.add(locationDO.getMapItemId());
|
||||
} else if (ReleaseTakeEnum.TO_POINT.getType().equals(robotTaskVo.getTakeType())) {
|
||||
WareHouseTakePointDO houseTakePoint = houseTakePointService.getHouseTakePoint(robotTaskVo.getTakeId());
|
||||
robotTaskVo.setToLocationNo(houseTakePoint.getPointName());
|
||||
robotTaskVo.setToLocationId(robotTaskVo.getTakeId());
|
||||
robotTaskVo.setToLocationStorey(houseTakePoint.getLocationStorey());
|
||||
robotTaskVo.setToLaneId(houseTakePoint.getLaneId());
|
||||
robotTaskVo.setToLocationNumber(houseTakePoint.getLocationNumber());
|
||||
robotTaskVo.setToMapItemId(houseTakePoint.getPositionMapItemId());
|
||||
} else {
|
||||
WareHouseLocationDO wareHouseLocationDO =
|
||||
locationMapper.selectByTypeAndId(LocationUseStatusEnum.NO.getType(), robotTaskVo.getReleaseType()
|
||||
|
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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.houselocation.WareHouseTakePointBindingMapper">
|
||||
|
||||
|
||||
<delete id="deleteByBindingId">
|
||||
delete
|
||||
from ware_house_take_point_binding
|
||||
where binding_id = #{bindingId}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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.houselocation.WareHouseTakePointMapper">
|
||||
|
||||
|
||||
<update id="setTakePointMapIdEmpty">
|
||||
update
|
||||
ware_house_take_point
|
||||
set
|
||||
position_map_id = null,
|
||||
position_map_item_id = null,
|
||||
actual_location_x = null,
|
||||
actual_location_y = null
|
||||
<where>
|
||||
position_map_id = #{positionMapId}
|
||||
and point_type = '0'
|
||||
<if test= " ids != null and ids.size() > 0">
|
||||
AND id not in
|
||||
<foreach collection="ids" item="id" index="index" open="(" close=")"
|
||||
separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<update id="updateHouseTakePointByItemIdAndStorey">
|
||||
update
|
||||
ware_house_take_point
|
||||
set
|
||||
tray_height = #{trayHeight}
|
||||
where
|
||||
position_map_item_id = #{positionMapItemId}
|
||||
and location_storey = #{locationStorey}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
@ -190,4 +190,15 @@
|
||||
robot_no = #{robotNo}
|
||||
and deleted = '0'
|
||||
</update>
|
||||
|
||||
<update id="setMapItemUse">
|
||||
update
|
||||
ware_position_map_item
|
||||
set
|
||||
use_status = '2'
|
||||
where
|
||||
robot_no = #{robotNo}
|
||||
and id = #{id}
|
||||
and deleted = '0'
|
||||
</update>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user