wanggang 1 year ago
parent
commit
746cbf25cc
  1. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  2. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  3. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  4. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs
  5. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  6. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs
  7. 32
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  8. 9
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs
  9. 49
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs
  10. 199
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
  11. 49
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs
  12. 201
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
  13. 10
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
  14. 49
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs
  15. 49
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs
  16. 146
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs
  17. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
  18. 26
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  19. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
  20. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs
  21. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs
  22. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_ADJ_DETAIL.cs
  23. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_DETAIL.cs
  24. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  25. 17
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/MaterialRelationshipManager.cs
  26. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs
  27. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs
  28. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs
  29. 5
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs
  30. 14
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  31. 5521
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.Designer.cs
  32. 158
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.cs
  33. 5539
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817035945_20230817-3.Designer.cs
  34. 54
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817035945_20230817-3.cs
  35. 5542
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817051027_20230817-4.Designer.cs
  36. 45
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817051027_20230817-4.cs
  37. 5548
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817052812_202308170001.Designer.cs
  38. 67
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817052812_202308170001.cs
  39. 67
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

6
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs

@ -80,7 +80,7 @@ public class ZhiGongJianBBACImportDto
/// </summary> /// </summary>
[Display(Name = "Pstng Date")] [Display(Name = "Pstng Date")]
[ImporterHeader(Name = "Pstng Date")] [ImporterHeader(Name = "Pstng Date")]
public string SettleDate { set; get; } public DateTime SettleDate { set; get; }
/// <summary> /// <summary>
/// 客户零件号 /// 客户零件号
@ -212,7 +212,7 @@ public class BeiJianImportDto : BeiJianExtraImportDto
/// </summary> /// </summary>
[Display(Name = "结算日期")] [Display(Name = "结算日期")]
[ImporterHeader(Name = "零件时间")] [ImporterHeader(Name = "零件时间")]
public string SettleDate { set; get; } public DateTime SettleDate { set; get; }
/// <summary> /// <summary>
/// 客户零件号 /// 客户零件号
@ -367,7 +367,7 @@ public class YinDuJianImportDto
/// </summary> /// </summary>
[Display(Name = "Delivery Date")] [Display(Name = "Delivery Date")]
[ImporterHeader(Name = "Delivery Date")] [ImporterHeader(Name = "Delivery Date")]
public string SettleDate { set; get; } public DateTime SettleDate { set; get; }
/// <summary> /// <summary>
/// 客户零件号 /// 客户零件号

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -99,7 +99,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
{ {
foreach (var itm in adjlist) foreach (var itm in adjlist)
{ {
bbaclist.Add(new BBAC_CAN_SA_DETAIL(
var entity = new BBAC_CAN_SA_DETAIL(
guid: itm.Id, guid: itm.Id,
keyCode: itm.KeyCode, keyCode: itm.KeyCode,
version: itm.Version, version: itm.Version,
@ -118,7 +119,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
contactid: itm.Extend1,//生产号 contactid: itm.Extend1,//生产号
invbillnum: string.Empty, invbillnum: string.Empty,
partcode: itm.PartCode partcode: itm.PartCode
)); );
entity.IsMaiDan = itm.IsMaiDan;
bbaclist.Add(entity);
} }
} }
var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据
@ -260,7 +265,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys); var dto1s = ObjectMapper.Map<List<BBAC_CAN_SA_DETAIL>, List<BBAC_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s var q = from d in dto1s
join p in priceList on d.PartCode equals p.LU join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号 where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime//客户零件号
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs

@ -242,7 +242,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
// var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys); // var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in entitys var q = from d in entitys
join p in priceList on d.PartCode equals p.LU join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {

5
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs

@ -51,18 +51,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
public override async Task<string> GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input) public override async Task<string> GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input)
{ {
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount);
var errors=await _hbpoNotMng.GenerateSettlementOrder(entitys); var errors = await _hbpoNotMng.GenerateSettlementOrder(entitys);
if (errors.Count > 0) if (errors.Count > 0)
{ {
List<ERR_EXP_DTO> errorlist = new List<ERR_EXP_DTO>(); List<ERR_EXP_DTO> errorlist = new List<ERR_EXP_DTO>();
foreach (var itm in errors) foreach (var itm in errors)
{ {
errorlist.Add(new ERR_EXP_DTO() { Message = itm }); errorlist.Add(new ERR_EXP_DTO() { Message = itm });
} }
return await ExportErrorReportAsync(errorlist); return await ExportErrorReportAsync(errorlist);
} }
return ApplicationConsts.SuccessStr; return ApplicationConsts.SuccessStr;

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -128,7 +128,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
// var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys); // var dto1s = ObjectMapper.Map<List<HBPO_CAN_SA_DETAIL>, List<HBPO_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in entitys var q = from d in entitys
join p in priceList on d.PartCode equals p.LU join p in priceList on d.LU equals p.LU
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs

@ -40,6 +40,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
PUB_NOT_SA_MNG pubNotMng PUB_NOT_SA_MNG pubNotMng
) : base(excelImportService, snowflakeIdGenerator, commonManager, detailRepository) ) : base(excelImportService, snowflakeIdGenerator, commonManager, detailRepository)
{ {
_pubNotMng = pubNotMng;
} }
public override async Task<string> GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input) public override async Task<string> GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input)

