| | |
| | | using static SKIT.FlurlHttpClient.Wechat.Api.Models.CardCreateRequest.Types.MembershipCard.Types.Base.Types; |
| | | using static SKIT.FlurlHttpClient.Wechat.Api.Models.CgibinExpressDeliveryOpenMessageGetDeliveryListResponse.Types; |
| | | using System.Threading.Channels; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace CoreCms.Net.Web.Admin.Controllers |
| | | { |
| | |
| | | private readonly IHttpContextUser _user; |
| | | private readonly ICoreCmsPlanOrderServices _planOrderServices; |
| | | private readonly ICoreCmsAreaServices _areaServices; |
| | | private readonly ICoreCmsOrderServices _orderServices; |
| | | private readonly ICoreCmsOrderItemServices _orderItemServices; |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | , IHttpContextUser user |
| | | , ICoreCmsPlanOrderServices planOrderServices |
| | | , ICoreCmsAreaServices areaServices |
| | | , ICoreCmsOrderServices orderServices |
| | | , ICoreCmsOrderItemServices orderItemServices |
| | | ) |
| | | { |
| | | _webHostEnvironment = webHostEnvironment; |
| | |
| | | _user = user; |
| | | _planOrderServices = planOrderServices; |
| | | _areaServices = areaServices; |
| | | _orderServices = orderServices; |
| | | _orderItemServices = orderItemServices; |
| | | |
| | | } |
| | | |
| | | #region 获取列表============================================================ |
| | |
| | | { |
| | | //获取相关状态描述说明转换 |
| | | order.statusText = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.PlanOrderTiJiao>(order.status); |
| | | |
| | | order.keYongAmount = order.keYongAmount - order.huaFeiAmount; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | //获取相关状态描述说明转换 |
| | | model.statusText = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.PlanOrderTiJiao>(model.status); |
| | | |
| | | model.keYongAmount = model.keYongAmount - model.huaFeiAmount; |
| | | |
| | | var modelItem1 = await _planOrderItemServices.QueryListByClauseAsync(p => p.orderId == entity.id && p.isOld == true, p => p.specification, OrderByType.Asc); |
| | | |
| | | var modelItem2 = await _planOrderItemServices.QueryListByClauseAsync(p => p.orderId == entity.id && p.isOld == false, p => p.specification, OrderByType.Asc); |
| | | |
| | | foreach (var coreCmsPlanOrderItem in modelItem1) |
| | | { |
| | | var coreCmsPlanOrderItem1 = modelItem2.Where(p => p.name == coreCmsPlanOrderItem.name && p.specification == coreCmsPlanOrderItem.specification).FirstOrDefault(); |
| | | if (coreCmsPlanOrderItem1 != null) |
| | | { |
| | | coreCmsPlanOrderItem.idnew = coreCmsPlanOrderItem1.id; |
| | | coreCmsPlanOrderItem.numsnew = coreCmsPlanOrderItem1.nums; |
| | | coreCmsPlanOrderItem.amountnew = coreCmsPlanOrderItem1.amount; |
| | | } |
| | | } |
| | | |
| | | jm.data = new |
| | | { |
| | | model, |
| | | modelItem1, |
| | | modelItem2 |
| | | modelItem1 |
| | | }; |
| | | jm.code = 0; |
| | | // jm.data = model; |
| | |
| | | jm.msg = GlobalConstVars.DataisNo; |
| | | return jm; |
| | | } |
| | | jm = await _CoreCmsPlanOrderServices.DeleteByIdAsync(entity.id); |
| | | jm = await _CoreCmsPlanOrderServices.DeleteByIdAsync(entity.id , _user.Name); |
| | | |
| | | return jm; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | [Description("批量删除")] |
| | | public async Task<AdminUiCallBack> DoBatchDelete([FromBody]FMArrayIntIds entity) |
| | | public async Task<AdminUiCallBack> DoBatchDelete([FromBody]FMArrayStringIds entity) |
| | | { |
| | | var jm = await _CoreCmsPlanOrderServices.DeleteByIdsAsync(entity.id); |
| | | var jm = await _CoreCmsPlanOrderServices.DeleteByIdsAsync(entity.id, _user.Name); |
| | | return jm; |
| | | } |
| | | |
| | |
| | | } |
| | | //获取相关状态描述说明转换 |
| | | model.statusText = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.PlanOrderTiJiao>(model.status); |
| | | model.keYongAmount = model.keYongAmount - model.huaFeiAmount; |
| | | |
| | | |
| | | var modelItem1 = await _planOrderItemServices.QueryListByClauseAsync(p => p.orderId == entity.id && p.isOld == true, p => p.specification, OrderByType.Asc); |
| | | |
| | | var modelItem2 = await _planOrderItemServices.QueryListByClauseAsync(p => p.orderId == entity.id && p.isOld == false, p => p.specification, OrderByType.Asc); |
| | | |
| | | |
| | | foreach(var coreCmsPlanOrderItem in modelItem1) |
| | | { |
| | | var coreCmsPlanOrderItem1 = modelItem2.Where(p => p.name == coreCmsPlanOrderItem.name && p.specification == coreCmsPlanOrderItem.specification).FirstOrDefault(); |
| | | if (coreCmsPlanOrderItem1 != null) |
| | | { |
| | | coreCmsPlanOrderItem.idnew = coreCmsPlanOrderItem1.id; |
| | | coreCmsPlanOrderItem.numsnew = coreCmsPlanOrderItem1.nums; |
| | | coreCmsPlanOrderItem.amountnew = coreCmsPlanOrderItem1.amount; |
| | | } |
| | | } |
| | | var coreCmsOrderItems = new List<CoreCmsOrderItem>(); |
| | | //查询用计划订单积分购买的订单 |
| | | var coreCmsOrders = await _orderServices.QueryListByClauseAsync(p => p.planorderId == model.orderId && p.isdel == false); |
| | | if(coreCmsOrders!=null && coreCmsOrders.Count > 0) |
| | | { |
| | | var orderids = new List<string>(); |
| | | foreach(var coreCmsOrder in coreCmsOrders) |
| | | { |
| | | orderids.Add(coreCmsOrder.orderId); |
| | | } |
| | | coreCmsOrderItems = await _orderItemServices.QueryListByClauseAsync(p => orderids.Contains(p.orderId)); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | jm.data = new |
| | | { |
| | | model, |
| | | modelItem1, |
| | | modelItem2 |
| | | coreCmsOrderItems |
| | | }; |
| | | jm.code = 0; |
| | | //jm.data = model; |