Commit ee6bf84f by guanzhenshan

不合理报表改为合理报告,可选择是否合理数据

parent c5daabc9
......@@ -7,29 +7,29 @@ namespace Bailun.DC.DailyPayAndIncoming
{
class Program
{
static async Task Main(string[] args)
{
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Services>();
});
await builder.RunConsoleAsync();
}
//static void Main(string[] args)
//static async Task Main(string[] args)
//{
// var _services = new Services();
// var start = DateTime.Parse("2019-11-01");
// while (start < DateTime.Now)
// Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
// var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
// {
// Console.WriteLine(start);
// _services.Init(start, start.AddDays(1));
// _services.SaveMoneyFlowCount(start, start.AddDays(1));
// start = start.AddDays(1);
// }
// services.AddHostedService<Services>();
// });
// await builder.RunConsoleAsync();
//}
static void Main(string[] args)
{
var _services = new Services();
var start = DateTime.Parse("2019-12-04");
while (start < DateTime.Now)
{
Console.WriteLine(start);
_services.Init(start, start.AddDays(1));
_services.SaveMoneyFlowCount(start, start.AddDays(1));
start = start.AddDays(1);
}
}
}
}
......@@ -87,7 +87,7 @@ namespace Bailun.DC.DailyPayAndIncoming
costTotal = listInterest.Count > 0 ? listInterest.Sum(a => a.RepayInterestRMB):0;
//管理成本 只取付款主体为广州百伦供应链科技有限公司、香港百伦科技有限公司、广州电子服装仓、阳山仓、深圳仓、广州哥戈尔生活科技有限公司、广州迪致美容科技有限公司的数据
list = list.Where(a => a.companyName.Contains("广州歌戈儿生活科技有限公司") || a.companyValue == 5 || a.companyValue == 1 || a.companyValue == 3 || a.companyValue == 8 || a.companyValue == 2).ToList();
list = list.Where(a => a.companyName.Contains("广州歌戈儿生活科技有限公司") || a.companyValue == 5 || a.companyValue == 1 || a.companyValue == 3 || a.companyValue == 8 || a.companyValue == 2 || a.companyValue==7).ToList();
if (list.Count > 0)
{
costTotal += list.Sum(a => a.amountRmb);
......@@ -159,7 +159,7 @@ namespace Bailun.DC.DailyPayAndIncoming
costTotal = listInterest.Count > 0 ? listInterest.Sum(a => a.RepayInterestRMB) : 0;
//管理成本 只取付款主体为广州百伦供应链科技有限公司、香港百伦科技有限公司、广州电子服装仓、阳山仓、深圳仓、广州哥戈尔生活科技有限公司、广州迪致美容科技有限公司的数据
list = list.Where(a => a.companyName.Contains("广州歌戈儿生活科技有限公司") || a.companyValue == 5 || a.companyValue == 1 || a.companyValue == 3 || a.companyValue == 8 || a.companyValue == 2).ToList();
list = list.Where(a => a.companyName.Contains("广州歌戈儿生活科技有限公司") || a.companyValue == 5 || a.companyValue == 1 || a.companyValue == 3 || a.companyValue == 8 || a.companyValue == 2 || a.companyValue == 7).ToList();
if (list.Count > 0)
{
costTotal += list.Sum(a => a.amountRmb);
......
......@@ -7,25 +7,30 @@ namespace Bailun.DC.DailyPurchaseSellStock
{
class Program
{
//static async Task Main(string[] args)
static async Task Main(string[] args)
{
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Services>();
});
await builder.RunConsoleAsync();
}
//static void Main(string[] args)
//{
// Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
// var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
// {
// services.AddHostedService<Services>();
// });
// var _services = new Services();
// await builder.RunConsoleAsync();
//}
// var start = DateTime.Parse("2020-01-01");
// while (start.AddDays(1) < DateTime.Now)
// {
// Console.WriteLine(start);
// _services.Init(start);
// }
static void Main(string[] args)
{
var _services = new Services();
var start = DateTime.Parse("2020-01-05");
_services.Init(start);
}
//}
}
}
......@@ -4846,7 +4846,7 @@ group by currency";
public List<dc_mid_month_sale_putin_report> ListMonthSalePutinDetail(BtTableParameter parameter, string month, string warehousetype, string warehouse, int? type,int? isclear,int? isnew,int? isaims,ref int total,int isreasonable=-1)
{
var sqlparam = new DynamicParameters();
var sql = $@"select t1.warehouse_type,t1.warehouse_code,t1.warehouse_name,t1.bailun_sku,t1.count_putin,(t1.count_putin*t1.buyprice) amount_putin,t1.count_outbound,(t1.count_outbound*t1.buyprice) amount_outbound,(t1.count_putin-t1.count_outbound) count_diff,((t1.count_putin-t1.count_outbound)*t1.buyprice) amount_diff,t2.is_clear,t2.is_new,t2.is_aimsorder,t2.count_usable_stock,t2.avg_sevenday_sales,t2.avg_fourteenday_sales,t2.avg_thirtyday_sales,t2.avg_sales from dc_mid_month_sale_putin t1
var sql = $@"select t1.warehouse_type,t1.warehouse_code,t1.warehouse_name,t1.bailun_sku,t1.count_putin,(t1.count_putin*t1.buyprice) amount_putin,t1.count_outbound,(t1.count_outbound*t1.buyprice) amount_outbound,(t1.count_putin-t1.count_outbound) count_diff,((t1.count_putin-t1.count_outbound)*t1.buyprice) amount_diff,t2.is_clear,t2.is_new,t2.is_aimsorder,t2.count_usable_stock,t2.avg_sevenday_sales,t2.avg_fourteenday_sales,t2.avg_thirtyday_sales,t2.avg_sales,t2.sale_putin_id from dc_mid_month_sale_putin t1
left join dc_mid_month_sale_putin_report t2 on t1.id=t2.sale_putin_id
where t1.`month`='{month}'";
......@@ -4914,6 +4914,10 @@ group by currency";
{
sql += " and t2.id is not null ";
}
else if (isreasonable == 1) //合理
{
sql += " and t2.id is null ";
}
if (!string.IsNullOrEmpty(parameter.sort))
......@@ -4954,7 +4958,7 @@ group by currency";
public dc_mid_month_sale_putin_report ListMonthSalePutinDetailCount(string month, string warehousetype, string warehouse, int? type, int? isclear, int? isnew, int? isaims, int isreasonable = -1)
{
var sqlparam = new DynamicParameters();
var sql = $@"select sum(t1.count_putin) count_putin,sum(t1.count_putin*t1.buyprice) amount_putin,sum(t1.count_outbound) count_outbound,sum(t1.count_outbound*t1.buyprice) amount_outbound,sum(t1.count_putin-t1.count_outbound) count_diff,sum((t1.count_putin-t1.count_outbound)*t1.buyprice) amount_diff from dc_mid_month_sale_putin t1
var sql = $@"select sum(t1.count_putin) count_putin,sum(t1.count_putin*t1.buyprice) amount_putin,sum(t1.count_outbound) count_outbound,sum(t1.count_outbound*t1.buyprice) amount_outbound,sum(t1.count_putin-t1.count_outbound) count_diff,sum((t1.count_putin-t1.count_outbound)*t1.buyprice) amount_diff,sum(t2.count_usable_stock) count_usable_stock from dc_mid_month_sale_putin t1
left join dc_mid_month_sale_putin_report t2 on t1.id=t2.sale_putin_id
where t1.`month`='{month}'";
......@@ -5022,6 +5026,10 @@ group by currency";
{
sql += " and t2.id is not null ";
}
else if (isreasonable == 1) //合理
{
sql += " and t2.id is null ";
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
......
......@@ -6430,7 +6430,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
a.avg_sevenday_sales,
a.avg_fourteenday_sales,
a.avg_thirtyday_sales,
a.avg_sales
a.avg_sales,
sale_putin_id = a.sale_putin_id>0?"不合理":"合理"
});
return JsonConvert.SerializeObject(new
......@@ -6445,7 +6446,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
count_putin = objCount.count_putin.ToString("N2"),
amount_putin = (objCount.amount_putin??0).ToString("N2"),
count_diff = objCount.count_diff.ToString("N2"),
amount_diff = (objCount.amount_diff??0).ToString("N2")
amount_diff = (objCount.amount_diff??0).ToString("N2"),
count_usable_stock = objCount.count_usable_stock.ToString("N2")
}
});
}
......@@ -6489,15 +6491,15 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
a.avg_sevenday_sales,
a.avg_fourteenday_sales,
a.avg_thirtyday_sales,
a.avg_sales
a.avg_sales,
sale_putin_id = a.sale_putin_id > 0 ? "不合理" : "合理"
});
var colNames = new List<string>() { "仓库类型", "仓库名称", "sku", "出库数量", "出库金额", "入库数量", "入途金额", "(入库-出库)数量", "(入库-出库)金额" }; ;
if (isreasonable == 0)
{
colNames.AddRange(new List<string> { "是否清货", "是否新品", "可用库存", "7日日均", "14日日均", "30日日均", "可消耗天数"});
}
colNames.AddRange(new List<string> { "是否清货", "是否新品", "可用库存", "7日日均", "14日日均", "30日日均", "可消耗天数","是否合理"});
......@@ -6505,12 +6507,12 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
foreach (var item in list)
{
listval.Add(item.warehouse_type + "|" + item.warehouse_name + "|" + item.bailun_sku + "|" + item.count_outbound + "|" + item.amount_outbound + "|" +
item.count_putin + "|" + item.amount_putin + "|" + item.count_diff + "|" + item.amount_diff+(isreasonable == 0?("|"+item.is_clear+"|"+item.is_new+"|"+item.count_usable_stock+"|"+item.avg_sevenday_sales+"|"+item.avg_fourteenday_sales+"|"+item.avg_thirtyday_sales+"|"+item.avg_sales):"")
item.count_putin + "|" + item.amount_putin + "|" + item.count_diff + "|" + item.amount_diff+("|"+item.is_clear+"|"+item.is_new+"|"+item.count_usable_stock+"|"+item.avg_sevenday_sales+"|"+item.avg_fourteenday_sales+"|"+item.avg_thirtyday_sales+"|"+item.avg_sales+"|"+item.sale_putin_id)
);
}
var guid = Guid.NewGuid().ToString();
var filename = "每月进销存明细" + DateTime.Now.ToString("yyyyMMddHHmmss");
var filename = "每月进销存合理报告" + DateTime.Now.ToString("yyyyMMddHHmmss");
var filepath = _hostingEnvironment.WebRootPath + "\\Files\\Report\\" + DateTime.Now.ToString("yyyy-MM-dd") + "\\";
ToCSV(listval, colNames, guid, filepath);
......
......@@ -28,6 +28,10 @@
</select>
</div>*@
<div class="form-group">
<label>请选择开始月份</label>
<input id="month" name="month" class="form-control" style="width:130px;" placeholder="年-月" value="@(ViewBag.month)" />
</div>
<div class="form-group">
<label>差异类型</label>
<select id="type" name="type" class="form-control">
<option value="">选择差异类型</option>
......@@ -36,8 +40,28 @@
</select>
</div>
<div class="form-group">
<label>请选择开始月份</label>
<input id="month" name="month" class="form-control" style="width:130px;" placeholder="年-月" value="@(ViewBag.month)" />
<label>是否合理</label>
<select id="isreasonable" name="isreasonable" class="form-control">
<option value="">请选择</option>
<option value="0">不合理</option>
<option value="1">合理</option>
</select>
</div>
<div class="form-group">
<label>是否新品</label>
<select id="isnew" name="isnew" class="form-control">
<option value="">请选择</option>
<option value="1">是</option>
<option value="0">否</option>
</select>
</div>
<div class="form-group">
<label>是否清货</label>
<select id="isclear" name="isclear" class="form-control">
<option value="">请选择</option>
<option value="1">是</option>
<option value="0">否</option>
</select>
</div>
<div class="form-group">
<label>&nbsp;</label>
......@@ -78,6 +102,10 @@
if (@(ViewBag.type)!= -1) {
$('#type').val(@(ViewBag.type));
}
if (@(ViewBag.isun)== 0) {
$('#isreasonable').val(0);
}
list();
})
......@@ -94,20 +122,18 @@
{ field: 'count_diff', title: '(入库-出库)数量', width: '150', iscount: true, sortable: true },
{ field: 'amount_diff', title: '(入库-出库)金额', width: '150', iscount: true }
];
columns.push({ field: 'is_clear', title: '是否清货', width: '110', sortable: true });
columns.push({ field: 'is_new', title: '是否新品', width: '110', sortable: true });
columns.push({ field: 'count_usable_stock', title: '可用库存', width: '110', sortable: true, iscount: true });
columns.push({ field: 'avg_sevenday_sales', title: '7日日均', width: '110' });
columns.push({ field: 'avg_fourteenday_sales', title: '14日日均', width: '110' });
columns.push({ field: 'avg_thirtyday_sales', title: '30天日均', width: '110' });
columns.push({ field: 'avg_sales', title: '可消耗天数', width: '110', sortable: true });
columns.push({ field: 'sale_putin_id', title: '是否合理', width: '110', sortable: true });
if (@(ViewBag.isun)== 0) {
columns.push({ field: 'is_clear', title: '是否清货', width: '110', sortable: true });
columns.push({ field: 'is_new', title: '是否新品', width: '110', sortable: true });
columns.push({ field: 'count_usable_stock', title: '可用库存', width: '110', sortable: true });
columns.push({ field: 'avg_sevenday_sales', title: '7日日均', width: '110' });
columns.push({ field: 'avg_fourteenday_sales', title: '14日日均', width: '110' });
columns.push({ field: 'avg_thirtyday_sales', title: '30天日均', width: '110' });
columns.push({ field: 'avg_sales', title: '可消耗天数', width: '110', sortable: true });
}
var url = '@Url.Content("~/Reports/Finance/ListUnReasonableJson")' + '?' + $("#toolbar").serialize() + (@(ViewBag.isun)== 0 ?'&isreasonable=0':'');
var url = '@Url.Content("~/Reports/Finance/ListUnReasonableJson")' + '?' + $("#toolbar").serialize();
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
......@@ -140,9 +166,6 @@
function exportlist() {
window.open('@Url.Content("~/Reports/Finance/ExportUnReasonable?")' + $("#toolbar").serialize() + (@(ViewBag.isun)== 0 ? '&isreasonable=0' : ''), '_blank');
}
</script>
}
......
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