Просмотр исходного кода

合并刘洋的分支丢失的代码

lichunlei 4 лет назад
Родитель
Сommit
0f6b19cd22

+ 21 - 2
Areas/Admin/Controllers/MainServer/ActiveRewardController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -50,7 +51,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 激活奖励记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(ActiveReward data, string MerchantNo, string MerchantName, string MakerCode, string RealName, string MerMakerCode, string MerRealName, string ParentMakerCode, string ParentRealName, string ParentParentMakerCode, string ParentParentRealName, string StoreNo, string StoreName, string SnTypeSelect, string ActTypeSelect, int page = 1, int limit = 30)
+        public JsonResult IndexData(ActiveReward data, string right, string BrandId, string MerchantNo, string MerchantName, string MakerCode, string RealName, string MerMakerCode, string MerRealName, string ParentMakerCode, string ParentRealName, string ParentParentMakerCode, string ParentParentRealName, string StoreNo, string StoreName, string SnTypeSelect, string ActTypeSelect, string ActDateData, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -61,6 +62,10 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("ActDate", "3"); //激活时间
             Fields.Add("TopUserId", "0"); //顶级创客
 
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            ViewBag.BrandId = BrandId;
+
             string condition = " and Status>-1";
             //商户编号
             if (!string.IsNullOrEmpty(MerchantNo))
@@ -133,6 +138,14 @@ namespace MySystem.Areas.Admin.Controllers
                 condition += " and ActType=" + ActTypeSelect;
             }
 
+            if(!string.IsNullOrEmpty(ActDateData))
+            {
+                string[] datelist = ActDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and ActDate>='" + start + " 00:00:00' and ActDate<='" + end + " 23:59:59'";
+            }
+
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("ActiveReward", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
@@ -189,7 +202,13 @@ namespace MySystem.Areas.Admin.Controllers
                 if(ActType == 3) dic["ActType"] = "循环机划拨激活";
             }            
             Dictionary<string, object> other = new Dictionary<string, object>();
-            other.Add("RewardAmount", 0);
+            string RewardAmount = "0.00";//奖励金额
+            DataTable dt = OtherMySqlConn.dtable("select sum(RewardAmount) from ActiveReward where BrandId='" + ViewBag.BrandId + "'" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                RewardAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            other.Add("RewardAmount", RewardAmount);
             obj.Add("other", other);
             return Json(obj);
         }

+ 17 - 2
Areas/Admin/Controllers/MainServer/FluxProfitDetailController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -50,7 +51,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 流量分佣明细列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(FluxProfitDetail data, string MakerCode, string RealName, string TopMakerCode, string TopRealName, string MerUserTypeSelect, string ProfitTypeSelect, int page = 1, int limit = 30)
+        public JsonResult IndexData(FluxProfitDetail data, string MakerCode, string RealName, string TopMakerCode, string TopRealName, string CreateDateData, string MerUserTypeSelect, string ProfitTypeSelect, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -92,6 +93,14 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and ProfitType=" + ProfitTypeSelect;
             }
+            //交易时间
+            if(!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and TradeDate>='" + start + " 00:00:00' and TradeDate>='" + end + " 23:59:59'";
+            }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("FluxProfitDetail", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
@@ -122,7 +131,13 @@ namespace MySystem.Areas.Admin.Controllers
 
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
-            other.Add("ProfitAmt", 0);
+            string ProfitAmt = "0.00";//分佣总金额
+            DataTable dt = OtherMySqlConn.dtable("select sum(FluxProfitAmt) from FluxProfitDetail where 1=1" + condition);
+            if(dt.Rows.Count > 0)
+            {
+                ProfitAmt = dt.Rows[0][0].ToString();
+            }
+            other.Add("ProfitAmt", ProfitAmt);
             obj.Add("other", other);
             return Json(obj);
         }

