Browse Source

Merge branch 'master' of http://dev.ccwin-in.com:6090/Win.Sfs.SmartSettlementSystem.PG

# Conflicts:
#	src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211214.txt
branch_ccpg_220107
44673626 3 years ago
parent
commit
8275560270
  1. BIN
      .vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo
  2. 1041
      src/.vs/SettleAccount/config/applicationhost.config
  3. 12639
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211215.txt
  4. 4229
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211216.txt
  5. 10345
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.Designer.cs
  6. 4385
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.cs
  7. 3
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs
  8. 4
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  9. 3
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobDto.cs
  10. 3
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobRequstDto.cs
  11. 9
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs
  12. 95
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/TaskList.cs
  13. 25
      src/Modules/SettleAccount/src/SettleAccount.Application/Jobs/TaskJobService.cs
  14. 91
      src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs
  15. 45
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  16. 6
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/Job.cs
  17. 4
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJob.cs
  18. 9
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs
  19. 11
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs
  20. 3
      src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDbProperties.cs
  21. 7
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ISettleAccountDbContext.cs
  22. 22
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs
  23. 4
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  24. 7
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs
  25. 216
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs
  26. 7
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskDapperRepository.cs
  27. 64
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs
  28. 89
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs
  29. 48
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs
  30. 87
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs
  31. 31
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs
  32. 1
      src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs
  33. BIN
      src/Shared/Win.Abp.Snowflakes/obj/Debug/netcoreapp5/Win.Abp.Snowflakes.assets.cache
  34. BIN
      src/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.assets.cache
  35. BIN
      src/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.assets.cache
  36. 10
      vue/src/router/index.js

BIN
.vs/Win.Sfs.SmartSettlementSystem.PG/v16/.suo

Binary file not shown.

1041
src/.vs/SettleAccount/config/applicationhost.config

File diff suppressed because it is too large

12639
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211215.txt

File diff suppressed because it is too large

4229
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Logs/log-20211216.txt

File diff suppressed because it is too large

10345
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.Designer.cs

File diff suppressed because it is too large

4385
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/20211129095823_init.cs

File diff suppressed because it is too large

3
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs

@ -63,15 +63,12 @@ namespace Win.Sfs.SettleAccount
typeof(AbpAutofacModule),
//typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpBlobStoringModule),
typeof(AbpBlobStoringFileSystemModule),
typeof(AbpBackgroundJobsHangfireModule)
//typeof(AbpEventBusRabbitMqModule)

4
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -10,7 +10,9 @@
//"Default": "Server=127.0.0.1;Database=ABP;user id=sa;Password=1",
//"SettleAccountService": "Server=127.0.0.1;Database=SettleAccountService;user id=sa;Password=1;"
"Default": "Server=192.168.0.140;Database=ABP;User ID=sa;Password=Microsoft2008;",
"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;"
"SettleAccountService": "Server=192.168.0.140;Database=SettleAccountService;user id=sa;password=Microsoft2008;",
"WmsService": "Server=192.168.0.140;Database=CPAT_WMS_TEST;user id=sa;password=Microsoft2008;"
},
"Logging": {
"LogLevel": {

3
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobDto.cs

@ -37,7 +37,8 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
/// </summary>
public string RealDownFileName { set; get; }
public string ServiceName { set; get; }
public string Type { set; get; }
public string Remark { set; get; }
}
}

3
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobRequstDto.cs

@ -28,7 +28,8 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
public string FileName { set; get; }
public string DownFileName { set; get; }
public string ServiceName { set; get; }
public string Type { set; get; }
public string Remark { set; get; }
}
}

9
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs

@ -81,7 +81,14 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
}
[HttpPost]
[Route("versionlist")]
//[Authorize(SettleAccountPermissions.Materials.Default)]
[UnitOfWork(false)]
virtual public async Task<List<string>> GetVersionListAsync()
{
return await _service.GetVersionListAsync();
}

95
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/WMS/TaskList.cs

@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.WMS
{
public partial class TS_UNI_API: FullAuditedAggregateRootBase<Guid>
{
public TS_UNI_API(string interfaceType, string version, string tableName, int? billType, int? subBillType, string sourceBillNum)
{
InterfaceType = interfaceType;
Version = version;
TableName = tableName;
BillType = billType;
SubBillType = subBillType;
SourceBillNum = sourceBillNum;
}
/// <summary>
/// 接口类型
/// </summary>
public string InterfaceType { get; set; }
/// <summary>
/// 版本号
/// </summary>
public string Version { get; set; }
/// <summary>
/// 表明
/// </summary>
public string TableName { get; set; }
/// <summary>
/// 单据类型
/// </summary>
public int? BillType { get; set; }
/// <summary>
/// 子单据类型
/// </summary>
public int? SubBillType { get; set; }
/// <summary>
/// 原单据类型
/// </summary>
public string SourceBillNum { get; set; }
/// <summary>
/// 状态
/// </summary>
public int State { set; get; }
/// <summary>
/// 状态
/// </summary>
//public int State { set; get; }
}
public class WmsOutPutDetial: FullAuditedAggregateRootBase<Guid>
{
public WmsOutPutDetial(string wmsBillNum, string kennCode, string chassisNumber, string parentMaterialCode, string materialDesc, string materialGroup)
{
WmsBillNum = wmsBillNum;
KennCode = kennCode;
ChassisNumber = chassisNumber;
ParentMaterialCode = parentMaterialCode;
MaterialDesc = materialDesc;
MaterialGroup = materialGroup;
}
//交货单号
public string WmsBillNum{ set; get; }
//KENN号
public string KennCode { set; get; }
//底盘号
public string ChassisNumber { set; get; }
//物料号
public string ParentMaterialCode { set; get; }
//物料描述
public string MaterialDesc { set; get; }
//物料组(车型)
public string MaterialGroup { set; get; }
}
}

25
src/Modules/SettleAccount/src/SettleAccount.Application/Jobs/TaskJobService.cs

