DuGuYang 2 жил өмнө
parent
commit
782f0b8a97

+ 4 - 3
Areas/Api/Controllers/v1/Main1/ConsumerOrdersController.cs

@@ -102,8 +102,9 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();
                 curData.Add("Id", subdata["Id"].ToString()); //Id
+                var query = MerchantAddInfoService.Query(int.Parse(subdata["MerchantId"].ToString()));
                 var subjectType = 0;
-                curData.Add("MerchantName", MerchantAddInfoService.Query(int.Parse(subdata["MerchantId"].ToString())).CertMerchantName); //交易商户
+                curData.Add("MerchantName", query.CertMerchantName); //交易商户
                 curData.Add("PayMoney", subdata["PayMoney"].ToString()); //交易金额
                 var status = 0;
                 if (subdata["Status"].ToString() != "0") status = 1;
@@ -112,8 +113,8 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
                 curData.Add("OrderNo", subdata["OrderNo"].ToString()); //交易号
                 curData.Add("CreateDate", subdata["CreateDate"].ToString() == null ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //交易时间
                 curData.Add("MaxDivi", subdata["MaxDivi"].ToString()); //分账金额
-                if (data["SubjectType"].ToString() == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
-                if (data["SubjectType"].ToString() == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
+                if (query.SubjectType == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
+                if (query.SubjectType == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
                 curData.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体)
                 dataList.Add(curData);
             }

+ 91 - 28
Areas/Api/Controllers/v1/Main1/MerchantAddInfoController.cs

@@ -44,6 +44,8 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
             int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
             string condition = "";
+            var merIds = MerchantInfoUtil.QuerySenedMerchantId();
+            condition = " and Id in (" + merIds + ")";
             if (!string.IsNullOrEmpty(data["SubjectType"].ToString()))
             {
                 if (data["SubjectType"].ToString() == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
@@ -67,12 +69,11 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             {
                 if (Status == "0") condition += " and Status=0"; //审核中
                 if (Status == "1") condition += " and Status=2 and QueryCount=2"; //已通过
-                if (Status == "-1") condition += " and Status=-1"; //审核失败
+                if (Status == "-1") condition += " and Status=-1 and QueryCount=0"; //审核失败
                 if (Status == "20") condition += " and Status=1"; //微信待签约
                 if (Status == "21") condition += " and Status=2"; //微信已签约
                 if (Status == "10") condition += " and QueryCount=1"; //支付宝待签约
                 if (Status == "11") condition += " and QueryCount=2"; //支付宝已签约
-                condition += "";
             }
             List<RelationData> relationData = new List<RelationData>();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
@@ -104,19 +105,23 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
                 //商户状态
                 var MerStatus = 0;
                 // if (status == 0) MerStatus = 0; //审核中
-                if (status == 2 && queryCount == 2) MerStatus = 1; //已通过
-                if (status == -1) MerStatus = -1; //审核失败
-                if (status == 1) MerStatus = 20; //微信待签约
-                if (status == 2) MerStatus = 21; //微信已签约
+                if (status == -1 && queryCount == 0) MerStatus = -1; //审核失败
                 if (queryCount == 1) MerStatus = 10; //支付宝待签约
                 if (queryCount == 2) MerStatus = 11; //支付宝已签约
+                if (status == 1) MerStatus = 20; //微信待签约
+                if (status == 2) MerStatus = 21; //微信已签约
+                if (status == 2 && queryCount == 2) MerStatus = 1; //已通过
                 curData.Add("Status", MerStatus); //商户状态
                 //审核平台
                 var AuditInfo = 0;
-                if (status < 0 && queryCount >= 1) AuditInfo = 2;
-                if (status >= 1 && queryCount < 0) AuditInfo = 1;
+                if (status < 0 && queryCount >= 1) AuditInfo = 1;
+                if (status >= 1 && queryCount < 0) AuditInfo = 2;
                 curData.Add("AuditInfo", AuditInfo); //审核平台(1 支付宝 2 微信)
 
+                // curData.Add("Status", GetMainStatusName(merchantAddInfo.QueryCount, merchantAddInfo.Status));
+                // curData.Add("AlipayStatus", merchantAddInfo.QueryCount);
+                // curData.Add("WeChatStatus", merchantAddInfo.Status);
+
                 dataList.Add(curData);
             }
             Other.Add("Count", count); //总数
@@ -145,11 +150,11 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             var info = "";
             if (query.Status == -1)
             {
-                info += query.WeChatRemark + "\n";
+                info += "微信:" + query.WeChatRemark + "\n";
             }
             if (query.QueryCount == -1)
             {
-                info += query.AlipayRemark + "\n";
+                info += "支付宝:" + query.AlipayRemark + "\n";
             }
             Obj.Add("Info", info); //失败原因
 
@@ -193,15 +198,16 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
         {
             JsonData data = JsonMapper.ToObject(value);
             string MerchantId = data["MerchantId"].ToString(); //商户Id
-            var info = MerchantAddInfoUtil.DirectSubmitDo(int.Parse(MerchantId));
-            if (info == "success")
-            {
-                return new AppResultJson() { Status = "1", Info = "成功", Data = info };
-            }
-            else
-            {
-                return new AppResultJson() { Status = "-1", Info = "失败", Data = info };
-            }
+            // var info = MerchantAddInfoUtil.DirectSubmitDo(int.Parse(MerchantId));
+            // if (info == "success")
+            // {
+            //     return new AppResultJson() { Status = "1", Info = "成功", Data = info };
+            // }
+            // else
+            // {
+            //     return new AppResultJson() { Status = "-1", Info = "失败", Data = info };
+            // }
+            return new AppResultJson() { Status = "1", Info = "成功" };
         }
         #endregion
 
@@ -211,12 +217,13 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
         [Authorize]
         public JsonResult DirectQueryMerchantTradeInfo(string value)
         {
-            value = PublicFunction.DesDecrypt(value);
+            value = PublicFunction.DesDecrypt(value); ;
             JsonData data = JsonMapper.ToObject(value);
-            Dictionary<string, object> Obj = DirectQueryMerchantTradeInfoDo(value);
-            return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
+            Dictionary<string, object> Other = new Dictionary<string, object>();
+            List<Dictionary<string, object>> dataList = DirectQueryMerchantTradeInfoDo(value, out Other);
+            return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList, Other = Other });
         }
-        private Dictionary<string, object> DirectQueryMerchantTradeInfoDo(string value)
+        private List<Dictionary<string, object>> DirectQueryMerchantTradeInfoDo(string value, out Dictionary<string, object> Other)
         {
             JsonData data = JsonMapper.ToObject(value);
             string MerchantName = data["MerchantName"].ToString(); //商户名称
@@ -226,12 +233,68 @@ namespace MySystem.Areas.Api.Controllers.v1.Main1
             string AliPID = data["AliPID"].ToString(); //支付宝PID
             string WeChatNo = data["WeChatNo"].ToString(); //微信商户号
             string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体)
-            Dictionary<string, object> Obj = new Dictionary<string, object>();
-            Obj = MerchantAddInfoUtil.DirectQueryMerchantTradeInfoDo(MerchantName, Mobile, MakerCode, MatchNo, AliPID, WeChatNo, SubjectType);
-            return Obj;
+            int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
+            int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
+            string condition = "";
+            var merIds = MerchantInfoUtil.QuerySenedMerchantId();
+            condition = " and Id in (" + merIds + ")";
+            if (!string.IsNullOrEmpty(MerchantName))
+            {
+                condition += " and CertMerchantName='" + MerchantName + "'";
+            }
+            if (!string.IsNullOrEmpty(Mobile))
+            {
+                condition += " and MobilePhone='" + Mobile + "'";
+            }
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                var Ids = MerchantInfoUtil.QueryMerchantIdByMakerCode(MakerCode);
+                condition += " and Id in (" + Ids + ")";
+            }
+            if (!string.IsNullOrEmpty(AliPID))
+            {
+                condition += " and AlipayPid='" + AliPID + "'";
+            }
+            if (!string.IsNullOrEmpty(WeChatNo))
+            {
+                condition += " and SubMchid='" + WeChatNo + "'";
+            }
+            if (!string.IsNullOrEmpty(SubjectType))
+            {
+                if (SubjectType == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
+                if (SubjectType == "2") SubjectType = "SUBJECT_TYPE_INDIVIDUAL"; //个体工商户
+                condition += " and SubjectType='" + SubjectType + "'";
+            }
+            List<RelationData> relationData = new List<RelationData>();
+            List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
+            Other = new Dictionary<string, object>();
+            int count = 0;
+            List<Dictionary<string, object>> source = MerchantAddInfoService.List(relationData, condition, out count, pageNum, pageSize);
+            foreach (Dictionary<string, object> subdata in source)
+            {
+                Dictionary<string, object> curData = new Dictionary<string, object>();
+                //商户Id
+                var MerchantId = int.Parse(subdata["Id"].ToString());
+                curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
+                curData.Add("MerchantName", subdata["CertMerchantName"].ToString()); //商户名称
+                curData.Add("Mobile", subdata["MobilePhone"].ToString()); //手机号码
+                curData.Add("MakerCode", UsersService.Query(MerchantInfoService.Query(MerchantId).UserId).MakerCode); //所属创客
+                var subjectType = 0;
+                if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
+                if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
+                curData.Add("AliPID", subdata["AlipayPid"].ToString()); //支付宝PID
+                curData.Add("WeChatNo", subdata["SubMchid"].ToString()); //微信商户号
+                curData.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体 3 小微)
+                curData.Add("MatchNo", subdata["MchtNo"].ToString()); //商户号
+                curData.Add("OrderCount", ConsumerOrdersService.Count(" and Status>0 and MerchantId=" + MerchantId + "")); //订单总数
+                curData.Add("InComeAmount", ConsumerOrdersService.Sum(" and Status>0 and MerchantId=" + MerchantId + "", "MerchantActualAmount")); //实收总金额
+                curData.Add("TradeAmount", ConsumerOrdersService.Sum(" and Status>0 and MerchantId=" + MerchantId + "", "PayMoney")); //营业总金额
+                dataList.Add(curData);
+            }
+            Other.Add("Count", count); //总数
+            return dataList;
+            #endregion
         }
