Commit 88813d78 by guanzhenshan

增加汇总字段,和页面底部汇总显示

parent ebb575d5
......@@ -220,6 +220,85 @@ namespace Bailun.DC.Services.DataWareHouse
}
}
/// <summary>
/// 获取财务会计流水明细汇总
/// </summary>
/// <param name="page"></param>
/// <param name="pagesize"></param>
/// <param name="platform"></param>
/// <param name="website"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="orderno"></param>
/// <param name="total"></param>
/// <returns></returns>
public order_fee_value_amazon ListOrderFeeValueCount(string platform, string website, DateTime? start, DateTime? end, string orderno, string month, int? datatype)
{
var sql = $@"select sum(amountval) as amountval,sum(amountval_rmb) amountval_rmb from order_fee_value_amazon t1
where t1.amountval!=0 ";
var sqlparam = new DynamicParameters();
if (datatype.HasValue)
{
sql += " and t1.datatype=" + datatype.Value;
}
if (!string.IsNullOrEmpty(platform))
{
sql += " and t1.platform=@platform";
sqlparam.Add("platform", platform);
}
if (!string.IsNullOrEmpty(website))
{
sql += " and t1.website=@website";
sqlparam.Add("website", website);
}
//if(!string.IsNullOrEmpty(month))
//{
// sql += " and t1.month=@month";
// sqlparam.Add("month", month);
//}
if (!string.IsNullOrEmpty(orderno))
{
sql += " and t1.orderno=@orderno";
sqlparam.Add("orderno", orderno);
}
if (start.HasValue)
{
sql += $" and t1.datatime>='{start.Value.ToString("yyyy-MM-dd")}'";
}
if (end.HasValue)
{
sql += $" and t1.datatime<'{end.Value.AddDays(1).ToString("yyyy-MM-dd")}'";
}
if (!string.IsNullOrEmpty(month))
{
sql += $" and t1.month=@month";
sqlparam.Add("month", month);
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString_DW))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var obj = cn.QueryFirstOrDefault<order_fee_value_amazon>(sql);
return obj;
}
}
}
}
......@@ -460,6 +460,8 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
var obj = new Services.DataWareHouse.PlatformOrderFeeServices().ListOrderFeeValue(request.pageIndex, request.limit, platform, website, start, end, orderno,month, ref total,datatype);
var objCount = new Services.DataWareHouse.PlatformOrderFeeServices().ListOrderFeeValueCount(platform, website, start, end, orderno, month, datatype);
var list = obj.Select(a => new
{
company = "香港百伦",
......@@ -481,9 +483,31 @@ namespace Bailun.DC.Web.Areas.DataWareHouse.Controllers
a.month,
});
var countRow = new {
company = "香港百伦",
platform = "",
website = "",
orderno = "",
datatime = "",
amountval = objCount.amountval.ToString("N2"),
feetype = "",
subjectcode = "",
projectcode = "",
financecategory = "",
datacenter_col = "",
currency = "合计",
exchange_rate = "",
amountval_rmb = objCount.amountval_rmb.HasValue ? objCount.amountval_rmb.Value.ToString("N2") : "",
month="",
};
return Newtonsoft.Json.JsonConvert.SerializeObject(new {
rows = list,
total = total
total = total,
count_row = countRow
});
}
......
......@@ -148,15 +148,15 @@
{ field: 'subjectcode', title: '会计科目编码', width: '130' },
{ field: 'projectcode', title: '项目编码', width: '120' },
{
field: 'currency', title: '币种', width: '100'
field: 'currency', title: '币种', width: '100',iscount:true
},
{
field: 'amountval', title: '原币金额', width: '120'
field: 'amountval', title: '原币金额', width: '120',iscount:true
},
{
field: 'exchange_rate', title: '汇率', width: '100'
},
{ field: 'amountval_rmb', title: 'RMB金额', width: '120' },
{ field: 'amountval_rmb', title: 'RMB金额', width: '120', iscount: true },
{ field: 'note', title: '备注', width: '160' },
];
......@@ -164,7 +164,7 @@
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
showfooter: false, loadsuccess: function (d) {
showfooter: true, loadsuccess: function (d) {
//替换汇总行的相关列值
var tr = $('.fixed-table-footer').find('tr');
for (var c in columns) {
......
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