@ -60,6 +60,14 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
}
virtual public async Task<List<string>> GetVersionListAsync()
{
return await _mng.GetVersionListAsync();
}
virtual public async Task<List<string>> GetUpFileListAsync(string taskId)
{
return await _taskDapper.GetUpFileAsync(taskId);
@ -87,7 +95,9 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
string.Empty,
input.DownFileName,
string.Empty,
input.ServiceName
input.ServiceName,
input.Type,
input.Remark
);
var _lst = await _taskDapper.GetTaskJobsAsync(_job);
var _dtoList = new List<JobDto>();
@ -113,6 +123,8 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
_dto.RealFileName = itm.RealFileName;
_dto.RealDownFileName = itm.RealDownFileName;
_dto.ServiceName = itm.ServiceName;
_dto.Type = itm.Type;
_dto.Remark = itm.Remark;
_dtoList.Add(_dto);
}
return _dtoList;
@ -181,7 +193,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
{
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
await _mng.CreateAsync(new TaskJob(_id, _taskId, currentApplicationName, "导入", string.Empty, user.Name, user.Email,JsonSerializer.Serialize(fileNameList,options), JsonSerializer.Serialize(fileNameList,options), string.Empty, string.Empty, _serviceName));
await _mng.CreateAsync(new TaskJob(_id, _taskId, currentApplicationName, "导入", string.Empty, user.Name, user.Email,JsonSerializer.Serialize(fileNameList,options), JsonSerializer.Serialize(fileNameList,options), string.Empty, string.Empty, _serviceName,string.Empty,string.Empty));
args.TaskId = _taskId;
if (endaction != null)
{
@ -198,7 +210,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
/// <param name="moudle">执行队列实现模块类名</param>
/// <param name="action">生成任务后回调函数</param>
/// <returns></returns>
public async Task<string> ExportEnqueueAsync(string currentApplicationName,ExportExtentsion extentsion, ICurrentUser user, Type moudle,List<CustomCondition> customConditions, Action<ExportTaskArgs> action = null)
public async Task<string> ExportEnqueueAsync(string currentApplicationName,ExportExtentsion extentsion,string version,string remark, ICurrentUser user, Type moudle,List<CustomCondition> customConditions, Action<ExportTaskArgs> action = null)
{
if (string.IsNullOrEmpty(currentApplicationName) || user == null || moudle == null)
{
@ -217,8 +229,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
var _serviceName = moudle.FullName;
var guid = Guid.NewGuid();
await _mng.CreateAsync(new TaskJob(guid, string.Empty, currentApplicationName, "导出", string.Empty, user.Name, user.Email, string.Empty, string.Empty, str, str, _serviceName));
await _mng.CreateAsync(new TaskJob(guid,version , currentApplicationName, "导出", string.Empty, user.Name, user.Email, string.Empty, string.Empty, str, str, _serviceName,version,remark));
var args = new ExportTaskArgs()
{
Id=guid,
@ -229,7 +240,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
Email = user.Email,
Name = currentApplicationName,
ServiceName=_serviceName,
InputConditions=customConditions
InputConditions=customConditions,
};
var _taskId=await _backgroundJobManager.EnqueueAsync(args,BackgroundJobPriority.Normal, TimeSpan.FromSeconds(3));
await _mng.ChangeTaskIdAsync(guid, _taskId);
@ -289,7 +300,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs
{
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
await _mng.CreateAsync(new TaskJob(Guid.NewGuid(), _taskId, currentApplicationName, "通知", string.Empty, user.Name, user.Email, JsonSerializer.Serialize(fileNameList,options), JsonSerializer.Serialize(fileNameList,options), string.Empty, string.Empty, _serviceName));
await _mng.CreateAsync(new TaskJob(Guid.NewGuid(), _taskId, currentApplicationName, "通知", string.Empty, user.Name, user.Email, JsonSerializer.Serialize(fileNameList,options), JsonSerializer.Serialize(fileNameList,options), string.Empty, string.Empty, _serviceName,string.Empty,string.Empty));
args.TaskId = _taskId;
if (endaction != null)
{

91
src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs

@ -97,7 +97,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
string cp7end,
string kenncode,
string chassisNumber,
string materialGroup
string materialGroup,
string sapCode
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
@ -110,7 +111,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(kenncode) ? string.Empty : kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup });
var _taskid = await _service.ExportEnqueueAsync("大众准时化结算门板价格差异比对报表", ExportExtentsion.Excel, CurrentUser, typeof(SettleDoorPanelExportService), customConditionList, (rs) =>
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(sapCode) ? string.Empty : sapCode });
var _taskid = await _service.ExportEnqueueAsync("大众准时化结算门板价格差异比对报表", ExportExtentsion.Excel,version,string.Empty, CurrentUser, typeof(SettleDoorPanelExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -147,7 +149,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
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, CurrentUser, typeof(SettleKBWithCodeExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("大众看板结算与交货核对明细表", ExportExtentsion.Excel,version ,string.Empty,CurrentUser, typeof(SettleKBWithCodeExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -185,7 +187,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
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, CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("大众备件结算核对明细表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(SettleSparePartExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -228,7 +230,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
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, CurrentUser, typeof(UnSettledExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("未结算对比", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(UnSettledExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -263,7 +265,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "ERP总成开票报表" });
customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? DateTime.Now.Year.ToString() });
var _taskid = await _service.ExportEnqueueAsync("ERP总成开票报表", ExportExtentsion.Excel, CurrentUser, typeof(fisUnsettledDiffReport), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("ERP总成开票报表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(fisUnsettledDiffReport), customConditionList, (rs) =>
{
});
return _taskid;
@ -304,7 +306,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
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, CurrentUser, typeof(PriceQtyDifferenceExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("价差量差分析报表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(PriceQtyDifferenceExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -340,7 +342,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
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, CurrentUser, typeof(InvoiceSettledDiffExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("大众发票与结算核对汇总表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(InvoiceSettledDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -364,15 +366,16 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
string cp7end,
string kenncode,
string chassisNumber,
List<string> materialGroup
string materialGroup,
string sapCode
)
{
string str1 = string.Empty;
if(materialGroup!=null)
{
//string str1 = string.Empty;
//if(materialGroup!=null)
//{
str1 = string.Join(',', materialGroup.ToArray());
}
// str1 = string.Join(',', materialGroup.ToArray());
//}
List<CustomCondition> customConditionList = new List<CustomCondition>();
@ -384,12 +387,12 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "Cp7EndTime", Value = string.IsNullOrEmpty(cp7end) ? string.Empty : cp7end });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(kenncode) ? string.Empty : kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(str1) ? string.Empty : str1 });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(sapCode) ? string.Empty : sapCode });
var _taskid = await _service.ExportEnqueueAsync("大众发票与结算核对明细表", ExportExtentsion.Excel, CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("大众发票与结算核对明细表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -413,7 +416,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
string cp7end,
string kenncode,
string chassisNumber,
string materialGroup
string materialGroup,
string sapCode
)
{
@ -430,9 +434,9 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
customConditionList.Add(new CustomCondition() { Name = "Mater", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(sapCode) ? string.Empty : sapCode });
var _taskid = await _service.ExportEnqueueAsync("大众结算未发运核对明细表", ExportExtentsion.Excel, CurrentUser, typeof(UnInvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("大众结算未发运核对明细表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(UnInvoiceSettledDetailDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -440,26 +444,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
/// <summary>
/// 3.大众准时化结算数量差异比对表
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
//[HttpGet]
//[Route("SettleFisDiffExport-Make")]
//[DisableRequestSizeLimit]
//public async Task<string> SettleFisDiffExportMake( string version, string materialCode, string begin, string end)
//{
// List<CustomCondition> customConditionList = new List<CustomCondition>();
// customConditionList.Add(new CustomCondition() { Name = "Version", Value = version });
// customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = materialCode});
// customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = begin });
// customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end });
// var _taskid = await _service.ExportEnqueueAsync("大众准时化结算数量差异比对表", ExportExtentsion.Excel, CurrentUser, typeof(SettleFisDiffExportService), customConditionList, (rs) =>
// {
// });
// return _taskid;
//}
/// <summary>
/// 7.大众准时化未结明细表(包含漏结,漏结要有标识)
@ -477,7 +462,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
string end,
string kenncode,
string chassisNumber,
string materialGroup
string materialGroup,
string sapCode
)
{
List<CustomCondition> customConditionList = new List<CustomCondition>();
@ -491,8 +477,8 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "End", Value = !string.IsNullOrEmpty(end)?string.Empty: end });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(kenncode) ? string.Empty : kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
var _taskid = await _service.ExportEnqueueAsync("大众准时化未结明细表", ExportExtentsion.Excel, CurrentUser, typeof(UnsettledDetailReportService), customConditionList, (rs) =>
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(sapCode) ? string.Empty : sapCode });
var _taskid = await _service.ExportEnqueueAsync("大众准时化未结明细表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(UnsettledDetailReportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -528,7 +514,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
string kenncode,
string chassisNumber,
string materialGroup,
string type
string sapCode
)
@ -538,26 +524,15 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = materialCode });
customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = begin });
customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = end });
customConditionList.Add(new CustomCondition() { Name = "Type", Value = type });
customConditionList.Add(new CustomCondition() { Name = "Year", Value = string.Empty });
customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = materialCode });
customConditionList.Add(new CustomCondition() { Name = "SapMaterialCode", Value = string.Empty });
customConditionList.Add(new CustomCondition() { Name = "KennCode", Value = string.IsNullOrEmpty(kenncode) ? string.Empty : kenncode });
customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(chassisNumber) ? string.Empty : chassisNumber });
customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup });
customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(sapCode) ? string.Empty : sapCode });
// var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
//var type = p_list.Where(p => p.Name == "Type").FirstOrDefault().Value;
//var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value;
//var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
//var sapCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value;
//var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value;
//var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var _taskid = await _service.ExportEnqueueAsync("大众准时化未结差异比对表", ExportExtentsion.Excel, CurrentUser, typeof(UnSettleDiffExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("大众准时化未结差异比对表", ExportExtentsion.Excel,version,string.Empty, CurrentUser, typeof(UnSettleDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;
@ -589,7 +564,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices
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, CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
var _taskid = await _service.ExportEnqueueAsync("结算总成和ERP总成价格对比", ExportExtentsion.Excel,version,string.Empty,CurrentUser, typeof(SettledPartAndErpPartPriceDiffExportService), customConditionList, (rs) =>
{
});
return _taskid;

