Browse Source

更新版本

master
学 赵 1 year ago
parent
commit
6fa31416ea
  1. 46
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BalanceSumService .cs
  2. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  3. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs
  4. 807
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  5. 373
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs
  6. 118
      code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/PD_SERVICE.cs

46
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BalanceSumService .cs

@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using EFCore.BulkExtensions;
using NPOI.OpenXmlFormats.Spreadsheet;
using SettleAccount.Bases;
using SettleAccount.Domain.BQ;
using TaskJob.EventArgs;
using TaskJob.Interfaces;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Emailing;
using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.Entities.CodeSettings;
using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{
public class BalanceSumService : ApplicationService, ITransientDependency, IExportJob
{
//protected readonly SettleAccountDbContext _dbcontext;
protected readonly BalanceSumDapperRepository _dapper;
public BalanceSumService(
BalanceSumDapperRepository dapper
)
{
_dapper = dapper;
//_dbcontext = dbcontext;
}
[UnitOfWork(false)]
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{
var year = property.Where(p => p.Name == "Year").FirstOrDefault().Value;
var list=_dapper.GetBalanceSum(year);
return id.ToString();
}
}
}

17
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs

@ -44,6 +44,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var projectList = _dbcontext.Set<CodeSetting>().Where(p => p.Project == "库位").ToList(); var projectList = _dbcontext.Set<CodeSetting>().Where(p => p.Project == "库位").ToList();
var jisbbac = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; var jisbbac = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description;
var jisbbac_sy = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; var jisbbac_sy = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description;
var jism = projectList.FirstOrDefault(p => p.Value == "MaiDanJianBBAC").Description;
var maidanhbpo = projectList.FirstOrDefault(p => p.Value == "MaiDanJianHBPO").Description;
var jism_sy = projectList.FirstOrDefault(p => p.Value == "MaiDanJianBBAC顺义").Description;
var yindujian = projectList.FirstOrDefault(p => p.Value == "YinDuJian").Description; var yindujian = projectList.FirstOrDefault(p => p.Value == "YinDuJian").Description;
var beijian = projectList.FirstOrDefault(p => p.Value == "BeiJian").Description; var beijian = projectList.FirstOrDefault(p => p.Value == "BeiJian").Description;
if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian" || type == "YinDuJian") if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian" || type == "YinDuJian")
@ -73,13 +84,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{ {
if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = jisbbac; itm.Extend2 = jism;
itm.Extend3 = "有结算无发运"; itm.Extend3 = "有结算无发运";
} }
if (itm.Site == "1046" && string.IsNullOrEmpty(itm.Extend2)) if (itm.Site == "1046" && string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = jisbbac_sy; itm.Extend2 = jism_sy;
itm.Extend3 = "有结算无发运"; itm.Extend3 = "有结算无发运";
} }
} }
@ -152,7 +163,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{ {
if (string.IsNullOrEmpty(itm.Extend2)) if (string.IsNullOrEmpty(itm.Extend2))
{ {
itm.Extend2 = "CC004"; itm.Extend2 = maidanhbpo;
itm.Extend3 = "有结算无发运"; itm.Extend3 = "有结算无发运";
} }
} }

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs

@ -58,6 +58,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
return (DateTime.Now - now).TotalMinutes; return (DateTime.Now - now).TotalMinutes;
} }
[NonAction] [NonAction]
[DisableValidation] [DisableValidation]
public async Task Invoke(IServiceProvider serviceProvider) public async Task Invoke(IServiceProvider serviceProvider)

