|
|
@@ -55,7 +55,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 创客订单列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(Orders data, string OrderNo, string TradeNo, string RealName, string Mobile, string StoreContact, string ErpCode, string SnNos, string PayDateData, string CreateDateData, string SendDateData, string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(Orders data, string OrderNo, string TradeNo, string RealName, string Mobile, string StoreContact, string ErpCode, string SnNos, string PayDateData, string CreateDateData, string SendDateData, string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string StatusSelect, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
@@ -168,7 +168,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string end = datelist[1];
|
|
|
condition += " and SendDate>='" + start + " 00:00:00' and SendDate<='" + end + " 23:59:59'";
|
|
|
}
|
|
|
-
|
|
|
+ //订单状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ {
|
|
|
+ condition += " and Status=" + StatusSelect;
|
|
|
+ }
|
|
|
//退款状态
|
|
|
if (!string.IsNullOrEmpty(RefundStatusSelect))
|
|
|
{
|
|
|
@@ -210,51 +214,67 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["Address"] = dic["Areas"].ToString() + dic["Address"].ToString();
|
|
|
dic["RecieveInfo"] = dic["RealName"].ToString() + "<br />" + dic["Mobile"].ToString();
|
|
|
dic["ErpInfo"] = dic["ErpCode"].ToString() + "<br />" + dic["ErpName"].ToString();
|
|
|
+
|
|
|
//创客
|
|
|
int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
dic["UserInfo"] = userid_Users.MakerCode + "<br />" + userid_Users.RealName;
|
|
|
dic.Remove("UserId");
|
|
|
+
|
|
|
+ //订单状态
|
|
|
+ int Status = int.Parse(dic["Status"].ToString());
|
|
|
+ if (Status == -1) dic["Status"] = "已取消";
|
|
|
+ if (Status == 1) dic["Status"] = "已支付";
|
|
|
+ if (Status == 2) dic["Status"] = "已完成";
|
|
|
+ if (Status == 3) dic["Status"] = "已发货";
|
|
|
+ if (Status == 4) dic["Status"] = "已退款";
|
|
|
+
|
|
|
//物流名称
|
|
|
dic["ErpName"] = RelationClass.GetErpCompanysInfo(dic["ErpName"].ToString());
|
|
|
+
|
|
|
//支付方式
|
|
|
int PayMode = int.Parse(dic["PayMode"].ToString());
|
|
|
if (PayMode == 1) dic["PayMode"] = "支付宝";
|
|
|
if (PayMode == 2) dic["PayMode"] = "微信";
|
|
|
if (PayMode == 3) dic["PayMode"] = "账户余额";
|
|
|
if (PayMode == 0) dic["PayMode"] = "";
|
|
|
+
|
|
|
//仓库
|
|
|
int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
|
|
|
StoreHouse storeid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
|
|
|
+
|
|
|
//仓库类型
|
|
|
int StoreType = int.Parse(dic["StoreType"].ToString());
|
|
|
if (StoreType == 0) dic["StoreType"] = "总仓";
|
|
|
if (StoreType == 1) dic["StoreType"] = "分仓";
|
|
|
dic["Store"] = storeid_StoreHouse.StoreNo + "<br />" + dic["StoreType"].ToString();
|
|
|
dic.Remove("StoreId");
|
|
|
- //退款状态
|
|
|
- int RefundStatus = int.Parse(dic["RefundStatus"].ToString());
|
|
|
- if (RefundStatus == 0) dic["RefundStatusName"] = "未退款";
|
|
|
- if (RefundStatus == 1) dic["RefundStatusName"] = "已退款";
|
|
|
+
|
|
|
+ // //退款状态
|
|
|
+ // int RefundStatus = int.Parse(dic["RefundStatus"].ToString());
|
|
|
+ // if (RefundStatus == 0) dic["RefundStatusName"] = "未退款";
|
|
|
+ // if (RefundStatus == 1) dic["RefundStatusName"] = "已退款";
|
|
|
+
|
|
|
//提货类型
|
|
|
int DeliveryType = int.Parse(dic["DeliveryType"].ToString());
|
|
|
if (DeliveryType == 1) dic["DeliveryType"] = "邮寄到付";
|
|
|
if (DeliveryType == 2) dic["DeliveryType"] = "上门自提";
|
|
|
if (DeliveryType == 0) dic["DeliveryType"] = "";
|
|
|
- //发货状态
|
|
|
- int SendStatus = int.Parse(dic["SendStatus"].ToString());
|
|
|
- if (SendStatus == -1) dic["SendStatusName"] = "已驳回";
|
|
|
- if (SendStatus == 0) dic["SendStatusName"] = "未发货";
|
|
|
- if (SendStatus == 1) dic["SendStatusName"] = "已发货";
|
|
|
- if (SendStatus == 2) dic["SendStatusName"] = "已退货";
|
|
|
- if (SendStatus == 0)
|
|
|
- {
|
|
|
- dic["SendInfo"] = dic["SendStatusName"];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- dic["SendInfo"] = dic["SendStatusName"].ToString() + "<br />" + dic["SendDate"].ToString();
|
|
|
- }
|
|
|
+
|
|
|
+ // //发货状态
|
|
|
+ // int SendStatus = int.Parse(dic["SendStatus"].ToString());
|
|
|
+ // if (SendStatus == -1) dic["SendStatusName"] = "已驳回";
|
|
|
+ // if (SendStatus == 0) dic["SendStatusName"] = "未发货";
|
|
|
+ // if (SendStatus == 1) dic["SendStatusName"] = "已发货";
|
|
|
+ // if (SendStatus == 2) dic["SendStatusName"] = "已退货";
|
|
|
+ // if (SendStatus == 0)
|
|
|
+ // {
|
|
|
+ // dic["SendInfo"] = dic["SendStatusName"];
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // dic["SendInfo"] = dic["SendStatusName"].ToString() + "<br />" + dic["SendDate"].ToString();
|
|
|
+ // }
|
|
|
//商品名称
|
|
|
dic["ProductId"] = RelationClass.GetProductsInfo(int.Parse(dic["ProductId"].ToString()));
|
|
|
|
|
|
@@ -266,23 +286,29 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if (product.ProductKind == 1) dic["ProductKind"] = "实物商品";
|
|
|
if (product.ProductKind == 2) dic["ProductKind"] = "虚拟商品";
|
|
|
|
|
|
+ //退款时间
|
|
|
+ var orderRefund = db.OrderRefund.FirstOrDefault(m => m.OrderId == Id) ?? new OrderRefund();
|
|
|
+ dic["RefundDate"] = orderRefund.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
//仓库归属创客
|
|
|
int StoreUserId = int.Parse(function.CheckInt(dic["StoreUserId"].ToString()));
|
|
|
Users storeuserid_Users = db.Users.FirstOrDefault(m => m.Id == StoreUserId) ?? new Users();
|
|
|
dic["StoreFrom"] = storeuserid_Users.MakerCode + "<br />" + storeid_StoreHouse.StoreName;
|
|
|
dic.Remove("StoreUserId");
|
|
|
+
|
|
|
//顶级创客
|
|
|
int TopUserId = int.Parse(function.CheckInt(dic["TopUserId"].ToString()));
|
|
|
Users topuserid_Users = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
|
|
|
dic["TopUserInfo"] = topuserid_Users.MakerCode + "<br />" + topuserid_Users.RealName;
|
|
|
dic.Remove("TopUserId");
|
|
|
- //支付状态
|
|
|
- int PayStatus = int.Parse(dic["PayStatus"].ToString());
|
|
|
- if (PayStatus == 0) dic["PayStatusName"] = "未支付";
|
|
|
- if (PayStatus == 1) dic["PayStatusName"] = "支付成功";
|
|
|
- if (PayStatus == 2) dic["PayStatusName"] = "支付失败";
|
|
|
- if (PayStatus == 3) dic["PayStatusName"] = "支付锁定中";
|
|
|
- if (PayStatus == 4) dic["PayStatusName"] = "支付处理中";
|
|
|
+
|
|
|
+ // //支付状态
|
|
|
+ // int PayStatus = int.Parse(dic["PayStatus"].ToString());
|
|
|
+ // if (PayStatus == 0) dic["PayStatusName"] = "未支付";
|
|
|
+ // if (PayStatus == 1) dic["PayStatusName"] = "支付成功";
|
|
|
+ // if (PayStatus == 2) dic["PayStatusName"] = "支付失败";
|
|
|
+ // if (PayStatus == 3) dic["PayStatusName"] = "支付锁定中";
|
|
|
+ // if (PayStatus == 4) dic["PayStatusName"] = "支付处理中";
|
|
|
|
|
|
}
|
|
|
Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
@@ -1049,7 +1075,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 导出Excel
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult ExportsExcel(Orders data, string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, string CreateDateData, string SendDateData, string PayDateData, string RedisKey = "ExportKey")
|
|
|
+ public JsonResult ExportsExcel(Orders data, string UserIdMakerCode, string UserIdRealName, string PayModeSelect, string StoreIdStoreNo, string StoreIdStoreName, string StatusSelect, string RefundStatusSelect, string DeliveryTypeSelect, string SendStatusSelect, string ProductIdSelect, string StoreTypeSelect, string StoreUserIdMakerCode, string StoreUserIdRealName, string PayStatusSelect, string CreateDateData, string SendDateData, string PayDateData, string RedisKey = "ExportKey")
|
|
|
{
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
// Fields.Add("CreateDate", "3"); //时间
|
|
|
@@ -1088,6 +1114,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and StoreId in (select StoreId from StoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
|
|
|
}
|
|
|
+ //订单状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ {
|
|
|
+ condition += " and Status=" + StatusSelect;
|
|
|
+ }
|
|
|
//退款状态
|
|
|
if (!string.IsNullOrEmpty(RefundStatusSelect))
|
|
|
{
|
|
|
@@ -1152,7 +1183,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
string end = datelist[1];
|
|
|
condition += " and SendDate>='" + start + " 00:00:00' and SendDate<='" + end + " 23:59:59'";
|
|
|
}
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Orders", Fields, "Id desc", "0", 1, 20000, condition, "UserId,OrderNo,RealName,Mobile,TotalPrice,Areas,Address,ErpName,ErpCode,SendDate,PayMode,PayDate,TradeNo,StoreId,RefundStatus,DeliveryType,SendStatus,ProductId,StoreContact,StoreType,StoreUserId,TopUserId,PayStatus,BuyCount,Remark,Id", false);
|
|
|
+ // Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Orders", Fields, "Id desc", "0", 1, 20000, condition, "UserId,OrderNo,RealName,Mobile,TotalPrice,Areas,Address,ErpName,ErpCode,SendDate,PayMode,PayDate,TradeNo,StoreId,RefundStatus,DeliveryType,SendStatus,ProductId,StoreContact,StoreType,StoreUserId,TopUserId,PayStatus,BuyCount,Remark,Id", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Orders", Fields, "Id desc", "0", 1, 20000, condition, "UserId,OrderNo,RealName,Mobile,TotalPrice,Areas,Address,ErpName,ErpCode,SendDate,PayMode,PayDate,TradeNo,StoreId,DeliveryType,ProductId,StoreContact,StoreType,StoreUserId,TopUserId,Status,BuyCount,Remark,Id", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
@@ -1162,59 +1194,70 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["UserIdMakerCode"] = userid_Users.MakerCode;
|
|
|
dic["UserIdRealName"] = userid_Users.RealName;
|
|
|
dic.Remove("UserId");
|
|
|
+
|
|
|
//物流名称
|
|
|
dic["ErpName"] = RelationClass.GetErpCompanysInfo(dic["ErpName"].ToString());
|
|
|
+
|
|
|
//支付方式
|
|
|
int PayMode = int.Parse(dic["PayMode"].ToString());
|
|
|
if (PayMode == 1) dic["PayMode"] = "支付宝";
|
|
|
if (PayMode == 2) dic["PayMode"] = "微信";
|
|
|
if (PayMode == 3) dic["PayMode"] = "账户余额";
|
|
|
if (PayMode == 0) dic["PayMode"] = "";
|
|
|
+
|
|
|
//仓库
|
|
|
int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
|
|
|
StoreHouse storeid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new StoreHouse();
|
|
|
dic["StoreIdStoreNo"] = storeid_StoreHouse.StoreNo;
|
|
|
dic["StoreIdStoreName"] = storeid_StoreHouse.StoreName;
|
|
|
dic.Remove("StoreId");
|
|
|
- //退款状态
|
|
|
- int RefundStatus = int.Parse(dic["RefundStatus"].ToString());
|
|
|
- if (RefundStatus == 0) dic["RefundStatus"] = "未退款";
|
|
|
- if (RefundStatus == 1) dic["RefundStatus"] = "已退款";
|
|
|
+
|
|
|
+ // //退款状态
|
|
|
+ // int RefundStatus = int.Parse(dic["RefundStatus"].ToString());
|
|
|
+ // if (RefundStatus == 0) dic["RefundStatus"] = "未退款";
|
|
|
+ // if (RefundStatus == 1) dic["RefundStatus"] = "已退款";
|
|
|
+
|
|
|
//提货类型
|
|
|
int DeliveryType = int.Parse(dic["DeliveryType"].ToString());
|
|
|
if (DeliveryType == 1) dic["DeliveryType"] = "邮寄到付";
|
|
|
if (DeliveryType == 2) dic["DeliveryType"] = "上门自提";
|
|
|
if (DeliveryType == 0) dic["DeliveryType"] = "";
|
|
|
- //发货状态
|
|
|
- int SendStatus = int.Parse(dic["SendStatus"].ToString());
|
|
|
- if (SendStatus == 0) dic["SendStatus"] = "未发货";
|
|
|
- if (SendStatus == 1) dic["SendStatus"] = "已发货";
|
|
|
- if (SendStatus == 2) dic["SendStatus"] = "已退货";
|
|
|
+
|
|
|
+ // //发货状态
|
|
|
+ // int SendStatus = int.Parse(dic["SendStatus"].ToString());
|
|
|
+ // if (SendStatus == 0) dic["SendStatus"] = "未发货";
|
|
|
+ // if (SendStatus == 1) dic["SendStatus"] = "已发货";
|
|
|
+ // if (SendStatus == 2) dic["SendStatus"] = "已退货";
|
|
|
+
|
|
|
//商品名称
|
|
|
dic["ProductId"] = RelationClass.GetProductsInfo(int.Parse(dic["ProductId"].ToString()));
|
|
|
+
|
|
|
//仓库类型
|
|
|
int StoreType = int.Parse(dic["StoreType"].ToString());
|
|
|
if (StoreType == 0) dic["StoreType"] = "总仓";
|
|
|
if (StoreType == 1) dic["StoreType"] = "分仓";
|
|
|
+
|
|
|
//仓库归属创客
|
|
|
int StoreUserId = int.Parse(function.CheckInt(dic["StoreUserId"].ToString()));
|
|
|
Users storeuserid_Users = db.Users.FirstOrDefault(m => m.Id == StoreUserId) ?? new Users();
|
|
|
dic["StoreUserIdMakerCode"] = storeuserid_Users.MakerCode;
|
|
|
dic["StoreUserIdRealName"] = storeuserid_Users.RealName;
|
|
|
dic.Remove("StoreUserId");
|
|
|
+
|
|
|
//顶级创客
|
|
|
int TopUserId = int.Parse(function.CheckInt(dic["TopUserId"].ToString()));
|
|
|
Users topuserid_Users = db.Users.FirstOrDefault(m => m.Id == TopUserId) ?? new Users();
|
|
|
dic["TopUserIdMakerCode"] = topuserid_Users.MakerCode;
|
|
|
dic["TopUserIdRealName"] = topuserid_Users.RealName;
|
|
|
dic.Remove("TopUserId");
|
|
|
- //支付状态
|
|
|
- int PayStatus = int.Parse(dic["PayStatus"].ToString());
|
|
|
- if (PayStatus == 0) dic["PayStatus"] = "未支付";
|
|
|
- if (PayStatus == 1) dic["PayStatus"] = "支付成功";
|
|
|
- if (PayStatus == 2) dic["PayStatus"] = "支付失败";
|
|
|
- if (PayStatus == 3) dic["PayStatus"] = "支付锁定中";
|
|
|
- if (PayStatus == 4) dic["PayStatus"] = "支付处理中";
|
|
|
+
|
|
|
+ // //支付状态
|
|
|
+ // int PayStatus = int.Parse(dic["PayStatus"].ToString());
|
|
|
+ // if (PayStatus == 0) dic["PayStatus"] = "未支付";
|
|
|
+ // if (PayStatus == 1) dic["PayStatus"] = "支付成功";
|
|
|
+ // if (PayStatus == 2) dic["PayStatus"] = "支付失败";
|
|
|
+ // if (PayStatus == 3) dic["PayStatus"] = "支付锁定中";
|
|
|
+ // if (PayStatus == 4) dic["PayStatus"] = "支付处理中";
|
|
|
|
|
|
int OrderId = int.Parse(dic["Id"].ToString());
|
|
|
List<OrderProduct> products = db.OrderProduct.Where(m => m.OrderId == OrderId).ToList();
|
|
|
@@ -1250,9 +1293,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
ReturnFields.Add("TradeNo", "支付交易号");
|
|
|
ReturnFields.Add("StoreIdStoreNo", "仓库编号");
|
|
|
ReturnFields.Add("StoreIdStoreName", "仓库名称");
|
|
|
- ReturnFields.Add("RefundStatus", "退款状态");
|
|
|
+ // ReturnFields.Add("RefundStatus", "退款状态");
|
|
|
ReturnFields.Add("DeliveryType", "提货类型");
|
|
|
- ReturnFields.Add("SendStatus", "发货状态");
|
|
|
+ // ReturnFields.Add("SendStatus", "发货状态");
|
|
|
ReturnFields.Add("ProductId", "商品名称");
|
|
|
ReturnFields.Add("StoreContact", "仓库联系人");
|
|
|
ReturnFields.Add("StoreType", "仓库类型");
|
|
|
@@ -1260,7 +1303,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
ReturnFields.Add("StoreUserIdRealName", "仓库归属创客姓名");
|
|
|
ReturnFields.Add("TopUserIdMakerCode", "顶级创客编号");
|
|
|
ReturnFields.Add("TopUserIdRealName", "顶级创客姓名");
|
|
|
- ReturnFields.Add("PayStatus", "支付状态");
|
|
|
+ // ReturnFields.Add("PayStatus", "支付状态");
|
|
|
ReturnFields.Add("BuyCount", "下单数量");
|
|
|
ReturnFields.Add("Remark", "订单备注");
|
|
|
ReturnFields.Add("ProductCode", "商品编号");
|