45
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -1728,7 +1728,7 @@
<param name="endaction">加入队列时回调</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.TaskJobs.TaskJobService.ExportEnqueueAsync(System.String,Win.Sfs.SettleAccount.ExportExtentsion,Volo.Abp.Users.ICurrentUser,System.Type,System.Collections.Generic.List{TaskJob.EventArgs.CustomCondition},System.Action{TaskJob.EventArgs.ExportTaskArgs})">
<member name="M:Win.Sfs.SettleAccount.Entities.TaskJobs.TaskJobService.ExportEnqueueAsync(System.String,Win.Sfs.SettleAccount.ExportExtentsion,System.String,System.String,Volo.Abp.Users.ICurrentUser,System.Type,System.Collections.Generic.List{TaskJob.EventArgs.CustomCondition},System.Action{TaskJob.EventArgs.ExportTaskArgs})">
<summary>
导出队列
</summary>
@ -2139,6 +2139,41 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="P:Win.Sfs.SettleAccount.Entities.WMS.TS_UNI_API.InterfaceType">
<summary>
接口类型
</summary>
</member>
<member name="P:Win.Sfs.SettleAccount.Entities.WMS.TS_UNI_API.Version">
<summary>
版本号
</summary>
</member>
<member name="P:Win.Sfs.SettleAccount.Entities.WMS.TS_UNI_API.TableName">
<summary>
表明
</summary>
</member>
<member name="P:Win.Sfs.SettleAccount.Entities.WMS.TS_UNI_API.BillType">
<summary>
单据类型
</summary>
</member>
<member name="P:Win.Sfs.SettleAccount.Entities.WMS.TS_UNI_API.SubBillType">
<summary>
子单据类型
</summary>
</member>
<member name="P:Win.Sfs.SettleAccount.Entities.WMS.TS_UNI_API.SourceBillNum">
<summary>
原单据类型
</summary>
</member>
<member name="P:Win.Sfs.SettleAccount.Entities.WMS.TS_UNI_API.State">
<summary>
状态
</summary>
</member>
<member name="T:Win.Sfs.SettleAccount.FISes.FISAppService">
<summary>
区域相关应用服务
@ -2646,7 +2681,7 @@
<param name="repository">仓储接口</param>
<param name="cache">缓存</param>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.SettleDoorPanel(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.SettleDoorPanel(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
大众准时化结算门板价格差异比对报表
</summary>
@ -2735,21 +2770,21 @@
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.InvoiceSettledDetailDiffMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.Collections.Generic.List{System.String})">
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.InvoiceSettledDetailDiffMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
2.大众发票与结算核对明细表
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnInvoiceSettledDetailDiffMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnInvoiceSettledDetailDiffMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
3.大众准时化结算数量差异比对表
</summary>
<param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnsettledDetailReportServiceMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<member name="M:Win.Sfs.SettleAccount.Reports.ReportServices.ReportService.UnsettledDetailReportServiceMake(System.String,System.String,System.String,System.String,System.String,System.String,System.String,System.String)">
<summary>
7.大众准时化未结明细表(包含漏结,漏结要有标识)
</summary>

6
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/Job.cs

@ -9,7 +9,7 @@ namespace Win.Sfs.SettleAccount.Entities
{
public class Job
{
public Job(Guid id, long stateId, string stateName, string invocationData, string arguments, DateTime createdAt, DateTime? expireAt, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string downFileName, string realDownFileName, string serviceName)
public Job(Guid id, long stateId, string stateName, string invocationData, string arguments, DateTime createdAt, DateTime? expireAt, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string downFileName, string realDownFileName, string serviceName,string type,string remark)
{
Id = id;
StateId = stateId;
@ -29,6 +29,8 @@ namespace Win.Sfs.SettleAccount.Entities
DownFileName = downFileName;
RealDownFileName = realDownFileName;
ServiceName = serviceName;
Type = type;
Remark = remark;
}
public Job()
{ }
@ -141,7 +143,9 @@ namespace Win.Sfs.SettleAccount.Entities
/// </summary>
public string ServiceName { set; get; }
public string Type { set; get; }
public string Remark { set; get; }
}
}

4
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJob.cs

@ -14,7 +14,7 @@ namespace Win.Sfs.SettleAccount.Entities
public TaskJob() { }
public TaskJob(Guid id, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string realDownFileName, string downFileName, string serviceName) : base(id)
public TaskJob(Guid id, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string realDownFileName, string downFileName, string serviceName,string type,string remark) : base(id)
{
TaskId = taskId;
Name = name;
@ -27,6 +27,8 @@ namespace Win.Sfs.SettleAccount.Entities
RealDownFileName = realDownFileName;
DownFileName = downFileName;
ServiceName = serviceName;
Type = type;
Remark = remark;
}

9
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs

@ -65,6 +65,13 @@ namespace Win.Sfs.SettleAccount.Entities
return entities;
}
public virtual async Task<List<string>> GetVersionListAsync()
{
var entities = await _repository.Select(p => p.Type).Distinct().ToListAsync();
return entities;
}
private async Task<long> GetCountAsync(List<FilterCondition> p_filter
, Guid branchId)
{
@ -78,7 +85,7 @@ namespace Win.Sfs.SettleAccount.Entities
public virtual async Task<TaskJob> CreateAsync(TaskJob input)
{
var entity =
new TaskJob(input.Id, input.TaskId, input.Name, input.ActionName, input.Error, input.Creator, input.Email, input.FileName, input.RealFileName, input.RealDownFileName, input.DownFileName, input.ServiceName );
new TaskJob(input.Id, input.TaskId, input.Name, input.ActionName, input.Error, input.Creator, input.Email, input.FileName, input.RealFileName, input.RealDownFileName, input.DownFileName, input.ServiceName,input.Type,input.Remark );
await _repository.InsertAsync( entity ,true);
return _repository.FirstOrDefault(p => p.Id == input.Id);

11
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs

@ -19,7 +19,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle
public override string KENNCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]
public override string ChassisNumber { set; get; }
[ExporterHeader(DisplayName = "交货状态 ")]
[ExporterHeader(DisplayName = "交货状态",IsIgnore =true)]
public override string WmsState { set; get; }
[ExporterHeader(DisplayName = "物料号")]
public override string SapMaterialCode { set; get; }
@ -39,16 +39,11 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle
public override decimal Amt { set; get; }
[ExporterHeader(DisplayName = "结算日期")]
[ExporterHeader(DisplayName = "结算日期",IsIgnore =true)]
public override DateTime CP7Time { set; get; }
[ExporterHeader(DisplayName = "开票单价")]
[ExporterHeader(DisplayName = "开票单价",IsIgnore =true)]
public override decimal InvoicePrice { set; get; }
[ExporterHeader(DisplayName = "结算平台未结数量 ")]
public decimal Qty { set; get; }

3
src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDbProperties.cs

@ -7,5 +7,8 @@
public static string DbSchema { get; set; } = null;
public const string ConnectionStringName = "SettleAccount";
public const string WMSConnectionStringName = "WMS";
}
}