807
code/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -9,6 +9,7 @@ using TaskJob.EventArgs;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
using Volo.Abp.Uow; using Volo.Abp.Uow;
using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Entities.Invoices;
using Win.Sfs.SettleAccount.Entities.ItemInvoicePrices; using Win.Sfs.SettleAccount.Entities.ItemInvoicePrices;
using Win.Sfs.SettleAccount.Entities.MaterialRelationships; using Win.Sfs.SettleAccount.Entities.MaterialRelationships;
@ -20,18 +21,18 @@ using Win.Sfs.SettleAccount.Reports.ReportRequestDto;
namespace Win.Sfs.SettleAccount.Reports.ReportServices namespace Win.Sfs.SettleAccount.Reports.ReportServices
{ {
[Authorize(SettleAccountPermissions.Reports.Default)] [AllowAnonymous]
[Route("api/settleaccount/ReportMakeService")] [Route("api/settleaccount/[controller]/[action]")]
public class ReportService : ApplicationService public class ReportService : BASE_SERVICE
{ {
private readonly ISettleAccountBranchEfCoreRepository<InvoiceVersion, Guid> _invoiceVersionRepository; //private readonly ISettleAccountBranchEfCoreRepository<InvoiceVersion, Guid> _invoiceVersionRepository;
private readonly ISettleAccountBranchEfCoreRepository<SettleAccountVersion, Guid> _settleAccountVersionrepository; //private readonly ISettleAccountBranchEfCoreRepository<SettleAccountVersion, Guid> _settleAccountVersionrepository;
private readonly ISettleAccountBranchEfCoreRepository<FISVersion, Guid> _fisVersionrepository; //private readonly ISettleAccountBranchEfCoreRepository<FISVersion, Guid> _fisVersionrepository;
private readonly ISettleAccountBranchEfCoreRepository<ItemInvoicePriceVersion, Guid> _itemInvoicePriceVersionrepository; //private readonly ISettleAccountBranchEfCoreRepository<ItemInvoicePriceVersion, Guid> _itemInvoicePriceVersionrepository;
private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationshipVersion, Guid> _relationshipRepository; //private readonly ISettleAccountBranchEfCoreRepository<MaterialRelationshipVersion, Guid> _relationshipRepository;
private readonly ISettleAccountBranchEfCoreRepository<SettlementPartVersion, Guid> _settlementPartVersionrepository; //private readonly ISettleAccountBranchEfCoreRepository<SettlementPartVersion, Guid> _settlementPartVersionrepository;
//private readonly ISettleAccountBranchEfCoreRepository<InvoiceSettledDiffVersion, Guid> _versionRepository; //private readonly ISettleAccountBranchEfCoreRepository<InvoiceSettledDiffVersion, Guid> _versionRepository;
private readonly TaskJobService _service; private readonly TaskJobService _service;
/// <summary> /// <summary>
@ -41,806 +42,26 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
/// <param name="repository">仓储接口</param> /// <param name="repository">仓储接口</param>
/// <param name="cache">缓存</param> /// <param name="cache">缓存</param>
public ReportService( public ReportService(
ISettleAccountBranchEfCoreRepository<InvoiceVersion, Guid> invoiceVersionRepository,
ISettleAccountBranchEfCoreRepository<SettleAccountVersion, Guid> settleAccountVersionrepository,
ISettleAccountBranchEfCoreRepository<MaterialRelationshipVersion, Guid> relationshipRepository,
ISettleAccountBranchEfCoreRepository<SettlementPartVersion, Guid> settlementPartVersionrepository,
ISettleAccountBranchEfCoreRepository<FISVersion, Guid> fisVersionrepository,
ISettleAccountBranchEfCoreRepository<ItemInvoicePriceVersion, Guid> itemInvoicePriceVersionrepository,
IExcelImportAppService excelImportService, IExcelImportAppService excelImportService,
//ISnowflakeIdGenerator snowflakeIdGenerator, TaskJobService service
//ICommonManager commonManager,
TaskJobService service
) )
{ {
_relationshipRepository = relationshipRepository;
_settlementPartVersionrepository = settlementPartVersionrepository;
_settleAccountVersionrepository = settleAccountVersionrepository;
_invoiceVersionRepository = invoiceVersionRepository;
_fisVersionrepository = fisVersionrepository;
_itemInvoicePriceVersionrepository = itemInvoicePriceVersionrepository;
_service = service; _service = service;
} }
//#region 派格大众看板-备件结算报表
///// <summary>
///// 大众准时化结算门板价格差异比对报表
///// </summary>
///// <param name="materialCode">客户物料号</param>
///// <param name="version">版本</param>
///// <param name="customerCode"></param>
///// <param name="sapCode">厂内物料号</param>
///// <param name="estimateTypeDesc">物料组</param>
///// <returns></returns>
//[HttpPost]
//[Route("SettleDoorPanel")]
//[DisableRequestSizeLimit]
//public async Task<string> SettleDoorPanel(
// BaseRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(input.Version) ? string.Empty : input.Version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(input.MaterialCode) ? string.Empty : input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(input.Begin) ? string.Empty : input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(input.End) ? string.Empty : input.End });
// customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(input.Cp7Begin) ? string.Empty : input.Cp7Begin });
// customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(input.Cp7End) ? string.Empty : input.Cp7End });
// customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
// customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// var _taskid = await _service.ExportEnqueueAsync("准时化结算门板价格差异比对报表", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(SettleDoorPanelExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
///// 有条码看板结算核对
///// </summary>
///// <param name="kanBan">看板号</param>
///// <param name="sapMaterialCode">厂内零件号</param>
///// <param name="version">版本</param>
///// <param name="customerCode"></param>
///// <param name="customerPartCode">客户物料号</param>
///// <param name="estimateTypeDesc">物料组(车型)</param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpPost]
//[Route("SettleKanBan-WithCode")]
//[DisableRequestSizeLimit]
//public async Task<string> SettledKanBanWithCode(BaseKanbanReqestDto input)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = input.CustomerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerPartCode", Value = input.CustomerPartCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = input.State ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "EstimateTypeDesc", Value = input.EstimateTypeDesc ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.KanBan ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = input.SapMaterialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End ?? string.Empty });
// var _taskid = await _service.ExportEnqueueAsync("看板结算输出", ExportExtentsion.Excel,input.Version ,string.Empty,CurrentUser, typeof(SettleKBWithCodeExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
//[HttpPost]
//[Route("SettleKanBan-WithOutCode")]
//[DisableRequestSizeLimit]
//public async Task<string> SettledKanBanWithOutCode(BaseKanbanReqestDto input)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = input.CustomerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerPartCode", Value = input.CustomerPartCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = input.State ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "EstimateTypeDesc", Value = input.EstimateTypeDesc ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "有条码看板结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.KanBan ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = input.SapMaterialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = input.Begin ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End ?? string.Empty });
// var _taskid = await _service.ExportEnqueueAsync("无条码看板结算输出", ExportExtentsion.Excel, input.Version,string.Empty, CurrentUser, typeof(SettleKBWithOutCodeExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
//#region 大众备件0-90天和90天以上输出
///// <summary>
///// 大众备件数据调整结算输出
///// </summary>
///// <param name="purchaseOrderNo"></param>
///// <param name="sapCode"></param>
///// <param name="version"></param>
///// <param name="customerCode"></param>
///// <param name="factory"></param>
///// <param name="matialCode"></param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpGet]
//[Route("SettleSparePart90Export")]
//[DisableRequestSizeLimit]
//public async Task<string> SettledSparePart90(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
// string state, DateTime begin, DateTime end)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("大众备件数据调整结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePart90ExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
///// 大众备件输出(包括带订货单号和无订单号)
///// </summary>
///// <param name="purchaseOrderNo">采购订单号</param>
///// <param name="sapCode">厂内物料号</param>
///// <param name="version">版本</param>
///// <param name="customerCode"></param>
///// <param name="factory"></param>
///// <param name="matialCode">物料代码</param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpGet]
//[Route("SettleSparePartExport")]
//[DisableRequestSizeLimit]
//public async Task<string> SettledSparePart(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
// string state, DateTime begin, DateTime end)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("大众备件结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
///// 大众备件未结明细
///// </summary>
///// <param name="purchaseOrderNo"></param>
///// <param name="sapCode"></param>
///// <param name="version"></param>
///// <param name="customerCode"></param>
///// <param name="factory"></param>
///// <param name="matialCode"></param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpGet]
//[Route("UnSettleSparePartExport")]
//[DisableRequestSizeLimit]
//public async Task<string> UnSettledSparePart(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
// string state, DateTime begin, DateTime end)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("大众备件未结输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleUnSparePartExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
//#endregion
///// <summary>
///// 无订单备件结算输出
///// </summary>
///// <param name="purchaseOrderNo">采购订单号</param>
///// <param name="sapCode">厂内物料号</param>
///// <param name="version">版本</param>
///// <param name="customerCode"></param>
///// <param name="factory"></param>
///// <param name="matialCode">物料代码</param>
///// <param name="state"></param>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <returns></returns>
//[HttpGet]
//[Route("SettleSparePartExportExtend")]
//[DisableRequestSizeLimit]
//public async Task<string> SettledSparePartExtend(string purchaseOrderNo, string sapCode, string version, string customerCode, string factory, string matialCode,
// string state, DateTime begin, DateTime end)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "PurchaseOrderNo", Value = purchaseOrderNo ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode ?? string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "State", Value = state ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? "0" });
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "大众备件结算核对" });
// customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
// var _taskid = await _service.ExportEnqueueAsync("无订单备件结算输出", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
//#endregion
[HttpGet]
[Route("SharePartUnSettledExport")]
[DisableRequestSizeLimit]
public async Task<string> SharePartUnSettled(string sapCode, string version,
DateTime begin, DateTime end)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
var _taskid = await _service.ExportEnqueueAsync("备件未结明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SharePartUnSettledExport), customConditionList, (rs) =>
{
}).ConfigureAwait(false);
return _taskid;
}
///// <summary>
///// 结算总成和ERP总成价格对比
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpGet]
//[Route("BomDiffPrice-Make")]
//[DisableRequestSizeLimit]
//public async Task<string> SettledPartAndErpPartPriceDiffMake(string version, string customerCode)
//{
// //if (!_relationshipRepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
// //{
// // throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version));
// //}
// //if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
// //{
// // throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version));
// //}
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "Bom定价差异明细" });
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(version) ? string.Empty : version });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.IsNullOrEmpty(customerCode)?string.Empty: customerCode });
// var _taskid = await _service.ExportEnqueueAsync("Bom定价差异明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
/// <summary>
/// 看板未结输出
/// </summary>
/// <param name="sapCode"></param>
/// <param name="version"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <param name="materialGroup"></param>
/// <returns></returns>
[HttpGet]
[Route("KanbanUnSettledExport")]
[DisableRequestSizeLimit]
public async Task<string> KanbanUnSettled(string sapCode, string version,
DateTime begin, DateTime end, string materialGroup, string matialCode, string isContainVersion)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SAPCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "BegingTime", Value = begin.ToString() });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end.ToString() });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = materialGroup });
customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = isContainVersion });
var _taskid = await _service.ExportEnqueueAsync("看板未结明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(KanBanUnSettledExport), customConditionList, (rs) =>
{
}).ConfigureAwait(false);
return _taskid;
}
/// <summary>
/// 1.大众发票与结算核对汇总表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpGet]
[Route("InvoiceSettledDiff-Make")]
[DisableRequestSizeLimit]
public async Task<string> InvoiceSettledDiffMake(
string year, string period, string version, string sapCode, string customerCode, string factory, string matialCode, string state
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = sapCode ?? string.Empty });
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "结算与开票数据对比" });
customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? DateTime.Now.Year.ToString() });
var _taskid = await _service.ExportEnqueueAsync("发票与结算核对汇总表", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(InvoiceSettledDiffExportService), customConditionList, (rs) =>
{
}).ConfigureAwait(false);
return _taskid;
}
/// <summary>
///发票与结算核对明细表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost] [HttpPost]
[Route("VersionSum")]
[DisableRequestSizeLimit] [DisableRequestSizeLimit]
public async Task<string> GetBalance(string p_year)
public async Task<string> VersionSumMake(
BaseRequestDto request
)
{ {
List<CustomCondition> customConditionList = new List<CustomCondition>(); List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(request.Version) ? string.Empty : request.Version }); customConditionList.Add(new CustomCondition() { Name = "Year", Value = p_year ?? DateTime.Now.Year.ToString() });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(request.MaterialCode) ? string.Empty : request.MaterialCode }); var _taskid = await _service.ExportEnqueueAsync("库存余额汇总", ExportExtentsion.Excel, p_year, string.Empty, CurrentUser, typeof(SharePartUnSettledExport), customConditionList, (rs) =>
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(request.Begin) ? string.Empty : request.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(request.End) ? string.Empty : request.End });
customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(request.Cp7Begin) ? string.Empty : request.Cp7Begin });
customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(request.Cp7End) ? string.Empty : request.Cp7End });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(request.Kenncode) ? string.Empty : request.Kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(request.ChassisNumber) ? string.Empty : request.ChassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(request.SapCode) ? string.Empty : request.SapCode });
var _taskid = await _service.ExportEnqueueAsync("", ExportExtentsion.Excel, request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
{ {
}).ConfigureAwait(false);
return _taskid;
}
/// <summary>
///发票与结算核对明细表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("InvoiceSettledDetailDiff-Make")]
[DisableRequestSizeLimit]
[UnitOfWork(IsDisabled = false)]
public async Task<string> InvoiceSettledDetailDiffMake(
BaseRequestDto request
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(request.Version) ? string.Empty : request.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(request.MaterialCode) ? string.Empty : request.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(request.Begin) ? string.Empty : request.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(request.End) ? string.Empty : request.End });
customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(request.Cp7Begin) ? string.Empty : request.Cp7Begin });
customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(request.Cp7End) ? string.Empty : request.Cp7End });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(request.Kenncode) ? string.Empty : request.Kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(request.ChassisNumber) ? string.Empty : request.ChassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(request.SapCode) ? string.Empty : request.SapCode });
var _taskid = await _service.ExportEnqueueAsync("准时化结算核对明细", ExportExtentsion.Excel, request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
{
}).ConfigureAwait(false);
return _taskid;
}
/// <summary>
///3.准时化结算数量差异比对表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("UnInvoiceSettledDetailDiff-Make")]
[DisableRequestSizeLimit]
[UnitOfWork(IsDisabled = false)]
public async Task<string> UnInvoiceSettledDetailDiffMake(
BaseRequestDto request
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(request.Version) ? string.Empty : request.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(request.MaterialCode) ? string.Empty : request.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(request.Begin) ? string.Empty : request.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(request.End) ? string.Empty : request.End });
customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(request.Cp7Begin) ? string.Empty : request.Cp7Begin });
customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(request.Cp7End) ? string.Empty : request.Cp7End });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(request.Kenncode) ? string.Empty : request.Kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(request.ChassisNumber) ? string.Empty : request.ChassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(request.SapCode) ? string.Empty : request.SapCode });
var _taskid = await _service.ExportEnqueueAsync("准时化结算数量差异比对输出", ExportExtentsion.Excel, request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(UnInvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
{
}).ConfigureAwait(false);
return _taskid;
}
/// <summary>
/// 准时化未结明细表(包含漏结,漏结要有标识)
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("UnsettledDetailReportService-Make")]
[DisableRequestSizeLimit]
[UnitOfWork(IsDisabled = false)]
public async Task<string> UnsettledDetailReportServiceMake(
BaseRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = !string.IsNullOrEmpty(input.Version) ? input.Version : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = !string.IsNullOrEmpty(input.MaterialCode) ? input.MaterialCode : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = !string.IsNullOrEmpty(input.MaterialGroup) ? input.MaterialGroup : string.Empty });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = string.Empty });
customConditionList.Add(new CustomCondition() { Name = "Begin", Value = string.IsNullOrEmpty(input.Begin) ? string.Empty : input.Begin });
customConditionList.Add(new CustomCondition() { Name = "End", Value = string.IsNullOrEmpty(input.End) ? string.Empty : input.End });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("准时化未结明细表", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(UnsettledDetailReportService), customConditionList, (rs) =>
{
}).ConfigureAwait(false);
return _taskid;
}
/// <summary>
///准时化未结差异比对表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("UnSettleDiffExport-Make")]
[DisableRequestSizeLimit]
public async Task<string> UnSettleDiffExportServiceMake(
BaseRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
var _taskid = await _service.ExportEnqueueAsync("准时化未结差异比对输出", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(UnSettleDiffExportService), customConditionList, (rs) =>
{
}).ConfigureAwait(false); }).ConfigureAwait(false);
return _taskid; return _taskid;
} }
/// <summary>
///统计汇总表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[Route("WmsOutputSumExport-Make")]
[DisableRequestSizeLimit]
public async Task<string> WmsOutputSumExport(
BaseRequestDto input
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
customConditionList.Add(new CustomCondition() { Name = "State", Value = string.IsNullOrEmpty(input.State) ? string.Empty : input.State });
var _taskid = await _service.ExportEnqueueAsync("出库单合计汇总输出", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(WmsOutputSumExportService), customConditionList, (rs) =>
{
}).ConfigureAwait(false);
return _taskid;
}
///// <summary>
///// 结算总成和ERP总成价格对比
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpGet]
//[Route("SettledPartAndErpPartPriceDiff-Make")]
//[DisableRequestSizeLimit]
//public async Task<string> SettledPartAndErpPartPriceDiffMake( string version, string customerCode)
//{
// if (!_relationshipRepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
// {
// throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version));
// }
// if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
// {
// throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version));
// }
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "结算总成和ERP总成价格对比" });
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version??string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode });
// var _taskid = await _service.ExportEnqueueAsync("结算总成和ERP总成价格对比", ExportExtentsion.Excel,version,string.Empty,CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
///// 结算总成和ERP总成价格对比
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpGet]
//[Route("SecMatchBaseMake-Make")]
//[DisableRequestSizeLimit]
//public async Task<string> SecMatchBaseMake(string version)
//{
// if (!_relationshipRepository.Any(p => p.Version == version ))
// {
// throw new BusinessException("8989", string.Format("不存总成与结算件零件关系{0}期间", version));
// }
// //if (!_settlementPartVersionrepository.Any(p => p.Version == version && p.CustomerCode == customerCode))
// //{
// // throw new BusinessException("8989", string.Format("不存结算包价格{0}期间", version));
// //}
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "二配当月结算表" });
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty });
// //customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = customerCode });
// var _taskid = await _service.ExportEnqueueAsync("二配当月结算表", ExportExtentsion.Excel, CurrentUser, typeof(SecMatchBaseExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
//#region 红旗、一汽轿车的输出报表
///// <summary>
/////红旗工厂核对明细
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("HQHSettledDetailDiffExportService")]
//[DisableRequestSizeLimit]
//[UnitOfWork(IsDisabled = false)]
//public async Task<string> HQHSettledDetailDiffExportServiceMake(
// HQKanbanRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
// customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// var _taskid = await _service.ExportEnqueueAsync("红旗工厂核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHSettledDetailDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
/////红旗工厂未结明细
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("HQHUnSettledDetailDiffExportService")]
//[DisableRequestSizeLimit]
//public async Task<string> HQHUnSettledDetailDiffExportServiceMake(
// HQKanbanRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
// customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion });
// var _taskid = await _service.ExportEnqueueAsync("红旗工厂未结明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHUnSettledDetailDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
/////红旗未结核对
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("HQFactoryUnSettledDetailDiffExportService")]
//[DisableRequestSizeLimit]
//public async Task<string> HQFactoryUnSettledDetailDiffExportService(
// HQKanbanRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
// customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// customConditionList.Add(new CustomCondition() { Name = "IsContainVersion", Value = input.IsContainVersion });
// var _taskid = await _service.ExportEnqueueAsync("红旗未结核对", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQFactoryUnSettledDetailDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
///// 红旗工厂备件明细
///// </summary>
///// <param name="input"></param>
///// <returns></returns>
//[HttpPost]
//[Route("HQHSharePartSettledDetailDiffExportService")]
//[DisableRequestSizeLimit]
//public async Task<string> HQHSharePartSettledDetailDiffExportServiceMake(
// HQKanbanRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = input.MaterialCode });
// customConditionList.Add(new CustomCondition() { Name = "AcceptNo", Value = input.AcceptNo });
// customConditionList.Add(new CustomCondition() { Name = "WarehouseDesc", Value = input.WarehouseDesc });
// customConditionList.Add(new CustomCondition() { Name = "Kanban", Value = input.Kanban });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// var _taskid = await _service.ExportEnqueueAsync("H平台备件核对明细", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(HQHSharePartSettledDetailDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
//[HttpPost]
//[Route("FisUpdateExportService")]
//[DisableRequestSizeLimit]
//[UnitOfWork(isTransactional: false)]
//public async Task<string> FisUpdateExportServiceMake(
// HQKanbanRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = input.Version });
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = input.End });
// var _taskid = await _service.ExportEnqueueAsync("Fis发货数据更新状态", ExportExtentsion.Excel, input.Version, null, CurrentUser, typeof(FisUpdateExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
///// <summary>
///// 结算未结寄售核对表
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("UnSettledSum-Make")]
//[DisableRequestSizeLimit]
//[UnitOfWork(IsDisabled = false)]
//public async Task<string> UnSettledSumServiceMake(
// BaseRequestDto input
// )
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = !string.IsNullOrEmpty(input.Version) ? input.Version : string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "CustomerCode", Value = string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = !string.IsNullOrEmpty(input.MaterialCode) ? input.MaterialCode : string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = !string.IsNullOrEmpty(input.MaterialGroup) ? input.MaterialGroup : string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = string.Empty });
// customConditionList.Add(new CustomCondition() { Name = "Begin", Value = string.IsNullOrEmpty(input.Begin) ? string.Empty : input.Begin });
// customConditionList.Add(new CustomCondition() { Name = "End", Value = string.IsNullOrEmpty(input.End) ? string.Empty : input.End });
// customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(input.Kenncode) ? string.Empty : input.Kenncode });
// customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(input.ChassisNumber) ? string.Empty : input.ChassisNumber });
// customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(input.SapCode) ? string.Empty : input.SapCode });
// var _taskid = await _service.ExportEnqueueAsync("结算未结寄售核对表", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(UnSettledSumService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
//#endregion
} }
} }

