Commit c2059d30 by 泽锋 李

修改财务报表的字段名字

parent 8fd33c8c
...@@ -34,10 +34,11 @@ namespace AutoTurnOver.DB ...@@ -34,10 +34,11 @@ namespace AutoTurnOver.DB
}; };
data.val = _connection.QueryFirstOrDefault<decimal?>("select sum(cashier_paymoneyrmb) from dc_base_finance_cashier where type_name = '出口退税收款' and cashier_status = 1 and cashier_time>=@b_this_time and cashier_time<=@e_this_time ", new { data.val = _connection.QueryFirstOrDefault<decimal?>("select sum(cashier_paymoneyrmb) from dc_base_finance_cashier where type_name = '出口退税收款' and cashier_status = 1 and cashier_time>=@b_this_time and cashier_time<=@e_this_time ", new
{
b_this_time = b_this_time, b_this_time = b_this_time,
e_this_time = e_this_time e_this_time = e_this_time
})??0M; }) ?? 0M;
data.id = _connection.QueryFirstOrDefault<int>(" select id from dc_report_finance where data_type=@data_type and item_name=@item_name and date=@date ", new data.id = _connection.QueryFirstOrDefault<int>(" select id from dc_report_finance where data_type=@data_type and item_name=@item_name and date=@date ", new
{ {
...@@ -64,7 +65,7 @@ namespace AutoTurnOver.DB ...@@ -64,7 +65,7 @@ namespace AutoTurnOver.DB
/// <param name="bTime"></param> /// <param name="bTime"></param>
public static void CalculationCashPayment(DateTime bTime) public static void CalculationCashPayment(DateTime bTime)
{ {
var bodys = ApiUtility.GetFinanceBody().Select(s => s.Name).ToList() ; var bodys = ApiUtility.GetFinanceBody().Select(s => s.Name).ToList();
var etime = DateTime.Now; var etime = DateTime.Now;
var thisTime = etime; var thisTime = etime;
while (thisTime >= bTime) while (thisTime >= bTime)
...@@ -148,7 +149,8 @@ and t1.bailun_order_status != 'Canceled' ...@@ -148,7 +149,8 @@ and t1.bailun_order_status != 'Canceled'
and t1.has_scalp = 0 and t1.has_scalp = 0
and t1.has_buyer_remark = 0 and t1.has_buyer_remark = 0
and t1.has_platsku_remark = 0 and t1.has_platsku_remark = 0
GROUP BY t2.product_type,t2.product_type_desc", new { GROUP BY t2.product_type,t2.product_type_desc", new
{
b_this_time = b_this_time, b_this_time = b_this_time,
e_this_time = e_this_time e_this_time = e_this_time
}).ToList(); }).ToList();
...@@ -158,10 +160,10 @@ GROUP BY t2.product_type,t2.product_type_desc", new { ...@@ -158,10 +160,10 @@ GROUP BY t2.product_type,t2.product_type_desc", new {
List<dc_report_finance> datas = new List<dc_report_finance>(); List<dc_report_finance> datas = new List<dc_report_finance>();
foreach (var item in group_datas) foreach (var item in group_datas)
{ {
datas.Add( new dc_report_finance() datas.Add(new dc_report_finance()
{ {
data_type = "销售数量", data_type = "销售数量",
item_name = item.product_type_desc??"未知", item_name = item.product_type_desc ?? "未知",
item_id = item.product_type.ToString(), item_id = item.product_type.ToString(),
date = b_this_time, date = b_this_time,
val = item.bailun_sku_quantity_ordered, val = item.bailun_sku_quantity_ordered,
...@@ -274,7 +276,7 @@ GROUP BY t1.platform_type ", new ...@@ -274,7 +276,7 @@ GROUP BY t1.platform_type ", new
{ {
data_type = "销售收入", data_type = "销售收入",
item_name = item.platform_type ?? "未知", item_name = item.platform_type ?? "未知",
item_id = item.platform_type??"未知", item_id = item.platform_type ?? "未知",
date = b_this_time, date = b_this_time,
val = item.amount_sales, val = item.amount_sales,
update_date = DateTime.Now update_date = DateTime.Now
...@@ -400,13 +402,14 @@ GROUP BY t2.product_type,t2.product_type_desc ", new ...@@ -400,13 +402,14 @@ GROUP BY t2.product_type,t2.product_type_desc ", new
var thisTime = etime; var thisTime = etime;
while (thisTime >= bTime) while (thisTime >= bTime)
{ {
var b_this_time = DateTime.Parse( thisTime.ToString("yyyy-MM-01 00:00:00")); var b_this_time = DateTime.Parse(thisTime.ToString("yyyy-MM-01 00:00:00"));
var e_this_time = thisTime.LastDayOfMonth().ToDayEnd(); var e_this_time = thisTime.LastDayOfMonth().ToDayEnd();
var datas = new List<dc_report_finance>(); var datas = new List<dc_report_finance>();
//当月-上月的金额 //当月-上月的金额
var val = (_connection.QueryFirstOrDefault<decimal?>(@" select short_term_borrow from dc_balance_sheet var val = (_connection.QueryFirstOrDefault<decimal?>(@" select short_term_borrow from dc_balance_sheet
where `statistical_time`=@b_this_time ", new { where `statistical_time`=@b_this_time ", new
{
b_this_time = b_this_time.LastDayOfMonth().ToString("yyyy-MM-dd") b_this_time = b_this_time.LastDayOfMonth().ToString("yyyy-MM-dd")
}) ?? 0M) }) ?? 0M)
- -
...@@ -417,13 +420,13 @@ where `statistical_time`>=@b_this_time ", new ...@@ -417,13 +420,13 @@ where `statistical_time`>=@b_this_time ", new
}) ?? 0M) }) ?? 0M)
; ;
datas.Add( new dc_report_finance() datas.Add(new dc_report_finance()
{ {
data_type = "筹资现金流入", data_type = "现金流入(出)",
item_name = "筹资现金流入", item_name = "筹资现金流入",
item_id = "筹资现金流入", item_id = "筹资现金流入",
date = b_this_time, date = b_this_time,
val = val>0? val:0, val = val > 0 ? val : 0,
update_date = DateTime.Now update_date = DateTime.Now
}); });
datas.Add(new dc_report_finance() datas.Add(new dc_report_finance()
...@@ -432,7 +435,7 @@ where `statistical_time`>=@b_this_time ", new ...@@ -432,7 +435,7 @@ where `statistical_time`>=@b_this_time ", new
item_name = "还款现金流出", item_name = "还款现金流出",
item_id = "还款现金流出", item_id = "还款现金流出",
date = b_this_time, date = b_this_time,
val = val<0? val:0, val = val < 0 ? val : 0,
update_date = DateTime.Now update_date = DateTime.Now
}); });
...@@ -523,7 +526,7 @@ where `statistical_time`>=@b_this_time ", new ...@@ -523,7 +526,7 @@ where `statistical_time`>=@b_this_time ", new
datas.Add(new dc_report_finance() datas.Add(new dc_report_finance()
{ {
data_type = "应收账款余额", data_type = "账款余额",
item_name = "应收账款余额", item_name = "应收账款余额",
item_id = "应收账款余额", item_id = "应收账款余额",
date = b_this_time, date = b_this_time,
...@@ -536,7 +539,7 @@ where `statistical_time`>=@b_this_time ", new ...@@ -536,7 +539,7 @@ where `statistical_time`>=@b_this_time ", new
}); });
datas.Add(new dc_report_finance() datas.Add(new dc_report_finance()
{ {
data_type = "应付账款余额", data_type = "账款余额",
item_name = "应付账款余额", item_name = "应付账款余额",
item_id = "应付账款余额", item_id = "应付账款余额",
date = b_this_time, date = b_this_time,
...@@ -572,5 +575,91 @@ where `statistical_time`>=@b_this_time ", new ...@@ -572,5 +575,91 @@ where `statistical_time`>=@b_this_time ", new
thisTime = thisTime.AddMonths(-1); thisTime = thisTime.AddMonths(-1);
} }
} }
public static List<report_stock_week_view_dto> ReportFinanceView(report_stock_week_view_search_dto search)
{
var btime = DateTime.Parse(DateTime.Now.ToString("yyyy-01-01"));
var etime = DateTime.Parse(DateTime.Now.ToString("yyyy-12-31"));
if (search.btime != null)
{
btime = search.btime.Value;
}
if (search.etime != null)
{
etime = search.etime.Value;
}
btime = DateTime.Parse(btime.ToString("yyyy-MM-01")).ToDayHome();
etime = DateTime.Parse(etime.ToString("yyyy-12-31")).ToDayEnd();
var datas = _connection.Query<dc_report_finance>(" select * from dc_report_finance where `date`>=@btime and `date` <=@etime ", new { btime, etime });
List<report_stock_week_view_dto> r_datas = new List<report_stock_week_view_dto>();
var datas_web_site_group = datas.GroupBy(s => s.data_type).ToList();
foreach (var websiteGroupItem in datas_web_site_group)
{
foreach (var itemData in websiteGroupItem.GroupBy(v => new { v.item_id, v.item_name }))
{
var itemWeekData = new report_stock_week_view_dto
{
web_site = websiteGroupItem.Key,
tag = itemData.Key.item_name,
weeks = new List<report_stock_week_view_dto.week> { }
};
var this_date = btime;
while (this_date <= etime)
{
var b_thie_date = DateTime.Parse(this_date.ToString("yyyy-MM-01")).ToDayHome();
var e_thie_date = b_thie_date.LastDayOfMonth().ToDayEnd();
var this_datas = itemData.Where(s => s.date >= b_thie_date && s.date <= e_thie_date).ToList();
itemWeekData.weeks.Add(new report_stock_week_view_dto.week
{
val = this_datas.Sum(s => s.val),
ratio = 0,
tag = this_date.ToString("yyyy-MM")
});
this_date = this_date.AddMonths(1);
}
r_datas.Add(itemWeekData);
}
}
return r_datas;
}
public static List<string> GetMonthList(report_stock_week_view_search_dto search)
{
List<string> months = new List<string>();
var btime = DateTime.Parse(DateTime.Now.ToString("yyyy-01-01"));
var etime = DateTime.Parse(DateTime.Now.ToString("yyyy-12-31"));
if (search.btime != null)
{
btime = search.btime.Value;
}
if (search.etime != null)
{
etime = search.etime.Value;
}
btime = DateTime.Parse(btime.ToString("yyyy-MM-01")).ToDayHome();
etime = DateTime.Parse(etime.ToString("yyyy-12-31")).ToDayEnd();
var this_date = btime;
while (this_date <= etime)
{
months.Add($" {this_date.ToString("yyyy-MM")}");
this_date = this_date.AddMonths(1);
}
return months;
}
} }
} }
...@@ -3606,6 +3606,7 @@ where t1.bailun_sku = t2.bailun_sku and t1.bailun_sku = t3.bailun_sku and t1.wee ...@@ -3606,6 +3606,7 @@ where t1.bailun_sku = t2.bailun_sku and t1.bailun_sku = t3.bailun_sku and t1.wee
return r_datas; return r_datas;
} }
public static List<string> ReportStockWeekViewGetWeekList(report_stock_week_view_search_dto search) public static List<string> ReportStockWeekViewGetWeekList(report_stock_week_view_search_dto search)
{ {
var weeks = new List<string>(); var weeks = new List<string>();
...@@ -3631,6 +3632,8 @@ where t1.bailun_sku = t2.bailun_sku and t1.bailun_sku = t3.bailun_sku and t1.wee ...@@ -3631,6 +3632,8 @@ where t1.bailun_sku = t2.bailun_sku and t1.bailun_sku = t3.bailun_sku and t1.wee
return weeks; return weeks;
} }
/// <summary> /// <summary>
/// 库存-采购每周备份 /// 库存-采购每周备份
/// </summary> /// </summary>
......
...@@ -40,10 +40,11 @@ namespace AutoTurnOver.Models ...@@ -40,10 +40,11 @@ namespace AutoTurnOver.Models
public List<tree_menu_dto> tree_menu_list() public List<tree_menu_dto> tree_menu_list()
{ {
if (menuInfoDtos == null) return new List<tree_menu_dto>(); List<tree_menu_dto> ms = new List<tree_menu_dto>();
if (menuInfoDtos == null) return ms;
else else
{ {
return menuInfoDtos.Where(s => s.isshow == true && s.menuFatherCode == "None").Select(s => new tree_menu_dto ms= menuInfoDtos.Where(s => s.isshow == true && s.menuFatherCode == "None").Select(s => new tree_menu_dto
{ {
url = s.html_url, url = s.html_url,
name = s.menuName, name = s.menuName,
...@@ -54,6 +55,16 @@ namespace AutoTurnOver.Models ...@@ -54,6 +55,16 @@ namespace AutoTurnOver.Models
}).ToList() }).ToList()
}).ToList(); }).ToList();
} }
ms.Add(new tree_menu_dto {
name="test",
url = "/view/reports/finance.html",
child = new List<tree_menu_dto> {
new tree_menu_dto {
name="test",
url = "/view/reports/finance.html"
}}
});
return ms;
} }
public class tree_menu_dto public class tree_menu_dto
......
...@@ -923,9 +923,35 @@ namespace AutoTurnOver.Services ...@@ -923,9 +923,35 @@ namespace AutoTurnOver.Services
} }
public List<dynamic> ReportFinanceView(report_stock_week_view_search_dto search_data)
{
var order_list = dc_report_finance_dao.ReportFinanceView(search_data);
List<dynamic> datas = new List<dynamic>();
foreach (var item in order_list)
{
dynamic o = new ExpandoObject();
o.web_site = item.web_site;
o.tag = item.tag;
foreach (var dat_item in item.weeks)
{
var dic = (IDictionary<string, object>)o;
dic["val_" + (dat_item.tag)] = Math.Round(dat_item.val, 2);
}
datas.Add(o);
}
return datas;
}
public List<string> ReportStockWeekViewGetWeekList(report_stock_week_view_search_dto search) public List<string> ReportStockWeekViewGetWeekList(report_stock_week_view_search_dto search)
{ {
return report.ReportStockWeekViewGetWeekList(search); return report.ReportStockWeekViewGetWeekList(search);
} }
public List<string> GetMonthList(report_stock_week_view_search_dto search)
{
return dc_report_finance_dao.GetMonthList(search);
}
} }
} }
...@@ -743,6 +743,23 @@ namespace AutoTurnOver.Controllers ...@@ -743,6 +743,23 @@ namespace AutoTurnOver.Controllers
}); });
} }
[BrowseLog("Bailun_aims", "访问【百伦自动周转系统】->【报表】->【财务报表】->【搜索】页面", 0)]
public JsonResult ReportFinanceView(DateTime? btime, DateTime? etime)
{
report_stock_week_view_search_dto search_data = new report_stock_week_view_search_dto
{
etime = etime,
btime = btime
};
var list = new ReportServices().ReportFinanceView(search_data);
return new JsonResult(new
{
rows = list,
total = 0,
});
}
[BrowseLog("Bailun_aims", "访问【百伦自动周转系统】->【报表】->【第三方海外仓采购汇总】->【导出】", 0)] [BrowseLog("Bailun_aims", "访问【百伦自动周转系统】->【报表】->【第三方海外仓采购汇总】->【导出】", 0)]
public FileResult ExportTableReportPurchaseWeekView(DateTime? btime, DateTime? etime) public FileResult ExportTableReportPurchaseWeekView(DateTime? btime, DateTime? etime)
{ {
...@@ -796,6 +813,17 @@ namespace AutoTurnOver.Controllers ...@@ -796,6 +813,17 @@ namespace AutoTurnOver.Controllers
return File(memory, "text/csv", "第三方海外仓采购统计表.csv"); return File(memory, "text/csv", "第三方海外仓采购统计表.csv");
} }
public JsonResult GetMonthList(DateTime? btime, DateTime? etime)
{
report_stock_week_view_search_dto search_data = new report_stock_week_view_search_dto
{
etime = etime,
btime = btime
};
var list = new ReportServices().GetMonthList(search_data);
return new JsonResult(list);
}
public JsonResult ReportStockWeekViewGetWeekList(DateTime? btime, DateTime? etime) public JsonResult ReportStockWeekViewGetWeekList(DateTime? btime, DateTime? etime)
{ {
report_stock_week_view_search_dto search_data = new report_stock_week_view_search_dto report_stock_week_view_search_dto search_data = new report_stock_week_view_search_dto
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment