|
|
@@ -35,7 +35,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 根据条件查询创客交易日汇总列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public IActionResult Index(UserTradeDaySummary data, string right)
|
|
|
+ public IActionResult Index(TradeDaySummary data, string right)
|
|
|
{
|
|
|
ViewBag.RightInfo = RightInfo;
|
|
|
ViewBag.right = right;
|
|
|
@@ -52,7 +52,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 创客交易日汇总列表
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult IndexData(UserTradeDaySummary data, string MakerCode, string RealName, string TradeMonthSelect, string TradeDateSelect,string BrandId, int page = 1, int limit = 30)
|
|
|
+ public JsonResult IndexData(TradeDaySummary data, string MakerCode, string RealName, string TradeMonthSelect, string TradeDateSelect,string BrandId, int page = 1, int limit = 30)
|
|
|
{
|
|
|
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
@@ -89,7 +89,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
condition += " and TradeDate>='" + start + "' and TradeDate<='" + end + "' ";
|
|
|
}
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("UserTradeDaySummary", Fields, "Id desc", "0", page, limit, condition);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("TradeDaySummary", 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)
|
|
|
{
|
|
|
@@ -100,17 +100,39 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
|
|
|
}
|
|
|
Dictionary<string, object> other = new Dictionary<string, object>();
|
|
|
- string DirectTradeAmt = "0.00", DirectDebitTradeAmt = "0.00", DirectDebitCapNum = "0.00";//直营商户交易总额 直营商户借记卡交易总额 直营激活商户数
|
|
|
- DataTable dt = OtherMySqlConn.dtable("select sum(DirectTradeAmt),sum(DirectDebitTradeAmt),sum(DirectDebitCapNum) from UserTradeDaySummary where 1=1 " + condition);
|
|
|
+ string HelpDirectTradeAmt = "0.00"; //扶持期直营贷记卡交易
|
|
|
+ string NotHelpDirectTradeAmt = "0.00"; //稳定期直营贷记卡交易
|
|
|
+ string HelpDirectDebitTradeAmt = "0.00"; //扶持期直营借记卡交易
|
|
|
+ string NotHelpDirectDebitTradeAmt = "0.00"; //稳定期直营借记卡交易
|
|
|
+ string HelpNonDirectTradeAmt = "0.00"; //扶持期非直营贷记卡交易
|
|
|
+ string NotHelpNonDirectTradeAmt = "0.00"; //稳定期非直营贷记卡交易
|
|
|
+ string HelpNonDirectDebitTradeAmt = "0.00"; //扶持期非直营借记卡交易
|
|
|
+ string NotHelpNonDirectDebitTradeAmt = "0.00"; //稳定期非直营借记卡交易
|
|
|
+
|
|
|
+ DataTable dt = OtherMySqlConn.dtable("select sum(HelpDirectTradeAmt),sum(NotHelpDirectTradeAmt),sum(HelpDirectDebitTradeAmt),sum(NotHelpDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='self' " + condition);
|
|
|
if(dt.Rows.Count > 0)
|
|
|
{
|
|
|
- DirectTradeAmt = dt.Rows[0][0].ToString();
|
|
|
- DirectDebitTradeAmt = dt.Rows[0][1].ToString();
|
|
|
- DirectDebitCapNum = dt.Rows[0][2].ToString();
|
|
|
+ HelpDirectTradeAmt = dt.Rows[0][0].ToString();
|
|
|
+ NotHelpDirectTradeAmt = dt.Rows[0][1].ToString();
|
|
|
+ HelpDirectDebitTradeAmt = dt.Rows[0][2].ToString();
|
|
|
+ NotHelpDirectDebitTradeAmt = dt.Rows[0][3].ToString();
|
|
|
}
|
|
|
- other.Add("DirectTradeAmt", DirectTradeAmt);
|
|
|
- other.Add("DirectDebitTradeAmt", DirectDebitTradeAmt);
|
|
|
- other.Add("DirectDebitCapNum", DirectDebitCapNum);
|
|
|
+ dt = OtherMySqlConn.dtable("select sum(HelpNonDirectTradeAmt),sum(NotHelpNonDirectTradeAmt),sum(HelpNonDirectDebitTradeAmt),sum(NotHelpNonDirectDebitTradeAmt) from TradeDaySummary where SeoTitle='team' " + condition);
|
|
|
+ if(dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ HelpNonDirectTradeAmt = dt.Rows[0][0].ToString();
|
|
|
+ NotHelpNonDirectTradeAmt = dt.Rows[0][1].ToString();
|
|
|
+ HelpNonDirectDebitTradeAmt = dt.Rows[0][2].ToString();
|
|
|
+ NotHelpNonDirectDebitTradeAmt = dt.Rows[0][3].ToString();
|
|
|
+ }
|
|
|
+ other.Add("HelpDirectTradeAmt", HelpDirectTradeAmt);
|
|
|
+ other.Add("NotHelpDirectTradeAmt", NotHelpDirectTradeAmt);
|
|
|
+ other.Add("HelpDirectDebitTradeAmt", HelpDirectDebitTradeAmt);
|
|
|
+ other.Add("NotHelpDirectDebitTradeAmt", NotHelpDirectDebitTradeAmt);
|
|
|
+ other.Add("HelpNonDirectTradeAmt", HelpNonDirectTradeAmt);
|
|
|
+ other.Add("NotHelpNonDirectTradeAmt", NotHelpNonDirectTradeAmt);
|
|
|
+ other.Add("HelpNonDirectDebitTradeAmt", HelpNonDirectDebitTradeAmt);
|
|
|
+ other.Add("NotHelpNonDirectDebitTradeAmt", NotHelpNonDirectDebitTradeAmt);
|
|
|
obj.Add("other", other);
|
|
|
return Json(obj);
|
|
|
}
|
|
|
@@ -141,7 +163,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public string Add(UserTradeDaySummary data)
|
|
|
+ public string Add(TradeDaySummary data)
|
|
|
{
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
|
|
|
@@ -149,8 +171,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("UserTradeDaySummary", Fields, 0);
|
|
|
- AddSysLog(data.Id.ToString(), "UserTradeDaySummary", "add");
|
|
|
+ int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("TradeDaySummary", Fields, 0);
|
|
|
+ AddSysLog(data.Id.ToString(), "TradeDaySummary", "add");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
return "success";
|
|
|
@@ -170,7 +192,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
ViewBag.right = right;
|
|
|
|
|
|
|
|
|
- UserTradeDaySummary editData = db.UserTradeDaySummary.FirstOrDefault(m => m.Id == Id) ?? new UserTradeDaySummary();
|
|
|
+ TradeDaySummary editData = db.TradeDaySummary.FirstOrDefault(m => m.Id == Id) ?? new TradeDaySummary();
|
|
|
ViewBag.data = editData;
|
|
|
return View();
|
|
|
}
|
|
|
@@ -184,7 +206,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public string Edit(UserTradeDaySummary data)
|
|
|
+ public string Edit(TradeDaySummary data)
|
|
|
{
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
|
|
|
@@ -192,8 +214,8 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
Fields.Add("SeoTitle", data.SeoTitle);
|
|
|
Fields.Add("SeoKeyword", data.SeoKeyword);
|
|
|
Fields.Add("SeoDescription", data.SeoDescription);
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("UserTradeDaySummary", Fields, data.Id);
|
|
|
- AddSysLog(data.Id.ToString(), "UserTradeDaySummary", "update");
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("TradeDaySummary", Fields, data.Id);
|
|
|
+ AddSysLog(data.Id.ToString(), "TradeDaySummary", "update");
|
|
|
db.SaveChanges();
|
|
|
|
|
|
return "success";
|
|
|
@@ -210,13 +232,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
public string Delete(string Id)
|
|
|
{
|
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
|
- AddSysLog(Id, "UserTradeDaySummary", "del");
|
|
|
+ AddSysLog(Id, "TradeDaySummary", "del");
|
|
|
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("UserTradeDaySummary", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("TradeDaySummary", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
|
|
|
@@ -234,13 +256,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
public string Open(string Id)
|
|
|
{
|
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
|
- AddSysLog(Id, "UserTradeDaySummary", "open");
|
|
|
+ AddSysLog(Id, "TradeDaySummary", "open");
|
|
|
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("UserTradeDaySummary", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("TradeDaySummary", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -257,13 +279,13 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
public string Close(string Id)
|
|
|
{
|
|
|
string[] idlist = Id.Split(new char[] { ',' });
|
|
|
- AddSysLog(Id, "UserTradeDaySummary", "close");
|
|
|
+ AddSysLog(Id, "TradeDaySummary", "close");
|
|
|
foreach (string subid in idlist)
|
|
|
{
|
|
|
int id = int.Parse(subid);
|
|
|
Dictionary<string, object> Fields = new Dictionary<string, object>();
|
|
|
Fields.Add("Status", 0);
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("UserTradeDaySummary", Fields, id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("TradeDaySummary", Fields, id);
|
|
|
}
|
|
|
db.SaveChanges();
|
|
|
return "success";
|
|
|
@@ -278,9 +300,9 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// <param name="Id"></param>
|
|
|
public string Sort(int Id, int Sort)
|
|
|
{
|
|
|
- new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("UserTradeDaySummary", Sort, Id);
|
|
|
+ new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("TradeDaySummary", Sort, Id);
|
|
|
|
|
|
- AddSysLog(Id.ToString(), "UserTradeDaySummary", "sort");
|
|
|
+ AddSysLog(Id.ToString(), "TradeDaySummary", "sort");
|
|
|
return "success";
|
|
|
}
|
|
|
#endregion
|
|
|
@@ -298,7 +320,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
{
|
|
|
JsonData dr = list[i];
|
|
|
|
|
|
- db.UserTradeDaySummary.Add(new UserTradeDaySummary()
|
|
|
+ db.TradeDaySummary.Add(new TradeDaySummary()
|
|
|
{
|
|
|
CreateDate = DateTime.Now,
|
|
|
UpdateDate = DateTime.Now,
|
|
|
@@ -306,7 +328,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
});
|
|
|
db.SaveChanges();
|
|
|
}
|
|
|
- AddSysLog("0", "UserTradeDaySummary", "Import");
|
|
|
+ AddSysLog("0", "TradeDaySummary", "Import");
|
|
|
return "success";
|
|
|
}
|
|
|
#endregion
|
|
|
@@ -317,7 +339,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
/// 导出Excel
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
- public JsonResult ExportExcel(UserTradeDaySummary data, string MakerCode, string RealName, string TradeMonthSelect)
|
|
|
+ public JsonResult ExportExcel(TradeDaySummary data, string MakerCode, string RealName, string TradeMonthSelect)
|
|
|
{
|
|
|
Dictionary<string, string> Fields = new Dictionary<string, string>();
|
|
|
|
|
|
@@ -341,7 +363,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
condition += " and TradeMonth=" + TradeMonthSelect.Replace("-", "");
|
|
|
}
|
|
|
|
|
|
- Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("UserTradeDaySummary", Fields, "Id desc", "0", 1, 20000, condition, "UserId,TradeDate,TradeMonth,BrandId,DirectTradeAmt,NonDirectTradeAmt,DirectDebitTradeAmt,DirectDebitCapNum,NonDirectDebitTradeAmt,NonDirectDebitCapNum,Remark", false);
|
|
|
+ Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("TradeDaySummary", Fields, "Id desc", "0", 1, 20000, condition, "UserId,TradeDate,TradeMonth,BrandId,HelpDirectTradeAmt,NotHelpDirectTradeAmt,HelpDirectDebitTradeAmt,NotHelpDirectDebitTradeAmt,HelpNonDirectTradeAmt,NotHelpNonDirectTradeAmt,HelpNonDirectDebitTradeAmt,NotHelpNonDirectDebitTradeAmt,Remark,SeoTitle", false);
|
|
|
List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
|
|
|
foreach (Dictionary<string, object> dic in diclist)
|
|
|
{
|
|
|
@@ -351,6 +373,7 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
dic["RealName"] = user.RealName;
|
|
|
dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
|
|
|
dic.Remove("UserId");
|
|
|
+ dic["SeoTitle"] = dic["SeoTitle"].ToString() == "self" ? "直营" : "非直营";
|
|
|
}
|
|
|
|
|
|
Dictionary<string, object> result = new Dictionary<string, object>();
|
|
|
@@ -363,16 +386,19 @@ namespace MySystem.Areas.Admin.Controllers
|
|
|
ReturnFields.Add("TradeDate", "交易日");
|
|
|
ReturnFields.Add("TradeMonth", "交易月");
|
|
|
ReturnFields.Add("BrandId", "品牌");
|
|
|
- ReturnFields.Add("DirectTradeAmt", "直营商户交易总额(万元)");
|
|
|
- ReturnFields.Add("NonDirectTradeAmt", "非直营商户交易总额(万元)");
|
|
|
- ReturnFields.Add("DirectDebitTradeAmt", "直营商户借记卡交易总额(万元)");
|
|
|
- ReturnFields.Add("DirectDebitCapNum", "直营激活商户数(万元)");
|
|
|
- ReturnFields.Add("NonDirectDebitTradeAmt", "非直营商户借记卡交易总额(万元)");
|
|
|
- ReturnFields.Add("NonDirectDebitCapNum", "非直营激活商户数");
|
|
|
+ ReturnFields.Add("SeoTitle", "交易类型");
|
|
|
+ ReturnFields.Add("HelpDirectTradeAmt", "扶持期直营贷记卡交易");
|
|
|
+ ReturnFields.Add("NotHelpDirectTradeAmt", "稳定期直营贷记卡交易");
|
|
|
+ ReturnFields.Add("HelpDirectDebitTradeAmt", "扶持期直营借记卡交易");
|
|
|
+ ReturnFields.Add("NotHelpDirectDebitTradeAmt", "稳定期直营借记卡交易");
|
|
|
+ ReturnFields.Add("HelpNonDirectTradeAmt", "扶持期非直营贷记卡交易");
|
|
|
+ ReturnFields.Add("NotHelpNonDirectTradeAmt", "稳定期非直营贷记卡交易");
|
|
|
+ ReturnFields.Add("HelpNonDirectDebitTradeAmt", "扶持期非直营借记卡交易");
|
|
|
+ ReturnFields.Add("NotHelpNonDirectDebitTradeAmt", "稳定期非直营借记卡交易");
|
|
|
ReturnFields.Add("Remark", "备注");
|
|
|
|
|
|
result.Add("Fields", ReturnFields);
|
|
|
- AddSysLog("0", "UserTradeDaySummary", "ExportExcel");
|
|
|
+ AddSysLog("0", "TradeDaySummary", "ExportExcel");
|
|
|
return Json(result);
|
|
|
}
|
|
|
|