7
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ISettleAccountDbContext.cs

@ -10,4 +10,11 @@ namespace Win.Sfs.SettleAccount
* DbSet<Question> Questions { get; }
*/
}
[ConnectionStringName(SettleAccountDbProperties.WMSConnectionStringName)]
public interface IWmsDbContext : IEfCoreDbContext
{
/* Add DbSet for each Aggregate Root here. Example:
* DbSet<Question> Questions { get; }
*/
}
}

22
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContext.cs

@ -28,4 +28,26 @@ namespace Win.Sfs.SettleAccount
builder.ConfigureSettleAccount();
}
}
[ConnectionStringName("WMSService")]
public class WmsDbContext : AbpDbContext<WmsDbContext>, IWmsDbContext
{
/* Add DbSet for each Aggregate Root here. Example:
* public DbSet<Question> Questions { get; set; }
*/
// public DbSet<>
public WmsDbContext(DbContextOptions<WmsDbContext> options)
: base(options)
{
this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(30));
}
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
}
}
}

4
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -2644,4 +2644,8 @@ namespace Win.Sfs.SettleAccount
#endregion
}
}

7
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs

@ -66,9 +66,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public override string ParentMaterialDesc { set; get; }
[ExporterHeader(DisplayName = "物料组(车型) ")]
public override string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "定价 ")]
[ExporterHeader(DisplayName = "定价")]
public override decimal Price { set; get; }
[ExporterHeader(DisplayName = "金额 ")]
[ExporterHeader(DisplayName = "金额") ]
public override decimal Amt { set; get; }
@ -132,7 +132,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
if (!string.IsNullOrEmpty(materialCode))
{
condition += string.Format(" and d.MaterialCode='{0}' ", materialCode);
condition += string.Format(" and d.MaterialCode in ({0}) ", materialCode);
}
if (!string.IsNullOrEmpty(begin))
{

216
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs

@ -24,7 +24,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public override string KENNCode { set; get; }
[ExporterHeader(DisplayName = "底盘号")]
public override string ChassisNumber { set; get; }
[ExporterHeader(DisplayName = "交货状态 ")]
[ExporterHeader(DisplayName = "交货状态",IsIgnore =true)]
public override string WmsState { set; get; }
[ExporterHeader(DisplayName = "物料号")]
public override string SapMaterialCode { set; get; }
@ -46,12 +46,18 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public decimal Qty { set; get; }
[ExporterHeader(DisplayName = "大众R3未结数量")]
public decimal UNSettleQty { set; get; }
[ExporterHeader(DisplayName = "差异")]
public decimal DiffQty { set; get; }
[ExporterHeader(DisplayName = "差异金额")]
[ExporterHeader(DisplayName = "差异金额",IsIgnore =true)]
public decimal DiffAmt { set; get; }
[ExporterHeader(DisplayName = "大众标识")]
public string UnsettledReason { set; get; }
[ExporterHeader(DisplayName = "结算日期",IsIgnore =true)]
public override DateTime CP7Time { set; get; }
[ExporterHeader(DisplayName = "开票单价",IsIgnore =true)]
public override decimal InvoicePrice { set; get; }
//交货单号 实际发货日期 KENN号 底盘号 底盘格式整理 M100交货状态 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 结算平台未结数量 定价 金额 大众R3未结数量 差异 差异金额
@ -78,10 +84,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
public string MaterialDesc { set; get; }
[ExporterHeader(DisplayName = "客户物料 ")]
public string MaterialCode { set; get; }
//[ExporterHeader(DisplayName = "组件组物料 ")]
//public string ParentSapMaterialCode { set; get; }
//[ExporterHeader(DisplayName = "组件组物料描述 ")]
//public string ParentMaterialDesc { set; get; }
[ExporterHeader(DisplayName = "组件组物料 ")]
public string ParentSapMaterialCode { set; get; }
[ExporterHeader(DisplayName = "组件组物料描述 ")]
public string ParentMaterialDesc { set; get; }
[ExporterHeader(DisplayName = "物料组(车型) ")]
public string MaterialGroup { set; get; }
[ExporterHeader(DisplayName = "定价 ")]
@ -114,7 +120,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
public virtual List<UnSettleDiff1> GetDiffReport(int type, string begin, string end, string materialCode, string kennCode,string chassisNumber)
public virtual List<UnSettleDiff> GetDiffReport(int type, string begin, string end, string materialCode, string kennCode,string chassisNumber)
{
string condition = " where 1=1 ";
@ -143,7 +149,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
}
string sql1 =
" SELECT\n" +
"SELECT\n" +
" t1.*,\n" +
" isnull( t1.UNSettleQty, 0 ) * isnull( T2.Price, 0 ) AMT,\n" +
" T2.Price,\n" +
@ -152,23 +158,35 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"FROM\n" +
" (\n" +
" SELECT\n" +
" temp1.*,\n" +
" temp2.MaterialDesc ParentMaterialDesc \n" +
" FROM\n" +
" (\n" +
" SELECT\n" +
" a.MaterialCode,\n" +
" a.KENNCode,\n" +
" a.ChassisNumber,\n" +
" isnull( b.OrderBillNum, a.KENNCode ) KENNCode,\n" +
" isnull( b.ChassisNumber, a.ChassisNumber ) ChassisNumber,\n" +
" a.qty UNSettleQty,\n" +
" isnull( b.qty, 0 ) qty,\n" +
" a.CP5A CP5Time,\n" +
" c.MaterialCode SapMaterialCode,\n" +
" c.MaterialDesc MaterialDesc,\n" +
" c.EstimateTypeDesc MaterialGroup,\n" +
" a.model Factory \n" +
" a.model Factory,\n" +
" b.ErpMaterialCode ParentSapMaterialCode,\n" +
" b.WMSBillNum, \n" +
" a.UnsettledReason " +
" FROM\n" +
" Set_unsettle a\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" OrderBillNum,\n" +
" ChassisNumber,\n" +
" ItemCode,\n" +
" KENNCode,\n" +
" ChassisNumber2,\n" +
" WMSBillNum,\n" +
" ErpMaterialCode,\n" +
" sum( qty ) qty \n" +
" FROM\n" +
" Set_fis \n" +
@ -179,11 +197,17 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
" ItemCode,\n" +
" KENNCode,\n" +
" ChassisNumber2,\n" +
" OrderBillNum,\n" +
" ChassisNumber,\n" +
" WMSBillNum,\n" +
" ErpMaterialCode,\n" +
" Model \n" +
" ) b ON a.ChassisNumber = b.ChassisNumber2 \n" +
" AND a.MaterialCode = b.ItemCode \n" +
" AND a.KENNCode = b.KENNCode\n" +
" LEFT JOIN Set_material c ON a.MaterialCode = c.CustomerPartCode {0}\n" +
" ) temp1\n" +
" LEFT JOIN Set_material temp2 ON temp1.ParentSapMaterialCode = temp2.MaterialCode \n" +
" ) t1\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
@ -198,80 +222,48 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
// string sql2 =
//" SELECT\n " +
//" SELECT\n" +
//" t1.*,\n" +
//" t1.Qty * T2.Price AMT,\n" +
//" isnull( t1.UNSettleQty, 0 ) * isnull( T2.Price, 0 ) AMT,\n" +
//" T2.Price,\n" +
//" Qty -(\n" +
//" ISNULL( UnSettleQty, 0 )) DiffQty,\n" +
//" Qty -(\n" +
//" ISNULL( UnSettleQty, 0 ))* isnull( t2.Price, 0 ) DiffPrice \n" +
//" ISNULL( UnSettleQty, 0 )) DiffQty \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" temp1.WMSState,\n" +
//" temp1.WMSBillNum,\n" +
//" temp1.MaterialCode,\n" +
//" temp1.KENNCode,\n" +
//" temp1.ChassisNumber2,\n" +
//" temp1.Qty,\n" +
//" temp1.ChassisNumber,\n" +
//" temp1.CP5Time,\n" +
//" temp1.UnSettleQty,\n" +
//" temp1.SapMaterialCode,\n" +
//" temp1.MaterialDesc,\n" +
//" temp1.MaterialGroup,\n" +
//" temp2.MaterialCode AS ParentSapMaterialCode,\n" +
//" temp2.MaterialDesc AS ParentMaterialDesc \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" a.WMSState,\n" +
//" a.WMSBillNum,\n" +
//" a.MaterialCode,\n" +
//" a.KENNCode,\n" +
//" a.ChassisNumber2,\n" +
//" a.Qty,\n" +
//" a.ParentCode,\n" +
//" a.ChassisNumber,\n" +
//" a.CP5Time,\n" +
//" b.Qty AS UnSettleQty,\n" +
//" C.MaterialCode AS SapMaterialCode,\n" +
//" C.MaterialDesc,\n" +
//" C.EstimateTypeDesc AS MaterialGroup \n" +
//" a.qty UNSettleQty,\n" +
//" isnull( b.qty, 0 ) qty,\n" +
//" a.CP5A CP5Time,\n" +
//" c.MaterialCode SapMaterialCode,\n" +
//" c.MaterialDesc MaterialDesc,\n" +
//" c.EstimateTypeDesc MaterialGroup,\n" +
//" a.model Factory \n" +
//" FROM\n" +
//" (\n" +
//" Set_unsettle a\n" +
//" LEFT JOIN (\n" +
//" SELECT\n" +
//" WMSState,\n" +
//" WMSBillNum,\n" +
//" ItemCode AS MaterialCode,\n" +
//" ItemCode,\n" +
//" KENNCode,\n" +
//" ChassisNumber2,\n" +
//" SUM( Qty ) AS Qty,\n" +
//" ErpMaterialCode AS ParentCode,\n" +
//" ChassisNumber,\n" +
//" CP5Time \n" +
//" sum( qty ) qty \n" +
//" FROM\n" +
//" Set_fis \n" +
//" WHERE\n" +
//" ( State = 0 ) \n" +
//" state = 0 \n" +
//" OR state = 4 \n" +
//" GROUP BY\n" +
//" ItemCode,\n" +
//" KENNCode,\n" +
//" ChassisNumber2,\n" +
//" WMSState,\n" +
//" WMSBillNum,\n" +
//" ErpMaterialCode,\n" +
//" ChassisNumber,\n" +
//" CP5Time \n" +
//" ) AS a\n" +
//" LEFT OUTER JOIN Set_Unsettle AS b ON a.ChassisNumber2 = b.ChassisNumber \n" +
//" AND b.MaterialCode = a.MaterialCode \n" +
//" Model \n" +
//" ) b ON a.ChassisNumber = b.ChassisNumber2 \n" +
//" AND a.MaterialCode = b.ItemCode \n" +
//" AND a.KENNCode = b.KENNCode\n" +
//" LEFT OUTER JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode {0}\n" +
//" ) AS temp1\n" +
//" LEFT OUTER JOIN Set_material AS temp2 ON temp1.ParentCode = temp2.MaterialCode \n" +
//" LEFT JOIN Set_material c ON a.MaterialCode = c.CustomerPartCode {0}\n" +
//" ) t1\n" +
//" LEFT JOIN (\n" +
//" SELECT\n" +
@ -280,7 +272,95 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
//" FROM\n" +
//" Set_PriceList \n" +
//" WHERE\n" +
//" version = ( SELECT max( version ) FROM Set_PriceListVersion )) t2 ON t1.SapMaterialCode = t2.MaterialCode";
//" version = ( SELECT max( version ) FROM Set_PriceListVersion )) t2 ON t1.SapMaterialCode = t2.MaterialCode \n" +
//"WHERE\n" +
//" 1 = 1";
// string sql2 =
//" SELECT\n " +
//" t1.*,\n" +
//" t1.Qty * T2.Price AMT,\n" +
//" T2.Price,\n" +
//" Qty -(\n" +
//" ISNULL( UnSettleQty, 0 )) DiffQty,\n" +
//" Qty -(\n" +
//" ISNULL( UnSettleQty, 0 ))* isnull( t2.Price, 0 ) DiffPrice \n" +
//"FROM\n" +
//" (\n" +
//" SELECT\n" +
//" temp1.WMSState,\n" +
//" temp1.WMSBillNum,\n" +
//" temp1.MaterialCode,\n" +
//" temp1.KENNCode,\n" +
//" temp1.ChassisNumber2,\n" +
//" temp1.Qty,\n" +
//" temp1.ChassisNumber,\n" +
//" temp1.CP5Time,\n" +
//" temp1.UnSettleQty,\n" +
//" temp1.SapMaterialCode,\n" +
//" temp1.MaterialDesc,\n" +
//" temp1.MaterialGroup,\n" +
//" temp2.MaterialCode AS ParentSapMaterialCode,\n" +
//" temp2.MaterialDesc AS ParentMaterialDesc \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" a.WMSState,\n" +
//" a.WMSBillNum,\n" +
//" a.MaterialCode,\n" +
//" a.KENNCode,\n" +
//" a.ChassisNumber2,\n" +
//" a.Qty,\n" +
//" a.ParentCode,\n" +
//" a.ChassisNumber,\n" +
//" a.CP5Time,\n" +
//" b.Qty AS UnSettleQty,\n" +
//" C.MaterialCode AS SapMaterialCode,\n" +
//" C.MaterialDesc,\n" +
//" C.EstimateTypeDesc AS MaterialGroup \n" +
//" FROM\n" +
//" (\n" +
//" SELECT\n" +
//" WMSState,\n" +
//" WMSBillNum,\n" +
//" ItemCode AS MaterialCode,\n" +
//" KENNCode,\n" +
//" ChassisNumber2,\n" +
//" SUM( Qty ) AS Qty,\n" +
//" ErpMaterialCode AS ParentCode,\n" +
//" ChassisNumber,\n" +
//" CP5Time \n" +
//" FROM\n" +
//" Set_fis \n" +
//" WHERE\n" +
//" ( State = 0 ) \n" +
//" GROUP BY\n" +
//" ItemCode,\n" +
//" KENNCode,\n" +
//" ChassisNumber2,\n" +
//" WMSState,\n" +
//" WMSBillNum,\n" +
//" ErpMaterialCode,\n" +
//" ChassisNumber,\n" +
//" CP5Time \n" +
//" ) AS a\n" +
//" LEFT OUTER JOIN Set_Unsettle AS b ON a.ChassisNumber2 = b.ChassisNumber \n" +
//" AND b.MaterialCode = a.MaterialCode \n" +
//" AND a.KENNCode = b.KENNCode\n" +
//" LEFT OUTER JOIN Set_material AS C ON a.MaterialCode = C.CustomerPartCode {0}\n" +
//" ) AS temp1\n" +
//" LEFT OUTER JOIN Set_material AS temp2 ON temp1.ParentCode = temp2.MaterialCode \n" +
//" ) t1\n" +
//" LEFT JOIN (\n" +
//" SELECT\n" +
//" MaterialCode,\n" +
//" Price \n" +
//" FROM\n" +
//" Set_PriceList \n" +
//" WHERE\n" +
//" version = ( SELECT max( version ) FROM Set_PriceListVersion )) t2 ON t1.SapMaterialCode = t2.MaterialCode";
@ -288,7 +368,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
var _query = DbConnection.Query<UnSettleDiff1>(_sql);
var _query = DbConnection.Query<UnSettleDiff>(_sql);
return _query.ToList();
}

