zouyu
5 天以前 dcd4f41b63ac7a103b960062434dad13a3e419b7
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
package com.ruoyi.vehicleInformationCollectionReview.controller;
 
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.vehicleInformationCollectionReview.dto.VehicleInformationCollectionReviewDTO;
import com.ruoyi.vehicleInformationCollectionReview.pojo.VehicleInformationCollectionReview;
import com.ruoyi.vehicleInformationCollectionReview.service.VehicleInformationCollectionReviewService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
@Slf4j
@RestController
@RequestMapping("/environmentAccess")
public class VehicleInformationCollectionController {
 
    @Autowired
    private VehicleInformationCollectionReviewService vehicleInformationCollectionReviewService;
 
    // 查询车辆信息分页列表
    @GetMapping("/vehicleInfoPage")
    public AjaxResult vehicleInfoPage(Page page, VehicleInformationCollectionReview vehicleInformationCollectionReview){
        return AjaxResult.success(vehicleInformationCollectionReviewService.listPage(page,vehicleInformationCollectionReview));
    }
    // 新增车辆信息
    @PostMapping("/vehicleInfoAdd")
    public AjaxResult vehicleInfoAdd(@RequestBody VehicleInformationCollectionReview vehicleInformationCollectionReview){
        return AjaxResult.success(vehicleInformationCollectionReviewService.insert(vehicleInformationCollectionReview));
    }
    // 修改车辆信息
    @PutMapping("/vehicleInfoUpdate")
    public AjaxResult updateRecord(VehicleInformationCollectionReview vehicleInformationCollectionReview){
        return AjaxResult.success(vehicleInformationCollectionReviewService.updateById(vehicleInformationCollectionReview));
    }
    // 删除车辆信息(支持批量)
    @DeleteMapping("/vehicleInfoDelete")
    public AjaxResult removeRecords(@RequestBody List<Long> ids){
        return AjaxResult.success(vehicleInformationCollectionReviewService.removeBatchByIds(ids));
    }
    // 审核车辆信息
    @PostMapping("/vehicleInfoReview")
    public AjaxResult vehicleInfoReview(@RequestBody VehicleInformationCollectionReviewDTO vehicleInformationCollectionReviewDTO){
        return AjaxResult.success(vehicleInformationCollectionReviewService.update(Wrappers.<VehicleInformationCollectionReview>lambdaUpdate()
                .set(VehicleInformationCollectionReview::getReviewStatus,vehicleInformationCollectionReviewDTO.getReviewStatus())
                .eq(VehicleInformationCollectionReview::getId,vehicleInformationCollectionReviewDTO.getId())));
    }
 
}