|
|
@@ -4027,28 +4027,22 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
|
|
|
[HttpPost]
|
|
|
- public string SetPosFeeDo(string PosSn, string FeeType)
|
|
|
+ public string SetPosFeeDo(string PosSn, int FeeType, int RecordFlag = 0)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(PosSn))
|
|
|
{
|
|
|
return "请输入机具SN";
|
|
|
}
|
|
|
- if (string.IsNullOrEmpty(FeeType))
|
|
|
+ if (FeeType == 0)
|
|
|
{
|
|
|
return "请输入选择费率";
|
|
|
}
|
|
|
- if (FeeType == "0")
|
|
|
+ string Fee = "0.63";
|
|
|
+ if(FeeType == 3)
|
|
|
{
|
|
|
- FeeType = "0.6";
|
|
|
+ Fee = "0.6";
|
|
|
}
|
|
|
- if (FeeType == "1")
|
|
|
- {
|
|
|
- FeeType = "0.63";
|
|
|
- }
|
|
|
-
|
|
|
string[] PosSnList = PosSn.Replace("\r", "").Split('\n');
|
|
|
- var PosId = "";
|
|
|
- var RecordId = "";
|
|
|
var error = "";
|
|
|
foreach (var item in PosSnList)
|
|
|
{
|
|
|
@@ -4056,21 +4050,30 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.SnId) ?? new PosMachinesTwo();
|
|
|
if (posInfo.Id > 0)
|
|
|
{
|
|
|
- var query = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
|
|
|
+ string RecordId = "";
|
|
|
+ if(RecordFlag == 1)
|
|
|
{
|
|
|
- Sort = posInfo.BrandId,
|
|
|
- CreateDate = DateTime.Now,
|
|
|
- PosId = posInfo.Id,
|
|
|
- PosSn = posInfo.PosSn,
|
|
|
- PosUserId = posInfo.UserId,
|
|
|
- MerchantId = posInfo.BindMerchantId,
|
|
|
- UserId = posInfo.UserId,
|
|
|
- ChangeFee = decimal.Parse(FeeType),
|
|
|
-
|
|
|
- }).Entity;
|
|
|
- db.SaveChanges();
|
|
|
- PosId += posInfo.Id + ",";
|
|
|
- RecordId += query.Id + ",";
|
|
|
+ decimal ChangeFee = decimal.Parse(Fee);
|
|
|
+ PosMachinesFeeChangeRecord query = db.PosMachinesFeeChangeRecord.FirstOrDefault(m => m.PosId == posInfo.Id && m.ChangeFee == ChangeFee && m.Status == 0);
|
|
|
+ if(query == null)
|
|
|
+ {
|
|
|
+ query = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
|
|
|
+ {
|
|
|
+ Sort = posInfo.BrandId,
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
+ PosId = posInfo.Id,
|
|
|
+ PosSn = posInfo.PosSn,
|
|
|
+ PosUserId = posInfo.UserId,
|
|
|
+ }).Entity;
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ query.MerchantId = posInfo.BindMerchantId;
|
|
|
+ query.UserId = posInfo.UserId;
|
|
|
+ query.ChangeFee = ChangeFee;
|
|
|
+ RecordId = query.Id.ToString();
|
|
|
+ }
|
|
|
+ string data = "{\"RecordId\":\"" + RecordId + "\",\"PosId\":\"" + posInfo.Id + "\",\"Fee\": \"" + Fee + "\",\"Kind\": \"" + FeeType + "\",\"OpMan\": \"系统\"}";
|
|
|
+ RedisDbconn.Instance.AddList("SetDepositPostQueue", data);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -4081,11 +4084,6 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
return "Warning|" + error;
|
|
|
}
|
|
|
- PosId = PosId.TrimEnd(',');
|
|
|
- function.WriteLog(DateTime.Now.ToString() + ":请求参数," + PosId + ":" + SysUserName + "-" + SysRealName, "根据机具号设置费率");
|
|
|
-
|
|
|
- string data = "{\"RecordId\":\"" + RecordId + "\",\"PosId\":\"" + PosId + "\",\"Fee\": \"" + FeeType + "\",\"Kind\": \"2\",\"OpMan\": \"系统\"}";
|
|
|
- RedisDbconn.Instance.AddList("SetDepositPostQueue", data);
|
|
|
return "success";
|
|
|
}
|
|
|
#endregion
|