7
src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskDapperRepository.cs

@ -23,7 +23,7 @@ namespace Win.Sfs.SettleAccount.Repository
public virtual async Task<List<Job>> GetTaskJobsAsync(Job p_task)
{
string str = string.Empty;
str += "SELECT b.Id, a.StateId, a.StateName, a.InvocationData, a.Arguments, a.CreatedAt, a.ExpireAt, b.TaskId, b.Name, \n";
str += "SELECT b.Id, a.StateId,b.Type, a.StateName, a.InvocationData, a.Arguments, a.CreatedAt, a.ExpireAt, b.TaskId, b.Name, \n";
str += " b.ActionName, b.Error, b.Creator, b.Email, b.FileName, b.DownFileName, b.ServiceName,b.RealDownFileName,b.RealFileName \n";
str += " FROM HangFire.Job AS a INNER JOIN \n";
str += " Set_TaskJob AS b ON a.Id = b.TaskId \n";
@ -50,7 +50,10 @@ namespace Win.Sfs.SettleAccount.Repository
{
str += string.Format(" and b.taskid='{0}'", p_task.TaskId);
}
if (!string.IsNullOrEmpty(p_task.Type))
{
str += string.Format(" and b.type='{0}'", p_task.Type);
}
str += " order by a.CreatedAt desc ";
var _db= await GetDbConnectionAsync();
var _query= await _db.QueryAsync<Job>(str);

64
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs

@ -52,25 +52,18 @@ namespace SettleAccount.Job.Services
var kenncode = p_list.Where(p => p.Name == "KennCode").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 sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber, materialGroup);
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, version, false);
var rangeList = _erpdapperRepository.GetSapList<InvoiceSettledDetailDiff>(_list, version, true);
var erpPriceList = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode })
.Select(p => new { ParentSapMaterialCode = p.Key.ParentSapMaterialCode, ChassisNumber = p.Key.ChassisNumber, KENNCode = p.Key.KENNCode, Price = p.Sum(itm => itm.InvoicePrice) }).ToList();
// var erpPriceList= _erpdapperRepository.GetErpPartCodePriceList(version);
var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version);
@ -107,33 +100,8 @@ namespace SettleAccount.Job.Services
DiffPrice = tm1.Price-itm1.Price
};
rangeList = rangList.ToList();
//rangeList.ForEach(p =>
//{
// p.Qty = 1;
// p.InvoiceQty = 1;
// p.SettledQty = 1;
// p.DiffSettleFisQty = 0;
// p.DiffSettleInvQty = 0;
// var _first = erpPriceList.FirstOrDefault(itm => itm.ParentSapMaterialCode == p.ParentSapMaterialCode && itm.ChassisNumber == p.ChassisNumber && itm.KENNCode == p.KENNCode);
// //var _first = erpPriceList.FirstOrDefault(itm => itm.SapErpPartCode == p.SapMaterialCode);
// if (_first != null)
// {
// p.InvoicePrice = _first.Price;
// p.Amt = p.Price * 1;
// p.InvocieAmt = p.InvoicePrice * 1;
// p.SettleAmt = p.SettledQty * p.Price;
// }
// p.DiffPrice = p.InvoicePrice - p.Price;
//});
foreach (var itm in diffList)
{
var _first = _ls.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode);
@ -146,21 +114,41 @@ namespace SettleAccount.Job.Services
itm.InvocieAmt = itm.InvoiceQty * itm.InvoicePrice;
itm.DiffPrice = itm.Price - itm.InvoicePrice;
}
_ls.AddRange(rangeList);
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList= materialGroup.Split(new char[] { ',' }).ToList();
_ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup) ).ToList();
if(_groupList.Count()>0)
{
_ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
}
}
if (!string.IsNullOrEmpty(kenncode))
{
_ls = _ls.Where(p => p.KENNCode.Contains(kenncode)).ToList();
var _groupList = kenncode.Split("\n").ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList();
}
}
if (!string.IsNullOrEmpty(chassisNumber))
{
_ls = _ls.Where(p => p.ChassisNumber.Contains(chassisNumber)).ToList();
var _groupList = chassisNumber.Split("\n").ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
_ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList();

89
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs

@ -54,31 +54,51 @@ namespace SettleAccount.Job.Services.Report
var kenncode = p_list.Where(p => p.Name == "KennCode").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 sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber, materialGroup);
var _list = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode }).Select(p => p.FirstOrDefault()).ToList();
if (_ls.Count > 0)
{
var rangeList = _erpdapperRepository.GetSapList<InvoiceSettledDetailDiff>(_list, version, true);
var erpPriceList = _erpdapperRepository.GetErpPartCodePriceList(version);
var erpPriceList = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode })
.Select(p => new { ParentSapMaterialCode = p.Key.ParentSapMaterialCode, ChassisNumber = p.Key.ChassisNumber, KENNCode = p.Key.KENNCode, Price = p.Sum(itm => itm.InvoicePrice) }).ToList();
var diffList = _erpdapperRepository.GetSettleInvoiceDiff(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)
var rangList = from itm1 in rangeList
join itm2 in erpPriceList on new { itm1.ParentSapMaterialCode, itm1.KENNCode, itm1.ChassisNumber } equals new { itm2.ParentSapMaterialCode, itm2.KENNCode, itm2.ChassisNumber }
into temp1
from tm1 in temp1.DefaultIfEmpty()
select new InvoiceSettledDetailDiff
{
p.InvoicePrice = _first.SapPrice;
p.Amt = p.Price * 1;
p.InvocieAmt = p.InvoicePrice * 1;
p.SettleAmt = p.SettledQty * p.Price;
}
p.DiffPrice = p.InvoicePrice - p.Price;
});
WmsBillNum = itm1.WmsBillNum,
CP5Time = itm1.CP5Time,
KENNCode = itm1.KENNCode,
ChassisNumber = itm1.ChassisNumber,
WmsState = itm1.WmsState,
SapMaterialCode = itm1.SapMaterialCode,
MaterialDesc = itm1.MaterialDesc,
MaterialCode = itm1.MaterialCode,
ParentSapMaterialCode = itm1.ParentSapMaterialCode,
ParentMaterialDesc = itm1.ParentMaterialDesc,
MaterialGroup = itm1.MaterialGroup,
Price = itm1.Price,
Amt = itm1.Amt,
Qty = 1,
SettledQty = 1,
CP7Time = itm1.CP7Time,
DiffSettleFisQty = 0,
DiffSettleInvQty = 0,
InvoiceQty = 1,
InvoicePrice = tm1.Price,
InvocieAmt = tm1.Price,
SettleAmt = tm1.Price,
DiffPrice = tm1.Price - itm1.Price
};
rangeList = rangList.ToList();
foreach (var itm in diffList)
@ -96,20 +116,45 @@ namespace SettleAccount.Job.Services.Report
_ls.AddRange(rangeList);
_ls = _ls.Where(p => p.DiffPrice != 0).OrderBy(p => p.SapMaterialCode).ToList();
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
}
}
if (!string.IsNullOrEmpty(kenncode))
{
_ls = _ls.Where(p => p.KENNCode.Contains(kenncode)).ToList();
var _groupList = kenncode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList();
}
}
if (!string.IsNullOrEmpty(chassisNumber))
{
_ls = _ls.Where(p => p.ChassisNumber.Contains(chassisNumber)).ToList();
var _groupList = chassisNumber.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
}
var report1List = _ls.Where(p=>p.DiffPrice!=0).GroupBy(p => new { p.MaterialGroup, p.MaterialCode, p.MaterialDesc, p.Price, p.InvoicePrice, p.DiffPrice, p.SapMaterialCode })
.Select(t => new SettleDoorPanelExport{ MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode, }).ToList();
// _unSettledapperRepository.GetErrorSettleDetail(string.Empty,begin,end,string.Empty,version,materialCode,materialGroup,string.Empty).GroupBy(p=> p.MaterialGroup)
.Select(t => new SettleDoorPanelExport{ MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode }).ToList();
//var report2List = report1List.GroupBy(p => new {p.MaterialGroup }).Select(p=>new SettleDoorPanelSumExport { MaterialGroup= p.Key.MaterialGroup, InvoiceDiffPrice=p.Sum(itm=>itm.InvoiceDiffPrice), Version= version });
var report2List = report1List.GroupBy(p => new {p.MaterialGroup }).Select(p=>new SettleDoorPanelSumExport { MaterialGroup= p.Key.MaterialGroup, InvoiceDiffPrice=p.Sum(itm=>itm.InvoiceDiffPrice), Version= version });
var report2List= _ls.Where(p => p.DiffPrice != 0).Select(p=> new { p.MaterialGroup,DiffAmt=p.DiffPrice*p.Qty }).GroupBy(p=>new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); ;
ExcelExporter _exporter = new ExcelExporter();//导出Excel
var result = _exporter.Append(report1List.ToList(), "按物料价格差异明细表")
.SeparateBySheet()

