|
|
@@ -39,7 +39,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
ViewBag.RightInfo = RightInfo;
|
|
|
ViewBag.right = right;
|
|
|
-
|
|
|
+
|
|
|
return View();
|
|
|
}
|
|
|
|
|
|
@@ -72,12 +72,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
|
|
|
}
|
|
|
//状态
|
|
|
- if(!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
{
|
|
|
condition += " and Status=" + StatusSelect;
|
|
|
}
|
|
|
//同步状态
|
|
|
- if(!string.IsNullOrEmpty(SyncStatusSelect))
|
|
|
+ if (!string.IsNullOrEmpty(SyncStatusSelect))
|
|
|
{
|
|
|
condition += " and SyncStatus=" + SyncStatusSelect;
|
|
|
}
|
|
|
@@ -93,13 +93,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["BizType"] = RelationClassForConst.GetBizTypeInfo(int.Parse(dic["BizType"].ToString()));
|
|
|
dic["ProductType"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["ProductType"].ToString()));
|
|
|
int Status = int.Parse(dic["Status"].ToString());
|
|
|
- if(Status == 0) dic["Status"] = "初始";
|
|
|
- if(Status == 1) dic["Status"] = "成功";
|
|
|
- if(Status == 2) dic["Status"] = "失败";
|
|
|
+ if (Status == 0) dic["Status"] = "初始";
|
|
|
+ if (Status == 1) dic["Status"] = "成功";
|
|
|
+ if (Status == 2) dic["Status"] = "失败";
|
|
|
int SyncStatus = int.Parse(dic["SyncStatus"].ToString());
|
|
|
- if(SyncStatus == 0) dic["SyncStatus"] = "未同步";
|
|
|
- if(SyncStatus == 1) dic["SyncStatus"] = "已同步";
|
|
|
- if(SyncStatus == 2) dic["SyncStatus"] = "同步中";
|
|
|
+ if (SyncStatus == 0) dic["SyncStatus"] = "未同步";
|
|
|
+ if (SyncStatus == 1) dic["SyncStatus"] = "已同步";
|
|
|
+ if (SyncStatus == 2) dic["SyncStatus"] = "同步中";
|
|
|
}
|
|
|
Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
string BizAmount30 = "0.00";//红包奖励
|
|
|
@@ -302,17 +302,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
for (int i = 1; i < list.Count; i++)
|
|
|
{
|
|
|
JsonData dr = list[i];
|
|
|
- string BatchCode = dr[0].ToString();
|
|
|
- string RechargeRecNo = dr[1].ToString();
|
|
|
- int ProductType = int.Parse(dr[5].ToString());
|
|
|
- string MakerCode = dr[2].ToString();
|
|
|
- int BizType = int.Parse(dr[4].ToString());
|
|
|
- decimal Amount = decimal.Parse(dr[6].ToString());
|
|
|
- string Remark = dr[7].ToString();
|
|
|
- string Operator = dr[8].ToString();
|
|
|
-
|
|
|
+ string BatchCode = dr[0].ToString(); // 批次号
|
|
|
+ string RechargeRecNo = dr[1].ToString(); // 业务单号
|
|
|
+ string MakerCode = dr[2].ToString(); // 创客编号
|
|
|
+ string RealName = dr[3].ToString(); // 创客名称
|
|
|
+ int BizType = int.Parse(dr[4].ToString()); // 业务类型
|
|
|
+ int ProductType = int.Parse(dr[5].ToString()); // 产品类型
|
|
|
+ decimal Amount = decimal.Parse(dr[6].ToString()); // 金额(分)
|
|
|
+ string Remark = dr[7].ToString(); // 备注信息
|
|
|
+ string Operator = dr[8].ToString(); // 操作人
|
|
|
UserForMakerCode user = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new UserForMakerCode();
|
|
|
-
|
|
|
db.SysRechargeRecord.Add(new SysRechargeRecord()
|
|
|
{
|
|
|
CreateDate = DateTime.Now,
|
|
|
@@ -325,6 +324,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Amount = Amount, //奖励金额
|
|
|
BatchCode = BatchCode, //批次号
|
|
|
SeoDescription = Remark,
|
|
|
+ CreateMan = Operator,
|
|
|
});
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
@@ -359,12 +359,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
condition += " and UserId in (select UserId from UserForRealName where RealName='" + RealName + "')";
|
|
|
}
|
|
|
//状态
|
|
|
- if(!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
{
|
|
|
condition += " and Status=" + StatusSelect;
|
|
|
}
|
|
|
//同步状态
|
|
|
- if(!string.IsNullOrEmpty(SyncStatusSelect))
|
|
|
+ if (!string.IsNullOrEmpty(SyncStatusSelect))
|
|
|
{
|
|
|
condition += " and SyncStatus=" + SyncStatusSelect;
|
|
|
}
|
|
|
@@ -380,13 +380,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["BizType"] = RelationClassForConst.GetBizTypeInfo(int.Parse(dic["BizType"].ToString()));
|
|
|
dic["ProductType"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["ProductType"].ToString()));
|
|
|
int Status = int.Parse(dic["Status"].ToString());
|
|
|
- if(Status == 0) dic["Status"] = "初始";
|
|
|
- if(Status == 1) dic["Status"] = "成功";
|
|
|
- if(Status == 2) dic["Status"] = "失败";
|
|
|
+ if (Status == 0) dic["Status"] = "初始";
|
|
|
+ if (Status == 1) dic["Status"] = "成功";
|
|
|
+ if (Status == 2) dic["Status"] = "失败";
|
|
|
int SyncStatus = int.Parse(dic["SyncStatus"].ToString());
|
|
|
- if(SyncStatus == 0) dic["SyncStatus"] = "未同步";
|
|
|
- if(SyncStatus == 1) dic["SyncStatus"] = "已同步";
|
|
|
- if(SyncStatus == 2) dic["SyncStatus"] = "同步中";
|
|
|
+ if (SyncStatus == 0) dic["SyncStatus"] = "未同步";
|
|
|
+ if (SyncStatus == 1) dic["SyncStatus"] = "已同步";
|
|
|
+ if (SyncStatus == 2) dic["SyncStatus"] = "同步中";
|
|
|
dic.Remove("UserId");
|
|
|
}
|
|
|
|
|
|
@@ -414,5 +414,62 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ #region 同步到账户余额
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 同步到账户余额
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string Sycn(string Id)
|
|
|
+ {
|
|
|
+ string[] idlist = Id.Split(new char[] { ',' });
|
|
|
+ AddSysLog(Id, "SysRechargeRecord", "Sycn");
|
|
|
+ foreach (string subid in idlist)
|
|
|
+ {
|
|
|
+ int id = int.Parse(subid);
|
|
|
+ SysRechargeRecord edit = db.SysRechargeRecord.FirstOrDefault(m => m.Id == id);
|
|
|
+ if (edit != null)
|
|
|
+ {
|
|
|
+ edit.Status = 1;
|
|
|
+ edit.SyncStatus = 1;
|
|
|
+ UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == edit.UserId);
|
|
|
+ if (account != null)
|
|
|
+ {
|
|
|
+ account.QueryCount = 1;
|
|
|
+ decimal TradeAmount = edit.Amount;
|
|
|
+ decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
|
|
|
+ decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
|
|
|
+ decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
|
|
|
+ account.TotalAmount += edit.Amount;
|
|
|
+ account.FreezeAmount += edit.Amount;
|
|
|
+ decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
|
|
|
+ decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
|
|
|
+ decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
|
|
|
+ db.UserAccountRecord.Add(new UserAccountRecord()
|
|
|
+ {
|
|
|
+ CreateDate = DateTime.Now,
|
|
|
+ UpdateDate = DateTime.Now,
|
|
|
+ UserId = edit.UserId, //创客
|
|
|
+ ChangeType = edit.BizType, //变动类型
|
|
|
+ ProductType = edit.ProductType, //产品类型
|
|
|
+ ChangeAmount = edit.Amount, //变更金额
|
|
|
+ BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
|
|
|
+ AfterTotalAmount = AfterTotalAmount, //变更后总金额
|
|
|
+ BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
|
|
|
+ AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
|
|
|
+ BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
|
|
|
+ AfterBalanceAmount = AfterBalanceAmount, //变更后余额
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
}
|
|
|
}
|