|
|
@@ -87,6 +87,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["MerchantIdMerRealName"] = merchantid_PosMerchantInfo.MerRealName;
|
|
|
dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
+ dic["MerchantIdKqSnNo"] = merchantid_PosMerchantInfo.KqSnNo;
|
|
|
dic.Remove("MerchantId");
|
|
|
int Status = int.Parse(dic["Status"].ToString());
|
|
|
if (Status == 0) dic["StatusName"] = "待处理";
|
|
|
@@ -94,6 +95,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if (Status == 2) dic["StatusName"] = "失败";
|
|
|
if (Status == 4) dic["StatusName"] = "通过";
|
|
|
if (Status == 5) dic["StatusName"] = "未通过";
|
|
|
+ dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(merchantid_PosMerchantInfo.BrandId.ToString()));
|
|
|
//创客
|
|
|
int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
@@ -181,6 +183,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["MerchantIdMerRealName"] = merchantid_PosMerchantInfo.MerRealName;
|
|
|
dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
+ dic["MerchantIdKqSnNo"] = merchantid_PosMerchantInfo.KqSnNo;
|
|
|
dic.Remove("MerchantId");
|
|
|
int Status = int.Parse(dic["Status"].ToString());
|
|
|
if (Status == 0) dic["StatusName"] = "待处理";
|
|
|
@@ -188,6 +191,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
if (Status == 2) dic["StatusName"] = "失败";
|
|
|
if (Status == 4) dic["StatusName"] = "通过";
|
|
|
if (Status == 5) dic["StatusName"] = "未通过";
|
|
|
+ dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(merchantid_PosMerchantInfo.BrandId.ToString()));
|
|
|
//创客
|
|
|
int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
|
|
|
Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
|
|
|
@@ -386,7 +390,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
- #region 导入数据
|
|
|
+ #region 首台导入数据
|
|
|
/// <summary>
|
|
|
/// 导入数据
|
|
|
/// </summary>
|
|
|
@@ -432,6 +436,52 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
+ #region 非首台导入数据
|
|
|
+ /// <summary>
|
|
|
+ /// 导入数据
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="ExcelData"></param>
|
|
|
+ public string Imports(string ExcelData)
|
|
|
+ {
|
|
|
+ ExcelData = HttpUtility.UrlDecode(ExcelData);
|
|
|
+ JsonData list = JsonMapper.ToObject(ExcelData);
|
|
|
+ string error = "";
|
|
|
+ for (int i = 1; i < list.Count; i++)
|
|
|
+ {
|
|
|
+ JsonData dr = list[i];
|
|
|
+ string SeoDescription = dr[0].ToString(); // 退押订单编号
|
|
|
+ int Status = int.Parse(dr[1].ToString()); // 审核结果
|
|
|
+ var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.SeoDescription == SeoDescription && m.Status == 0) ?? new MerchantDepositReturns();
|
|
|
+ if (true)
|
|
|
+ {
|
|
|
+ merchantDepositReturns.Id = 0;
|
|
|
+ error += "以下操作失败" + SeoDescription + ',' + "该订单未找到或不符合规则" + '\n';
|
|
|
+ }
|
|
|
+ if (Status == 1)
|
|
|
+ {
|
|
|
+ Status = 4;
|
|
|
+ }
|
|
|
+ else if (Status == 2)
|
|
|
+ {
|
|
|
+ Status = 5;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Status = 0;
|
|
|
+ }
|
|
|
+ merchantDepositReturns.Status = Status;
|
|
|
+ merchantDepositReturns.UpdateDate = DateTime.Now;
|
|
|
+ merchantDepositReturns.SeoTitle = SysUserName + "-" + SysRealName;
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(error))
|
|
|
+ {
|
|
|
+ return "Warning|" + error;
|
|
|
+ }
|
|
|
+ db.SaveChanges();
|
|
|
+ return "success";
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
|
|
|
#region 提交代付平台
|
|
|
|
|
|
@@ -463,7 +513,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
- #region 导出Excel
|
|
|
+ #region 首台导出Excel
|
|
|
|
|
|
/// <summary>
|
|
|
/// 导出Excel
|
|
|
@@ -473,9 +523,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
Fields.Add("AlipayAccountNo", "1"); //支付宝账号
|
|
|
- Fields.Add("OrderNo", "1"); //退押订单号
|
|
|
+ Fields.Add("SeoKeyword", "1"); //退押订单号
|
|
|
|
|
|
- string condition = " and Status>-1";
|
|
|
+ string condition = " and Status>-1 and QueryCount=1";
|
|
|
|
|
|
//提现状态
|
|
|
if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
@@ -492,39 +542,41 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
}
|
|
|
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "Id,MerchantId,AlipayAccountNo,ReturnAmount,UserId", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "MerchantId,CreateDate,SeoDescription,AlipayAccountNo", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
//商户
|
|
|
int MerchantId = int.Parse(function.CheckInt(dic["MerchantId"].ToString()));
|
|
|
+ var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.MerchantId == MerchantId) ?? new MerchantDepositReturns();
|
|
|
PosMerchantInfo merchantid_PosMerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == MerchantId) ?? new PosMerchantInfo();
|
|
|
dic["MerchantIdMerRealName"] = merchantid_PosMerchantInfo.MerRealName;
|
|
|
- dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
- dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
+ // dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
+ // dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
dic.Remove("MerchantId");
|
|
|
- // dic["StatusName"] = dic["Status"].ToString() == "1" ? "正常" : "关闭";
|
|
|
- //创客
|
|
|
- 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.Remove("UserId");
|
|
|
-
|
|
|
+ dic["PosSn"] = merchantid_PosMerchantInfo.KqSnNo;
|
|
|
+ dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(merchantid_PosMerchantInfo.BrandId.ToString()));
|
|
|
+ // 实际返还金额
|
|
|
+ decimal amt = decimal.Parse(merchantDepositReturns.ReturnAmount.ToString());
|
|
|
+ dic["ReturnAmount"] = (amt * 0.92M).ToString("f2");
|
|
|
}
|
|
|
|
|
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
- result.Add("Status", "0");
|
|
|
+ // result.Add("Status", "0");
|
|
|
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("MerchantIdMerRealName", "商户真实姓名");
|
|
|
+ // ReturnFields.Add("Id", "记录ID");
|
|
|
+ ReturnFields.Add("CreateDate", "申请提现时间");
|
|
|
+ ReturnFields.Add("MerchantIdMerRealName", "商户真实姓名");
|
|
|
+ ReturnFields.Add("BrandId", "机具品牌");
|
|
|
+ ReturnFields.Add("PosSn", "机具Sn");
|
|
|
// ReturnFields.Add("MerchantIdMerchantMobile", "商户手机号");
|
|
|
// ReturnFields.Add("MerchantIdMerIdcardNo", "商户身份证号");
|
|
|
- ReturnFields.Add("SeoDescription", "退押订单号");
|
|
|
+ // ReturnFields.Add("SeoDescription", "退押订单号");
|
|
|
ReturnFields.Add("AlipayAccountNo", "支付宝账号");
|
|
|
- ReturnFields.Add("ReturnAmount", "返还金额");
|
|
|
+ ReturnFields.Add("ReturnAmount", "实际返还金额");
|
|
|
+ ReturnFields.Add("SeoDescription", "备注");
|
|
|
// ReturnFields.Add("UserIdRealName", "创客真实姓名");
|
|
|
// ReturnFields.Add("UserIdMakerCode", "创客编号");
|
|
|
|
|
|
@@ -535,5 +587,81 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+
|
|
|
+ #region 非首台导出Excel
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 导出Excel
|
|
|
+ /// </summary>
|
|
|
+ /// <returns></returns>
|
|
|
+ public JsonResult ExportExcels(MerchantDepositReturns data, string StatusSelect, string CreateDateData)
|
|
|
+ {
|
|
|
+ Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+ Fields.Add("AlipayAccountNo", "1"); //支付宝账号
|
|
|
+ Fields.Add("SeoKeyword", "1"); //退押订单号
|
|
|
+
|
|
|
+ string condition = " and Status>-1 and QueryCount=0";
|
|
|
+
|
|
|
+ //提现状态
|
|
|
+ if (!string.IsNullOrEmpty(StatusSelect))
|
|
|
+ {
|
|
|
+ condition += " and Status=" + StatusSelect;
|
|
|
+ }
|
|
|
+ //创建时间
|
|
|
+ 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'";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "MerchantId,CreateDate,SeoDescription,AlipayAccountNo", false);
|
|
|
+ List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
+ foreach (Dictionary<string, object> dic in diclist)
|
|
|
+ {
|
|
|
+ //商户
|
|
|
+ int MerchantId = int.Parse(function.CheckInt(dic["MerchantId"].ToString()));
|
|
|
+ var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.MerchantId == MerchantId) ?? new MerchantDepositReturns();
|
|
|
+ PosMerchantInfo merchantid_PosMerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == MerchantId) ?? new PosMerchantInfo();
|
|
|
+ dic["MerchantIdMerRealName"] = merchantid_PosMerchantInfo.MerRealName;
|
|
|
+ // dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
+ // dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
+ dic.Remove("MerchantId");
|
|
|
+ dic["PosSn"] = merchantid_PosMerchantInfo.KqSnNo;
|
|
|
+ dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(merchantid_PosMerchantInfo.BrandId.ToString()));
|
|
|
+ // 实际返还金额
|
|
|
+ decimal amt = decimal.Parse(merchantDepositReturns.ReturnAmount.ToString());
|
|
|
+ dic["ReturnAmount"] = (amt * 0.92M).ToString("f2");
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
+ // result.Add("Status", "0");
|
|
|
+ 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("CreateDate", "申请提现时间");
|
|
|
+ ReturnFields.Add("MerchantIdMerRealName", "商户真实姓名");
|
|
|
+ ReturnFields.Add("BrandId", "机具品牌");
|
|
|
+ ReturnFields.Add("PosSn", "机具Sn");
|
|
|
+ // ReturnFields.Add("MerchantIdMerchantMobile", "商户手机号");
|
|
|
+ // ReturnFields.Add("MerchantIdMerIdcardNo", "商户身份证号");
|
|
|
+ // ReturnFields.Add("SeoDescription", "退押订单号");
|
|
|
+ ReturnFields.Add("AlipayAccountNo", "支付宝账号");
|
|
|
+ ReturnFields.Add("ReturnAmount", "实际返还金额");
|
|
|
+ ReturnFields.Add("SeoDescription", "备注");
|
|
|
+ // ReturnFields.Add("UserIdRealName", "创客真实姓名");
|
|
|
+ // ReturnFields.Add("UserIdMakerCode", "创客编号");
|
|
|
+
|
|
|
+ result.Add("Fields", ReturnFields);
|
|
|
+ AddSysLog("0", "MerchantDepositReturnsn", "ExportExcel");
|
|
|
+ return Json(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
}
|
|
|
}
|