From 597399726303f4f6f41b0a55d8dcaa153f49b97a Mon Sep 17 00:00:00 2001
From: yzh <snbbt@21cn.com>
Date: 星期四, 19 五月 2022 14:57:33 +0800
Subject: [PATCH] 账号信息增加是否自动返还 系统账号信息增加:用户类型 客户信息增加:归属客户经理、归属业务员、归属客服人员、归属财务等 客户账号查询优化 账号查询充值优化

---
 web/web/GwOrder.ashx |   41 ++++++++++++++++++++---------------------
 1 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/web/web/GwOrder.ashx b/web/web/GwOrder.ashx
index 471e79e..99c1784 100644
--- a/web/web/GwOrder.ashx
+++ b/web/web/GwOrder.ashx
@@ -103,7 +103,7 @@
             }
         }
         else
-            str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
+            str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
 
         return new JsonPageResult(true,  new
         {
@@ -165,7 +165,7 @@
             }
         }
         else
-            str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
+            str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
 
         return new JsonPageResult(true,  new
         {
@@ -242,7 +242,7 @@
             }
         }
         else
-            str1 += "<tr><td colspan=\"14\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
+            str1 += "<tr><td colspan=\"15\" style=\"padding-left:5px; text-align: center;\">鏆傛棤淇℃伅</td></tr>";
 
         return new JsonPageResult(true,  new
         {
@@ -295,10 +295,10 @@
         int givingNum = context.GetInt("givingNum");
         string clientId = "";
         int payAmount = 0;
-        int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1);
+        int tmpPayAmount = Math.Max((int) (context.GetDecimal("payAmount", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
         payAmount = tmpPayAmount;
         //double price = context.GetDecimal(price);
-        int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 1);
+        int num = Math.Max((int) (context.GetDecimal("price", new Decimal(4, 0, 0, false, (byte) 2)) * new Decimal(1000)), 0);
         string remark = context.GetString("remark");
         int status = context.GetInt("status");  //0-瀹℃牳涓嶉�氳繃锛�1-瀹℃牳閫氳繃
         string auditReason = context.GetString("auditReason");
@@ -434,7 +434,7 @@
             int topUpAmountTotal = 0;
             if (string.IsNullOrEmpty(nextFlowCode))
             {
-                orderStatus = 2;
+                orderStatus = 2;                    
 
                 //鑾峰彇璐﹀彿淇℃伅
                 GwSp gwSp = _GwSpDao.Get(spId);
@@ -449,7 +449,8 @@
                 topUpAmountTotal = int.Parse(gwClient.Top_up_Amount_Total.ToString() );
 
                 //涓�1-棰勪粯璐�
-                if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
+                //if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
+                if (gwClient.ChargeType==1 && (balance + payAmount) < num * basicNum)
                 {
                     throw new ArgumentException("瀹㈡埛浣欓鍙婂厖鍊奸噾棰濅笉瓒宠喘涔帮紝璇疯皟鏁村悗鎻愪氦锛�");
                 }
@@ -457,23 +458,20 @@
                 //gwSp.Balance = balance - num * basicNum;
                 //gwSp.BasicNum = beforeBasicNum + basicNum;
                 //gwSp.GivingNum = beforeGivingNum + givingNum;
-
-                _GwSpDao.UpdateBalanceByOrder(balance - num * basicNum
-                    , beforeBasicNum + basicNum
-                    , beforeGivingNum + givingNum
-                    , spId
-                    );
+                //鏇存柊璐﹀彿鍏呭�兼暟鎹�
+                _GwSpDao.UpdateBalanceByOrder( payAmount, basicNum , givingNum , spId );
 
 
                 //鏈夊厖鍊奸噾棰濇椂锛屾洿鏂板鎴风疮璁″厖鍊奸噾棰濓紙鍘橈級
-                if (payAmount > 0) {
+                if (payAmount > 0 || basicNum > 0 ) {
                     //GwClient gwClient = new GwClient();
-                    gwClient = new GwClient();
-                    gwClient.Top_up_Amount_Total = topUpAmountTotal + payAmount;    //绱閲戦:鍗曚綅锛堝帢锛�
-                    gwClient.Balance = ((balance + payAmount) - num * basicNum) ;   //璐︽埛浣欓:鍗曚綅锛堝帢锛�
-                    gwClient.ClientID = clientId;
-
-                    _GwClientDao.UpdateClientAmount(gwClient);
+                    //gwClient = new GwClient();
+                    //gwClient.Balance = ((balance + payAmount) - num * basicNum) ;   //鍏呭�间綑棰�:鍗曚綅锛堝帢锛�
+                    //gwClient.Top_up_Amount_Total = topUpAmountTotal + payAmount;    //鍏呭�奸噾棰�:鍗曚綅锛堝帢锛�
+                    //gwClient.ClientID = clientId;
+                    
+                    //鏇存柊瀹㈡埛鍏呭�兼暟鎹�
+                    _GwClientDao.UpdateClientAmount(payAmount-( num * basicNum), payAmount, clientId );
                 }
             }
             else
@@ -578,7 +576,8 @@
         balance =  int.Parse(gwClient.Balance.ToString() );
 
         //涓�1-棰勪粯璐�
-        if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
+        //if (gwSp.ChargeType==1 && (balance + payAmount) < num * basicNum)
+        if (gwClient.ChargeType==1 && (balance + payAmount) < num * basicNum)
         {
             throw new ArgumentException("瀹㈡埛浣欓鍙婂厖鍊奸噾棰濅笉瓒宠喘涔帮紝璇疯皟鏁村悗鎻愪氦锛�");
         }

--
Gitblit v1.9.1