Default Changelist
This commit is contained in:
@ -1,9 +1,12 @@
|
||||
package com.xkrs.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.xkrs.dao.CameraDao;
|
||||
import com.xkrs.dao.DeviceManagementDao;
|
||||
import com.xkrs.model.entity.CameraInformation;
|
||||
import com.xkrs.model.entity.DeviceManagement;
|
||||
import com.xkrs.model.vo.ADD;
|
||||
import com.xkrs.model.vo.DA;
|
||||
import com.xkrs.service.CameraService;
|
||||
import com.xkrs.service.FireService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -11,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -47,9 +52,44 @@ public class CameraController {
|
||||
}
|
||||
|
||||
@GetMapping("/SelectDeviceManagement")
|
||||
public List<DeviceManagement> SelectDeviceManagement()
|
||||
public String SelectDeviceManagement()
|
||||
{
|
||||
return cameraService.SelectDevice();
|
||||
File file = new File("C:\\Users\\HP\\Desktop\\摄像头设备信息.txt");
|
||||
try {
|
||||
BufferedReader br=new BufferedReader(new FileReader(file));
|
||||
String contnetTotal="";
|
||||
String s;
|
||||
while (( s=br.readLine())!=null){
|
||||
contnetTotal+=s;
|
||||
}
|
||||
br.close();
|
||||
System.out.println(contnetTotal);
|
||||
|
||||
DA tempBran = JSON.parseObject(contnetTotal, DA.class);
|
||||
|
||||
List<DA.DataDTO.PageDataDTO> pageData = tempBran.getData().getPageData();
|
||||
List<ADD> list1=new ArrayList<>();
|
||||
|
||||
for (DA.DataDTO.PageDataDTO item: pageData) {
|
||||
ADD add=new ADD();
|
||||
add.deviceName=item.getDeviceName();
|
||||
add.deviCevode=item.getDeviceCode();
|
||||
add.deviceSn=item.getDeviceSn();
|
||||
add.deviceCategory=item.getDeviceCategory();
|
||||
add.deviceManufacture=item.getDeviceManufacturer();
|
||||
add.deviceType=item.getDeviceType();
|
||||
add.deviceModel=item.getDeviceModel();
|
||||
add.deviceLp=item.getDeviceIp();
|
||||
add.devicePort=item.getDevicePort();
|
||||
add.ownerCode=item.getOwnerCode();
|
||||
list1.add(add);
|
||||
}
|
||||
cameraService.InsertPaging(list1);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "over";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user