373
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/BalanceSum/BalanceSumDapperRepository.cs

@ -0,0 +1,373 @@
using System.Collections.Generic;
using System.Linq;
using Dapper;
using Magicodes.ExporterAndImporter.Core;
using SettleAccount.Domain.BQ;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories.Dapper;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Temp;
namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
public class Meta
{
public class SettleInvoiceDiff
{
[ExporterHeader(DisplayName = "零件号", IsBold = true)]
public string MaterialCode { set; get; }
[ExporterHeader(DisplayName = "零件名称", IsBold = true)]
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "全年发票合计", IsBold = true)]
public string SumInvoice { set; get; }
[ExporterHeader(DisplayName = "全年结算合计", IsBold = true)]
public string SumSettle { set; get; }
[ExporterHeader(DisplayName = "全年合计差异", IsBold = true)]
public string SumDiff { set; get; }
[ExporterHeader(DisplayName = "1月发票", IsBold = true)]
public string January { set; get; }
[ExporterHeader(DisplayName = "1月结算", IsBold = true)]
public string SettleJanuary { set; get; }
[ExporterHeader(DisplayName = "2月发票", IsBold = true)]
public string InvoiceFebruary { set; get; }
[ExporterHeader(DisplayName = "2月结算", IsBold = true)]
public string SettleFebruary { set; get; }
[ExporterHeader(DisplayName = "3月发票", IsBold = true)]
public string InvoiceMarch { set; get; }
[ExporterHeader(DisplayName = "3月结算", IsBold = true)]
public string SettleMarch { set; get; }
[ExporterHeader(DisplayName = "4月发票", IsBold = true)]
public string InvoiceApril { set; get; }
[ExporterHeader(DisplayName = "4月结算", IsBold = true)]
public string SettleApril { set; get; }
[ExporterHeader(DisplayName = "5月发票", IsBold = true)]
public string InvoiceMay { set; get; }
[ExporterHeader(DisplayName = "5月结算", IsBold = true)]
public string SettleMay { set; get; }
[ExporterHeader(DisplayName = "6月发票", IsBold = true)]
public string InvoiceJune { set; get; }
[ExporterHeader(DisplayName = "6月结算", IsBold = true)]
public string SettleJune { set; get; }
[ExporterHeader(DisplayName = "7月发票", IsBold = true)]
public string InvoiceJuly { set; get; }
[ExporterHeader(DisplayName = "7月结算", IsBold = true)]
public string SettleJuly { set; get; }
[ExporterHeader(DisplayName = "8月发票", IsBold = true)]
public string InvoiceAugust { set; get; }
[ExporterHeader(DisplayName = "8月结算", IsBold = true)]
public string SettleAugust { set; get; }
[ExporterHeader(DisplayName = "9月发票", IsBold = true)]
public string InvoiceSeptember { set; get; }
[ExporterHeader(DisplayName = "9月结算", IsBold = true)]
public string SettleSeptember { set; get; }
[ExporterHeader(DisplayName = "10月发票", IsBold = true)]
public string InvoiceOctober { set; get; }
[ExporterHeader(DisplayName = "10月结算", IsBold = true)]
public string SettleOctober { set; get; }
[ExporterHeader(DisplayName = "11月发票", IsBold = true)]
public string InvoiceNovember { set; get; }
[ExporterHeader(DisplayName = "11月结算", IsBold = true)]
public string DiffNovember { set; get; }
[ExporterHeader(DisplayName = "12月发票", IsBold = true)]
public string InvoiceDecember { set; get; }
[ExporterHeader(DisplayName = "12月结算", IsBold = true)]
public string SettleDecember { set; get; }
}
}
/// <summary>
/// 2.大众发票与结算核对明细表-准时化
/// </summary>
public class BalanceSumDapperRepository : DapperRepository<SettleAccountDbContext>, ITransientDependency
{
public BalanceSumDapperRepository(IDbContextProvider<SettleAccountDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
/// <summary>
/// 获取库存余额汇总
/// </summary>
/// <param name="p_year"></param>
/// <returns></returns>
public virtual object GetBalanceSum(string p_year)
{
var sql = "declare @lastyear as varchar(50)\n" +
"declare @lastTime as varchar(50)\n" +
"declare @BeforeYear as varchar(50)\n" +
"Set @lastyear='{0}'\n" +
"Set @BeforeYear=CAST(@lastyear as int)-1\n" +
"Set @lastTime=dateadd(ms,-3,DATEADD(yy,DATEDIFF(yy,0,@lastyear+'01'+'01')+1, 0))\n" +
"select * into #temp_js from (\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'01' version1 from (\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@BeforeYear+'-12-26 08:00:00' AND BillTime<=@lastyear+'-01-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'02' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-01-26 08:00:00' AND BillTime<=@lastyear+'-02-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'03' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-02-26 08:00:00' AND BillTime<=@lastyear+'-03-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'04' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-03-26 08:00:00' AND BillTime<=@lastyear+'-04-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'05' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-04-26 08:00:00' AND BillTime<=@lastyear+'-05-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'06' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-05-26 08:00:00' AND BillTime<=@lastyear+'-06-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'07' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-06-26 08:00:00' AND BillTime<=@lastyear+'-07-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'09' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-07-26 08:00:00' AND BillTime<=@lastyear+'-08-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'09' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-08-26 08:00:00' AND BillTime<=@lastyear+'-09-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"union all\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'10' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-09-26 08:00:00' AND BillTime<=@lastyear+'-10-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"union all\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'11' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-10-26 08:00:00' AND BillTime<=@lastyear+'-11-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"union all\n" +
"select sum(changedQty) changedqty,RealPartCode,ErpToLoc,@lastyear+'12' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-11-26 08:00:00' AND BillTime<=@lastyear+'-12-26 07:59:59' and (LogType>200 OR LogType<200)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"union all\n" +
"select sum(changedQty) changedqty,RealPartCode,ErpToLoc, version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc,FORMAT(BillTime,'yyyyMM') version1\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where LogType=200\n" +
") a group by RealPartCode,ErpToLoc,version1\n" +
") temp\n" +
"PIVOT ( SUM( changedqty )\n" +
"FOR VERSION1 IN ([{0}01],[{0}02],[{0}03],[{0}04],[{0}05],[{0}06],[{0}07],[{0}08],[{0}09],[{0}10],[{0}11],[{0}12]) ) b\n" +
"select * into #temp_bh from (\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'01' version1 from (\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@BeforeYear+'-12-26 08:00:00' AND BillTime<=@lastyear+'-01-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'02' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-01-26 08:00:00' AND BillTime<=@lastyear+'-02-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'03' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-02-26 08:00:00' AND BillTime<=@lastyear+'-03-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'04' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-03-26 08:00:00' AND BillTime<=@lastyear+'-04-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'05' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-04-26 08:00:00' AND BillTime<=@lastyear+'-05-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'06' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-05-26 08:00:00' AND BillTime<=@lastyear+'-06-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'07' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-06-26 08:00:00' AND BillTime<=@lastyear+'-07-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'08' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-07-26 08:00:00' AND BillTime<=@lastyear+'-08-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"UNION ALL\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'09' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-08-26 08:00:00' AND BillTime<=@lastyear+'-09-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"union all\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'10' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-09-26 08:00:00' AND BillTime<=@lastyear+'-10-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"union all\n" +
"select sum(changedQty) ChangedQty,RealPartCode,ErpToLoc,@lastyear+'11' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-10-26 08:00:00' AND BillTime<=@lastyear+'-11-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"union all\n" +
"select sum(changedQty) changedqty,RealPartCode,ErpToLoc,@lastyear+'12' version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where BillTime>=@lastyear+'-11-26 08:00:00' AND BillTime<=@lastyear+'-12-26 07:59:59' and (LogType=500)\n" +
") a group by RealPartCode,ErpToLoc\n" +
"union all\n" +
"select sum(changedQty) changedqty,RealPartCode,ErpToLoc, version1 from\n" +
"(\n" +
"SELECT ChangedQty,RealPartCode,ErpToLoc,FORMAT(BillTime,'yyyyMM') version1\n" +
"FROM [BQ_SA].[dbo].[Set_VmiLog] where LogType=200 and ReMark ='有结算无发运'\n" +
") a group by RealPartCode,ErpToLoc,version1\n" +
") temp\n" +
"\n" +
"PIVOT ( SUM( changedqty )\n" +
"FOR VERSION1 IN ([{0}01],[{0}02],[{0}03],[{0}04],[{0}05],[{0}06],[{0}07],[{0}08],[{0}09],[{0}10],[{0}11],[{0}12]) ) b\n" +
"select\n" +
"isnull(a.ErpToLoc,b.ErpToLoc) ErpToLoc,\n" +
"Isnull(b.RealPartCode,a.RealPartCode) RealPartCode,\n" +
"isnull(a.[{0}01],0)+\n" +
"isnull(a.[{0}02],0)+\n" +
"isnull(a.[{0}03],0)+\n" +
"isnull(a.[{0}04],0)+\n" +
"isnull(a.[{0}05],0)+\n" +
"isnull(a.[{0}06],0)+\n" +
"isnull(a.[{0}07],0)+\n" +
"isnull(a.[{0}08],0)+\n" +
"isnull(a.[{0}09],0)+\n" +
"isnull(a.[{0}10],0)+\n" +
"isnull(a.[{0}11],0)+\n" +
"isnull(a.[{0}12],0) 库存余额数量,\n" +
"isnull(b.[{0}01],0) +\n" +
"isnull(b.[{0}02],0) +\n" +
"isnull(b.[{0}03],0) +\n" +
"isnull(b.[{0}04],0) +\n" +
"isnull(b.[{0}05],0) +\n" +
"isnull(b.[{0}06],0) +\n" +
"isnull(b.[{0}07],0) +\n" +
"isnull(b.[{0}08],0) +\n" +
"isnull(b.[{0}09],0) +\n" +
"isnull(b.[{0}10],0) +\n" +
"isnull(b.[{0}11],0) +\n" +
"isnull(b.[{0}12],0) 有结无发合计,\n" +
"isnull(a.[{0}01],0) [{0}01],isnull(b.[{0}01],0) [有结无发],\n" +
"isnull(a.[{0}02],0) [{0}02],isnull(b.[{0}02],0) [有结无发],\n" +
"isnull(a.[{0}03],0) [{0}03],isnull(b.[{0}03],0) [有结无发],\n" +
"isnull(a.[{0}04],0) [{0}04],isnull(b.[{0}04],0) [有结无发],\n" +
"isnull(a.[{0}05],0) [{0}05],isnull(b.[{0}05],0) [有结无发],\n" +
"isnull(a.[{0}06],0) [{0}06],isnull(b.[{0}06],0) [有结无发],\n" +
"isnull(a.[{0}07],0) [{0}07],isnull(b.[{0}07],0) [有结无发],\n" +
"isnull(a.[{0}08],0) [{0}08],isnull(b.[{0}08],0) [有结无发],\n" +
"isnull(a.[{0}09],0) [{0}09],isnull(b.[{0}09],0) [有结无发],\n" +
"isnull(a.[{0}10],0) [{0}10],isnull(b.[{0}10],0) [有结无发],\n" +
"isnull(a.[{0}11],0) [{0}11],isnull(b.[{0}11],0) [有结无发],\n" +
"isnull(a.[{0}12],0) [{0}12],isnull(b.[{0}12],0) [有结无发] \n" +
"from #temp_js a full join #temp_bh b on a.ErpToLoc=b.ErpToLoc and a.RealPartCode=b.RealPartCode\n" +
"drop table #temp_js\n" +
"drop table #temp_bh\n";
var query = string.Format(sql, p_year);
var list = DbConnection.Query(query,null,null,false,1200,null);
return "";
}
}
}