-        #endregion
-
 
 
         #region 商户管理-直连添加支付宝PID和微信商户号

+ 5 - 4
Areas/Api/Controllers/v1/Main2/ConsumerOrdersController.cs

@@ -102,8 +102,9 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();
                 curData.Add("Id", subdata["Id"].ToString()); //Id
+                var query = MerchantAddInfoService.Query(int.Parse(subdata["MerchantId"].ToString()));
                 var subjectType = 0;
-                curData.Add("MerchantName", MerchantAddInfoService.Query(int.Parse(subdata["MerchantId"].ToString())).CertMerchantName); //交易商户
+                curData.Add("MerchantName", query.CertMerchantName); //交易商户
                 curData.Add("PayMoney", subdata["PayMoney"].ToString()); //交易金额
                 var status = 0;
                 if (subdata["Status"].ToString() != "0") status = 1;
@@ -112,9 +113,9 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
                 curData.Add("OrderNo", subdata["OrderNo"].ToString()); //交易号
                 curData.Add("CreateDate", subdata["CreateDate"].ToString() == null ? "" : DateTime.Parse(subdata["CreateDate"].ToString()).ToString("yyyy-MM-dd HH:mm:ss")); //交易时间
                 curData.Add("MaxDivi", subdata["MaxDivi"].ToString()); //分账金额
