DuGuYang 1 tahun lalu
induk
melakukan
b9335eec6a

+ 1 - 1
Areas/Api/Controllers/v1/MainServer/MerchantAmountSummayController.cs

@@ -32,7 +32,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             List<Dictionary<string, object>> dataList = ListDo(value);
             return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList });
         }
-        private List<Dictionary<string, object>> ListDo(string value)
+        public List<Dictionary<string, object>> ListDo(string value)
         {
             JsonData data = JsonMapper.ToObject(value);
             int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户

+ 9 - 4
Areas/Api/Controllers/v1/MainServer/MerchantDepositOrderController.cs

@@ -90,6 +90,8 @@ namespace MySystem.Areas.Api.Controllers.v1
             }
             RedisDbconn.Instance.Set("ConfirmOrder:" + MerchantId + "_" + OrderNo, "1");
             RedisDbconn.Instance.SetExpire("ConfirmOrder:" + MerchantId + "_" + OrderNo, 10);
+            var IsBuy = new MerchantDepositOrderService().QueryByMerchantId(MerchantId);
+            if (IsBuy.Id > 0) return new AppResultJson() { Status = "-1", Info = "请勿重复下单!" };
             decimal ActPayPrice = 365; //服务费总额
             var Id = MerchantDepositOrderUtil.AddMerchantDepositOrder(OrderNo, merchant.UserId, MerchantId, ActPayPrice);
             var query = new MerchantDepositOrderService().QueryById(Id);
@@ -107,10 +109,10 @@ namespace MySystem.Areas.Api.Controllers.v1
         {
             value = DesDecrypt(value);
             JsonData data = JsonMapper.ToObject(value);
-            Dictionary<string, object> Obj = InfoDo(value);
-            return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
+            AppResultJson result = InfoDo(value);
+            return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
         }
-        public Dictionary<string, object> InfoDo(string value)
+        public AppResultJson InfoDo(string value)
         {
             JsonData data = JsonMapper.ToObject(value);
             int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户Id
@@ -118,18 +120,21 @@ namespace MySystem.Areas.Api.Controllers.v1
             var CreateDate = "";
             var StartDate = "";
             var EndDate = "";
+            var Status = -1;
             var query = new MerchantDepositOrderService().QueryByMerchantId(MerchantId);
             if (query.Id > 0)
             {
                 CreateDate = DateTime.Parse(query.UpdateDate.ToString()).Year + "年" + DateTime.Parse(query.UpdateDate.ToString()).Month + "月" + DateTime.Parse(query.UpdateDate.ToString()).Day + "日";
                 StartDate = DateTime.Parse(query.UpdateDate.ToString()).AddMonths(1).Year + "年" + DateTime.Parse(query.UpdateDate.ToString()).AddMonths(1).Month + "月";
                 EndDate = DateTime.Parse(query.UpdateDate.ToString()).AddMonths(11).Year + "年" + DateTime.Parse(query.UpdateDate.ToString()).AddMonths(11).Month + "月";
+                Status = new MerchantInfoService().Query(MerchantId).ExamineStatus;
             }
             Obj.Add("CreateDate", CreateDate); //参与时间
             Obj.Add("StartDate", StartDate); //考核开始时间
             Obj.Add("EndDate", EndDate); //考核结束时间
+            Obj.Add("Status", Status); //考核状态(-1 未参与 0 考核中 1 已通过 2 未通过 101 待领取 100 已领取 99 发放中)
 
-            return Obj;
+            return new AppResultJson() { Status = "1", Info = "", Data = Obj };
         }
         #endregion
 

+ 11 - 1
Areas/Api/Controllers/v1/MainServer/MerchantInfoController.cs

@@ -133,7 +133,8 @@ namespace MySystem.Areas.Api.Controllers.v1
             JsonData data = JsonMapper.ToObject(value);
             string SearchKey = data["SearchKey"].ToString(); //搜索关键词
             int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客
-            int ActiveStatus = int.Parse(function.CheckInt(data["ActiveStatus"].ToString())); //商户激活状态
+            int ActiveStatus = int.Parse(function.CheckInt(data["ActiveStatus"].ToString())); //商户达标状态
+            int IsAct = int.Parse(function.CheckInt(data["IsAct"].ToString())); //激活状态(1 已激活 2 未激活)
             int Kind = int.Parse(function.CheckInt(data["Kind"].ToString()));
             string TradeSort = data["TradeSort"].ToString(); //排序
             string DateSort = data["DateSort"].ToString(); //排序