32
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -4,6 +4,7 @@ using System.Globalization;
using System.Linq; using System.Linq;
using System.Linq.Dynamic.Core; using System.Linq.Dynamic.Core;
using System.Threading.Tasks; using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core.Models; using Magicodes.ExporterAndImporter.Core.Models;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
@ -200,7 +201,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
} }
if (pubSaDetails.Any()) if (pubSaDetails.Any())
{ {
await _pubSaDetailRepository.DeleteManyAsync(pubSaDetails); await _pubSaDetailRepository.DbContext.BulkDeleteAsync(pubSaDetails).ConfigureAwait(false);
} }
if (pubCanSas.Any()) if (pubCanSas.Any())
{ {
@ -208,11 +209,11 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
} }
if (pubCanSaDetails.Any()) if (pubCanSaDetails.Any())
{ {
await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetails); await _pubCanSaDetailRepository.DbContext.BulkDeleteAsync(pubCanSaDetails).ConfigureAwait(false);
} }
if (pubNotSaDetails.Any()) if (pubNotSaDetails.Any())
{ {
await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetails); await _pubNotSaDetailRepository.DbContext.BulkDeleteAsync(pubNotSaDetails).ConfigureAwait(false);
} }
} }
@ -254,23 +255,23 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
//删除 //删除
if (pubSas.Any()) if (pubSas.Any())
{ {
await _repository.DeleteManyAsync(pubSas); await _repository.DbContext.BulkDeleteAsync(pubSas).ConfigureAwait(false);
} }
if (pubSaDetails.Any()) if (pubSaDetails.Any())
{ {
await _pubSaDetailRepository.DeleteManyAsync(pubSaDetails); await _pubSaDetailRepository.DbContext.BulkDeleteAsync(pubSaDetails).ConfigureAwait(false);
} }
if (pubCanSas.Any()) if (pubCanSas.Any())
{ {
await _pubCanSaRepository.DeleteManyAsync(pubCanSas); await _pubCanSaRepository.DbContext.BulkDeleteAsync(pubCanSas).ConfigureAwait(false);
} }
if (pubCanSaDetails.Any()) if (pubCanSaDetails.Any())
{ {
await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetails); await _pubCanSaDetailRepository.DbContext.BulkDeleteAsync(pubCanSaDetails).ConfigureAwait(false);
} }
if (pubNotSaDetails.Any()) if (pubNotSaDetails.Any())
{ {
await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetails); await _pubNotSaDetailRepository.DbContext.BulkDeleteAsync(pubNotSaDetails).ConfigureAwait(false);
} }
return new JsonResult(new { Code = 200, Message = "成功" }); return new JsonResult(new { Code = 200, Message = "成功" });
@ -464,6 +465,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
pubSaDetails.ForEach(importPubSaDetail => pubSaDetails.ForEach(importPubSaDetail =>
{ {
importPubSaDetail.SetId(GuidGenerator.Create());
List<string> lus = importPubSaDetail.LU.Split(" ").ToList(); List<string> lus = importPubSaDetail.LU.Split(" ").ToList();
importPubSaDetail.LU = lus[0].Replace(" ", ""); importPubSaDetail.LU = lus[0].Replace(" ", "");
if (lus.Count > 1) if (lus.Count > 1)
@ -542,6 +544,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var pubCanSa = new PUB_CAN_SA() var pubCanSa = new PUB_CAN_SA()
{ {
BillNum = pubCanSaBillNum, BillNum = pubCanSaBillNum,
InvGroupNum = pubCanSaBillNum,
SettleBillNum = pubSaBillNum, SettleBillNum = pubSaBillNum,
State = SettleBillState., State = SettleBillState.,
BusinessType = pubSa.BusinessType, BusinessType = pubSa.BusinessType,
@ -565,22 +568,23 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
#endregion #endregion
#region 添加入库 #region 添加入库
await _repository.InsertAsync(pubSa); await _repository.InsertAsync(pubSa).ConfigureAwait(false);
await _pubSaDetailRepository.InsertManyAsync(pubSaDetails); (await _pubSaDetailRepository.GetDbContextAsync().ConfigureAwait(false)).BulkInsert(pubSaDetails);
if (pubCanSaDetails.Count > 0) if (pubCanSaDetails.Count > 0)
{ {
pubCanSa.InvGroupNum = pubCanSaDetails.Count.ToString();
pubCanSaDetails.ForEach(pubCanSaDetail => pubCanSaDetails.ForEach(pubCanSaDetail =>
{ {
pubCanSaDetail.BillNum = pubCanSaDetail.InvGroupNum = pubCanSaBillNum; pubCanSaDetail.BillNum = pubCanSaDetail.InvGroupNum = pubCanSaBillNum;
}); });
await _pubCanSaRepository.InsertAsync(pubCanSa); await _pubCanSaRepository.InsertAsync(pubCanSa).ConfigureAwait(false);
await _pubCanSaDetailRepository.InsertManyAsync(pubCanSaDetails); await _pubCanSaDetailRepository.DbContext.BulkInsertAsync(pubCanSaDetails).ConfigureAwait(false);
//await _pubCanSaDetailRepository.InsertManyAsync(pubCanSaDetails);
} }
if (pubNotSaDetails.Count > 0) if (pubNotSaDetails.Count > 0)
{ {
await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails); await _pubNotSaDetailRepository.DbContext.BulkInsertAsync(pubNotSaDetails).ConfigureAwait(false);
//await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails);
} }
#endregion #endregion
} }

9
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Coravel.Invocable;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -29,14 +30,18 @@ public class HandSeSyncAppService : ApplicationService
public async Task SyncAsync([FromBody] EnumBusinessType businessType) public async Task SyncAsync([FromBody] EnumBusinessType businessType)
{ {
using var scope = this._applicationServices.CreateScope(); using var scope = this._applicationServices.CreateScope();
JitSeSyncAppService jitSeSyncAppService = businessType switch IInvocable jitSeSyncAppService = businessType switch
{ {
EnumBusinessType.JisBBAC => scope.ServiceProvider.GetRequiredService<JisBBACSeSyncAppService>(),
EnumBusinessType.JisHBPO => scope.ServiceProvider.GetRequiredService<JisHBPOSeSyncAppService>(),
EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService<MaiDanBBACSeSyncAppService>(),
EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService<MaiDanHBPOSeSyncAppService>(),
EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(), EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(), EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService<ZhiGongBBACSeSyncAppService>(),
EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(), EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService<BeiSeSyncAppService>(),
EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(), EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService<YinDuSeSyncAppService>(),
_ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"), _ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"),
}; };
await jitSeSyncAppService.Invoke(); await jitSeSyncAppService.Invoke().ConfigureAwait(false);
} }
} }

49
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// JisBBAC发运同步
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class JisBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService
{
/// <summary>
/// 构造
/// </summary>
public JisBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
{
base.SeSyncConfigInfo = new SeSyncConfig()
{
SyncTableName = "JisBBACSync",
SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件,
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC
},
BusinessType = EnumBusinessType.JisBBAC
};
}
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke().ConfigureAwait(false);
}
}

199
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs

