Commit ad7167ca by guanzhenshan
parents 314c8ff5 16429c17
...@@ -22,7 +22,7 @@ namespace Bailun.DC.HappenAmount ...@@ -22,7 +22,7 @@ namespace Bailun.DC.HappenAmount
//static void Main(string[] args) //static void Main(string[] args)
//{ //{
// var start = DateTime.Parse("2019-12-01"); // //var start = DateTime.Parse("2019-12-17");
// //while (start.AddDays(3) < DateTime.Now) // //while (start.AddDays(3) < DateTime.Now)
// //{ // //{
// // new Services().Init(start, start.AddDays(1)); // // new Services().Init(start, start.AddDays(1));
...@@ -30,7 +30,7 @@ namespace Bailun.DC.HappenAmount ...@@ -30,7 +30,7 @@ namespace Bailun.DC.HappenAmount
// // start = start.AddDays(1); // // start = start.AddDays(1);
// //} // //}
// new Bailun.DC.Services.FinanceReportServices().UpdateLogisticsWaitPay(start,0,"admin",null); // //new Bailun.DC.Services.FinanceReportServices().UpdateLogisticsWaitPay(start, 0, "admin", null);
//} //}
} }
......
...@@ -27,6 +27,7 @@ namespace Bailun.DC.HappenAmount ...@@ -27,6 +27,7 @@ namespace Bailun.DC.HappenAmount
{ {
try try
{ {
hl_amount_pay = 0;
var now = DateTime.Now; var now = DateTime.Now;
if (now.Hour == 23 && now.Minute == 59) //每天 23:59分启动 if (now.Hour == 23 && now.Minute == 59) //每天 23:59分启动
...@@ -35,17 +36,7 @@ namespace Bailun.DC.HappenAmount ...@@ -35,17 +36,7 @@ namespace Bailun.DC.HappenAmount
Console.WriteLine("开始启动 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Console.WriteLine("开始启动 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
Init(DateTime.Parse(now.ToShortDateString()), DateTime.Parse(now.AddDays(1).ToShortDateString())); Init(DateTime.Parse(now.ToShortDateString()), DateTime.Parse(now.AddDays(1).ToShortDateString()));
var result = new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(day, hl_amount_pay);
if (string.IsNullOrEmpty(result))
{
Console.WriteLine("生成物流供应商应付款余额记录成功 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
else
{
Console.WriteLine("生成物流供应商应付款余额记录失败: "+result+ " " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
Console.WriteLine("任务运行完成 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); Console.WriteLine("任务运行完成 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
} }
else if ((now.Hour== 12) && now.Minute == 1) else if ((now.Hour== 12) && now.Minute == 1)
...@@ -55,7 +46,7 @@ namespace Bailun.DC.HappenAmount ...@@ -55,7 +46,7 @@ namespace Bailun.DC.HappenAmount
while (start.AddDays(1) < DateTime.Now) while (start.AddDays(1) < DateTime.Now)
{ {
new Services().Init(start, start.AddDays(1)); new Services().Init(start, start.AddDays(1));
new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(start, hl_amount_pay); //new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(start, hl_amount_pay);
start = start.AddDays(1); start = start.AddDays(1);
} }
} }
...@@ -252,6 +243,17 @@ namespace Bailun.DC.HappenAmount ...@@ -252,6 +243,17 @@ namespace Bailun.DC.HappenAmount
else else
{ {
Console.WriteLine(m.day + " 保存成功!"); Console.WriteLine(m.day + " 保存成功!");
var lg_result = new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(m.day, m.hl_amount_pay);
if (string.IsNullOrEmpty(lg_result))
{
Console.WriteLine("生成物流供应商应付款余额记录成功 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
else
{
Console.WriteLine("生成物流供应商应付款余额记录失败: " + result + " " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
}
} }
} }
......
...@@ -279,14 +279,14 @@ namespace Bailun.DC.MonthSalePutin ...@@ -279,14 +279,14 @@ namespace Bailun.DC.MonthSalePutin
) tb ) tb
where tb.count_usable_stock/((tb.avg_sevenday_sales+tb.avg_fourteenday_sales+tb.avg_thirtyday_sales)/3)>14 or tb.avg_thirtyday_sales=0"; where tb.count_usable_stock/((tb.avg_sevenday_sales+tb.avg_fourteenday_sales+tb.avg_thirtyday_sales)/3)>14 or tb.avg_thirtyday_sales=0";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString + "Allow User Variables=True;"))
{ {
if (cn.State == System.Data.ConnectionState.Closed) if (cn.State == System.Data.ConnectionState.Closed)
{ {
cn.Open(); cn.Open();
} }
var list = cn.Query<dc_mid_month_sale_putin_report>(sql, null, null, true, 3 * 60).AsList(); var list = cn.Query<dc_mid_month_sale_putin_report>(sql, null, null, true, 10 * 60).AsList();
cn.Execute($@"delete t1 from dc_mid_month_sale_putin_report t1 cn.Execute($@"delete t1 from dc_mid_month_sale_putin_report t1
join dc_mid_month_sale_putin t2 on t1.sale_putin_id=t2.id and t2.warehouse_type='国内仓' and t2.`month`='{month}'"); join dc_mid_month_sale_putin t2 on t1.sale_putin_id=t2.id and t2.warehouse_type='国内仓' and t2.`month`='{month}'");
...@@ -332,16 +332,20 @@ namespace Bailun.DC.MonthSalePutin ...@@ -332,16 +332,20 @@ namespace Bailun.DC.MonthSalePutin
sql = $@"select t1.id from dc_mid_month_sale_putin_report t1 sql = $@"select t1.id from dc_mid_month_sale_putin_report t1
join dc_mid_month_sale_putin t2 on t1.sale_putin_id = t2.id join dc_mid_month_sale_putin t2 on t1.sale_putin_id = t2.id
join dc_base_sku t3 on t2.bailun_sku=t3.bailun_sku and t3.status=1 join dc_base_sku t3 on t2.bailun_sku=t3.bailun_sku and t3.status=1
where t2.`month`='{month}' and t3.create_time is null"; where t2.`month`='{month}' -- and t3.create_time is null";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString + "Allow User Variables=True;"))
{ {
if (cn.State == System.Data.ConnectionState.Closed) if (cn.State == System.Data.ConnectionState.Closed)
{ {
cn.Open(); cn.Open();
} }
var list = cn.Query<int>(sql, null, null, true, 2 * 60).AsList(); var list = cn.Query<int>(sql, null, null, true, 10 * 60).AsList();
cn.Execute("update dc_mid_month_sale_putin_report set is_clear=1 where id in (" + string.Join(",", list) + ")"); if (list.Count > 0)
{
cn.Execute("update dc_mid_month_sale_putin_report set is_clear=1 where id in (" + string.Join(",", list) + ")");
}
} }
...@@ -351,14 +355,14 @@ namespace Bailun.DC.MonthSalePutin ...@@ -351,14 +355,14 @@ namespace Bailun.DC.MonthSalePutin
left join dc_base_sku t3 on t2.bailun_sku=t3.bailun_sku and t3.create_time>'{DateTime.Now.AddMonths(-2).ToString("yyyy-MM-dd HH:mm:ss")}' left join dc_base_sku t3 on t2.bailun_sku=t3.bailun_sku and t3.create_time>'{DateTime.Now.AddMonths(-2).ToString("yyyy-MM-dd HH:mm:ss")}'
where t2.month='{month}' and t3.create_time is not null"; where t2.month='{month}' and t3.create_time is not null";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString + "Allow User Variables=True;"))
{ {
if (cn.State == System.Data.ConnectionState.Closed) if (cn.State == System.Data.ConnectionState.Closed)
{ {
cn.Open(); cn.Open();
} }
var list = cn.Query<int>(sql, null, null, true, 2 * 60).AsList(); var list = cn.Query<int>(sql, null, null, true, 10 * 60).AsList();
cn.Execute("update dc_mid_month_sale_putin_report set is_new=1 where id in (" + string.Join(",", list) + ")"); cn.Execute("update dc_mid_month_sale_putin_report set is_new=1 where id in (" + string.Join(",", list) + ")");
} }
......
...@@ -396,7 +396,8 @@ namespace Bailun.DC.Services ...@@ -396,7 +396,8 @@ namespace Bailun.DC.Services
cn.Insert<dc_daily_lg_waitpay>(obj); cn.Insert<dc_daily_lg_waitpay>(obj);
} }
UpdateLogisticsEndAmount(date, obj.amount_end); UpdateLogisticsWaitPay(date, 0, "admin", cn);
//UpdateLogisticsEndAmount(date, obj.amount_end);
} }
......
...@@ -262,7 +262,7 @@ namespace Bailun.DC.Services ...@@ -262,7 +262,7 @@ namespace Bailun.DC.Services
} }
if (!string.IsNullOrWhiteSpace(warehousetype)) if (!string.IsNullOrWhiteSpace(warehousetype))
{ {
sql += " and t1.hq_type=@hq_type"; sql += " and t1.warehousetype=@hq_type";
sqlparams.Add("hq_type", warehousetype); sqlparams.Add("hq_type", warehousetype);
} }
if (!string.IsNullOrWhiteSpace(warehousecode)) if (!string.IsNullOrWhiteSpace(warehousecode))
...@@ -394,7 +394,7 @@ namespace Bailun.DC.Services ...@@ -394,7 +394,7 @@ namespace Bailun.DC.Services
if (!string.IsNullOrWhiteSpace(warehousetype)) if (!string.IsNullOrWhiteSpace(warehousetype))
{ {
sql += " and t1.hq_type=@hq_type"; sql += " and t1.warehousetype=@hq_type";
sqlparams.Add("hq_type", warehousetype); sqlparams.Add("hq_type", warehousetype);
} }
if (!string.IsNullOrWhiteSpace(warehousecode)) if (!string.IsNullOrWhiteSpace(warehousecode))
......
...@@ -69,6 +69,10 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -69,6 +69,10 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
date = DateTime.Parse(date.ToString("yyyy-MM") + "-01").AddDays(-1); date = DateTime.Parse(date.ToString("yyyy-MM") + "-01").AddDays(-1);
} }
} }
else if (type == 1)
{
date = day.Value;
}
var list = new Services.FinanceReportServices().GetBalanceSheet(type, date, paycompanyvalue); var list = new Services.FinanceReportServices().GetBalanceSheet(type, date, paycompanyvalue);
......
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
<div class="form-group"> <div class="form-group">
<input id="chk_showdetail" type="checkbox" checked="checked" /><label for="chk_showdetail">是否可看明细</label> <input id="chk_showdetail" type="checkbox" checked="checked" /><label for="chk_showdetail">是否可看明细</label>
<select id="timetype" class="form-control" style="width:120px;"> <select id="timetype" class="form-control" style="width:120px;">
<option value="2">按周的方式</option> <option value="2">按周的方式</option>
<option value="3">按月的方式</option> <option value="3">按月的方式</option>
@*<option value="4">按年的方式</option>*@ @*<option value="4">按年的方式</option>*@
<option value="1">按日的方式</option> <option value="1">按日的方式</option>
</select> </select>
@*<label>日期</label> @*<label>日期</label>*@
<input id="day" type="text" style="width:120px" value="@DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")" class="form-control">*@ <input id="day" type="text" style="width:120px;display:none;" value="@DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")" class="form-control" />
<label>付款主体</label> <label>付款主体</label>
<select id="sel_paycompany" class="form-control" style="width:200px;"> <select id="sel_paycompany" class="form-control" style="width:200px;">
<option value="0">百伦供应链</option> <option value="0">百伦供应链</option>
@*<option value="1">广州百伦科技有限公司</option> @*<option value="1">广州百伦科技有限公司</option>
<option value="2" selected>香港百伦科技有限公司</option>*@ <option value="2" selected>香港百伦科技有限公司</option>*@
</select> </select>
<button type="button" class="btn btn-sm btn-primary" onclick="GetData();"><i class="fa fa-search"></i>&nbsp;查询</button> <button type="button" class="btn btn-sm btn-primary" onclick="GetData();"><i class="fa fa-search"></i>&nbsp;查询</button>
<button id="btnexport" style="display:none;" type="button" class="btn btn-sm btn-success" onclick="ExportXsl();">导出</button> <button id="btnexport" style="display:none;" type="button" class="btn btn-sm btn-success" onclick="ExportXsl();">导出</button>
...@@ -1334,6 +1334,15 @@ ...@@ -1334,6 +1334,15 @@
init(); init();
//list(); //list();
$('#timetype').change(function () {
if ($('#timetype').val() == 1) {
$('#day').show();
}
else {
$('#day').hide();
}
})
}) })
function init() { function init() {
...@@ -1381,7 +1390,7 @@ ...@@ -1381,7 +1390,7 @@
$.submit({ $.submit({
url: '@Url.Content("~/Reports/Finance/IndexJson")', url: '@Url.Content("~/Reports/Finance/IndexJson")',
type: "POST", type: "POST",
data: 'type=' + type + '&day=' + day + '&paycompanyvalue=' + paycompany, paramData: 'type=' + type + '&day=' + day + '&paycompanyvalue=' + paycompany,
func: function (result) { func: function (result) {
if (result.success) { if (result.success) {
var list = result.data; var list = result.data;
......
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