Selaa lähdekoodia

再次提交子商户,参数判断逻辑

lcl 3 kuukautta sitten
vanhempi
commit
6c01452959
1 muutettua tiedostoa jossa 21 lisäystä ja 14 poistoa
  1. 21 14
      Areas/Api/Controllers/Main/MerchantAddInfoController.cs

+ 21 - 14
Areas/Api/Controllers/Main/MerchantAddInfoController.cs

@@ -286,7 +286,7 @@ namespace MySystem.Areas.Api.Controllers.v1
                 MerchantAddInfo addInfo = MerchantAddInfoService.Query(MerchantAddInfoId);
                 if(sub)
                 {
-                    if(addInfo.HdStatus == 0)
+                    if(addInfo.HdStatus == 0 && addInfo.ParentId == 0)
                     {
                         return new AppResultJson() { Status = "-1", Info = "商户" + addInfo.CertMerchantName + "未进件成功", Data = Obj };
                     }
@@ -294,19 +294,26 @@ namespace MySystem.Areas.Api.Controllers.v1
                     {
                         CertMerchantName += function.get_Random(00000000, 99999999);
                     }
-                    Dictionary<string, object> Fiel = new Dictionary<string, object>();
-                    Fiel.Add("CertMerchantName", CertMerchantName);
-                    int ParentId = MerchantAddInfoId;
-                    Fiel.Add("OutMchtNo", addInfo.OutMchtNo); //费率
-                    Fiel.Add("ParentId", ParentId);
-                    MerchantAddInfoId = (int)MerchantAddInfoService.Add(Fiel, false).Data;
-
-                    Fiel = new Dictionary<string, object>();
-                    Fiel.Add("Id", MerchantAddInfoId);
-                    Fiel.Add("UserId", UserId);
-                    Fiel.Add("ParentId", ParentId);
-                    Fiel.Add("Name", CertMerchantName);
-                    MerchantInfoService.Add(Fiel, false);
+                    if(addInfo.ParentId == 0)
+                    {
+                        Dictionary<string, object> Fiel = new Dictionary<string, object>();
+                        Fiel.Add("CertMerchantName", CertMerchantName);
+                        int ParentId = MerchantAddInfoId;
+                        Fiel.Add("OutMchtNo", addInfo.OutMchtNo); //费率
+                        Fiel.Add("ParentId", ParentId);
+                        MerchantAddInfoId = (int)MerchantAddInfoService.Add(Fiel, false).Data;
+
+                        Fiel = new Dictionary<string, object>();
+                        Fiel.Add("Id", MerchantAddInfoId);
+                        Fiel.Add("UserId", UserId);
+                        Fiel.Add("ParentId", ParentId);
+                        Fiel.Add("Name", CertMerchantName);
+                        MerchantInfoService.Add(Fiel, false);
+                    }
+                    else
+                    {
+                        MerchantAddInfoId = addInfo.Id;
+                    }
                 }
                 else
                 {