团餐订单
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.
 
 

109 lines
3.7 KiB

  1. using BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Dtos;
  2. using BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service;
  3. using BPA.KitChen.GroupMealOrder.Core.Entity;
  4. using BPA.KitChen.GroupMealOrder.SqlSugar;
  5. using Furion.DatabaseAccessor;
  6. using Furion.DynamicApiController;
  7. using Microsoft.AspNetCore.Authorization;
  8. using Microsoft.AspNetCore.Mvc;
  9. using Newtonsoft.Json;
  10. using SqlSugar;
  11. using System;
  12. using System.Collections.Generic;
  13. using System.Linq;
  14. using System.Text;
  15. using System.Threading.Tasks;
  16. namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder
  17. {
  18. [ApiDescriptionSettings("订单管理", Tag = "称重订单", SplitCamelCase = false)]
  19. public class WeighOrderServices: IDynamicApiController
  20. {
  21. private readonly IWeighOrderService _weighOrderService;
  22. public WeighOrderServices(IWeighOrderService weighOrderService)
  23. {
  24. _weighOrderService = weighOrderService;
  25. }
  26. /// <summary>
  27. /// 创建订单
  28. /// </summary>
  29. /// <param name="inputDto"></param>
  30. /// <returns></returns>
  31. [HttpPost("/api/WeighOrder/CreateWeighOrder")]
  32. public async Task<WeighOrderDto> CreateWeighOrder(WeighOrderCreteDto inputDto)
  33. {
  34. return await _weighOrderService.CreateWeighOrder(inputDto);
  35. }
  36. /// <summary>
  37. /// 添加订单商品
  38. /// </summary>
  39. /// <param name="inputDto"></param>
  40. /// <returns></returns>
  41. [HttpPost("/api/WeighOrder/AddWeighOrderGoods")]
  42. public async Task<bool> AddWeighOrderGoods(List<WeighOrderGoodsCreateDto> inputDto)
  43. {
  44. return await _weighOrderService.AddWeighOrderGoods(inputDto);
  45. }
  46. /// <summary>
  47. /// 添加订单餐盘
  48. /// </summary>
  49. /// <param name="inputDto"></param>
  50. /// <returns></returns>
  51. [HttpPost("/api/WeighOrder/AddWeighOrderDiningPlate")]
  52. public async Task<bool> AddWeighOrderDiningPlate(List<WeighOrderDiningPlateCreateDto> inputDto)
  53. {
  54. return await _weighOrderService.AddWeighOrderDiningPlate(inputDto);
  55. }
  56. /// <summary>
  57. /// 查询订单商品
  58. /// </summary>
  59. /// <param name="inputDto"></param>
  60. /// <returns></returns>
  61. [HttpPost("/api/WeighOrder/GetWeighOrder")]
  62. public async Task<WeighOrderDto> GetWeighOrder(GetOrderInputDto inputDto)
  63. {
  64. return await _weighOrderService.GetWeighOrder(inputDto);
  65. }
  66. /// <summary>
  67. /// 修改订单状态
  68. /// </summary>
  69. /// <returns></returns>
  70. [HttpPost("/api/WeighOrder/UpdateWeighOrderStates")]
  71. public async Task<bool> UpdateWeighOrderStates(WeighOrderUpdateDto inputDto)
  72. {
  73. return await _weighOrderService.UpdateWeighOrderStates(inputDto);
  74. }
  75. /// <summary>
  76. /// 添加 餐盘解绑记录
  77. /// </summary>
  78. /// <param name="inputDto">餐盘ID</param>
  79. /// <returns></returns>
  80. [HttpPost("/api/WeighOrder/AddWeighOrderDiningPlateUnbindRecord"), AllowAnonymous]
  81. public async Task<bool> AddWeighOrderDiningPlateUnbindRecord(List<string> inputDto)
  82. {
  83. return await _weighOrderService.AddWeighOrderDiningPlateUnbindRecord(inputDto);
  84. }
  85. /// <summary>
  86. /// 获取餐盘绑定信息
  87. /// </summary>
  88. /// <param name="inputDto">餐盘ID</param>
  89. /// <returns></returns>
  90. [HttpPost("/api/WeighOrder/GetDiningPlateOccupyInfo"), AllowAnonymous]
  91. public async Task<List<DiningPlateDto>> GetDiningPlateOccupyInfo(List<string> inputDto)
  92. {
  93. return await _weighOrderService.GetDiningPlateOccupyInfo(inputDto);
  94. }
  95. }
  96. }