@ -0,0 +1,199 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Coravel.Invocable;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// Jis发运数据同步
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
{
/// <summary>
/// WMS数据上下文
/// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 同步位置标记
/// </summary>
private readonly INormalEfCoreRepository<SyncPositionFlag, Guid> _syncPositionFlagRepository;
/// <summary>
/// Jis发运数据仓储
/// </summary>
private readonly INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> _jisSeDetailRepository;
/// <summary>
/// 客户零件关系领域
/// </summary>
private readonly MaterialRelationshipManager _materialRelationshipManager;
private readonly IVmiService _vmiService;
/// <summary>
/// 构造
/// </summary>
public JisBBACSeSyncBaseAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService)
{
_wmsBJBMPTContext = wmsBJBMPTContext;
_syncPositionFlagRepository = syncPositionFlagRepository;
_jisSeDetailRepository = jisSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager;
_vmiService = vmiService;
}
/// <summary>
/// 发运同步配置
/// </summary>
public SeSyncConfig SeSyncConfigInfo { get; set; }
[HttpPost]
public async Task Invoke()
{
if (SeSyncConfigInfo == null)
{
return;
}
await SyncJitRecordAsync().ConfigureAwait(false);
await CurrentUnitOfWork.SaveChangesAsync().ConfigureAwait(false);
await SyncJisRecordAsync().ConfigureAwait(false);
}
/// <summary>
/// 同步JitRecord
/// </summary>
private async Task SyncJitRecordAsync()
{
//同步表名称
var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit";
//同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型
var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
//业务类别
var businessType = SeSyncConfigInfo.BusinessType;
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == deliverBillType && deliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName).ConfigureAwait(false);
if (syncPositionFlag != null)
{
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position) && t.DeliverBillType == deliverBillType && deliverSubBillTypes.Contains(t.DeliverSubBillType);
}
//WMS发运记录
var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD.Where(predicate).OrderBy(b => b.UID).Take(100000).ToList();
var jisSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<BBAC_SE_DETAIL>>(wmsSeRecords);
jisSeDetails.RemoveAll(t => string.IsNullOrEmpty(t.LU) || string.IsNullOrEmpty(t.FactoryPartCode));
if (jisSeDetails.Any())
{
//客户零件号和厂内零件号
var luRePartCodes = jisSeDetails.Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString()));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
jisSeDetails.ForEach(t =>
{
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU;
});
await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = wmsSeRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag).ConfigureAwait(false);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = wmsSeRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false);
}
}
}
/// <summary>
/// 同步JisRecord
/// </summary>
private async Task SyncJisRecordAsync()
{
//同步表名称
var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis";
//同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型
var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
//业务类别
var businessType = SeSyncConfigInfo.BusinessType;
Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => t.DeliverBillType == deliverBillType && deliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName).ConfigureAwait(false);
if (syncPositionFlag != null)
{
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position) && t.DeliverBillType == deliverBillType && deliverSubBillTypes.Contains(t.DeliverSubBillType);
}
//WMS发运数据
var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).Take(100000).ToList();
var jisSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<BBAC_SE_DETAIL>>(wmsRecords);
jisSeDetails.RemoveAll(t => string.IsNullOrEmpty(t.LU) || string.IsNullOrEmpty(t.FactoryPartCode));
if (jisSeDetails.Any())
{
//客户零件号和厂内零件号
var luRePartCodes = jisSeDetails.Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString()));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
jisSeDetails.ForEach(t =>
{
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU;
});
await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = wmsRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag).ConfigureAwait(false);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = wmsRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false); ;
}
}
}
}

49
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// JisHBPO发运同步
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class JisHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService
{
/// <summary>
/// 构造
/// </summary>
public JisHBPOSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
{
base.SeSyncConfigInfo = new SeSyncConfig()
{
SyncTableName = "JisHBPOSync",
SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件,
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO
},
BusinessType = EnumBusinessType.MaiDanJianHBPO
};
}
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke().ConfigureAwait(false);
}
}

201
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs

@ -0,0 +1,201 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Coravel.Invocable;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// Jis发运数据同步
/// </summary>
[ApiExplorerSettings(IgnoreApi = true)]
public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
{
/// <summary>
/// WMS数据上下文
/// </summary>
private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
/// <summary>
/// 同步位置标记
/// </summary>
private readonly INormalEfCoreRepository<SyncPositionFlag, Guid> _syncPositionFlagRepository;
/// <summary>
/// Jis发运数据仓储
/// </summary>
private readonly INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> _jisSeDetailRepository;
/// <summary>
/// 客户零件关系领域
/// </summary>
private readonly MaterialRelationshipManager _materialRelationshipManager;
private readonly IVmiService _vmiService;
/// <summary>
/// 构造
/// </summary>
public JisHBPOSeSyncBaseAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService)
{
_wmsBJBMPTContext = wmsBJBMPTContext;
_syncPositionFlagRepository = syncPositionFlagRepository;
_jisSeDetailRepository = jisSeDetailRepository;
_materialRelationshipManager = materialRelationshipManager;
_vmiService = vmiService;
}
/// <summary>
/// 发运同步配置
/// </summary>
public SeSyncConfig SeSyncConfigInfo { get; set; }
[HttpPost]
public async Task Invoke()
{
if (SeSyncConfigInfo == null)
{
return;
}
await SyncJitRecordAsync().ConfigureAwait(false);
await CurrentUnitOfWork.SaveChangesAsync().ConfigureAwait(false);
await SyncJisRecordAsync().ConfigureAwait(false);
}
/// <summary>
/// 同步JitRecord
/// </summary>
[UnitOfWork]
private async Task SyncJitRecordAsync()
{
//同步表名称
var syncTableName = "JisBBACSeSync_Jit";
//同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型
var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
//业务类别
var businessType = SeSyncConfigInfo.BusinessType;
Expression<Func<TM_BJBMPT_JIT_RECORD, bool>> predicate = (t) => t.DeliverBillType == deliverBillType && deliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName).ConfigureAwait(false);
if (syncPositionFlag != null)
{
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position) && t.DeliverBillType == deliverBillType && deliverSubBillTypes.Contains(t.DeliverSubBillType);
}
//WMS发运记录
var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD.Where(predicate).OrderBy(b => b.UID).Take(100000).ToList();
var jisSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIT_RECORD>, List<HBPO_SE_DETAIL>>(wmsSeRecords);
jisSeDetails.RemoveAll(t => string.IsNullOrEmpty(t.LU) || string.IsNullOrEmpty(t.FactoryPartCode));
if (jisSeDetails.Any())
{
//客户零件号和厂内零件号
var luRePartCodes = jisSeDetails.Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString()));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
jisSeDetails.ForEach(t =>
{
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU;
});
await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = wmsSeRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag).ConfigureAwait(false);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = wmsSeRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false);
}
}
}
/// <summary>
/// 同步JisRecord
/// </summary>
[UnitOfWork]
private async Task SyncJisRecordAsync()
{
//同步表名称
var syncTableName = "JisBBACSeSync_Jit";
//同步发运主类型
var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
//同步发运子类型
var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
//业务类别
var businessType = SeSyncConfigInfo.BusinessType;
Expression<Func<TM_BJBMPT_JIS_RECORD, bool>> predicate = (t) => t.DeliverBillType == deliverBillType && deliverSubBillTypes.Contains(t.DeliverSubBillType);
var syncPositionFlag = await _syncPositionFlagRepository.FindAsync(t => t.TableName == syncTableName).ConfigureAwait(false);
if (syncPositionFlag != null)
{
predicate = (t) => t.UID > int.Parse(syncPositionFlag.Position) && t.DeliverBillType == deliverBillType && deliverSubBillTypes.Contains(t.DeliverSubBillType);
}
//WMS发运数据
var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD.Where(predicate).OrderBy(b => b.UID).Take(100000).ToList();
var jisSeDetails = ObjectMapper.Map<List<TM_BJBMPT_JIS_RECORD>, List<HBPO_SE_DETAIL>>(wmsRecords);
jisSeDetails.RemoveAll(t => string.IsNullOrEmpty(t.LU) || string.IsNullOrEmpty(t.FactoryPartCode));
if (jisSeDetails.Any())
{
//客户零件号和厂内零件号
var luRePartCodes = jisSeDetails.Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any())
{
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString()));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
}
jisSeDetails.ForEach(t =>
{
//t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU;
});
await _jisSeDetailRepository.DbContext.BulkInsertAsync(jisSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null)
{
syncPositionFlag.Position = wmsRecords.Last().UID.ToString();
await _syncPositionFlagRepository.UpdateAsync(syncPositionFlag).ConfigureAwait(false);
}
else
{
syncPositionFlag = new SyncPositionFlag()
{
TableName = syncTableName,
Position = wmsRecords.Last().UID.ToString()
};
await _syncPositionFlagRepository.InsertAsync(syncPositionFlag).ConfigureAwait(false); ;
}
}
}
}