48
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs

@ -80,6 +80,7 @@ namespace SettleAccount.Job.Services
var kenncode = p_list.Where(p => p.Name == "KennCode").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 sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
// customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup });
@ -93,6 +94,44 @@ namespace SettleAccount.Job.Services
}
_ls=_ls.OrderBy(p => p.ChassisNumber).ThenBy(p=>p.KENNCode).ThenBy(p=>p.SapMaterialCode).ToList();
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
}
}
if (!string.IsNullOrEmpty(kenncode))
{
var _groupList = kenncode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList();
}
}
if (!string.IsNullOrEmpty(chassisNumber))
{
var _groupList = chassisNumber.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
var _lsSum=_ls.GroupBy(p => new { p.MaterialCode, p.SapMaterialCode, p.MaterialGroup,p.InvoicePrice }).Select(p => new UnInvoiceSettledDetailSum
{
MaterialCode = p.Key.MaterialCode,
@ -116,15 +155,6 @@ namespace SettleAccount.Job.Services
};
_lsSum.Add(_sumTotal);
ExcelExporter _exporter = new ExcelExporter();//导出Excel
//if (_ls.Count > 500000)
//{
//}
//if (_ls.Count > 1000000)
//{
//}
//if (_ls.Count > 1500000)
//{
//}

87
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs

@ -14,82 +14,77 @@ namespace SettleAccount.Job.Services.Report
{
private readonly UnSettleDiffDapperRepository _dapper;
private readonly OutputService _outputService;
private readonly ErpPartDapperRepository _erpdapperRepository;
public UnSettleDiffExportService(UnSettleDiffDapperRepository dapper, OutputService outputService)
public UnSettleDiffExportService(UnSettleDiffDapperRepository dapper, OutputService outputService,
ErpPartDapperRepository erpdapperRepository
)
{
_erpdapperRepository = erpdapperRepository;
_dapper = dapper;
_outputService = outputService;
}
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> p_list)
{
//var type = p_list.Where(p => p.Name == "Type").FirstOrDefault().Value;
//var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value;
//var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value;
//var sapCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value;
//var beginTime = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value;
//var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value;
var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value;
//var type = p_list.Where(p => p.Name == "Type").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 materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value;
var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
var _first = exportName.FirstOrDefault();
var _ls = new List<UnSettleDiff1>();
var _ls = new List<UnSettleDiff>();
_ls = _dapper.GetDiffReport(0,begin,end, materialCode,kenncode,chassisNumber);
var _list = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode && !string.IsNullOrEmpty(p.ParentSapMaterialCode)).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode })
.Select(p => p.FirstOrDefault()).ToList();
var rangeList = _erpdapperRepository.GetSapList<UnSettleDiff>(_list, version, false);
_ls.AddRange(rangeList);
if (!string.IsNullOrEmpty(materialGroup))
{
var _groupList = materialGroup.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
}
}
if (!string.IsNullOrEmpty(kenncode))
{
_ls = _ls.Where(p => p.KENNCode.Contains(kenncode)).ToList();
var _groupList = kenncode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList();
}
}
if (!string.IsNullOrEmpty(chassisNumber))
{
_ls = _ls.Where(p => p.ChassisNumber.Contains(chassisNumber)).ToList();
var _groupList = chassisNumber.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
var _id = Guid.NewGuid();
List<UnSettleDiff> _lsExport = new List<UnSettleDiff>();
//foreach (var itm in _ls)
//{
// var dto = new FISExportDto()
// {
// ChassisNumber = itm.ChassisNumber,
// ChassisNumber2 = itm.ChassisNumber2,
// CP5Time = itm.CP5Time,
// ItemCode = itm.ItemCode,
// CP7Time = itm.CP7Time,
// KENNCode = itm.KENNCode,
// OrderBillNum = itm.OrderBillNum,
// //Model = itm.Model,
// SequenceNumber = itm.SequenceNumber,
// ErpMaterialCode = itm.ErpMaterialCode,
// SettledQty = itm.SettledQty,
// //State = itm.State,
// Qty = itm.Qty,
// Version = itm.Version,
// };
// _lsExport.Add(dto);
//}
_outputService.Export<UnSettleDiff1>(id, _first, _ls);
_ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.SapMaterialCode).ToList();
_outputService.Export<UnSettleDiff>(id, _first, _ls);
return id.ToString();
}
}

