mahao
1 year ago
7 changed files with 252 additions and 42 deletions
@ -0,0 +1,88 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.OpenApi.Extensions; |
||||
|
using SettleAccount.Job.Services.Report; |
||||
|
using TaskJob.EventArgs; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
using Win.Sfs.SettleAccount.Entities.BQ.Dtos; |
||||
|
using Win.Sfs.SettleAccount.Entities.TaskJobs; |
||||
|
|
||||
|
namespace Win.Sfs.SettleAccount.Entities.BQ; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Edi与发运对比服务
|
||||
|
/// </summary>
|
||||
|
[AllowAnonymous] |
||||
|
[Route("api/settleaccount/[controller]/[action]")]
|
||||
|
public class EdiSeCompareService : ApplicationService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 任务服务
|
||||
|
/// </summary>
|
||||
|
private readonly TaskJobService _taskJobService; |
||||
|
|
||||
|
public EdiSeCompareService(TaskJobService taskJobService) |
||||
|
{ |
||||
|
_taskJobService = taskJobService; |
||||
|
} |
||||
|
|
||||
|
#region 对比
|
||||
|
/// <summary>
|
||||
|
/// BBACEdi与发运比对
|
||||
|
/// </summary>
|
||||
|
[HttpPost] |
||||
|
public async Task<string> BBACEdiSeCompare(PubSaSeCompareRequestDto pubSaSeCompareRequestDto) |
||||
|
{ |
||||
|
var businessTypeDisplayName = pubSaSeCompareRequestDto.BusinessType.ToString(); |
||||
|
DisplayAttribute attributeOfType = pubSaSeCompareRequestDto.BusinessType.GetAttributeOfType<DisplayAttribute>(); |
||||
|
if (attributeOfType != null) |
||||
|
{ |
||||
|
businessTypeDisplayName = attributeOfType.Name; |
||||
|
} |
||||
|
var projectName = $"{businessTypeDisplayName}结算与发运数据对比"; |
||||
|
|
||||
|
List<CustomCondition> customConditionList = new List<CustomCondition>(); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "Version", Value = pubSaSeCompareRequestDto.Version }); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)pubSaSeCompareRequestDto.BusinessType).ToString() }); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "LU", Value = pubSaSeCompareRequestDto.LU }); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "PN", Value = pubSaSeCompareRequestDto.PN }); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName }); |
||||
|
|
||||
|
var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(BBACEdiSeCompareExportService), customConditionList, (rs) => |
||||
|
{ |
||||
|
}); |
||||
|
return _taskid; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// HBPOEdi与发运比对
|
||||
|
/// </summary>
|
||||
|
[HttpPost] |
||||
|
public async Task<string> HBPOEdiSeCompare(PubSaSeCompareRequestDto pubSaSeCompareRequestDto) |
||||
|
{ |
||||
|
var businessTypeDisplayName = pubSaSeCompareRequestDto.BusinessType.ToString(); |
||||
|
DisplayAttribute attributeOfType = pubSaSeCompareRequestDto.BusinessType.GetAttributeOfType<DisplayAttribute>(); |
||||
|
if (attributeOfType != null) |
||||
|
{ |
||||
|
businessTypeDisplayName = attributeOfType.Name; |
||||
|
} |
||||
|
var projectName = $"{businessTypeDisplayName}结算与发运数据对比"; |
||||
|
|
||||
|
List<CustomCondition> customConditionList = new List<CustomCondition>(); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "Version", Value = pubSaSeCompareRequestDto.Version }); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)pubSaSeCompareRequestDto.BusinessType).ToString() }); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "LU", Value = pubSaSeCompareRequestDto.LU }); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "PN", Value = pubSaSeCompareRequestDto.PN }); |
||||
|
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName }); |
||||
|
|
||||
|
var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, pubSaSeCompareRequestDto.Version, string.Empty, CurrentUser, typeof(HBPOEdiSeCompareExportService), customConditionList, (rs) => |
||||
|
{ |
||||
|
}); |
||||
|
return _taskid; |
||||
|
} |
||||
|
#endregion
|
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using TaskJob.EventArgs; |
||||
|
using TaskJob.Interfaces; |
||||
|
using Volo.Abp.BlobStoring; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.ObjectMapping; |
||||
|
using Win.Sfs.BaseData.ImportExcelCommon; |
||||
|
|
||||
|
namespace SettleAccount.Job.Services.Report |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// BBACEdi与发运对比导出服务
|
||||
|
/// </summary>
|
||||
|
public class BBACEdiSeCompareExportService : ITransientDependency, IExportJob |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 文件容器
|
||||
|
/// </summary>
|
||||
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// AutoMapper
|
||||
|
/// </summary>
|
||||
|
private readonly IObjectMapper _objectMapper; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public BBACEdiSeCompareExportService( |
||||
|
IBlobContainer<MyFileContainer> fileContainer, |
||||
|
IObjectMapper objectMapper) |
||||
|
{ |
||||
|
_fileContainer = fileContainer; |
||||
|
_objectMapper = objectMapper; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导出
|
||||
|
/// </summary>
|
||||
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
||||
|
{ |
||||
|
return ""; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using TaskJob.EventArgs; |
||||
|
using TaskJob.Interfaces; |
||||
|
using Volo.Abp.BlobStoring; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
using Volo.Abp.ObjectMapping; |
||||
|
using Win.Sfs.BaseData.ImportExcelCommon; |
||||
|
|
||||
|
namespace SettleAccount.Job.Services.Report |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// HBPOEdi与发运对比导出服务
|
||||
|
/// </summary>
|
||||
|
public class HBPOEdiSeCompareExportService : ITransientDependency, IExportJob |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 文件容器
|
||||
|
/// </summary>
|
||||
|
private readonly IBlobContainer<MyFileContainer> _fileContainer; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// AutoMapper
|
||||
|
/// </summary>
|
||||
|
private readonly IObjectMapper _objectMapper; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造
|
||||
|
/// </summary>
|
||||
|
public HBPOEdiSeCompareExportService( |
||||
|
IBlobContainer<MyFileContainer> fileContainer, |
||||
|
IObjectMapper objectMapper) |
||||
|
{ |
||||
|
_fileContainer = fileContainer; |
||||
|
_objectMapper = objectMapper; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 导出
|
||||
|
/// </summary>
|
||||
|
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property) |
||||
|
{ |
||||
|
return ""; |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue