44673626
3 years ago
38 changed files with 15841 additions and 350 deletions
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,87 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using TaskJob.EventArgs; |
|||
using TaskJob.Interfaces; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccount; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccountJob; |
|||
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; |
|||
|
|||
namespace SettleAccount.Job.Services |
|||
{ |
|||
/// <summary>
|
|||
/// 2.大众发票与结算核对明细表-准时化
|
|||
/// </summary>
|
|||
public class InvoiceSettledDetailDiffExportService : ITransientDependency, IExportJob |
|||
{ |
|||
|
|||
private readonly InvoiceSettledDetailDiffDapperRepository _dapperRepository; |
|||
private readonly ErpPartDapperRepository _erpdapperRepository; |
|||
|
|||
private readonly OutputService _outputService; |
|||
private readonly InputService _inputService; |
|||
|
|||
public InvoiceSettledDetailDiffExportService( |
|||
|
|||
ErpPartDapperRepository erpdapperRepository, |
|||
InvoiceSettledDetailDiffDapperRepository dapperRepository, |
|||
OutputService outputService, |
|||
InputService inputService |
|||
) |
|||
{ |
|||
_inputService = inputService; |
|||
_outputService = outputService; |
|||
_erpdapperRepository= erpdapperRepository; |
|||
//_repository = repository;
|
|||
//_versionRepository = versionRepository;
|
|||
_dapperRepository =dapperRepository; |
|||
} |
|||
|
|||
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list) |
|||
{ |
|||
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; |
|||
var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; |
|||
var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value; |
|||
var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; |
|||
var cp7begin = p_list.Where(p => p.Name == "Cp7BeginTime").FirstOrDefault().Value; |
|||
var cp7end = p_list.Where(p => p.Name == "Cp7EndTime").FirstOrDefault().Value; |
|||
var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value; |
|||
var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; |
|||
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber); |
|||
var _list = _ls.Where(p=>p.ParentSapMaterialCode!=p.SapMaterialCode).GroupBy(p =>new { p.ParentSapMaterialCode,p.ChassisNumber,p.KENNCode }).Select(p => p.FirstOrDefault()).ToList(); |
|||
|
|||
var rangeList = _erpdapperRepository.GetSapList<InvoiceSettledDetailDiff>(_list); |
|||
var erpPriceList= _erpdapperRepository.GetErpPartCodePriceList(version); |
|||
rangeList.ForEach(p => { |
|||
p.Qty = 1; |
|||
p.InvoiceQty = 1; |
|||
p.SettledQty = 1; |
|||
p.DiffSettleFisQty = 0; |
|||
p.DiffSettleInvQty = 0; |
|||
var _first= erpPriceList.FirstOrDefault(itm => itm.SapErpPartCode == p.SapMaterialCode); |
|||
if (_first != null) |
|||
{ |
|||
p.InvoicePrice= _first.SapPrice; |
|||
} |
|||
p.DiffPrice = p.InvoicePrice - p.Price; |
|||
|
|||
}); |
|||
|
|||
|
|||
_ls.AddRange(rangeList); |
|||
_ls=_ls.OrderBy(p => p.ChassisNumber).ThenBy(p=>p.KENNCode).ThenBy(p=>p.SapMaterialCode).ToList(); |
|||
_outputService.Export<InvoiceSettledDetailDiff>(id, string.Format("大众发票与结算核对明细表_{0}.xlsx", Guid.NewGuid().ToString()), _ls); |
|||
|
|||
|
|||
|
|||
//_repository.Insert(_list);
|
|||
//_versionRepository.Insert(_id, version, customerCode, customerCode, string.Empty, string.Empty, projectName);
|
|||
return id.ToString(); |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,57 @@ |
|||
|
|||
export default { |
|||
components: {}, |
|||
data() { |
|||
return { |
|||
loading: false, // 加载动画
|
|||
tableHeight: document.documentElement.clientHeight - 300, // 表的高度
|
|||
total: 0 |
|||
} |
|||
}, |
|||
|
|||
computed: { |
|||
// 展示options下拉选择
|
|||
showOptions() { |
|||
if (this.infoType == 'putInPoolRemind') { |
|||
return false |
|||
} |
|||
return true |
|||
} |
|||
}, |
|||
|
|||
mounted() { |
|||
this.$bus.on('message-scroll', tableHeight => { |
|||
this.tableHeight = tableHeight |
|||
}) |
|||
|
|||
this.$bus.on('examine-handle-bus', () => { |
|||
}) |
|||
|
|||
/** 控制table的高度 */ |
|||
window.onresize = () => { |
|||
this.updateTableHeight() |
|||
} |
|||
}, |
|||
|
|||
beforeDestroy() { |
|||
this.$bus.off('message-scroll') |
|||
this.$bus.off('examine-handle-bus') |
|||
|
|||
if (document.getElementById('crm-table')) { |
|||
document.getElementById('crm-table').removeEventListener('click', e => { |
|||
e.stopPropagation() |
|||
}) |
|||
} |
|||
}, |
|||
|
|||
methods: { |
|||
/** |
|||
* 更新表高 |
|||
*/ |
|||
updateTableHeight() { |
|||
var offsetHei = document.documentElement.clientHeight |
|||
var removeHeight = Object.keys(this.filterObj).length > 0 ? 360 : 300 |
|||
this.tableHeight = offsetHei - removeHeight |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue