liujie
2026-06-09 c96fbe6b0aeb413a17c429133ee6d81d138144b9
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
package com.xiaopeng.vehicleConvoy.controller;
 
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.vehicleConvoy.model.query.IndexDataQuery;
import com.xiaopeng.vehicleConvoy.model.vo.IndexDataVO;
import com.xiaopeng.vehicleConvoy.service.IndexDataService;
import com.xiaopeng.vehicleConvoy.task.VehicleDocumentExpiryTask;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * 首页 Controller
 *
 * @author mitao
 */
@Slf4j
@RestController
@Api(tags = "管理后台-首页")
public class IndexController {
 
    @Resource
    private IndexDataService indexDataService;
    @Autowired
    private VehicleDocumentExpiryTask vehicleDocumentExpiryTask;
 
    @ApiOperation(value = "首页数据统计", tags = {"管理后台-首页"})
    @PostMapping("/base/v1/indexData")
    public R<IndexDataVO> indexData(@RequestBody(required = false) IndexDataQuery query) {
        if (query == null) {
            query = new IndexDataQuery();
        }
        return R.ok(indexDataService.getIndexData(query));
    }
 
    @ApiOperation(value = "车辆资质过期检查", tags = {"定时任务"})
    @PostMapping("/base/v1/vehicle/execute")
    public R<?> vehicleExecute() {
        vehicleDocumentExpiryTask.checkAndStockExpiredVehicles();
        return R.ok();
    }
}