| | |
| | | @RequestParam String workspaceId, |
| | | @RequestParam(name = "dkbh", defaultValue = "") String dkbh, |
| | | @RequestParam(name = "isPlan", required = false) Integer isPlan, |
| | | @RequestParam(name = "xzqdm", defaultValue = "") String xzqdm |
| | | @RequestParam(name = "xzqdm", defaultValue = "") String xzqdm, |
| | | @RequestParam(name="bsm",defaultValue = "")String bsm |
| | | ) { |
| | | //调用service分页查询 |
| | | PatchesParam param = PatchesParam.builder() |
| | |
| | | .dkbh(dkbh) |
| | | .isPlan(isPlan) |
| | | .xzqdm(xzqdm) |
| | | .bsm(bsm) |
| | | .build(); |
| | | PaginationData<LotInfo> data = getPatchesService.limitGet(param); |
| | | return ResponseResult.success(data); |
| | |
| | | private Integer isPlan; |
| | | |
| | | private String xzqdm; |
| | | |
| | | private String bsm; |
| | | } |
| | |
| | | .eq(LotInfo::getWorkspaceId, param.getWorkspaceId()) |
| | | .like(LotInfo::getDkbh, param.getDkbh()) |
| | | .like(LotInfo::getXzqdm, param.getXzqdm()) |
| | | .like(LotInfo::getBsm,param.getBsm()) |
| | | .eq(LotInfo::getIsPlan, param.getIsPlan())); |
| | | List<LotInfo> records = page.getRecords() |
| | | .stream() |
| | |
| | | new LambdaQueryWrapper<LotInfo>() |
| | | .eq(LotInfo::getWorkspaceId, param.getWorkspaceId()) |
| | | .like(LotInfo::getDkbh, param.getDkbh()) |
| | | .like(LotInfo::getBsm,param.getBsm()) |
| | | .like(LotInfo::getXzqdm, param.getXzqdm())); |
| | | List<LotInfo> records = page.getRecords() |
| | | .stream() |
| | |
| | | * @return |
| | | */ |
| | | public String backWayline(MultipartFile multipartFile, String waylineName, String workspaceId, String username) { |
| | | waylineFileService.importKmzFile(multipartFile, workspaceId, username); |
| | | waylineFileService.importKmzFileBack(multipartFile, workspaceId, username); |
| | | WaylineFileEntity entity = waylineFileService.selectByName(waylineName); |
| | | try { |
| | | waylineFileService.getObjectUrl(workspaceId, entity.getWaylineId()); |
| | |
| | | g2d.setComposite(alphaComposite); |
| | | String extraInfo = String.format("Lon:%.7f Lat:%.7f\n%s %s", lng, lat, angel, sd); |
| | | |
| | | File fontFile = new File("src/main/java/com/dji/sample/territory/utils/MiSans-Normal.ttf"); // 替换为你的字体文件路径 |
| | | File fontFile = new File("/usr/share/fonts/MiSans-Normal.ttf"); // 替换为你的字体文件路径 |
| | | Font customFont = Font.createFont(Font.TRUETYPE_FONT, fontFile).deriveFont(36.00F); |
| | | // 注册字体 |
| | | GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); |
| | |
| | | */ |
| | | @PostMapping("/{workspace_id}/waylines/file/upload") |
| | | @SysLogAnnotation(operModul = "航线库", operType = "上传", operDesc = "上传kmz航线文件") |
| | | public ResponseResult importKmzFile(@PathVariable(name = "workspace_id") String workspaceId,HttpServletRequest request, MultipartFile file) { |
| | | public ResponseResult importKmzFile(@PathVariable(name = "workspace_id") String workspaceId, |
| | | HttpServletRequest request, MultipartFile file, |
| | | @RequestParam String patchesId) { |
| | | if (Objects.isNull(file)) { |
| | | return ResponseResult.error("未上传文件"); |
| | | } |
| | | CustomClaim customClaim = (CustomClaim)request.getAttribute(TOKEN_CLAIM); |
| | | String creator = customClaim.getUsername(); |
| | | waylineFileService.importKmzFile(file, workspaceId, creator); |
| | | waylineFileService.importKmzFile(file, workspaceId, creator,patchesId); |
| | | return ResponseResult.success(); |
| | | } |
| | | |
| | |
| | | private String username; |
| | | |
| | | private Long updateTime; |
| | | |
| | | private String patchesId; |
| | | } |
| | |
| | | @TableField("user_name") |
| | | private String username; |
| | | |
| | | @TableField("patches_id") |
| | | private String patchesId; |
| | | |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private Long createTime; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | Integer saveWaylineFile(String workspaceId, WaylineFileDTO metadata); |
| | | |
| | | Integer saveWaylineFiles(String workspaceId, WaylineFileDTO metadata,String patchesId); |
| | | /** |
| | | * Updates whether the file is collected or not based on the passed parameters. |
| | | * @param workspaceId |
| | |
| | | * @param creator |
| | | * @return |
| | | */ |
| | | void importKmzFile(MultipartFile file, String workspaceId, String creator); |
| | | void importKmzFile(MultipartFile file, String workspaceId, String creator,String patchesId); |
| | | |
| | | WaylineFileDTO importKmzFileBack (MultipartFile file, String workspaceId, String creator); |
| | | WaylineFileEntity selectByName(String name); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer saveWaylineFiles(String workspaceId, WaylineFileDTO metadata, String patchesId) { |
| | | metadata.setPatchesId(patchesId); |
| | | WaylineFileEntity file = this.dtoConvertToEntity(metadata); |
| | | file.setWaylineId(UUID.randomUUID().toString()); |
| | | file.setWorkspaceId(workspaceId); |
| | | |
| | | if (!StringUtils.hasText(file.getSign())) { |
| | | try (InputStream object = ossService.getObject(OssConfiguration.bucket, metadata.getObjectKey())) { |
| | | if (object.available() == 0) { |
| | | throw new RuntimeException("文件" + metadata.getObjectKey() + |
| | | " 在空间中不存在[" + OssConfiguration.bucket + "]."); |
| | | } |
| | | file.setSign(DigestUtils.md5DigestAsHex(object)); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | int insertId = mapper.insert(file); |
| | | return insertId > 0 ? file.getId() : insertId; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean markFavorite(String workspaceId, List<String> waylineIds, Boolean isFavorite) { |
| | | if (waylineIds.isEmpty()) { |
| | | return false; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void importKmzFile(MultipartFile file, String workspaceId, String creator) { |
| | | public void importKmzFile(MultipartFile file, String workspaceId, String creator,String patchesId) { |
| | | Optional<WaylineFileDTO> waylineFileOpt = validKmzFile(file); |
| | | if (waylineFileOpt.isEmpty()) { |
| | | throw new RuntimeException("文件格式错误"); |
| | |
| | | waylineFile.setUsername(creator); |
| | | |
| | | ossService.putObject(OssConfiguration.bucket, waylineFile.getObjectKey(), file.getInputStream()); |
| | | this.saveWaylineFile(workspaceId, waylineFile); |
| | | this.saveWaylineFiles(workspaceId, waylineFile,patchesId); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | .droneModelKey(entity.getDroneModelKey()) |
| | | .favorited(entity.getFavorited()) |
| | | .name(entity.getName()) |
| | | .patchesId(entity.getPatchesId()) |
| | | .payloadModelKeys(entity.getPayloadModelKeys() != null ? |
| | | Arrays.asList(entity.getPayloadModelKeys().split(",")) : null) |
| | | .templateTypes(Arrays.stream(entity.getTemplateTypes().split(",")) |
| | |
| | | .collect(Collectors.joining(","))) |
| | | .favorited(file.getFavorited()) |
| | | .sign(file.getSign()) |
| | | .patchesId(file.getPatchesId()) |
| | | .build(); |
| | | } |
| | | |