Commit 77581089 by 泽锋 李

新增现金流报表

parent bb62b0fe
......@@ -850,7 +850,7 @@ where t1.create_time>=@btime and t1.create_time<=@etime ";
{
throw new Exception("时间类型必选");
}
var sql = " select t1.*,t2.warehouse_name from dc_report_cash_flow_log as t1 left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code where t1.is_delete=0 ";
var sql = " select t1.*,t2.warehouse_name from dc_report_cash_flow_log as t1 left join dc_base_warehouse as t2 on t1.warehouse_code = t2.warehouse_code where t1.is_delete=0 and `val`!=0 ";
DynamicParameters parameters = new DynamicParameters();
if (search.type == 1)
{
......@@ -865,6 +865,11 @@ where t1.create_time>=@btime and t1.create_time<=@etime ";
parameters.Add("btime",search.btime.Value.ToDayHome());
parameters.Add("etime",search.etime.Value.ToDayEnd());
if (!string.IsNullOrWhiteSpace(search.bailun_sku))
{
sql += " and t1.bailun_sku = @bailun_sku ";
parameters.Add("bailun_sku", search.bailun_sku);
}
if (search.data_type !=null &&search.data_type.Count>=0)
{
sql += " and t1.data_type in @data_type ";
......@@ -875,8 +880,14 @@ where t1.create_time>=@btime and t1.create_time<=@etime ";
public static Page<dc_report_cash_flow_sku_group_dto> SkuView(dc_report_cash_flow_sku_group_search_dto search)
{
var sql = " select * from dc_report_cash_flow_sku_group as t1 where 1=1 ";
if (search.data_type == null || search.data_type <= 0)
{
search.data_type = 1;
}
var sql = " select t1.*,t2.sku_title_cn as 'sku_name',t2.`status` as 'sku_status',t2.buyer_name from dc_report_cash_flow_sku_group as t1 left join dc_base_sku as t2 on t1.bailun_sku=t2.bailun_sku where t1.type=@type ";
DynamicParameters parameters = new DynamicParameters();
parameters.Add("type", search.data_type);
if (!string.IsNullOrWhiteSpace(search.bailun_sku))
{
sql += " and t1.bailun_sku=@bailun_sku ";
......
......@@ -180,6 +180,7 @@ namespace AutoTurnOver.Models
/// 2 = 根据支付时间查询
/// </summary>
public int? type { get; set; }
public string bailun_sku { get; set; }
}
public class dc_report_cash_flow_sku_group
......@@ -199,11 +200,14 @@ namespace AutoTurnOver.Models
}
public class dc_report_cash_flow_sku_group_dto: dc_report_cash_flow_sku_group
{
public string sku_name { get; set; }
public int sku_status { get; set; }
public string buyer_name { get; set; }
}
public class dc_report_cash_flow_sku_group_search_dto: page_search_dto
{
public string bailun_sku { get; set; }
public int? data_type { get; set; }
}
}
......@@ -33,7 +33,7 @@ namespace AutoTurnOver.Controllers
});
}
public FileResult Export(DateTime? btime, DateTime? etime, string data_type = null,int? type = null)
public FileResult Export(DateTime? btime, DateTime? etime,string bailun_sku, string data_type = null,int? type = null)
{
var m = new dc_report_cash_flow_log_export_search_dto
{
......@@ -41,6 +41,7 @@ namespace AutoTurnOver.Controllers
btime = btime,
etime = etime,
type = type,
bailun_sku = bailun_sku
};
var service = new Services.CashFlowServices();
......@@ -66,7 +67,7 @@ namespace AutoTurnOver.Controllers
row["数据类型"] = itemData.data_type_str;
row["发生时间"] = itemData.occur_time;
row["支付时间"] = itemData.pay_time;
row["相关单号"] = itemData.no;
row["相关单号"] = itemData.item_no;
row["备注"] = itemData.remarks;
row["金额"] = itemData.val;
......
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