2026-01-23 18:42:11 +08:00
|
|
|
|
package com.ruoyi.airline.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.ruoyi.airline.api.domain.AirlineFileVO;
|
|
|
|
|
|
import com.ruoyi.airline.controller.convert.AirlineFileControllerConvert;
|
|
|
|
|
|
import com.ruoyi.airline.service.api.IAirlineFileService;
|
|
|
|
|
|
import com.ruoyi.airline.service.dto.AirlineFileDTO;
|
|
|
|
|
|
import com.ruoyi.common.core.exception.base.BaseException;
|
|
|
|
|
|
import com.ruoyi.common.core.web.controller.BaseController;
|
|
|
|
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
2026-01-24 11:29:55 +08:00
|
|
|
|
import com.ruoyi.common.log.annotation.Log;
|
|
|
|
|
|
import com.ruoyi.common.log.enums.BusinessType;
|
2026-01-24 16:17:41 +08:00
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
2026-01-24 11:29:55 +08:00
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
2026-01-23 18:42:11 +08:00
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 航线文件Controller
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
|
* @date 2026-01-17
|
|
|
|
|
|
*/
|
|
|
|
|
|
@RestController
|
2026-01-26 16:37:58 +08:00
|
|
|
|
@RequestMapping("/file")
|
2026-01-24 11:29:55 +08:00
|
|
|
|
@Tag(name = "航线管理")
|
2026-01-23 18:42:11 +08:00
|
|
|
|
public class AirlineFileController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(AirlineFileController.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
private IAirlineFileService airlineFileService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 编辑航线文件信息
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param entity 实体对象
|
|
|
|
|
|
* @return
|
|
|
|
|
|
*/
|
2026-01-24 16:17:41 +08:00
|
|
|
|
// @RequiresPermissions("airline:file:edit")
|
2026-01-24 11:29:55 +08:00
|
|
|
|
@Log(title = "修改航线属性", businessType = BusinessType.UPDATE)
|
2026-01-23 18:42:11 +08:00
|
|
|
|
@PutMapping("/edit")
|
2026-01-28 09:11:59 +08:00
|
|
|
|
@Operation(summary = "编辑航线文件描述信息")
|
2026-01-23 18:42:11 +08:00
|
|
|
|
public AjaxResult edit(@RequestBody AirlineFileVO entity) {
|
2026-01-28 20:15:05 +08:00
|
|
|
|
AirlineFileDTO dto = AirlineFileControllerConvert.to(entity);
|
2026-01-23 18:42:11 +08:00
|
|
|
|
return success(airlineFileService.save(dto));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 长江口
|
|
|
|
|
|
* <p>
|
|
|
|
|
|
* kmz类似zip,一般情况下内部包含kml和wpml两个文件
|
|
|
|
|
|
*
|
|
|
|
|
|
* @param vo
|
|
|
|
|
|
*/
|
2026-01-24 16:17:41 +08:00
|
|
|
|
// @RequiresPermissions("airline:file:parseAndUpload")
|
2026-01-24 11:29:55 +08:00
|
|
|
|
@Log(title = "创建航线", businessType = BusinessType.UPDATE)
|
2026-01-24 16:17:41 +08:00
|
|
|
|
@PostMapping("/createOrUpdate")
|
2026-01-28 09:11:59 +08:00
|
|
|
|
@Operation(summary = "编辑航线文件内容,生产航点新文件")
|
2026-01-24 11:29:55 +08:00
|
|
|
|
public AjaxResult createOrUpdate(@RequestBody AirlineFileVO vo) {
|
2026-01-28 20:15:05 +08:00
|
|
|
|
AirlineFileDTO airlineFile = AirlineFileControllerConvert.to(vo);
|
2026-01-23 18:42:11 +08:00
|
|
|
|
try {
|
|
|
|
|
|
return success(airlineFileService.createOrupdate(airlineFile));
|
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
|
throw new BaseException("更新航线失败", e.getMessage());
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|