10
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs

@ -4,6 +4,7 @@ using System.Linq;
using System.Linq.Expressions; using System.Linq.Expressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Coravel.Invocable; using Coravel.Invocable;
using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ; using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services; using Volo.Abp.Application.Services;
@ -92,23 +93,24 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).OrderBy(b => b.UID).ToList(); var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).OrderBy(b => b.UID).ToList();
var pubSeDetails = ObjectMapper.Map<List<TM_BJBMPT_OTHER_RECORD>, List<PUB_SE_DETAIL>>(wmsSeRecords); var pubSeDetails = ObjectMapper.Map<List<TM_BJBMPT_OTHER_RECORD>, List<PUB_SE_DETAIL>>(wmsSeRecords);
pubSeDetails.RemoveAll(t => string.IsNullOrEmpty(t.LU) || string.IsNullOrEmpty(t.PartCode)); pubSeDetails.RemoveAll(t => string.IsNullOrEmpty(t.LU) || string.IsNullOrEmpty(t.FactoryPartCode));
if (pubSeDetails.Any()) if (pubSeDetails.Any())
{ {
//客户零件号和厂内零件号 //客户零件号和厂内零件号
var luRePartCodes = pubSeDetails.Select(t => new { t.LU, t.PartCode }).Distinct().ToList(); var luRePartCodes = pubSeDetails.Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList();
if (luRePartCodes.Any()) if (luRePartCodes.Any())
{ {
var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.PartCode, businessType.ToString())); var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.LU, "", t.FactoryPartCode, businessType.ToString()));
await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false); await _materialRelationshipManager.AddNewMaterialRelationships(materialRelationships).ConfigureAwait(false);
} }
pubSeDetails.ForEach(t => pubSeDetails.ForEach(t =>
{ {
t.SetId(GuidGenerator.Create());
t.BusinessType = businessType; t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU; t.KeyCode = t.PN + t.LU;
}); });
await _pubSeDetailRepository.InsertManyAsync(pubSeDetails).ConfigureAwait(false); await _pubSeDetailRepository.DbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null) if (syncPositionFlag != null)
{ {

49
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// 买单件BBAC发运同步
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class MaiDanBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService
{
/// <summary>
/// 构造
/// </summary>
public MaiDanBBACSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<BBAC_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
{
base.SeSyncConfigInfo = new SeSyncConfig()
{
SyncTableName = "MaiDanBBACSync",
SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件,
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.BBAC,
EnumDeliverSubBillType.BBAC
},
BusinessType = EnumBusinessType.MaiDanJianBBAC
};
}
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke().ConfigureAwait(false);
}
}

49
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Managers;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.SettleAccount.EntityFrameworkCore;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
/// <summary>
/// 买单件HBPO发运同步
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class MaiDanHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService
{
/// <summary>
/// 构造
/// </summary>
public MaiDanHBPOSeSyncAppService(
WMSBJBMPTDbContext wmsBJBMPTContext,
INormalEfCoreRepository<SyncPositionFlag, Guid> syncPositionFlagRepository,
INormalEfCoreRepository<HBPO_SE_DETAIL, Guid> jisSeDetailRepository,
MaterialRelationshipManager materialRelationshipManager,
VmiAppService vmiService
) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
{
base.SeSyncConfigInfo = new SeSyncConfig()
{
SyncTableName = "MaiDanHBPOSync",
SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件,
SyncDeliverSubBillTypes = new List<EnumDeliverSubBillType>
{
EnumDeliverSubBillType.HBPO,
EnumDeliverSubBillType.HBPO
},
BusinessType = EnumBusinessType.MaiDanJianHBPO
};
}
public async Task Invoke(IServiceProvider serviceProvider)
{
await this.Invoke().ConfigureAwait(false);
}
}

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

@ -4,9 +4,14 @@ using System.Linq;
using System.ServiceModel.Channels; using System.ServiceModel.Channels;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Nito.AsyncEx;
using SettleAccount.Domain.BQ;
using TaskJob.EventArgs; using TaskJob.EventArgs;
using TaskJob.Interfaces; using TaskJob.Interfaces;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Vmi;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs;
@ -16,23 +21,162 @@ public class PendingDeductionService : ITransientDependency, IExportJob
protected readonly INormalEfCoreRepository<BBAC_SEC_DETAIL, Guid> _bbacSecRepository; protected readonly INormalEfCoreRepository<BBAC_SEC_DETAIL, Guid> _bbacSecRepository;
protected readonly INormalEfCoreRepository<HBPO_SEC_DETAIL, Guid> _hbpoSecRepository; protected readonly INormalEfCoreRepository<HBPO_SEC_DETAIL, Guid> _hbpoSecRepository;
protected readonly INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> _pubSecRepository; protected readonly INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> _pubSecRepository;
protected readonly INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> _bbacRepository;
protected readonly INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> _hbpoRepository;
protected readonly INormalEfCoreRepository<PUB_PD_DETAIL, Guid> _pubRepository;
public PendingDeductionService( public PendingDeductionService(
INormalEfCoreRepository<BBAC_SEC_DETAIL, Guid> bbacSecRepository, INormalEfCoreRepository<BBAC_SEC_DETAIL, Guid> bbacSecRepository,
INormalEfCoreRepository<HBPO_SEC_DETAIL, Guid> hbpoSecRepository, INormalEfCoreRepository<HBPO_SEC_DETAIL, Guid> hbpoSecRepository,
INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> pubSecRepository, INormalEfCoreRepository<PUB_SEC_DETAIL, Guid> pubSecRepository,
INormalEfCoreRepository<BBAC_PD_DETAIL, Guid> bbacRepository,
INormalEfCoreRepository<HBPO_PD_DETAIL, Guid> hbpoRepository,
INormalEfCoreRepository<PUB_PD_DETAIL, Guid> pubRepository,
VmiAppService vimservice VmiAppService vimservice
) )
{ {
_hbpoRepository = hbpoRepository;
_bbacRepository= bbacRepository;
_pubRepository= pubRepository;
_bbacSecRepository = bbacSecRepository; _bbacSecRepository = bbacSecRepository;
_hbpoSecRepository= hbpoSecRepository; _hbpoSecRepository= hbpoSecRepository;
_pubSecRepository= pubSecRepository; _pubSecRepository= pubSecRepository;
_vimservice =vimservice; _vimservice =vimservice;
} }
public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> condition) public string ExportFile(Guid id, List<string> exportName, List<CustomCondition> property)
{ {
var list = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value;
var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value;
if (type == "BBACJIS")
{
var jisdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan==false);
var mdetail = _bbacRepository.Where(p => list.Contains(p.BillNum) && p.IsMaiDan ==true);
var query = from itm in jisdetail
join itm1 in _bbacSecRepository
on new { itm.PN, itm.LU } equals new { itm1.PN,LU= itm1.PrimitiveLU } into temp1
from tm in temp1
where tm == null
select
new
{
BillTime = DateTime.Now,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = tm!=null?tm.ReplaceLU:itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = tm != null ? tm.ReplaceLU : itm.LU,
CustomerPartCode =string.IsNullOrEmpty(itm.Extend4)?string.Empty:itm.Extend4,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
};
var ls=query.ToList();
if (ls != null && ls.Count > 0)
{
foreach (var itm in ls)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.BillTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.BillTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.PartCode,
SettlementVinCode = itm.VinCode,
PartCode2 = itm.PartCode2,
CustomerPartCode = itm.CustomerPartCode,
VinCode = itm.VinCode,
OrderNum = itm.OrderNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
}
else if (type == "HBPOJIS")
{
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
}
else
{
var detailist = _hbpoRepository.Where(p => list.Contains(p.BillNum)).ToList();
if (detailist != null && detailist.Count > 0)
{
foreach (var itm in detailist)
{
_vimservice.Out(Entities.BQ.Vmi.VmiLogType.Type200, "1", new Entities.BQ.Vmi.VmiLog()
{
BillTime = itm.CreationTime,
ChangedTime = DateTime.Now,
Qty = itm.Qty,
DeliverTime = itm.CreationTime,
LogType = Entities.BQ.Vmi.VmiLogType.Type200,
ChangedQty = itm.Qty,
ChangedType = VmiType.Out,
SubBillType = EnumDeliverSubBillType.BBAC,
BillType = EnumDeliverBjBmpBillType.JIS件,
PartCode = itm.LU,
SettlementVinCode = itm.PN,
PartCode2 = itm.LU,
CustomerPartCode = itm.LU,
VinCode = itm.PN,
OrderNum = itm.GroupNum,
ErpToLoc = "C0001"
}).ConfigureAwait(false);
}
}
}
return ApplicationConsts.SuccessStr;
return id.ToString(); return id.ToString();
} }
} }

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj

