参数配置
This commit is contained in:
parent
740e725637
commit
3665002ba1
@ -223,4 +223,7 @@ public interface ErrorCodeConstants {
|
||||
// ========== 机器人告警码值映射 1_002_041_001 ==========
|
||||
ErrorCode WARN_CODE_MAPPING_NOT_EXISTS = new ErrorCode(1_002_041_001, "机器人告警码值映射不存在");
|
||||
|
||||
// ========== 通用配置 1_002_042_001 ==========
|
||||
ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(1_002_042_001 , "通用配置不存在");
|
||||
|
||||
}
|
||||
|
@ -72,6 +72,8 @@ public class RobotStatusApiImpl implements RobotStatusApi {
|
||||
robotStatusDataPoseDTO.setX(robotStatusDataDTO.getData().getPose2d().getX());
|
||||
robotStatusDataPoseDTO.setY(robotStatusDataDTO.getData().getPose2d().getY());
|
||||
robotStatusDataPoseDTO.setYaw(robotStatusDataDTO.getData().getPose2d().getYaw());
|
||||
robotStatusDataPoseDTO.setFloor(robotStatusDataDTO.getData().getPose2d().getFloor());
|
||||
robotStatusDataPoseDTO.setArea(robotStatusDataDTO.getData().getPose2d().getArea());
|
||||
redisUtil.set(pose2dKey,JSON.toJSONString(robotStatusDataPoseDTO),robotPositionCacheTime);
|
||||
|
||||
if (ObjectUtil.isNotNull(robotStatusDataDTO.getData().getErr_code())) {
|
||||
|
@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.config;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.config.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
import cn.iocoder.yudao.module.system.service.config.CommonConfigService;
|
||||
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/common/config")
|
||||
@Validated
|
||||
public class CommonConfigController {
|
||||
|
||||
@Resource
|
||||
private CommonConfigService configService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建通用配置")
|
||||
@PreAuthorize("@ss.hasPermission('common:config:create')")
|
||||
public CommonResult<Long> createConfig(@Valid @RequestBody CommonConfigSaveReqVO createReqVO) {
|
||||
return success(configService.createConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新通用配置")
|
||||
@PreAuthorize("@ss.hasPermission('common:config:update')")
|
||||
public CommonResult<Boolean> updateConfig(@Valid @RequestBody CommonConfigSaveReqVO updateReqVO) {
|
||||
configService.updateConfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除通用配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('common:config:delete')")
|
||||
public CommonResult<Boolean> deleteConfig(@RequestParam("id") Long id) {
|
||||
configService.deleteConfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得通用配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('common:config:query')")
|
||||
public CommonResult<CommonConfigDO> getConfig(@RequestParam("configType") Long configType) {
|
||||
CommonConfigDO config = configService.getConfig(configType);
|
||||
return success(config);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得通用配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('common:config:query')")
|
||||
public CommonResult<PageResult<CommonConfigRespVO>> getConfigPage(@Valid CommonConfigPageReqVO pageReqVO) {
|
||||
PageResult<CommonConfigDO> pageResult = configService.getConfigPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CommonConfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出通用配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('common:config:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportConfigExcel(@Valid CommonConfigPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<CommonConfigDO> list = configService.getConfigPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "通用配置.xls", "数据", CommonConfigRespVO.class,
|
||||
BeanUtils.toBean(list, CommonConfigRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.config.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 CommonConfigPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "类型(1:参数配置、2:备用)", example = "1")
|
||||
private Integer configType;
|
||||
|
||||
@Schema(description = "配置信息")
|
||||
private String configStr;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.config.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 CommonConfigRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22456")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "类型(1:参数配置、2:备用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("类型(1:参数配置、2:备用)")
|
||||
private Integer configType;
|
||||
|
||||
@Schema(description = "配置信息")
|
||||
@ExcelProperty("配置信息")
|
||||
private String configStr;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.config.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
import cn.iocoder.yudao.framework.common.exception.enums.ServiceErrorCodeRange;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 通用配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class CommonConfigSaveReqVO implements Serializable {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22456")
|
||||
private Long id;
|
||||
|
||||
//查看 CommandConfigTypeEnum
|
||||
@Schema(description = "类型(1:参数配置、2:备用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer configType;
|
||||
|
||||
@Schema(description = "配置信息")
|
||||
private String configStr;
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.config.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 参数设置
|
||||
*/
|
||||
@Data
|
||||
public class CommonConfigVO {
|
||||
|
||||
@Schema(description = "自动充电电量-充电-阀值")
|
||||
private Integer startAutoCharge;
|
||||
|
||||
@Schema(description = "自动充电电量-离开-阀值")
|
||||
private Integer endAutoCharge;
|
||||
|
||||
@Schema(description = "机会充电电量-充电-阀值")
|
||||
private Integer chanceChargeStart;
|
||||
|
||||
@Schema(description = "机会充电电量-离开-阀值")
|
||||
private Integer chanceChargeEnd;
|
||||
|
||||
@Schema(description = "定时充电时段-开始时间")
|
||||
private LocalDateTime chargeStartTime;
|
||||
|
||||
@Schema(description = "定时充电时段-结束时间")
|
||||
private LocalDateTime chargeEndTime;
|
||||
|
||||
@Schema(description = "冲满电周期")
|
||||
private Integer chanceCycle;
|
||||
|
||||
@Schema(description = "遇障告警设置-等待时间")
|
||||
private Integer warnWaitTime;
|
||||
}
|
@ -79,4 +79,12 @@ public class HouseAreaController {
|
||||
BeanUtils.toBean(list, HouseAreaRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getHouseAreaList")
|
||||
@Operation(summary = "获得全部库区")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-area:query')")
|
||||
public CommonResult<List<HouseAreaRespVO>> getHouseAreaList() {
|
||||
List<HouseAreaDO> list = houseAreaService.getHouseAreaList();
|
||||
return success(BeanUtils.toBean(list, HouseAreaRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -54,4 +54,12 @@ public class WareHouseLaneController {
|
||||
.eq(WareHouseLaneDO::getPositionMapId, positionMapId));
|
||||
return success(BeanUtils.toBean(list, WareHouseLaneRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getHouseLaneList")
|
||||
@Operation(summary = "获得所有线库列表")
|
||||
public CommonResult<List<WareHouseLaneRespVO>> getHouseLaneList() {
|
||||
List<WareHouseLaneDO> list = houseLaneService.list(new LambdaQueryWrapperX<WareHouseLaneDO>()
|
||||
.orderByAsc(WareHouseLaneDO::getId));
|
||||
return success(BeanUtils.toBean(list, WareHouseLaneRespVO.class));
|
||||
}
|
||||
}
|
||||
|
@ -73,10 +73,10 @@ public class WareHouseLocationController {
|
||||
return success(BeanUtils.toBean(houseLocation, WareHouseLocationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@PostMapping("/page")
|
||||
@Operation(summary = "获得库位分页")
|
||||
@PreAuthorize("@ss.hasPermission('ware:house-location:query')")
|
||||
public CommonResult<PageResult<WareHouseLocationRespVO>> getHouseLocationPage(@Valid WareHouseLocationPageReqVO pageReqVO) {
|
||||
public CommonResult<PageResult<WareHouseLocationRespVO>> getHouseLocationPage(@Valid @RequestBody WareHouseLocationPageReqVO pageReqVO) {
|
||||
PageResult<WareHouseLocationDO> pageResult = houseLocationService.getHouseLocationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WareHouseLocationRespVO.class));
|
||||
}
|
||||
|
@ -140,4 +140,8 @@ public class WareHouseLocationRespVO {
|
||||
@Schema(description = "ware_position_map的id", example = "1")
|
||||
@ExcelProperty("ware_position_map的id")
|
||||
private Long mapId;
|
||||
|
||||
@Schema(description = "ware_position_map_item的id", example = "1")
|
||||
@ExcelProperty("ware_position_map_item的id")
|
||||
private Long mapItemId;
|
||||
}
|
@ -91,10 +91,10 @@ public class PositionMapController {
|
||||
}
|
||||
|
||||
@GetMapping("/getAllMap")
|
||||
@Operation(summary = "获得所有仓库点位地图Map")
|
||||
@Operation(summary = "获得楼层对应的区域集合")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map:getAllMap')")
|
||||
public CommonResult<List<PositionMapDO>> getAllMap() {
|
||||
List<PositionMapDO> list = positionMapService.getAllMap();
|
||||
public CommonResult<Map<Integer, List<PositionMapDO>>> getAllMap() {
|
||||
Map<Integer, List<PositionMapDO>> list = positionMapService.getAllMap();
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 机器人告警码值映射")
|
||||
@RestController
|
||||
@RequestMapping("/robot/warn-code-mapping")
|
||||
@RequestMapping("/system/robot/warn-code-mapping")
|
||||
@Validated
|
||||
public class RobotWarnCodeMappingController {
|
||||
|
||||
|
@ -33,7 +33,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 机器人告警信息")
|
||||
@RestController
|
||||
@RequestMapping("/robot/warn-msg")
|
||||
@RequestMapping("/system/robot/warn-msg")
|
||||
@Validated
|
||||
public class RobotWarnMsgController {
|
||||
|
||||
|
@ -5,6 +5,9 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 车辆信息 Response VO")
|
||||
@Data
|
||||
@ -14,6 +17,9 @@ public class RobotInformationPageRespVO {
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "车辆类型表id", example = "28234")
|
||||
private Long robotModelId;
|
||||
|
||||
@Schema(description = "车辆类型")
|
||||
@ExcelProperty("车辆类型")
|
||||
private String robotModelNumber;
|
||||
@ -55,4 +61,7 @@ public class RobotInformationPageRespVO {
|
||||
@Schema(description = "任务模式(0:拒收任务、1:正常)")
|
||||
private Integer robotTaskModel;
|
||||
|
||||
@Schema(description = "楼层/区域(json)")
|
||||
private Set<Long> floorAreaJson;
|
||||
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ public class RobotInformationSaveReqVO {
|
||||
private Long robotModelId;
|
||||
|
||||
@Schema(description = "车辆类型")
|
||||
@NotEmpty(message = "车辆类型不能为空")
|
||||
private String robotModelNumber;
|
||||
|
||||
@Schema(description = "AGV编号")
|
||||
|
@ -28,4 +28,9 @@ public class RobotModelPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "上传图片附件", example = "https://www.iocoder.cn")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "是否自动充电(0:手动充电,1:自动充电)")
|
||||
private Integer autoCharge;
|
||||
}
|
@ -20,6 +20,13 @@ public class RobotModelRespVO {
|
||||
@ExcelProperty("车辆类型")
|
||||
private String robotModelNumber;
|
||||
|
||||
@Schema(description = "上传图片附件", example = "https://www.iocoder.cn")
|
||||
@ExcelProperty("上传图片附件")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "是否自动充电(0:手动充电,1:自动充电)")
|
||||
private Integer autoCharge;
|
||||
|
||||
@Schema(description = "偏移量")
|
||||
@ExcelProperty("偏移量")
|
||||
private String robotOffset;
|
||||
|
@ -19,4 +19,10 @@ public class RobotModelSaveReqVO {
|
||||
@Schema(description = "偏移量")
|
||||
private String robotOffset;
|
||||
|
||||
@Schema(description = "上传图片附件", example = "https://www.iocoder.cn")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "是否自动充电(0:手动充电,1:自动充电)")
|
||||
private Integer autoCharge;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.config;
|
||||
|
||||
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("common_config")
|
||||
@KeySequence("common_config_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CommonConfigDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 类型(1:参数配置、2:备用)
|
||||
*/
|
||||
private Integer configType;
|
||||
/**
|
||||
* 配置信息
|
||||
*/
|
||||
private String configStr;
|
||||
|
||||
}
|
@ -37,4 +37,14 @@ public class RobotModelDO extends BaseDO {
|
||||
*/
|
||||
private String robotOffset;
|
||||
|
||||
/**
|
||||
* 上传图片附件
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 是否自动充电(0:手动充电,1:自动充电)
|
||||
*/
|
||||
private Integer autoCharge;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.config;
|
||||
|
||||
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.config.vo.CommonConfigPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 通用配置 Mapper
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Mapper
|
||||
public interface CommonConfigMapper extends BaseMapperX<CommonConfigDO> {
|
||||
|
||||
default PageResult<CommonConfigDO> selectPage(CommonConfigPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CommonConfigDO>()
|
||||
.eqIfPresent(CommonConfigDO::getConfigType, reqVO.getConfigType())
|
||||
.eqIfPresent(CommonConfigDO::getConfigStr, reqVO.getConfigStr())
|
||||
.betweenIfPresent(CommonConfigDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CommonConfigDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -28,10 +28,10 @@ public interface WareHouseLocationMapper extends BaseMapperX<WareHouseLocationDO
|
||||
.likeIfPresent(WareHouseLocationDO::getLaneName, reqVO.getLaneName())
|
||||
.eqIfPresent(WareHouseLocationDO::getAreaId, reqVO.getAreaId())
|
||||
.likeIfPresent(WareHouseLocationDO::getAreaName, reqVO.getAreaName())
|
||||
.eqIfPresent(WareHouseLocationDO::getLocationNo, reqVO.getLocationNo())
|
||||
.likeIfPresent(WareHouseLocationDO::getLocationNo, reqVO.getLocationNo())
|
||||
.likeIfPresent(WareHouseLocationDO::getGroupName, reqVO.getGroupName())
|
||||
.eqIfPresent(WareHouseLocationDO::getLocationYaw, reqVO.getLocationYaw())
|
||||
.eqIfPresent(WareHouseLocationDO::getSkuInfo, reqVO.getSkuInfo())
|
||||
.likeIfPresent(WareHouseLocationDO::getSkuInfo, reqVO.getSkuInfo())
|
||||
.eqIfPresent(WareHouseLocationDO::getSkuBatch, reqVO.getSkuBatch())
|
||||
.eqIfPresent(WareHouseLocationDO::getSkuNumber, reqVO.getSkuNumber())
|
||||
.eqIfPresent(WareHouseLocationDO::getTrayInfo, reqVO.getTrayInfo())
|
||||
|
@ -23,7 +23,7 @@ public interface RobotInformationMapper extends BaseMapperX<RobotInformationDO>
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RobotInformationDO>()
|
||||
.eqIfPresent(RobotInformationDO::getRobotModelId, reqVO.getRobotModelId())
|
||||
.eqIfPresent(RobotInformationDO::getRobotModelNumber, reqVO.getRobotModelNumber())
|
||||
.eqIfPresent(RobotInformationDO::getRobotNo, reqVO.getRobotNo())
|
||||
.likeIfPresent(RobotInformationDO::getRobotNo, reqVO.getRobotNo())
|
||||
.eqIfPresent(RobotInformationDO::getRobotTaskModel, reqVO.getRobotTaskModel())
|
||||
.eqIfPresent(RobotInformationDO::getMacAddress, reqVO.getMacAddress())
|
||||
.eqIfPresent(RobotInformationDO::getUrl, reqVO.getUrl())
|
||||
|
@ -21,7 +21,7 @@ public interface RobotWarnMsgMapper extends BaseMapperX<RobotWarnMsgDO> {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<RobotWarnMsgDO>()
|
||||
.eqIfPresent(RobotWarnMsgDO::getRobotNo, reqVO.getRobotNo())
|
||||
.eqIfPresent(RobotWarnMsgDO::getWarnLevel, reqVO.getWarnLevel())
|
||||
.eqIfPresent(RobotWarnMsgDO::getWarnCode, reqVO.getWarnCode())
|
||||
.likeIfPresent(RobotWarnMsgDO::getWarnCode, reqVO.getWarnCode())
|
||||
.eqIfPresent(RobotWarnMsgDO::getWarnMsg, reqVO.getWarnMsg())
|
||||
.eqIfPresent(RobotWarnMsgDO::getWarnSolve, reqVO.getWarnSolve())
|
||||
.betweenIfPresent(RobotWarnMsgDO::getSolveTime, reqVO.getSolveTime())
|
||||
|
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.system.enums.config;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* common_config的 config_type
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CommandConfigTypeEnum {
|
||||
ONE(1), //充电设置(页面)
|
||||
TWO(2); //充满电周期对应的冲电量
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private final Integer type;
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.service.config;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.config.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
|
||||
/**
|
||||
* 通用配置 Service 接口
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
public interface CommonConfigService {
|
||||
|
||||
/**
|
||||
* 创建通用配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createConfig(@Valid CommonConfigSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新通用配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateConfig(@Valid CommonConfigSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除通用配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteConfig(Long id);
|
||||
|
||||
/**
|
||||
* 获得通用配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 通用配置
|
||||
*/
|
||||
CommonConfigDO getConfig(Long configType);
|
||||
|
||||
/**
|
||||
* 获得通用配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 通用配置分页
|
||||
*/
|
||||
PageResult<CommonConfigDO> getConfigPage(CommonConfigPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.system.service.config;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.config.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.config.CommonConfigDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.config.CommonConfigMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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 static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.CONFIG_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 通用配置 Service 实现类
|
||||
*
|
||||
* @author 陈宾顺
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CommonConfigServiceImpl implements CommonConfigService {
|
||||
|
||||
@Resource
|
||||
private CommonConfigMapper configMapper;
|
||||
|
||||
@Override
|
||||
public Long createConfig(CommonConfigSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CommonConfigDO config = BeanUtils.toBean(createReqVO, CommonConfigDO.class);
|
||||
configMapper.insert(config);
|
||||
// 返回
|
||||
return config.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateConfig(CommonConfigSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateConfigExists(updateReqVO.getId());
|
||||
// 更新
|
||||
CommonConfigDO updateObj = BeanUtils.toBean(updateReqVO, CommonConfigDO.class);
|
||||
configMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConfig(Long id) {
|
||||
// 校验存在
|
||||
validateConfigExists(id);
|
||||
// 删除
|
||||
configMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateConfigExists(Long id) {
|
||||
if (configMapper.selectById(id) == null) {
|
||||
throw exception(CONFIG_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonConfigDO getConfig(Long configType) {
|
||||
CommonConfigDO commonConfigDO = configMapper.selectOne(new LambdaQueryWrapper<CommonConfigDO>()
|
||||
.eq(CommonConfigDO::getConfigType, configType));
|
||||
return commonConfigDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CommonConfigDO> getConfigPage(CommonConfigPageReqVO pageReqVO) {
|
||||
return configMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.housearea.vo.HouseAreaSav
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.housearea.HouseAreaDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库区 Service 接口
|
||||
@ -58,4 +59,10 @@ public interface HouseAreaService {
|
||||
* @param createReqVO
|
||||
*/
|
||||
void createOrEditOrDel(@Valid HouseAreaSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 获得全部库区
|
||||
* @return
|
||||
*/
|
||||
List<HouseAreaDO> getHouseAreaList();
|
||||
}
|
||||
|
@ -14,9 +14,11 @@ import cn.iocoder.yudao.module.system.controller.admin.positionmap.dto.PositionM
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.housearea.HouseAreaDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.houselocation.WareHouseLocationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotModelDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.housearea.HouseAreaMapper;
|
||||
import cn.iocoder.yudao.module.system.service.houselocation.HouseLocationService;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@ -154,4 +156,11 @@ public class HouseAreaServiceImpl implements HouseAreaService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HouseAreaDO> getHouseAreaList() {
|
||||
List<HouseAreaDO> list = houseAreaMapper.selectList(new LambdaQueryWrapper<HouseAreaDO>()
|
||||
.orderByAsc(HouseAreaDO::getId));
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 仓库点位地图 Service 接口
|
||||
@ -93,5 +94,5 @@ public interface PositionMapService extends IService<PositionMapDO> {
|
||||
* 获得所有仓库点位地图Map
|
||||
* @return
|
||||
*/
|
||||
List<PositionMapDO> getAllMap();
|
||||
Map<Integer, List<PositionMapDO>> getAllMap();
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
package cn.iocoder.yudao.module.system.service.positionmap;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.module.system.controller.admin.positionmap.vo.PositionMapPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapSaveReqVO;
|
||||
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.mysql.positionmap.PositionMapMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -31,6 +33,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
@ -296,11 +299,26 @@ public class PositionMapServiceImpl extends ServiceImpl<PositionMapMapper, Posit
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionMapDO> getAllMap() {
|
||||
public Map<Integer, List<PositionMapDO>> getAllMap() {
|
||||
List<PositionMapDO> positionMapDOS = positionMapMapper.selectList(new LambdaQueryWrapperX<PositionMapDO>()
|
||||
.orderByAsc(PositionMapDO::getFloor));
|
||||
return positionMapDOS;
|
||||
|
||||
if (ObjectUtil.isEmpty(positionMapDOS)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
Map<Integer, List<PositionMapDO>> collect =
|
||||
positionMapDOS.stream()
|
||||
.collect(Collectors.groupingBy(PositionMapDO::getFloor));
|
||||
|
||||
ArrayList<Map.Entry<Integer, List<PositionMapDO>>> list = new ArrayList<Map.Entry<Integer, List<PositionMapDO>>>(collect.entrySet());
|
||||
Collections.sort(list, new Comparator<Map.Entry<Integer, List<PositionMapDO>>>() {
|
||||
public int compare(Map.Entry<Integer, List<PositionMapDO>> o1, Map.Entry<Integer, List<PositionMapDO>> o2) {
|
||||
return o1.getKey().compareTo(o2.getKey()); // 按照值排序
|
||||
}
|
||||
});
|
||||
|
||||
return collect;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,9 +8,11 @@ import cn.iocoder.yudao.module.system.constant.robot.RobotTaskChcheConstant;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.robot.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotInformationDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotModelDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.robot.RobotTaskDetailDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotInformationMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotModelMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.robot.RobotTaskDetailMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.robot.*;
|
||||
import cn.iocoder.yudao.module.system.util.redis.RedisUtil;
|
||||
@ -46,6 +48,9 @@ public class RobotInformationServiceImpl implements RobotInformationService {
|
||||
@Resource
|
||||
private RobotTaskDetailMapper taskDetailMapper;
|
||||
|
||||
@Resource
|
||||
private RobotModelMapper modelMapper;
|
||||
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@ -65,6 +70,9 @@ public class RobotInformationServiceImpl implements RobotInformationService {
|
||||
if (ObjectUtil.isNotEmpty(existRobotNo)) {
|
||||
throw exception(ROBOT_ROBOT_NO_EXISTS);
|
||||
}
|
||||
RobotModelDO robotModelDO = modelMapper.selectById(createReqVO.getRobotModelId());
|
||||
createReqVO.setRobotModelNumber(robotModelDO.getRobotModelNumber());
|
||||
createReqVO.setUrl(robotModelDO.getUrl());
|
||||
// 插入
|
||||
RobotInformationDO information = BeanUtils.toBean(createReqVO, RobotInformationDO.class);
|
||||
informationMapper.insert(information);
|
||||
@ -165,12 +173,12 @@ public class RobotInformationServiceImpl implements RobotInformationService {
|
||||
v.setArea(robotStatusDataPoseDTO.getArea());
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(object)) {
|
||||
v.setRobotStatus(RobotInformationPageStatusEnum.OFFLINE.getType());
|
||||
v.setMsg("车辆已经离线");
|
||||
}else if (RobotTaskModelEnum.REJECTION.getType().equals(v.getRobotTaskModel())) {
|
||||
if (RobotTaskModelEnum.REJECTION.getType().equals(v.getRobotTaskModel())) {
|
||||
v.setRobotStatus(RobotInformationPageStatusEnum.DOLOCK.getType());
|
||||
v.setMsg("车辆已经锁定");
|
||||
}else if (ObjectUtil.isEmpty(object)) {
|
||||
v.setRobotStatus(RobotInformationPageStatusEnum.OFFLINE.getType());
|
||||
v.setMsg("车辆已经离线");
|
||||
}else if (RobotStatusEnum.STAND_BY.getType().equals(v.getRobotStatus())) {
|
||||
//查看机器人最后做的任务是不是充电
|
||||
RobotTaskDetailDO robotTaskDetailDO = taskDetailMapper.selectOne(new LambdaQueryWrapper<RobotTaskDetailDO>()
|
||||
|
@ -129,15 +129,11 @@ public class RobotTaskServiceImpl implements RobotTaskService {
|
||||
}
|
||||
//搬空任务只能选择线库或者区域
|
||||
if (MoveAllEnum.YES.getType().equals(createReqVO.getDoMoveAll())) {
|
||||
Set<Integer> releaseTypeList =
|
||||
createReqVO.getTaskDetailList().stream().map(v -> v.getReleaseType())
|
||||
.collect(Collectors.toSet());
|
||||
Set<Integer> takeTypeList =
|
||||
createReqVO.getTaskDetailList().stream().map(v -> v.getTakeType())
|
||||
.collect(Collectors.toSet());
|
||||
if (releaseTypeList.contains(ReleaseTakeEnum.TO_LOCATION.getType())
|
||||
|| takeTypeList.contains(ReleaseTakeEnum.TO_LOCATION.getType())) {
|
||||
throw exception(TASK_ONLY_CHOOSE_LOCATION);
|
||||
for (RobotTaskDetailAddVO robotTaskDetailAddVO : createReqVO.getTaskDetailList()) {
|
||||
if (ReleaseTakeEnum.TO_LOCATION.getType().equals(robotTaskDetailAddVO.getTakeType())
|
||||
|| ReleaseTakeEnum.TO_LOCATION.getType().equals(robotTaskDetailAddVO.getReleaseType())) {
|
||||
throw exception(TASK_ONLY_CHOOSE_LOCATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
//校验机器人是否禁用
|
||||
@ -164,7 +160,7 @@ public class RobotTaskServiceImpl implements RobotTaskService {
|
||||
throw exception(TASK_CHECK_EXIST_NO);
|
||||
}
|
||||
}
|
||||
// todo 如果搬空所选线库/区域 ,不能线库到库位, 不能区域到库位
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -176,8 +172,6 @@ public class RobotTaskServiceImpl implements RobotTaskService {
|
||||
RobotTaskDO task = BeanUtils.toBean(createReqVO, RobotTaskDO.class);
|
||||
taskMapper.insert(task);
|
||||
|
||||
// todo 更新数据库顺序 后续改为xxl-job一致
|
||||
|
||||
//查找库位
|
||||
List<Long> locationIds = new ArrayList<>();
|
||||
if (MoveAllEnum.NO.getType().equals(createReqVO.getDoMoveAll())) {
|
||||
|
@ -0,0 +1,12 @@
|
||||
<?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.config.CommonConfigMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user