|
@ -18,10 +18,10 @@ namespace SettleAccount.Job.Services.Report |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
private readonly OutputService _outputService; |
|
|
private readonly OutputService _outputService; |
|
|
KanbanUnSettledDapperRepository _dapper; |
|
|
SharePartUnSettledDapperRepository _dapper; |
|
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
|
|
|
|
|
|
|
|
public SharePartUnSettledExport(KanbanUnSettledDapperRepository dapper, OutputService outputService, |
|
|
public SharePartUnSettledExport(SharePartUnSettledDapperRepository dapper, OutputService outputService, |
|
|
|
|
|
|
|
|
IBlobContainer<MyFileContainer> fileContainer |
|
|
IBlobContainer<MyFileContainer> fileContainer |
|
|
) |
|
|
) |
|
@ -46,14 +46,14 @@ namespace SettleAccount.Job.Services.Report |
|
|
var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; |
|
|
var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; |
|
|
var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; |
|
|
var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; |
|
|
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; |
|
|
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; |
|
|
var _ls = _dapper.GetKanbanReportList(version, begin,end); |
|
|
var _ls = _dapper.GetOrderSharePartReportList(version, begin,end); |
|
|
var _lst = _dapper.GetNoKanbanReportList(version, begin, end); |
|
|
var _lst = _dapper.GetNoOrderSharePartReportList(version, begin, end); |
|
|
if (!string.IsNullOrEmpty(materialGroup)) |
|
|
if (!string.IsNullOrEmpty(materialGroup)) |
|
|
{ |
|
|
{ |
|
|
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); |
|
|
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); |
|
|
if (_groupList.Count() > 0) |
|
|
if (_groupList.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
_ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); |
|
|
_ls = _ls.Where(p => _groupList.Contains(p.MaterilGroup)).ToList(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrEmpty(materialCode)) |
|
|
if (!string.IsNullOrEmpty(materialCode)) |
|
@ -61,7 +61,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
if (_groupList.Count() > 0) |
|
|
if (_groupList.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
_ls = _ls.Where(p => _groupList.Contains(p.CustomerPartCode)).ToList(); |
|
|
_ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrEmpty(sapCode)) |
|
|
if (!string.IsNullOrEmpty(sapCode)) |
|
@ -69,7 +69,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
if (_groupList.Count() > 0) |
|
|
if (_groupList.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
_ls = _ls.Where(p => _groupList.Contains(p.SapCode)).ToList(); |
|
|
_ls = _ls.Where(p => _groupList.Contains(p.SAPCode)).ToList(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrEmpty(materialGroup)) |
|
|
if (!string.IsNullOrEmpty(materialGroup)) |
|
@ -77,7 +77,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); |
|
|
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); |
|
|
if (_groupList.Count() > 0) |
|
|
if (_groupList.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
_lst = _lst.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); |
|
|
_lst = _lst.Where(p => _groupList.Contains(p.MaterilGroup)).ToList(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrEmpty(materialCode)) |
|
|
if (!string.IsNullOrEmpty(materialCode)) |
|
@ -93,13 +93,13 @@ namespace SettleAccount.Job.Services.Report |
|
|
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
if (_groupList.Count() > 0) |
|
|
if (_groupList.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
_lst = _lst.Where(p => _groupList.Contains(p.SapCode)).ToList(); |
|
|
_lst = _lst.Where(p => _groupList.Contains(p.SAPCode)).ToList(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
ExcelExporter _exporter = new ExcelExporter();//导出Excel
|
|
|
ExcelExporter _exporter = new ExcelExporter();//导出Excel
|
|
|
var result = _exporter.Append(_ls.ToList(), "有看板号未结差异对比") |
|
|
var result = _exporter.Append(_ls.ToList(), "备件未结差异对比") |
|
|
.SeparateBySheet() |
|
|
.SeparateBySheet() |
|
|
.Append(_lst.ToList(), "无看板号未结差异对比") |
|
|
.Append(_lst.ToList(), "备件未结差异对比(无订单号)") |
|
|
.ExportAppendDataAsByteArray(); |
|
|
.ExportAppendDataAsByteArray(); |
|
|
result.ShouldNotBeNull(); |
|
|
result.ShouldNotBeNull(); |
|
|
_fileContainer.SaveAsync(_filename, result.Result, true); |
|
|
_fileContainer.SaveAsync(_filename, result.Result, true); |
|
|