소스 검색

修复人工已退商户押金显示问题

DuGuYang 3 년 전
부모
커밋
ce359a61f0
1개의 변경된 파일24개의 추가작업 그리고 4개의 파일을 삭제
  1. 24 4
      Areas/Admin/Controllers/MainServer/PosMerchantInfoListController.cs

+ 24 - 4
Areas/Admin/Controllers/MainServer/PosMerchantInfoListController.cs

@@ -178,7 +178,6 @@ namespace MySystem.Areas.Admin.Controllers
             Dictionary<string, string> Fields = new Dictionary<string, string>();
 
             Fields.Add("KqMerNo", "1"); //商户编号
-            decimal ReturnAmounts = 0.00M;
             string condition = " and Status>-1 and StandardStatus=-2";
             //身份证号
             if (!string.IsNullOrEmpty(MerIdcardNo))
@@ -262,15 +261,15 @@ namespace MySystem.Areas.Admin.Controllers
 
                 var KqSnNo = dic["KqSnNo"].ToString();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == KqSnNo) ?? new PosMachinesTwo();
+
                 //实际押金
                 string SeoKeyword = "0";
                 if (!string.IsNullOrEmpty(pos.SeoKeyword))
                 {
-                    if (SeoKeyword.Length > 3)
+                    if (pos.SeoKeyword.Length > 3)
                     {
-                        SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
+                        SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
                     }
-                    ReturnAmounts += decimal.Parse(SeoKeyword);
                 }
                 dic["SeoKeyword"] = SeoKeyword;
 
@@ -283,12 +282,33 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["PrizeParams"] = PrizeParams;
             }
             Dictionary<string, object> other = new Dictionary<string, object>();
+            decimal ReturnAmounts = 0.00M;
             decimal ReturnAmount = 0.00M;
             DataTable dt = OtherMySqlConn.dtable("SELECT SUM(Remark) FROM PosMerchantInfo WHERE 1=1" + condition);
             if (dt.Rows.Count > 0)
             {
                 ReturnAmount = decimal.Parse(function.CheckNum(dt.Rows[0][0].ToString()));
             }
+            DataTable dts = OtherMySqlConn.dtable("SELECT KqSnNo FROM PosMerchantInfo WHERE 1=1" + condition);
+            if (dt.Rows.Count > 0)
+            {
+                foreach (DataRow item in dts.Rows)
+                {
+                    string KqSnNo = item["KqSnNo"].ToString();
+                    var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == KqSnNo) ?? new PosMachinesTwo();
+                    if (!string.IsNullOrEmpty(pos.SeoKeyword))
+                    {
+                        if (pos.SeoKeyword.Length > 3)
+                        {
+                            ReturnAmounts += decimal.Parse(pos.SeoKeyword) / 100;
+                        }
+                        else
+                        {
+                            ReturnAmounts += decimal.Parse(pos.SeoKeyword);
+                        }
+                    }
+                }
+            }
             other.Add("ReturnAmount", ReturnAmount.ToString("f2"));
             other.Add("ReturnAmounts", ReturnAmounts.ToString("f2"));
             obj.Add("other", other);