package com.ruoyi.web.controller.manage;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.page.TableDataInfo;
|
import com.ruoyi.manage.domain.DpShips;
|
import com.ruoyi.manage.domain.vo.ShipTypeVO;
|
import com.ruoyi.manage.domain.vo.Tree;
|
import com.ruoyi.manage.service.DpShipsService;
|
import io.swagger.v3.oas.annotations.Hidden;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import jakarta.annotation.Resource;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* <p>
|
* 舰船表 前端控制器
|
* </p>
|
*
|
* @author zhangyy
|
* @since 2025-03-11
|
*/
|
@Tag(name = "大屏--舰船数据管理")
|
@RestController
|
@RequestMapping("/dp/dpShips")
|
public class DpShipsController {
|
|
@Resource
|
private DpShipsService dpShipsService;
|
|
@Operation(summary = "新增舰船数据")
|
@PostMapping("/insertDpShip")
|
public R<Boolean> insertDpShip(@RequestBody DpShips dpShips) {
|
return R.ok(dpShipsService.save(dpShips));
|
}
|
|
@Operation(summary = "更新舰船数据")
|
@PostMapping("/updateDpShip")
|
public R<Boolean> updateDpShip(@RequestBody DpShips dpShips) {
|
return R.ok(dpShipsService.updateById(dpShips));
|
}
|
|
@Operation(summary = "删除舰船数据")
|
@GetMapping("/deleteDpShip")
|
public R<Boolean> deleteDpShip( String id) {
|
return R.ok(dpShipsService.removeById(id));
|
}
|
|
|
@Operation(summary = "获取舰船ById")
|
@GetMapping("/{id}")
|
public R<DpShips> getDpShipsById(@PathVariable String id) {
|
return R.ok(dpShipsService.getDpShipsById(id));
|
}
|
|
@Operation(summary = "获取舰船数据列表")
|
@GetMapping("/getDpShips")
|
public R<List<DpShips>> getDpShips() {
|
return R.ok(dpShipsService.list());
|
}
|
|
@Operation(summary = "获取舰船分页据列表")
|
@GetMapping("/list")
|
public TableDataInfo list(DpShips ships) {
|
return dpShipsService.getPageList(ships);
|
}
|
|
|
@Operation(summary = "根据码头ID查询船舰类型")
|
@PostMapping("/getDpShipTypeByWhId")
|
public R<List<ShipTypeVO>> getDpShipTypeByWhId(@Parameter(description = "码头ID", required = true) Integer whId) {
|
return R.ok(dpShipsService.getDpShipTypeByWhId(whId));
|
}
|
|
@Operation(summary = "(新)根据码头ID查询船舰类型")
|
@PostMapping("/getDpShipTypeByWhIdNEW")
|
public R<List<ShipTypeVO>> getDpShipTypeByWhIdNEW(@Parameter(description = "码头ID", required = true) Integer whId) {
|
return R.ok(dpShipsService.getDpShipTypeByWhIdNEW(whId));
|
}
|
|
@Operation(summary = "根据码头ID和舰船类型查询舰船列表")
|
@PostMapping("/getDpShipsByWhIdType")
|
public AjaxResult getDpShipsByWhIdType(@Parameter(description = "码头ID", required = true) Integer whId,
|
@Parameter(description = "船舰类型ID", required = true) String shipType) {
|
return AjaxResult.success(dpShipsService.getDpShipsByWhIdType(whId,shipType));
|
}
|
|
@Operation(summary = "(新)根据码头ID和舰船类型数组查询列表")
|
@PostMapping("/getDpShipsByWhIdTypeNEW")
|
public AjaxResult getDpShipsByWhIdTypeNEW(@Parameter(description = "码头ID", required = true) Integer whId,
|
@RequestBody List<Integer> shipTypes) {
|
return AjaxResult.success(dpShipsService.getDpShipsByWhIdTypeNEW(whId,shipTypes));
|
}
|
|
}
|