|
|
@@ -503,31 +503,104 @@ namespace MySystem
|
|
|
|
|
|
public static Dictionary<string, string> GetFee(string PosSn, string FeeRate, string FeeAmt, string ProductType)
|
|
|
{
|
|
|
- if(decimal.Parse(FeeRate) > 0.63M) FeeRate = "0.63";
|
|
|
- List<string> BrandIds = new List<string>();
|
|
|
- BrandIds.Add("1");
|
|
|
- BrandIds.Add("7");
|
|
|
- BrandIds.Add("10");
|
|
|
- BrandIds.Add("11");
|
|
|
- BrandIds.Add("15");
|
|
|
- BrandIds.Add("16");
|
|
|
- BrandIds.Add("27");
|
|
|
Dictionary<string, string> result = new Dictionary<string, string>();
|
|
|
- if(BrandIds.Contains(ProductType))
|
|
|
+ try
|
|
|
{
|
|
|
- PosFeeItem pos = RedisDbconn.Instance.GetList<PosFeeItem>("PosFeeList").FirstOrDefault(m => m.PosSn == PosSn);
|
|
|
- if(pos != null)
|
|
|
+ if(decimal.Parse(FeeRate) > 0.63M) FeeRate = "0.63";
|
|
|
+ List<int> BrandIds = new List<int>();
|
|
|
+ BrandIds.Add(7);
|
|
|
+ BrandIds.Add(10);
|
|
|
+ BrandIds.Add(11);
|
|
|
+ BrandIds.Add(15);
|
|
|
+ BrandIds.Add(16);
|
|
|
+ Utils.WriteLog("start");
|
|
|
+ bool op = false;
|
|
|
+ if(ProductType == "1" || ProductType == "27")
|
|
|
+ {
|
|
|
+ op = true;
|
|
|
+ }
|
|
|
+ else if(BrandIds.Contains(int.Parse(ProductType)))
|
|
|
+ {
|
|
|
+ PxcModels.WebCMSEntities db = new PxcModels.WebCMSEntities();
|
|
|
+ op = db.TmpTradeNo.Any(m => m.RecordNo == PosSn);
|
|
|
+ db.Dispose();
|
|
|
+ }
|
|
|
+ if(op)
|
|
|
+ {
|
|
|
+ PosFeeItem pos = RedisDbconn.Instance.Get<PosFeeItem>("PosFee:" + PosSn);
|
|
|
+ if(pos == null)
|
|
|
+ {
|
|
|
+ JavaProductModels.WebCMSEntities db = new JavaProductModels.WebCMSEntities();
|
|
|
+ JavaProductModels.KxsMachine p = db.KxsMachine.FirstOrDefault(m => m.PosSn == PosSn && BrandIds.Contains(m.BrandId));
|
|
|
+ pos = new PosFeeItem() { PosSn = p.PosSn, FeeRate = p.MachineRatio, FeeAmt = p.SecondFee };
|
|
|
+ RedisDbconn.Instance.Set("PosFee:" + PosSn, pos);
|
|
|
+ db.Dispose();
|
|
|
+ }
|
|
|
+ if(pos != null)
|
|
|
+ {
|
|
|
+ result.Add("FeeRate", pos.FeeRate.ToString("f2"));
|
|
|
+ result.Add("FeeAmt", pos.FeeAmt.ToString("f2"));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.Add("FeeRate", FeeRate);
|
|
|
+ result.Add("FeeAmt", FeeAmt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- result.Add("FeeRate", pos.FeeRate.ToString("f2"));
|
|
|
- result.Add("FeeAmt", pos.FeeAmt.ToString("f2"));
|
|
|
+ result.Add("FeeRate", FeeRate);
|
|
|
+ result.Add("FeeAmt", FeeAmt);
|
|
|
+ }
|
|
|
+ Utils.WriteLog("end");
|
|
|
+ }
|
|
|
+ catch
|
|
|
+ {
|
|
|
+ result.Add("FeeRate", FeeRate);
|
|
|
+ result.Add("FeeAmt", FeeAmt);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static Dictionary<string, string> GetFee2(string PosSn, string FeeRate, string FeeAmt, string ProductType)
|
|
|
+ {
|
|
|
+ Dictionary<string, string> result = new Dictionary<string, string>();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ if(decimal.Parse(FeeRate) > 0.63M) FeeRate = "0.63";
|
|
|
+ List<int> BrandIds = new List<int>();
|
|
|
+ BrandIds.Add(1);
|
|
|
+ BrandIds.Add(7);
|
|
|
+ BrandIds.Add(10);
|
|
|
+ BrandIds.Add(11);
|
|
|
+ BrandIds.Add(15);
|
|
|
+ BrandIds.Add(16);
|
|
|
+ BrandIds.Add(27);
|
|
|
+ Utils.WriteLog("start");
|
|
|
+ if(BrandIds.Contains(int.Parse(ProductType)))
|
|
|
+ {
|
|
|
+ JavaProductModels.WebCMSEntities db = new JavaProductModels.WebCMSEntities();
|
|
|
+ JavaProductModels.KxsMachine pos = db.KxsMachine.FirstOrDefault(m => m.PosSn == PosSn && BrandIds.Contains(m.BrandId));
|
|
|
+ if(pos != null)
|
|
|
+ {
|
|
|
+ result.Add("FeeRate", pos.MachineRatio.ToString("f2"));
|
|
|
+ result.Add("FeeAmt", pos.SecondFee.ToString("f2"));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.Add("FeeRate", FeeRate);
|
|
|
+ result.Add("FeeAmt", FeeAmt);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
result.Add("FeeRate", FeeRate);
|
|
|
result.Add("FeeAmt", FeeAmt);
|
|
|
}
|
|
|
+ Utils.WriteLog("end");
|
|
|
}
|
|
|
- else
|
|
|
+ catch
|
|
|
{
|
|
|
result.Add("FeeRate", FeeRate);
|
|
|
result.Add("FeeAmt", FeeAmt);
|