HookupController.java 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. package com.bizmatics.controller.web;
  2. import com.bizmatics.common.core.bean.ApiResult;
  3. import com.bizmatics.model.Device;
  4. import com.bizmatics.model.DeviceAnalogVariableList;
  5. import com.bizmatics.model.DeviceAttribute;
  6. import com.bizmatics.model.vo.HookupComponentCompleteOneVo;
  7. import com.bizmatics.model.vo.HookupComponentCompleteVo;
  8. import com.bizmatics.model.vo.HookupOneVo;
  9. import com.bizmatics.service.HookupService;
  10. import org.springframework.beans.factory.annotation.Autowired;
  11. import org.springframework.stereotype.Controller;
  12. import org.springframework.web.bind.annotation.*;
  13. import java.util.List;
  14. /**
  15. * 配电图相关查询接口
  16. *
  17. * @author ya
  18. * @since 2022-03-07
  19. */
  20. @RestController
  21. @RequestMapping("/hookup")
  22. public class HookupController {
  23. @Autowired
  24. private HookupService hookupService;
  25. /**
  26. * 设备下拉框
  27. * @param siteId 站点ID
  28. * @return
  29. */
  30. @GetMapping("getDeviceAttributeList")
  31. public ApiResult<List<DeviceAttribute>> getDeviceAttributeList(@RequestParam Integer siteId) {
  32. return ApiResult.success(hookupService.getDeviceAttributeList(siteId));
  33. }
  34. /**
  35. * 变量下拉框
  36. * @param monitoringDeviceId 监控设备ID
  37. * @return
  38. */
  39. @GetMapping("getDeviceAnalogVariableList")
  40. public ApiResult<List<DeviceAnalogVariableList>> getDeviceAnalogVariableList(@RequestParam Integer monitoringDeviceId) {
  41. return ApiResult.success(hookupService.getDeviceAnalogVariableList(monitoringDeviceId));
  42. }
  43. /**
  44. * 配电图模板基础信息
  45. * @param siteId 站点ID
  46. * @return
  47. */
  48. @GetMapping("gethookupComponentBasics")
  49. public ApiResult<List<HookupOneVo>> gethookupComponentBasics(@RequestParam(value = "siteId", required = false, defaultValue = "0") Integer siteId) {
  50. return ApiResult.success(hookupService.gethookupComponentBasics(siteId));
  51. }
  52. /**
  53. * 配电图数据查询
  54. * @param siteId 站点ID
  55. * @return
  56. */
  57. @GetMapping("getHookupComponentComplete")
  58. public ApiResult<List<HookupComponentCompleteVo>> getHookupComponentComplete(@RequestParam Integer siteId) {
  59. return ApiResult.success(hookupService.getHookupComponentComplete(siteId));
  60. }
  61. /**
  62. * 配电图保存
  63. * @param hookupComponentCompleteOneVoList
  64. * @return
  65. */
  66. @PostMapping("setHookupComponentComplete")
  67. public ApiResult<Void> setHookupComponentComplete(@RequestBody List<HookupComponentCompleteOneVo> hookupComponentCompleteOneVoList) {
  68. hookupService.setHookupComponentComplete(hookupComponentCompleteOneVoList);
  69. return ApiResult.success();
  70. }
  71. }