diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
index 6b14f1d7..72829407 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
@@ -80,7 +80,7 @@ public class ZhiGongJianBBACImportDto
///
[Display(Name = "Pstng Date")]
[ImporterHeader(Name = "Pstng Date")]
- public string SettleDate { set; get; }
+ public DateTime SettleDate { set; get; }
///
/// 客户零件号
@@ -212,7 +212,7 @@ public class BeiJianImportDto : BeiJianExtraImportDto
///
[Display(Name = "结算日期")]
[ImporterHeader(Name = "零件时间")]
- public string SettleDate { set; get; }
+ public DateTime SettleDate { set; get; }
///
/// 客户零件号
@@ -367,7 +367,7 @@ public class YinDuJianImportDto
///
[Display(Name = "Delivery Date")]
[ImporterHeader(Name = "Delivery Date")]
- public string SettleDate { set; get; }
+ public DateTime SettleDate { set; get; }
///
/// 客户零件号
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
index 4fab60ae..09354fc6 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
+++ b/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.Dynamic.Core;
using System.Threading.Tasks;
+using EFCore.BulkExtensions;
using Magicodes.ExporterAndImporter.Core.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
@@ -200,7 +201,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
}
if (pubSaDetails.Any())
{
- await _pubSaDetailRepository.DeleteManyAsync(pubSaDetails);
+ await _pubSaDetailRepository.DbContext.BulkDeleteAsync(pubSaDetails).ConfigureAwait(false);
}
if (pubCanSas.Any())
{
@@ -208,11 +209,11 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
}
if (pubCanSaDetails.Any())
{
- await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetails);
+ await _pubCanSaDetailRepository.DbContext.BulkDeleteAsync(pubCanSaDetails).ConfigureAwait(false);
}
if (pubNotSaDetails.Any())
{
- await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetails);
+ await _pubNotSaDetailRepository.DbContext.BulkDeleteAsync(pubNotSaDetails).ConfigureAwait(false);
}
}
@@ -254,23 +255,23 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
//删除
if (pubSas.Any())
{
- await _repository.DeleteManyAsync(pubSas);
+ await _repository.DbContext.BulkDeleteAsync(pubSas).ConfigureAwait(false);
}
if (pubSaDetails.Any())
{
- await _pubSaDetailRepository.DeleteManyAsync(pubSaDetails);
+ await _pubSaDetailRepository.DbContext.BulkDeleteAsync(pubSaDetails).ConfigureAwait(false);
}
if (pubCanSas.Any())
{
- await _pubCanSaRepository.DeleteManyAsync(pubCanSas);
+ await _pubCanSaRepository.DbContext.BulkDeleteAsync(pubCanSas).ConfigureAwait(false);
}
if (pubCanSaDetails.Any())
{
- await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetails);
+ await _pubCanSaDetailRepository.DbContext.BulkDeleteAsync(pubCanSaDetails).ConfigureAwait(false);
}
if (pubNotSaDetails.Any())
{
- await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetails);
+ await _pubNotSaDetailRepository.DbContext.BulkDeleteAsync(pubNotSaDetails).ConfigureAwait(false);
}
return new JsonResult(new { Code = 200, Message = "成功" });
@@ -464,6 +465,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
pubSaDetails.ForEach(importPubSaDetail =>
{
+ importPubSaDetail.SetId(GuidGenerator.Create());
List lus = importPubSaDetail.LU.Split(" ").ToList();
importPubSaDetail.LU = lus[0].Replace(" ", "");
if (lus.Count > 1)
@@ -565,8 +567,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
#endregion
#region 添加入库
- await _repository.InsertAsync(pubSa);
- await _pubSaDetailRepository.InsertManyAsync(pubSaDetails);
+ await _repository.InsertAsync(pubSa).ConfigureAwait(false);
+ (await _pubSaDetailRepository.GetDbContextAsync().ConfigureAwait(false)).BulkInsert(pubSaDetails);
if (pubCanSaDetails.Count > 0)
{
pubCanSa.InvGroupNum = pubCanSaDetails.Count.ToString();
@@ -575,12 +577,14 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
pubCanSaDetail.BillNum = pubCanSaDetail.InvGroupNum = pubCanSaBillNum;
});
- await _pubCanSaRepository.InsertAsync(pubCanSa);
- await _pubCanSaDetailRepository.InsertManyAsync(pubCanSaDetails);
+ await _pubCanSaRepository.InsertAsync(pubCanSa).ConfigureAwait(false);
+ await _pubCanSaDetailRepository.DbContext.BulkInsertAsync(pubCanSaDetails).ConfigureAwait(false);
+ //await _pubCanSaDetailRepository.InsertManyAsync(pubCanSaDetails);
}
if (pubNotSaDetails.Count > 0)
{
- await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails);
+ await _pubNotSaDetailRepository.DbContext.BulkInsertAsync(pubNotSaDetails).ConfigureAwait(false);
+ //await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails);
}
#endregion
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs
index 2f321ad1..3f7a997c 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
+using Coravel.Invocable;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
@@ -29,14 +30,18 @@ public class HandSeSyncAppService : ApplicationService
public async Task SyncAsync([FromBody] EnumBusinessType businessType)
{
using var scope = this._applicationServices.CreateScope();
- JitSeSyncAppService jitSeSyncAppService = businessType switch
+ IInvocable jitSeSyncAppService = businessType switch
{
+ EnumBusinessType.JisBBAC => scope.ServiceProvider.GetRequiredService(),
+ EnumBusinessType.JisHBPO => scope.ServiceProvider.GetRequiredService(),
+ EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService(),
+ EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService(),
EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService(),
EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService(),
EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService(),
EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService(),
_ => throw new ArgumentOutOfRangeException(nameof(businessType), $"Not expected direction value: {businessType}"),
};
- await jitSeSyncAppService.Invoke();
+ await jitSeSyncAppService.Invoke().ConfigureAwait(false);
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs
new file mode 100644
index 00000000..ed7cc862
--- /dev/null
+++ b/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;
+
+///
+/// JisBBAC发运同步
+///
+[AllowAnonymous]
+[Route("api/settleaccount/[controller]/[action]")]
+public class JisBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService
+{
+ ///
+ /// 构造
+ ///
+ public JisBBACSeSyncAppService(
+ WMSBJBMPTDbContext wmsBJBMPTContext,
+ INormalEfCoreRepository syncPositionFlagRepository,
+ INormalEfCoreRepository jisSeDetailRepository,
+ MaterialRelationshipManager materialRelationshipManager,
+ VmiAppService vmiService
+ ) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
+ {
+ base.SeSyncConfigInfo = new SeSyncConfig()
+ {
+ SyncTableName = "JisBBACSync",
+ SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件,
+ SyncDeliverSubBillTypes = new List
+ {
+ EnumDeliverSubBillType.保险杠BBAC,
+ EnumDeliverSubBillType.小件BBAC
+ },
+ BusinessType = EnumBusinessType.JisBBAC
+ };
+ }
+
+ public async Task Invoke(IServiceProvider serviceProvider)
+ {
+ await this.Invoke().ConfigureAwait(false);
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs
new file mode 100644
index 00000000..1e5e8e21
--- /dev/null
+++ b/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 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;
+
+///
+/// Jis发运数据同步
+///
+[ApiExplorerSettings(IgnoreApi = true)]
+public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable
+{
+ ///
+ /// WMS数据上下文
+ ///
+ private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
+
+ ///
+ /// 同步位置标记
+ ///
+ private readonly INormalEfCoreRepository _syncPositionFlagRepository;
+
+ ///
+ /// Jis发运数据仓储
+ ///
+ private readonly INormalEfCoreRepository _jisSeDetailRepository;
+
+ ///
+ /// 客户零件关系领域
+ ///
+ private readonly MaterialRelationshipManager _materialRelationshipManager;
+
+ private readonly IVmiService _vmiService;
+
+ ///
+ /// 构造
+ ///
+ public JisBBACSeSyncBaseAppService(
+ WMSBJBMPTDbContext wmsBJBMPTContext,
+ INormalEfCoreRepository syncPositionFlagRepository,
+ INormalEfCoreRepository jisSeDetailRepository,
+ MaterialRelationshipManager materialRelationshipManager,
+ VmiAppService vmiService)
+ {
+ _wmsBJBMPTContext = wmsBJBMPTContext;
+ _syncPositionFlagRepository = syncPositionFlagRepository;
+ _jisSeDetailRepository = jisSeDetailRepository;
+ _materialRelationshipManager = materialRelationshipManager;
+ _vmiService = vmiService;
+ }
+
+ ///
+ /// 发运同步配置
+ ///
+ public SeSyncConfig SeSyncConfigInfo { get; set; }
+
+ [HttpPost]
+ public async Task Invoke()
+ {
+ if (SeSyncConfigInfo == null)
+ {
+ return;
+ }
+ await SyncJitRecordAsync().ConfigureAwait(false);
+ await SyncJisRecordAsync().ConfigureAwait(false);
+ }
+
+ ///
+ /// 同步JitRecord
+ ///
+ [UnitOfWork]
+ private async Task SyncJitRecordAsync()
+ {
+ //同步表名称
+ var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit";
+ //同步发运主类型
+ var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
+ //同步发运子类型
+ var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
+ //业务类别
+ var businessType = SeSyncConfigInfo.BusinessType;
+
+ Expression> 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>(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.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);
+ }
+ }
+ }
+
+ ///
+ /// 同步JisRecord
+ ///
+ [UnitOfWork]
+ private async Task SyncJisRecordAsync()
+ {
+ //同步表名称
+ var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis";
+ //同步发运主类型
+ var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
+ //同步发运子类型
+ var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
+ //业务类别
+ var businessType = SeSyncConfigInfo.BusinessType;
+
+ Expression> 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>(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); ;
+ }
+ }
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs
new file mode 100644
index 00000000..d3c28620
--- /dev/null
+++ b/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;
+
+///
+/// JisHBPO发运同步
+///
+[AllowAnonymous]
+[Route("api/settleaccount/[controller]/[action]")]
+public class JisHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService
+{
+ ///
+ /// 构造
+ ///
+ public JisHBPOSeSyncAppService(
+ WMSBJBMPTDbContext wmsBJBMPTContext,
+ INormalEfCoreRepository syncPositionFlagRepository,
+ INormalEfCoreRepository jisSeDetailRepository,
+ MaterialRelationshipManager materialRelationshipManager,
+ VmiAppService vmiService
+ ) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
+ {
+ base.SeSyncConfigInfo = new SeSyncConfig()
+ {
+ SyncTableName = "JisHBPOSync",
+ SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件,
+ SyncDeliverSubBillTypes = new List
+ {
+ EnumDeliverSubBillType.保险杠HBPO,
+ EnumDeliverSubBillType.小件HBPO
+ },
+ BusinessType = EnumBusinessType.MaiDanJianHBPO
+ };
+ }
+
+ public async Task Invoke(IServiceProvider serviceProvider)
+ {
+ await this.Invoke().ConfigureAwait(false);
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs
new file mode 100644
index 00000000..402756d5
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.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 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;
+
+///
+/// Jis发运数据同步
+///
+[ApiExplorerSettings(IgnoreApi = true)]
+public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable
+{
+ ///
+ /// WMS数据上下文
+ ///
+ private readonly WMSBJBMPTDbContext _wmsBJBMPTContext;
+
+ ///
+ /// 同步位置标记
+ ///
+ private readonly INormalEfCoreRepository _syncPositionFlagRepository;
+
+ ///
+ /// Jis发运数据仓储
+ ///
+ private readonly INormalEfCoreRepository _jisSeDetailRepository;
+
+ ///
+ /// 客户零件关系领域
+ ///
+ private readonly MaterialRelationshipManager _materialRelationshipManager;
+
+ private readonly IVmiService _vmiService;
+
+ ///
+ /// 构造
+ ///
+ public JisHBPOSeSyncBaseAppService(
+ WMSBJBMPTDbContext wmsBJBMPTContext,
+ INormalEfCoreRepository syncPositionFlagRepository,
+ INormalEfCoreRepository jisSeDetailRepository,
+ MaterialRelationshipManager materialRelationshipManager,
+ VmiAppService vmiService)
+ {
+ _wmsBJBMPTContext = wmsBJBMPTContext;
+ _syncPositionFlagRepository = syncPositionFlagRepository;
+ _jisSeDetailRepository = jisSeDetailRepository;
+ _materialRelationshipManager = materialRelationshipManager;
+ _vmiService = vmiService;
+ }
+
+ ///
+ /// 发运同步配置
+ ///
+ public SeSyncConfig SeSyncConfigInfo { get; set; }
+
+ [HttpPost]
+ public async Task Invoke()
+ {
+ if (SeSyncConfigInfo == null)
+ {
+ return;
+ }
+ await SyncJitRecordAsync().ConfigureAwait(false);
+ await SyncJisRecordAsync().ConfigureAwait(false);
+ }
+
+ ///
+ /// 同步JitRecord
+ ///
+ [UnitOfWork]
+ private async Task SyncJitRecordAsync()
+ {
+ //同步表名称
+ var syncTableName = "JisBBACSeSync_Jit";
+ //同步发运主类型
+ var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
+ //同步发运子类型
+ var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
+ //业务类别
+ var businessType = SeSyncConfigInfo.BusinessType;
+
+ Expression> 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>(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.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);
+ }
+ }
+ }
+
+ ///
+ /// 同步JisRecord
+ ///
+ [UnitOfWork]
+ private async Task SyncJisRecordAsync()
+ {
+ //同步表名称
+ var syncTableName = "JisBBACSeSync_Jit";
+ //同步发运主类型
+ var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType;
+ //同步发运子类型
+ var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes;
+ //业务类别
+ var businessType = SeSyncConfigInfo.BusinessType;
+
+ Expression> 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>(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); ;
+ }
+ }
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
index 769a9307..93011086 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs
+++ b/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.Threading.Tasks;
using Coravel.Invocable;
+using EFCore.BulkExtensions;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Volo.Abp.Application.Services;
@@ -92,14 +93,14 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).OrderBy(b => b.UID).ToList();
var pubSeDetails = ObjectMapper.Map, List>(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())
{
//客户零件号和厂内零件号
- 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())
{
- 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);
}
@@ -108,7 +109,7 @@ public class JitSeSyncAppService : ApplicationService, IInvocable
t.BusinessType = businessType;
t.KeyCode = t.PN + t.LU;
});
- await _pubSeDetailRepository.InsertManyAsync(pubSeDetails).ConfigureAwait(false);
+ await _pubSeDetailRepository.DbContext.BulkInsertAsync(pubSeDetails).ConfigureAwait(false);
if (syncPositionFlag != null)
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs
new file mode 100644
index 00000000..196d7178
--- /dev/null
+++ b/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;
+
+///
+/// 买单件BBAC发运同步
+///
+[AllowAnonymous]
+[Route("api/settleaccount/[controller]/[action]")]
+public class MaiDanBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService
+{
+ ///
+ /// 构造
+ ///
+ public MaiDanBBACSeSyncAppService(
+ WMSBJBMPTDbContext wmsBJBMPTContext,
+ INormalEfCoreRepository syncPositionFlagRepository,
+ INormalEfCoreRepository jisSeDetailRepository,
+ MaterialRelationshipManager materialRelationshipManager,
+ VmiAppService vmiService
+ ) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
+ {
+ base.SeSyncConfigInfo = new SeSyncConfig()
+ {
+ SyncTableName = "MaiDanBBACSync",
+ SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件,
+ SyncDeliverSubBillTypes = new List
+ {
+ EnumDeliverSubBillType.买单件保险杠BBAC,
+ EnumDeliverSubBillType.买单件小件BBAC
+ },
+ BusinessType = EnumBusinessType.MaiDanJianBBAC
+ };
+ }
+
+ public async Task Invoke(IServiceProvider serviceProvider)
+ {
+ await this.Invoke().ConfigureAwait(false);
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs
new file mode 100644
index 00000000..d7080fce
--- /dev/null
+++ b/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;
+
+///
+/// 买单件HBPO发运同步
+///
+[AllowAnonymous]
+[Route("api/settleaccount/[controller]/[action]")]
+public class MaiDanHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService
+{
+ ///
+ /// 构造
+ ///
+ public MaiDanHBPOSeSyncAppService(
+ WMSBJBMPTDbContext wmsBJBMPTContext,
+ INormalEfCoreRepository syncPositionFlagRepository,
+ INormalEfCoreRepository jisSeDetailRepository,
+ MaterialRelationshipManager materialRelationshipManager,
+ VmiAppService vmiService
+ ) : base(wmsBJBMPTContext, syncPositionFlagRepository, jisSeDetailRepository, materialRelationshipManager, vmiService)
+ {
+ base.SeSyncConfigInfo = new SeSyncConfig()
+ {
+ SyncTableName = "MaiDanHBPOSync",
+ SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件,
+ SyncDeliverSubBillTypes = new List
+ {
+ EnumDeliverSubBillType.买单件保险杠HBPO,
+ EnumDeliverSubBillType.买单件小件HBPO
+ },
+ BusinessType = EnumBusinessType.MaiDanJianHBPO
+ };
+ }
+
+ public async Task Invoke(IServiceProvider serviceProvider)
+ {
+ await this.Invoke().ConfigureAwait(false);
+ }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
index ef233298..1d283b18 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccount.Application.csproj
@@ -111,6 +111,8 @@
+
+
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
index f9780bb9..9c6afd57 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
@@ -1135,7 +1135,8 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.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.Qty, y => y.MapFrom(d => d.Qty));
CreateMap()
@@ -1145,14 +1146,16 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.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.Qty, y => y.MapFrom(d => d.Qty));
CreateMap()
.ForMember(x => x.BeginDate, y => y.MapFrom(d => d.AssembleData))
.ForMember(x => x.ShippingDate, y => y.MapFrom(d => d.BillTime))
.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.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.ShippingDate, y => y.MapFrom(d => d.BillTime))
.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.Qty, y => y.MapFrom(d => d.Qty));
CreateMap()
@@ -1173,14 +1177,16 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.BeginDate, 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.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.Qty, y => y.MapFrom(d => d.Qty));
CreateMap()
.ForMember(x => x.BeginDate, 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.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.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.ShippingDate, y => y.MapFrom(d => d.BillTime))
.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.PartCode))
+ .ForMember(x => x.LU, y => y.MapFrom(d => d.CustPartCode))
+ .ForMember(x => x.FactoryPartCode, y => y.MapFrom(d => d.PartCode))
.ForMember(x => x.PN, y => y.MapFrom(d => d.BillNum))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.Qty));
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
index bcce0e6e..e0af36e9 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs
@@ -546,21 +546,24 @@ namespace SettleAccount.Bases
/// 发运单号
///
public string WmsBillNum { set; get; }
-
///
- /// 厂内零件号
+ /// 客户零件号
///
public string LU { get; set; }
///
- /// 生產號
+ /// 厂内零件号
+ ///
+ public string FactoryPartCode { get; set; }
+ ///
+ /// 生产号
///
public string PN { get; set; }
///
- /// 組合鍵值(LU+PN)
+ /// 组合键值(PN+LU)
///
public string KeyCode { get; set; }
///
- /// 數量
+ /// 数量
///
public decimal Qty { get; set; }
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs
index 09fbfcde..2b248ed1 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs
+++ b/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 void SetId(Guid id)
+ {
+ Id = id;
+ }
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
index de0c7eeb..d20832ad 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
@@ -1342,12 +1342,14 @@ namespace Win.Sfs.SettleAccount
//seed
builder.Entity().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" });
- builder.Entity().HasData(new JobItem("BBACSeSync".ToGuid()) { Name = "BBAC发运数据同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BBACSeSyncAppService" });
- builder.Entity().HasData(new JobItem("HBPOSeSync".ToGuid()) { Name = "HBPO发运数据同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.HBPOSeSyncAppService" });
- builder.Entity().HasData(new JobItem("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" });
- builder.Entity().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" });
- builder.Entity().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" });
- builder.Entity().HasData(new JobItem("YinDuSeSync".ToGuid()) { Name = "印度件发运同步", Cron = "0 0/10 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" });
+ builder.Entity().HasData(new JobItem("JisBBACSeSync".ToGuid()) { Name = "JisBBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisBBACSeSyncAppService" });
+ builder.Entity().HasData(new JobItem("JisHBPOSeSync".ToGuid()) { Name = "JisHBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.JisHBPOSeSyncAppService" });
+ builder.Entity().HasData(new JobItem("MaiDanBBACSeSync".ToGuid()) { Name = "买单件BBAC发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" });
+ builder.Entity().HasData(new JobItem("MaiDanHBPOSeSync".ToGuid()) { Name = "买单件HBPO发运数据同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.MaiDanBBACSeSyncAppService" });
+ builder.Entity().HasData(new JobItem("ZhiGongBBACSeSync".ToGuid()) { Name = "直供件BBAC发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongBBACSeSyncAppService" });
+ builder.Entity().HasData(new JobItem("ZhiGongHBPOSeSync".ToGuid()) { Name = "直供件HBPO发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.ZhiGongHBPOSeSyncAppService" });
+ builder.Entity().HasData(new JobItem("BeiSeSync".ToGuid()) { Name = "备件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.BeiSeSyncAppService" });
+ builder.Entity().HasData(new JobItem("YinDuSeSync".ToGuid()) { Name = "印度件发运同步", Cron = "0 0/30 * * * ? ", Service = "Win.Sfs.SettleAccount.Entities.BQ.Syncs.YinDuSeSyncAppService" });
//builder.Entity().HasData(new VmiCategory("发运入库".ToGuid()) { Type = VmiType.In, Name = "发运入库", Number = "100" });
//builder.Entity().HasData(new VmiCategory("结算出库".ToGuid()) { Type = VmiType.Out, Name = "结算出库", Number = "200" });
//builder.Entity().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" });
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.Designer.cs
new file mode 100644
index 00000000..3ad178b7
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.Designer.cs
@@ -0,0 +1,5521 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Volo.Abp.EntityFrameworkCore;
+using Win.Sfs.SettleAccount;
+
+namespace Win.Sfs.SettleAccount.Migrations
+{
+ [DbContext(typeof(SettleAccountDbContext))]
+ [Migration("20230817033153_20230817-2")]
+ partial class _202308172
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
+ .HasAnnotation("Relational:MaxIdentifierLength", 128)
+ .HasAnnotation("ProductVersion", "5.0.17")
+ .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvbillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsMaiDan")
+ .HasColumnType("bit");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_NOT_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsMaiDan")
+ .HasColumnType("bit");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_NOT_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("State")
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_PD");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Extend1")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend2")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend3")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend4")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RELU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("REPN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_PD_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DNBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("Category")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssembleData")
+ .HasColumnType("datetime2");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Batch")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("BillCharacter")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BillTime")
+ .HasColumnType("datetime2");
+
+ b.Property("BillType")
+ .HasColumnType("int");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("CodeType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("DeliverBillType")
+ .HasColumnType("int");
+
+ b.Property("DeliverCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeliverSubBillType")
+ .HasColumnType("int");
+
+ b.Property("ErpToLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("Factory")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FactoryPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FromLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InjectionCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsHaveEdiData")
+ .HasColumnType("bit");
+
+ b.Property("JISNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MESConfigCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MatchNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Oper")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrigiCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PartDesc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PjsNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Position")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProType")
+ .HasColumnType("int");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RealCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RefBillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RefVinCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Remark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Seq")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SeqNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ShippingDate")
+ .HasColumnType("datetime2");
+
+ b.Property("State")
+ .HasColumnType("int");
+
+ b.Property("SubBillType")
+ .HasColumnType("int");
+
+ b.Property("ToLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TransType")
+ .HasColumnType("int");
+
+ b.Property("UID")
+ .HasColumnType("bigint");
+
+ b.Property("UniqueCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.Property("VinCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("WmsBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SE_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_EDI", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Extend1")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Extend2")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Extend3")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Extend4")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InjectionCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsHaveSeData")
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SeqNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Version")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SE_EDI");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_REPORT", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("EDIQty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property