|
@@ -35,15 +35,23 @@ namespace MySystem
|
|
{
|
|
{
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
JsonData jsonObj = JsonMapper.ToObject(data);
|
|
JsonData jsonObj = JsonMapper.ToObject(data);
|
|
- int PosId = int.Parse(function.CheckInt(jsonObj["PosId"].ToString()));
|
|
|
|
|
|
+ string PosIds = jsonObj["PosId"].ToString();
|
|
int Kind = int.Parse(function.CheckInt(jsonObj["Kind"].ToString()));
|
|
int Kind = int.Parse(function.CheckInt(jsonObj["Kind"].ToString()));
|
|
string OpMan = jsonObj["OpMan"].ToString();
|
|
string OpMan = jsonObj["OpMan"].ToString();
|
|
- if(PosId > 0 && Kind > 0)
|
|
|
|
|
|
+ if(!string.IsNullOrEmpty(PosIds) && Kind > 0)
|
|
{
|
|
{
|
|
- PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == PosId);
|
|
|
|
- if(pos != null)
|
|
|
|
- {
|
|
|
|
- PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
|
|
|
|
+ List<int> ids = new List<int>();
|
|
|
|
+ string[] PosIdList = PosIds.Split(',');
|
|
|
|
+ foreach(string sub in PosIdList)
|
|
|
|
+ {
|
|
|
|
+ ids.Add(int.Parse(sub));
|
|
|
|
+ }
|
|
|
|
+ List<PosMachinesTwo> poslist = db.PosMachinesTwo.Where(m => ids.Contains(m.Id)).ToList();
|
|
|
|
+ List<int> mids = poslist.Select(m => m.BindMerchantId).ToList();
|
|
|
|
+ List<PosMerchantInfo> merchantlist = db.PosMerchantInfo.Where(m => mids.Contains(m.Id)).ToList();
|
|
|
|
+ foreach(PosMachinesTwo pos in poslist)
|
|
|
|
+ {
|
|
|
|
+ PosMerchantInfo merchant = merchantlist.FirstOrDefault(m => m.Id == pos.BindMerchantId);
|
|
if(merchant != null)
|
|
if(merchant != null)
|
|
{
|
|
{
|
|
decimal Fee = Kind == 1 ? 0.63M : 0.6M;
|
|
decimal Fee = Kind == 1 ? 0.63M : 0.6M;
|
|
@@ -117,8 +125,7 @@ namespace MySystem
|
|
db.Dispose();
|
|
db.Dispose();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
- {
|
|
|
|
-
|
|
|
|
|
|
+ {
|
|
function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "设置费率队列异常");
|
|
function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "设置费率队列异常");
|
|
}
|
|
}
|
|
}
|
|
}
|