Forráskód Böngészése

若收款码或音响码已是绑定状态,返回对应提示

DuGuYang 1 éve
szülő
commit
e53ff7190b
1 módosított fájl, 10 hozzáadás és 2 törlés
  1. 10 2
      Areas/Api/Controllers/Main/MerchantQrCodeController.cs

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

@@ -97,7 +97,7 @@ namespace MySystem.Areas.Api.Controllers.v1
                 SnNo = SnNo.TrimEnd('\0');
                 SnNo = SnNo.Substring(0, 20);
             }
-            if(!string.IsNullOrEmpty(MachineNo))
+            if (!string.IsNullOrEmpty(MachineNo))
             {
                 if (MachineNo.Length > 20)
                 {
@@ -116,6 +116,14 @@ namespace MySystem.Areas.Api.Controllers.v1
             Models.Main1.PosMachinesTwo pos = PosMachinesTwoService.Query(" PosSn='" + SnNo + "'");
             Models.Main1.PosMachines machines = PosMachinesService.Query(" PosSn='" + SnNo + "'");
             MerchantInfo merchant = MerchantInfoService.Query(MerchantId);
+            if (pos.BindingState == 1)
+            {
+                return new AppResultJson() { Status = "-1", Info = "绑定失败,该二维码已绑定" };
+            }
+            if (machines.BindingState == 1)
+            {
+                return new AppResultJson() { Status = "-1", Info = "绑定失败,该二维码已绑定" };
+            }
             int PosId = 0;
             if (SnNo == MachineNo || string.IsNullOrEmpty(MachineNo))
             {
@@ -192,7 +200,7 @@ namespace MySystem.Areas.Api.Controllers.v1
                 // if(jsonObj["alipay_commerce_iot_device_baseinfo_query_response"]["code"].ToString() == "10000")
                 // {
                 // string deviceId = jsonObj["alipay_commerce_iot_device_baseinfo_query_response"]["device_id"].ToString();
-                if(machines.BrandId == 1)
+                if (machines.BrandId == 1)
                 {
                     MerchantAddInfo addinfo = MerchantAddInfoService.Query(MerchantId);
                     //通过商户smid(好哒认证成功后台提供)绑定支付宝设备