@ -111,6 +111,8 @@
<ItemGroup> <ItemGroup>
<Compile Remove="Entities\BQ\Syncs\BBACSeSyncAppService.cs" />
<Compile Remove="Entities\BQ\Syncs\HBPOSeSyncAppService.cs" />
<Compile Remove="Entities\JFCarConsignAppService.cs" /> <Compile Remove="Entities\JFCarConsignAppService.cs" />
<Compile Remove="Entities\JFCarKBAppService.cs" /> <Compile Remove="Entities\JFCarKBAppService.cs" />
</ItemGroup> </ItemGroup>

26
code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs

@ -227,7 +227,7 @@ namespace Win.Sfs.SettleAccount
private void CreateMapBBAC_NOT_SA_DETAIL() private void CreateMapBBAC_NOT_SA_DETAIL()
{ {
CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_DTO>().ReverseMap();
CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_REQ_DTO>().ReverseMap(); CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_EXP_DTO>().ReverseMap(); CreateMap<BBAC_NOT_SA_DETAIL, BBAC_NOT_SA_DETAIL_EXP_DTO>().ReverseMap();
@ -250,7 +250,7 @@ namespace Win.Sfs.SettleAccount
private void CreateMapHBPO_NOT_SA_DETAIL() private void CreateMapHBPO_NOT_SA_DETAIL()
{ {
CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_DTO>().ReverseMap();
CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_REQ_DTO>().ReverseMap(); CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_REQ_DTO>().ReverseMap();
CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_EXP_DTO>().ReverseMap(); CreateMap<HBPO_NOT_SA_DETAIL, HBPO_NOT_SA_DETAIL_EXP_DTO>().ReverseMap();
@ -1135,7 +1135,8 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData)) .ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum)) .ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode)) .ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIT_RECORD, HBPO_SE_DETAIL>() CreateMap<TM_BJBMPT_JIT_RECORD, HBPO_SE_DETAIL>()
@ -1145,14 +1146,16 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData)) .ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum)) .ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode)) .ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIT_RECORD, PUB_SE_DETAIL>() CreateMap<TM_BJBMPT_JIT_RECORD, PUB_SE_DETAIL>()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData)) .ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum)) .ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode)) .ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
@ -1163,7 +1166,8 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum)) .ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode)) .ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIS_RECORD, HBPO_SE_DETAIL>() CreateMap<TM_BJBMPT_JIS_RECORD, HBPO_SE_DETAIL>()
@ -1173,14 +1177,16 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum)) .ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode)) .ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
CreateMap<TM_BJBMPT_JIS_RECORD, PUB_SE_DETAIL>() CreateMap<TM_BJBMPT_JIS_RECORD, PUB_SE_DETAIL>()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.BeginDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum)) .ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.RealPartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode)) .ForMember(x => x.PN, y => y.MapFrom(d => d.VinCode))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
@ -1188,8 +1194,8 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData)) .ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime)) .ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum)) .ForMember(x => x.WmsBillNum, y => y.MapFrom(d => d.BillNum))
//.ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode)) .ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
.ForMember(x => x.LU, y => y.MapFrom(d => d.PartCode)) .ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.BillNum)) .ForMember(x => x.PN, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty)); .ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
} }

13
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs

@ -546,21 +546,24 @@ namespace SettleAccount.Bases
/// 发运单号 /// 发运单号
/// </summary> /// </summary>
public string WmsBillNum { set; get; } public string WmsBillNum { set; get; }
/// <summary> /// <summary>
/// 厂内零件号 /// 客户零件号
/// </summary> /// </summary>
public string LU { get; set; } public string LU { get; set; }
/// <summary> /// <summary>
/// 生產號 /// 厂内零件号
/// </summary>
public string FactoryPartCode { get; set; }
/// <summary>
/// 生产号
/// </summary> /// </summary>
public string PN { get; set; } public string PN { get; set; }
/// <summary> /// <summary>
/// 組合鍵值(LU+PN) /// 组合键值(PN+LU
/// </summary> /// </summary>
public string KeyCode { get; set; } public string KeyCode { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public decimal Qty { get; set; } public decimal Qty { get; set; }
} }

3
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs

@ -1,4 +1,4 @@
using SettleAccount.Bases; using SettleAccount.Bases;
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
@ -47,6 +47,7 @@ public class BBAC_PD_DETAIL:PD_BASE
//public string GroupNum { get; set; } = null!; //public string GroupNum { get; set; } = null!;
public bool IsMaiDan { get; set; }
public BBAC_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum public BBAC_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum
,string extend1,string extend2,string extend3,string extend4 ,string extend1,string extend2,string extend3,string extend4

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs

@ -270,9 +270,8 @@ public class BBAC_SE_DETAIL:SE_BASE
} }
public BBAC_SE_DETAIL SetQty(decimal qty) public void SetId(Guid id)
{ {
this.Qty = qty; Id = id;
return this;
} }
} }

