yu.wu 3 years ago
parent
commit
b9d7ac3bf8
  1. 7
      .vs/VSWorkspaceState.json
  2. 9432
      src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs
  3. 2
      src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWSparePart/ISparePartAppService.cs
  4. 30
      src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs
  5. 7
      src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml
  6. 9
      src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/VWSparePart/SparePart.cs
  7. 248
      src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  8. 28
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs
  9. 3
      src/Modules/SettleAccount/src/SettleAccount.Job/Services/UnSettleAccount/UnSettleAccountImportService.cs

7
.vs/VSWorkspaceState.json

@ -0,0 +1,7 @@
{
"ExpandedNodes": [
""
],
"SelectedNode": "\\WY.NewJit.sln (src\\Modules\\派格FIS\\WY.NewJit.sln)",
"PreviewInSolutionExplorer": false
}

9432
src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Migrations/SettleAccountHttpApiHostMigrationsDbContextModelSnapshot.cs

File diff suppressed because it is too large

2
src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWSparePart/ISparePartAppService.cs

@ -43,7 +43,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
Task<PagedResultDto<SparePartDto>> GetListAsync(Guid parentId, SparePartRequestDto input);
Task<PagedResultDto<SparePartDto>> GetListAsync( SparePartRequestDto input);

30
src/Modules/SettleAccount/src/SettleAccount.Application/Entities/VWSparePart/SparePartAppService.cs

