|
@@ -39,7 +39,7 @@ import java.util.List;
|
|
@Validated
|
|
@Validated
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/als/aircraft" )
|
|
|
|
|
|
+@RequestMapping("/als/aircraft")
|
|
public class AircraftController extends BaseController {
|
|
public class AircraftController extends BaseController {
|
|
@Resource
|
|
@Resource
|
|
private IAircraftService aircraftService;
|
|
private IAircraftService aircraftService;
|
|
@@ -47,8 +47,8 @@ public class AircraftController extends BaseController {
|
|
/**
|
|
/**
|
|
* 查询机型机号列表
|
|
* 查询机型机号列表
|
|
*/
|
|
*/
|
|
- @SaCheckPermission("als:aircraft:list" )
|
|
|
|
- @GetMapping("/list" )
|
|
|
|
|
|
+ @SaCheckPermission("als:aircraft:list")
|
|
|
|
+ @GetMapping("/list")
|
|
public CommonResult<List<AircraftVo>> list(AircraftBo aircraftBo) {
|
|
public CommonResult<List<AircraftVo>> list(AircraftBo aircraftBo) {
|
|
List<AircraftVo> list = aircraftService.selectList(aircraftBo);
|
|
List<AircraftVo> list = aircraftService.selectList(aircraftBo);
|
|
return CommonResult.success(list);
|
|
return CommonResult.success(list);
|
|
@@ -57,28 +57,28 @@ public class AircraftController extends BaseController {
|
|
/**
|
|
/**
|
|
* 导出机型机号列表
|
|
* 导出机型机号列表
|
|
*/
|
|
*/
|
|
- @SaCheckPermission("als:aircraft:export" )
|
|
|
|
- @Log(title = "机型机号" , businessType = BusinessType.EXPORT)
|
|
|
|
- @PostMapping("/export" )
|
|
|
|
- public CommonResult<Void> export(HttpServletResponse response, AircraftBo aircraftBo) {
|
|
|
|
|
|
+ @SaCheckPermission("als:aircraft:export")
|
|
|
|
+ @Log(title = "机型机号", businessType = BusinessType.EXPORT)
|
|
|
|
+ @PostMapping("/export")
|
|
|
|
+ public CommonResult<Void> export(AircraftBo aircraftBo) {
|
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
|
List<AircraftVo> list = aircraftService.selectList(aircraftBo);
|
|
List<AircraftVo> list = aircraftService.selectList(aircraftBo);
|
|
- aircraftService.asyncExport(list, "机型机号" , loginUser);
|
|
|
|
|
|
+ aircraftService.asyncExport(list, "机型机号", loginUser);
|
|
return CommonResult.success();
|
|
return CommonResult.success();
|
|
}
|
|
}
|
|
|
|
|
|
- @SaCheckPermission("als:aircraft:import" )
|
|
|
|
- @PostMapping("/importTemplate" )
|
|
|
|
|
|
+ @SaCheckPermission("als:aircraft:import")
|
|
|
|
+ @PostMapping("/importTemplate")
|
|
public void importTemplate(HttpServletResponse response) {
|
|
public void importTemplate(HttpServletResponse response) {
|
|
- ExcelUtil.exportExcel(new ArrayList<>(), "机型机号" , AircraftImportVo.class, response);
|
|
|
|
|
|
+ ExcelUtil.exportExcel(new ArrayList<>(), "机型机号", AircraftImportVo.class, response);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 导入机型机号列表
|
|
* 导入机型机号列表
|
|
*/
|
|
*/
|
|
- @Log(title = "机型机号" , businessType = BusinessType.IMPORT)
|
|
|
|
- @SaCheckPermission("als:aircraft:import" )
|
|
|
|
- @PostMapping("/importData" )
|
|
|
|
|
|
+ @Log(title = "机型机号", businessType = BusinessType.IMPORT)
|
|
|
|
+ @SaCheckPermission("als:aircraft:import")
|
|
|
|
+ @PostMapping("/importData")
|
|
public CommonResult<Void> importData(MultipartFile file, boolean updateSupport) {
|
|
public CommonResult<Void> importData(MultipartFile file, boolean updateSupport) {
|
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
|
aircraftService.asyncImportData(file, updateSupport, loginUser);
|
|
aircraftService.asyncImportData(file, updateSupport, loginUser);
|
|
@@ -88,8 +88,8 @@ public class AircraftController extends BaseController {
|
|
/**
|
|
/**
|
|
* 获取机型机号详细信息
|
|
* 获取机型机号详细信息
|
|
*/
|
|
*/
|
|
- @SaCheckPermission("als:aircraft:query" )
|
|
|
|
- @GetMapping(value = "/{id}" )
|
|
|
|
|
|
+ @SaCheckPermission("als:aircraft:query")
|
|
|
|
+ @GetMapping(value = "/{id}")
|
|
public CommonResult<AircraftVo> getInfo(@PathVariable Long id) {
|
|
public CommonResult<AircraftVo> getInfo(@PathVariable Long id) {
|
|
return CommonResult.success(aircraftService.selectById(id));
|
|
return CommonResult.success(aircraftService.selectById(id));
|
|
}
|
|
}
|
|
@@ -97,14 +97,14 @@ public class AircraftController extends BaseController {
|
|
/**
|
|
/**
|
|
* 新增机型机号
|
|
* 新增机型机号
|
|
*/
|
|
*/
|
|
- @SaCheckPermission("als:aircraft:add" )
|
|
|
|
- @Log(title = "机型机号" , businessType = BusinessType.INSERT)
|
|
|
|
|
|
+ @SaCheckPermission("als:aircraft:add")
|
|
|
|
+ @Log(title = "机型机号", businessType = BusinessType.INSERT)
|
|
@RepeatSubmit()
|
|
@RepeatSubmit()
|
|
@PostMapping
|
|
@PostMapping
|
|
public CommonResult<Void> add(@Validated @RequestBody AircraftBo aircraftBo) {
|
|
public CommonResult<Void> add(@Validated @RequestBody AircraftBo aircraftBo) {
|
|
boolean inserted = aircraftService.insert(aircraftBo);
|
|
boolean inserted = aircraftService.insert(aircraftBo);
|
|
if (!inserted) {
|
|
if (!inserted) {
|
|
- return CommonResult.fail("新增机型机号记录失败!" );
|
|
|
|
|
|
+ return CommonResult.fail("新增机型机号记录失败!");
|
|
}
|
|
}
|
|
return CommonResult.success();
|
|
return CommonResult.success();
|
|
}
|
|
}
|
|
@@ -112,14 +112,14 @@ public class AircraftController extends BaseController {
|
|
/**
|
|
/**
|
|
* 修改机型机号
|
|
* 修改机型机号
|
|
*/
|
|
*/
|
|
- @SaCheckPermission("als:aircraft:edit" )
|
|
|
|
- @Log(title = "机型机号" , businessType = BusinessType.UPDATE)
|
|
|
|
|
|
+ @SaCheckPermission("als:aircraft:edit")
|
|
|
|
+ @Log(title = "机型机号", businessType = BusinessType.UPDATE)
|
|
@RepeatSubmit()
|
|
@RepeatSubmit()
|
|
@PutMapping
|
|
@PutMapping
|
|
public CommonResult<Void> edit(@Validated @RequestBody AircraftBo aircraftBo) {
|
|
public CommonResult<Void> edit(@Validated @RequestBody AircraftBo aircraftBo) {
|
|
boolean updated = aircraftService.update(aircraftBo);
|
|
boolean updated = aircraftService.update(aircraftBo);
|
|
if (!updated) {
|
|
if (!updated) {
|
|
- return CommonResult.fail("修改机型机号记录失败!" );
|
|
|
|
|
|
+ return CommonResult.fail("修改机型机号记录失败!");
|
|
}
|
|
}
|
|
return CommonResult.success();
|
|
return CommonResult.success();
|
|
}
|
|
}
|
|
@@ -127,13 +127,13 @@ public class AircraftController extends BaseController {
|
|
/**
|
|
/**
|
|
* 删除机型机号
|
|
* 删除机型机号
|
|
*/
|
|
*/
|
|
- @SaCheckPermission("als:aircraft:remove" )
|
|
|
|
- @Log(title = "机型机号" , businessType = BusinessType.DELETE)
|
|
|
|
- @DeleteMapping("/{ids}" )
|
|
|
|
|
|
+ @SaCheckPermission("als:aircraft:remove")
|
|
|
|
+ @Log(title = "机型机号", businessType = BusinessType.DELETE)
|
|
|
|
+ @DeleteMapping("/{ids}")
|
|
public CommonResult<Void> remove(@PathVariable Long[] ids) {
|
|
public CommonResult<Void> remove(@PathVariable Long[] ids) {
|
|
boolean deleted = aircraftService.deleteByIds(ids);
|
|
boolean deleted = aircraftService.deleteByIds(ids);
|
|
if (!deleted) {
|
|
if (!deleted) {
|
|
- return CommonResult.fail("删除机型机号记录失败!" );
|
|
|
|
|
|
+ return CommonResult.fail("删除机型机号记录失败!");
|
|
}
|
|
}
|
|
return CommonResult.success();
|
|
return CommonResult.success();
|
|
}
|
|
}
|