@@ -155,11 +156,18 @@ namespace MySystem.Areas.Api.Controllers.v1
                 if (ActiveStatus == 2) ActiveStatus = 0;
                 query = query.Where(m => m.ActivationStatus == ActiveStatus);
             }
+            if (IsAct > 0)
+            {
+                query = query.Where(m => m.IsAct == IsAct);
+            }
             int TotalCount = query.Count();
             int ActCount = query.Count(m => m.ActivationDate == today);
             int ProductCount = query.Count();
             int ProductActCount = query.Count(m => m.ActivationStatus == 1);
             int ProductUnActCount = ProductCount - ProductActCount;
+
+            int IsActNum = query.Count(m => m.IsAct == 1);
+            int UnActNum = ProductCount - IsActNum;
             if (TradeSort == "1")
             {
                 if (DateSort == "1")
@@ -207,6 +215,8 @@ namespace MySystem.Areas.Api.Controllers.v1
             Other.Add("TotalCount", TotalCount); //商户数
             Other.Add("ActCount", ActCount); //商户达标数
             Other.Add("UnActCount", ProductUnActCount); //未达标数
+            Other.Add("IsActNum", IsActNum); //商户激活数
+            Other.Add("UnActNum", UnActNum); //商户未激活数
             return dataList;
         }
         #endregion

+ 1 - 1
Services/MerchantDepositOrderService.cs

@@ -39,7 +39,7 @@ namespace MySystem.Service.Main
         public MerchantDepositOrder QueryByMerchantId(int MerchantId)
         {
             WebCMSEntities db = new WebCMSEntities();
-            MerchantDepositOrder editData = db.MerchantDepositOrder.FirstOrDefault(m => m.Status == 1 && m.MerchantId == MerchantId) ?? new MerchantDepositOrder();
+            MerchantDepositOrder editData = db.MerchantDepositOrder.FirstOrDefault(m => m.Status > 0 && m.MerchantId == MerchantId) ?? new MerchantDepositOrder();
             db.Dispose();
             return editData;
         }

+ 4 - 12
Util/MerchantAmountSummayUtil.cs

@@ -23,29 +23,21 @@ namespace MySystem
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             var query = new MerchantDepositOrderService().QueryByMerchantId(MerchantId);
             var Status = 0;//活动交易状态
-            var IsJoin = 0;//是否参加活动(0 否 1 是)
             if (query.Id > 0)
             {
-                IsJoin = 1;
-                var month = DateTime.Parse(query.UpdateDate.ToString());
+                var month = DateTime.Parse(query.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss"));
                 var TradeMonth = "";
                 decimal TradeAmount = 0.00M;
                 Dictionary<string, string> dic = new Dictionary<string, string>();
                 for (int i = 0; i < 10; i++)
                 {
-                    month = month.AddMonths(i + 1);
-                    TradeMonth = month.ToString("yyyy-MM");
+                    TradeMonth = month.AddMonths(i + 1).ToString("yyyy-MM");
                     var check = new MerchantAmountSummayService().QueryAmount("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeMonth + "' and MerchantId=" + MerchantId + "");
                     if (check.Count > 0)
                     {
                         dic = new MerchantAmountSummayService().Sum("TradeAmount", " and IsAct=1 and TradeMonth='" + TradeMonth + "'");
                         TradeAmount = decimal.Parse(dic["TradeAmount"].ToString());
                     }
-                    if (IsJoin == 0)
-                    {
-                        //未参与
-                        Status = 3;
-                    }
                     else
                     {
                         //考核中
@@ -53,9 +45,9 @@ namespace MySystem
                         //待考核
                         if (int.Parse(DateTime.Now.ToString("yyyyMM")) < int.Parse(month.ToString("yyyyMM"))) Status = 0;
                         //已通过
-                        if (TradeAmount >= 10000 && IsJoin != 3 && check.Count > 0) Status = 2;
+                        if (TradeAmount >= 10000 && check.Count > 0) Status = 2;
                         //未通过
-                        if (TradeAmount < 10000 && IsJoin != 3 && check.Count > 0) Status = -1;
+                        if (TradeAmount < 10000 && check.Count > 0) Status = -1;
 
                         Dictionary<string, object> curData = new Dictionary<string, object>();
                         curData.Add("TradeMonth", TradeMonth); //月份