From 68e78d9fbd99870e147d668b6daf8820f4deeb6a Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期四, 13 六月 2024 10:39:09 +0800
Subject: [PATCH] no message
---
CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsPlanOrderController.cs | 86 ++++++++++++++++++++++++++++++++++++++-----
1 files changed, 76 insertions(+), 10 deletions(-)
diff --git a/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsPlanOrderController.cs b/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsPlanOrderController.cs
index 31daf60..829d941 100644
--- a/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsPlanOrderController.cs
+++ b/CoreCms.Net.Web.Admin/Controllers/Order/CoreCmsPlanOrderController.cs
@@ -43,6 +43,7 @@
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
{
@@ -64,6 +65,8 @@
private readonly IHttpContextUser _user;
private readonly ICoreCmsPlanOrderServices _planOrderServices;
private readonly ICoreCmsAreaServices _areaServices;
+ private readonly ICoreCmsOrderServices _orderServices;
+ private readonly ICoreCmsOrderItemServices _orderItemServices;
/// <summary>
@@ -76,6 +79,8 @@
, IHttpContextUser user
, ICoreCmsPlanOrderServices planOrderServices
, ICoreCmsAreaServices areaServices
+ , ICoreCmsOrderServices orderServices
+ , ICoreCmsOrderItemServices orderItemServices
)
{
_webHostEnvironment = webHostEnvironment;
@@ -85,6 +90,9 @@
_user = user;
_planOrderServices = planOrderServices;
_areaServices = areaServices;
+ _orderServices = orderServices;
+ _orderItemServices = orderItemServices;
+
}
#region 鑾峰彇鍒楄〃============================================================
@@ -259,7 +267,7 @@
{
//鑾峰彇鐩稿叧鐘舵�佹弿杩拌鏄庤浆鎹�
order.statusText = EnumHelper.GetEnumDescriptionByValue<GlobalEnumVars.PlanOrderTiJiao>(order.status);
-
+ order.keYongAmount = order.keYongAmount - order.huaFeiAmount;
}
}
@@ -292,7 +300,26 @@
return jm;
}
#endregion
+ #region 閫夋嫨鐪�============================================================
+ // POST: Api/CoreCmsPlanOrder/GetIndex
+ /// <summary>
+ /// 閫夋嫨甯�
+ /// </summary>
+ /// <returns></returns>
+ [Description("閫夋嫨鐪�")]
+ [AllowAnonymous]
+ public async Task<AdminUiCallBack> GetCityId(int shengid = 0)
+ {
+ //杩斿洖鏁版嵁
+ var jm = new AdminUiCallBack { code = 0 };
+ var shi = await _areaServices.QueryListByClauseAsync(p => p.parentId == shengid);
+
+ jm.data = shi;
+
+ return jm;
+ }
+ #endregion
#region 閫夋嫨甯�============================================================
// POST: Api/CoreCmsPlanOrder/GetIndex
@@ -368,17 +395,27 @@
}
//鑾峰彇鐩稿叧鐘舵�佹弿杩拌鏄庤浆鎹�
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;
@@ -471,7 +508,7 @@
jm.msg = GlobalConstVars.DataisNo;
return jm;
}
- jm = await _CoreCmsPlanOrderServices.DeleteByIdAsync(entity.id);
+ jm = await _CoreCmsPlanOrderServices.DeleteByIdAsync(entity.id , _user.Name);
return jm;
}
@@ -486,9 +523,9 @@
/// <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;
}
@@ -515,17 +552,46 @@
}
//鑾峰彇鐩稿叧鐘舵�佹弿杩拌鏄庤浆鎹�
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
+ modelItem1 ,
+ coreCmsOrderItems
};
jm.code = 0;
//jm.data = model;
--
Gitblit v1.9.1