浏览代码

统计分红修复
商户提交暂存修复
商户筛选数字等修复

DuGuYang 1 年之前
父节点
当前提交
0091dc837b

+ 1 - 1
AppStart/Redis/MySql/QrCodeTradeStat.cs

@@ -2,7 +2,7 @@
 using System.Collections.Generic;
 using Library;
 using System.Linq;
-using MySystem.Models.Main1;
+using MySystem.Models.Main;
 
 namespace MySystem
 {

+ 23 - 7
Areas/Api/Controllers/Main/MerchantAddInfoController.cs

@@ -186,22 +186,38 @@ namespace MySystem.Areas.Api.Controllers.v1
                 BankBranchId = openBank.BankCode;
             }
             Dictionary<string, object> Obj = new Dictionary<string, object>();
-            var query = MerchantAddInfoService.Query(" CertMerchantName='" + CertMerchantName + "'");
-            if (query == null)
+            Dictionary<string, object> Fields = new Dictionary<string, object>();
+            if (MerchantAddInfoId == 0)
             {
                 if (SubjectType == "SUBJECT_TYPE_SMALL")
                 {
-                    CertMerchantName = CertMerchantName + function.MD5_16(Guid.NewGuid().ToString("N"));
+                    CertMerchantName += function.MD5_16(Guid.NewGuid().ToString("N"));
+                }
+                var query = MerchantAddInfoService.Query(" CertMerchantName='" + CertMerchantName + "'");
+                if (query.Id == 0)
+                {
+                    Dictionary<string, object> Fiel = new Dictionary<string, object>();
+                    Fiel.Add("CertMerchantName", CertMerchantName);
+                    MerchantAddInfoId = (int)MerchantAddInfoService.Add(Fiel, false).Data;
+
+                    Fiel = new Dictionary<string, object>();
+                    Fiel.Add("Id", MerchantAddInfoId);
+                    Fiel.Add("Name", CertMerchantName);
+                    MerchantInfoService.Add(Fiel, false);
+                }
+                else
+                {
+                    return new AppResultJson() { Status = "-1", Info = "该商户已进件", Data = Obj };
                 }
-                Dictionary<string, object> Fiel = new Dictionary<string, object>();
-                Fiel.Add("CertMerchantName", CertMerchantName);
-                MerchantAddInfoId = (int)MerchantAddInfoService.Add(Fiel, false).Data;
+            }
+            else
+            {
+                Fields.Add("CertMerchantName", CertMerchantName);
             }
             // var ActivitiesId = "20191030111cff5b5e";
             // var ActivitiesRate = "0.38";
             // MerchantAddInfoUtil.EditMerchantAddInfo(query.Id, ContactName, ContactIdNumber, MobilePhone, ContactEmail, SubjectType, LicenseCopy, LicenseNumber, CertLegalPerson, CertMerchantName, CertLegalPerson, ServicePhone, BizStoreName, BizAddressCode, BizStoreAddress, StoreEntrancePic, IndoorPic, QualificationType, SettlementId, BankAccountType, AccountName, AccountBank, BankAddressCode, BankName, BankBranchId, AccountNumber, IdCardCopy, IdCardNational, IdCardName, IdCardNumber, IdCardAddress, CardPeriodBegin, CardPeriodEnd, MerchantShortname, Qualifications, ActivitiesId, ActivitiesRate, AlipayAccount, AlipayMccCode, ChannelKind, SalesScenesType, OpenAccountLicenses, RentAgreement, OperatorMcht, AgentProtocol, SignaturePicture, Support, CheckstandImg, ProductImg, Agreement, TaxImage, OrganizationCopy, IndustryLicense1, FaceRecognition, Extra1, BankCard, PersonWithIdCard, TakeCreditCard, MchtNo);
 
-            Dictionary<string, object> Fields = new Dictionary<string, object>();
             Fields.Add("LicenseCopy", LicenseCopy); //- 营业执照
             // Fields.Add("CertMerchantName", CertMerchantName); //- 商户名称
             Fields.Add("LicenseNumber", LicenseNumber); //- 商户信用代码

+ 5 - 5
Areas/Api/Controllers/Main/MerchantInfoController.cs

@@ -249,11 +249,6 @@ namespace MySystem.Areas.Api.Controllers.v1
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             IQueryable<MerchantInfo> query = maindb.MerchantInfo.Where(m => m.UserId == UserId && (m.Status == 2 || m.QueryCount == 2));
             DateTime today = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00");
-            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;
             if (!string.IsNullOrEmpty(SearchKey))
             {
                 query = query.Where(m => m.Name.Contains(SearchKey));
@@ -267,6 +262,11 @@ namespace MySystem.Areas.Api.Controllers.v1
                 if (ActiveStatus == 2) ActiveStatus = 0;
                 query = query.Where(m => m.ActivationStatus == ActiveStatus);
             }
+            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;
             if (TradeSort == "1")
             {
                 if (DateSort == "1")

+ 1 - 1
Util/Business/BusinessUtil.cs

@@ -139,7 +139,7 @@ namespace MySystem
                     cdata.Add("ProfitAmount", decimal.Parse(dic["GetMoney"].ToString()).ToString("f2")); //分红金额
                     dataList.Add(cdata);
                 }
-                obj.Add("ProfitTotalAmount", ConsumerProfitService.Sum(" and OrderId=" + int.Parse(subdata["Id"].ToString()), "GetMoney").ToString("f2")); //分红总金额
+                obj.Add("ProfitTotalAmount", ConsumerProfitService.Sum(" OrderId=" + int.Parse(subdata["Id"].ToString()) + "", "GetMoney").ToString("f2")); //分红总金额
                 obj.Add("ProfitList", dataList); //订单分红记录列表
             }
             return obj;