This commit is contained in:
cbs 2025-06-17 14:19:51 +08:00
parent 41bf5bed58
commit e73d9a2002
25 changed files with 165 additions and 208 deletions

View File

@ -31,4 +31,8 @@ public class RobotDimensionsDTO {
@Schema(description = "转弯半径(单位米)")
private Double robotTurningRadius;
@Schema(description = "偏移量")
private Double robotOffset;
}

View File

@ -34,9 +34,9 @@ management:
# MQTT
mqtt:
# host: tcp://123.57.12.40:1883
# host: tcp://127.0.0.1:1883
host: tcp://127.0.0.1:1883
# host: tcp://10.10.7.116:1883
host: tcp://10.10.7.114:1883
# host: tcp://10.10.7.114:1883
username: adminuser
password: adminuser
qos: 2

View File

@ -5,12 +5,14 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.api.remote.dto.*;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.controller.admin.robot.camera.RobotCameraAddVO;
import cn.iocoder.yudao.module.system.service.remote.RemoteControllerInformationService;
import cn.iocoder.yudao.module.system.service.robot.RobotTaskDetailService;
import cn.iocoder.yudao.module.system.service.robot.camera.RobotCameraService;
import cn.iocoder.yudao.module.system.util.aes.AESEncryptionUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@ -39,8 +41,8 @@ public class RemoteExceptionTaskApiImpl implements RemoteExceptionTaskApi{
@Resource
private RobotCameraService cameraService;
@Value("${zn.camera_secret_key}")
private String cameraSecretKey;
@Autowired
private ZnConfigConstant znConfigConstant;
/**
* 远遥查询异常的车辆
@ -67,8 +69,8 @@ public class RemoteExceptionTaskApiImpl implements RemoteExceptionTaskApi{
for (RemoteRobotCameraDTO robotCameraDO : list) {
try {
robotCameraDO.setCameraAccount(AESEncryptionUtil.decrypt(robotCameraDO.getCameraAccount(),cameraSecretKey));
robotCameraDO.setCameraPassword(AESEncryptionUtil.decrypt(robotCameraDO.getCameraPassword(),cameraSecretKey));
robotCameraDO.setCameraAccount(AESEncryptionUtil.decrypt(robotCameraDO.getCameraAccount(),znConfigConstant.getCameraSecretKey()));
robotCameraDO.setCameraPassword(AESEncryptionUtil.decrypt(robotCameraDO.getCameraPassword(),znConfigConstant.getCameraSecretKey()));
} catch (Exception e) {
throw exception(CAMERA_DECRYPTION_FAILED);
}

View File

@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.system.api.robot.processor.RequestProcessor;
import cn.iocoder.yudao.module.system.api.robot.websocket.RobotInformationVO;
import cn.iocoder.yudao.module.system.api.robot.vo.RobotReactiveStatusDTO;
import cn.iocoder.yudao.module.system.api.robot.websocket.RobotStatusDataPoseDTO;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.config.ratelimiter.SystemRateLimiter;
import cn.iocoder.yudao.module.system.constant.CommonConstant;
import cn.iocoder.yudao.module.system.constant.area.FloorAreaConstant;
@ -41,8 +42,8 @@ public class RobotStatusApiImpl implements RobotStatusApi {
@Autowired
private RobotInformationService robotInformationService;
@Value("${zn.robot_position_cache_time:10}")
private Long robotPositionCacheTime;
@Autowired
private ZnConfigConstant znConfigConstant;
@Resource
private RequestProcessor processor;
@ -107,7 +108,7 @@ public class RobotStatusApiImpl implements RobotStatusApi {
robotStatusDataPoseDTO.setForkHeight(data.getForkHeight());
}
redisUtil.set(pose2dKey, JSON.toJSONString(robotStatusDataPoseDTO), robotPositionCacheTime);
redisUtil.set(pose2dKey, JSON.toJSONString(robotStatusDataPoseDTO), znConfigConstant.getRobotPositionCacheTime());
executorService.execute(() ->{
sendToPP(robotStatusDataPoseDTO);
@ -127,8 +128,8 @@ public class RobotStatusApiImpl implements RobotStatusApi {
//机器人身上是否有货
String taskStatusKey = RobotTaskChcheConstant.ROBOT_TASK_STATUS + robotStatusDataDTO.getMac();
String cargoDetectedKey = RobotTaskChcheConstant.ROBOT_CARGO_DETECTED + robotStatusDataDTO.getMac();
redisUtil.set(taskStatusKey, robotStatusDataDTO.getTaskStatus(), robotPositionCacheTime);
redisUtil.set(cargoDetectedKey, robotStatusDataDTO.getCargoDetected(), robotPositionCacheTime);
redisUtil.set(taskStatusKey, robotStatusDataDTO.getTaskStatus(), znConfigConstant.getRobotPositionCacheTime());
redisUtil.set(cargoDetectedKey, robotStatusDataDTO.getCargoDetected(), znConfigConstant.getRobotPositionCacheTime());
Map<String, Object> map = new HashMap<>();
String value = FloorAreaConstant.FLOOR_AREA_ROBOT + floorZoneDTO.getFloor() + CommonConstant.SYMBOL + floorZoneDTO.getArea();
map.put(robotStatusDataDTO.getMac(), JSON.toJSONString(finalRobotInformationVO));

View File

@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.system.api.robot.dto.RobotCommandStateDTO;
import cn.iocoder.yudao.module.system.api.robot.dto.RobotCompleteTaskDTO;
import cn.iocoder.yudao.module.system.api.robot.websocket.RobotSkuInfoDTO;
import cn.iocoder.yudao.module.system.api.robot.websocket.WsWareHouseLocationDTO;
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;
@ -120,12 +121,8 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
@Resource
private DeviceInformationService deviceInformationService;
@Value("${zn.robot_doing_action.doing_action_cache_time:2*24*60*60}")
private Long doingActionCacheTime;
@Value("${zn.is_simulation:false}")
private Boolean isSimulation;
@Autowired
private ZnConfigConstant znConfigConstant;
@Transactional(rollbackFor = Exception.class)
public void doRobotDoneTask(RobotCompleteTaskDTO robotCompleteTaskDTO) {
@ -415,7 +412,8 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
|| RobotTaskStageEnum.UN_START.getType().equals(robotTaskDetailDO.getTaskStage())) {
robotTaskDetailDO.setTaskStatus(RobotTaskDetailStatusEnum.NEW.getType());
robotTaskDetailDO.setTaskStage(RobotTaskStageEnum.UN_START.getType());
if (!isSimulation) {
if (!znConfigConstant.getIsSimulation()) {
robotTaskDetailDO.setRobotNo("");
}
robotTaskDetailDO.setOccurError(ZeroOneEnum.ZERO.getType());
@ -549,7 +547,7 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
pathPlanningService.updateBehavior(String.valueOf(robotCompleteTaskDTO.getOrderId()), robotTaskDetailDO.getRobotNo()
, "", PathIsReachEnum.END_WORK.getType());
if (!isSimulation) {
if (!znConfigConstant.getIsSimulation()) {
String plantingKey = PathPlanningChcheConstant.PATH_PLANNING_TASK + robotCompleteTaskDTO.getOrderId();
redisUtil.del(plantingKey);
}
@ -660,7 +658,7 @@ public class RobotTaskStatusApiImpl implements RobotTaskStatusApi {
logOne.setPositionMapId(mapId);
}
taskDetailActionLogService.createTaskDetailActionLog(logOne);
redisUtil.set(robotDoingActionKey, logOne.getActionMsg(), doingActionCacheTime);
redisUtil.set(robotDoingActionKey, logOne.getActionMsg(), znConfigConstant.getRobotDoingAction().getDoingActionCacheTime());
robotTaskDetailMapper.updateById(robotTaskDetailDO);
}

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.config.aop;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.config.ratelimiter.SystemRateLimiter;
import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
import lombok.extern.slf4j.Slf4j;
@ -13,6 +14,7 @@ import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
@ -36,8 +38,9 @@ public class SystemRateLimiterAspect {
@Resource
private RedisUtil redisUtil;
@Value("${zn.open_rate_limiter:false}")
private Boolean openRateLimiter;
@Autowired
private ZnConfigConstant znConfigConstant;
@Pointcut("@annotation(cn.iocoder.yudao.module.system.config.ratelimiter.SystemRateLimiter)")
public void serviceLimit() {
@ -46,7 +49,7 @@ public class SystemRateLimiterAspect {
@Around("serviceLimit()")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
if (!openRateLimiter) {
if (!znConfigConstant.getOpenRateLimiter()) {
return joinPoint.proceed();
}
MethodSignature signature = (MethodSignature) joinPoint.getSignature();

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.config.poperties;
import cn.iocoder.yudao.module.system.config.poperties.dto.RobotCharge;
import cn.iocoder.yudao.module.system.config.poperties.dto.RobotConfig;
import cn.iocoder.yudao.module.system.config.poperties.dto.RobotDoingAction;
import cn.iocoder.yudao.module.system.config.poperties.dto.Task;
@ -22,13 +23,15 @@ public class ZnConfigConstant {
private Long robotPositionCacheTime;
private Boolean cycleDoAutoMove;
private String fullElectricity;
private String taskNeedSingle;
private String locationNumberReduce;
private Boolean taskNeedSingle;
private Long locationNumberReduce;
private RobotDoingAction robotDoingAction;
private RobotCharge robotCharge;
private Task task ;
private RobotConfig robotConfig;
private Boolean openRateLimiter;
private Boolean isSimulation ;
private Boolean isSimulation;
private Boolean sendRobotInitPose;
private Boolean synchronousAllMapNode;
private Integer synchronousAllMapNode;
private Boolean taskNotCheck;
}

View File

@ -0,0 +1,9 @@
package cn.iocoder.yudao.module.system.config.poperties.dto;
import lombok.Data;
@Data
public class RobotCharge {
private Long releaseLocationNumberConfig;
private Long priorityConfig;
}

View File

@ -5,5 +5,5 @@ import lombok.Data;
@Data
public class Task {
private Boolean checkSkuInfo;
private Long taskChcheTime;
private Long taskCacheTime;
}

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.constant.device.DeviceChcheConstant;
import cn.iocoder.yudao.module.system.controller.admin.information.dto.DeviceInformationDTO;
import cn.iocoder.yudao.module.system.controller.admin.information.dto.MapBindDeviceInfoDTO;
@ -40,6 +41,7 @@ import com.serotonin.modbus4j.ModbusMaster;
import com.serotonin.modbus4j.exception.ModbusInitException;
import com.serotonin.modbus4j.exception.ModbusTransportException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -91,8 +93,8 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
@Resource
private PositionMapItemService positionMapItemService;
@Value("${zn.camera_secret_key}")
private String cameraSecretKey;
@Autowired
private ZnConfigConstant znConfigConstant;
@Override
public Long createInformation(DeviceInformationSaveReqVO createReqVO) {
@ -114,7 +116,7 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
if (DeviceTypeEnum.CAMERA.getType().equals(createReqVO.getDeviceType())) {
try {
createReqVO.setCameraCode(AESEncryptionUtil.getEncrypt(createReqVO.getCameraCode(), cameraSecretKey));
createReqVO.setCameraCode(AESEncryptionUtil.getEncrypt(createReqVO.getCameraCode(), znConfigConstant.getCameraSecretKey()));
} catch (Exception ignored) {
}
}
@ -149,7 +151,7 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
// 更新
if (DeviceTypeEnum.CAMERA.getType().equals(updateReqVO.getDeviceType())) {
try {
updateReqVO.setCameraCode(AESEncryptionUtil.getEncrypt(updateReqVO.getCameraCode(), cameraSecretKey));
updateReqVO.setCameraCode(AESEncryptionUtil.getEncrypt(updateReqVO.getCameraCode(), znConfigConstant.getCameraSecretKey()));
} catch (Exception ignored) {
}
}
@ -478,7 +480,7 @@ public class DeviceInformationServiceImpl extends ServiceImpl<DeviceInformationM
return "";
}
return AESEncryptionUtil.decrypt(deviceInformationDO.getCameraCode(), cameraSecretKey);
return AESEncryptionUtil.decrypt(deviceInformationDO.getCameraCode(), znConfigConstant.getCameraSecretKey());
}
public void shrink(String ip, int port, String deviceNo) {

View File

@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.mqtt.api.path.dto.*;
import cn.iocoder.yudao.module.mqtt.api.path.task.TaskPathPlanningDTO;
import cn.iocoder.yudao.module.system.api.robot.dto.FloorZoneDTO;
import cn.iocoder.yudao.module.system.api.robot.vo.PathPlanningMovePoseVO;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.constant.CommonConstant;
import cn.iocoder.yudao.module.system.constant.path.PathPlanningChcheConstant;
import cn.iocoder.yudao.module.system.constant.path.PathPlanningTopicConstant;
@ -118,11 +119,8 @@ public class PathPlanningServiceImpl implements PathPlanningService {
@Resource
private PositionMapItemService positionMapItemService;
@Value("${zn.send_robot_init_pose:false}")
private Boolean sendRobotInitPose;
@Value("${zn.synchronous_all_map_node:500}")
private Integer synchronousAllMapNodeSize;
@Autowired
private ZnConfigConstant znConfigConstant;
@Resource
private PositionChangePointBindingService positionChangePointBindingService;
@ -197,7 +195,7 @@ public class PathPlanningServiceImpl implements PathPlanningService {
continue;
}
List<List<PositionMapItemSynDTO>> partition = Lists.partition(positionMapItemSynDTOS, synchronousAllMapNodeSize);
List<List<PositionMapItemSynDTO>> partition = Lists.partition(positionMapItemSynDTOS, znConfigConstant.getSynchronousAllMapNode());
for (List<PositionMapItemSynDTO> nodes : partition) {
PositionMapItemPathDTO relatedPathNode = new PositionMapItemPathDTO();
relatedPathNode.setFloor(positionMapDO.getFloor());
@ -467,9 +465,9 @@ public class PathPlanningServiceImpl implements PathPlanningService {
String topic = RobotTopicConstant.ROBOT_TASK_MOVE_TOPIC + mac;
if(RobotCommandTypeEnum.SWITCH_MAP.getType().equals(pathRobotDTO.getTaskType())) {
switchMap(pathRobotDTO,topic);
} else if (PathTaskTypeToRobotEnum.DROP_OFF_GOODS.getType().equals(pathRobotDTO.getTaskType())) {
} /*else if (PathTaskTypeToRobotEnum.DROP_OFF_GOODS.getType().equals(pathRobotDTO.getTaskType())) {
wordDropOffGoods(message,topic,pathRobotDTO.getRobotNo());
} else {
} */else {
commonApi.commonMethodStr(message, topic);
}
}
@ -592,7 +590,7 @@ public class PathPlanningServiceImpl implements PathPlanningService {
@Override
public void simulationRobotPoseRequest() {
if (!sendRobotInitPose) {
if (!znConfigConstant.getSendRobotInitPose()) {
log.info("不同步初始点位信息");
return;
}

View File

@ -23,6 +23,7 @@ import cn.iocoder.yudao.module.system.api.robot.dto.FloorZoneDTO;
import cn.iocoder.yudao.module.system.api.robot.dto.RobotStatusDTO;
import cn.iocoder.yudao.module.system.api.robot.websocket.RobotStatusDataPoseDTO;
import cn.iocoder.yudao.module.system.api.robot.websocket.RobotInformationVO;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.constant.CommonConstant;
import cn.iocoder.yudao.module.system.constant.path.PathPlanningChcheConstant;
import cn.iocoder.yudao.module.system.constant.path.PathPlanningTopicConstant;
@ -50,7 +51,6 @@ import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapItemMappe
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapMapper;
import cn.iocoder.yudao.module.system.dal.mysql.remote.RemoteControllerInformationMapper;
import cn.iocoder.yudao.module.system.dal.mysql.robot.*;
import cn.iocoder.yudao.module.system.dal.mysql.statistics.RobotWorkingHoursStatisticsMapper;
import cn.iocoder.yudao.module.system.dal.mysql.wait.MoveToWaitMapper;
import cn.iocoder.yudao.module.system.enums.common.ZeroOneEnum;
import cn.iocoder.yudao.module.system.enums.device.DeviceTypeEnum;
@ -159,24 +159,12 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
@Resource
private RedissonUtils redissonUtils;
@Value("${zn.is_simulation:false}")
private Boolean isSimulation;
@Value("${zn.full_electricity:95}")
private String fullElectricity;
@Value("${zn.task.task_chche_time:604800}")
private Long taskChcheTime;
@Resource
private RobotCameraService cameraService;
@Resource
private RobotChargeLogMapper chargeLogMapper;
@Resource
private RobotWorkingHoursStatisticsMapper robotWorkingHoursStatisticsMapper;
@Resource
private MoveToWaitMapper moveToWaitMapper;
@ -186,6 +174,9 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
@Resource
private RobotMapStopMapper mapStopMapper;
@Autowired
private ZnConfigConstant znConfigConstant;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createInformation(RobotInformationSaveReqVO createReqVO) {
@ -1179,7 +1170,7 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
String mac = getMacByRobotNo(robotNo);
robotCloseTaskDetail(actionLog.getTaskDetailId() + "", mac, actionLog.getCommandType());
if (!isSimulation && ActionStatusEnum.DONE.getType().equals(actionLog.getActionStatus())) {
if (!znConfigConstant.getIsSimulation() && ActionStatusEnum.DONE.getType().equals(actionLog.getActionStatus())) {
throw exception(TASK_CHECK_TASK_STATUS);
}
@ -1261,7 +1252,7 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
pathPlanningList.add(pathPlanning);
String plantingKey = PathPlanningChcheConstant.PATH_PLANNING_TASK + pathPlanning.getOrderId();
redisUtil.set(plantingKey, JSON.toJSONString(pathPlanning), taskChcheTime);
redisUtil.set(plantingKey, JSON.toJSONString(pathPlanning), znConfigConstant.getTask().getTaskCacheTime());
log.info("任务下发给PP :{}", JSON.toJSONString(pathPlanningList));
commonApi.commonMethod(pathPlanningList, PathPlanningTopicConstant.TASK_ASSIGNMENT_REQUEST);
@ -1689,7 +1680,7 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
resendToPPData(pathPlanning, actionLog, robotInformationDO, true);
String plantingKey = PathPlanningChcheConstant.PATH_PLANNING_TASK + pathPlanning.getOrderId();
redisUtil.set(plantingKey, JSON.toJSONString(pathPlanning), taskChcheTime);
redisUtil.set(plantingKey, JSON.toJSONString(pathPlanning), znConfigConstant.getTask().getTaskCacheTime());
List<TaskToPathPlanningDTO> pathPlanningList = new ArrayList<>();
pathPlanningList.add(pathPlanning);
@ -1725,7 +1716,7 @@ public class RobotInformationServiceImpl extends ServiceImpl<RobotInformationMap
&& !ChargeModelEnum.FULL.getType().equals((Integer) chargeModelCache)) {
robotEndElectricity = new BigDecimal(String.valueOf(robot.getAutoCharge()));
} else if (ObjectUtil.isNotEmpty(chargeModelCache) && ChargeModelEnum.FULL.getType().equals((Integer) chargeModelCache)) {
robotEndElectricity = new BigDecimal(fullElectricity);
robotEndElectricity = new BigDecimal(znConfigConstant.getFullElectricity());
} else if (ObjectUtil.isNotEmpty(chargeModelCache) && ChargeModelEnum.CHANCE.getType().equals((Integer) chargeModelCache)
&& ObjectUtil.isNotEmpty(chargeConfig.getChanceChargeEnd())) {
robotEndElectricity = new BigDecimal(String.valueOf(chargeConfig.getChanceChargeEnd()));

View File

@ -13,6 +13,7 @@ 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;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.constant.path.PathPlanningTopicConstant;
import cn.iocoder.yudao.module.system.constant.robot.RobotTaskChcheConstant;
import cn.iocoder.yudao.module.system.constant.robot.RobotTopicConstant;
@ -130,20 +131,8 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
@Autowired
private RobotInformationService robotInformationService;
@Value("${zn.task-no:ZN}")
private String taskNo;
@Value("${zn.do_cycle:true}")
private Boolean doCycle;
@Value("${zn.task.check_sku_info:true}")
private Boolean checkSkuInfo;
@Value("${zn.robot_config.offset_height}")
private Double offsetHeight;
@Value("${zn.robot_config.default_tray_height:0.82}")
private Double defaultTrayHeight;
@Autowired
private ZnConfigConstant znConfigConstant;
@Resource
private WareHouseLaneMapper houseLaneMapper;
@ -166,18 +155,12 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
@Resource
private DeviceInformationService deviceInformationService;
@Resource
private RobotTaskDetailActionLogMapper taskDetailActionLogMapper;
@Autowired
private RobotTaskMapper robotTaskMapper;
@Autowired
private RobotTaskDetailMapper robotTaskDetailMapper;
@Value("${zn.move-no:MOVE}")
private String moveTaskNo;
@Resource
private PositionMapItemService positionMapItemService;
@ -190,14 +173,10 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
@Resource
private RobotSimulationService robotSimulationService;
@Value("${zn.task_not_check:true}")
private Boolean taskNotCheck;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createTask(RobotTaskSaveReqVO createReqVO) throws InterruptedException {
if (taskNotCheck) {
if (znConfigConstant.getTaskNotCheck()) {
robotSimulationService.createTask(createReqVO);
return 1L;
}
@ -207,7 +186,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
//设置任务号
if (ObjectUtil.isEmpty(createReqVO.getTaskNo())) {
String incrementByKey = redisUtil.getIncrementByKey(RobotCacheLockEnum.TASK_NO.getKey());
createReqVO.setTaskNo(taskNo + DateUtils.getYearMonthDay() + incrementByKey);
createReqVO.setTaskNo(znConfigConstant.getTaskNo() + DateUtils.getYearMonthDay() + incrementByKey);
}
//获取库位id
RLock lock = redissonUtils.getLock(RobotCacheLockEnum.ROBOT_TASK_ADD_LOCK.getKey());
@ -240,7 +219,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
throw exception(TASK_DATA_NOT_FULL);
}
//校验循环任务的配置未开启
if (DoCycleEnum.YES.getType().equals(createReqVO.getDoCycle()) && !doCycle) {
if (DoCycleEnum.YES.getType().equals(createReqVO.getDoCycle()) && !znConfigConstant.getDoCycle()) {
throw exception(TASK_CYCLE_NOT_OPEN);
}
//搬空任务只能选择线库或者区域
@ -364,7 +343,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
List<Long> laneIds = new ArrayList<>();
List<Long> areaIds = new ArrayList<>();
if (ObjectUtil.isNotEmpty(task.getSkuInfo()) && checkSkuInfo) {
if (ObjectUtil.isNotEmpty(task.getSkuInfo()) && znConfigConstant.getTask().getCheckSkuInfo()) {
List<WareHouseLaneDO> wareHouseLaneDOS = houseLaneMapper.selectList(new LambdaQueryWrapper<WareHouseLaneDO>()
.eq(WareHouseLaneDO::getLaneMsg, task.getSkuInfo()));
if (ObjectUtil.isNotEmpty(wareHouseLaneDOS)) {
@ -397,7 +376,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
locationMapper.updateLocationLockList(list, task.getId(), LocationLockEnum.NO.getType());
});
if (doCycle && ObjectUtil.isNotEmpty(createReqVO.getDoCycle())
if (znConfigConstant.getDoCycle() && ObjectUtil.isNotEmpty(createReqVO.getDoCycle())
&& ZeroOneEnum.ONE.getType().equals(createReqVO.getDoCycle().intValue())) {
addCycle(task.getId(), createReqVO.getTaskDetailList());
}
@ -572,6 +551,12 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
*/
@Override
public void checkHaveDoingTask() {
//暂时注释
if (true) {
return;
}
List<RobotTaskDO> taskDOS = taskMapper.selectList(new LambdaQueryWrapper<RobotTaskDO>()
.in(RobotTaskDO::getTaskStatus, RobotTaskStatusEnum.NEW.getType(), RobotTaskStatusEnum.DOING.getType()));
if (ObjectUtil.isNotEmpty(taskDOS)) {
@ -661,7 +646,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
private RobotTaskDO ppCreateMove(TaskAssignDTO taskAssignDTO) {
RobotTaskDO task = new RobotTaskDO();
String incrementByKey = redisUtil.getIncrementByKey(RobotCacheLockEnum.MOVE_TASK_NO.getKey());
task.setTaskNo(moveTaskNo + DateUtils.getYearMonthDay() + incrementByKey);
task.setTaskNo(znConfigConstant.getMoveNo() + DateUtils.getYearMonthDay() + incrementByKey);
task.setId(IdUtil.getSnowflakeNextId());
task.setCycleNumber(0L);
task.setRemainingCycleNumber(0L);
@ -777,7 +762,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
location = locationMapper.selectById(v.getFromLocationId());
build = RobotAssignTaskArgDTO.builder()
.level(Double.valueOf(location.getLocationStorey()))
.offsetHeight(offsetHeight)
.offsetHeight(znConfigConstant.getRobotConfig().getOffsetHeight())
.build();
take.setArg(Arrays.asList(build));
} else if (PathTaskTypeEnum.RELEASE.getType().equals(taskAssignDTO.getOrderType())) {
@ -785,7 +770,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
location = locationMapper.selectById(v.getToLocationId());
build = RobotAssignTaskArgDTO.builder()
.level(Double.valueOf(location.getLocationStorey()))
.offsetHeight(offsetHeight)
.offsetHeight(znConfigConstant.getRobotConfig().getOffsetHeight())
.build();
}
@ -802,7 +787,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
private void setRobotAssignTaskArgHeigth(WareHouseLocationDO location, RobotAssignTaskArgDTO build) {
Integer locationStorey = location.getLocationStorey() - 1;
double height = locationStorey * defaultTrayHeight;
double height = locationStorey * znConfigConstant.getRobotConfig().getDefaultTrayHeight();
build.setHeight(height);
}
@ -851,7 +836,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
List<RobotTaskDetailAddVO> newTaskDetailList = new ArrayList<>();
List<Long> mapItemIds = new ArrayList<>();
if (doCycle) {
if (znConfigConstant.getDoCycle()) {
List<TaskCycleDO> taskCycleDOS = taskCycleMapper.selectList(new LambdaQueryWrapper<TaskCycleDO>());
if (ObjectUtil.isNotEmpty(taskCycleDOS)) {
mapItemIds = taskCycleDOS.stream().map(TaskCycleDO::getMapItemId).collect(Collectors.toList());
@ -1021,7 +1006,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
releaseMapItemIds = new ArrayList<>();
}
if (doCycle) {
if (znConfigConstant.getDoCycle()) {
List<TaskCycleDO> taskCycleDOS = taskCycleMapper.selectList(new LambdaQueryWrapper<TaskCycleDO>());
if (ObjectUtil.isNotEmpty(taskCycleDOS)) {
List<Long> mapItemIds =
@ -1495,7 +1480,7 @@ public class RobotTaskServiceImpl extends ServiceImpl<RobotTaskMapper, RobotTask
@Override
public String getTaskNo() {
String incrementByKey = redisUtil.getIncrementByKey(RobotCacheLockEnum.TASK_NO.getKey());
return taskNo + DateUtils.getYearMonthDay() + incrementByKey;
return znConfigConstant.getTaskNo() + DateUtils.getYearMonthDay() + incrementByKey;
}
/**

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.system.service.robot.camera;
import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.controller.admin.robot.camera.RobotCameraAddVO;
import cn.iocoder.yudao.module.system.controller.admin.robot.camera.RobotCameraPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.robot.camera.RobotCameraRespVO;
@ -13,6 +14,7 @@ import cn.iocoder.yudao.module.system.util.aes.AESEncryptionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -45,8 +47,8 @@ public class RobotCameraServiceImpl extends ServiceImpl<RobotCameraMapper, Robot
@Resource
private RobotCameraMapper cameraMapper;
@Value("${zn.camera_secret_key}")
private String cameraSecretKey;
@Autowired
private ZnConfigConstant znConfigConstant;
@Override
public Long createCamera(RobotCameraSaveReqVO createReqVO) {
@ -131,14 +133,14 @@ public class RobotCameraServiceImpl extends ServiceImpl<RobotCameraMapper, Robot
private void setCameraAccountAndPassword(RobotCameraDO robotCameraDO) {
if (ObjectUtil.isEmpty(robotCameraDO.getId())) {
try {
robotCameraDO.setCameraAccount(AESEncryptionUtil.encrypt(robotCameraDO.getCameraAccount(), cameraSecretKey));
robotCameraDO.setCameraPassword(AESEncryptionUtil.encrypt(robotCameraDO.getCameraPassword(), cameraSecretKey));
robotCameraDO.setCameraAccount(AESEncryptionUtil.encrypt(robotCameraDO.getCameraAccount(), znConfigConstant.getCameraSecretKey()));
robotCameraDO.setCameraPassword(AESEncryptionUtil.encrypt(robotCameraDO.getCameraPassword(), znConfigConstant.getCameraSecretKey()));
} catch (Exception e) {
throw new RuntimeException(e);
}
} else {
robotCameraDO.setCameraAccount(AESEncryptionUtil.getEncrypt(robotCameraDO.getCameraAccount(),cameraSecretKey));
robotCameraDO.setCameraPassword(AESEncryptionUtil.getEncrypt(robotCameraDO.getCameraPassword(),cameraSecretKey));
robotCameraDO.setCameraAccount(AESEncryptionUtil.getEncrypt(robotCameraDO.getCameraAccount(),znConfigConstant.getCameraSecretKey()));
robotCameraDO.setCameraPassword(AESEncryptionUtil.getEncrypt(robotCameraDO.getCameraPassword(),znConfigConstant.getCameraSecretKey()));
}
}

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.system.api.robot.websocket.RobotStatusDataPoseDTO;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
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.config.vo.CommonConfigVO;
@ -74,11 +75,8 @@ public class AutoChargeServiceImpl implements AutoChargeService {
@Resource
private RedisUtil redisUtil;
@Value("${zn.full_electricity:100}")
private String fullElectricity;
@Value("${zn.charge-no:CHARGE}")
private String chargeNo;
@Autowired
private ZnConfigConstant znConfigConstant;
@Autowired
private RobotPathPlanningService robotPathPlanningService;
@ -307,7 +305,7 @@ public class AutoChargeServiceImpl implements AutoChargeService {
&& !ChargeModelEnum.FULL.getType().equals((Integer) chargeModelCache)) {
robotEndElectricity = new BigDecimal(String.valueOf(robot.getAutoCharge()));
} else if (ObjectUtil.isNotEmpty(chargeModelCache) && ChargeModelEnum.FULL.getType().equals((Integer) chargeModelCache)) {
robotEndElectricity = new BigDecimal(fullElectricity);
robotEndElectricity = new BigDecimal(znConfigConstant.getFullElectricity());
} else if (ObjectUtil.isNotEmpty(chargeModelCache) && ChargeModelEnum.CHANCE.getType().equals((Integer) chargeModelCache)
&& ObjectUtil.isNotEmpty(chargeConfig.getEndAutoCharge())) {
robotEndElectricity = new BigDecimal(String.valueOf(chargeConfig.getChanceChargeEnd()));
@ -386,7 +384,7 @@ public class AutoChargeServiceImpl implements AutoChargeService {
logDo.setStartElectricity(electricity);
//配置的充满电电量
BigDecimal robotFullElectricity = new BigDecimal(fullElectricity);
BigDecimal robotFullElectricity = new BigDecimal(znConfigConstant.getFullElectricity());
//车子剩余电量
BigDecimal robotRemainingElectricity = new BigDecimal(electricity + "");
if (ObjectUtil.isNotEmpty(chargeConfig.getChanceCycle()) && !chargeFullNos.contains(robot.getRobotNo())
@ -502,7 +500,7 @@ public class AutoChargeServiceImpl implements AutoChargeService {
public Long createChargeTask(String robotNo, List<RobotTaskDO> tasks, List<RobotTaskDetailAddVO> taskDetails, Long positionMapItemId, String deviceNo) {
RobotTaskDO task = new RobotTaskDO();
String incrementByKey = redisUtil.getIncrementByKey(RobotCacheLockEnum.CHARGE_TASK_NO.getKey());
task.setTaskNo(chargeNo + DateUtils.getYearMonthDay() + incrementByKey);
task.setTaskNo(znConfigConstant.getChargeNo() + DateUtils.getYearMonthDay() + incrementByKey);
task.setId(IdUtil.getSnowflakeNextId());
task.setCycleNumber(0L);
task.setRemainingCycleNumber(0L);

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailAddVO;
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDO;
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
@ -21,6 +22,7 @@ import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -46,11 +48,8 @@ public class CycleServiceImpl implements CycleService {
@Resource
private RobotTaskDetailMapper taskDetailMapper;
@Value("${zn.do_cycle:true}")
private Boolean doCycle;
@Value("${zn.task-no:ZN}")
private String taskNo;
@Autowired
private ZnConfigConstant znConfigConstant;
@Resource
private RedisUtil redisUtil;
@ -70,7 +69,7 @@ public class CycleServiceImpl implements CycleService {
public void cycleTaskJob() {
TenantContextHolder.setTenantId(1L);
if (!doCycle) {
if (!znConfigConstant.getDoCycle()) {
log.info("循环任务关闭了--不自动创建循环任务");
}
@ -195,7 +194,7 @@ public class CycleServiceImpl implements CycleService {
* @return
*/
public RobotTaskDO getTaskData(String incrementByKey, RobotTaskDO v ) {
String taskNoStr = taskNo + DateUtils.getYearMonthDay() + incrementByKey;
String taskNoStr = znConfigConstant.getTaskNo() + DateUtils.getYearMonthDay() + incrementByKey;
RobotTaskDO task = new RobotTaskDO();
BeanUtils.copyProperties(v, task);
task.setRemainingCycleNumber(v.getRemainingCycleNumber() - 1);

View File

@ -5,6 +5,7 @@ import cn.hutool.json.JSONUtil;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.system.api.robot.websocket.RobotStatusDataPoseDTO;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
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.config.vo.CommonConfigVO;
@ -54,9 +55,6 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
@Autowired
private RobotTaskDetailMapper robotTaskDetailMapper;
@Value("${zn.full_electricity:95}")
private String fullElectricity;
@Resource
private CommonConfigMapper configMapper;
@ -66,6 +64,9 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
@Resource
private RemoteControllerInformationMapper controllerInformationMapper;
@Autowired
private ZnConfigConstant znConfigConstant;
/**
* 获取待执行的机器人和任务
@ -258,7 +259,7 @@ public class DistributeTasksServiceImpl implements DistributeTasksService {
&& !ChargeModelEnum.FULL.getType().equals((Integer) chargeModelCache)) {
robotEndElectricity = new BigDecimal(String.valueOf(robot.getAutoCharge()));
} else if (ObjectUtil.isNotEmpty(chargeModelCache) && ChargeModelEnum.FULL.getType().equals((Integer) chargeModelCache)) {
robotEndElectricity = new BigDecimal(fullElectricity);
robotEndElectricity = new BigDecimal(znConfigConstant.getFullElectricity());
} else if (ObjectUtil.isNotEmpty(chargeModelCache) && ChargeModelEnum.CHANCE.getType().equals((Integer) chargeModelCache)
&& ObjectUtil.isNotEmpty(chargeConfig.getEndAutoCharge())) {
robotEndElectricity = new BigDecimal(String.valueOf(chargeConfig.getChanceChargeEnd()));

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.mqtt.api.task.RobotTaskApi;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskAutoMovePageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskAutoMoveSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
@ -60,12 +61,8 @@ public class RobotTaskAutoMoveServiceImpl implements RobotTaskAutoMoveService {
@Resource
private WareHouseLocationMapper locationMapper;
@Value("${zn.lane_auto_move:true}")
private Boolean laneAutoMove;
@Value("${zn.cycle_do_auto_move:true}")
private Boolean cycleDoAutoMove;
@Autowired
private ZnConfigConstant znConfigConstant;
@Override
public Long createTaskAutoMove(RobotTaskAutoMoveSaveReqVO createReqVO) {
@ -311,7 +308,7 @@ public class RobotTaskAutoMoveServiceImpl implements RobotTaskAutoMoveService {
*/
public List<Pair<RobotTaskDetailDO, List<WareHouseLocationDO>>> getLaneAutoMoveLocation(List<RobotTaskDetailDO> taskDetailDOS) {
List<Pair<RobotTaskDetailDO, List<WareHouseLocationDO>>> result = new ArrayList<>();
if (ObjectUtil.isEmpty(taskDetailDOS) || !laneAutoMove) {
if (ObjectUtil.isEmpty(taskDetailDOS) || !znConfigConstant.getLaneAutoMove()) {
log.info("没有线库的任务明细, 不需要执行线库移库");
return result;
}

View File

@ -10,6 +10,7 @@ import cn.iocoder.yudao.module.mqtt.api.common.CommonApi;
import cn.iocoder.yudao.module.mqtt.api.path.task.TaskLimitationAreaDTO;
import cn.iocoder.yudao.module.mqtt.api.path.task.TaskRobotNoLimittationAreaDTO;
import cn.iocoder.yudao.module.mqtt.api.path.task.TaskToPathPlanningDTO;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
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.RobotStatusCodeConstant;
@ -68,12 +69,6 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
@Resource
private PositionMapItemMapper positionMapItemMapper;
@Value("${zn.task_need_single:true}")
private Boolean taskNeedSingle;
@Value("${zn.location_number_reduce:100000000}")
private Long locationNumberReduce;
@Resource
private WareHouseLocationMapper locationMapper;
@ -86,23 +81,8 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
@Resource
private PositionMapMapper positionMapMapper;
@Value("${zn.robot_chearg.release_location_number_config:50}")
private Long releaseLocationNumberConfig;
@Value("${zn.robot_chearg.priority_config:50}")
private Long priorityConfig;
@Value("${zn.robot_config.offset_height}")
private Double offsetHeight;
@Value("${zn.task.task_chche_time:604800}")
private Long taskChcheTime;
@Value("${zn.move-no:MOVE}")
private String moveTaskNo;
@Value("${zn.robot_config.default_tray_height:0.82}")
private Double defaultTrayHeight;
@Autowired
private ZnConfigConstant znConfigConstant;
@Autowired
private RobotTaskMapper robotTaskMapper;
@ -302,7 +282,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
RobotTaskDO task = new RobotTaskDO();
String incrementByKey = redisUtil.getIncrementByKey(RobotCacheLockEnum.MOVE_TASK_NO.getKey());
task.setTaskNo(moveTaskNo + DateUtils.getYearMonthDay() + incrementByKey);
task.setTaskNo(znConfigConstant.getMoveNo() + DateUtils.getYearMonthDay() + incrementByKey);
task.setId(IdUtil.getSnowflakeNextId());
task.setCycleNumber(0L);
task.setRemainingCycleNumber(0L);
@ -333,7 +313,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
pathPlanning.setRobotNoLimitationAreaDTOS(robotNoLimitions);
String key = PathPlanningChcheConstant.PATH_PLANNING_TASK + pathPlanning.getOrderId();
redisUtil.set(key, JSON.toJSONString(pathPlanning), taskChcheTime);
redisUtil.set(key, JSON.toJSONString(pathPlanning), znConfigConstant.getTask().getTaskCacheTime());
pathPlanningList.add(pathPlanning);
}
@ -370,7 +350,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
for (RobotChargeLogDO v : logs) {
Long priority = priorityConfig;
Long priority = znConfigConstant.getRobotCharge().getPriorityConfig();
LocalDateTime createTime = LocalDateTime.now();
if (ObjectUtil.isEmpty(ChargeModelEnum.TASK.getType().equals(v.getChargeModel()))
&& ObjectUtil.isNotEmpty(v.getTaskDetailId())
@ -397,11 +377,11 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
pathPlanning.setTaskType(taskType);
pathPlanning.setReleaseGroupId("POINT_" + v.getPositionMapItemId());
pathPlanning.setReleaseLocationNumber(releaseLocationNumberConfig);
pathPlanning.setReleaseLocationNumber(znConfigConstant.getRobotCharge().getReleaseLocationNumberConfig());
pathPlanning.setWaitIds(Collections.singletonList(v.getPositionMapItemId() + ""));
String key = PathPlanningChcheConstant.PATH_PLANNING_TASK + pathPlanning.getOrderId();
redisUtil.set(key, JSON.toJSONString(pathPlanning), taskChcheTime);
redisUtil.set(key, JSON.toJSONString(pathPlanning), znConfigConstant.getTask().getTaskCacheTime());
pathPlanningList.add(pathPlanning);
}
@ -518,12 +498,12 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
WareHouseLocationDO toLocation = locationDOMap.get(taskDetailDO.getToLocationId());
if (ObjectUtil.isNotEmpty(taskDetailDO.getFromLocationId())) {
pathPlanning.setTakeLocationNumber(Math.abs(locationNumberReduce - taskDetailDO.getFromLocationNumber()));
pathPlanning.setTakeLocationNumber(Math.abs(znConfigConstant.getLocationNumberReduce() - taskDetailDO.getFromLocationNumber()));
pathPlanning.setTakePointId(fromLocation.getMapItemId());
pathPlanningSetTakeHeight(pathPlanning, fromLocation);
pathPlanning.setTakeLevel(fromLocation.getLocationStorey());
pathPlanning.setTakeOffsetHeight(offsetHeight);
pathPlanning.setTakeOffsetHeight(znConfigConstant.getRobotConfig().getOffsetHeight());
if (ObjectUtil.isNotEmpty(taskDetailDO.getFromLaneId())) {
pathPlanning.setTakeGroupId("LINE_" + taskDetailDO.getFromLaneId());
} else {
@ -537,7 +517,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
pathPlanningSetReleaseHeight(pathPlanning, toLocation);
pathPlanning.setReleaseLevel(toLocation.getLocationStorey());
pathPlanning.setReleaseOffsetHeight(offsetHeight);
pathPlanning.setReleaseOffsetHeight(znConfigConstant.getRobotConfig().getOffsetHeight());
if (ObjectUtil.isNotEmpty(taskDetailDO.getToLaneId())) {
pathPlanning.setReleaseGroupId("LINE_" + taskDetailDO.getToLaneId());
} else {
@ -546,7 +526,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
}
String key = PathPlanningChcheConstant.PATH_PLANNING_TASK + pathPlanning.getOrderId();
redisUtil.set(key, JSON.toJSONString(pathPlanning), taskChcheTime);
redisUtil.set(key, JSON.toJSONString(pathPlanning), znConfigConstant.getTask().getTaskCacheTime());
pathPlanningList.add(pathPlanning);
}
@ -569,17 +549,17 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
return;
}
WareHouseLocationDO nextLocation = locationMapper.selectOne(new LambdaQueryWrapperX<WareHouseLocationDO>()
/*WareHouseLocationDO nextLocation = locationMapper.selectOne(new LambdaQueryWrapperX<WareHouseLocationDO>()
.eq(WareHouseLocationDO::getId, toLocation.getMapItemId())
.eq(WareHouseLocationDO::getLocationStorey, toLocation.getLocationStorey() - 1)
.last("limit 1"));
if (ObjectUtil.isNotEmpty(nextLocation) && ObjectUtil.isNotEmpty(nextLocation.getLocationTotalHeight())) {
pathPlanning.setReleaseHeight(Double.valueOf(nextLocation.getLocationTotalHeight() + ""));
return;
}
}*/
Integer locationStorey = toLocation.getLocationStorey() - 1;
double height = locationStorey * defaultTrayHeight;
double height = locationStorey * znConfigConstant.getRobotConfig().getDefaultTrayHeight();
log.info("放货设置默认高度 :{}", height);
pathPlanning.setReleaseHeight(height);
}
@ -591,12 +571,12 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
* @param fromLocation
*/
private void pathPlanningSetTakeHeight(TaskToPathPlanningDTO pathPlanning, WareHouseLocationDO fromLocation) {
if (ObjectUtil.isNotEmpty(fromLocation.getLocationTotalHeight())) {
/*if (ObjectUtil.isNotEmpty(fromLocation.getLocationTotalHeight())) {
pathPlanning.setTakeHeight(Double.valueOf(fromLocation.getLocationTotalHeight() + ""));
return;
}
}*/
Integer locationStorey = fromLocation.getLocationStorey();
double height = locationStorey * defaultTrayHeight;
double height = locationStorey * znConfigConstant.getRobotConfig().getDefaultTrayHeight();
log.info("取货设置默认取货高度 :{}", height);
pathPlanning.setTakeHeight(height);
}
@ -701,7 +681,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService {
*/
private List<RobotTaskDetailDO> getSingleTask(List<RobotTaskDetailDO> taskDetailDOS) {
//剔除目前正在做的线库和点位
if (!taskNeedSingle) {
if (!znConfigConstant.getTaskNeedSingle()) {
return taskDetailDOS;
}

View File

@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.mqtt.api.common.CommonApi;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotInformationPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskDetailAddVO;
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.RobotTaskSaveReqVO;
@ -85,27 +86,17 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
@Resource
private RobotInformationMapper informationMapper;
@Value("${zn.task-no:ZN}")
private String taskNo;
@Value("${zn.task.check_sku_info:true}")
private Boolean checkSkuInfo;
@Resource
private WareHouseLaneMapper houseLaneMapper;
@Resource
private HouseAreaMapper houseAreaMapper;
@Value("${zn.move-no:MOVE}")
private String moveTaskNo;
@Resource
private PositionMapItemService positionMapItemService;
@Autowired
private ZnConfigConstant znConfigConstant;
@Override
public void createTask(RobotTaskSaveReqVO createReqVO) {
@ -113,7 +104,7 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
//设置任务号
if (ObjectUtil.isEmpty(createReqVO.getTaskNo())) {
String incrementByKey = redisUtil.getIncrementByKey(RobotCacheLockEnum.TASK_NO.getKey());
createReqVO.setTaskNo(taskNo + DateUtils.getYearMonthDay() + incrementByKey);
createReqVO.setTaskNo(znConfigConstant.getTaskNo() + DateUtils.getYearMonthDay() + incrementByKey);
}
log.info("111111创建一个不校验的任务 :{}",createReqVO.getTaskNo());
@ -124,7 +115,7 @@ public class RobotSimulationServiceImpl implements RobotSimulationService{
List<Long> laneIds = new ArrayList<>();
List<Long> areaIds = new ArrayList<>();
if (ObjectUtil.isNotEmpty(task.getSkuInfo()) && checkSkuInfo) {
if (ObjectUtil.isNotEmpty(task.getSkuInfo()) && znConfigConstant.getTask().getCheckSkuInfo()) {
List<WareHouseLaneDO> wareHouseLaneDOS = houseLaneMapper.selectList(new LambdaQueryWrapper<WareHouseLaneDO>()
.eq(WareHouseLaneDO::getLaneMsg, task.getSkuInfo()));
if (ObjectUtil.isNotEmpty(wareHouseLaneDOS)) {

View File

@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.mqtt.api.task.dto.RobotSimulationPoseDTO;
import cn.iocoder.yudao.module.mqtt.api.task.dto.RobotSimulationPoseDataDTO;
import cn.iocoder.yudao.module.mqtt.enums.task.ExecutionTypeEnum;
import cn.iocoder.yudao.module.system.api.path.vo.RobotClosePathPlantingDTO;
import cn.iocoder.yudao.module.system.config.poperties.ZnConfigConstant;
import cn.iocoder.yudao.module.system.constant.path.PathPlanningTopicConstant;
import cn.iocoder.yudao.module.system.constant.robot.RobotTopicConstant;
import cn.iocoder.yudao.module.system.controller.admin.config.dto.TaskOrderConfigDTO;
@ -70,14 +71,11 @@ public class ToolsServiceImpl implements ToolsService {
@Resource
private PositionMapItemService positionMapItemService;
/*@Resource
private CommonConfigService configService;*/
@Resource
private PositionMapService positionMapService;
@Value("${zn.is_simulation:false}")
private Boolean isSimulation;
@Autowired
private ZnConfigConstant znConfigConstant;
/**
* 发送时间优先级距离的权重给PP
@ -184,7 +182,7 @@ public class ToolsServiceImpl implements ToolsService {
@Override
public void simulationPose() {
if (!isSimulation) {
if (!znConfigConstant.getIsSimulation()) {
log.info("非仿真环境不需要同步默认的节点数据");
}

View File

@ -191,27 +191,25 @@ zn:
camera_secret_key: A2C4rv7DY012c9ef #摄像头秘钥
do_cycle: true #是否开启循环
lane_auto_move: true #线库是否自动移库 true:线库执行自动移库 、false线库关闭执行自动移库
robot_position_cache_time: 10 #机器人上报点位存储时间(秒)
robot_position_cache_time: 10000000 #机器人上报点位存储时间(秒)
cycle_do_auto_move: true #存在循环的任务,是否开启自动移库. true:存在循环任务,开启自动移库; false有循环任务不自动移库
full_electricity: 100 #机器人充满电的电量
full_electricity: 95 #机器人充满电的电量
task_need_single: true #机器人对同一线库/点位是不是只能有一台机器人做任务 (true:一个点位/线库,只有一台机器人)
location_number_reduce: 100000000 #库位排序的差值(下发取货任务,将库位排序减去此值,然后取绝对值)
robot_doing_action: # 机器人正在做的动作
doing_action_cache_time: 172800 #单个动作缓存时间 8小时
robot_chearg: #机器人充电的配置
robot_charge: #机器人充电的配置
release_location_number_config: 50 #同一组序号,越大越先执行
priority_config: 50 #优先级
task: #任务相关的配置
check_sku_info: true #校验物料信息
task_cache_time: 1209600 #任务缓存的时间, 默认一星期
robot_config: #机器人取放货默认配置
offset_height: 0.1 #叉起货需要在原来高度基础上偏移的高度
default_tray_height: 1.1 #默认每层高度
default_tray_height: 0.82 #默认每层高度
open_rate_limiter: true #是否开启限流
path_planning:
task_chche_time: 1209600 #任务缓存的时间, 默认一星期
is_simulation: false # 是否为仿真环境
send_robot_init_pose: true # 是否为发送默认的车辆所在地图和点位
restore_task_restart: false # 恢复任务是否全部重新执行 true:全部重新开始
synchronous_all_map_node: 500 # 点位信息每次发送的数据量
task_not_check: true # 创建任务不校验

View File

@ -228,26 +228,24 @@ zn:
lane_auto_move: true #线库是否自动移库 true:线库执行自动移库 、false线库关闭执行自动移库
robot_position_cache_time: 10000000 #机器人上报点位存储时间(秒)
cycle_do_auto_move: true #存在循环的任务,是否开启自动移库. true:存在循环任务,开启自动移库; false有循环任务不自动移库
full_electricity: 100 #机器人充满电的电量
full_electricity: 95 #机器人充满电的电量
task_need_single: true #机器人对同一线库/点位是不是只能有一台机器人做任务 (true:一个点位/线库,只有一台机器人)
location_number_reduce: 100000000 #库位排序的差值(下发取货任务,将库位排序减去此值,然后取绝对值)
robot_doing_action: # 机器人正在做的动作
doing_action_cache_time: 172800 #单个动作缓存时间 8小时
robot_chearg: #机器人充电的配置
robot_charge: #机器人充电的配置
release_location_number_config: 50 #同一组序号,越大越先执行
priority_config: 50 #优先级
task: #任务相关的配置
check_sku_info: true #校验物料信息
task_chche_time: 1209600 #任务缓存的时间, 默认一星期
task_cache_time: 1209600 #任务缓存的时间, 默认一星期
robot_config: #机器人取放货默认配置
offset_height: 0.1 #叉起货需要在原来高度基础上偏移的高度
default_tray_height: 0.82 #默认每层高度
open_rate_limiter: true #是否开启限流
path_planning:
task_chche_time: 1209600 #任务缓存的时间, 默认一星期
is_simulation: false # 是否为仿真环境
send_robot_init_pose: true # 是否为发送默认的车辆所在地图和点位
# synchronous_all_map_node: 500 # 点位信息每次发送的数据量
synchronous_all_map_node: 500 # 点位信息每次发送的数据量
task_not_check: true # 创建任务不校验
logging:

View File

@ -219,27 +219,25 @@ zn:
camera_secret_key: A2C4rv7DY012c9ef #摄像头秘钥
do_cycle: true #是否开启循环
lane_auto_move: true #线库是否自动移库 true:线库执行自动移库 、false线库关闭执行自动移库
robot_position_cache_time: 10 #机器人上报点位存储时间(秒)
robot_position_cache_time: 10000000 #机器人上报点位存储时间(秒)
cycle_do_auto_move: true #存在循环的任务,是否开启自动移库. true:存在循环任务,开启自动移库; false有循环任务不自动移库
full_electricity: 100 #机器人充满电的电量
full_electricity: 95 #机器人充满电的电量
task_need_single: true #机器人对同一线库/点位是不是只能有一台机器人做任务 (true:一个点位/线库,只有一台机器人)
location_number_reduce: 100000000 #库位排序的差值(下发取货任务,将库位排序减去此值,然后取绝对值)
robot_doing_action: # 机器人正在做的动作
doing_action_cache_time: 172800 #单个动作缓存时间 8小时
robot_chearg: #机器人充电的配置
robot_charge: #机器人充电的配置
release_location_number_config: 50 #同一组序号,越大越先执行
priority_config: 50 #优先级
task: #任务相关的配置
check_sku_info: true #校验物料信息
task_cache_time: 1209600 #任务缓存的时间, 默认一星期
robot_config: #机器人取放货默认配置
offset_height: 0.1 #叉起货需要在原来高度基础上偏移的高度
default_tray_height: 1.1 #默认每层高度
default_tray_height: 0.82 #默认每层高度
open_rate_limiter: true #是否开启限流
path_planning:
task_chche_time: 1209600 #任务缓存的时间, 默认一星期
is_simulation: false # 是否为仿真环境
send_robot_init_pose: true # 是否为发送默认的车辆所在地图和点位
restore_task_restart: false # 恢复任务是否全部重新执行 true:全部重新开始
synchronous_all_map_node: 500 # 点位信息每次发送的数据量
task_not_check: true # 创建任务不校验

View File

@ -176,7 +176,8 @@
t2.robot_center_headstock AS robotCenterHeadstock,
t2.robot_center_tail AS robotCenterTail,
t1.mac_address as macAddress,
t2.robot_turning_radius as robotTurningRadius
t2.robot_turning_radius as robotTurningRadius,
t2.robot_offset as robotOffset
FROM
robot_information t1
LEFT JOIN robot_model t2 ON t1.robot_model_id = t2.id