Selaa lähdekoodia

Merge branch 'feature-dgy-商户版1.1.2功能更新' into DuGuYang

DuGuYang 1 vuosi sitten
vanhempi
commit
1df6c9e9d2

+ 13 - 5
Areas/Api/Controllers/Main/MerchantAddInfoController.cs

@@ -196,13 +196,15 @@ namespace MySystem.Areas.Api.Controllers.v1
             {
                 if (SubjectType == "SUBJECT_TYPE_SMALL")
                 {
-                    CertMerchantName += function.MD5_16(Guid.NewGuid().ToString("N"));
+                    // CertMerchantName += function.MD5_16(Guid.NewGuid().ToString("N"));
+                    CertMerchantName += function.get_Random(00000000, 99999999);
                 }
                 var query = MerchantAddInfoService.Query(" CertMerchantName='" + CertMerchantName + "'");
                 if (query.Id == 0)
                 {
                     Dictionary<string, object> Fiel = new Dictionary<string, object>();
                     Fiel.Add("CertMerchantName", CertMerchantName);
+                    Fields.Add("MchtNo", MchtNo); // 收款商户号
                     MerchantAddInfoId = (int)MerchantAddInfoService.Add(Fiel, false).Data;
 
                     Fiel = new Dictionary<string, object>();
@@ -217,7 +219,14 @@ namespace MySystem.Areas.Api.Controllers.v1
             }
             else
             {
-                Fields.Add("CertMerchantName", CertMerchantName);
+                if (SubjectType != "SUBJECT_TYPE_SMALL")
+                {
+                    Fields.Add("CertMerchantName", CertMerchantName);
+                }
+                else
+                {
+                    CertMerchantName = MerchantInfoService.Query(MerchantAddInfoId).Name;
+                }
             }
             // var ActivitiesId = "20191030111cff5b5e";
             // var ActivitiesRate = "0.38";
@@ -246,7 +255,6 @@ namespace MySystem.Areas.Api.Controllers.v1
             Fields.Add("QualificationType", SalesScenesType); //- 所属行业
             Fields.Add("SalesScenesType", SalesScenesTypeName); //- 所属行业
             Fields.Add("BusinessId", SalesScenesType); //- 所属行业Id
-            Fields.Add("MchtNo", MchtNo); // 收款商户号
             Fields.Add("BizStoreName", BizStoreName); //- 门店名称
             Fields.Add("BizAddressCode", BizAddressCode); //- 门店区域
             Fields.Add("AreaNo", HaoDaAreaCodeService.Query("CityName like '%" + BizAddressCode + "%'").CityCode); //- 经营地区区域码
@@ -257,8 +265,8 @@ namespace MySystem.Areas.Api.Controllers.v1
             Fields.Add("IdCardNumber", IdCardNumber); //- 身份证号码
             Fields.Add("CardPeriodBegin", DateTime.Parse(CardPeriodBegin)); //- 身份证有效期开始
             Fields.Add("CardPeriodEnd", DateTime.Parse(CardPeriodEnd)); //- 身份证有效期结束
-            Fields.Add("PeriodBegin", DateTime.Parse(PeriodBegin)); //- 身份证有效期开始
-            Fields.Add("PeriodEnd", DateTime.Parse(PeriodEnd)); //- 身份证有效期结束
+            Fields.Add("PeriodBegin", DateTime.Parse(PeriodBegin)); //- 营业执照有效期开始
+            Fields.Add("PeriodEnd", DateTime.Parse(PeriodEnd)); //- 营业执照有效期结束
             Fields.Add("IdCardAddress", IdCardAddress); //身份证居住地址            
             Fields.Add("MobilePhone", MobilePhone); //- 手机号码
             Fields.Add("AccountName", AccountName); //- 开户名称

+ 12 - 10
Areas/Api/Controllers/Main/MerchantQrCodeController.cs

@@ -105,29 +105,29 @@ namespace MySystem.Areas.Api.Controllers.v1
             Models.Main.MerchantInfo merchant = MerchantInfoService.Query(MerchantId);
             int PosId = 0;
             int Kind = 0;
-            if(SnNo == MachineNo)
+            if (SnNo == MachineNo)
             {
                 if (pos.Id == 0)
                 {
                     return new AppResultJson() { Status = "-1", Info = "绑定失败" };
                 }
-                if (pos.BuyUserId == 0)
-                {
-                    return new AppResultJson() { Status = "-1", Info = "码牌未授权" };
-                }
+                // if (pos.BuyUserId == 0)
+                // {
+                //     return new AppResultJson() { Status = "-1", Info = "码牌未授权" };
+                // }
                 PosId = pos.Id;
                 Kind = 1;
             }
-            else if(SnNo != MachineNo)
+            else if (SnNo != MachineNo)
             {
                 if (machines.Id == 0)
                 {
                     return new AppResultJson() { Status = "-1", Info = "绑定失败" };
                 }
-                if (machines.BuyUserId == 0)
-                {
-                    return new AppResultJson() { Status = "-1", Info = "音响未授权" };
-                }
+                // if (machines.BuyUserId == 0)
+                // {
+                //     return new AppResultJson() { Status = "-1", Info = "音响未授权" };
+                // }
                 PosId = machines.Id;
                 Kind = 2;
             }
@@ -197,6 +197,8 @@ namespace MySystem.Areas.Api.Controllers.v1
                     Models.Main1.PosMachines machine = PosMachinesService.Query(" PosSn='" + SnNo + "'");
                     fields = new Dictionary<string, object>();
                     fields.Add("BindingTime", DateTime.Now);
+                    fields.Add("BuyUserId", merchant.UserId);
+                    fields.Add("UserId", merchant.UserId);
                     fields.Add("BindingState", 1);
                     fields.Add("BindMerchantId", MerchantId);
                     // fields.Add("DeviceName", deviceId);

+ 5 - 0
Areas/Api/Controllers/Main/PosMachinesController.cs

@@ -230,12 +230,15 @@ namespace MySystem.Areas.Api.Controllers.v1
             JsonData data = JsonMapper.ToObject(value);
             string PosSn = data["PosSn"].ToString(); //SN编号
             int BindMerchantId = int.Parse(function.CheckInt(data["BindMerchantId"].ToString())); //绑定商户
+            Models.Main.MerchantInfo merchant = MerchantInfoService.Query(BindMerchantId);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             PosMachines query = new PosMachines();
             query = new PosMachines()
             {
                 CreateDate = DateTime.Now, //创建时间
                 UpdateDate = DateTime.Now, //修改时间
+                BuyUserId = merchant.UserId, //绑定所属创客Id
+                UserId = merchant.UserId, //绑定所属创客Id
                 PosSn = PosSn, //SN编号
                 BindMerchantId = BindMerchantId, //绑定商户
             };
@@ -272,6 +275,8 @@ namespace MySystem.Areas.Api.Controllers.v1
                     if (machine != null)
                     {
                         machine.BindMerchantId = 0;
+                        machine.BuyUserId = 0;
+                        machine.UserId = 0;
                     }
                 }
             }

