cjl
2023-07-26 0ce061d9ed37a6c25fff70e4734fa8cc8747237c
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
package com.moral.api.controller;
 
import com.moral.api.service.HistoryAqiService;
import com.moral.api.service.HistoryDailyService;
import com.moral.api.service.HistoryFiveMinutelyService;
import com.moral.api.service.HistoryHourlyService;
import com.moral.constant.ResultMessage;
import com.moral.util.DateUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Date;
 
/**
 * @ClassName UserController
 * @Description 用户管理
 * @Author 陈凯裕
 * @Date 2021/3/22 13:52
 * @Version TODO
 **/
@Slf4j
@Api(tags = {"公共功能"})
@RestController
@RequestMapping("/pub")
public class PubController {
    @Autowired
    private HistoryDailyService historyDailyService;
    @Autowired
    private HistoryFiveMinutelyService historyFiveMinutelyService;
 
    @Autowired
    private HistoryAqiService historyAqiService;
    @Autowired
    private HistoryHourlyService historyHourlyService;
 
    @GetMapping("insertHistoryDaily")
    @ApiOperation(value = "天数据补录", notes = "天数据补录")
    public ResultMessage insertHistoryDaily(String time) {
        Date d = DateUtils.getDate(time,"yyyy-MM-dd");
        historyDailyService.insertHistoryDaily(time);
        int i = 0;
        return new ResultMessage();
    }
 
    @GetMapping("insertHistoryFiveMinutely")
    @ApiOperation(value = "5分钟数据", notes = "5分钟数据")
    public ResultMessage insertHistoryFiveMinutely() {
        historyFiveMinutelyService.insertHistoryFiveMinutely();
        return new ResultMessage();
    }
 
    @GetMapping("FiveMinutelyTest")
    @ApiOperation(value = "5分钟数据1", notes = "5分钟数据1")
    public ResultMessage FiveMinutelyTest(String yz,String mac) {
        historyFiveMinutelyService.insertHistoryFiveMinutely(yz,mac);
        return new ResultMessage();
    }
 
    @GetMapping("insertHistoryAqi")
    @ApiOperation(value = "过控制战补偿", notes = "过控制战补偿")
    public ResultMessage insertHistoryAqi() {
        historyAqiService.insertHistoryAqi();
        return new ResultMessage();
    }
 
    @GetMapping("dateToChangShu")
    @ApiOperation(value = "常熟小时数据", notes = "常熟小时数据")
    public ResultMessage dateToChangShu() {
        historyHourlyService.dateToChangShu(null);
        return new ResultMessage();
    }
 
 
    public static void main(String[] args) {
        String s = "2023-9-01";
        Date d = DateUtils.getDate(s,"yyyy-MM-dd");
        System.out.println(DateUtils.dateToDateFullString(d));
        //System.out.println( DateUtils.dateToDateFullString(DateUtils.getDateOfDay(d, -1), "yyyy-MM-dd"));
 
 
 
    }
 
}