118
code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/PD_SERVICE.cs

@ -13,13 +13,13 @@ namespace SettleAccount.Job.Services
{ {
public class PD_SERVICE : ITransientDependency, IExportJob public class PD_SERVICE : ITransientDependency, IExportJob
{ {
private readonly PendingDeductionDapperRepository _dapper; private readonly BalanceSumDapperRepository _dapper;
//private readonly BBAC_PD_MNG _pdmng; //private readonly BBAC_PD_MNG _pdmng;
readonly IServiceProvider _serviceProvider; readonly IServiceProvider _serviceProvider;
public PD_SERVICE( public PD_SERVICE(
PendingDeductionDapperRepository dapper, BalanceSumDapperRepository dapper,
//BBAC_PD_MNG pdmng, //BBAC_PD_MNG pdmng,
IServiceProvider serviceProvider IServiceProvider serviceProvider
@ -41,68 +41,68 @@ namespace SettleAccount.Job.Services
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> customConditions) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> customConditions)
{ {
var invgroup = customConditions.Where(p => p.Name == "InvGroupNum").FirstOrDefault().Value;//获取发票分 //var invgroup = customConditions.Where(p => p.Name == "InvGroupNum").FirstOrDefault().Value;//获取发票分
var ls = _dapper.GetInvoiceList(invgroup); //var ls = _dapper.GetInvoiceList(invgroup);
if (ls != null && ls.Count > 0) //if (ls != null && ls.Count > 0)
{ //{
var first = ls.FirstOrDefault(); // var first = ls.FirstOrDefault();
if (first.BusinessType == EnumBusinessType.JisHBPO) // if (first.BusinessType == EnumBusinessType.JisHBPO)
{ // {
var pd = _dapper.GenerationPendingDeductionHBPO(invgroup); // var pd = _dapper.GenerationPendingDeductionHBPO(invgroup);
if (pd.Count > 0) // if (pd.Count > 0)
{ // {
foreach (var c in pd) // foreach (var c in pd)
{ // {
var main = c.Key; // var main = c.Key;
var detail = c.Value; // var detail = c.Value;
//_invRepository.GetDbContext().BulkInsert(new List<HBPO_PD>() { main }); // //_invRepository.GetDbContext().BulkInsert(new List<HBPO_PD>() { main });
//_invRepository.GetDbContext().BulkInsert(detail); // //_invRepository.GetDbContext().BulkInsert(detail);
} // }
} // }
else // else
{ // {
} // }
} // }
else if (first.BusinessType == EnumBusinessType.JisBBAC) // else if (first.BusinessType == EnumBusinessType.JisBBAC)
{ // {
var pd = _dapper.GenerationPendingDeductionBBAC(invgroup); // var pd = _dapper.GenerationPendingDeductionBBAC(invgroup);
if (pd.Count > 0) // if (pd.Count > 0)
{ // {
foreach (var c in pd) // foreach (var c in pd)
{ // {
var main = c.Key; // var main = c.Key;
var detail = c.Value; // var detail = c.Value;
//_pdmng.InsertDetail(detail); // //_pdmng.InsertDetail(detail);
//_pdmng.InsertMain(main); // //_pdmng.InsertMain(main);
} // }
} // }
else // else
{ // {
} // }
} // }
else // else
{ // {
var pd = _dapper.GenerationPendingDeductionPUB(invgroup); // var pd = _dapper.GenerationPendingDeductionPUB(invgroup);
if (pd.Count > 0) // if (pd.Count > 0)
{ // {
foreach (var c in pd) // foreach (var c in pd)
{ // {
var main = c.Key; // var main = c.Key;
var detail = c.Value; // var detail = c.Value;
//_invRepository.DbContext.BulkInsert(new List<PUB_PD>() { main }); // //_invRepository.DbContext.BulkInsert(new List<PUB_PD>() { main });
//_invRepository.DbContext.BulkInsert(detail); // //_invRepository.DbContext.BulkInsert(detail);
} // }
} // }
else // else
{ // {
} // }
} // }
} //}
return id.ToString(); return id.ToString();
} }

Loading…
Cancel
Save