13693261870
2025-07-02 6708810c4de34dfb9513061432d656f91d56ee3a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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));
    }
 
}