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
103
104
105
106
107
108
109
110
111
112
113
package com.ruoyi.web.controller.manage;
 
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.fuzhou.domain.DpRfidVehicle;
import com.ruoyi.fuzhou.domain.OpenWZ;
import com.ruoyi.fuzhou.domain.vo.RfidVehicleVO;
import com.ruoyi.fuzhou.service.DpRfidVehicleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * <p>
 * RFID车辆记录表 前端控制器
 * </p>
 *
 * @author sunjiawei
 * @since 2025-03-21
 */
@RestController
@RequestMapping("/dp/dpRfidVehicle")
@Tag(name = "大屏--车辆RFID数据")
public class DpRfidVehicleController {
    @Autowired
    private DpRfidVehicleService dpRfidVehicleService;
 
    @GetMapping("/list")
    @Operation(summary = "获取车辆RFID数据列表")
    public AjaxResult getList(){
        return AjaxResult.success(dpRfidVehicleService.list());
    }
 
    @GetMapping("/selectByTime")
    @Operation(summary = "根据时间段查询数据")
    public AjaxResult selectByTime(@RequestParam String startTime,@RequestParam String endTime){
        LambdaQueryWrapper<DpRfidVehicle> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.ge(DpRfidVehicle::getPassTime,startTime)
                .le(DpRfidVehicle::getPassTime,endTime)
                .orderByDesc(DpRfidVehicle::getPassTime);
        return AjaxResult.success(
                dpRfidVehicleService.list(lambdaQueryWrapper));
    }
 
    @GetMapping("/selectByNodeNum")
    @Operation(summary = "根据终端ID查询数据")
    public AjaxResult selectByNodeNum(@RequestParam String nodeNum){
        LambdaQueryWrapper<DpRfidVehicle> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(DpRfidVehicle::getSn,nodeNum)
                .orderByDesc(DpRfidVehicle::getPassTime);
        return AjaxResult.success(dpRfidVehicleService.list(lambdaQueryWrapper));
    }
 
    @PostMapping("/selectRfidVehicle")
    @Operation(summary = "条件查询RFID车辆数据")
    public AjaxResult selectRfidVehicle(@RequestBody RfidVehicleVO rfidVehicleVO){
        return AjaxResult.success(dpRfidVehicleService.selectRfidVehicle(rfidVehicleVO));
    }
 
    @GetMapping("/QueryVehicleByTask/{task}")
    @Operation(summary = "根据rfid任务查询RFID车辆数据")
    public AjaxResult QueryVehicleByTask(@PathVariable("task") String task){
        return AjaxResult.success(dpRfidVehicleService.QueryVehicleByTask(task));
    }
 
 
    @Operation(summary = "车辆RFID数据分页列表")
    public TableDataInfo getPageList(DpRfidVehicle dpRfidVehicle) {
        return dpRfidVehicleService.getPageList(dpRfidVehicle);
    }
 
 
    @GetMapping(value = "/{id}")
    @Operation(summary = "获取车辆RFID数据详细信息")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        return AjaxResult.success(dpRfidVehicleService.getById(id));
    }
 
 
    @Operation(summary = "新增")
    @PostMapping
    public AjaxResult add(@RequestBody DpRfidVehicle dpRfidVehicle)
    {
        List<OpenWZ> openWZS = dpRfidVehicle.getWzData();
        dpRfidVehicle.setWzDataStr(JSON.toJSONString(openWZS));
        dpRfidVehicle.setWzData(null);
        return AjaxResult.success(dpRfidVehicleService.save(dpRfidVehicle));
    }
 
 
    @Operation(summary = "修改")
    @PutMapping
    public AjaxResult edit(@RequestBody DpRfidVehicle dpRfidVehicle)
    {
        return AjaxResult.success(dpRfidVehicleService.updateById(dpRfidVehicle));
    }
 
 
    @Operation(summary = "删除")
    @DeleteMapping("/{id}")
    public AjaxResult remove(@PathVariable Integer id)
    {
        return AjaxResult.success(dpRfidVehicleService.removeById(id));
    }
 
}