Browse Source

#设备实例告警修改

zhongwei
yang_shj 5 months ago
parent
commit
272abeaf55
  1. 24
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/controller/HistoryController.java
  2. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/PointService.java
  3. 31
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java

24
hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/controller/HistoryController.java

@ -8,6 +8,7 @@ import com.hnac.hzinfo.dataconfig.entity.Device;
import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryCondition;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceAttrVO;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@ -38,24 +39,17 @@ public class HistoryController extends BladeController {
return R.data(alarmService.alarm(soeQueryCondition));
}
@GetMapping("/projectSid")
@GetMapping("/projectFacDevice")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询站点sid", notes = "根据站点id查询sid")
public R<String> projectSid(@RequestParam(value = "stationId") String projectId) {
return R.data(pointService.projectSid(projectId));
@ApiOperation(value = "站点厂租点", notes = "根据站点id查询厂组点信息")
public R<List<Device>> projectFacDevice(@RequestParam(value = "projectId") String projectId) {
return R.data(pointService.projectFacDevice(projectId));
}
@GetMapping("/projectGroup")
@GetMapping("/projectDeviceInstance")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "站点分组信息", notes = "根据站点sid查询厂信息分组")
public R<List<Device>> projectGroup(@RequestParam(value = "sid") String sid) {
return R.data(pointService.projectGroup(sid));
}
@GetMapping("/onlineAttr")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分组点位信息", notes = "根据分组Id查询分组点位")
public R<List<DeviceInstanceAttrVO>> onlineAttr(@RequestParam(value = "groupId") String groupId) {
return R.data(pointService.onlineAttr(groupId));
@ApiOperation(value = "站点虚拟设备息", notes = "根据站点id查询虚拟设备")
public R<List<DeviceInstanceVO>> projectDeviceInstance(@RequestParam(value = "projectId") String projectId) {
return R.data(pointService.projectDeviceInstance(projectId));
}
}

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/PointService.java

@ -5,6 +5,7 @@ import com.hnac.hzinfo.dataconfig.entity.Device;
import com.hnac.hzinfo.datasearch.soe.domian.SoeData;
import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryCondition;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceAttrVO;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO;
import java.util.List;
@ -14,9 +15,8 @@ import java.util.List;
public interface PointService {
String projectSid(String projectId);
List<Device> projectFacDevice(String projectId);
List<Device> projectGroup(String projectId);
List<DeviceInstanceAttrVO> onlineAttr(String groupId);
List<DeviceInstanceVO> projectDeviceInstance(String projectId);
}

31
hzims-service/operational/src/main/java/com/hnac/hzims/operational/history/service/impl/PointServiceImpl.java

@ -5,6 +5,7 @@ import com.hnac.hzinfo.dataconfig.entity.Device;
import com.hnac.hzinfo.sdk.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceAttrVO;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO;
import com.hnac.hzinfo.sdk.v5.project.ProjectClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -28,28 +29,15 @@ public class PointServiceImpl implements PointService {
private final DeviceClient deviceClient;
/**
* 查询站点厂信息分组
* @param projectId
* @return
*/
@Override
public String projectSid(String projectId) {
Result<String> result = projectClient.getProjectBySid(projectId);
if(!result.isSuccess() || StringUtil.isBlank(result.getData())){
return "";
}
return result.getData();
}
/**
* 厂信息分组
* @param sid
* 根据站点查询厂组点信息
* @param projectId
* @return
*/
@Override
public List<Device> projectGroup(String sid) {
Result<List<Device>> result = deviceClient.facDeviceByProjectId(sid);
public List<Device> projectFacDevice(String projectId) {
Result<List<Device>> result = deviceClient.facDeviceByProjectId(projectId);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return new ArrayList<>();
}
@ -57,17 +45,18 @@ public class PointServiceImpl implements PointService {
}
/**
* 查询分组点位信息
* @param groupId
* 根据站点查询虚拟设备
* @param projectId
* @return
*/
@Override
public List<DeviceInstanceAttrVO> onlineAttr(String groupId) {
R<List<DeviceInstanceAttrVO>> result = deviceClient.getOnlineAttr(groupId);
public List<DeviceInstanceVO> projectDeviceInstance(String projectId) {
R<List<DeviceInstanceVO>> result = deviceClient.getOnlineDeviceInstance(projectId);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return new ArrayList<>();
}
return result.getData();
}
}
Loading…
Cancel
Save