+ 15 - 2
Areas/Admin/Controllers/MainServer/FluxProfitSummaryController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -110,8 +111,20 @@ namespace MySystem.Areas.Admin.Controllers
                 if (CheckStatus == 1) dic["CheckStatus"] = "已验证和同步";
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
-            other.Add("TradeCount", 0);
-            other.Add("FluxProfit", 0);
+            string TradeCount = "0.00";//流量费交易笔数
+            string FluxProfit = "0.00";//分佣总金额
+            DataTable dt = OtherMySqlConn.dtable("select count(0) from FluxProfitSummary where BrandId=3 or BrandId=5" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                TradeCount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            dt = OtherMySqlConn.dtable("select sum(FluxProfitAmt) from FluxProfitSummary where BrandId=3 or BrandId=5" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                FluxProfit = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            other.Add("TradeCount", TradeCount);
+            other.Add("FluxProfit", FluxProfit);
             obj.Add("other", other);
             return Json(obj);
         }

+ 15 - 2
Areas/Admin/Controllers/MainServer/MachineApplyController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -165,8 +166,20 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["ExpressInfo"] = dic["ExpressName"].ToString() + "<br />" + dic["ExpressNo"].ToString();
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
-            other.Add("ApplyCount", 0);
-            other.Add("SendCount", 0);
+            string ApplyCount = "0.00";//申请机具数
+            string SendCount = "0.00";//发货机具数
+            DataTable dt = OtherMySqlConn.dtable("select sum(ApplyDeviceNum) from MachineApply where SendStatus=0" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                ApplyCount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            dt = OtherMySqlConn.dtable("select sum(ApplyDeviceNum) from MachineApply where SendStatus=1" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                SendCount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            other.Add("ApplyCount", ApplyCount);
+            other.Add("SendCount", SendCount);
             obj.Add("other", other);
             return Json(obj);
         }

+ 14 - 4
Areas/Admin/Controllers/MainServer/MerchantRebateDetailController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -98,10 +99,19 @@ namespace MySystem.Areas.Admin.Controllers
                 // if (SyncStatus == 1) dic["SyncStatus"] = "已验证和同步";
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
-            other.Add("CreditTradeAmt", 0);
-            other.Add("DebitTradeAmt", 0);
-            other.Add("CreditPrizeAmt", 0);
-            other.Add("DebitPrizeAmt", 0);
+            string CreditTradeAmt = "0.00", DebitTradeAmt = "0.00", CreditPrizeAmt = "0.00", DebitPrizeAmt = "0.00";
+            DataTable dt = OtherMySqlConn.dtable("select sum(CreditTradeAmt),sum(DebitTradeAmt),sum(CreditPrizeAmt),sum(DebitPrizeAmt) from MerchantRebateDetail where 1=1" + condition);
+            if(dt.Rows.Count > 0)
+            {
+                CreditTradeAmt = dt.Rows[0][0].ToString();
+                DebitTradeAmt = dt.Rows[0][1].ToString();
+                CreditPrizeAmt = dt.Rows[0][2].ToString();
+                DebitPrizeAmt = dt.Rows[0][3].ToString();
+            }
+            other.Add("CreditTradeAmt", CreditTradeAmt);
+            other.Add("DebitTradeAmt", DebitTradeAmt);
+            other.Add("CreditPrizeAmt", CreditPrizeAmt);
+            other.Add("DebitPrizeAmt", DebitPrizeAmt);
             obj.Add("other", other);
             return Json(obj);
         }

+ 24 - 5
Areas/Admin/Controllers/MainServer/OpenRewardDetailController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -50,7 +51,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 开机奖励明细列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(OpenRewardDetail data, string MakerCode, string RealName, string MerchantNo, string MerchantName, int page = 1, int limit = 30)
+        public JsonResult IndexData(OpenRewardDetail data, string MakerCode, string RealName, string MerchantNo, string MerchantName, string TradeDateData, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -82,6 +83,14 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and MerchantId in (select MerchantId from MerchantForName where Name='" + MerchantName + "')";
             }
+            // 交易时间
+            if(!string.IsNullOrEmpty(TradeDateData))
+            {
+                string[] datelist = TradeDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and TradeDate>='" + start + " 00:00:00' and TradeDate>='" + end + " 23:59:59'";
+            }
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("OpenRewardDetail", Fields, "Id desc", "0", page, limit, condition);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
@@ -138,10 +147,20 @@ namespace MySystem.Areas.Admin.Controllers
                 
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
-            other.Add("CreditTradeAmt", 0);
-            other.Add("DebitTradeAmt", 0);
-            other.Add("CreditPrizeAmt", 0);
-            other.Add("DebitPrizeAmt", 0);
+            string CreditTradeAmt = "0.00", DebitTradeAmt = "0.00", CreditRewardAmount = "0.00", DebitRewardAmount = "0.00";//贷记卡交易总额 借记卡交易总额 贷记卡交易奖励金额 借记记卡交易奖励金额
+            DataTable dt = OtherMySqlConn.dtable("select sum(CreditTradeAmt),sum(DebitTradeAmt),sum(CreditRewardAmount),sum(DebitRewardAmount) from OpenRewardDetail where 1=1" + condition);
+            if(dt.Rows.Count > 0)
+            {
+                CreditTradeAmt = dt.Rows[0][0].ToString();
+                DebitTradeAmt = dt.Rows[0][1].ToString();
+                CreditRewardAmount = dt.Rows[0][2].ToString();
+                DebitRewardAmount = dt.Rows[0][3].ToString();
+
+            }
+            other.Add("CreditTradeAmt", CreditTradeAmt);
+            other.Add("DebitTradeAmt", DebitTradeAmt);
+            other.Add("CreditRewardAmount", CreditRewardAmount);
+            other.Add("DebitRewardAmount", DebitRewardAmount);
             obj.Add("other", other);
             return Json(obj);
         }