31
src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs

@ -44,6 +44,7 @@ namespace SettleAccount.Job.Services.Report
var end = p_list.Where(p => p.Name == "End").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 sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value;
//var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value;
@ -59,21 +60,37 @@ namespace SettleAccount.Job.Services.Report
}
);
_list.AddRange(_lst);
if (!string.IsNullOrEmpty(sapcode))
{
_list= _list.Where(p => p.SapMaterialCode == sapcode).ToList();
}
if (!string.IsNullOrEmpty(materialGroup))
{
_list= _list.Where(p => p.MaterialGroup == materialGroup).ToList();
var _groupList = materialGroup.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList();
}
}
if (!string.IsNullOrEmpty(kenncode))
{
_list = _list.Where(p => p.KENNCode.Contains(kenncode)).ToList();
var _groupList = kenncode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_list = _list.Where(p => _groupList.Contains(p.KENNCode)).ToList();
}
}
if (!string.IsNullOrEmpty(chassisNumber))
{
_list = _list.Where(p => p.ChassisNumber .Contains(chassisNumber)).ToList();
var _groupList = chassisNumber.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_list = _list.Where(p => _groupList.Contains(p.ChassisNumber)).ToList();
}
}
if (!string.IsNullOrEmpty(sapCode))
{
var _groupList = sapCode.Split(new char[] { ',' }).ToList();
if (_groupList.Count() > 0)
{
_list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList();
}
}
_list = _list.OrderBy(p => p.ChassisNumber).ThenBy(p => p.SapMaterialCode).ThenBy(p => p.Flag).ToList();
_outputService.Export<UnSettleDetailReport>(id, _first, _list);

