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

79 lines
2.3 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. /// 添加
  29. /// </summary>
  30. /// <param name="dto"></param>
  31. /// <returns></returns>
  32. [HttpPost("/api/bom/add")]
  33. public async Task<bool> AddBom(BomInputDto dto)
  34. {
  35. return await _bomService.AddBom(dto);
  36. }
  37. /// <summary>
  38. /// 更新
  39. /// </summary>
  40. /// <param name="dto"></param>
  41. /// <returns></returns>
  42. [HttpPost("/api/bom/update")]
  43. public async Task<bool> UpdateBom(BomInputDto dto)
  44. {
  45. return await _bomService.UpdateBom(dto);
  46. }
  47. /// <summary>
  48. /// 删除
  49. /// </summary>
  50. /// <param name="id"></param>
  51. /// <returns></returns>
  52. [HttpGet("/api/bom/delete")]
  53. public async Task<bool> DeleteBom(string id)
  54. {
  55. return await _bomService.DeleteBom(id);
  56. }
  57. /// <summary>
  58. /// 添加配方分类
  59. /// </summary>
  60. /// <param name="dto"></param>
  61. /// <returns></returns>
  62. [HttpPost("/api/bom/addbomtype")]
  63. public async Task<bool> AddBomType(AddBomTypeInputDto dto)
  64. {
  65. return await _bomService.AddBomType(dto);
  66. }
  67. /// <summary>
  68. /// 配方分类列表
  69. /// </summary>
  70. /// <returns></returns>
  71. [HttpGet("/api/bom/getbomtypelist")]
  72. public async Task<List<dynamic>> GetBomTypeList()
  73. {
  74. return await _bomService.GetBomTypeList();
  75. }
  76. }
  77. }