地图相关
This commit is contained in:
parent
9aac8442f1
commit
f94062a262
@ -152,7 +152,7 @@ public class CodegenEngine {
|
||||
/**
|
||||
* 是否使用 jakarta 包,用于解决 Spring Boot 2.X 和 3.X 的兼容性问题
|
||||
*
|
||||
* true - 使用 jakarta.validation.constraints.*
|
||||
* true - 使用 javax.validation.constraints.*
|
||||
* false - 使用 javax.validation.constraints.*
|
||||
*/
|
||||
@Setter // 允许设置的原因,是因为单测需要手动改变
|
||||
|
@ -61,23 +61,23 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://47.97.8.94:3306/zn_wcs?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
|
||||
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例
|
||||
# url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
|
||||
username: root
|
||||
password: 123456
|
||||
password: yhtkj@2024!
|
||||
# username: sa # SQL Server 连接的示例
|
||||
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
|
||||
# username: SYSDBA # DM 连接的示例
|
||||
# password: SYSDBA # DM 连接的示例
|
||||
slave: # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
url: jdbc:mysql://47.97.8.94:3306/zn_wcs?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: 123456
|
||||
password: yhtkj@2024!
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
@ -156,4 +156,4 @@ yudao:
|
||||
security:
|
||||
mock-enable: true
|
||||
access-log: # 访问日志的配置项
|
||||
enable: false
|
||||
enable: false
|
||||
|
@ -167,4 +167,10 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode INFORMATION_NOT_EXISTS = new ErrorCode(1_002_029_001, "设备信息不存在");
|
||||
ErrorCode INFORMATION_MAC_EXIST = new ErrorCode(1_002_029_002, "此Mac地址已经存在");
|
||||
ErrorCode INFORMATION_MAC_INPUT = new ErrorCode(1_002_029_003, "请输入Mac地址");
|
||||
|
||||
// ========== 地图信息 1-002-030-000 ==========
|
||||
ErrorCode AGV_UPLOAD_INFORMATION_DOES_NOT_INCLUDE_FLOOR_OR_AREA_INFORMATION = new ErrorCode(1_002_030_001, "AGV上传信息未包含楼层或区域信息");
|
||||
ErrorCode AGV_FILE_UPLOAD_CONTENT_IS_EMPTY = new ErrorCode(1_002_030_002, "AGV文件上传内容为空");
|
||||
ErrorCode PLEASE_UPLOAD_PNG_AND_YAML_FILES = new ErrorCode(1_002_030_003, "请上传png和yaml两个文件并且文件内容不为空");
|
||||
ErrorCode AGV_MAP_NOT_FOUND = new ErrorCode(1_002_030_004, "找不到AGV地图信息");
|
||||
}
|
||||
|
@ -144,6 +144,12 @@
|
||||
<groupId>com.xingyuv</groupId>
|
||||
<artifactId>spring-boot-starter-captcha-plus</artifactId> <!-- 验证码,一般用于登录使用 -->
|
||||
</dependency>
|
||||
<!-- yaml文件解析-->
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -0,0 +1,105 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 仓库点位地图")
|
||||
@RestController
|
||||
@RequestMapping("/system/position-map/")
|
||||
@Validated
|
||||
public class PositionMapController {
|
||||
|
||||
@Resource
|
||||
private PositionMapService positionMapService;
|
||||
|
||||
private static final String UPLOAD_DIR = "/Users/aikai/project/";
|
||||
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新仓库点位地图")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map:update')")
|
||||
public CommonResult<Boolean> updatePositionMap(@Valid @RequestBody PositionMapSaveReqVO updateReqVO) {
|
||||
positionMapService.updatePositionMap(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除仓库点位地图")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map:delete')")
|
||||
public CommonResult<Boolean> deletePositionMap(@RequestParam("id") Long id) {
|
||||
positionMapService.deletePositionMap(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得仓库点位地图")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map:query')")
|
||||
public CommonResult<PositionMapRespVO> getPositionMap(@RequestParam("id") Long id) {
|
||||
PositionMapDO positionMap = positionMapService.getPositionMap(id);
|
||||
return success(BeanUtils.toBean(positionMap, PositionMapRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getMap")
|
||||
@Operation(summary = "获得仓库点位地图Map")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map:query')")
|
||||
public CommonResult<Map<Integer, List<PositionMapDO>>> getPositionMapList() {
|
||||
List<PositionMapDO> list = positionMapService.list();
|
||||
Map<Integer, List<PositionMapDO>> map = list.stream().collect(Collectors.groupingBy(PositionMapDO::getFloor));
|
||||
return success(map);
|
||||
}
|
||||
|
||||
@PostMapping("/upload")
|
||||
@Operation(summary = "文件上传")
|
||||
@PermitAll
|
||||
public CommonResult uploadFiles(@RequestParam("files") MultipartFile[] files) {
|
||||
// todo aiKai - 这里需要和设备定义好 楼层和区域到底是通过文件名称给 - 还是通过yml内容中给 目前按照以yml给的来写
|
||||
positionMapService.uploadFiles(files);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/downloadPng")
|
||||
@Operation(summary = "下载png文件")
|
||||
@PermitAll
|
||||
public void downloadPng(@RequestParam Integer floor, @RequestParam String area, HttpServletResponse response) throws IOException {
|
||||
positionMapService.downloadPng(floor, area, response);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/download")
|
||||
@Operation(summary = "下载文件")
|
||||
@PermitAll
|
||||
public void download(@RequestParam Integer floor, @RequestParam String area, HttpServletResponse response) throws IOException {
|
||||
positionMapService.downloadFile(floor, area, response);
|
||||
}
|
||||
|
||||
@GetMapping("/agvDownload")
|
||||
@Operation(summary = "AGV下载文件")
|
||||
@PermitAll
|
||||
public void downloadFile(HttpServletResponse response) throws IOException {
|
||||
positionMapService.downloadFile(response);
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapItemService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 仓库点位地图子表")
|
||||
@RestController
|
||||
@RequestMapping("/system/position-map-item")
|
||||
@Validated
|
||||
public class PositionMapItemController {
|
||||
|
||||
@Resource
|
||||
private PositionMapItemService positionMapItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建仓库点位地图子表")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-item:create')")
|
||||
public CommonResult<Long> createPositionMapItem(@Valid @RequestBody PositionMapItemSaveReqVO createReqVO) {
|
||||
return success(positionMapItemService.createPositionMapItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新仓库点位地图子表")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-item:update')")
|
||||
public CommonResult<Boolean> updatePositionMapItem(@Valid @RequestBody PositionMapItemSaveReqVO updateReqVO) {
|
||||
positionMapItemService.updatePositionMapItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除仓库点位地图子表")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-item:delete')")
|
||||
public CommonResult<Boolean> deletePositionMapItem(@RequestParam("id") Long id) {
|
||||
positionMapItemService.deletePositionMapItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得仓库点位地图子表")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-item:query')")
|
||||
public CommonResult<PositionMapItemRespVO> getPositionMapItem(@RequestParam("id") Long id) {
|
||||
PositionMapItemDO positionMapItem = positionMapItemService.getPositionMapItem(id);
|
||||
return success(BeanUtils.toBean(positionMapItem, PositionMapItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得仓库点位地图子表分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-item:query')")
|
||||
public CommonResult<PageResult<PositionMapItemRespVO>> getPositionMapItemPage(@Valid PositionMapItemPageReqVO pageReqVO) {
|
||||
PageResult<PositionMapItemDO> pageResult = positionMapItemService.getPositionMapItemPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PositionMapItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出仓库点位地图子表 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-item:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPositionMapItemExcel(@Valid PositionMapItemPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PositionMapItemDO> list = positionMapItemService.getPositionMapItemPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "仓库点位地图子表.xls", "数据", PositionMapItemRespVO.class,
|
||||
BeanUtils.toBean(list, PositionMapItemRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLinePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO;
|
||||
import cn.iocoder.yudao.module.system.service.positionmap.PositionMapLineService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 仓库点位地图连线")
|
||||
@RestController
|
||||
@RequestMapping("/system/position-map-line")
|
||||
@Validated
|
||||
public class PositionMapLineController {
|
||||
|
||||
@Resource
|
||||
private PositionMapLineService positionMapLineService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建仓库点位地图连线")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-line:create')")
|
||||
public CommonResult<Long> createPositionMapLine(@Valid @RequestBody PositionMapLineSaveReqVO createReqVO) {
|
||||
return success(positionMapLineService.createPositionMapLine(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新仓库点位地图连线")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-line:update')")
|
||||
public CommonResult<Boolean> updatePositionMapLine(@Valid @RequestBody PositionMapLineSaveReqVO updateReqVO) {
|
||||
positionMapLineService.updatePositionMapLine(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除仓库点位地图连线")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-line:delete')")
|
||||
public CommonResult<Boolean> deletePositionMapLine(@RequestParam("id") Long id) {
|
||||
positionMapLineService.deletePositionMapLine(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得仓库点位地图连线")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-line:query')")
|
||||
public CommonResult<PositionMapLineRespVO> getPositionMapLine(@RequestParam("id") Long id) {
|
||||
PositionMapLineDO positionMapLine = positionMapLineService.getPositionMapLine(id);
|
||||
return success(BeanUtils.toBean(positionMapLine, PositionMapLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得仓库点位地图连线分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-line:query')")
|
||||
public CommonResult<PageResult<PositionMapLineRespVO>> getPositionMapLinePage(@Valid PositionMapLinePageReqVO pageReqVO) {
|
||||
PageResult<PositionMapLineDO> pageResult = positionMapLineService.getPositionMapLinePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PositionMapLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出仓库点位地图连线 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:position-map-line:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPositionMapLineExcel(@Valid PositionMapLinePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PositionMapLineDO> list = positionMapLineService.getPositionMapLinePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "仓库点位地图连线.xls", "数据", PositionMapLineRespVO.class,
|
||||
BeanUtils.toBean(list, PositionMapLineRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.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 PositionMapItemPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "仓库点位地图表id", example = "30963")
|
||||
private Long positionMapId;
|
||||
|
||||
@Schema(description = "坐标x轴")
|
||||
private String locationX;
|
||||
|
||||
@Schema(description = "坐标y轴")
|
||||
private String locationY;
|
||||
|
||||
@Schema(description = "类型 1.行走点位 2.库位 3.充电桩 --- 后续补充", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "类型所对应表id", example = "15418")
|
||||
private Long objectId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.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 PositionMapItemRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31007")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "仓库点位地图表id", example = "30963")
|
||||
@ExcelProperty("仓库点位地图表id")
|
||||
private Long positionMapId;
|
||||
|
||||
@Schema(description = "坐标x轴")
|
||||
@ExcelProperty("坐标x轴")
|
||||
private String locationX;
|
||||
|
||||
@Schema(description = "坐标y轴")
|
||||
@ExcelProperty("坐标y轴")
|
||||
private String locationY;
|
||||
|
||||
@Schema(description = "类型 1.行走点位 2.库位 3.充电桩 --- 后续补充", example = "1")
|
||||
@ExcelProperty("类型 1.行走点位 2.库位 3.充电桩 --- 后续补充")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "类型所对应表id", example = "15418")
|
||||
@ExcelProperty("类型所对应表id")
|
||||
private Long objectId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.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 PositionMapItemSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31007")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "仓库点位地图表id", example = "30963")
|
||||
private Long positionMapId;
|
||||
|
||||
@Schema(description = "坐标x轴")
|
||||
private String locationX;
|
||||
|
||||
@Schema(description = "坐标y轴")
|
||||
private String locationY;
|
||||
|
||||
@Schema(description = "类型 1.行走点位 2.库位 3.充电桩 --- 后续补充", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "类型所对应表id", example = "15418")
|
||||
private Long objectId;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.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 PositionMapLinePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "出发点id(点位子表id)", example = "20863")
|
||||
private Long startingPointId;
|
||||
|
||||
@Schema(description = "结束点id(点位子表id)", example = "15890")
|
||||
private Long endPointId;
|
||||
|
||||
@Schema(description = "行走方法 1.直线 2曲线")
|
||||
private Integer method;
|
||||
|
||||
@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.positionmap.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 PositionMapLineRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28062")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "出发点id(点位子表id)", example = "20863")
|
||||
@ExcelProperty("出发点id(点位子表id)")
|
||||
private Long startingPointId;
|
||||
|
||||
@Schema(description = "结束点id(点位子表id)", example = "15890")
|
||||
@ExcelProperty("结束点id(点位子表id)")
|
||||
private Long endPointId;
|
||||
|
||||
@Schema(description = "行走方法 1.直线 2曲线")
|
||||
@ExcelProperty("行走方法 1.直线 2曲线")
|
||||
private Integer method;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.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 PositionMapLineSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "28062")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "出发点id(点位子表id)", example = "20863")
|
||||
private Long startingPointId;
|
||||
|
||||
@Schema(description = "结束点id(点位子表id)", example = "15890")
|
||||
private Long endPointId;
|
||||
|
||||
@Schema(description = "行走方法 1.直线 2曲线")
|
||||
private Integer method;
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
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 PositionMapPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "楼层")
|
||||
private Integer floor;
|
||||
|
||||
@Schema(description = "区域")
|
||||
private String area;
|
||||
|
||||
@Schema(description = "AGV地图ymlJson信息")
|
||||
private String yamlJson;
|
||||
|
||||
@Schema(description = "AGV地图图片路径")
|
||||
private String pngUrl;
|
||||
|
||||
@Schema(description = "AGV地图yaml路径")
|
||||
private String yamlUrl;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 仓库点位地图 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class PositionMapRespVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2349")
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "楼层")
|
||||
@ExcelProperty("楼层")
|
||||
private Integer floor;
|
||||
|
||||
@Schema(description = "区域")
|
||||
@ExcelProperty("区域")
|
||||
private String area;
|
||||
|
||||
@Schema(description = "AGV地图ymlJson信息")
|
||||
@ExcelProperty("AGV地图ymlJson信息")
|
||||
private String yamlJson;
|
||||
|
||||
@Schema(description = "AGV地图图片路径")
|
||||
@ExcelProperty("AGV地图图片路径")
|
||||
private String pngUrl;
|
||||
|
||||
@Schema(description = "AGV地图yaml路径")
|
||||
@ExcelProperty("AGV地图yaml路径")
|
||||
private String yamlUrl;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.positionmap.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 仓库点位地图新增/修改 Request VO")
|
||||
@Data
|
||||
public class PositionMapSaveReqVO {
|
||||
|
||||
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2349")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "楼层")
|
||||
private Integer floor;
|
||||
|
||||
@Schema(description = "区域")
|
||||
private String area;
|
||||
|
||||
@Schema(description = "AGV地图ymlJson信息")
|
||||
private String yamlJson;
|
||||
|
||||
@Schema(description = "AGV地图图片路径")
|
||||
private String pngUrl;
|
||||
|
||||
@Schema(description = "AGV地图yaml路径")
|
||||
private String yamlUrl;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.positionmap;
|
||||
|
||||
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_position_map")
|
||||
@KeySequence("ware_position_map_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PositionMapDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 楼层
|
||||
*/
|
||||
private Integer floor;
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
private String area;
|
||||
/**
|
||||
* AGV地图ymlJson信息
|
||||
*/
|
||||
private String yamlJson;
|
||||
/**
|
||||
* AGV地图图片路径
|
||||
*/
|
||||
private String pngUrl;
|
||||
/**
|
||||
* AGV地图yaml路径
|
||||
*/
|
||||
private String yamlUrl;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.positionmap;
|
||||
|
||||
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_position_map_item")
|
||||
@KeySequence("ware_position_map_item_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PositionMapItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 仓库点位地图表id
|
||||
*/
|
||||
private Long positionMapId;
|
||||
/**
|
||||
* 坐标x轴
|
||||
*/
|
||||
private String locationX;
|
||||
/**
|
||||
* 坐标y轴
|
||||
*/
|
||||
private String locationY;
|
||||
/**
|
||||
* 类型 1.行走点位 2.库位 3.充电桩 --- 后续补充
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 类型所对应表id
|
||||
*/
|
||||
private Long objectId;
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.positionmap;
|
||||
|
||||
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_position_map_line")
|
||||
@KeySequence("ware_position_map_line_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PositionMapLineDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 出发点id(点位子表id)
|
||||
*/
|
||||
private Long startingPointId;
|
||||
/**
|
||||
* 结束点id(点位子表id)
|
||||
*/
|
||||
private Long endPointId;
|
||||
/**
|
||||
* 行走方法 1.直线 2曲线
|
||||
*/
|
||||
private Integer method;
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 仓库点位地图子表 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface PositionMapItemMapper extends BaseMapperX<PositionMapItemDO> {
|
||||
|
||||
default PageResult<PositionMapItemDO> selectPage(PositionMapItemPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PositionMapItemDO>()
|
||||
.eqIfPresent(PositionMapItemDO::getPositionMapId, reqVO.getPositionMapId())
|
||||
.eqIfPresent(PositionMapItemDO::getLocationX, reqVO.getLocationX())
|
||||
.eqIfPresent(PositionMapItemDO::getLocationY, reqVO.getLocationY())
|
||||
.eqIfPresent(PositionMapItemDO::getType, reqVO.getType())
|
||||
.eqIfPresent(PositionMapItemDO::getObjectId, reqVO.getObjectId())
|
||||
.betweenIfPresent(PositionMapItemDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PositionMapItemDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLinePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 仓库点位地图连线 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface PositionMapLineMapper extends BaseMapperX<PositionMapLineDO> {
|
||||
|
||||
default PageResult<PositionMapLineDO> selectPage(PositionMapLinePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PositionMapLineDO>()
|
||||
.eqIfPresent(PositionMapLineDO::getStartingPointId, reqVO.getStartingPointId())
|
||||
.eqIfPresent(PositionMapLineDO::getEndPointId, reqVO.getEndPointId())
|
||||
.eqIfPresent(PositionMapLineDO::getMethod, reqVO.getMethod())
|
||||
.betweenIfPresent(PositionMapLineDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PositionMapLineDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 仓库点位地图 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface PositionMapMapper extends BaseMapperX<PositionMapDO> {
|
||||
|
||||
default PageResult<PositionMapDO> selectPage(PositionMapPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PositionMapDO>()
|
||||
.eqIfPresent(PositionMapDO::getFloor, reqVO.getFloor())
|
||||
.eqIfPresent(PositionMapDO::getArea, reqVO.getArea())
|
||||
.eqIfPresent(PositionMapDO::getYamlJson, reqVO.getYamlJson())
|
||||
.eqIfPresent(PositionMapDO::getYamlUrl, reqVO.getYamlUrl())
|
||||
.eqIfPresent(PositionMapDO::getPngUrl, reqVO.getPngUrl())
|
||||
.betweenIfPresent(PositionMapDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PositionMapDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.service.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 仓库点位地图子表 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface PositionMapItemService {
|
||||
|
||||
/**
|
||||
* 创建仓库点位地图子表
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPositionMapItem(@Valid PositionMapItemSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新仓库点位地图子表
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePositionMapItem(@Valid PositionMapItemSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除仓库点位地图子表
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePositionMapItem(Long id);
|
||||
|
||||
/**
|
||||
* 获得仓库点位地图子表
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 仓库点位地图子表
|
||||
*/
|
||||
PositionMapItemDO getPositionMapItem(Long id);
|
||||
|
||||
/**
|
||||
* 获得仓库点位地图子表分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 仓库点位地图子表分页
|
||||
*/
|
||||
PageResult<PositionMapItemDO> getPositionMapItemPage(PositionMapItemPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.system.service.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapItemDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapItemMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 仓库点位地图子表 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PositionMapItemServiceImpl implements PositionMapItemService {
|
||||
|
||||
@Resource
|
||||
private PositionMapItemMapper positionMapItemMapper;
|
||||
|
||||
@Override
|
||||
public Long createPositionMapItem(PositionMapItemSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PositionMapItemDO positionMapItem = BeanUtils.toBean(createReqVO, PositionMapItemDO.class);
|
||||
positionMapItemMapper.insert(positionMapItem);
|
||||
// 返回
|
||||
return positionMapItem.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePositionMapItem(PositionMapItemSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
PositionMapItemDO updateObj = BeanUtils.toBean(updateReqVO, PositionMapItemDO.class);
|
||||
positionMapItemMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePositionMapItem(Long id) {
|
||||
// 删除
|
||||
positionMapItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionMapItemDO getPositionMapItem(Long id) {
|
||||
return positionMapItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PositionMapItemDO> getPositionMapItemPage(PositionMapItemPageReqVO pageReqVO) {
|
||||
return positionMapItemMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.service.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLinePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 仓库点位地图连线 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface PositionMapLineService {
|
||||
|
||||
/**
|
||||
* 创建仓库点位地图连线
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPositionMapLine(@Valid PositionMapLineSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新仓库点位地图连线
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePositionMapLine(@Valid PositionMapLineSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除仓库点位地图连线
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePositionMapLine(Long id);
|
||||
|
||||
/**
|
||||
* 获得仓库点位地图连线
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 仓库点位地图连线
|
||||
*/
|
||||
PositionMapLineDO getPositionMapLine(Long id);
|
||||
|
||||
/**
|
||||
* 获得仓库点位地图连线分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 仓库点位地图连线分页
|
||||
*/
|
||||
PageResult<PositionMapLineDO> getPositionMapLinePage(PositionMapLinePageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.system.service.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLinePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.positionmap.vo.PositionMapLineSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.positionmap.PositionMapLineDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapLineMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 仓库点位地图连线 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PositionMapLineServiceImpl implements PositionMapLineService {
|
||||
|
||||
@Resource
|
||||
private PositionMapLineMapper positionMapLineMapper;
|
||||
|
||||
@Override
|
||||
public Long createPositionMapLine(PositionMapLineSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PositionMapLineDO positionMapLine = BeanUtils.toBean(createReqVO, PositionMapLineDO.class);
|
||||
positionMapLineMapper.insert(positionMapLine);
|
||||
// 返回
|
||||
return positionMapLine.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePositionMapLine(PositionMapLineSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
PositionMapLineDO updateObj = BeanUtils.toBean(updateReqVO, PositionMapLineDO.class);
|
||||
positionMapLineMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePositionMapLine(Long id) {
|
||||
// 删除
|
||||
positionMapLineMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionMapLineDO getPositionMapLine(Long id) {
|
||||
return positionMapLineMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PositionMapLineDO> getPositionMapLinePage(PositionMapLinePageReqVO pageReqVO) {
|
||||
return positionMapLineMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package cn.iocoder.yudao.module.system.service.positionmap;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
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.positionmap.PositionMapDO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 仓库点位地图 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface PositionMapService extends IService<PositionMapDO> {
|
||||
|
||||
/**
|
||||
* 创建仓库点位地图
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPositionMap(@Valid PositionMapSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新仓库点位地图
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePositionMap(@Valid PositionMapSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除仓库点位地图
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePositionMap(Long id);
|
||||
|
||||
/**
|
||||
* 获得仓库点位地图
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 仓库点位地图
|
||||
*/
|
||||
PositionMapDO getPositionMap(Long id);
|
||||
|
||||
/**
|
||||
* 获得仓库点位地图分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 仓库点位地图分页
|
||||
*/
|
||||
PageResult<PositionMapDO> getPositionMapPage(PositionMapPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* AGV文件上传
|
||||
*
|
||||
* @param files
|
||||
*/
|
||||
void uploadFiles(MultipartFile[] files);
|
||||
|
||||
/**
|
||||
* 文件下载 - 指定地图文件
|
||||
*
|
||||
* @param floor
|
||||
* @param area
|
||||
* @param response
|
||||
*/
|
||||
void downloadFile(Integer floor, String area, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* AGV文件下载 - 所有地图文件
|
||||
*
|
||||
* @param response
|
||||
* @throws IOException
|
||||
*/
|
||||
void downloadFile(HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 前端下载图片信息
|
||||
*
|
||||
* @param floor
|
||||
* @param area
|
||||
* @param response
|
||||
*/
|
||||
void downloadPng(Integer floor, String area, HttpServletResponse response) throws IOException;
|
||||
}
|
@ -0,0 +1,287 @@
|
||||
package cn.iocoder.yudao.module.system.service.positionmap;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
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.positionmap.PositionMapDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.positionmap.PositionMapMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 仓库点位地图 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PositionMapServiceImpl extends ServiceImpl<PositionMapMapper, PositionMapDO> implements PositionMapService {
|
||||
|
||||
@Autowired
|
||||
private PositionMapMapper positionMapMapper;
|
||||
@Value("${map.file.upload-path}")
|
||||
private String UPLOAD_DIR;
|
||||
|
||||
@Override
|
||||
public Long createPositionMap(PositionMapSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
PositionMapDO positionMap = BeanUtils.toBean(createReqVO, PositionMapDO.class);
|
||||
positionMapMapper.insert(positionMap);
|
||||
// 返回
|
||||
return positionMap.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePositionMap(PositionMapSaveReqVO updateReqVO) {
|
||||
// 更新
|
||||
PositionMapDO updateObj = BeanUtils.toBean(updateReqVO, PositionMapDO.class);
|
||||
positionMapMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePositionMap(Long id) {
|
||||
// 删除
|
||||
positionMapMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PositionMapDO getPositionMap(Long id) {
|
||||
return positionMapMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PositionMapDO> getPositionMapPage(PositionMapPageReqVO pageReqVO) {
|
||||
return positionMapMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void uploadFiles(MultipartFile[] files) {
|
||||
if (files == null || files.length < 2) {
|
||||
throw exception(PLEASE_UPLOAD_PNG_AND_YAML_FILES);
|
||||
}
|
||||
MultipartFile yamlFile = null;
|
||||
MultipartFile pngFile = null;
|
||||
// 分类文件
|
||||
for (MultipartFile file : files) {
|
||||
if (Objects.requireNonNull(file.getOriginalFilename()).toLowerCase().endsWith(".yaml")) {
|
||||
yamlFile = file;
|
||||
} else if (Objects.requireNonNull(file.getOriginalFilename()).toLowerCase().endsWith(".png")) {
|
||||
pngFile = file;
|
||||
}
|
||||
}
|
||||
if (yamlFile == null || pngFile == null || yamlFile.isEmpty() || pngFile.isEmpty()) {
|
||||
throw exception(PLEASE_UPLOAD_PNG_AND_YAML_FILES);
|
||||
}
|
||||
// 处理 YAML 文件 - 返回yaml中存储的楼层信息 作为png文件存储的目录
|
||||
String url = null;
|
||||
String yamlJson = null;
|
||||
String yamlUrl = null;
|
||||
String pngUrl = null;
|
||||
Integer floorInt = null;
|
||||
String areaStr = null;
|
||||
try {
|
||||
// Get the file and save it somewhere
|
||||
byte[] bytes = yamlFile.getBytes();
|
||||
// Parse the YAML file
|
||||
Yaml yaml = new Yaml();
|
||||
Map<String, Object> data = yaml.load(new String(bytes));
|
||||
Object floor = data.get("floor");
|
||||
Object area = data.get("area");
|
||||
// -- 根据楼和区域查询是否有存在地图信息 - 如果有存在则替换 - 并且通知所有该楼该区域的AGV
|
||||
if (ObjUtil.isEmpty(floor) || ObjUtil.isEmpty(area)) {
|
||||
throw exception(AGV_UPLOAD_INFORMATION_DOES_NOT_INCLUDE_FLOOR_OR_AREA_INFORMATION);
|
||||
}
|
||||
floorInt = Integer.parseInt(Objects.requireNonNull(floor).toString());
|
||||
areaStr = Objects.requireNonNull(area).toString();
|
||||
url = UPLOAD_DIR + floor + "/" + area + "/";
|
||||
// 判断目录是否存在 - 如果不存在则创建目录
|
||||
File directory = new File(url);
|
||||
if (!directory.exists()) {
|
||||
directory.mkdirs();
|
||||
}
|
||||
yamlUrl = url + yamlFile.getOriginalFilename();
|
||||
Path path = Paths.get(yamlUrl);
|
||||
Files.write(path, bytes);
|
||||
// Convert the YAML data to JSON
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
yamlJson = objectMapper.writeValueAsString(data);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("Failed to upload '{}'", e);
|
||||
return;
|
||||
}
|
||||
|
||||
// 处理 PNG 文件
|
||||
try {
|
||||
pngUrl = url + pngFile.getOriginalFilename();
|
||||
byte[] bytes = pngFile.getBytes();
|
||||
Path path = Paths.get(pngUrl);
|
||||
Files.write(path, bytes);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
PositionMapDO positionMap = positionMapMapper.selectOne(new LambdaQueryWrapperX<PositionMapDO>()
|
||||
.eq(PositionMapDO::getFloor, floorInt)
|
||||
.eq(PositionMapDO::getArea, areaStr));
|
||||
if (positionMap != null) {
|
||||
positionMapMapper.updateById(positionMap.setYamlJson(yamlJson).setPngUrl(pngUrl).setYamlUrl(yamlUrl));
|
||||
|
||||
// todo 异步通知所有该楼层区域内所有AGV车地图有更改 - 这个时候AGV应当重新获取地图信息
|
||||
} else {
|
||||
positionMap = new PositionMapDO().setFloor(floorInt).setArea(areaStr)
|
||||
.setYamlJson(yamlJson).setPngUrl(pngUrl).setYamlUrl(yamlUrl);
|
||||
positionMapMapper.insert(positionMap);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadFile(Integer floor, String area, HttpServletResponse response) throws IOException {
|
||||
PositionMapDO positionMapDO = positionMapMapper.selectOne(new LambdaQueryWrapperX<PositionMapDO>()
|
||||
.eq(PositionMapDO::getFloor, floor)
|
||||
.eq(PositionMapDO::getArea, area));
|
||||
if (positionMapDO == null) {
|
||||
throw exception(AGV_MAP_NOT_FOUND);
|
||||
}
|
||||
|
||||
// 假设文件存储路径,根据实际情况修改
|
||||
String basePath = UPLOAD_DIR + floor + "/" + area + "/";
|
||||
List<File> filesToZip = findFilesByFloorAndArea(basePath);
|
||||
|
||||
if (filesToZip.isEmpty()) {
|
||||
response.sendError(HttpStatus.NOT_FOUND.value(), "No files found for the given floor and area.");
|
||||
return;
|
||||
}
|
||||
|
||||
response.setContentType("application/zip");
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"files.zip\"");
|
||||
|
||||
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream())) {
|
||||
for (File file : filesToZip) {
|
||||
ZipEntry zipEntry = new ZipEntry(file.getName());
|
||||
zipOut.putNextEntry(zipEntry);
|
||||
try (FileInputStream fileIn = new FileInputStream(file)) {
|
||||
IOUtils.copy(fileIn, zipOut);
|
||||
}
|
||||
zipOut.closeEntry();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<File> findFilesByFloorAndArea(String basePath) {
|
||||
List<File> foundFiles = new ArrayList<>();
|
||||
File directory = new File(basePath);
|
||||
if (directory.exists() && directory.isDirectory()) {
|
||||
File[] files = directory.listFiles();
|
||||
if (files != null) {
|
||||
foundFiles.addAll(Arrays.asList(files));
|
||||
}
|
||||
}
|
||||
return foundFiles;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void downloadFile(HttpServletResponse response) throws IOException {
|
||||
// 指定要压缩的文件夹路径
|
||||
Path folderPath = Paths.get(UPLOAD_DIR);
|
||||
|
||||
if (!Files.exists(folderPath) || !Files.isDirectory(folderPath)) {
|
||||
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Folder not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置响应头
|
||||
response.setContentType("application/zip");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=project.zip");
|
||||
|
||||
// 压缩文件夹并写入响应体
|
||||
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream())) {
|
||||
addFolderToZip(folderPath.toFile(), folderPath.toString(), zipOut);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void addFolderToZip(File folder, String baseFolder, ZipOutputStream zipOut) throws IOException {
|
||||
File[] files = folder.listFiles();
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
if (file.isDirectory()) {
|
||||
addFolderToZip(file, baseFolder, zipOut);
|
||||
continue;
|
||||
}
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
ZipEntry zipEntry = new ZipEntry(file.getAbsolutePath().substring(baseFolder.length() + 1));
|
||||
zipOut.putNextEntry(zipEntry);
|
||||
|
||||
byte[] bytes = new byte[1024];
|
||||
int length;
|
||||
while ((length = fis.read(bytes)) >= 0) {
|
||||
zipOut.write(bytes, 0, length);
|
||||
}
|
||||
fis.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void downloadPng(Integer floor, String area, HttpServletResponse response) throws IOException {
|
||||
// 根据楼层和区域查找对应的PNG文件路径
|
||||
String basePath = UPLOAD_DIR + floor + "/" + area + "/";
|
||||
File directory = new File(basePath);
|
||||
if (!directory.exists() || !directory.isDirectory()) {
|
||||
response.sendError(HttpStatus.NOT_FOUND.value(), "Directory not found for the given floor and area.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 查找PNG文件
|
||||
File pngFile = null;
|
||||
File[] files = directory.listFiles((dir, name) -> name.toLowerCase().endsWith(".png"));
|
||||
if (files != null && files.length > 0) {
|
||||
pngFile = files[0]; // 假设每个目录下只有一个PNG文件
|
||||
}
|
||||
|
||||
if (pngFile == null || !pngFile.exists()) {
|
||||
response.sendError(HttpStatus.NOT_FOUND.value(), "PNG file not found for the given floor and area.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置响应头以指示浏览器下载文件
|
||||
response.setContentType("image/png");
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + pngFile.getName() + "\"");
|
||||
|
||||
// 将PNG文件写入HTTP响应输出流
|
||||
try (FileInputStream fis = new FileInputStream(pngFile)) {
|
||||
IOUtils.copy(fis, response.getOutputStream());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -57,23 +57,23 @@ spring:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
url: jdbc:mysql://47.97.8.94:3306/zn_wcs?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
|
||||
# url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
|
||||
# url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
|
||||
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
|
||||
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro # SQLServer 连接的示例
|
||||
# url: jdbc:dm://10.211.55.4:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
|
||||
username: root
|
||||
password: 123456
|
||||
password: yhtkj@2024!
|
||||
# username: sa # SQL Server 连接的示例
|
||||
# password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W # SQL Server 连接的示例
|
||||
# username: SYSDBA # DM 连接的示例
|
||||
# password: SYSDBA # DM 连接的示例
|
||||
slave: # 模拟从库,可根据自己需要修改
|
||||
lazy: true # 开启懒加载,保证启动速度
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
url: jdbc:mysql://47.97.8.94:3306/zn_wcs?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: 123456
|
||||
password: yhtkj@2024!
|
||||
|
||||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||||
redis:
|
||||
@ -212,3 +212,6 @@ justauth:
|
||||
type: REDIS
|
||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||
map:
|
||||
file:
|
||||
upload-path: /Users/aikai/Documents/map/ # 地图文件上传路径
|
||||
|
@ -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.positionmap.PositionMapItemMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -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.positionmap.PositionMapLineMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
@ -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.positionmap.PositionMapMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user