+ 3 - 0
Util/Main/MerchantAddInfoUtil.cs

@@ -154,6 +154,9 @@ namespace MySystem
             {
                 if (MerchantAddInfoService.Exist(Id))
                 {
+                    Fields.Add("Status", 0);
+                    Fields.Add("WeChatRemark", null);
+                    Fields.Add("AlipayRemark", null);
                     info = MerchantAddInfoService.Edit(Fields, Id, false);
                 }
                 else

+ 1 - 0
Util/Main/MerchantInfoUtil.cs

@@ -36,6 +36,7 @@ namespace MySystem
             }
             else
             {
+                Fields.Add("Status", 0);
                 info = MerchantInfoService.Edit(Fields, Id, false);
             }
             return info;

+ 4 - 0
Util/PublicFunction.cs

@@ -226,12 +226,16 @@ namespace MySystem
             {
                 Models.Main1.PosMachines pos = db.PosMachines.FirstOrDefault(m => m.PosSn == PosSn) ?? new Models.Main1.PosMachines();
                 pos.BindingState = 1;
+                pos.BuyUserId = UserId;
+                pos.UserId = UserId;
                 pos.BindingTime = DateTime.Now;
             }
             else
             {
                 Models.Main1.PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn) ?? new Models.Main1.PosMachinesTwo();
                 pos.BindingState = 1;
+                pos.BuyUserId = UserId;
+                pos.UserId = UserId;
                 pos.BindingTime = DateTime.Now;
             }
             string IdBrand = UserId + "_" + BrandId;