yangys
2024-11-13 04d53749b21921c9bceebe120d170c2ee6e533af
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
package com.qianwen.mdc.collect.controller;
import java.util.Arrays;
import java.util.List;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
 
import com.baomidou.dynamic.datasource.annotation.DS;
import com.qianwen.mdc.collect.config.IotDBSessionConfig;
import com.qianwen.mdc.collect.dto.CalendarShiftInfoDTO;
import com.qianwen.mdc.collect.entity.iotdb.Output;
import com.qianwen.mdc.collect.entity.iotdb.ProcessParam;
import com.qianwen.mdc.collect.mapper.iotdb.OutputMapper;
import com.qianwen.mdc.collect.mapper.iotdb.ProcessParamMapper;
import com.qianwen.mdc.collect.mapper.mgr.CalendarMapper;
import com.qianwen.mdc.collect.mqtt.MqttMessageSender;
import com.qianwen.mdc.collect.service.DeviceStateFixPointService;
import com.qianwen.mdc.collect.service.IOTMqttReceiveService;
import com.qianwen.mdc.collect.service.IotDBCommonService;
import com.qianwen.mdc.collect.service.OutputAggregateService;
import com.qianwen.mdc.collect.utils.redis.RedisUtil;
 
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
 
@RestController
public class CollectTestController {
    @Autowired
    private MqttMessageSender mqttMessageSender;
    @Autowired
    private IOTMqttReceiveService recService;
    @Autowired
    private IotDBSessionConfig iotdbCfg;
    
    @Autowired
    private IotDBCommonService iotService;
    
    @Autowired
    private OutputAggregateService oservice;
    @Autowired
    private ProcessParamMapper mapper;
    @Autowired
    private OutputMapper outmapper;
    @Autowired
    private  RedisUtil redisUtil;
    @Autowired
    private DeviceStateFixPointService fpService;
    
    @Autowired
    private CalendarMapper calendarMapper;
    
    @GetMapping("/last")
    public Object last() {
        //ProcessParam last= mapper.lastParamInDuration(1656819188967653378L,300000);
        //System.out.print(list1);
        return "dd";
    }
    
    @DS("iotdb")
    @GetMapping("/lastSync")
    public Object lastSync() {
        return outmapper.getLastIsSyncOutput(1656819188967653378L);
    }
    
    @GetMapping("/rset")
    public Object rset() {
        redisUtil.hset("workstation-appid-map", "174", 1656819188967653378L);
        return 1;
    }
    
    @GetMapping("/fixpoint")
    public Object fixpoint() {
        //DateTime dateTime = DateTime.now().offset(DateField.DAY_OF_MONTH, 1);//+1天,即明天的数据
        DateTime dateTime = DateTime.now();
        fpService.deviceStateFixPoint(dateTime, null);
        return 1;
    }
    @GetMapping("/shift")
    public Object shift() {
        Long val = calendarMapper.t1();
        return val;
    }
}