新增云协议相关内容
This commit is contained in:
@@ -2,6 +2,10 @@ package com.njcn;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||
import com.njcn.access.enums.AccessEnum;
|
||||
import com.njcn.access.enums.TypeEnum;
|
||||
import com.njcn.access.pojo.dto.ReqAndResDto;
|
||||
import com.njcn.csharmonic.api.WavePicFeignClient;
|
||||
import com.njcn.influx.pojo.constant.InfluxDBTableConstant;
|
||||
import com.njcn.influx.utils.InfluxDbUtils;
|
||||
@@ -15,6 +19,8 @@ import com.njcn.zlevent.ZlEventBootApplication;
|
||||
import com.njcn.zlevent.pojo.constant.ZlConstant;
|
||||
import com.njcn.zlevent.pojo.dto.FileStreamDto;
|
||||
import com.njcn.zlevent.pojo.dto.WaveTimeDto;
|
||||
import com.njcn.zlevent.service.ICsWaveService;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.influxdb.InfluxDB;
|
||||
import org.influxdb.dto.BatchPoints;
|
||||
import org.influxdb.dto.Point;
|
||||
@@ -59,6 +65,11 @@ public class AppTest {
|
||||
@Resource
|
||||
private InfluxDbUtils influxDbUtils;
|
||||
|
||||
@Resource
|
||||
private MqttPublisher publisher;
|
||||
@Resource
|
||||
private ICsWaveService csWaveService;
|
||||
|
||||
/**
|
||||
* Rigorous Test :-)
|
||||
*/
|
||||
@@ -68,6 +79,39 @@ public class AppTest {
|
||||
assertTrue( true );
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test00() {
|
||||
long time = 1726237055L;
|
||||
long subtleTime = 889000L;
|
||||
Double millisecond = 1430.0;
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
time = time - 8*3600;
|
||||
// 将millisecond转换为长整型,并乘以1000以获取微秒
|
||||
long millisecondValue = millisecond.longValue() * 1000;
|
||||
long time1 = time * 1000000 + subtleTime;
|
||||
long time2 = time * 1000000 + subtleTime + millisecondValue;
|
||||
String time1String = String.valueOf(time1);
|
||||
String time2String = String.valueOf(time2);
|
||||
|
||||
String time11 = time1String.substring(time1String.length() - 6);
|
||||
String time111 = time1String.substring(0,time1String.length() - 6);
|
||||
String formatTime1 = format.format(Long.parseLong(time111) * 1000);
|
||||
|
||||
String time22 = time2String.substring(time2String.length() - 6);
|
||||
String time222 = time2String.substring(0,time2String.length() - 6);
|
||||
String formatTime2 = format.format(Long.parseLong(time222) * 1000);
|
||||
System.out.println(formatTime1 + "." + time11);
|
||||
System.out.println(formatTime2 + "." + time22);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test11() {
|
||||
String fileName = "/bd0/comtrade/PQS_PQM1_000063_20241029_101442_886";
|
||||
boolean result = csWaveService.findCountByName(fileName);
|
||||
System.out.println("result==:" + result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() {
|
||||
List<String> records = new ArrayList<String>();
|
||||
|
||||
Reference in New Issue
Block a user