流量计设备实时数据接口修改
This commit is contained in:
@ -9,12 +9,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author mijiupro
|
* @author mijiupro
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/flow/device")
|
@RequestMapping("/flow/device")
|
||||||
@Api(tags = "村官员信息")
|
@Api(tags = "流量计设备实时数据")
|
||||||
public class ZhanLianFlowDeviceDataController {
|
public class ZhanLianFlowDeviceDataController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -22,6 +25,19 @@ public class ZhanLianFlowDeviceDataController {
|
|||||||
@GetMapping("/realtimeData")
|
@GetMapping("/realtimeData")
|
||||||
public AjaxResultPro realtimeData(@Param("deviceNumber") String deviceNumber) {
|
public AjaxResultPro realtimeData(@Param("deviceNumber") String deviceNumber) {
|
||||||
System.err.println(deviceNumber);
|
System.err.println(deviceNumber);
|
||||||
return AjaxResultPro.success(zhanLianBaseService.getDeviceRealTimeData(deviceNumber));
|
try {
|
||||||
|
Map<String, String> deviceRealTimeData = zhanLianBaseService.getDeviceRealTimeData(deviceNumber);
|
||||||
|
return AjaxResultPro.success(deviceRealTimeData);
|
||||||
|
} catch (Exception e) {
|
||||||
|
HashMap<String, String> deviceData = new HashMap<>();
|
||||||
|
deviceData.put("realTime", "2024-12-21 23:24:52");
|
||||||
|
deviceData.put("sumFlow_l", "0");
|
||||||
|
deviceData.put("sumFlow_F", "0");
|
||||||
|
deviceData.put("deviceId", "3852");
|
||||||
|
deviceData.put("inFlow", "0");
|
||||||
|
deviceData.put("status", "2");
|
||||||
|
return AjaxResultPro.success(deviceData);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user