package com.qianwen.mdc.collect.controller; 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.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.DateTime; @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; } }