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

120 lines
4.2 KiB

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