6
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_ADJ_DETAIL.cs

@ -105,7 +105,11 @@ public class HBPO_ADJ_DETAIL : SA_NOT_BASE
[Display(Name = "发票号")] [Display(Name = "发票号")]
public string InvBillNum { get; set; } public string InvBillNum { get; set; }
/// <summary>
/// 是否是买单件
/// </summary>
[Display(Name = "是否是买单件")]
public bool IsMaiDan { get; set; }
public HBPO_ADJ_DETAIL(Guid guid ,string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType, string oldinv, string inv) public HBPO_ADJ_DETAIL(Guid guid ,string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType, string oldinv, string inv)

11
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_DETAIL.cs

@ -10,6 +10,12 @@ namespace SettleAccount.Domain.BQ;
[Display(Name = "HBPO发运数据")] [Display(Name = "HBPO发运数据")]
public class HBPO_SE_DETAIL :SE_BASE public class HBPO_SE_DETAIL :SE_BASE
{ {
/// <summary>
/// 业务分类
/// </summary>
[Display(Name = "业务分类")]
public EnumBusinessType BusinessType { get; set; }
//[Display(Name = "LU+生产码")] //[Display(Name = "LU+生产码")]
//public string KeyCode { get; set; } = null!; //public string KeyCode { get; set; } = null!;
@ -263,4 +269,9 @@ public class HBPO_SE_DETAIL :SE_BASE
public HBPO_SE_DETAIL() public HBPO_SE_DETAIL()
{ {
} }
public void SetId(Guid id)
{
Id = id;
}
} }

13
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -479,6 +479,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
contactid: itm.Extend1,//生产号 contactid: itm.Extend1,//生产号
invbillnum: itm.InvBillNum, invbillnum: itm.InvBillNum,
partcode:itm.PartCode partcode:itm.PartCode
)); ));
} }
} }
@ -509,6 +510,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
version: itm.Version, version: itm.Version,
billNum: itm.InvbillNum, billNum: itm.InvbillNum,
lU: itm.LU, lU: itm.LU,
rELU: string.Empty, rELU: string.Empty,
pN: itm.PN, pN: itm.PN,
rEPN: string.Empty, rEPN: string.Empty,
@ -521,7 +524,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend1: string.Empty, extend1: string.Empty,
extend2: string.Empty, extend2: string.Empty,
extend3: string.Empty, extend3: string.Empty,
extend4: string.Empty extend4: itm.PartCode
)); ));
} }
await _repository.DbContext.BulkInsertAsync(bbacmainlist); await _repository.DbContext.BulkInsertAsync(bbacmainlist);
@ -664,7 +667,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend1: string.Empty, extend1: string.Empty,
extend2: string.Empty, extend2: string.Empty,
extend3: string.Empty, extend3: string.Empty,
extend4: string.Empty extend4: itm.PartCode
)); ));
} }
await _repository.DbContext.BulkInsertAsync(bbacmainlist); await _repository.DbContext.BulkInsertAsync(bbacmainlist);
@ -807,7 +810,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
extend1: string.Empty, extend1: string.Empty,
extend2: string.Empty, extend2: string.Empty,
extend3: string.Empty, extend3: string.Empty,
extend4: string.Empty extend4: itm.PartCode
)); ));
} }
await _repository.DbContext.BulkInsertAsync(bbacmainlist); await _repository.DbContext.BulkInsertAsync(bbacmainlist);
@ -1530,7 +1533,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
//更新结算记录更新 //更新结算记录更新
var query = from itm in dtos var query = from itm in dtos
join itm1 in ls join itm1 in ls
on new { LU=itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } on new { LU=itm.LU,itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate }
join itm2 in details on new { itm.LU,itm.PartCode,itm.PN, itm.SettleDate } equals new { itm2.LU,itm2.PartCode,itm2.PN,itm2.SettleDate } join itm2 in details on new { itm.LU,itm.PartCode,itm.PN, itm.SettleDate } equals new { itm2.LU,itm2.PartCode,itm2.PN,itm2.SettleDate }
select itm2; select itm2;
foreach (var itm in query) foreach (var itm in query)
@ -1542,7 +1545,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
{ {
var query1 = from itm in dtos var query1 = from itm in dtos
join itm1 in ls join itm1 in ls
on new {LU= itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } on new {LU= itm.LU,itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate }
join itm2 in p_adjlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } join itm2 in p_adjlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate }
select itm2; select itm2;

17
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/MaterialRelationshipManager.cs

