| | |
| | | package com.qianwen.mdc.collect.controller; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | 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 { |
| | |
| | | private OutputMapper outmapper; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private DeviceStateFixPointService fpService; |
| | | |
| | | @Autowired |
| | | private CalendarMapper calendarMapper; |
| | | |
| | | @GetMapping("/last") |
| | | public Object last() { |
| | | List<ProcessParam> list1= mapper.mylist(1656819188967653378L); |
| | | System.out.print(list1); |
| | | return list1; |
| | | //ProcessParam last= mapper.lastParamInDuration(1656819188967653378L,300000); |
| | | //System.out.print(list1); |
| | | return "dd"; |
| | | } |
| | | |
| | | @DS("iotdb") |
| | |
| | | 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; |
| | | } |
| | | } |