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

99 regels
3.0 KiB

  1. using BPA.SAAS.Manage.Application.DataBase.Dtos.Bom;
  2. using BPA.SAAS.Manage.Application.DataBase.Interface;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace BPA.SAAS.Manage.Application.DataBase
  9. {
  10. [ApiDescriptionSettings("Goods", Tag = "配方管理")]
  11. public class BomServices: IDynamicApiController, ITransient
  12. {
  13. IBomService _bomService;
  14. public BomServices(IBomService bomService)
  15. {
  16. _bomService= bomService;
  17. }
  18. /// <summary>
  19. /// 查询所有配方信息
  20. /// </summary>
  21. /// <returns></returns>
  22. [HttpGet("/api/bom/getbomlist")]
  23. public async Task<List<BomSelectList>> GetBomList()
  24. {
  25. return await _bomService.GetBomList();
  26. }
  27. /// <summary>
  28. /// 根据配方id查询配方信息
  29. /// </summary>
  30. /// <param name="bomId"></param>
  31. /// <returns></returns>
  32. [HttpGet("/api/bom/getbyidbomlist")]
  33. public async Task<BomList> GetBomList(string bomId)
  34. {
  35. return await _bomService.GetBomList(bomId);
  36. }
  37. /// <summary>
  38. /// 添加
  39. /// </summary>
  40. /// <param name="dto"></param>
  41. /// <returns></returns>
  42. [HttpPost("/api/bom/add")]
  43. public async Task<bool> AddBom(BomInputDto dto)
  44. {
  45. return await _bomService.AddBom(dto);
  46. }
  47. /// <summary>
  48. /// 更新
  49. /// </summary>
  50. /// <param name="dto"></param>
  51. /// <returns></returns>
  52. [HttpPost("/api/bom/update")]
  53. public async Task<bool> UpdateBom(BomInputDto dto)
  54. {
  55. return await _bomService.UpdateBom(dto);
  56. }
  57. /// <summary>
  58. /// 更新配方详情
  59. /// </summary>
  60. /// <param name="dto"></param>
  61. /// <returns></returns>
  62. [HttpPost("/api/bom/updatebombatcing")]
  63. public async Task<bool> UpdateBomBatcing(BomBatcingInputDto dto)
  64. {
  65. return await _bomService.UpdateBomBatcing(dto);
  66. }
  67. /// <summary>
  68. /// 删除
  69. /// </summary>
  70. /// <param name="id"></param>
  71. /// <returns></returns>
  72. [HttpGet("/api/bom/delete")]
  73. public async Task<bool> DeleteBom(string id)
  74. {
  75. return await _bomService.DeleteBom(id);
  76. }
  77. /// <summary>
  78. /// 添加配方分类
  79. /// </summary>
  80. /// <param name="dto"></param>
  81. /// <returns></returns>
  82. [HttpPost("/api/bom/addbomtype")]
  83. public async Task<bool> AddBomType(AddBomTypeInputDto dto)
  84. {
  85. return await _bomService.AddBomType(dto);
  86. }
  87. /// <summary>
  88. /// 配方分类列表
  89. /// </summary>
  90. /// <returns></returns>
  91. [HttpGet("/api/bom/getbomtypelist")]
  92. public async Task<List<dynamic>> GetBomTypeList()
  93. {
  94. return await _bomService.GetBomTypeList();
  95. }
  96. }
  97. }