Преглед изворни кода

推送java交易数据,金额处理

lcl пре 6 месеци
родитељ
комит
0c0a60e850
1 измењених фајлова са 49 додато и 3 уклоњено
  1. 49 3
      AppStart/Helper/PosPushDataNewHelper.cs

+ 49 - 3
AppStart/Helper/PosPushDataNewHelper.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using Library;
 using MySystem.SpModels;
 
@@ -98,11 +99,26 @@ namespace MySystem
         {
             try
             {
+                List<string> BrandIds = new List<string>();
+                decimal TradeAmount = decimal.Parse(function.CheckNum(act.SeoTitle));
+                BrandIds.Add("1");
+                BrandIds.Add("4");
+                BrandIds.Add("6");
+                BrandIds.Add("7");
+                BrandIds.Add("8");
+                BrandIds.Add("9");
+                BrandIds.Add("15");
+                BrandIds.Add("22");
+                BrandIds.Add("30");
+                if(BrandIds.Contains(act.ProductType))
+                {
+                    TradeAmount = TradeAmount / 100;
+                }
                 Dictionary<string, object> dataContent = new Dictionary<string, object>();
                 dataContent.Add("pos_sn", act.SnNo); //机具sn
                 dataContent.Add("mer_no", act.MerNo); //商户号
                 dataContent.Add("request_id", getRequestId(act.Id, "deposit")); //流水号
-                dataContent.Add("deposit_amount", act.SeoTitle); //押金金额
+                dataContent.Add("deposit_amount", TradeAmount); //押金金额
                 dataContent.Add("trade_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //交易时间
                 dataContent.Add("card_type", 1); //卡类型
                 dataContent.Add("brand", int.Parse(function.CheckInt(act.ProductType))); //品牌
@@ -117,11 +133,26 @@ namespace MySystem
         {
             try
             {
+                List<string> BrandIds = new List<string>();
+                decimal TradeAmount = trade.TradeAmount;
+                BrandIds.Add("1");
+                BrandIds.Add("4");
+                BrandIds.Add("6");
+                BrandIds.Add("7");
+                BrandIds.Add("8");
+                BrandIds.Add("9");
+                BrandIds.Add("15");
+                BrandIds.Add("22");
+                BrandIds.Add("30");
+                if(BrandIds.Contains(trade.ProductType))
+                {
+                    TradeAmount = TradeAmount / 100;
+                }
                 Dictionary<string, object> dataContent = new Dictionary<string, object>();
                 dataContent.Add("pos_sn", trade.TradeSnNo); //机具sn
                 dataContent.Add("mer_no", trade.MerNo); //商户号
                 dataContent.Add("request_id", getRequestId(trade.Id, "deposit1")); //流水号
-                dataContent.Add("deposit_amount", trade.TradeAmount); //押金金额
+                dataContent.Add("deposit_amount", TradeAmount); //押金金额
                 dataContent.Add("trade_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //交易时间
                 dataContent.Add("card_type", 1); //卡类型
                 dataContent.Add("brand", int.Parse(function.CheckInt(trade.ProductType))); //品牌
@@ -159,6 +190,21 @@ namespace MySystem
             {
                 int QrPayFlag = 0;
                 int BankCardType = 1;
+                List<string> BrandIds = new List<string>();
+                decimal TradeAmount = trade.TradeAmount;
+                BrandIds.Add("1");
+                BrandIds.Add("4");
+                BrandIds.Add("6");
+                BrandIds.Add("7");
+                BrandIds.Add("8");
+                BrandIds.Add("9");
+                BrandIds.Add("15");
+                BrandIds.Add("22");
+                BrandIds.Add("30");
+                if(BrandIds.Contains(trade.ProductType))
+                {
+                    TradeAmount = TradeAmount / 100;
+                }
                 if (trade.ProductType == "1")
                 {
                     if (trade.TradeType == "02") QrPayFlag = 1;
@@ -261,7 +307,7 @@ namespace MySystem
                 dataContent.Add("pos_sn", trade.TradeSnNo); //机具sn
                 dataContent.Add("mer_no", trade.MerNo); //商户号
                 dataContent.Add("request_id", trade.TradeSerialNo); //流水号
-                dataContent.Add("trade_amount", trade.TradeAmount); //交易金额
+                dataContent.Add("trade_amount", TradeAmount); //交易金额
                 dataContent.Add("trade_time", trade.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")); //交易时间
                 dataContent.Add("brand", int.Parse(function.CheckInt(trade.ProductType))); //品牌
                 dataContent.Add("card_type", BankCardType); //卡类型