|
|
@ -28,10 +28,14 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
|
|
|
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list) |
|
|
|
{ |
|
|
|
|
|
|
|
var _filename = exportName.FirstOrDefault(); |
|
|
|
var sapMaterialCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value; |
|
|
|
|
|
|
|
|
|
|
|
var customerPartCode = p_list.Where(p => p.Name == "CustomerPartCode").FirstOrDefault().Value; |
|
|
|
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; |
|
|
|
var estimateTypeDesc = p_list.Where(p => p.Name == "EstimateTypeDesc").FirstOrDefault().Value; |
|
|
|
var materialGroup = p_list.Where(p => p.Name == "EstimateTypeDesc").FirstOrDefault().Value; |
|
|
|
var kanban = p_list.Where(p => p.Name == "Kanban").FirstOrDefault().Value; |
|
|
|
|
|
|
|
|
|
|
@ -39,7 +43,7 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; |
|
|
|
|
|
|
|
|
|
|
|
var _list = _dapper.GetSettleKBWithCodeReportList(kanban, version, sapMaterialCode, customerPartCode,estimateTypeDesc, beginTime, endTime); |
|
|
|
var _list = _dapper.GetSettleKBWithCodeReportList(kanban, version, sapMaterialCode, customerPartCode,materialGroup, beginTime, endTime); |
|
|
|
var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version); |
|
|
|
if (diffList != null) |
|
|
|
{ |
|
|
@ -53,7 +57,62 @@ namespace SettleAccount.Job.Services.Report |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_outputService.Export<SettleKBWithCode>(id, string.Format("大众看板结算与交货核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _list); |
|
|
|
if (!string.IsNullOrEmpty(materialGroup)) |
|
|
|
{ |
|
|
|
var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); |
|
|
|
if (_groupList.Count() > 0) |
|
|
|
{ |
|
|
|
_list = _list.Where(p => _groupList.Contains(p.EstimateTypeDesc)).ToList(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(sapMaterialCode)) |
|
|
|
{ |
|
|
|
var _groupList = sapMaterialCode.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
|
if (_groupList.Count() > 0) |
|
|
|
{ |
|
|
|
_list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(customerPartCode)) |
|
|
|
{ |
|
|
|
var _groupList = customerPartCode.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
|
if (_groupList.Count() > 0) |
|
|
|
{ |
|
|
|
_list = _list.Where(p => _groupList.Contains(p.CustomerPartCode)).ToList(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(beginTime)) |
|
|
|
{ |
|
|
|
|
|
|
|
_list = _list.Where(p => DateTime.Parse(beginTime)<=p.ActualGoodsDate).ToList(); |
|
|
|
|
|
|
|
} |
|
|
|
if (!string.IsNullOrEmpty(endTime)) |
|
|
|
{ |
|
|
|
|
|
|
|
_list = _list.Where(p => DateTime.Parse(endTime) >= p.ActualGoodsDate).ToList(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(kanban)) |
|
|
|
{ |
|
|
|
var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); |
|
|
|
if (_groupList.Count() > 0) |
|
|
|
{ |
|
|
|
_list = _list.Where(p => _groupList.Contains(p.Kanban)).ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_outputService.Export<SettleKBWithCode>(id,_filename , _list); |
|
|
|
|
|
|
|
return id.ToString(); |
|
|
|
} |
|
|
|