+ 9 - 0
Areas/Admin/Controllers/MainServer/OpenSnSnapshotController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -121,6 +122,14 @@ namespace MySystem.Areas.Admin.Controllers
                 if (Status == 1) dic["Status"] = "成功";
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
+            string PrizeAmt = "0.00", BuyPosCount = "0.00", StadardBuyPosCount = "0.00";//奖励金额 购买机数量 标准购买机数量
+            DataTable dt = OtherMySqlConn.dtable("select sum(PrizeAmt),sum(BuyPosCount),sum(StadardBuyPosCount) from OpenSnSnapshot where 1=1" + condition);
+            if(dt.Rows.Count > 0)
+            {
+                PrizeAmt = dt.Rows[0][0].ToString();
+                BuyPosCount = dt.Rows[0][1].ToString();
+                StadardBuyPosCount = dt.Rows[0][2].ToString();
+            }
             other.Add("PrizeAmt", 0);
             other.Add("BuyPosCount", 0);
             other.Add("StadardBuyPosCount", 0);

+ 97 - 3
Areas/Admin/Controllers/MainServer/OrdersController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -115,7 +116,7 @@ namespace MySystem.Areas.Admin.Controllers
             //商品名称
             if (!string.IsNullOrEmpty(ProductIdSelect))
             {
-                condition += " and ProductId=" + ProductIdSelect;
+                condition += " and Id in (select OrderId from OrderProduct where ProductId="+ProductIdSelect+")";//表数据量过大时不适用
             }
             //仓库类型
             if (!string.IsNullOrEmpty(StoreTypeSelect))
@@ -194,6 +195,12 @@ namespace MySystem.Areas.Admin.Controllers
                 }
                 //商品名称
                 dic["ProductId"] = RelationClass.GetProductsInfo(int.Parse(dic["ProductId"].ToString()));
+                
+                //商品名称
+                int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
+                OrderProduct orderProducts = db.OrderProduct.FirstOrDefault(m => m.OrderId == Id) ?? new OrderProduct();
+                dic["ProductName"] = orderProducts.ProductName;
+
                 //仓库归属创客
                 int StoreUserId = int.Parse(function.CheckInt(dic["StoreUserId"].ToString()));
                 Users storeuserid_Users = db.Users.FirstOrDefault(m => m.Id == StoreUserId) ?? new Users();
