暂态模块格式化时间处理

This commit is contained in:
2023-04-20 10:44:18 +08:00
parent bdffafbf56
commit 4b3ff6e3ff
8 changed files with 47 additions and 287 deletions

View File

@@ -1,71 +0,0 @@
package com.njcn.prepare.harmonic.controller;
import com.njcn.harmonic.pojo.po.ExcelRptTemp;
import com.njcn.influxdb.utils.InfluxDbUtils;
import com.njcn.prepare.harmonic.mapper.mysql.line.ExcelRptTempMapper;
import com.njcn.prepare.harmonic.pojo.influxdb.po.DataVPO;
import com.njcn.prepare.harmonic.service.mysql.Impl.line.LimitRateService;
import org.influxdb.dto.QueryResult;
import org.influxdb.impl.InfluxDBResultMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import java.text.ParseException;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2022/10/18 20:15【需求编号】
*
* @author clam
* @version V1.0.0
*/
@RunWith(SpringRunner.class)
@WebAppConfiguration
@SpringBootTest
public class LimitRateServiceTest {
private @Autowired
LimitRateService limitRateService;
private @Autowired
InfluxDbUtils influxDbUtils;
private @Autowired
ExcelRptTempMapper excelRptTempMapper;
@Test
public void test() throws ParseException {
System.out.println("spring test start");
limitRateService.limitRateJobHandler (Stream.of ("8696be1d170e05b7d848accc059f4558" ).collect(Collectors.toList()), "2022-10-15 00:00:00", "2022-10-15 23:59:59");
}
@Test
public void test1(){
System.out.println("spring test start");
String sql ="SELECT * FROM data_v where time >= '2022-10-15 00:00:00' and time <= '2022-10-15 23:59:59' ";
influxDbUtils.setDbName ("pqsbase_test");
QueryResult sqlResult = influxDbUtils.query (sql);
InfluxDBResultMapper resultMapper = new InfluxDBResultMapper ( );
List<DataVPO> list = resultMapper.toPOJO (sqlResult, DataVPO.class);
System.out.println ("spring test end" );
}
@Test
public void test3(){
System.out.println("spring test start");
ExcelRptTemp excelRptTemp = excelRptTempMapper.selectById ("8c7f0cb540904ddeb8fbedef288579d7");
System.out.println (excelRptTemp.getId () );
// limitRateService.limitRateJobHandler (Stream.of ("8696be1d170e05b7d848accc059f4558" ).collect(Collectors.toList()), "2022-10-15 00:00:00", "2022-10-15 23:59:59");
}
}