基础服务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.
 
 

142 lines
5.5 KiB

  1. using BPA.SAAS.Manage.Application.Device.Dtos.ProductFunction;
  2. using BPA.SAAS.Manage.Application.Device.Interface;
  3. using BPA.SAAS.Manage.Core.Base;
  4. using BPA.SAAS.Manage.Core.Product;
  5. using Microsoft.AspNetCore.Components.Forms;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace BPA.SAAS.Manage.Application.Device
  12. {
  13. [ApiDescriptionSettings("Device", Tag = "设备基础工艺信息管理")]
  14. public class ProductFunctionServices: IDynamicApiController, ITransient
  15. {
  16. IProductFunctionService _deviceTechnologyService;
  17. public ProductFunctionServices(IProductFunctionService deviceTechnologyService)
  18. {
  19. _deviceTechnologyService= deviceTechnologyService;
  20. }
  21. /// <summary>
  22. /// 获取功能基础信息列表
  23. /// </summary>
  24. /// <param name="inputDto"></param>
  25. /// <returns></returns>
  26. [HttpPost("/api/productfunction/page")]
  27. public async Task<PageUtil> GetProductFunctionPage(ProductFunctionPageBase inputDto)
  28. {
  29. return await _deviceTechnologyService.GetProductFunctionPage(inputDto);
  30. }
  31. /// <summary>
  32. /// 查询所有功能信息
  33. /// </summary>
  34. /// <returns></returns>
  35. [HttpGet("/api/productfunction/getdevicetechnology")]
  36. public async Task<List<ProductFunctionDto>> GetProductFunction()
  37. {
  38. return await _deviceTechnologyService.GetProductFunction();
  39. }
  40. /// <summary>
  41. /// 根据设备id查询产品功能和服务
  42. /// </summary>
  43. /// <param name="deviceId"></param>
  44. /// <returns></returns>
  45. [HttpGet("/api/productfunction/getproductfunction")]
  46. public async Task<List<ProductFunctionView>> GetProductFunction(string deviceId)
  47. {
  48. return await _deviceTechnologyService.GetProductFunction(deviceId);
  49. }
  50. /// <summary>
  51. /// 根据设备id查询产品功能和服务(外部调用)
  52. /// </summary>
  53. /// <param name="deviceId"></param>
  54. /// <returns></returns>
  55. [HttpGet("/api/productfunction/getproductfunction_alm")]
  56. [AllowAnonymous]
  57. public async Task<List<ProductFunctionView>> GetProductFunction_alm(string deviceId)
  58. {
  59. return await _deviceTechnologyService.GetProductFunction_alm(deviceId);
  60. }
  61. /// <summary>
  62. /// 添加功能
  63. /// </summary>
  64. /// <param name="inputDto"></param>
  65. /// <returns></returns>
  66. [HttpPost("/api/productfunction/add")]
  67. public async Task<bool> AddProductFunction(ProductFunctionBaseDto inputDto)
  68. {
  69. return await _deviceTechnologyService.AddProductFunction(inputDto);
  70. }
  71. /// <summary>
  72. /// 修改功能
  73. /// </summary>
  74. /// <param name="inputDto"></param>
  75. /// <returns></returns>
  76. [HttpPost("/api/productfunction/update")]
  77. public async Task<bool> UpdateProductFunction(ProductFunctionBaseDto inputDto)
  78. {
  79. return await _deviceTechnologyService.UpdateProductFunction(inputDto);
  80. }
  81. /// <summary>
  82. /// 删除功能
  83. /// </summary>
  84. /// <param name="ids"></param>
  85. /// <returns></returns>
  86. [HttpPost("/api/productfunction/delete")]
  87. public async Task<bool> DeleteProductFunction(List<string> ids)
  88. {
  89. return await _deviceTechnologyService.DeleteProductFunction(ids);
  90. }
  91. /// <summary>
  92. /// 根据功能id查询功能参数
  93. /// </summary>
  94. /// <returns></returns>
  95. [HttpGet("/api/productfunction/getproductfunctionaction")]
  96. public async Task<List<BPA_ProductFunctionAction>> GetProductFunctionActionList(string productFunctionId)
  97. {
  98. return await _deviceTechnologyService.GetProductFunctionActionList(productFunctionId);
  99. }
  100. /// <summary>
  101. /// 查询所有功能参数
  102. /// </summary>
  103. /// <returns></returns>
  104. [HttpGet("/api/productfunction/getproductfunctionactionlist")]
  105. public async Task<List<BPA_ProductFunctionAction>> GetProductFunctionActionList()
  106. {
  107. return await _deviceTechnologyService.GetProductFunctionActionList();
  108. }
  109. /// <summary>
  110. /// 添加功能参数
  111. /// </summary>
  112. /// <param name="inputDto"></param>
  113. /// <returns></returns>
  114. [HttpPost("/api/productfunction/addproductfunctionaction")]
  115. public async Task<bool> AddProductFunctionAction(ProductFunctionActionBaseDto inputDto)
  116. {
  117. return await _deviceTechnologyService.AddProductFunctionAction(inputDto);
  118. }
  119. /// <summary>
  120. /// 修改功能参数
  121. /// </summary>
  122. /// <param name="inputDto"></param>
  123. /// <returns></returns>
  124. [HttpPost("/api/productfunction/updateproductfunctionaction")]
  125. public async Task<bool> UpdateProductFunctionAction(ProductFunctionActionBaseDto inputDto)
  126. {
  127. return await _deviceTechnologyService.UpdateProductFunctionAction(inputDto);
  128. }
  129. /// <summary>
  130. /// 删除功能参数
  131. /// </summary>
  132. /// <param name="ids"></param>
  133. /// <returns></returns>
  134. [HttpPost("/api/productfunction/delproductfunctionaction")]
  135. public async Task<bool> DeleteProductFunctionAction(List<string> ids)
  136. {
  137. return await _deviceTechnologyService.DeleteProductFunctionAction(ids);
  138. }
  139. }
  140. }