diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
index 15b30dd3..b1ca1613 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs
@@ -371,7 +371,7 @@ public class PriceListBJRequestDto : RequestInputBase
///
/// 列表
///
-public class TB_PRICE_LISTDto : AuditedEntityDto
+public class TB_PRICE_LISTDto : EntityDto
{
///
/// 零件号
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 f88aa7b5..e295ee4b 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
@@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using Volo.Abp;
using Volo.Abp.Application.Services;
using Volo.Abp.Uow;
@@ -34,15 +35,15 @@ public class HandSeSyncAppService : ApplicationService
using var scope = this._applicationServices.CreateScope();
IInvocable seSyncAppService = 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}"),
+ //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 UserFriendlyException($"{nameof(businessType)}参数值无效", "403")
};
await seSyncAppService.Invoke().ConfigureAwait(false);
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs
deleted file mode 100644
index 7119c3b6..00000000
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErrorListBill/ErrorBillAppService.cs
+++ /dev/null
@@ -1,303 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using EFCore.BulkExtensions;
-using Magicodes.ExporterAndImporter.Core;
-using Magicodes.ExporterAndImporter.Excel;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Extensions.Caching.Distributed;
-using Shouldly;
-using Volo.Abp;
-using Volo.Abp.Application.Dtos;
-using Volo.Abp.Application.Services;
-using Volo.Abp.BackgroundJobs;
-using Volo.Abp.Caching;
-using Volo.Abp.Domain.Repositories;
-using Volo.Abp.Guids;
-using Volo.Abp.ObjectMapping;
-using Volo.Abp.Uow;
-using Win.Abp.Snowflakes;
-using Win.Sfs.BaseData.ImportExcelCommon;
-using Win.Sfs.SettleAccount.Boms;
-using Win.Sfs.SettleAccount.CommonManagers;
-using Win.Sfs.SettleAccount.Constant;
-using Win.Sfs.SettleAccount.Entities.Boms;
-using Win.Sfs.SettleAccount.Entities.Errors;
-using Win.Sfs.SettleAccount.Entities.ImportMap;
-using Win.Sfs.SettleAccount.Entities.Prices;
-using Win.Sfs.SettleAccount.Entities.TaskJobs;
-using Win.Sfs.SettleAccount.Errors;
-using Win.Sfs.SettleAccount.ExcelImporter;
-using Win.Sfs.SettleAccount.ExportReports;
-using Win.Sfs.SettleAccount.Reports;
-using Win.Sfs.Shared.CacheBase;
-using Win.Utils;
-namespace Win.Sfs.SettleAccount.Entities.ErrorBills
-{
-
- ///
- /// 物料主数据应用服务
- ///
- // [Authorize(SettleAccountPermissions.ErrorBills.Default)]
- //[AllowAnonymous]
- [Route("api/settleaccount/ErrorBill")]
- [ApiExplorerSettings(IgnoreApi = true)]
- public class ErrorBillAppService : SettleAccountApplicationBase
- {
-
-
- private readonly IExcelImportAppService _excelImportService;
- private readonly ISettleAccountBranchEfCoreRepository _repository;
- private readonly ISettleAccountBranchEfCoreRepository _bomRepository;
- private readonly ISettleAccountBranchEfCoreRepository _bomversionRepository;
- private readonly ISettleAccountBranchEfCoreRepository _priceRepository;
- private readonly ISettleAccountBranchEfCoreRepository _priceversionRepository;
- private readonly ISettleAccountBranchEfCoreRepository _mapRepository;
- //private readonly ISettleAccountBranchEfCoreRepository _relationshipRepository;
- ///
- /// 构建方法
- ///
- /// 构建UID
- /// 自动map
- /// 仓储接口
- /// 缓存
- public ErrorBillAppService(
-
- ISettleAccountBranchEfCoreRepository repository,
- ISettleAccountBranchEfCoreRepository mapRepository,
- ISettleAccountBranchEfCoreRepository bomRepository,
- ISettleAccountBranchEfCoreRepository bomversionRepository,
- TaskJobService service,
- //ISettleAccountBranchEfCoreRepository relationshipRepository,
- ISettleAccountBranchEfCoreRepository priceRepository,
- ISettleAccountBranchEfCoreRepository priceversionRepository,
-
- IDistributedCache cache,
- IExcelImportAppService excelImportService,
- ISnowflakeIdGenerator snowflakeIdGenerator,
- ICommonManager commonManager
-
- ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager)
- {
- _priceRepository = priceRepository;
- _priceversionRepository = priceversionRepository;
- _bomRepository = bomRepository;
- _excelImportService = excelImportService;
- _repository = repository;
- //_relationshipRepository = relationshipRepository;
- _mapRepository = mapRepository;
- _bomversionRepository = bomversionRepository;
- }
-
-
- ///
- /// 导入功能
- ///
- /// 上传的文件(前端已经限制只能上传一个附件)
- ///
- //[HttpPost]
- //[Route("ExcelImport")]
- //[DisableRequestSizeLimit]
-
- //public async Task ErrorBillUploadExcelImportMap([FromForm] IFormFileCollection files,string version)
- //{
- // ExportImporter _exportImporter = new ExportImporter();
- // var result = await _exportImporter.ExtendExcelImport(files, _excelImportService);
- // return ApplicationConsts.SuccessStr;
- //}
-
-
-
- //public List RemoveError(List p_list) where T : ReportDetailBase, new ()
- //{
-
-
- // return p_list;
-
-
- //}
-
-
-
-
- ///
- /// 导入功能
- ///
- /// 上传的文件(前端已经限制只能上传一个附件)
- ///
- [HttpPost]
- [Route("ExcelImport")]
- [DisableRequestSizeLimit]
-
- public async Task ErrorBillUploadExcelImport([FromForm] IFormFileCollection files)
- {
- ExportImporter _exportImporter = new ExportImporter();
- var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
- var _ls = ObjectMapper.Map, List>(result);
- var checkList = new List();
- foreach (var itm in _ls)
- {
- var _first = await _repository.FirstOrDefaultAsync(p => p.BillNum == itm.BillNum && p.CustomerMaterialCode==itm.CustomerMaterialCode && p.WmsBillNum==itm.WmsBillNum);
- if (_first == null)
- {
- var entity = new ErrorBill(
- GuidGenerator.Create(),
- GuidGenerator.Create(),
- itm.BillNum,
- itm.MaterialCode,
- itm.WmsBillNum,
- itm.MaterialDesc,
- itm.CustomerMaterialCode
- );
- await _repository.InsertAsync(entity);
- }
- }
- return ApplicationConsts.SuccessStr;
- }
-
-
-
- ///
- /// 按ID获取唯一实体
- ///
- ///
- /// 返回实体全部属性
- ///
- /// ID
- /// 实体DTO
- [HttpGet]
- [Route("{id}")]
-
- virtual public async Task GetAsync(Guid id)
- {
- var result = await GetFromCacheAsync(id);
- var dto = ObjectMapper.Map(result);
- return dto;
- }
-
- private async Task GetFromCacheAsync(Guid id)
- {
- var result = await _repository.GetAsync(id);
-
- return result;
- }
-
- private async Task GetCountAsync(ErrorBillRequestDto input)
- {
- return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
- }
-
-
- ///
- /// 根据筛选条件获取实体列表
- ///
- ///
- /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
- ///
- /// 请求条件
- /// 实体DTO列表
- [HttpPost]
- [Route("list")]
-
- virtual public async Task> GetListAsync(ErrorBillRequestDto input)
- {
- var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
- input.SkipCount, true);
-
- var totalCount = await GetCountAsync(input);
- var dtos = ObjectMapper.Map, List>(entities);
-
- return new PagedResultDto(totalCount, dtos);
- }
-
-
- ///
- /// 获取实体总数
- ///
- /// 实体总数
- [HttpGet]
- [Route("count")]
-
- virtual public async Task GetTotalCountAsync(Guid branchId)
- {
- return await _repository.GetCountAsync(branchId);
- }
-
- ///
- /// 获取全部实体列表
- ///
- /// 实体DTO列表
- [HttpGet]
- [Route("all")]
-
- virtual public async Task> GetAllAsync(Guid branchId)
- {
- var entities = await _repository.GetAllAsync(branchId, true);
- var dtos = ObjectMapper.Map, List>(entities);
- return new ListResultDto(dtos);
- }
-
-
- ///
- /// 删除实体
- ///
- /// ID
- /// 无
- [HttpDelete]
- [Route("{id}")]
-
- virtual public async Task DeleteAsync(Guid id)
- {
- var entity = await GetFromCacheAsync(id);
- await Cache.DeleteAsync(id.ToString());
- await _repository.DeleteAsync(id);
- }
-
- ///
- /// 按IDs删除实体列表
- ///
- /// IDs
- /// 是否执行成功
- [HttpPost]
- [Route("delete")]
-
- virtual public async Task DeleteListAsync(List ids)
- {
- var _query = _repository.Where(p => ids.Contains(p.Id));
- int i = await _query.BatchDeleteAsync();
-
- if (i == 0)
- {
- return false;
- }
- return true;
- }
- [HttpPost]
- [Route("Export")]
-
- virtual public async Task ExportAsync(ErrorBillRequestDto input)
- {
- string _fileName = string.Format("错误单据输出_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd"));
- var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
- 0, true);
- var dtoDetails = ObjectMapper.Map, List>(entities);
- //声明导出容器
- ExportImporter _exportImporter = new ExportImporter();
- var result = await _exportImporter.ExcelExporter(dtoDetails);
- result.ShouldNotBeNull();
- //保存导出文件到服务器存成二进制
- await _excelImportService.SaveBlobAsync(
- new SaveExcelImportInputDto
- {
- Name = _fileName,
- Content = result
- }
- );
- return _fileName;
- }
- }
-}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
index 36b3b2b2..85d64dd8 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
@@ -35,13 +35,11 @@ public class PriceListAppService : SettleAccountApplicationBase
///
private readonly INormalEfCoreRepository _priceListRepository;
- private readonly PriceListManager _priceListManager;
private readonly ISettleAccountBranchEfCoreRepository _mapRepository;
private readonly TaskJobService _service;
public PriceListAppService(
INormalEfCoreRepository priceListRepository,
ISettleAccountBranchEfCoreRepository mapRepository,
- PriceListManager priceListManager,
TaskJobService service,
IDistributedCache cache,
IExcelImportAppService excelImportService,
@@ -51,7 +49,6 @@ public class PriceListAppService : SettleAccountApplicationBase
{
_priceListRepository = priceListRepository;
_mapRepository = mapRepository;
- _priceListManager = priceListManager;
_service = service;
}
@@ -90,7 +87,7 @@ public class PriceListAppService : SettleAccountApplicationBase
var query = from item1 in entityList
join item2 in entityList
on new { item1.LU } equals new { item2.LU }
- where (item1.BeginTime >= item2.BeginTime && item1.EndTime <= item2.EndTime) || (item2.BeginTime >= item1.BeginTime && item2.EndTime <= item1.EndTime)
+ where (item1.BeginTime > item2.BeginTime && item1.EndTime < item2.EndTime) || (item2.BeginTime > item1.BeginTime && item2.EndTime < item1.EndTime) || (item1.BeginTime == item2.BeginTime && item1.EndTime != item2.EndTime) || (item1.BeginTime != item2.BeginTime && item1.EndTime == item2.EndTime)
select item1.LU;
var repeat = query.Distinct().ToList();
foreach (var item in repeat)
@@ -105,7 +102,28 @@ public class PriceListAppService : SettleAccountApplicationBase
}
#endregion
var lus = entityList.Select(p => p.LU);
- var priceListModelEntitys = _priceListRepository.Where(t => t.ContractNo == contractNo && lus.Contains(t.ContractNo)).ToList();
+
+ var prices = _priceListRepository.Where(t => lus.Contains(t.LU) && t.ContractNo != contractNo).ToList();
+ if (prices.Any())
+ {
+ var query = from item1 in entityList
+ join item2 in prices
+ on new { item1.LU } equals new { item2.LU }
+ where (item1.BeginTime >= item2.BeginTime && item1.EndTime <= item2.EndTime) || (item2.BeginTime >= item1.BeginTime && item2.EndTime <= item1.EndTime)
+ select item1.LU;
+ var repeat = query.Distinct().ToList();
+ foreach (var item in repeat)
+ {
+ checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item},时间区间与系统内数据存在交集", string.Empty));
+ }
+ }
+ if (checkList.Count > 0)
+ {
+ string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false);
+ return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName = fileName });
+ }
+
+ var priceListModelEntitys = _priceListRepository.Where(t => t.ContractNo == contractNo && lus.Contains(t.LU)).ToList();
if (priceListModelEntitys.Any())
{
await _priceListRepository.DeleteManyAsync(priceListModelEntitys).ConfigureAwait(false);
@@ -126,10 +144,10 @@ public class PriceListAppService : SettleAccountApplicationBase
public virtual async Task ExportAsync(RequestDto input)
{
IExporter _excel = new ExcelExporter();
- var entities = await _priceListManager.GetListAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
+ var entities = await _priceListRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false);
var dtoDetails = ObjectMapper.Map, List>(entities);
string fileName = string.Format("销售价格单_{0}.xlsx", Guid.NewGuid().ToString());
- byte[] result = await _excel.ExportAsByteArray(dtoDetails);
+ byte[] result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
@@ -139,7 +157,7 @@ public class PriceListAppService : SettleAccountApplicationBase
Name = fileName,
Content = result
}
- );
+ ).ConfigureAwait(false);
return fileName;
}
#endregion
@@ -149,11 +167,11 @@ public class PriceListAppService : SettleAccountApplicationBase
/// 获取列表
///
[HttpPost]
- public virtual async Task> GetListAsync(RequestDto input)
+ public async Task> GetListAsync(RequestDto input)
{
- var entitys = await _priceListManager.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
- var totalCount = await _priceListManager.GetCountAsync(input.Filters, GuidGenerator.Create());
- var dtos = ObjectMapper.Map, List>(entitys);
+ var entities = await _priceListRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
+ var totalCount = await _priceListRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
+ var dtos = ObjectMapper.Map, List>(entities);
return new PagedResultDto(totalCount, dtos);
}
@@ -161,18 +179,18 @@ public class PriceListAppService : SettleAccountApplicationBase
/// 删除
///
[HttpPost]
- virtual public async Task DeleteAsync(Guid id)
+ public async Task DeleteAsync(Guid id)
{
- await _priceListManager.DeleteAsync(id);
+ await _priceListRepository.DeleteAsync(id).ConfigureAwait(false);
}
///
/// 批量删除
///
[HttpPost]
- virtual public async Task DeleteListAsync(List ids)
+ public async Task DeleteListAsync(List ids)
{
- return await _priceListManager.DeleteListAsync(ids);
+ return await _priceListRepository.DeleteListAsync(ids).ConfigureAwait(false);
}
#endregion
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
index a6e3fbc3..dd6e30ad 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs
@@ -29,11 +29,9 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
public class PriceListAppServiceBJ : SettleAccountApplicationBase
{
private readonly INormalEfCoreRepository _repository;
- private readonly PriceListManagerBJ _priceListManagerBJ;
public PriceListAppServiceBJ(
INormalEfCoreRepository repository,
- PriceListManagerBJ priceListManagerBJ,
IDistributedCache cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
@@ -41,7 +39,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_repository = repository;
- _priceListManagerBJ = priceListManagerBJ;
}
#region 导入、导出
@@ -70,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var query = from item1 in entityList
join item2 in entityList
on new { item1.LU } equals new { item2.LU }
- where (item1.BeginDate > item2.BeginDate && item1.EndDate < item2.EndDate) || (item2.BeginDate > item1.BeginDate && item2.EndDate < item1.EndDate)
+ where (item1.BeginDate > item2.BeginDate && item1.EndDate < item2.EndDate) || (item2.BeginDate > item1.BeginDate && item2.EndDate < item1.EndDate) || (item1.BeginDate == item2.BeginDate && item1.EndDate != item2.EndDate) || (item1.BeginDate != item2.BeginDate && item1.EndDate == item2.EndDate)
select item1.LU;
var repeat = query.Distinct().ToList();
foreach (var item in query)
@@ -85,7 +82,28 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
}
#endregion
var lus = entityList.Select(p => p.LU);
- var priceListModelEntitys = _repository.Where(t => t.ContractNo == contractNo && lus.Contains(t.ContractNo)).ToList();
+
+ var prices = _repository.Where(t => lus.Contains(t.LU) && t.ContractNo != contractNo).ToList();
+ if (prices.Any())
+ {
+ var query = from item1 in entityList
+ join item2 in prices
+ on new { item1.LU } equals new { item2.LU }
+ where (item1.BeginDate >= item2.BeginDate && item1.EndDate <= item2.EndDate) || (item2.BeginDate >= item1.BeginDate && item2.EndDate <= item1.EndDate)
+ select item1.LU;
+ var repeat = query.Distinct().ToList();
+ foreach (var item in repeat)
+ {
+ checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"导入文件中物料号:{item},时间区间与系统内数据存在交集", string.Empty));
+ }
+ }
+ if (checkList.Count > 0)
+ {
+ string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false);
+ return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName = fileName });
+ }
+
+ var priceListModelEntitys = _repository.Where(t => t.ContractNo == contractNo && lus.Contains(t.LU)).ToList();
if (priceListModelEntitys.Any())
{
await _repository.DeleteManyAsync(priceListModelEntitys).ConfigureAwait(false);
@@ -125,255 +143,12 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
[HttpPost]
public async Task> GetListAsync(RequestDto input)
{
- var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
- var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
var dtos = ObjectMapper.Map, List>(entities);
return new PagedResultDto(totalCount, dtos);
}
#endregion
-
- #region 原有的方法之后废弃删除
- // ///
- // /// 按ID获取唯一实体
- // ///
- // ///
- // /// 返回实体全部属性
- // ///
- // /// ID
- // /// 实体DTO
-
- // [HttpGet]
- // [Route("{id}")]
- // /// [Authorize(SettleAccountPermissions.PriceLists.Default)]
- // virtual public async Task GetAsync(Guid id)
- // {
- // var result = await _mng.GetAsync(id); ;
- // var dto = ObjectMapper.Map(result);
- // return dto;
-
- // }
-
-
-
- // ///
- // /// 根据筛选条件获取实体列表
- // ///
- // ///
- // /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
- // ///
- // /// 请求条件
- // /// 实体DTO列表
- // [HttpPost]
- // [Route("list")]
- // //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- // virtual public async Task> GetListAsync(PriceListRequestDto input)
- // {
-
- // if (!string.IsNullOrEmpty(input.Version))
- // {
- // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version });
- // }
- // var entities = await _mng.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount,
- //input.SkipCount);
- // var totalCount = await GetCountAsync(input);
- // var dtos = ObjectMapper.Map, List>(entities);
- // return new PagedResultDto(totalCount, dtos);
- // }
-
- // ///
- // /// 根据筛选条件获取实体列表
- // ///
- // ///
- // /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
- // ///
- // /// 请求条件
- // /// 实体DTO列表
- // [HttpPost]
- // [Route("versionlist")]
- // // [Authorize(SettleAccountPermissions.PriceLists.Default)]
- // virtual public async Task> GetVersionListAsync(PriceListRequestDto input)
- // {
- // var entities = await _mng.GetVersionListAsync(input.Filters, input.Sorting, input.MaxResultCount,input.SkipCount);
- // var totalCount = await GetCountAsync(input);
- // var dtos = ObjectMapper.Map, List>(entities);
- // return new PagedResultDto(totalCount, dtos);
- // }
-
-
-
-
-
-
- // private async Task GetCountAsync(PriceListRequestDto input)
- // {
- // return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create());
- // }
-
- // ///
- // /// 获取实体总数
- // ///
- // /// 实体总数
- // [HttpGet]
- // [Route("count")]
- // //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- // virtual public async Task GetTotalCountAsync(Guid branchId)
- // {
- // return await _mng.GetCountAsync(new List(), branchId);
- // }
-
- // ///
- // /// 获取全部实体列表
- // ///
- // /// 实体DTO列表
- // [HttpGet]
- // [Route("all")]
- // //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- // virtual public async Task> GetAllAsync(Guid branchId)
- // {
- // var entities = await _mng.GetAllAsync(branchId);
- // var dtos = ObjectMapper.Map, List>(entities);
- // return new ListResultDto(dtos);
- // }
-
- // ///
- // /// 批量导入实体列表
- // ///
- // ///
- // /// 以ID为依据,数据库中找不到ID的实体会新增,已有ID的实体会修改
- // ///
- // /// 实体列表
- // /// 是否导入成功
- // [HttpPost]
- // [Route("ExcelImport-Map")]
- // //[Authorize(SettleAccountPermissions.PriceLists.Create)]
- // virtual public async Task ImportAsync([FromForm] IFormFileCollection files,string version)
- // {
- // ExportImporter _exportImporter = new ExportImporter();
- // var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
-
- // List _checkls = new List();
- // _checkls.Add("100001");
- // _checkls.Add("100053");
- // _checkls.Add("100113");
- // // _checkls.Add("200067");
- // result = result.Where(p => _checkls.Contains(p.CustomerCode)).ToList();
-
- // var entityList = ObjectMapper.Map, List>(result);
- // var _ls = entityList.Where(p=>p.EndDate.ToString().Contains("9999")).OrderByDescending(p => p.BeginDate).GroupBy(p => new { p.MaterialCode, p.CustomerCode,p.Type }).Select(p=>p.FirstOrDefault());
-
- // foreach (var itm in _ls)
- // {
- // itm.Update(GuidGenerator.Create(),version);
- // }
- // _ls=_ls.Where(p => p.Type == 20).ToList();
-
-
-
-
-
- // await _mng.ImportAsync(_ls.ToList(), version);
- // return ApplicationConsts.SuccessStr;
- // }
-
-
-
-
- // ///
- // /// 修改实体
- // ///
- // /// ID
- // /// 修改实体DTO
- // /// 实体DTO
- // [HttpPut]
- // [Route("{id}")]
- // [Authorize(SettleAccountPermissions.PriceLists.Update)]
- // virtual public async Task UpdateAsync(Guid id, PriceListBJDto input)
- // {
- // var entity = new PriceListBJ(
-
- // );
-
- // var _ent = await _mng.UpdateAsync(id, entity);
-
-
- // var dto = ObjectMapper.Map(_ent);
- // return dto;
- // }
-
- // ///
- // /// 删除实体
- // ///
- // /// ID
- // /// 无
- // [HttpDelete]
- // [Route("{id}")]
- // //[Authorize(SettleAccountPermissions.PriceLists.Delete)]
- // virtual public async Task DeleteAsync(Guid id)
- // {
-
- // await _mng.DeleteAsync(id);
- // }
-
- // ///
- // /// 按IDs删除实体列表
- // ///
- // /// ID列表
- // /// 是否执行成功
- // [HttpPost]
- // [Route("delete")]
- // //[Authorize(SettleAccountPermissions.PriceLists.Delete)]
- // virtual public async Task DeleteListAsync(List ids)
- // {
-
- // return await _mng.DeleteListAsync(ids);
- // }
-
- // ///
- // /// 导出文件
- // ///
- // ///
- // ///
- // [HttpPost]
- // [Route("Export")]
- // //[Authorize(SettleAccountPermissions.PriceLists.Default)]
- // virtual public async Task ExportAsync(PriceListRequestDto input)
- // {
-
- // IExporter _csv = new CsvExporter();
- // IExporter _excel = new ExcelExporter();
- // var entities = await _mng.GetListAsync(input.Filters, input.Sorting, int.MaxValue,
- // 0, true);
- // var dtoDetails = ObjectMapper.Map, List>(entities);
-
- // string _fileName = string.Empty;
- // //声明导出容器
-
- // byte[] result = null;
- // switch (input.FileType)
- // {
- // case 0:
- // _fileName = string.Format("备件标准价格单_{0}.xlsx", Guid.NewGuid().ToString());
- // result = await _csv.ExportAsByteArray(dtoDetails);
- // break;
- // case 1:
- // _fileName = string.Format("备件标准价格单_{0}.xlsx", Guid.NewGuid().ToString());
- // result = await _excel.ExportAsByteArray(dtoDetails);
- // break;
- // }
- // result.ShouldNotBeNull();
-
- // //保存导出文件到服务器存成二进制
- // await _excelImportService.SaveBlobAsync(
- // new SaveExcelImportInputDto
- // {
- // Name = _fileName,
- // Content = result
- // }
- // );
- // return _fileName;
- // }
- #endregion
-
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs
index 88aad9de..527b6d3e 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs
@@ -5,6 +5,7 @@ using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Volo.Abp.Domain.Entities.Auditing;
using Win.Sfs.Shared.DomainBase;
namespace Win.Sfs.SettleAccount.Entities.Prices
@@ -21,7 +22,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
///
/// 销售价格
///
- public class PriceList : FullAuditedAggregateRootBase
+ public class PriceList : AuditedAggregateRoot
{
public PriceList()
{ }
@@ -155,7 +156,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
///
/// 备件价格
///
- public class PriceListBJ : FullAuditedAggregateRootBase
+ public class PriceListBJ : AuditedAggregateRoot
{
public PriceListBJ()
{ }
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs
deleted file mode 100644
index 3c02807e..00000000
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs
+++ /dev/null
@@ -1,338 +0,0 @@
-using EFCore.BulkExtensions;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
-using Volo.Abp.Domain.Repositories;
-using Volo.Abp.Domain.Services;
-using Win.Sfs.Shared.DomainBase;
-using Win.Sfs.Shared.Filter;
-using Win.Sfs.Shared.RepositoryBase;
-
-namespace Win.Sfs.SettleAccount.Entities.Prices
-{
- public class PriceListManager : DomainService
- {
- ///
- /// 销售价格仓储
- ///
- private readonly INormalEfCoreRepository _priceListRepository;
-
- private readonly ISettleAccountBranchEfCoreRepository _repository;
- private readonly ISettleAccountBranchEfCoreRepository _versionRepository;
- protected PriceListManager() { }
- public PriceListManager(
- INormalEfCoreRepository priceListRepository,
- ISettleAccountBranchEfCoreRepository repository,
- ISettleAccountBranchEfCoreRepository versionRepository
- )
- {
- _priceListRepository = priceListRepository;
- _versionRepository = versionRepository;
- _repository = repository;
- }
- public virtual async Task GetAsync(Guid id)
- {
- return await _repository.GetAsync(id);
- }
-
- public virtual List GetPriceList(string version)
- {
- var entities = _repository.Where(p => p.Version == version);
- return entities.ToList();
- }
-
- public virtual async Task> GetListAsync(
-
- List filters,
- string sorting = null,
- int maxResultCount = int.MaxValue,
- int skipCount = 0,
- bool includeDetails = false,
- CancellationToken cancellationToken = default)
- {
- var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount,
- skipCount);
- return entities;
- }
- public virtual async Task> GetVersionListAsync(
-
- List filters,
- string sorting = null,
- int maxResultCount = int.MaxValue,
- int skipCount = 0,
- bool includeDetails = false,
- CancellationToken cancellationToken = default)
- {
- var entities = await _versionRepository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount,
- skipCount);
- return entities;
- }
-
-
-
- public async Task GetCountAsync(List p_filter
- , Guid branchId)
- {
- return await _repository.GetCountByFilterAsync(branchId, p_filter);
- }
-
- ///
- /// 导入
- ///
- public virtual async Task> ImportAsync(List entities, string version)
- {
- List _errorList = new List();
- //写校验在这里
-
- var lus = entities.Select(p => p.LU).ToList();
- var pricelist = await _priceListRepository.GetListAsync(p => lus.Contains(p.LU));
-
- var update = from item1 in entities
- join item2 in pricelist
- on new { item1.LU, item1.ClientCode } equals new { item2.LU, item2.ClientCode }
- where item1.Price != item2.Price && item1.BeginTime == item2.BeginTime && item1.EndTime == item1.EndTime
- select new PriceList(item2.Id, item2.LU, item1.Price, item2.BeginTime, item2.EndTime, item2.ClientCode, item2.Date, item2.ContractNo);
-
- //新日期
- var updateNewDate = from item1 in entities
- join item2 in pricelist
- on new { item1.LU, item1.ClientCode } equals new { item2.LU, item2.ClientCode }
- where item1.BeginTime != item2.BeginTime || item1.EndTime != item2.EndTime
- select item1;
- update = update.Concat(updateNewDate);
- if (update.Any())
- {
- await _repository.GetDbContext().BulkUpdateAsync(update.ToList());
- }
-
- //新零件号
- var addNewLu = from item1 in entities
- join item2 in pricelist
- on new { item1.LU, item1.ClientCode } equals new { item2.LU, item2.ClientCode }
- into temp
- from item3 in temp.DefaultIfEmpty()
- where item3 == null
- select item1;
-
- if (addNewLu.Any())
- {
- await _repository.GetDbContext().BulkInsertAsync(addNewLu.ToList());
- }
-
- return _errorList;
- }
-
- public virtual async Task CreateAsync(PriceList input)
- {
- var entity = new PriceList(
- GuidGenerator.Create(), input.BeginTime, input.EndTime, input.Price, input.MaterialCode, input.Type,input.ParentId,input.Version,input.CustomerCode
- );
-
- return await _repository.InsertAsync(entity);
-
- }
-
-
- public virtual async Task UpdateAsync(Guid id, PriceList input)
- {
- var entity = await _repository.GetAsync(id);
- entity.Set(
- input.BeginTime, input.EndTime, input.Price, input.MaterialCode, input.Type,input.CustomerCode
- );
- return await _repository.UpdateAsync(entity);
-
- }
-
-
- public virtual async Task DeleteAsync(Guid id)
- {
- await _repository.DeleteAsync(id);
- }
-
-
- public virtual async Task DeleteListAsync(List ids)
- {
- return await _repository.DeleteListAsync(ids);
- }
-
-
- public virtual async Task GetTotalCountAsync(Guid branchId)
- {
- return await _repository.GetCountAsync(branchId);
- }
-
- public virtual async Task> GetAllAsync(Guid branchId)
- {
- var entities = await _repository.GetAllAsync(branchId);
-
- return entities;
- }
- }
-
- public class PriceListManagerBJ : DomainService
- {
- ///
- /// 备件价格仓储
- ///
- private readonly INormalEfCoreRepository _priceListBJRepository;
-
- private readonly ISettleAccountBranchEfCoreRepository _repository;
- private readonly ISettleAccountBranchEfCoreRepository _versionRepository;
- protected PriceListManagerBJ() { }
- public PriceListManagerBJ(
- INormalEfCoreRepository priceListBJRepository,
- ISettleAccountBranchEfCoreRepository repository,
- ISettleAccountBranchEfCoreRepository versionRepository
- )
- {
- _priceListBJRepository = priceListBJRepository;
- _versionRepository = versionRepository;
- _repository = repository;
- }
- public virtual async Task GetAsync(Guid id)
- {
- return await _repository.GetAsync(id);
- }
-
- public virtual List GetPriceList(string version)
- {
- var entities = _repository.Where(p => p.Version == version);
- return entities.ToList();
- }
-
- public virtual async Task> GetListAsync(
-
- List filters,
- string sorting = null,
- int maxResultCount = int.MaxValue,
- int skipCount = 0,
- bool includeDetails = false,
- CancellationToken cancellationToken = default)
- {
- var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount,
- skipCount);
- return entities;
- }
- public virtual async Task> GetVersionListAsync(
-
- List filters,
- string sorting = null,
- int maxResultCount = int.MaxValue,
- int skipCount = 0,
- bool includeDetails = false,
- CancellationToken cancellationToken = default)
- {
- var entities = await _versionRepository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount,
- skipCount);
- return entities;
- }
-
-
-
- public async Task GetCountAsync(List p_filter
- , Guid branchId)
- {
- return await _repository.GetCountByFilterAsync(branchId, p_filter);
- }
-
- ///
- /// 导入
- ///
- public virtual async Task> ImportAsync(List entities, string version)
- {
- List _errorList = new List();
- //写校验在这里
-
- var lus = entities.Select(p => p.LU).ToList();
- var pricelist = await _priceListBJRepository.GetListAsync(p => lus.Contains(p.LU));
-
- var update = from item1 in entities
- join item2 in pricelist
- on new { item1.LU, item1.ClientCode } equals new { item2.LU, item2.ClientCode }
- where item1.Price != item2.Price && item1.BeginDate == item2.BeginDate && item1.EndDate == item1.EndDate
- select new PriceListBJ(item2.Id, item2.LU, item1.Price, item2.BeginDate, item2.EndDate, item2.ClientCode, item2.Date, item2.ContractNo);
- if (update.Any())
- {
- await _repository.GetDbContext().BulkUpdateAsync(update.ToList());
- }
-
- //新零件号
- var addNewLu = from item1 in entities
- join item2 in pricelist
- on new { item1.LU, item1.ClientCode } equals new { item2.LU, item2.ClientCode }
- into temp
- from item3 in temp.DefaultIfEmpty()
- where item3 == null
- select item1;
- //新日期
- var addNewDate = from item1 in entities
- join item2 in pricelist
- on new { item1.LU, item1.ClientCode } equals new { item2.LU, item2.ClientCode }
- where item1.BeginDate != item2.BeginDate || item1.EndDate != item2.EndDate
- select item1;
-
- var add = addNewLu.Concat(addNewDate);
- if (add.Any())
- {
- await _repository.GetDbContext().BulkInsertAsync(add.ToList());
- }
-
- return _errorList;
- }
-
- public virtual async Task CreateAsync(PriceListBJ input)
- {
- var entity = new PriceListBJ(
- GuidGenerator.Create(), input.BeginDate, input.EndDate, input.Price, input.MaterialCode, input.Type, input.ParentId, input.Version, input.CustomerCode
- );
-
- return await _repository.InsertAsync(entity);
-
- }
-
-
- public virtual async Task UpdateAsync(Guid id, PriceListBJ input)
- {
- var entity = await _repository.GetAsync(id);
- entity.Set(
- input.BeginDate, input.EndDate, input.Price, input.MaterialCode, input.Type, input.CustomerCode
- );
- return await _repository.UpdateAsync(entity);
-
- }
-
-
- public virtual async Task DeleteAsync(Guid id)
- {
- await _repository.DeleteAsync(id);
- }
-
-
- public virtual async Task DeleteListAsync(List ids)
- {
- return await _repository.DeleteListAsync(ids);
- }
-
-
- public virtual async Task GetTotalCountAsync(Guid branchId)
- {
- return await _repository.GetCountAsync(branchId);
- }
-
- public virtual async Task> GetAllAsync(Guid branchId)
- {
- var entities = await _repository.GetAllAsync(branchId);
-
- return entities;
- }
- }
-
-
-
-
-
-}
-
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831024215_vmi19.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831024215_vmi19.cs
index d7519865..96730e22 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831024215_vmi19.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831024215_vmi19.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
@@ -37,12 +37,12 @@ namespace Win.Sfs.SettleAccount.Migrations
oldType: "nvarchar(450)",
oldNullable: true);
- migrationBuilder.UpdateData(
- table: "Set_JobItem",
- keyColumn: "Id",
- keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
- columns: new[] { "ConcurrencyStamp", "Name" },
- values: new object[] { "89ee40808b37440e89bc3e3c9c0312a7", "库存余额同步" });
+ //migrationBuilder.UpdateData(
+ // table: "Set_JobItem",
+ // keyColumn: "Id",
+ // keyValue: new Guid("185c5968-e02b-267e-db2f-225fccfc9716"),
+ // columns: new[] { "ConcurrencyStamp", "Name" },
+ // values: new object[] { "89ee40808b37440e89bc3e3c9c0312a7", "库存余额同步" });
migrationBuilder.UpdateData(
table: "Set_JobItem",
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831082843_20230831-1.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831082843_20230831-1.Designer.cs
new file mode 100644
index 00000000..81761cec
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831082843_20230831-1.Designer.cs
@@ -0,0 +1,5774 @@
+//
+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("20230831082843_20230831-1")]
+ partial class _202308311
+ {
+ 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("ErpLoc")
+ .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("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("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ 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("ErpLoc")
+ .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("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("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ 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("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("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("IsMaiDan")
+ .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("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("ContractDocID")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustomerPartCodeNoSpace")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ 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