-                if (data["SubjectType"].ToString() == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
-                if (data["SubjectType"].ToString() == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
-                if (data["SubjectType"].ToString() == "SUBJECT_TYPE_SMALL") subjectType = 3; //小微
+                if (query.SubjectType == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
+                if (query.SubjectType == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
+                if (query.SubjectType == "SUBJECT_TYPE_SMALL") subjectType = 3; //小微
                 curData.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体 3 小微)
                 dataList.Add(curData);
             }

+ 87 - 27
Areas/Api/Controllers/v1/Main2/MerchantAddInfoController.cs

@@ -44,6 +44,8 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
             int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
             string condition = "";
+            var merIds = MerchantInfoUtil.QuerySenedMerchantId();
+            condition = " and Id in (" + merIds + ")";
             if (!string.IsNullOrEmpty(data["SubjectType"].ToString()))
             {
                 if (data["SubjectType"].ToString() == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
@@ -68,12 +70,11 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             {
                 if (Status == "0") condition += " and Status=0"; //审核中
                 if (Status == "1") condition += " and Status=2 and QueryCount=2"; //已通过
-                if (Status == "-1") condition += " and Status=-1"; //审核失败
+                if (Status == "-1") condition += " and Status=-1 and QueryCount=0"; //审核失败
                 if (Status == "20") condition += " and Status=1"; //微信待签约
                 if (Status == "21") condition += " and Status=2"; //微信已签约
-                if (Status == "10") condition += " and Status=1"; //支付宝待签约
-                if (Status == "11") condition += " and Status=2"; //支付宝已签约
-                condition += "";
+                if (Status == "10") condition += " and QueryCount=1"; //支付宝待签约
+                if (Status == "11") condition += " and QueryCount=2"; //支付宝已签约
             }
             List<RelationData> relationData = new List<RelationData>();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
@@ -106,17 +107,17 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
                 //商户状态
                 var MerStatus = 0;
                 // if (status == 0) MerStatus = 0; //审核中
-                if (status == 2 && queryCount == 2) MerStatus = 1; //已通过
-                if (status == -1) MerStatus = -1; //审核失败
-                if (status == 1) MerStatus = 20; //微信待签约
-                if (status == 2) MerStatus = 21; //微信已签约
+                if (status == -1 && queryCount == 0) MerStatus = -1; //审核失败
                 if (queryCount == 1) MerStatus = 10; //支付宝待签约
                 if (queryCount == 2) MerStatus = 11; //支付宝已签约
+                if (status == 1) MerStatus = 20; //微信待签约
+                if (status == 2) MerStatus = 21; //微信已签约
+                if (status == 2 && queryCount == 2) MerStatus = 1; //已通过
                 curData.Add("Status", MerStatus); //商户状态
                 //审核平台
                 var AuditInfo = 0;
-                if (status < 0 && queryCount >= 1) AuditInfo = 2;
-                if (status >= 1 && queryCount < 0) AuditInfo = 1;
+                if (status < 0 && queryCount >= 1) AuditInfo = 1;
+                if (status >= 1 && queryCount < 0) AuditInfo = 2;
                 if (status < 0 && queryCount == 0) AuditInfo = 3;
                 curData.Add("AuditInfo", AuditInfo); //审核平台(1 支付宝 2 微信 3 好哒)
 
@@ -146,9 +147,13 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             MerchantAddInfo query = new MerchantAddInfo();
             query = MerchantAddInfoService.Query(int.Parse(MerchantId));
             var info = "";
-            if (query.Status == -1)
+            if (query.Status == -1 && string.IsNullOrEmpty(query.MchtNo))
             {
-                info += query.WeChatRemark + "\n";
+                info += "好哒:" + query.WeChatRemark + "\n";
+            }
+            if (query.Status == -1 && !string.IsNullOrEmpty(query.MchtNo))
+            {
+                info += "微信:" + query.WeChatRemark + "\n";
             }
             if (query.QueryCount == -1)
             {
@@ -196,15 +201,16 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
         {
             JsonData data = JsonMapper.ToObject(value);
             string MerchantId = data["MerchantId"].ToString(); //商户Id
-            var info = MerchantAddInfoUtil.DirectSubmitDo(int.Parse(MerchantId));
-            if (info == "success")
-            {
-                return new AppResultJson() { Status = "1", Info = "成功", Data = info };
-            }
-            else
-            {
-                return new AppResultJson() { Status = "-1", Info = "失败", Data = info };
-            }
+            // var info = MerchantAddInfoUtil.DirectSubmitDo(int.Parse(MerchantId));
+            // if (info == "success")
+            // {
+            //     return new AppResultJson() { Status = "1", Info = "成功", Data = info };
+            // }
+            // else
+            // {
+            //     return new AppResultJson() { Status = "-1", Info = "失败", Data = info };
+            // }
+            return new AppResultJson() { Status = "1", Info = "成功" };
         }
         #endregion
 
@@ -216,10 +222,11 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
         {
             value = PublicFunction.DesDecrypt(value); ;
             JsonData data = JsonMapper.ToObject(value);
-            Dictionary<string, object> Obj = UnionPayQueryMerchantTradeInfoDo(value);
-            return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
+            Dictionary<string, object> Other = new Dictionary<string, object>();
+            List<Dictionary<string, object>> dataList = UnionPayQueryMerchantTradeInfoDo(value, out Other);
+            return Json(new AppResultJson() { Status = "1", Info = "", Data = dataList, Other = Other });
         }
-        private Dictionary<string, object> UnionPayQueryMerchantTradeInfoDo(string value)
+        private List<Dictionary<string, object>> UnionPayQueryMerchantTradeInfoDo(string value, out Dictionary<string, object> Other)
         {
             JsonData data = JsonMapper.ToObject(value);
             string MerchantName = data["MerchantName"].ToString(); //商户名称
@@ -227,9 +234,62 @@ namespace MySystem.Areas.Api.Controllers.v1.Main2
             string MakerCode = data["MakerCode"].ToString(); //所属创客
             string MatchNo = data["MatchNo"].ToString(); //商户号
             string SubjectType = data["SubjectType"].ToString(); //主体类型(1 企业 2 个体 3 小微)
-            Dictionary<string, object> Obj = new Dictionary<string, object>();
-            Obj = MerchantAddInfoUtil.DirectQueryMerchantTradeInfoDo(MerchantName, Mobile, MakerCode, MatchNo, SubjectType);
-            return Obj;
+            int pageSize = int.Parse(function.CheckInt(data["page_size"].ToString()));
+            int pageNum = int.Parse(function.CheckInt(data["page_num"].ToString()));
+            string condition = "";
+            var merIds = MerchantInfoUtil.QuerySenedMerchantId();
+            condition = " and Id in (" + merIds + ")";
+            if (!string.IsNullOrEmpty(MerchantName))
+            {
+                condition += " and CertMerchantName='" + MerchantName + "'";
+            }
+            if (!string.IsNullOrEmpty(Mobile))
+            {
+                condition += " and MobilePhone='" + Mobile + "'";
+            }
+            if (!string.IsNullOrEmpty(MakerCode))
+            {
+                var Ids = MerchantInfoUtil.QueryMerchantIdByMakerCode(MakerCode);
+                condition += " and Id in (" + Ids + ")";
+            }
+            if (!string.IsNullOrEmpty(MatchNo))
+            {
+                condition += " and MchtNo='" + MatchNo + "'";
+            }
+            if (!string.IsNullOrEmpty(SubjectType))
+            {
+                if (SubjectType == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
+                if (SubjectType == "2") SubjectType = "SUBJECT_TYPE_INDIVIDUAL"; //个体工商户
+                if (SubjectType == "3") SubjectType = "SUBJECT_TYPE_SMALL"; //小微
+                condition += " and SubjectType='" + SubjectType + "'";
+            }
+            List<RelationData> relationData = new List<RelationData>();
+            List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
+            Other = new Dictionary<string, object>();
+            int count = 0;
+            List<Dictionary<string, object>> source = MerchantAddInfoService.List(relationData, condition, out count, pageNum, pageSize);
+            foreach (Dictionary<string, object> subdata in source)
+            {
+                Dictionary<string, object> curData = new Dictionary<string, object>();
+                //商户Id
+                var MerchantId = int.Parse(subdata["Id"].ToString());
+                curData.Add("MerchantId", subdata["Id"].ToString()); //商户Id
+                curData.Add("MerchantName", subdata["CertMerchantName"].ToString()); //商户名称
+                curData.Add("Mobile", subdata["MobilePhone"].ToString()); //手机号码
+                curData.Add("MakerCode", UsersService.Query(MerchantInfoService.Query(MerchantId).UserId).MakerCode); //所属创客
+                var subjectType = 0;
+                if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
+                if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
+                if (subdata["SubjectType"].ToString() == "SUBJECT_TYPE_SMALL") subjectType = 3; //小微
+                curData.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体 3 小微)
+                curData.Add("MatchNo", subdata["MchtNo"].ToString()); //商户号
+                curData.Add("OrderCount", ConsumerOrdersService.Count(" and Status>0 and MerchantId=" + MerchantId + "")); //订单总数
+                curData.Add("TradeAmount", ConsumerOrdersService.Sum(" and Status>0 and MerchantId=" + MerchantId + "", "PayMoney")); //营业总金额
+                curData.Add("InComeAmount", ConsumerOrdersService.Sum(" and Status>0 and MerchantId=" + MerchantId + "", "MerchantActualAmount")); //实收总金额
+                dataList.Add(curData);
+            }
+            Other.Add("Count", count); //总数
+            return dataList;
         }
         #endregion
 

+ 1 - 1
Service/Bs/RefreshTokensService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Bs
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.bsTables, _conn).Query("Sum(" + field + ") " + field + "", "RefreshTokens", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Bs/SysAdminRoleService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Bs
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.bsTables, _conn).Query("Sum(" + field + ") " + field + "", "SysAdminRole", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main1/ConsumerOrdersService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main1
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "ConsumerOrders", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main1/MerchantAddInfoService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main1
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantAddInfo", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main1/MerchantDepositBackService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main1
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantDepositBack", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main1/MerchantDepositOrderService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main1
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantDepositOrder", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main1/MerchantDepositReturnsService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main1
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantDepositReturns", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main1/MerchantInfoService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main1
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main1Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantInfo", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main2/ConsumerOrdersService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main2
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main2Tables, _conn).Query("Sum(" + field + ") " + field + "", "ConsumerOrders", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main2/HaoDaAreaCodeService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main2
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main2Tables, _conn).Query("Sum(" + field + ") " + field + "", "HaoDaAreaCode", condition);
             if(obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main2/MerchantAddInfoService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main2
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main2Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantAddInfo", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main2/MerchantDepositBackService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main2
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main2Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantDepositBack", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main2/MerchantDepositOrderService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main2
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main2Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantDepositOrder", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main2/MerchantDepositReturnsService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main2
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main2Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantDepositReturns", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main2/MerchantInfoService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main2
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main2Tables, _conn).Query("Sum(" + field + ") " + field + "", "MerchantInfo", condition);
             if (obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 1 - 1
Service/Main2/OpenBankAllService.cs

@@ -106,7 +106,7 @@ namespace MySystem.Service.Main2
             Dictionary<string, object> obj = new DbServiceNew(AppConfig.Base.main2Tables, _conn).Query("Sum(" + field + ") " + field + "", "OpenBankAll", condition);
             if(obj.Keys.Count > 0)
             {
-                amount = decimal.Parse(obj[field].ToString());
+                amount = decimal.Parse(function.CheckNum(obj[field].ToString()));
             }
             return amount;
         }

+ 28 - 1
Util/Base/BaseClass.cs

@@ -7,6 +7,33 @@ namespace MySystem
     public class BaseClass
     {
 
-        
+        #region 商户主状态
+        /// <summary>
+        /// 商户主状态
+        /// </summary>
+        /// <param name="AlipayStatus">支付宝状态</param>
+        /// <param name="WeChatStatus">微信状态</param>
+        /// <returns></returns>
+        public string GetMainStatusName(int AlipayStatus, int WeChatStatus)
+        {
+            if (AlipayStatus == 0 && WeChatStatus == 0) return "待审核";
+            if (AlipayStatus == 0 && WeChatStatus == -1) return "部分未通过";
+            if (AlipayStatus == -1 && WeChatStatus == 0) return "部分未通过";
+            if (AlipayStatus == 0 && WeChatStatus == 1) return "部分待签约";
+            if (AlipayStatus == 1 && WeChatStatus == 0) return "部分待签约";
+            if (AlipayStatus == 0 && WeChatStatus == 2) return "部分已通过";
+            if (AlipayStatus == 2 && WeChatStatus == 0) return "部分已通过";
+            if (AlipayStatus == -1 && WeChatStatus == -1) return "审核未通过";
+            if (AlipayStatus == -1 && WeChatStatus == 1) return "部分未通过";
+            if (AlipayStatus == 1 && WeChatStatus == -1) return "部分未通过";
+            if (AlipayStatus == -1 && WeChatStatus == 2) return "部分未通过";
+            if (AlipayStatus == 2 && WeChatStatus == -1) return "部分未通过";
+            if (AlipayStatus == 1 && WeChatStatus == 1) return "待签约";
+            if (AlipayStatus == 1 && WeChatStatus == 2) return "部分待签约";
+            if (AlipayStatus == 2 && WeChatStatus == 1) return "部分待签约";
+            if (AlipayStatus == 2 && WeChatStatus == 2) return "已通过";
+            return "";
+        }
+        #endregion
     }
 }

+ 24 - 1
Util/Main1/MerchantInfoUtil.cs

@@ -65,6 +65,30 @@ namespace MySystem.Service.Main1
         }
         #endregion
 
+        #region 获取已提交商户Id
+        /// <summary>
+        /// 获取已提交商户Id
+        /// </summary>
+        /// <returns></returns>
+        public static string QuerySenedMerchantId()
+        {
+            var info = "";
+            List<RelationData> relationData = new List<RelationData>();
+            var merInfo = MerchantInfoService.List(relationData," and Sort=1",1,9999999);
+            if (merInfo.Count > 0)
+            {
+                var merIds = "";
+                foreach (Dictionary<string, object> dic in merInfo)
+                {
+                    var MerchantId = int.Parse(dic["Id"].ToString());
+                    merIds += MerchantId + ",";
+                }
+                info = merIds.TrimEnd(',');
+            }
+            return info;
+        }
+        #endregion
+
         #region 主体类型
         /// <summary>
         /// 主体类型
@@ -251,6 +275,5 @@ namespace MySystem.Service.Main1
             return dic;
         }
         #endregion
-
     }
 }

