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

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.SoeData;
import com.hnac.hzinfo.datasearch.soe.domian.SoeQueryCondition; 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.DeviceInstanceAttrVO;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO;
import java.util.List; import java.util.List;
@ -14,9 +15,8 @@ import java.util.List;
public interface PointService { 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.core.response.Result;
import com.hnac.hzinfo.sdk.v5.device.client.DeviceClient; 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.DeviceInstanceAttrVO;
import com.hnac.hzinfo.sdk.v5.device.vo.DeviceInstanceVO;
import com.hnac.hzinfo.sdk.v5.project.ProjectClient; import com.hnac.hzinfo.sdk.v5.project.ProjectClient;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -28,28 +29,15 @@ public class PointServiceImpl implements PointService {
private final DeviceClient deviceClient; 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 * @return
*/ */
@Override @Override
public List<Device> projectGroup(String sid) { public List<Device> projectFacDevice(String projectId) {
Result<List<Device>> result = deviceClient.facDeviceByProjectId(sid); Result<List<Device>> result = deviceClient.facDeviceByProjectId(projectId);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return new ArrayList<>(); return new ArrayList<>();
} }
@ -57,17 +45,18 @@ public class PointServiceImpl implements PointService {
} }
/** /**
* 查询分组点位信息 * 根据站点查询虚拟设备
* @param groupId * @param projectId
* @return * @return
*/ */
@Override @Override
public List<DeviceInstanceAttrVO> onlineAttr(String groupId) { public List<DeviceInstanceVO> projectDeviceInstance(String projectId) {
R<List<DeviceInstanceAttrVO>> result = deviceClient.getOnlineAttr(groupId); R<List<DeviceInstanceVO>> result = deviceClient.getOnlineDeviceInstance(projectId);
if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){ if(!result.isSuccess() || CollectionUtil.isEmpty(result.getData())){
return new ArrayList<>(); return new ArrayList<>();
} }
return result.getData(); return result.getData();
} }
} }
Loading…
Cancel
Save