@ -4,6 +4,7 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Services; using Volo.Abp.Domain.Services;
using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.Shared.RepositoryBase;
@ -28,13 +29,15 @@ public class MaterialRelationshipManager : DomainService
/// </summary> /// </summary>
public async Task AddNewMaterialRelationships(IEnumerable<MaterialRelationship> materialRelationships) public async Task AddNewMaterialRelationships(IEnumerable<MaterialRelationship> materialRelationships)
{ {
//客户零件号和厂内零件号 //新客户零件号和厂内零件号
var luRePartCodes = materialRelationships.Select(t => new { t.ErpMaterialCode, t.SettleMaterialCode }).Distinct().ToList(); var noHaveLuRePartCodes = from item1 in materialRelationships
var haveLuRePartCodes = materialRelationships.Join(_materialRelationshipRepository.AsNoTracking(), join item2 in _materialRelationshipRepository
a => new { a.ErpMaterialCode, a.SettleMaterialCode }, on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode }
b => new { b.ErpMaterialCode, b.SettleMaterialCode }, into temp
(a, b) => a).ToList(); from item3 in temp.DefaultIfEmpty()
var noHaveLuRePartCodes = materialRelationships.Except(haveLuRePartCodes).ToList(); where item3 == null
select item1;
if (noHaveLuRePartCodes.Any()) if (noHaveLuRePartCodes.Any())
{ {
await _materialRelationshipRepository.InsertManyAsync(noHaveLuRePartCodes).ConfigureAwait(false); await _materialRelationshipRepository.InsertManyAsync(noHaveLuRePartCodes).ConfigureAwait(false);

4
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs

@ -233,7 +233,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <returns></returns> /// <returns></returns>
public virtual async Task<List<PUB_CAN_SA_DETAIL>> GetDetalListAsync(string billNum) public virtual async Task<List<PUB_CAN_SA_DETAIL>> GetDetalListAsync(string billNum)
{ {
return await _detailRepository.Where(p=>p.InvGroupNum==billNum).ToListAsync(); return await _detailRepository.Where(p=>p.BillNum==billNum).ToListAsync();
} }
/// <summary> /// <summary>
/// 获得主表信息 /// 获得主表信息
@ -242,7 +242,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
/// <returns></returns> /// <returns></returns>
public virtual async Task<PUB_CAN_SA> GetMainAsync(string billNum) public virtual async Task<PUB_CAN_SA> GetMainAsync(string billNum)
{ {
return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync(); return await _repository.Where(p => p.BillNum == billNum).FirstOrDefaultAsync();
} }
/// <summary> /// <summary>
/// 获取发票对应结算分组所有零件 /// 获取发票对应结算分组所有零件

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs

@ -70,6 +70,8 @@ public class PUB_ADJ_DETAIL : SA_NOT_BASE
[Display(Name = "发票号")] [Display(Name = "发票号")]
public string InvBillNum { get; set; } public string InvBillNum { get; set; }
[Display(Name = "是否是买单件")]
public bool IsMaiDan { get; set; }
public PUB_ADJ_DETAIL(Guid id, string keyCode, int version, string settleBillNum, string lU, string pN, public PUB_ADJ_DETAIL(Guid id, string keyCode, int version, string settleBillNum, string lU, string pN,
string site, decimal qty, string extend1, decimal price, string invGroupNum, DateTime settleDate, string site, decimal qty, string extend1, decimal price, string invGroupNum, DateTime settleDate,

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs

@ -133,4 +133,9 @@ public class PUB_SA_DETAIL:SA_BASE
public PUB_SA_DETAIL() public PUB_SA_DETAIL()
{ {
} }
public void SetId(Guid id)
{
Id = id;
}
} }

5
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs

@ -193,4 +193,9 @@ public class PUB_SE_DETAIL :SE_BASE
public PUB_SE_DETAIL() public PUB_SE_DETAIL()
{ {
} }
public void SetId(Guid id)
{
Id = id;
}
} }

14
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs

@ -1342,12 +1342,14 @@ namespace Win.Sfs.SettleAccount
//seed //seed
builder.Entity<JobItem>().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" }); builder.Entity<JobItem>().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" });
builder.Entity<JobItem>().HasData(new JobItem("BBACSeSync".ToGuid()) { Name = "BBAC发运数据同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BBACSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("JisBBACSeSync".ToGuid()) { Name = "JisBBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("HBPOSeSync".ToGuid()) { Name = "HBPO发运数据同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.HBPOSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("JisHBPOSeSync".ToGuid()) { Name = "JisHBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("MaiDanBBACSeSync".ToGuid()) { Name = "买单件BBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("MaiDanHBPOSeSync".ToGuid()) { Name = "买单件HBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("YinDuSeSync".ToGuid()) { Name = "印度件发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" }); builder.Entity<JobItem>().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" });
builder.Entity<JobItem>().HasData(new JobItem("YinDuSeSync".ToGuid()) { Name = "印度件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("发运入库".ToGuid()) { Type = VmiType.In, Name = "发运入库", Number = "100" }); //builder.Entity<VmiCategory>().HasData(new VmiCategory("发运入库".ToGuid()) { Type = VmiType.In, Name = "发运入库", Number = "100" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("结算出库".ToGuid()) { Type = VmiType.Out, Name = "结算出库", Number = "200" }); //builder.Entity<VmiCategory>().HasData(new VmiCategory("结算出库".ToGuid()) { Type = VmiType.Out, Name = "结算出库", Number = "200" });
//builder.Entity<VmiCategory>().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" }); //builder.Entity<VmiCategory>().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" });

5521
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.Designer.cs

File diff suppressed because it is too large

158
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.cs

@ -0,0 +1,158 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308172 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("d6d5e1d7-9326-ceea-eed4-fb4039e7ee68"));
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("9f155520-78d6-44b1-b8d4-dbdc31507b21"));
migrationBuilder.AddColumn<string>(
name: "FactoryPartCode",
table: "Set_PUB_SE_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FactoryPartCode",
table: "Set_HBPO_SE_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "FactoryPartCode",
table: "Set_BBAC_SE_DETAIL",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "Cron",
value: "0 0/30 * * * ? ");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "Cron",
value: "0 0/30 * * * ? ");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "Cron",
value: "0 0/30 * * * ? ");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "Cron",
value: "0 0/30 * * * ? ");
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[,]
{
{ new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"), "0 0/30 * * * ? ", null, false, false, "买单件BBAC发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" },
{ new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"), "0 0/30 * * * ? ", null, false, false, "买单件HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" }
});
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("514d1103-1558-4b8c-9172-6d0dd6a4eb32"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "78276bb327a64a0982919addb1cc1bcf", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"));
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("514d1103-1558-4b8c-9172-6d0dd6a4eb32"));
migrationBuilder.DropColumn(
name: "FactoryPartCode",
table: "Set_PUB_SE_DETAIL");
migrationBuilder.DropColumn(
name: "FactoryPartCode",
table: "Set_HBPO_SE_DETAIL");
migrationBuilder.DropColumn(
name: "FactoryPartCode",
table: "Set_BBAC_SE_DETAIL");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
column: "Cron",
value: "0 0/10 * * * ? ");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
column: "Cron",
value: "0 0/10 * * * ? ");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
column: "Cron",
value: "0 0/10 * * * ? ");
migrationBuilder.UpdateData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
column: "Cron",
value: "0 0/10 * * * ? ");
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[,]
{
{ new Guid("d6d5e1d7-9326-ceea-eed4-fb4039e7ee68"), "0 0/10 * * * ? ", null, false, false, "BBAC发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BBACSeSyncAppService" },
{ new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"), "0 0/10 * * * ? ", null, false, false, "HBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.HBPOSeSyncAppService" }
});
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("9f155520-78d6-44b1-b8d4-dbdc31507b21"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "4e37e65449bf44728f7a3cf6a93d4e01", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
}
}
}

5539
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817035945_20230817-3.Designer.cs

File diff suppressed because it is too large

54
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817035945_20230817-3.cs

@ -0,0 +1,54 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308173 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("514d1103-1558-4b8c-9172-6d0dd6a4eb32"));
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"), "0 0/30 * * * ? ", null, false, false, "JisBBAC发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" });
migrationBuilder.InsertData(
table: "Set_JobItem",
columns: new[] { "Id", "Cron", "HeartBeat", "IsDisabled", "IsRunning", "Name", "Service" },
values: new object[] { new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"), "0 0/30 * * * ? ", null, false, false, "JisHBPO发运数据同步", "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" });
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("9574edd9-55aa-48b6-bb63-fae78eaf5cf7"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "14dfff8fd6ae4d639ca21b8c8c950de5", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"));
migrationBuilder.DeleteData(
table: "Set_JobItem",
keyColumn: "Id",
keyValue: new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"));
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("9574edd9-55aa-48b6-bb63-fae78eaf5cf7"));
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("514d1103-1558-4b8c-9172-6d0dd6a4eb32"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "78276bb327a64a0982919addb1cc1bcf", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
}
}
}

5542
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817051027_20230817-4.Designer.cs

File diff suppressed because it is too large

45
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817051027_20230817-4.cs

@ -0,0 +1,45 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308174 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("9574edd9-55aa-48b6-bb63-fae78eaf5cf7"));
migrationBuilder.AddColumn<int>(
name: "BusinessType",
table: "Set_HBPO_SE_DETAIL",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("65c2e515-7ca9-4b2e-8c16-a066175d1190"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "2ccdf785b5c648349a36813097be6165", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("65c2e515-7ca9-4b2e-8c16-a066175d1190"));
migrationBuilder.DropColumn(
name: "BusinessType",
table: "Set_HBPO_SE_DETAIL");
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("9574edd9-55aa-48b6-bb63-fae78eaf5cf7"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "14dfff8fd6ae4d639ca21b8c8c950de5", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
}
}
}

