zhanghua
2022-11-01 6671f0e002b63a98585fce1b5270cf7e5dc3986a
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
package com.ycl.controller.intelligentPatrol;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.annotation.LogSave;
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.dto.statistics.UnlawfulTypeDto;
import com.ycl.vo.equipment.HandheldTerminalVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
 
/**
 * StatisticsController
 *
 * @version V1.0
 * @author: AI
 * @date: 2022-11-01 16:40
 **/
@RestController
@RequestMapping("/intelligentPatrol/statistics")
@Api(tags = "违章-违法统计")
public class StatisticsController extends BaseController {
 
    @GetMapping("/unlawful/type")
    @ApiOperation("按违规类型统计")
    @LogSave(operationType = "按违规类型统计", contain = "查询")
    public CommonResult<IPage<UnlawfulTypeDto>> searchByType(@RequestParam(required = true) Integer currentPage,
                                                             @RequestParam(required = true) Integer pageSize,
                                                             @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime beginTime,
                                                             @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
        IPage<UnlawfulTypeDto> page = new Page<>();
        List<UnlawfulTypeDto> ls = new ArrayList<>();
        ls.add(new UnlawfulTypeDto("市场监管", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("公安", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("自然资源", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("生态环境", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("地方立法", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("地震", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("教育", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("经信", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("林业", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("农村环境卫生", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("气象", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("人防", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("水行政", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("应急管理", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        ls.add(new UnlawfulTypeDto("其他", 100, 0.6, 10, 1, 20, 5, 20, 0.6, 0.9));
        page.setTotal(ls.size());
        page.setRecords(ls);
        return CommonResult.success(page);
    }
}