+ 0 - 57
Util/Main2/MerchantAddInfoUtil.cs

@@ -156,62 +156,5 @@ namespace MySystem.Service.Main2
         }
         #endregion
 
-
-        #region 商户管理-银联查询商户交易信息
-        /// <summary>
-        /// 商户管理-银联查询商户交易信息
-        /// </summary>
-        /// <param name="MerchantName">商户名称</param>
-        /// <param name="Mobile">手机号码</param>
-        /// <param name="MakerCode">所属创客</param>
-        /// <param name="MatchNo">商户号</param>
-        /// <param name="SubjectType">主体类型(1 企业 2 个体 3 小微)</param>
-        /// <returns></returns>
-        public static Dictionary<string, object> DirectQueryMerchantTradeInfoDo(string MerchantName, string Mobile, string MakerCode, string MatchNo, string SubjectType)
-        {
-            Dictionary<string, object> Obj = new Dictionary<string, object>();
-            string condition = "";
-            if (!string.IsNullOrEmpty(MerchantName))
-            {
-                condition += " and CertMerchantName='" + MerchantName + "'";
-            }
-            if (!string.IsNullOrEmpty(Mobile))
-            {
-                condition += " and MobilePhone='" + Mobile + "'";
-            }
-            if (!string.IsNullOrEmpty(MakerCode))
-            {
-                var Ids = MerchantInfoUtil.QueryMerchantIdByMakerCode(MakerCode);
-                condition += " and Id in (" + Ids + ")";
-            }
-            if (!string.IsNullOrEmpty(MatchNo))
-            {
-                condition += " and MchtNo='" + MatchNo + "'";
-            }
-            if (!string.IsNullOrEmpty(SubjectType))
-            {
-                if (SubjectType == "1") SubjectType = "SUBJECT_TYPE_ENTERPRISE"; //企业公司
-                if (SubjectType == "2") SubjectType = "SUBJECT_TYPE_INDIVIDUAL"; //个体工商户
-                if (SubjectType == "3") SubjectType = "SUBJECT_TYPE_SMALL"; //小微
-                condition += " and SubjectType='" + SubjectType + "'";
-            }
-            var query = MerchantAddInfoService.Query(condition);
-            Obj.Add("MerchantId", query.Id); //商户Id
-            Obj.Add("MerchantName", query.CertMerchantName); //商户名称
-            Obj.Add("Mobile", query.MobilePhone); //手机号码
-            Obj.Add("MakerCode", UsersService.Query(MerchantInfoService.Query(query.Id).UserId).MakerCode); //所属创客
-            var subjectType = 0;
-            if (query.SubjectType == "SUBJECT_TYPE_ENTERPRISE") subjectType = 1; //企业公司
-            if (query.SubjectType == "SUBJECT_TYPE_INDIVIDUAL") subjectType = 2; //个体工商户
-            if (query.SubjectType == "SUBJECT_TYPE_SMALL") subjectType = 3; //小微
-            Obj.Add("SubjectType", subjectType); //主体类型(1 企业 2 个体 3 小微)
-            Obj.Add("MatchNo", query.MchtNo); //商户号
-            Obj.Add("OrderCount", ConsumerOrdersService.Count(" and Status>0 and MerchantId=" + query.Id + "")); //订单总数
-            Obj.Add("TradeAmount", ConsumerOrdersService.Sum(" and Status>0 and MerchantId=" + query.Id + "", "PayMoney")); //营业总金额
-            Obj.Add("InComeAmount", ConsumerOrdersService.Sum(" and Status>0 and MerchantId=" + query.Id + "", "MerchantActualAmount")); //实收总金额
-            return Obj;
-        }
-        #endregion
-
     }
 }

+ 24 - 0
Util/Main2/MerchantInfoUtil.cs

@@ -64,6 +64,30 @@ namespace MySystem.Service.Main2
         }
         #endregion
 
+        #region 获取已提交商户Id
+        /// <summary>
+        /// 获取已提交商户Id
+        /// </summary>
+        /// <returns></returns>
+        public static string QuerySenedMerchantId()
+        {
+            var info = "";
+            List<RelationData> relationData = new List<RelationData>();
+            var merInfo = MerchantInfoService.List(relationData," and Sort=1",1,9999999);
+            if (merInfo.Count > 0)
+            {
+                var merIds = "";
+                foreach (Dictionary<string, object> dic in merInfo)
+                {
+                    var MerchantId = int.Parse(dic["Id"].ToString());
+                    merIds += MerchantId + ",";
+                }
+                info = merIds.TrimEnd(',');
+            }
+            return info;
+        }
+        #endregion
+
         #region 主体类型
         /// <summary>
         /// 主体类型