|
@@ -1,10 +1,7 @@
|
|
|
package com.welampiot.service;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.welampiot.configuration.FreqConfig;
|
|
|
-import com.welampiot.configuration.FreqMapConfig;
|
|
|
-import com.welampiot.dto.LampInfoDTO;
|
|
|
-import com.welampiot.utils.*;
|
|
|
+import com.welampiot.dto.NetworkDTO;
|
|
|
+import com.welampiot.utils.ToolUtils;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -14,9 +11,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.sql.DataSource;
|
|
|
import java.io.IOException;
|
|
|
-import java.nio.charset.StandardCharsets;
|
|
|
import java.sql.SQLException;
|
|
|
-import java.util.*;
|
|
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
@SpringBootTest
|
|
@@ -30,19 +25,15 @@ public class UserServiceTest {
|
|
|
@Autowired
|
|
|
private VideoGbInfoService videoGbInfoService;
|
|
|
@Resource
|
|
|
- private LampService lampService;
|
|
|
-
|
|
|
+ private NetworkService plcAddressService;
|
|
|
|
|
|
@Test
|
|
|
- public void testConnection() throws Exception {
|
|
|
- LampInfoDTO lampInfoDTO = new LampInfoDTO();
|
|
|
- String sn = "06780064";
|
|
|
- String macAddress = "352011200865";
|
|
|
- lampInfoDTO.setMacAddress(macAddress);
|
|
|
- lampInfoDTO.setAddress(sn);
|
|
|
- List<LampInfoDTO> listByDto = lampService.getListByDto(lampInfoDTO);
|
|
|
- System.out.println("===dd=:"+listByDto);
|
|
|
-
|
|
|
+ public void testConnection() throws SQLException, IOException {
|
|
|
+ NetworkDTO networkDTO = new NetworkDTO();
|
|
|
+ networkDTO.setDeviceSn("fefed436");
|
|
|
+ //plcAddressDTO.setLampAddress("C20102010400");
|
|
|
+ networkDTO = plcAddressService.getSimpleData(networkDTO);
|
|
|
+ System.out.println("===d===:"+networkDTO);
|
|
|
// long l = System.currentTimeMillis() - (24L * 3600 * 30*1000);
|
|
|
// Date date = new Date(l);
|
|
|
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|