基础服务api
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DeviceServices.cs 3.2 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using BPA.SAAS.Manage.Application.Device.Dtos.Device;
  2. using BPA.SAAS.Manage.Application.Device.Interface;
  3. using BPA.SAAS.Manage.Comm.Model;
  4. using BPA.SAAS.Manage.Core.Base;
  5. using Microsoft.AspNetCore.Components.Forms;
  6. using NPOI.Util;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace BPA.SAAS.Manage.Application.Device
  13. {
  14. [ApiDescriptionSettings("Device", Tag = "设备基础信息管理")]
  15. public class DeviceServices: IDynamicApiController, ITransient
  16. {
  17. IDeviceService _deviceService;
  18. public DeviceServices(IDeviceService deviceService)
  19. {
  20. _deviceService=deviceService;
  21. }
  22. /// <summary>
  23. /// 分页查询
  24. /// </summary>
  25. /// <param name="inputDto"></param>
  26. /// <returns></returns>
  27. [HttpPost("/api/device/page")]
  28. public async Task<PageUtil> GetDeviceInfoPage(DeviceQueryInputDto inputDto)
  29. {
  30. return await _deviceService.GetDeviceInfoPage(inputDto);
  31. }
  32. /// <summary>
  33. /// 查询设备列表
  34. /// </summary>
  35. /// <returns></returns>
  36. [HttpGet("/api/device/list")]
  37. public async Task<List<ListSelectDeviceQuery>> GetDeviceList()
  38. {
  39. return await _deviceService.GetDeviceList();
  40. }
  41. [HttpGet("/api/device/getdevicebystoplist")]
  42. public async Task<List<ListSelectDeviceQuery>> GetDeviceByStopList(string stopId)
  43. {
  44. return await _deviceService.GetDeviceByStopList(stopId);
  45. }
  46. /// <summary>
  47. /// 添加
  48. /// </summary>
  49. /// <param name="inputDto"></param>
  50. /// <returns></returns>
  51. [HttpPost("/api/device/add")]
  52. public async Task<bool> AddDevice(DeviceInfoBaseDto inputDto)
  53. {
  54. return await _deviceService.AddDevice(inputDto);
  55. }
  56. /// <summary>
  57. /// 修改
  58. /// </summary>
  59. /// <param name="inputDto"></param>
  60. /// <returns></returns>
  61. [HttpPost("/api/device/update")]
  62. public async Task<bool> UpdateDevice(DeviceInfoBaseDto inputDto)
  63. {
  64. return await _deviceService.UpdateDevice(inputDto);
  65. }
  66. /// <summary>
  67. /// 删除
  68. /// </summary>
  69. /// <param name="inputList"></param>
  70. /// <returns></returns>
  71. [HttpPost("/api/device/delete")]
  72. public async Task<bool> DelDeviceInfo(List<string> inputList)
  73. {
  74. return await _deviceService.DelDeviceInfo(inputList);
  75. }
  76. /// <summary>
  77. /// 添加设备标签
  78. /// </summary>
  79. /// <param name="inputDto"></param>
  80. /// <returns></returns>
  81. [HttpPost("/api/device/adddevicetype")]
  82. public async Task<bool> AddDeviceTypeAsync(DeviceTypeBaseDto inputDto)
  83. {
  84. return await _deviceService.AddDeviceTypeAsync(inputDto);
  85. }
  86. /// <summary>
  87. /// 查询设备标签
  88. /// </summary>
  89. /// <returns></returns>
  90. [HttpGet("/api/device/getdevicetypelist")]
  91. public async Task<List<ListSelectQuery>> GetDeviceTypeList()
  92. {
  93. return await _deviceService.GetDeviceTypeList();
  94. }
  95. }
  96. }