@@ -214,12 +221,99 @@ namespace MySystem.Areas.Admin.Controllers
 
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
-            other.Add("SuccessAmount", 0);
-            other.Add("FailAmount", 0);
+            string SuccessAmount = "0.00";//支付成功总金额
+            string FailAmount = "0.00";//支付失败总金额
+            DataTable dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=0" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                SuccessAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=1" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                FailAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            other.Add("SuccessAmount", SuccessAmount);
+            other.Add("FailAmount", FailAmount);
             obj.Add("other", other);
             return Json(obj);
         }
 
+
+        public JsonResult IndexDatas(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)
+        {
+            string condition = " and Status>-1";
+            //创客创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            //创客真实姓名
+            if (!string.IsNullOrEmpty(UserIdRealName))
+            {
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
+            }
+            //支付方式
+            if (!string.IsNullOrEmpty(PayModeSelect))
+            {
+                condition += " and PayMode=" + PayModeSelect;
+            }
+            //仓库仓库编号
+            if (!string.IsNullOrEmpty(StoreIdStoreNo))
+            {
+                condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
+            }
+            //仓库仓库名称
+            if (!string.IsNullOrEmpty(StoreIdStoreName))
+            {
+                condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
+            }
+            //退款状态
+            if (!string.IsNullOrEmpty(RefundStatusSelect))
+            {
+                condition += " and RefundStatus=" + RefundStatusSelect;
+            }
+            //提货类型
+            if (!string.IsNullOrEmpty(DeliveryTypeSelect))
+            {
+                condition += " and DeliveryType=" + DeliveryTypeSelect;
+            }
+            //发货状态
+            if (!string.IsNullOrEmpty(SendStatusSelect))
+            {
+                condition += " and SendStatus=" + SendStatusSelect;
+            }
+            //商品名称
+            if (!string.IsNullOrEmpty(ProductIdSelect))
+            {
+                condition += " and ProductId=" + ProductIdSelect;
+            }
+            //仓库类型
+            if (!string.IsNullOrEmpty(StoreTypeSelect))
+            {
+                condition += " and StoreType=" + StoreTypeSelect;
+            }
+            //仓库归属创客创客编号
+            if (!string.IsNullOrEmpty(StoreUserIdMakerCode))
+            {
+                condition += " and StoreUserId in (select StoreUserId from UserForMakerCode where MakerCode='" + StoreUserIdMakerCode + "')";
+            }
+            //仓库归属创客真实姓名
+            if (!string.IsNullOrEmpty(StoreUserIdRealName))
+            {
+                condition += " and StoreUserId in (select StoreUserId from UserForRealName where RealName='" + StoreUserIdRealName + "')";
+            }
+            //支付状态
+            if (!string.IsNullOrEmpty(PayStatusSelect))
+            {
+                condition += " and PayStatus=" + PayStatusSelect;
+            }
+            List<Dictionary<string, object>> other = new List<Dictionary<string, object>>();
+            Dictionary<string, object> obj = new Dictionary<string, object>();
+            DataTable dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=0" + condition);
+            return null;
+        }
+
         #endregion
 
         #region 增加创客订单

+ 16 - 0
Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs

@@ -7,6 +7,7 @@ using System.Web;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Data;
 using System.Threading.Tasks;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Http;
@@ -138,6 +139,21 @@ namespace MySystem.Areas.Admin.Controllers
 
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
+            string TotalCount = "0.00";//总机具数
+            string KysCount99 = "0.00";
+            string KssCount99 = "0.00";
+            string KssCoun198 = "0.00";
+            string KssCount298 = "0.00";
+            DataTable dt = OtherMySqlConn.dtable("select count(0) from PosMachinesTwo" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                TotalCount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            }
+            // dt = OtherMySqlConn.dtable("select sum(TotalPrice) from Orders where PayStatus=1" + condition);
+            // if (dt.Rows.Count > 0)
+            // {
+            //     FailAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString())).ToString("f2");
+            // }
             other.Add("TotalCount", 0);
             other.Add("KysCount99", 0);
             other.Add("KssCount99", 0);