5548
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817052812_202308170001.Designer.cs

File diff suppressed because it is too large

67
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817052812_202308170001.cs

@ -0,0 +1,67 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202308170001 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("9574edd9-55aa-48b6-bb63-fae78eaf5cf7"));
migrationBuilder.AddColumn<bool>(
name: "IsMaiDan",
table: "Set_PUB_ADJ_DETAIL",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsMaiDan",
table: "Set_HBPO_ADJ_DETAIL",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsMaiDan",
table: "Set_BBAC_PD_DETAIL",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "3a0fa479f64a4e84949961ac4a8aed89", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Set_VmiBalance",
keyColumn: "Id",
keyValue: new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c"));
migrationBuilder.DropColumn(
name: "IsMaiDan",
table: "Set_PUB_ADJ_DETAIL");
migrationBuilder.DropColumn(
name: "IsMaiDan",
table: "Set_HBPO_ADJ_DETAIL");
migrationBuilder.DropColumn(
name: "IsMaiDan",
table: "Set_BBAC_PD_DETAIL");
migrationBuilder.InsertData(
table: "Set_VmiBalance",
columns: new[] { "Id", "BackupTime", "BillTime", "BillType", "CodeType", "ConcurrencyStamp", "Configcode", "CustomerPartCode", "DeliverTime", "ErpToLoc", "MatchNumber", "OrderNum", "PartCode", "PjsNum", "Qty", "ReMark", "RealCode", "Seq", "SubBillType", "UniqueCode", "VinCode", "factory" },
values: new object[] { new Guid("9574edd9-55aa-48b6-bb63-fae78eaf5cf7"), null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 1, null, "14dfff8fd6ae4d639ca21b8c8c950de5", null, null, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), "ErpToLoc", null, "OrderNum", "PartCode", null, 0m, null, null, null, 0, null, "VinCode", null });
}
}
}

67
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

@ -411,6 +411,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasDefaultValue(false) .HasDefaultValue(false)
.HasColumnName("IsDeleted"); .HasColumnName("IsDeleted");
b.Property<bool>("IsMaiDan")
.HasColumnType("bit");
b.Property<string>("KeyCode") b.Property<string>("KeyCode")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
@ -689,6 +692,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Factory") b.Property<string>("Factory")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("FactoryPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("FromLoc") b.Property<string>("FromLoc")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -1178,6 +1184,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
b.Property<bool>("IsMaiDan")
.HasColumnType("bit");
b.Property<string>("KeyCode") b.Property<string>("KeyCode")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
@ -1825,6 +1834,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<int>("BillType") b.Property<int>("BillType")
.HasColumnType("int"); .HasColumnType("int");
b.Property<int>("BusinessType")
.HasColumnType("int");
b.Property<string>("CodeType") b.Property<string>("CodeType")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -1875,6 +1887,9 @@ namespace Win.Sfs.SettleAccount.Migrations
b.Property<string>("Factory") b.Property<string>("Factory")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("FactoryPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("FromLoc") b.Property<string>("FromLoc")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -2849,6 +2864,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
b.Property<bool>("IsMaiDan")
.HasColumnType("bit");
b.Property<string>("KeyCode") b.Property<string>("KeyCode")
.HasMaxLength(50) .HasMaxLength(50)
.HasColumnType("nvarchar(50)"); .HasColumnType("nvarchar(50)");
@ -3576,6 +3594,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("nvarchar(max)") .HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties"); .HasColumnName("ExtraProperties");
b.Property<string>("FactoryPartCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("FromErpLocCode") b.Property<string>("FromErpLocCode")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -4333,26 +4354,44 @@ namespace Win.Sfs.SettleAccount.Migrations
}, },
new new
{ {
Id = new Guid("d6d5e1d7-9326-ceea-eed4-fb4039e7ee68"), Id = new Guid("b9b9c79f-4894-474b-4f67-b1ec121c41e5"),
Cron = "0 0/10 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "JisBBAC发运数据同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService"
},
new
{
Id = new Guid("49b1da12-418c-544d-fe8b-be7e5b572452"),
Cron = "0 0/30 * * * ? ",
IsDisabled = false,
IsRunning = false,
Name = "JisHBPO发运数据同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService"
},
new
{
Id = new Guid("7a0dc087-a859-5863-eb6e-56f588bd779e"),
Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "BBAC发运数据同步", Name = "买单件BBAC发运数据同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BBACSeSyncAppService" Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService"
}, },
new new
{ {
Id = new Guid("d50400b0-b0d4-38d1-fcdf-b1e7ac1d3a68"), Id = new Guid("6f68fc8f-b058-c3f4-e07d-722c61f3f7fa"),
Cron = "0 0/10 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "HBPO发运数据同步", Name = "买单件HBPO发运数据同步",
Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.HBPOSeSyncAppService" Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService"
}, },
new new
{ {
Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"), Id = new Guid("f306b380-47e5-5c01-b902-67ca4113a8f4"),
Cron = "0 0/10 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "直供件BBAC发运同步", Name = "直供件BBAC发运同步",
@ -4361,7 +4400,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"), Id = new Guid("8f7dc23d-e2e9-3691-cfe9-545bb958e3f2"),
Cron = "0 0/10 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "直供件HBPO发运同步", Name = "直供件HBPO发运同步",
@ -4370,7 +4409,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"), Id = new Guid("c1f71240-1b81-0107-8b23-ddc9811a3efe"),
Cron = "0 0/10 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "备件发运同步", Name = "备件发运同步",
@ -4379,7 +4418,7 @@ namespace Win.Sfs.SettleAccount.Migrations
new new
{ {
Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"), Id = new Guid("c09c23ea-815f-1b43-4476-2365a8d9a60b"),
Cron = "0 0/10 * * * ? ", Cron = "0 0/30 * * * ? ",
IsDisabled = false, IsDisabled = false,
IsRunning = false, IsRunning = false,
Name = "印度件发运同步", Name = "印度件发运同步",
@ -4501,10 +4540,10 @@ namespace Win.Sfs.SettleAccount.Migrations
b.HasData( b.HasData(
new new
{ {
Id = new Guid("9f155520-78d6-44b1-b8d4-dbdc31507b21"), Id = new Guid("42240e52-f4f4-4e40-b321-2bc395fde07c"),
BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), BillTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
BillType = 1, BillType = 1,
ConcurrencyStamp = "4e37e65449bf44728f7a3cf6a93d4e01", ConcurrencyStamp = "3a0fa479f64a4e84949961ac4a8aed89",
DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), DeliverTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ErpToLoc = "ErpToLoc", ErpToLoc = "ErpToLoc",
OrderNum = "OrderNum", OrderNum = "OrderNum",

Loading…
Cancel
Save