|
|
@@ -26,7 +26,13 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
string requestMes = sr.ReadToEnd();
|
|
|
JsonData data = JsonMapper.ToObject(requestMes);
|
|
|
Dictionary<string, object> req = new Dictionary<string, object>();
|
|
|
- req.Add("PosSnId", data["posId"].ToString());
|
|
|
+ string PosSn = data["posSn"].ToString();
|
|
|
+ PosMachinesTwo pos = maindb.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
|
|
|
+ if(pos == null)
|
|
|
+ {
|
|
|
+ return Json(new AppResultJson() { Status = "-1", Info = "机具号不正确" });
|
|
|
+ }
|
|
|
+ req.Add("PosSnId", pos.Id);
|
|
|
req.Add("BrandId", data["brandId"].ToString());
|
|
|
req.Add("Deposit", data["deposit"].ToString());
|
|
|
req.Add("CallBackUrl", data["callBackUrl"].ToString());
|
|
|
@@ -42,12 +48,17 @@ namespace MySystem.Areas.Api.Controllers.v1
|
|
|
StreamReader sr = new StreamReader(Request.Body);
|
|
|
string requestMes = sr.ReadToEnd();
|
|
|
JsonData data = JsonMapper.ToObject(requestMes);
|
|
|
- int PosId = int.Parse(data["posId"].ToString());
|
|
|
+ string PosSn = data["posSn"].ToString();
|
|
|
+ PosMachinesTwo pos = maindb.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
|
|
|
+ if(pos == null)
|
|
|
+ {
|
|
|
+ return Json(new AppResultJson() { Status = "-1", Info = "机具号不正确" });
|
|
|
+ }
|
|
|
+ int PosId = pos.Id;
|
|
|
int BrandId = int.Parse(data["brandId"].ToString());
|
|
|
decimal FeeRate = decimal.Parse(data["feeRate"].ToString());
|
|
|
int FeeExtra = int.Parse(data["feeExtra"].ToString());
|
|
|
string CallBackUrl = data["callBackUrl"].ToString();
|
|
|
- PosMachinesTwo pos = maindb.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId) ?? new PosMachinesTwo();
|
|
|
PosMerchantInfo mer = maindb.PosMerchantInfo.FirstOrDefault(m => m.Id == PosId) ?? new PosMerchantInfo();
|
|
|
PosMachinesFeeChangeRecord query = maindb.PosMachinesFeeChangeRecord.FirstOrDefault(m => m.PosId == PosId && m.Status == 0);
|
|
|
if(query == null)
|