1
src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs

@ -48,6 +48,7 @@ namespace Win.Sfs.SettleAccount
//量差和价差分析报表
context.Services.AddTransient<PriceQtyDifferenceExportService>();
context.Services.AddTransient(implementationFactory =>
{
Func<string, IImportJob> accesor = key =>

BIN
src/Shared/Win.Abp.Snowflakes/obj/Debug/netcoreapp5/Win.Abp.Snowflakes.assets.cache

Binary file not shown.

BIN
src/Shared/Win.Sfs.Shared/obj/Debug/netcoreapp5/Win.Sfs.Shared.assets.cache

Binary file not shown.

BIN
src/Shared/Win.Utils/obj/Debug/netcoreapp5/Win.Utils.assets.cache

Binary file not shown.

10
vue/src/router/index.js

@ -168,13 +168,13 @@ export const asyncRoutes = [
/** when your routing map is too long, you can split it into small modules **/
managerRouter,//系统首页
personRouter,//系统管理
basedataRouter,//基础数据维护
vwFisDataRouter,//结算与开票数据导入
billdataRouter,//销售结算与开票报表
//basedataRouter,//基础数据维护
//vwFisDataRouter,//结算与开票数据导入
//billdataRouter,//销售结算与开票报表
//businessdataRouter,
wheeldataRouter,//大众看板和备件
//wheeldataRouter,//大众看板和备件
pgfis,//派格fis
JobTimeDataRouter,//后台作业监控
//JobTimeDataRouter,//后台作业监控
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }

Loading…
Cancel
Save