@ -22,10 +22,13 @@ using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Win.Sfs.Shared.Filter;
using Volo.Abp;
namespace Win.Sfs.SettleAccount.Entities.VWSparePart
{
/// <summary>
/// 大众备件服务
/// </summary>
[Route("api/settleaccount/SparePart")]
public class SparePartAppService : SettleAccountApplicationBase<SparePart>, ISparePartAppService
{
@ -69,6 +72,10 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
public async Task<string> SparePartUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode)
{
if (string.IsNullOrEmpty(version))
{
throw new BusinessException("版本不能空,必须传入!");
}
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport< SparePartImportDto>(files, _excelImportService);
var entityList = ObjectMapper.Map<List< SparePartImportDto>, List<SparePart>>(result);
@ -91,7 +98,10 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
var _id = GuidGenerator.Create();
var _bomList = new List< SparePartVersion>();
_bomList.Add(new SparePartVersion(_id, branchId, year, period, version, customerCode));
foreach (var itm in entityList)
{
itm.SetValue(GuidGenerator.Create(), branchId, year, period, version);
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
@ -148,12 +158,15 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<string> ExportAsync(SparePartRequestDto input)
{
if (string.IsNullOrEmpty(input.Version))
{
throw new BusinessException("版本不能空,必须传入!");
}
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
if (input.ParentId != Guid.Empty)
if (!string.IsNullOrEmpty(input.Version))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
0, true);
@ -200,16 +213,17 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
[HttpPost]
[Route("list")]
//[Authorize(SettleAccountPermissions.SettleAccounts.Default)]
virtual public async Task<PagedResultDto<SparePartDto>> GetListAsync(Guid id, SparePartRequestDto input)
virtual public async Task<PagedResultDto<SparePartDto>> GetListAsync(SparePartRequestDto input)
{
if (input.ParentId != Guid.Empty)
if (!string.IsNullOrEmpty(input.Version))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
}
else
{
return new PagedResultDto<SparePartDto>(0, new List<SparePartDto>());
}
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);

7
src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.xml

@ -1659,6 +1659,11 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="T:Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartAppService">
<summary>
大众备件服务
</summary>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartAppService.#ctor(Volo.Abp.Guids.IGuidGenerator,Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartVersion,System.Guid},Win.Sfs.SettleAccount.ISettleAccountBranchEfCoreRepository{Win.Sfs.SettleAccount.Entities.VWSparePart.SparePart,System.Guid},Volo.Abp.Caching.IDistributedCache{Win.Sfs.SettleAccount.Entities.VWSparePart.SparePart},Win.Sfs.BaseData.ImportExcelCommon.IExcelImportAppService,Win.Abp.Snowflakes.ISnowflakeIdGenerator,Win.Sfs.SettleAccount.CommonManagers.ICommonManager)">
<summary>
构建方法
@ -1691,7 +1696,7 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartAppService.GetListAsync(System.Guid,Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartRequestDto)">
<member name="M:Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartAppService.GetListAsync(Win.Sfs.SettleAccount.Entities.VWSparePart.SparePartRequestDto)">
<summary>
根据筛选条件获取实体列表
</summary>

9
src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/VWSparePart/SparePart.cs

@ -15,6 +15,15 @@ namespace Win.Sfs.SettleAccount.Entities.VWSparePart
{
public SparePart()
{ }
public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version)
{
Period = peroid;
Year = year;
Id = guid;
Version = version;
BranchId = branchId;
}
public SparePart(Guid Id, string year, string period, string version, string lineNumber,
string purchaseType,string purchaseOrderNo, string purchaseOrderNoItem, string purchaseOrderNoText,
decimal receiptQty, decimal invoicedQty, decimal amountNoTax, decimal purchasePriceNoTax,

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

@ -87,181 +87,181 @@ namespace Win.Sfs.SettleAccount
#region 天合
//产品结构
//builder.ConfigureBom(options);
builder.ConfigureBom(options);
////结算件
//builder.ConfigureSettlementPart(options);
//结算件
builder.ConfigureSettlementPart(options);
////ERP总成开票价格
//builder.ConfigureItemInvoicePrice(options);
//builder.ConfigureItemInvoicePriceVersion(options);
//ERP总成开票价格
builder.ConfigureItemInvoicePrice(options);
builder.ConfigureItemInvoicePriceVersion(options);
////客户
//builder.ConfigureCustomer(options);
//客户
builder.ConfigureCustomer(options);
////客户产品结构
//builder.ConfigureCustomerBom(options);
//builder.ConfigureEstimatedSum(options);
//builder.ConfigureCodeSetting(options);
//builder.ConfigureMaterial(options);
//builder.ConfigureEstimatedInventoryDetail(options);
//builder.ConfigureInventoryDetail(options);
//客户产品结构
builder.ConfigureCustomerBom(options);
builder.ConfigureEstimatedSum(options);
builder.ConfigureCodeSetting(options);
builder.ConfigureMaterial(options);
builder.ConfigureEstimatedInventoryDetail(options);
builder.ConfigureInventoryDetail(options);
//builder.ConfigureMaterialRelationship(options);
//builder.ConfigureFIS(options);
//builder.ConfigureFISExtend(options);
//builder.ConfigureCentralizedControl(options);
//builder.ConfigurePrebatch(options);
//builder.ConfigureFactory(options);
//builder.ConfigureSupplierItemSetUp(options);
//builder.ConfigureSecondaryAdjustment(options);
//builder.ConfigureSecondaryPriceRatio(options);
//builder.ConfigureCustomerStorageLocation(options);
//builder.ConfigureBomVersion(options);
//builder.ConfigureFISVersion(options);
//builder.ConfigureEstimatedSumVersion(options);
//builder.ConfigureEstimatedInventoryVersion(options);
//builder.ConfigureInventoryDetailVersion(options);
builder.ConfigureMaterialRelationship(options);
builder.ConfigureFIS(options);
builder.ConfigureFISExtend(options);
builder.ConfigureCentralizedControl(options);
builder.ConfigurePrebatch(options);
builder.ConfigureFactory(options);
builder.ConfigureSupplierItemSetUp(options);
builder.ConfigureSecondaryAdjustment(options);
builder.ConfigureSecondaryPriceRatio(options);
builder.ConfigureCustomerStorageLocation(options);
builder.ConfigureBomVersion(options);
builder.ConfigureFISVersion(options);
builder.ConfigureEstimatedSumVersion(options);
builder.ConfigureEstimatedInventoryVersion(options);
builder.ConfigureInventoryDetailVersion(options);
//builder.ConfigureSecondaryAdjustmentVersion(options);
//builder.ConfigureSecondaryPriceRatioVersion(options);
//builder.ConfigureSecondaryDiscount(options);
//builder.ConfigureSecondaryDiscountVersion(options);
builder.ConfigureSecondaryAdjustmentVersion(options);
builder.ConfigureSecondaryPriceRatioVersion(options);
builder.ConfigureSecondaryDiscount(options);
builder.ConfigureSecondaryDiscountVersion(options);
//builder.ConfigureSecondaryPriceRatioVersion(options);
////暂估发出未结算
//builder.ConfigureEstimatedStockDiffReport(options);
builder.ConfigureSecondaryPriceRatioVersion(options);
//暂估发出未结算
builder.ConfigureEstimatedStockDiffReport(options);
////暂估发出未结算明细
//builder.ConfigureEstimatedStockDiffReportDetail(options);
//暂估发出未结算明细
builder.ConfigureEstimatedStockDiffReportDetail(options);
////库存未结算比对
//builder.ConfigureStockUnsettledDiffReport(options);
//库存未结算比对
builder.ConfigureStockUnsettledDiffReport(options);
////库存未结算比对明细
//builder.ConfigureStockUnsettledDiffReportDetail(options);
//库存未结算比对明细
builder.ConfigureStockUnsettledDiffReportDetail(options);
////R3结算数据对比输出表
//builder.ConfigureStockSettledDiffReport(options);
//R3结算数据对比输出表
builder.ConfigureStockSettledDiffReport(options);
////R3结算数据对比输出表明细
//builder.ConfigureStockSettledDiffReportDetail(options);
//R3结算数据对比输出表明细
builder.ConfigureStockSettledDiffReportDetail(options);
////FIS发运数据对比输出表
//builder.ConfigureStockFisDiffReport(options);
//FIS发运数据对比输出表
builder.ConfigureStockFisDiffReport(options);
////FIS发运数据对比输出表明细
//builder.ConfigureStockFisDiffReportDetail(options);
//FIS发运数据对比输出表明细
builder.ConfigureStockFisDiffReportDetail(options);
////发出未结算比对
//builder.ConfigureSendUnsettledDiffReport(options);
//发出未结算比对
builder.ConfigureSendUnsettledDiffReport(options);
////发出未结算比对明细
//builder.ConfigureSendUnsettledDiffReportDetail(options);
//发出未结算比对明细
builder.ConfigureSendUnsettledDiffReportDetail(options);
////奔腾轿车一厂车序输入表
//builder.ConfigureBTCarSeqFirst(options);
//builder.ConfigureBTCarSeqFirstVersion(options);
////实际二配调整后输出表
//builder.ConfigureSecondaryActuralAdjustmentReport(options);
//奔腾轿车一厂车序输入表
builder.ConfigureBTCarSeqFirst(options);
builder.ConfigureBTCarSeqFirstVersion(options);
//实际二配调整后输出表
builder.ConfigureSecondaryActuralAdjustmentReport(options);
////实际二配调整后输出表明细
//builder.ConfigureSecondaryActuralAdjustmentReportDetail(options);
//实际二配调整后输出表明细
builder.ConfigureSecondaryActuralAdjustmentReportDetail(options);
////二配对比输出表
//builder.ConfigureSecondaryActuralDiffReport(options);
//二配对比输出表
builder.ConfigureSecondaryActuralDiffReport(options);
////二配对比输出表明细
//builder.ConfigureSecondaryActuralDiffReportDetail(options);
//二配对比输出表明细
builder.ConfigureSecondaryActuralDiffReportDetail(options);
////奔腾轿车二厂车序输入表
//builder.ConfigureBTCarSeqSecond(options);
//builder.ConfigureBTCarSeqSecondVersion(options);
//奔腾轿车二厂车序输入表
builder.ConfigureBTCarSeqSecond(options);
builder.ConfigureBTCarSeqSecondVersion(options);
////奔腾轿车车序输入表
//builder.ConfigureBTCarSeq(options);
//builder.ConfigureBTCarSeqVersion(options);
//奔腾轿车车序输入表
builder.ConfigureBTCarSeq(options);
builder.ConfigureBTCarSeqVersion(options);
////奔腾看板输入表
//builder.ConfigureBTCarKB(options);
//builder.ConfigureBTCarKBVersion(options);
//奔腾看板输入表
builder.ConfigureBTCarKB(options);
builder.ConfigureBTCarKBVersion(options);
////奔腾结算输入表
//builder.ConfigureBTCarConsign(options);
//builder.ConfigureBTCarConsignVersion(options);
//奔腾结算输入表
builder.ConfigureBTCarConsign(options);
builder.ConfigureBTCarConsignVersion(options);
////解放看板输入表
//builder.ConfigureJFCarKB(options);
//builder.ConfigureJFCarKBVersion(options);
//解放看板输入表
builder.ConfigureJFCarKB(options);
builder.ConfigureJFCarKBVersion(options);
////结算结算输入表
//builder.ConfigureJFCarConsign(options);
//builder.ConfigureJFCarConsignVersion(options);
//结算结算输入表
builder.ConfigureJFCarConsign(options);
builder.ConfigureJFCarConsignVersion(options);
////车型代码与零件号匹配关系设置表
//builder.ConfigureCarMaterialConfig(options);
//车型代码与零件号匹配关系设置表
builder.ConfigureCarMaterialConfig(options);
////轿车车序与看板差异输出表
//builder.ConfigureBTSeqKBDiffReport(options);
//轿车车序与看板差异输出表
builder.ConfigureBTSeqKBDiffReport(options);
////轿车车序与看板差异输出表明细
//builder.ConfigureBTSeqKBDiffReportDetail(options);
//轿车车序与看板差异输出表明细
builder.ConfigureBTSeqKBDiffReportDetail(options);
////轿车发出未结算输出表
//builder.ConfigureBTNotConsignReport(options);
////轿车发出未结算输出表明细
//builder.ConfigureBTNotConsignReportDetail(options);
//轿车发出未结算输出表
builder.ConfigureBTNotConsignReport(options);
//轿车发出未结算输出表明细
builder.ConfigureBTNotConsignReportDetail(options);
////解放发出未结算输出表
//builder.ConfigureJFNotConsignReport(options);
////解放发出未结算输出表明细
//builder.ConfigureJFNotConsignReportDetail(options);
//解放发出未结算输出表
builder.ConfigureJFNotConsignReport(options);
//解放发出未结算输出表明细
builder.ConfigureJFNotConsignReportDetail(options);
//builder.ConfigureHQKBVersion(options);
//builder.ConfigureHQSpecKBVersion(options);
//builder.ConfigureHQConsignVersion(options);
//builder.ConfigureHQSpecConsignVersion(options);
builder.ConfigureHQKBVersion(options);
builder.ConfigureHQSpecKBVersion(options);
builder.ConfigureHQConsignVersion(options);
builder.ConfigureHQSpecConsignVersion(options);
//builder.ConfigureHQKB(options);
//builder.ConfigureHQSpecKB(options);
//builder.ConfigureHQConsign(options);
//builder.ConfigureHQSpecConsign(options);
//builder.ConfigureTaskJob(options);
//builder.ConfigureImportMap(options);
builder.ConfigureHQKB(options);
builder.ConfigureHQSpecKB(options);
builder.ConfigureHQConsign(options);
builder.ConfigureHQSpecConsign(options);
builder.ConfigureTaskJob(options);
builder.ConfigureImportMap(options);
//builder.ConfigureInvoiceSettledDiff(options);
//builder.ConfigureInventoryDetailVersion(options);
//builder.ConfigureInvoiceSettledDiffVersion(options);
//builder.ConfigurePriceListVersion(options);
//builder.ConfigurePriceList(options);
//builder.ConfigureFIS_TH(options);
//builder.ConfigureMaterialRelationshipVersion(options);
//builder.ConfigureMaterialRelationshipDetail(options);
//builder.ConfigureSettlementPartVersion(options);
////结算关系对照表
//builder.ConfigureSettlementCrossReference(options);
//builder.ConfigureSettlementCrossReferenceVersion(options);
////结算包和跟散件对应关系
//builder.ConfigureSettlementPakAndSpareParts(options);
//builder.ConfigureSettlementPakAndSparePartsVersion(options);
builder.ConfigureInvoiceSettledDiff(options);
builder.ConfigureInventoryDetailVersion(options);
builder.ConfigureInvoiceSettledDiffVersion(options);
builder.ConfigurePriceListVersion(options);
builder.ConfigurePriceList(options);
builder.ConfigureFIS_TH(options);
builder.ConfigureMaterialRelationshipVersion(options);
builder.ConfigureMaterialRelationshipDetail(options);
builder.ConfigureSettlementPartVersion(options);
//结算关系对照表
builder.ConfigureSettlementCrossReference(options);
builder.ConfigureSettlementCrossReferenceVersion(options);
//结算包和跟散件对应关系
builder.ConfigureSettlementPakAndSpareParts(options);
builder.ConfigureSettlementPakAndSparePartsVersion(options);
//builder.ConfigureSecMatchBase(options);
builder.ConfigureSecMatchBase(options);
#endregion

28
src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs

@ -53,6 +53,7 @@ namespace TaskJob.Services
var factory = customConditions.Where(p => p.Name == "Factory").FirstOrDefault().Value;
//_versionRepository.Delete(version);
//_repository.Delete(version);
List<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount> _setls = new List<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
var _id = Guid.NewGuid();
foreach (var itm in fileName)
@ -62,7 +63,7 @@ namespace TaskJob.Services
var filePath = fileSavePath + itm;//获取到导入的excel
var exten = Path.GetExtension(fileSavePath);
List<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount> _setls = new List<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>();
List<string> _errorList = new List<string>();
var checkList = new List<ErrorExportDto>();
@ -130,29 +131,22 @@ namespace TaskJob.Services
else
{
// _setls= _inputService.Input<Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount>(filePath);
var errorlist=new List<ErrorExportDto>();
var dtoList = _inputService.Input<SettleAccountImportDto>(filePath,null,errorlist);
var errorlist = new List<ErrorExportDto>();
var dtoList = _inputService.Input<SettleAccountImportDto>(filePath, null, errorlist);
foreach (var dto in dtoList)
{
if (dto.KENNCode.Length == 6)
{
dto.KENNCode = "0" + dto.KENNCode;
}
var _settleaccount=new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount(Guid.NewGuid(), Guid.NewGuid(),dto.SettleYear, dto.KENNCode,
var _settleaccount = new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount(Guid.NewGuid(), Guid.NewGuid(), dto.SettleYear, dto.KENNCode,
dto.ChassisNumber, dto.Model, dto.CP5A, dto.CP7,
dto.MaterialCode, dto.Qty, dto.SettlementID, dto.SettlementSupplier,
DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now,Guid.NewGuid());
DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now, Guid.NewGuid());
_setls.Add(_settleaccount);
}
}
var _ls = _setls;
var a = _ls.Where(p => string.IsNullOrEmpty(p.KENNCode));
var query = from arc in _ls
group arc by new { arc.ChassisNumber, arc.MaterialCode } into g
where g.Count() > 1
select g;
_repository.Insert(_setls);
_versionRepository.Insert(_id,version, customerCode, customerCode);
@ -169,6 +163,14 @@ namespace TaskJob.Services
throw e;
}
}
_setls = _setls.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.KENNCode }).Select(p => p.FirstOrDefault()).ToList();
_repository.Insert(_setls);
_versionRepository.Insert(_id, version, customerCode, customerCode);
return id.ToString();
}
}

3
src/Modules/SettleAccount/src/SettleAccount.Job/Services/UnSettleAccount/UnSettleAccountImportService.cs

@ -15,6 +15,9 @@ using Win.Sfs.SettleAccount.Repository.SettleAccount;
namespace TaskJob.Services
{
/// <summary>
/// 大众FIS未结数据-服务
/// </summary>
public class UnSettleAccountImportService : ITransientDependency, IImportJob
{
private readonly UnSettleAccountRepository _repository;

Loading…
Cancel
Save