|
|
@@ -52,12 +52,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 首台商户退押金申请记录列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(MerchantDepositReturns data, string CreateDateData, string UpdateDateData, string MerchantName, string PosSn, string StatusSelect = "0", int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(MerchantDepositReturns data, string CreateDateData, string UpdateDateData, string MerchantName, string PosSn, string PayKindSelect, string BankNameSelect, string StatusSelect = "0", int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
|
Fields.Add("AlipayAccountNo", "1"); //支付宝账号
|
|
|
+ Fields.Add("BankCardNo", "1"); //银行卡号
|
|
|
Fields.Add("SeoKeyword", "1"); //退押订单号
|
|
|
|
|
|
string condition = " and Status>-1 and QueryCount=1";
|
|
|
@@ -67,6 +68,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and Status=" + StatusSelect;
|
|
|
}
|
|
|
+ //退款类型
|
|
|
+ if (!string.IsNullOrEmpty(PayKindSelect))
|
|
|
+ {
|
|
|
+ condition += " and PayKind=" + PayKindSelect;
|
|
|
+ }
|
|
|
+ //开户行
|
|
|
+ if (!string.IsNullOrEmpty(BankNameSelect))
|
|
|
+ {
|
|
|
+ condition += " and BankName='" + BankNameSelect + "'";
|
|
|
+ }
|
|
|
//创建时间
|
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
@@ -133,6 +144,10 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["UserIdMakerCode"] = userid_Users.MakerCode;
|
|
|
dic.Remove("UserId");
|
|
|
|
|
|
+ int PayKind = int.Parse(dic["PayKind"].ToString());
|
|
|
+ if (PayKind == 0) dic["PayKindName"] = "支付宝";
|
|
|
+ if (PayKind == 1) dic["PayKindName"] = "银行卡";
|
|
|
+
|
|
|
//实际返还金额
|
|
|
decimal amt = decimal.Parse(dic["ReturnAmount"].ToString());
|
|
|
dic["ReturnAmounts"] = (amt * 0.92M).ToString("f2");
|
|
|
@@ -178,12 +193,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 非首台商户退押金申请记录列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexsData(MerchantDepositReturns data, string CreateDateData, string UpdateDateData, string MerchantName, string PosSn, string StatusSelect = "0", int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexsData(MerchantDepositReturns data, string CreateDateData, string UpdateDateData, string MerchantName, string PosSn, string PayKindSelect, string BankNameSelect, string StatusSelect = "0", int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
|
Fields.Add("AlipayAccountNo", "1"); //支付宝账号
|
|
|
+ Fields.Add("BankCardNo", "1"); //银行卡号
|
|
|
Fields.Add("SeoKeyword", "1"); //退押订单号
|
|
|
|
|
|
string condition = " and Status>-1 and QueryCount=0";
|
|
|
@@ -193,6 +209,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and Status=" + StatusSelect;
|
|
|
}
|
|
|
+ //退款类型
|
|
|
+ if (!string.IsNullOrEmpty(PayKindSelect))
|
|
|
+ {
|
|
|
+ condition += " and PayKind=" + PayKindSelect;
|
|
|
+ }
|
|
|
+ //开户行
|
|
|
+ if (!string.IsNullOrEmpty(BankNameSelect))
|
|
|
+ {
|
|
|
+ condition += " and BankName='" + BankNameSelect + "'";
|
|
|
+ }
|
|
|
//创建时间
|
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
@@ -581,10 +607,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 导出Excel
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult ExportExcel(MerchantDepositReturns data, string StatusSelect, string CreateDateData)
|
|
|
+ public JsonResult ExportExcel(MerchantDepositReturns data, string CreateDateData, string UpdateDateData, string MerchantName, string PosSn, string PayKindSelect, string BankNameSelect, string StatusSelect)
|
|
|
{
|
|
|
+
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+
|
|
|
Fields.Add("AlipayAccountNo", "1"); //支付宝账号
|
|
|
+ Fields.Add("BankCardNo", "1"); //银行卡号
|
|
|
Fields.Add("SeoKeyword", "1"); //退押订单号
|
|
|
|
|
|
string condition = " and Status>-1 and QueryCount=1";
|
|
|
@@ -594,6 +623,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and Status=" + StatusSelect;
|
|
|
}
|
|
|
+ //退款类型
|
|
|
+ if (!string.IsNullOrEmpty(PayKindSelect))
|
|
|
+ {
|
|
|
+ condition += " and PayKind=" + PayKindSelect;
|
|
|
+ }
|
|
|
+ //开户行
|
|
|
+ if (!string.IsNullOrEmpty(BankNameSelect))
|
|
|
+ {
|
|
|
+ condition += " and BankName=" + BankNameSelect;
|
|
|
+ }
|
|
|
//创建时间
|
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
@@ -602,16 +641,49 @@ 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(UpdateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = UpdateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and UpdateDate>='" + start + " 00:00:00' and UpdateDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(MerchantName))
|
|
|
+ {
|
|
|
+ var Ids = "";
|
|
|
+ var posMerchantInfo = db.PosMerchantInfo.Where(m => m.MerRealName == MerchantName).ToList();
|
|
|
+ foreach (var item in posMerchantInfo)
|
|
|
+ {
|
|
|
+ Ids += item.Id + ",";
|
|
|
+ }
|
|
|
+ Ids = Ids.TrimEnd(',');
|
|
|
+ condition += " and MerchantId in(" + Ids + ")";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(PosSn))
|
|
|
+ {
|
|
|
+ var Ids = "";
|
|
|
+ var posMerchantInfo = db.PosMerchantInfo.Where(m => m.KqSnNo == PosSn).ToList();
|
|
|
+ foreach (var item in posMerchantInfo)
|
|
|
+ {
|
|
|
+ Ids += item.Id + ",";
|
|
|
+ }
|
|
|
+ Ids = Ids.TrimEnd(',');
|
|
|
+ condition += " and MerchantId in(" + Ids + ")";
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "MerchantId,SeoKeyword,CreateDate,SeoDescription,AlipayAccountNo", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "Id,MerchantId,SeoKeyword,CreateDate,SeoDescription,AlipayAccountNo,BankCardNo,BankName", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
+ int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
|
|
|
+ var merchantDepositReturn = db.MerchantDepositReturns.FirstOrDefault(m => m.Id == Id) ?? new MerchantDepositReturns();
|
|
|
//商户
|
|
|
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();
|
|
|
+ // var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.MerchantId == MerchantId) ?? new MerchantDepositReturns();
|
|
|
+ // PosMerchantInfo merchantid_PosMerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == MerchantId) ?? new PosMerchantInfo();
|
|
|
+ PosMerchantInfo merchantid_PosMerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == merchantDepositReturn.MerchantId) ?? new PosMerchantInfo();
|
|
|
dic["MerchantIdMerRealName"] = merchantid_PosMerchantInfo.MerRealName;
|
|
|
// dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
// dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
@@ -619,8 +691,26 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["PosSn"] = merchantid_PosMerchantInfo.KqSnNo;
|
|
|
dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(merchantid_PosMerchantInfo.BrandId.ToString()));
|
|
|
// 实际返还金额
|
|
|
- decimal amt = decimal.Parse(merchantDepositReturns.ReturnAmount.ToString());
|
|
|
+ // decimal amt = decimal.Parse(merchantDepositReturns.ReturnAmount.ToString());
|
|
|
+ decimal amt = decimal.Parse(merchantDepositReturn.ReturnAmount.ToString());
|
|
|
dic["ReturnAmount"] = (amt * 0.92M).ToString("f2");
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(merchantDepositReturn.AlipayAccountNo))
|
|
|
+ {
|
|
|
+ dic["AccountNo"] = merchantDepositReturn.AlipayAccountNo;
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(merchantDepositReturn.BankCardNo))
|
|
|
+ {
|
|
|
+ dic["AccountNo"] = merchantDepositReturn.BankCardNo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ int PayKind = merchantDepositReturn.PayKind;
|
|
|
+ if (PayKind == 0) dic["PayKindName"] = "支付宝";
|
|
|
+ if (PayKind == 1) dic["PayKindName"] = "银行卡";
|
|
|
+ dic.Remove("Id");
|
|
|
+ dic.Remove("AlipayAccountNo");
|
|
|
+ dic.Remove("BankCardNo");
|
|
|
}
|
|
|
|
|
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
@@ -636,7 +726,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
// ReturnFields.Add("MerchantIdMerchantMobile", "商户手机号");
|
|
|
// ReturnFields.Add("MerchantIdMerIdcardNo", "商户身份证号");
|
|
|
ReturnFields.Add("SeoKeyword", "退押订单号");
|
|
|
- ReturnFields.Add("AlipayAccountNo", "支付宝账号");
|
|
|
+ ReturnFields.Add("AccountNo", "收款账号");
|
|
|
+ // ReturnFields.Add("AlipayAccountNo", "支付宝账号");
|
|
|
+ // ReturnFields.Add("BankCardNo", "银行卡号");
|
|
|
+ ReturnFields.Add("BankName", "开户行");
|
|
|
+ ReturnFields.Add("PayKindName", "退款类型");
|
|
|
ReturnFields.Add("ReturnAmount", "实际返还金额");
|
|
|
ReturnFields.Add("SeoDescription", "备注");
|
|
|
// ReturnFields.Add("UserIdRealName", "创客真实姓名");
|
|
|
@@ -656,10 +750,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 导出Excel
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult ExportExcels(MerchantDepositReturns data, string StatusSelect, string CreateDateData)
|
|
|
+ public JsonResult ExportsExcel(MerchantDepositReturns data, string CreateDateData, string UpdateDateData, string MerchantName, string PosSn, string PayKindSelect, string BankNameSelect, string StatusSelect)
|
|
|
{
|
|
|
+
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
+
|
|
|
Fields.Add("AlipayAccountNo", "1"); //支付宝账号
|
|
|
+ Fields.Add("BankCardNo", "1"); //银行卡号
|
|
|
Fields.Add("SeoKeyword", "1"); //退押订单号
|
|
|
|
|
|
string condition = " and Status>-1 and QueryCount=0";
|
|
|
@@ -669,6 +766,16 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
condition += " and Status=" + StatusSelect;
|
|
|
}
|
|
|
+ //退款类型
|
|
|
+ if (!string.IsNullOrEmpty(PayKindSelect))
|
|
|
+ {
|
|
|
+ condition += " and PayKind=" + PayKindSelect;
|
|
|
+ }
|
|
|
+ //开户行
|
|
|
+ if (!string.IsNullOrEmpty(BankNameSelect))
|
|
|
+ {
|
|
|
+ condition += " and BankName=" + BankNameSelect;
|
|
|
+ }
|
|
|
//创建时间
|
|
|
if (!string.IsNullOrEmpty(CreateDateData))
|
|
|
{
|
|
|
@@ -677,16 +784,49 @@ 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(UpdateDateData))
|
|
|
+ {
|
|
|
+ string[] datelist = UpdateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
|
|
|
+ string start = datelist[0];
|
|
|
+ string end = datelist[1];
|
|
|
+ condition += " and UpdateDate>='" + start + " 00:00:00' and UpdateDate<='" + end + " 23:59:59'";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(MerchantName))
|
|
|
+ {
|
|
|
+ var Ids = "";
|
|
|
+ var posMerchantInfo = db.PosMerchantInfo.Where(m => m.MerRealName == MerchantName).ToList();
|
|
|
+ foreach (var item in posMerchantInfo)
|
|
|
+ {
|
|
|
+ Ids += item.Id + ",";
|
|
|
+ }
|
|
|
+ Ids = Ids.TrimEnd(',');
|
|
|
+ condition += " and MerchantId in(" + Ids + ")";
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(PosSn))
|
|
|
+ {
|
|
|
+ var Ids = "";
|
|
|
+ var posMerchantInfo = db.PosMerchantInfo.Where(m => m.KqSnNo == PosSn).ToList();
|
|
|
+ foreach (var item in posMerchantInfo)
|
|
|
+ {
|
|
|
+ Ids += item.Id + ",";
|
|
|
+ }
|
|
|
+ Ids = Ids.TrimEnd(',');
|
|
|
+ condition += " and MerchantId in(" + Ids + ")";
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "MerchantId,CreateDate,SeoKeyword,SeoDescription,AlipayAccountNo", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("MerchantDepositReturns", Fields, "Id desc", "0", 1, 20000, condition, "Id,MerchantId,SeoKeyword,CreateDate,SeoDescription,AlipayAccountNo,BankCardNo,BankName", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
+ int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
|
|
|
+ var merchantDepositReturn = db.MerchantDepositReturns.FirstOrDefault(m => m.Id == Id) ?? new MerchantDepositReturns();
|
|
|
//商户
|
|
|
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();
|
|
|
+ // var merchantDepositReturns = db.MerchantDepositReturns.FirstOrDefault(m => m.MerchantId == MerchantId) ?? new MerchantDepositReturns();
|
|
|
+ // PosMerchantInfo merchantid_PosMerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == MerchantId) ?? new PosMerchantInfo();
|
|
|
+ PosMerchantInfo merchantid_PosMerchantInfo = db.PosMerchantInfo.FirstOrDefault(m => m.Id == merchantDepositReturn.MerchantId) ?? new PosMerchantInfo();
|
|
|
dic["MerchantIdMerRealName"] = merchantid_PosMerchantInfo.MerRealName;
|
|
|
// dic["MerchantIdMerchantMobile"] = merchantid_PosMerchantInfo.MerchantMobile;
|
|
|
// dic["MerchantIdMerIdcardNo"] = merchantid_PosMerchantInfo.MerIdcardNo;
|
|
|
@@ -694,9 +834,26 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["PosSn"] = merchantid_PosMerchantInfo.KqSnNo;
|
|
|
dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(merchantid_PosMerchantInfo.BrandId.ToString()));
|
|
|
// 实际返还金额
|
|
|
- decimal amt = decimal.Parse(merchantDepositReturns.ReturnAmount.ToString());
|
|
|
+ // decimal amt = decimal.Parse(merchantDepositReturns.ReturnAmount.ToString());
|
|
|
+ decimal amt = decimal.Parse(merchantDepositReturn.ReturnAmount.ToString());
|
|
|
dic["ReturnAmount"] = (amt * 0.92M).ToString("f2");
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(merchantDepositReturn.AlipayAccountNo))
|
|
|
+ {
|
|
|
+ dic["AccountNo"] = merchantDepositReturn.AlipayAccountNo;
|
|
|
+ }
|
|
|
+ if (!string.IsNullOrEmpty(merchantDepositReturn.BankCardNo))
|
|
|
+ {
|
|
|
+ dic["AccountNo"] = merchantDepositReturn.BankCardNo;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ int PayKind = merchantDepositReturn.PayKind;
|
|
|
+ if (PayKind == 0) dic["PayKindName"] = "支付宝";
|
|
|
+ if (PayKind == 1) dic["PayKindName"] = "银行卡";
|
|
|
+ dic.Remove("Id");
|
|
|
+ dic.Remove("AlipayAccountNo");
|
|
|
+ dic.Remove("BankCardNo");
|
|
|
}
|
|
|
|
|
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
@@ -712,7 +869,11 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
// ReturnFields.Add("MerchantIdMerchantMobile", "商户手机号");
|
|
|
// ReturnFields.Add("MerchantIdMerIdcardNo", "商户身份证号");
|
|
|
ReturnFields.Add("SeoKeyword", "退押订单号");
|
|
|
- ReturnFields.Add("AlipayAccountNo", "支付宝账号");
|
|
|
+ ReturnFields.Add("AccountNo", "收款账号");
|
|
|
+ // ReturnFields.Add("AlipayAccountNo", "支付宝账号");
|
|
|
+ // ReturnFields.Add("BankCardNo", "银行卡号");
|
|
|
+ ReturnFields.Add("BankName", "开户行");
|
|
|
+ ReturnFields.Add("PayKindName", "退款类型");
|
|
|
ReturnFields.Add("ReturnAmount", "实际返还金额");
|
|
|
ReturnFields.Add("SeoDescription", "备注");
|
|
|
// ReturnFields.Add("UserIdRealName", "创客真实姓名");
|