| | |
| | | using CoreCms.Net.Model.FromBody; |
| | | using CoreCms.Net.Model.ViewModels.DTO; |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using CoreCms.Net.Services; |
| | | using CoreCms.Net.Utility.Extensions; |
| | | using CoreCms.Net.Utility.Helper; |
| | | using Microsoft.AspNetCore.Authorization; |
| | |
| | | private readonly ICoreCmsUserServices _userServices; |
| | | private readonly ICoreCmsClerkServices _clerkServices; |
| | | private readonly ICoreCmsInvoiceServices _invoiceServices; |
| | | |
| | | private readonly ICoreCmsPlanOrderServices _planOrderServices; |
| | | private readonly ICoreCmsPlanOrderItemServices _planOrderItemServices; |
| | | |
| | | /// <summary> |
| | | /// 构造函数 |
| | |
| | | , ICoreCmsBillAftersalesServices aftersalesServices |
| | | , ICoreCmsSettingServices settingServices |
| | | , ICoreCmsAreaServices areaServices |
| | | , ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository, ICoreCmsUserServices userServices, ICoreCmsClerkServices clerkServices, ICoreCmsInvoiceServices invoiceServices) |
| | | , ICoreCmsBillReshipServices reshipServices, ICoreCmsShipServices shipServices, ICoreCmsLogisticsServices logisticsServices, ICoreCmsOrderDistributionModelServices orderDistributionModelServices, IRedisOperationRepository redisOperationRepository, ICoreCmsUserServices userServices, ICoreCmsClerkServices clerkServices, ICoreCmsInvoiceServices invoiceServices |
| | | , ICoreCmsPlanOrderServices planOrderServices |
| | | , ICoreCmsPlanOrderItemServices planOrderItemServices) |
| | | { |
| | | _user = user; |
| | | _orderServices = orderServices; |
| | |
| | | _userServices = userServices; |
| | | _clerkServices = clerkServices; |
| | | _invoiceServices = invoiceServices; |
| | | _planOrderServices = planOrderServices; |
| | | _planOrderItemServices = planOrderItemServices; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 获取计划订单列表微信小程序======================================================= |
| | | |
| | | /// <summary> |
| | | /// 获取计划订单列表微信小程序 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Authorize] |
| | | public async Task<WebApiCallBack> GetPlanOrderList([FromBody] GetOrderListPost entity) |
| | | { |
| | | var jm = await _planOrderServices.GetOrderList(entity.status, _user.ID, entity.page, entity.limit); |
| | | return jm; |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 获取计划订单详情======================================================= |
| | | |
| | | /// <summary> |
| | | /// 获取计划订单详情 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Authorize] |
| | | public async Task<WebApiCallBack> GetPlanOrder([FromBody] FMStringId entity) |
| | | { |
| | | var jm = new WebApiCallBack(); |
| | | |
| | | var model = await _planOrderServices.QueryByIdAsync(entity.id); |
| | | if (model == null) |
| | | { |
| | | jm.msg = "不存在此信息"; |
| | | return jm; |
| | | } |
| | | |
| | | //获取相关状态描述说明转换 |
| | | model.statusText = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.PlanOrderTiJiao>(model.status); |
| | | var modelItem = await _planOrderItemServices.QueryListByClauseAsync(p => p.orderId == entity.id, p => p.specification, OrderByType.Asc); |
| | | |
| | | jm.code = 0; |
| | | jm.status = true; |
| | | jm.data = new |
| | | { |
| | | model, |
| | | modelItem, |
| | | }; |
| | | |
| | | return jm; |
| | | } |
| | | |
| | | |
| | | #region 修改计划订单================================================== |
| | | /// <summary> |
| | | /// 修改计划订单 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Authorize] |
| | | public async Task<WebApiCallBack> UpdatePlanOrder([FromBody] CreateOrder entity) |
| | | { |
| | | var jm = new WebApiCallBack(); |
| | | |
| | | |
| | | |
| | | try |
| | | { |
| | | |
| | | |
| | | if (string.IsNullOrEmpty(entity.itemIds)) |
| | | { |
| | | jm.data = 10000; |
| | | jm.msg = GlobalErrorCodeVars.Code10000; |
| | | return jm; |
| | | } |
| | | |
| | | jm = await _planOrderServices.ToUpdate(entity.orderId , _user.ID, _user.Name, entity.status, entity.itemIds, entity.itemNums); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | jm.msg = "数据处理异常"; |
| | | jm.otherData = e; |
| | | } |
| | | |
| | | |
| | | return jm; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 取消订单==================================================== |
| | | |
| | | /// <summary> |