|
|
@@ -51,24 +51,28 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 分仓机具额度记录列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string AmountTypeSelect, string OperateTypeSelect, string ChangeTypeSelect, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string CreateDateData, string AmountTypeSelect, string OperateTypeSelect, string ChangeTypeSelect, string PayModeSelect, int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
|
- Fields.Add("CreateDate", "3"); //时间
|
|
|
-
|
|
|
-
|
|
|
- string condition = " and Status>-1";
|
|
|
+ string condition = " and Status>=-1";
|
|
|
//创客真实姓名
|
|
|
if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
{
|
|
|
- condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
}
|
|
|
//创客编号
|
|
|
if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
{
|
|
|
- condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
}
|
|
|
//额度类别
|
|
|
if (!string.IsNullOrEmpty(AmountTypeSelect))
|
|
|
@@ -85,6 +89,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and OperateType=" + OperateTypeSelect;
|
|
|
}
|
|
|
+ //额度类别
|
|
|
+ if (!string.IsNullOrEmpty(PayModeSelect))
|
|
|
+ {
|
|
|
+ condition += " and PayMode=" + PayModeSelect;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", page, limit, condition);
|
|
|
@@ -115,6 +124,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if (OperateType == 1) dic["OperateType"] = "增加";
|
|
|
if (OperateType == 2) dic["OperateType"] = "减少";
|
|
|
if (OperateType == 0) dic["OperateType"] = "";
|
|
|
+ //额度类别
|
|
|
+ int PayMode = int.Parse(dic["PayMode"].ToString());
|
|
|
+ if (PayMode == 1) dic["PayMode"] = "支付宝";
|
|
|
+ if (PayMode == 3) dic["PayMode"] = "余额";
|
|
|
+ if (PayMode == 0) dic["PayMode"] = "";
|
|
|
|
|
|
}
|
|
|
return Json(obj);
|
|
|
@@ -155,7 +169,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- int Id = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Add("StoreHouseAmountRecord", Fields, 0);
|
|
|
+ int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("StoreHouseAmountRecord", Fields, 0);
|
|
|
AddSysLog(data.Id.ToString(), "StoreHouseAmountRecord", "add");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -199,7 +213,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, data.Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, data.Id);
|
|
|
AddSysLog(data.Id.ToString(), "StoreHouseAmountRecord", "update");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -223,7 +237,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", -1);
|
|
|
- new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -247,7 +261,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 1);
|
|
|
- new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -270,7 +284,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 0);
|
|
|
- new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -285,7 +299,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// <param name="Id"></param>
|
|
|
public string Sort(int Id, int Sort)
|
|
|
{
|
|
|
- new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Sort("StoreHouseAmountRecord", Sort, Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("StoreHouseAmountRecord", Sort, Id);
|
|
|
|
|
|
AddSysLog(Id.ToString(), "StoreHouseAmountRecord", "sort");
|
|
|
return "success";
|
|
|
@@ -334,12 +348,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
//创客真实姓名
|
|
|
if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
{
|
|
|
- condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
}
|
|
|
//创客编号
|
|
|
if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
{
|
|
|
- condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
}
|
|
|
//额度类别
|
|
|
if (!string.IsNullOrEmpty(AmountTypeSelect))
|
|
|
@@ -353,7 +367,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "UserId,ApplyId,UseAmount,BeforeAmount,AfterAmount,AmountType,OperateType", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "UserId,ApplyId,UseAmount,BeforeAmount,AfterAmount,AmountType,OperateType", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
@@ -398,5 +412,302 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+ #region 银行卡临额提现记录列表
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 根据条件查询分仓机具额度记录列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public IActionResult Indexs(StoreHouseAmountRecord data, string right)
|
|
|
+ {
|
|
|
+ ViewBag.RightInfo = RightInfo;
|
|
|
+ ViewBag.right = right;
|
|
|
+
|
|
|
+
|
|
|
+ return View();
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 银行卡临额提现记录列表
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 分仓机具额度记录列表
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public JsonResult IndexsData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string CreateDateData, string AmountTypeSelect, string OperateTypeSelect, string ChangeTypeSelect, string PayModeSelect, string StatusSelect = "0", int page = 1, int limit = 30)
|
|
|
+ {
|
|
|
+
|
|
|
+ Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+
|
|
|
+ string condition = " and Status>=-1 and PayMode=1 and Sort=3";
|
|
|
+ //创客真实姓名
|
|
|
+ if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
+ {
|
|
|
+ condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ }
|
|
|
+ //创客编号
|
|
|
+ if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ {
|
|
|
+ condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+ //额度类别
|
|
|
+ if (!string.IsNullOrEmpty(AmountTypeSelect))
|
|
|
+ {
|
|
|
+ condition += " and AmountType=" + AmountTypeSelect;
|
|
|
+ }
|
|
|
+ //变动类别
|
|
|
+ if (!string.IsNullOrEmpty(ChangeTypeSelect))
|
|
|
+ {
|
|
|
+ condition += " and Sort=" + ChangeTypeSelect;
|
|
|
+ }
|
|
|
+ //操作类别
|
|
|
+ if (!string.IsNullOrEmpty(OperateTypeSelect))
|
|
|
+ {
|
|
|
+ condition += " and OperateType=" + OperateTypeSelect;
|
|
|
+ }
|
|
|
+ //额度类别
|
|
|
+ if (!string.IsNullOrEmpty(PayModeSelect))
|
|
|
+ {
|
|
|
+ condition += " and PayMode=" + PayModeSelect;
|
|
|
+ }
|
|
|
+ //状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ {
|
|
|
+ condition += " and Status=" + StatusSelect;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", page, limit, condition);
|
|
|
+ List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
+ foreach (Dictionary<string, object> dic in diclist)
|
|
|
+ {
|
|
|
+ //创客
|
|
|
+ int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
+ Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
+ dic["UserIdRealName"] = userid_Users.RealName;
|
|
|
+ dic["UserIdMakerCode"] = userid_Users.MakerCode;
|
|
|
+ dic["CertId"] = userid_Users.CertId;
|
|
|
+ dic["SettleBankCardNo"] = userid_Users.SettleBankCardNo;
|
|
|
+ dic["SettleBankName"] = userid_Users.SettleBankName;
|
|
|
+ dic["Mobile"] = userid_Users.Mobile;
|
|
|
+ dic["Type"] = "临额提现";
|
|
|
+ dic.Remove("UserId");
|
|
|
+ //申请单
|
|
|
+ dic["ApplyId"] = RelationClass.GetStoreMachineApplyInfo(int.Parse(dic["ApplyId"].ToString()));
|
|
|
+ //额度类别
|
|
|
+ int AmountType = int.Parse(dic["AmountType"].ToString());
|
|
|
+ if (AmountType == 0) dic["AmountType"] = "固定额度";
|
|
|
+ if (AmountType == 1) dic["AmountType"] = "临时额度";
|
|
|
+ //变动类别
|
|
|
+ int ChangeType = int.Parse(dic["Sort"].ToString());
|
|
|
+ if (ChangeType == 1) dic["ChangeType"] = "购买临时额度";
|
|
|
+ if (ChangeType == 2) dic["ChangeType"] = "增减分仓临时额度";
|
|
|
+ if (ChangeType == 3) dic["ChangeType"] = "调低额度返回余额";
|
|
|
+ if (ChangeType == 4) dic["ChangeType"] = "仓库发货|预发机申请";
|
|
|
+ if (ChangeType == 5) dic["ChangeType"] = "后台仓库调拨";
|
|
|
+ //操作类别
|
|
|
+ int OperateType = int.Parse(dic["OperateType"].ToString());
|
|
|
+ if (OperateType == 1) dic["OperateType"] = "增加";
|
|
|
+ if (OperateType == 2) dic["OperateType"] = "减少";
|
|
|
+ if (OperateType == 0) dic["OperateType"] = "";
|
|
|
+ //额度类别
|
|
|
+ int PayMode = int.Parse(dic["PayMode"].ToString());
|
|
|
+ if (PayMode == 1) dic["PayMode"] = "支付宝";
|
|
|
+ if (PayMode == 3) dic["PayMode"] = "余额";
|
|
|
+ if (PayMode == 0) dic["PayMode"] = "";
|
|
|
+ //状态
|
|
|
+ int Status = int.Parse(dic["Status"].ToString());
|
|
|
+ if (Status == 0) dic["Status"] = "待处理";
|
|
|
+ if (Status == 2) dic["Status"] = "处理中";
|
|
|
+ if (Status == 1) dic["Status"] = "成功";
|
|
|
+ if (Status == -1) dic["Status"] = "失败";
|
|
|
+
|
|
|
+ }
|
|
|
+ return Json(obj);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 银行卡临额提现记录导出Excel
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 导出Excel
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public JsonResult ExportsExcel(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string CreateDateData, string StatusSelect)
|
|
|
+ {
|
|
|
+ Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+ // Fields.Add("CreateDate", "3"); //时间
|
|
|
+
|
|
|
+
|
|
|
+ string condition = " and PayMode=1 and Sort=3";
|
|
|
+ //创客真实姓名
|
|
|
+ if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
+ {
|
|
|
+ condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
|
|
|
+ }
|
|
|
+ //创客编号
|
|
|
+ if (!string.IsNullOrEmpty(UserIdMakerCode))
|
|
|
+ {
|
|
|
+ condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+ //状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ {
|
|
|
+ condition += " and Status=" + StatusSelect;
|
|
|
+ }
|
|
|
+
|
|
|
+ var Ids = "";
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "Id,UserId,UseAmount", false);
|
|
|
+ List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
+ foreach (Dictionary<string, object> dic in diclist)
|
|
|
+ {
|
|
|
+ //创客
|
|
|
+ int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
+ Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
+ dic["UserIdRealName"] = userid_Users.RealName;
|
|
|
+ dic["UserIdMakerCode"] = userid_Users.MakerCode;
|
|
|
+ dic["CertId"] = userid_Users.CertId;
|
|
|
+ dic["SettleBankCardNo"] = userid_Users.SettleBankCardNo;
|
|
|
+ dic["SettleBankName"] = userid_Users.SettleBankName;
|
|
|
+ dic["Mobile"] = userid_Users.Mobile;
|
|
|
+ dic["Type"] = "临额提现";
|
|
|
+ dic["IsOk"] = "";
|
|
|
+ dic.Remove("UserId");
|
|
|
+
|
|
|
+ //记录Id
|
|
|
+ int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
|
|
|
+ dic["Id"] = Id;
|
|
|
+ Ids += Id + ",";
|
|
|
+ }
|
|
|
+ Ids = Ids.TrimEnd(',');
|
|
|
+
|
|
|
+ Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
+ result.Add("Status", "1");
|
|
|
+ result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
|
|
|
+ result.Add("Obj", diclist);
|
|
|
+ Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
|
|
|
+ ReturnFields.Add("Id", "记录ID");
|
|
|
+ ReturnFields.Add("UserIdRealName", "创客真实姓名");
|
|
|
+ ReturnFields.Add("UserIdMakerCode", "创客编号");
|
|
|
+ ReturnFields.Add("UseAmount", "申请提现临额");
|
|
|
+ ReturnFields.Add("CertId", "身份证号");
|
|
|
+ ReturnFields.Add("SettleBankCardNo", "银行卡号");
|
|
|
+ ReturnFields.Add("SettleBankName", "银行名称");
|
|
|
+ ReturnFields.Add("Mobile", "手机号");
|
|
|
+ ReturnFields.Add("Type", "交易类型");
|
|
|
+ ReturnFields.Add("IsOk", "是否成功(是、否)");
|
|
|
+
|
|
|
+ result.Add("Fields", ReturnFields);
|
|
|
+ OtherMySqlConn.op("UPDATE StoreHouseAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ")");
|
|
|
+ AddSysLog("0", "StoreHouseAmountRecord", "ExportExcel");
|
|
|
+ return Json(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 开启
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public string BatchSetting(string Id)
|
|
|
+ {
|
|
|
+ string[] idlist = Id.Split(new char[] { ',' });
|
|
|
+ AddSysLog(Id, "StoreHouseCardAmountRecord", "BatchSetting");
|
|
|
+ foreach (string subid in idlist)
|
|
|
+ {
|
|
|
+ int id = int.Parse(subid);
|
|
|
+ Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
+ Fields.Add("Status", -1);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 银行卡临额提现记录结果导入Excel
|
|
|
+ /// <summary>
|
|
|
+ /// 银行卡临额提现记录结果导入Excel
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="ExcelData"></param>
|
|
|
+ public string Imports(string ExcelData)
|
|
|
+ {
|
|
|
+ ExcelData = HttpUtility.UrlDecode(ExcelData);
|
|
|
+ JsonData list = JsonMapper.ToObject(ExcelData);
|
|
|
+ string error = "";
|
|
|
+ List<int> IdList = new List<int>();
|
|
|
+ List<int> IdLists = new List<int>();
|
|
|
+ for (int i = 1; i < list.Count; i++)
|
|
|
+ {
|
|
|
+ JsonData dr = list[i];
|
|
|
+ string itemJson = dr.ToJson();
|
|
|
+ string Id = itemJson.Contains("\"A\"") ? dr["A"].ToString() : "";
|
|
|
+ string IsOk = itemJson.Contains("\"J\"") ? dr["J"].ToString() : "";
|
|
|
+ if (IdList.Contains(Convert.ToInt32(Id)))
|
|
|
+ {
|
|
|
+ error += "以下操作失败" + Id + ',' + "该记录重复" + '\n';
|
|
|
+ }
|
|
|
+ else if (IsOk == "否")
|
|
|
+ {
|
|
|
+ IdLists.Add(Convert.ToInt32(Id));
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ IdList.Add(Convert.ToInt32(Id));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(error))
|
|
|
+ {
|
|
|
+ return "Warning|" + error;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var Info = db.StoreHouseAmountRecord.Where(m => IdList.Contains(m.Id)).ToList();//成功
|
|
|
+ var Infos = db.StoreHouseAmountRecord.Where(m => IdLists.Contains(m.Id)).ToList();//失败
|
|
|
+ foreach (var item in Info)
|
|
|
+ {
|
|
|
+ item.Status = 1;//设置为成功
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ foreach (var items in Infos)
|
|
|
+ {
|
|
|
+ items.Status = -1;//设置为失败
|
|
|
+ var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == items.UserId) ?? new UserAccount();
|
|
|
+ if (userAccount.Id > 0)
|
|
|
+ {
|
|
|
+ userAccount.TempAmount += items.UseAmount;//退还卡充值临额
|
|
|
+ userAccount.ValidAmount += items.UseAmount;//退还可用额度
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AddSysLog("0", "StoreHouseCardAmountRecord", "Import");
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
}
|
|
|
}
|