|
|
@@ -56,7 +56,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
|
- string condition = " and Status>-1";
|
|
|
+ string condition = " and Status>=-1";
|
|
|
//创客真实姓名
|
|
|
if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
{
|
|
|
@@ -436,12 +436,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 分仓机具额度记录列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexsData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string CreateDateData, string AmountTypeSelect, string OperateTypeSelect, string ChangeTypeSelect, string PayModeSelect, int page = 1, int limit = 30)
|
|
|
+ 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";
|
|
|
+ string condition = " and Status>=-1 and PayMode=1 and Sort=3";
|
|
|
//创客真实姓名
|
|
|
if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
{
|
|
|
@@ -479,6 +479,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
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);
|
|
|
@@ -519,6 +524,12 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
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);
|
|
|
@@ -533,13 +544,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 导出Excel
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult ExportsExcel(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string CreateDateData)
|
|
|
+ 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"); //时间
|
|
|
+ // Fields.Add("CreateDate", "3"); //时间
|
|
|
|
|
|
|
|
|
- string condition = " and Status>-1 and PayMode=1 and Sort=3";
|
|
|
+ string condition = " and PayMode=1 and Sort=3";
|
|
|
//创客真实姓名
|
|
|
if (!string.IsNullOrEmpty(UserIdRealName))
|
|
|
{
|
|
|
@@ -557,7 +568,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
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)
|
|
|
@@ -572,14 +589,15 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["SettleBankName"] = userid_Users.SettleBankName;
|
|
|
dic["Mobile"] = userid_Users.Mobile;
|
|
|
dic["Type"] = "临额提现";
|
|
|
- dic["IsOk"] = "否";
|
|
|
+ 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");
|
|
|
@@ -595,9 +613,10 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
ReturnFields.Add("SettleBankName", "银行名称");
|
|
|
ReturnFields.Add("Mobile", "手机号");
|
|
|
ReturnFields.Add("Type", "交易类型");
|
|
|
- ReturnFields.Add("IsOk", "是否完成");
|
|
|
+ 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);
|
|
|
}
|
|
|
@@ -640,6 +659,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
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];
|
|
|
@@ -652,7 +672,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
else if (IsOk == "否")
|
|
|
{
|
|
|
- error += "以下操作失败" + Id + ',' + "该记录未处理" + '\n';
|
|
|
+ IdLists.Add(Convert.ToInt32(Id));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -665,68 +685,27 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- var Info = db.StoreHouseAmountRecord.Where(m => IdList.Contains(m.Id)).ToList();
|
|
|
+ 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;
|
|
|
+ item.Status = 1;//设置为成功
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
- }
|
|
|
- AddSysLog("0", "StoreHouseCardAmountRecord", "Import");
|
|
|
- return "success";
|
|
|
- }
|
|
|
- #endregion
|
|
|
-
|
|
|
-
|
|
|
- #region 导入数据
|
|
|
-
|
|
|
- public IActionResult Import(string right, string ExcelKind)
|
|
|
- {
|
|
|
- ViewBag.RightInfo = RightInfo;
|
|
|
- ViewBag.right = right;
|
|
|
- ViewBag.ExcelKind = ExcelKind;
|
|
|
- return View();
|
|
|
- }
|
|
|
- /// <summary>
|
|
|
- /// 导入数据
|
|
|
- /// </summary>
|
|
|
- /// <param name="ExcelData"></param>
|
|
|
- [HttpPost]
|
|
|
- public string ImportPost(string ExcelPath, int Kind = 0)
|
|
|
- {
|
|
|
- string key = function.MD5_16(Guid.NewGuid().ToString());
|
|
|
- RedisDbconn.Instance.AddList("ExcelImportV2", ExcelPath + "#cut#" + Kind + "#cut#" + key + "#cut#" + SysUserName);
|
|
|
- return "success|" + key;
|
|
|
- }
|
|
|
- public Dictionary<string, object> CheckImportV2(string key)
|
|
|
- {
|
|
|
- Dictionary<string, object> Obj = new Dictionary<string, object>();
|
|
|
- string result = RedisDbconn.Instance.Get<string>("CheckImport:" + key);
|
|
|
- if (!string.IsNullOrEmpty(result))
|
|
|
- {
|
|
|
- string[] datalist = result.Split('|');
|
|
|
- if (datalist[0] == "success")
|
|
|
+ foreach (var items in Infos)
|
|
|
{
|
|
|
- List<string> errList = RedisDbconn.Instance.GetList<string>("ErrList" + key);
|
|
|
- if (errList.Count > 0)
|
|
|
- {
|
|
|
- Obj.Add("status", 2);
|
|
|
- Obj.Add("errList", errList);
|
|
|
- }
|
|
|
- else
|
|
|
+ items.Status = -1;//设置为失败
|
|
|
+ var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == items.UserId) ?? new UserAccount();
|
|
|
+ if (userAccount.Id > 0)
|
|
|
{
|
|
|
- Obj.Add("status", 1);
|
|
|
- Obj.Add("data", result);
|
|
|
+ userAccount.TempAmount += items.UseAmount;//退还卡充值临额
|
|
|
+ userAccount.ValidAmount += items.UseAmount;//退还可用额度
|
|
|
}
|
|
|
- return Obj;
|
|
|
+ db.SaveChanges();
|
|
|
}
|
|
|
- Obj.Add("status", 0);
|
|
|
- Obj.Add("data", datalist[0]);
|
|
|
- return Obj;
|
|
|
}
|
|
|
- Obj.Add("status", -1);
|
|
|
- Obj.Add("data", "执行中...");
|
|
|
- return Obj;
|
|
|
+ AddSysLog("0", "StoreHouseCardAmountRecord", "Import");
|
|
|
+ return "success";
|
|
|
}
|
|
|
#endregion
|
|
|
|