diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs
index 90ac0bf8..a17adf98 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs
@@ -1,5 +1,6 @@
-using System;
+using System;
using System.IO;
+using Magicodes.ExporterAndImporter.Excel.Utility.TemplateExport;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
@@ -39,10 +40,10 @@ namespace Win.Sfs.SettleAccount
Log.Logger = new LoggerConfiguration()
.ReadFrom.Configuration(configuration)
+ .WriteTo.Async(c => c.Console())
.CreateLogger();
-
try
{
Log.Information("Starting web host.");
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Attributes/ExcelImporterHeadDescAttribute.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Attributes/ExcelImporterHeadDescAttribute.cs
new file mode 100644
index 00000000..c0f8a911
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Attributes/ExcelImporterHeadDescAttribute.cs
@@ -0,0 +1,21 @@
+using System;
+
+namespace Win.Sfs.SettleAccount.Attributes
+{
+ ///
+ /// Excel导入头部描述
+ ///
+ [AttributeUsage(AttributeTargets.Property)]
+ public class ExcelImporterHeadDescAttribute : Attribute
+ {
+ ///
+ /// 行数
+ ///
+ public int Row { get; set; }
+
+ ///
+ /// 列数
+ ///
+ public int Cell { get; set; }
+ }
+}
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 1bbe2702..86946622 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
@@ -1,4 +1,4 @@
-using Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
@@ -32,7 +32,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
///
/// 导入
///
- public class ZGJ_PUB_SA_DETAIL_IMPORT_DTO
+ public class PUB_SA_DETAIL_IMPORT_DTO
{
/////
///// 期间
@@ -103,9 +103,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
}
///
- /// 导出
+ /// 结算明细导出请求
///
- public class PUB_SA_EXPORT_DTO
+ public class PUB_SA_DETAIL_EXPORT_REQUEST_DTO
+ {
+ ///
+ /// 结算单号
+ ///
+ [Display(Name = "结算单号")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ public string BillNum { set; get; }
+ }
+
+ ///
+ /// 结算明细导出
+ ///
+ public class PUB_SA_DETAIL_EXPORT_DTO
{
}
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 d9c012d3..0d0570dd 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
@@ -1,8 +1,10 @@
-using Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Excel;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
+using Win.Sfs.SettleAccount.Attributes;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.Shared.Filter;
@@ -87,14 +89,43 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
[Display(Name = "客户编码")]
[ExporterHeader(DisplayName = "客户编码")]
public string ClientCode { get; set; }
+
+ ///
+ /// 合同签订时间
+ ///
+ [Display(Name = "合同签订时间")]
+ [ExporterHeader(DisplayName = "合同签订时间")]
+ public DateTime Date { get; set; }
+
+ ///
+ /// 合同号
+ ///
+ [Display(Name = "合同号")]
+ [ExporterHeader(DisplayName = "合同号")]
+ public string ContractNo { get; set; }
}
///
/// 销售价格导入
///
[ImportProject(Name = SettleAccountModuleName.PriceList)]
+ [Importer(HeaderRowIndex = 22)]
public class PriceListImportDto
{
+ ///
+ /// 合同签订时间
+ ///
+ [ImporterHeader(IsIgnore = true)]
+ [ExcelImporterHeadDesc(Row = 1, Cell = 1)]
+ public string Date { get; set; }
+
+ ///
+ /// 合同号
+ ///
+ [ImporterHeader(IsIgnore = true)]
+ [ExcelImporterHeadDesc(Row = 2, Cell = 1)]
+ public string ContractNo { get; set; }
+
/////
///// ItemNo
/////
@@ -265,8 +296,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
}
public class PriceListRequestDto : PagedAndSortedResultRequestDto
{
-
-
[Display(Name = "开始时间")]
public DateTime BeginDate { get; set; }
[Display(Name = "结算时间")]
@@ -331,8 +360,22 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
[ExporterHeader(DisplayName = "客户编码")]
public string ClientCode { get; set; }
+ ///
+ /// 合同签订时间
+ ///
+ [Display(Name = "合同签订时间")]
+ [ExporterHeader(DisplayName = "合同签订时间")]
+ public DateTime Date { get; set; }
+
+ ///
+ /// 合同号
+ ///
+ [Display(Name = "合同号")]
+ [ExporterHeader(DisplayName = "合同号")]
+ public string ContractNo { get; set; }
}
+ [Importer(HeaderRowIndex = 22)]
public class PriceListBJImportDto
{
///
@@ -353,6 +396,19 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
[ImporterHeader(Name = "客户编码")]
public string ClientCode { get; set; }
+ ///
+ /// 合同签订时间
+ ///
+ [ImporterHeader(IsIgnore = true)]
+ [ExcelImporterHeadDesc(Row = 1, Cell = 1)]
+ public string Date { get; set; }
+
+ ///
+ /// 合同号
+ ///
+ [ImporterHeader(IsIgnore = true)]
+ [ExcelImporterHeadDesc(Row = 2, Cell = 1)]
+ public string ContractNo { get; set; }
}
public class PriceListBJRequestDto : RequestInputBase
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
new file mode 100644
index 00000000..4960a705
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs
@@ -0,0 +1,84 @@
+using System;
+using System.Collections.Generic;
+using System.Linq.Dynamic.Core;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.OpenApi.Extensions;
+using SettleAccount.Domain.BQ;
+using Shouldly;
+using Volo.Abp;
+using Volo.Abp.Caching;
+using Win.Abp.Snowflakes;
+using Win.Sfs.BaseData.ImportExcelCommon;
+using Win.Sfs.SettleAccount.CommonManagers;
+using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using Win.Sfs.SettleAccount.ExcelImporter;
+using Win.Sfs.Shared.Filter;
+using Win.Sfs.Shared.RepositoryBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ;
+
+///
+/// PUB结算明细
+///
+[AllowAnonymous]
+[Route("api/settleaccount/[controller]/[action]")]
+public class PUB_SA_DETAIL_SERVICE : SettleAccountApplicationBase
+{
+ ///
+ /// PUB结算明细仓储
+ ///
+ private readonly INormalEfCoreRepository _pubSaDetailRepository;
+
+ ///
+ /// PUB结算仓储
+ ///
+ private readonly INormalEfCoreRepository _pubSaRepository;
+
+ ///
+ /// 构造
+ ///
+ public PUB_SA_DETAIL_SERVICE(INormalEfCoreRepository pubSaDetailRepository,
+ INormalEfCoreRepository pubSaRepository,
+ IDistributedCache cache,
+ IExcelImportAppService excelImportService,
+ ISnowflakeIdGenerator snowflakeIdGenerator,
+ ICommonManager commonManager
+ ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
+ {
+ _pubSaDetailRepository = pubSaDetailRepository;
+ _pubSaRepository = pubSaRepository;
+ }
+
+ #region 导出
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ public async Task ExportAsync(PUB_SA_DETAIL_EXPORT_REQUEST_DTO input)
+ {
+ var pubSaEntity = await _pubSaRepository.FirstOrDefaultAsync(t=>t.BillNum == input.BillNum);
+ if (pubSaEntity == null)
+ {
+ throw new UserFriendlyException($"导出失败,结算单号不存在!", "400");
+ }
+ var businessType = pubSaEntity.BusinessType;
+ string fileName = $"{businessType.GetDisplayName()}结算数据_{Guid.NewGuid()}.xlsx";
+ List filters = new List();
+ filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And));
+
+ var entities = await _pubSaDetailRepository.GetListByFilterAsync(filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos);
+ result.ShouldNotBeNull();
+
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
+ return fileName;
+ }
+ #endregion
+
+}
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 f6545a99..7a9e914b 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
@@ -1,16 +1,15 @@
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using NPOI.Util;
-using NUglify.Helpers;
-using SettleAccount.Bases;
-using SettleAccount.Domain.BQ;
-using Shouldly;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.OpenApi.Extensions;
+using NUglify.Helpers;
+using SettleAccount.Domain.BQ;
+using Shouldly;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
@@ -24,6 +23,7 @@ using Win.Sfs.SettleAccount.Entities.Prices;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.MaterialRelationships;
+using Win.Sfs.Shared.Filter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
@@ -104,32 +104,151 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
#region 直供件
+ #region 导入
+ ///
+ /// 导入(直供件)
+ ///
+ [HttpPost]
+ public async Task ImportByBusinessTypeAsync([FromForm] IFormFileCollection files, EnumBusinessType businessType)
+ {
+ return await ImportAsync(files, businessType);
+ }
+
+ /////
+ ///// 导入(直供件)
+ /////
+ //[HttpPost]
+ //public async Task ZhiGongJianImportAsync([FromForm] IFormFileCollection files)
+ //{
+ // return await ImportAsync(files, EnumBusinessType.ZhiGongJian);
+ //}
+
+ /////
+ ///// 导入(备件)
+ /////
+ //[HttpPost]
+ //public async Task BeiJianImportAsync([FromForm] IFormFileCollection files)
+ //{
+ // return await ImportAsync(files, EnumBusinessType.BeiJian);
+ //}
+
+ /////
+ ///// 导入(备件)
+ /////
+ //[HttpPost]
+ //public async Task BeiJianImportAsync([FromForm] IFormFileCollection files)
+ //{
+ // return await ImportAsync(files, EnumBusinessType.BeiJian);
+ //}
+
+ /////
+ ///// 导入(备件)
+ /////
+ //[HttpPost]
+ //public async Task BeiJianImportAsync([FromForm] IFormFileCollection files)
+ //{
+ // return await ImportAsync(files, EnumBusinessType.BeiJian);
+ //}
+ #endregion
+
#endregion
#region 导入、导出
+
+ #endregion
+
+ #region CURD
///
- /// 导入
+ /// 获取列表
+ ///
+ [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 dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
+
+ ///
+ /// 删除
///
[HttpPost]
- public async Task ZGJImportAsync([FromForm] IFormFileCollection files)
+ public async Task DeleteAsync(Guid id)
+ {
+ //结算主表
+ PUB_SA pubSaDelEntity;
+ //结算明细
+ List pubSaDetailDelEntitys;
+ //可结算主表
+ List pubCanSaDelEntitys;
+ //可结算明细
+ List pubCanSaDetailDelEntitys;
+ //不可结算
+ List pubNotSaDetailDelEntitys;
+
+
+ pubSaDelEntity = await _repository.FindAsync(id);
+ if (pubSaDelEntity == null) return;
+ //结算单据
+ string pubSaBillNum = pubSaDelEntity.BillNum;
+
+
+ pubCanSaDelEntitys = await _pubCanSaRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum);
+ //验证可结算主表状态
+ if (pubCanSaDelEntitys.Any(t => t.State != SettleBillState.未结状态))
+ {
+ throw new UserFriendlyException($"该单据可结算单状态无法删除!", "400");
+ }
+
+ pubSaDetailDelEntitys = await _pubSaDetailRepository.GetListAsync(t => t.BillNum == pubSaBillNum);
+ pubCanSaDetailDelEntitys = await _pubCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum);
+ pubNotSaDetailDelEntitys = await _pubNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum);
+
+ //删除
+ await _repository.DeleteAsync(pubSaDelEntity);
+ if (pubSaDetailDelEntitys != null)
+ {
+ await _pubSaDetailRepository.DeleteManyAsync(pubSaDetailDelEntitys);
+ }
+ if (pubCanSaDelEntitys != null)
+ {
+ await _pubCanSaRepository.DeleteManyAsync(pubCanSaDelEntitys);
+ }
+ if (pubCanSaDetailDelEntitys != null)
+ {
+ await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetailDelEntitys);
+ }
+ if (pubNotSaDetailDelEntitys != null)
+ {
+ await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetailDelEntitys);
+ }
+
+ }
+ #endregion
+
+ #region 私有方法
+ ///
+ /// 导入
+ ///
+ private async Task ImportAsync([FromForm] IFormFileCollection files, EnumBusinessType businessType)
{
//数据校验
var checkList = new List();
- //类型(直供件)
- var businessType = EnumBusinessType.ZhiGongJian;
//结算单号
var pubSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA");
//结算主表
var pubSa = new PUB_SA()
{
BillNum = pubSaBillNum,
- State = "1"
+ State = "1",
+ BusinessType = businessType
};
//结算明细
var pubSaDetails = new List();
- //可算单号
+ //可结算单号
var pubCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C");
- //可算主表
+ //可结算主表
var pubCanSa = new PUB_CAN_SA()
{
BillNum = pubCanSaBillNum,
@@ -147,8 +266,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
#region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter();
- var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
- var importPubSaDetails = ObjectMapper.Map, List>(result);
+ var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ var importPubSaDetails = ObjectMapper.Map, List>(result);
//结算分组号
var pubSaGroupNums = importPubSaDetails.Select(t => t.GroupNum).Distinct();
@@ -178,9 +297,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
importPubSaDetails.ForEach(importPubSaDetail =>
{
List luList = importPubSaDetail.LU.Split(" ").ToList();
+ importPubSaDetail.LU = luList[0].Replace(" ", "");
if (luList.Count > 1)
{
- importPubSaDetail.LU = luList[0].Replace(" ", "");
luList.RemoveAt(0);
var luAssemble = luList.Select(t => t.Replace(" ", ""));
importPubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
@@ -209,7 +328,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
noExistSettleMaterialCodes.ForEach(t =>
{
- var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t);
+ var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType.ToString());
materialRelationships.Add(materialRelationship);
});
#endregion
@@ -263,95 +382,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
return ApplicationConsts.SuccessStr;
}
-
- ///
- /// 导出
- ///
- [HttpPost]
- public async Task ExportAsync(RequestDto input)
- {
- string fileName = $"HBPO的EDI数据_{Guid.NewGuid()}.xlsx";
- var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
- var dtos = ObjectMapper.Map, List>(entities);
-
- ExportImporter _exportImporter = new ExportImporter();
- var result = await _exportImporter.ExcelExporter(dtos);
- result.ShouldNotBeNull();
-
- await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result });
- return fileName;
- }
#endregion
-
- #region CURD
- ///
- /// 获取列表
- ///
- [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 dtos = ObjectMapper.Map, List>(entities);
- return new PagedResultDto(totalCount, dtos);
- }
-
- ///
- /// 删除
- ///
- [HttpPost]
- public async Task DeleteAsync(Guid id)
- {
- //结算主表
- PUB_SA pubSaDelEntity;
- //结算明细
- List pubSaDetailDelEntitys;
- //可结算主表
- List pubCanSaDelEntitys;
- //可结算明细
- List pubCanSaDetailDelEntitys;
- //不可结算
- List pubNotSaDetailDelEntitys;
-
-
- pubSaDelEntity = await _repository.FindAsync(id);
- if (pubSaDelEntity == null) return;
- //结算单据
- string pubSaBillNum = pubSaDelEntity.BillNum;
-
-
- pubCanSaDelEntitys = await _pubCanSaRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum);
- //验证可结算主表状态
- if (pubCanSaDelEntitys.Any(t => t.State != SettleBillState.未结状态))
- {
- throw new UserFriendlyException($"该单据可结算单状态无法删除!", "400");
- }
-
- pubSaDetailDelEntitys = await _pubSaDetailRepository.GetListAsync(t => t.BillNum == pubSaBillNum);
- pubCanSaDetailDelEntitys = await _pubCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum);
- pubNotSaDetailDelEntitys = await _pubNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum);
-
- //删除
- await _repository.DeleteAsync(pubSaDelEntity);
- if (pubSaDetailDelEntitys != null)
- {
- await _pubSaDetailRepository.DeleteManyAsync(pubSaDetailDelEntitys);
- }
- if (pubCanSaDelEntitys != null)
- {
- await _pubCanSaRepository.DeleteManyAsync(pubCanSaDelEntitys);
- }
- if (pubCanSaDetailDelEntitys != null)
- {
- await _pubCanSaDetailRepository.DeleteManyAsync(pubCanSaDetailDelEntitys);
- }
- if (pubNotSaDetailDelEntitys != null)
- {
- await _pubNotSaDetailRepository.DeleteManyAsync(pubNotSaDetailDelEntitys);
- }
-
- }
- #endregion
-
}
}
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 63b0e3a4..7606c967 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
@@ -1,9 +1,11 @@
-using Magicodes.ExporterAndImporter.Core;
+using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using NPOI.SS.UserModel;
+using NPOI.SS.Util;
using Shouldly;
using System;
using System.Collections.Generic;
@@ -55,6 +57,17 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
// return new Microsoft.AspNetCore.Mvc.OkResult();
//}
+
+ private string GetOtherSheetStringValue(IWorkbook wk, String sheetName, String location)
+ {
+ ISheet sheet = wk.GetSheet(sheetName);
+ var cr = new CellReference(location);
+ var row = sheet.GetRow(cr.Row);
+ var cell = row.GetCell(cr.Col);
+ string result = cell.StringCellValue;
+ return result;
+ }
+
///
/// 导入
///
@@ -63,7 +76,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
{
ExportImporter _exportImporter = new ExportImporter();
- var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ var result = await _exportImporter.UploadExcelImportByHeadDesc(files, _excelImportService);
List _checkls = new List();
_checkls.Add("1040");
@@ -75,7 +88,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var entityList = ObjectMapper.Map, List>(result);
var _ls = entityList.OrderByDescending(p => p.BeginTime).GroupBy(p => new { p.LU, p.ClientCode }).Select(p => p.FirstOrDefault());
-
foreach (var itm in _ls)
{
itm.Update(GuidGenerator.Create(), version);
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
index 595069a9..5c13fabf 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
@@ -30,6 +30,12 @@ using Win.Sfs.SettleAccount.Entities.Errors;
using Win.Sfs.SettleAccount.Entities.TaskJobs;
using Win.Sfs.SettleAccount.Entities.ImportMap;
+using Magicodes.ExporterAndImporter.Excel.Utility;
+using Magicodes.ExporterAndImporter.Core.Models;
+using Magicodes.ExporterAndImporter.Core.Filters;
+using OfficeOpenXml.Attributes;
+using Win.Sfs.SettleAccount.Attributes;
+using Magicodes.ExporterAndImporter.Core.Extension;
namespace Win.Sfs.SettleAccount.ExcelImporter
{
@@ -38,7 +44,7 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
- private readonly IExporter _csvExporter= new Magicodes.ExporterAndImporter.Csv.CsvExporter();//导出CSV
+ private readonly IExporter _csvExporter = new Magicodes.ExporterAndImporter.Csv.CsvExporter();//导出CSV
private readonly IExcelImporter _importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();//导入Excel
private readonly IExporter _exporter = new ExcelExporter();//导出Excel
@@ -50,7 +56,7 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
ExcelImportResult returnResult = new ExcelImportResult();
List _errorList = new List();
- var importAttrib= type.GetCustomAttribute();
+ var importAttrib = type.GetCustomAttribute();
if (importAttrib != null)
{
@@ -69,7 +75,7 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
{
throw new BusinessException("上传附件不能为空!");
}
-
+
string FileOriginName = file.FileName;
string getFileName = Path.GetFileName(FileOriginName);//获取附件名称
using (var memoryStream = new MemoryStream())
@@ -98,18 +104,153 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
{
if (import.Exception.Message.ToString() == "导入文件不存在!")
{
- throw new BusinessException("8989","文件容器配置的路径错误,请检查!");
+ throw new BusinessException("8989", "文件容器配置的路径错误,请检查!");
+ }
+ else
+ {
+ throw new BusinessException("8989", import.Exception.Message.ToString());
+ }
+ }
+ else
+ {
+ if (import.TemplateErrors.Count > 0)
+ {
+ throw new BusinessException("8989", "模板错误!当前模板中字段不匹配!!请正确上传模板数据!导入不对的列名:" + import.TemplateErrors.FirstOrDefault().RequireColumnName);
+ }
+ import.ShouldNotBeNull();
+ if (import.Exception != null)
+ {
+ //导入的数据有异常
+ throw new BusinessException(import.Exception.ToString());
+ }
+ returnResult.totalSize = import.Data.Count;
+ if (import.RowErrors.Count > 0)
+ {
+ foreach (var itm in import.RowErrors)
+ {
+ string error = string.Empty;
+ foreach (var dic in itm.FieldErrors)
+ {
+ error += (dic.Key + dic.Value + "|");
+ }
+
+ _errorList.Add(string.Format("第{0}行{1}", itm.RowIndex.ToString(), error));
+ }
+ //自动保存“{ 目标文件名称}_.xlsx”的标注文件到目标位置
+ //导入的数据有错误,比如重复列,必填项为空等(不包含警告),主要看DTO的设置
+ import.HasError.ShouldBeTrue();//标识导入的数据有错误
+ returnResult.errSize = import.RowErrors.Count;
+ returnResult.errTemplate = Path.GetFileNameWithoutExtension(FileOriginName) + "_.xlsx";//返回错误模板名称作为参数
+ returnResult.errMessage = "RowErrors";
+ }
+ else
+ {
+ import.HasError.ShouldBeFalse();//标识导入的数据没有错误了
+ if (import.Data.Count > 0)
+ {
+ ImportList.AddRange(import.Data.ToList());
+ }
+ returnResult.errMessage = "SccessData";
+ }
+ }
+ }
+ if (_errorList.Count > 0)
+ {
+ throw new BusinessException("8989", string.Join("\r\n", _errorList));
+ }
+ return ImportList;//返回客户端
+ }
+
+ public virtual async Task> UploadExcelImportByHeadDesc([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService)
+ where T : class, new()
+ {
+ Type type = typeof(T);
+ var ImportList = new List();
+ ExcelImportResult returnResult = new ExcelImportResult();
+ List _errorList = new List();
+
+ foreach (var file in files)
+ {
+ if (file == null)
+ {
+ throw new BusinessException("上传附件不能为空!");
+ }
+
+ string FileOriginName = file.FileName;
+ string getFileName = Path.GetFileName(FileOriginName);//获取附件名称
+ using (var memoryStream = new MemoryStream())
+ {
+ //保存成物理文件
+ await file.CopyToAsync(memoryStream);
+ await _excelImportService.SaveBlobAsync(
+ new SaveExcelImportInputDto
+ {
+ Name = Path.GetFileName(FileOriginName),
+ Content = memoryStream.ToArray()
+ }
+ );
+ }
+ //读取文件保存的根目录
+ string fileSaveRootDir = ConfigDirHelper.GetAppSetting("App", "FileRootPath");
+ //读取WMS文件保存的模块的根目录
+ string fileSaveDir = ConfigDirHelper.GetAppSetting("App", "WMSFiles");
+ //文件保存的相对文件夹(保存到wwwroot目录下)
+ string absoluteFileDir = fileSaveRootDir + @"\" + fileSaveDir;
+ //文件保存的路径(应用的工作目录+文件夹相对路径);
+ string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container" + absoluteFileDir;
+ var filePath = fileSavePath + getFileName;//获取到导入的excel
+ //var import = await _importer.Import(filePath);
+
+ var import = new ImportResult();
+
+ using (var importer = new ImportHelper(filePath, null))
+ {
+ import = await importer.Import(null);
+
+ Stream Stream = new FileStream(filePath, FileMode.Open);
+ using (Stream)
+ {
+ IWorkbook wk = new XSSFWorkbook(Stream);
+ //读取当前表数据
+ ISheet sheet = wk.GetSheetAt(0);
+
+ var excelImporterHeadDescAttributeProperties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty)
+ .Where(o => o.GetCustomAttribute(true) != null);
+ foreach (var item in excelImporterHeadDescAttributeProperties)
+ {
+ string propertyName = item.Name;
+ var excelImporterHeadDesc = item.GetCustomAttribute();
+ var row = excelImporterHeadDesc.Row;
+ var cell = excelImporterHeadDesc.Cell;
+ var value = sheet.GetRow(row).GetCell(cell).ToString();
+
+ if (import.Data != null)
+ {
+ foreach (var item2 in import.Data)
+ {
+ item2.GetType().GetProperty(propertyName).SetValue(item2, value);
+ }
+ }
+ }
+ }
+ }
+
+ if (import.Exception != null)
+ {
+ if (import.Exception.Message.ToString() == "导入文件不存在!")
+ {
+ throw new BusinessException("8989", "文件容器配置的路径错误,请检查!");
}
else
{
- throw new BusinessException("8989",import.Exception.Message.ToString());
+ throw new BusinessException("8989", import.Exception.Message.ToString());
}
}
else
{
if (import.TemplateErrors.Count > 0)
{
- throw new BusinessException("8989","模板错误!当前模板中字段不匹配!!请正确上传模板数据!导入不对的列名:"+import.TemplateErrors.FirstOrDefault().RequireColumnName);
+ throw new BusinessException("8989", "模板错误!当前模板中字段不匹配!!请正确上传模板数据!导入不对的列名:" + import.TemplateErrors.FirstOrDefault().RequireColumnName);
}
import.ShouldNotBeNull();
if (import.Exception != null)
@@ -125,10 +266,10 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
string error = string.Empty;
foreach (var dic in itm.FieldErrors)
{
- error += (dic.Key+ dic.Value+"|");
+ error += (dic.Key + dic.Value + "|");
}
- _errorList.Add(string.Format("第{0}行{1}", itm.RowIndex.ToString(),error));
+ _errorList.Add(string.Format("第{0}行{1}", itm.RowIndex.ToString(), error));
}
//自动保存“{ 目标文件名称}_.xlsx”的标注文件到目标位置
//导入的数据有错误,比如重复列,必填项为空等(不包含警告),主要看DTO的设置
@@ -150,142 +291,142 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
}
if (_errorList.Count > 0)
{
- throw new BusinessException("8989",string.Join("\r\n", _errorList));
+ throw new BusinessException("8989", string.Join("\r\n", _errorList));
}
return ImportList;//返回客户端
}
- // public virtual async Task> UploadExcelImport([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService, ISettleAccountBranchEfCoreRepository repository=null)
- //where T : class, new()
- // {
- // Type type = typeof(T);
- // var ImportList = new List();
- // ExcelImportResult returnResult = new ExcelImportResult();
- // List _errorList = new List();
-
-
-
-
- // //if (repository != null)
- // //{
- // // var importAttrib = type.GetCustomAttribute();
- // // if (importAttrib != null)
- // // {
- // // var _columnList = repository.Where(p => p.ProjectName == importAttrib.Name);
- // // if (_columnList.Count() > 0)
- // // {
- // // foreach (var itm in type.GetProperties())
- // // {
- // // var attrib = itm.GetCustomAttribute();
- // // if (attrib != null)
- // // {
- // // var newColumn = _columnList.FirstOrDefault(p => p.OldColumnName == attrib.Name);
- // // if (newColumn != null && !string.IsNullOrEmpty(newColumn.NewColumnName))
- // // {
-
- // // attrib.Name = !string.IsNullOrEmpty(newColumn.NewColumnName)? newColumn.NewColumnName:attrib.Name;
-
- // // }
- // // }
- // // }
- // // }
- // // }
- // //}
-
-
- // foreach (var file in files)
- // {
- // if (file == null)
- // {
- // throw new BusinessException("上传附件不能为空!");
- // }
-
- // string FileOriginName = file.FileName;
- // string getFileName = Path.GetFileName(FileOriginName);//获取附件名称
- // using (var memoryStream = new MemoryStream())
- // {
- // //保存成物理文件
- // await file.CopyToAsync(memoryStream);
- // await _excelImportService.SaveBlobAsync(
- // new SaveExcelImportInputDto
- // {
- // Name = Path.GetFileName(FileOriginName),
- // Content = memoryStream.ToArray()
- // }
- // );
- // }
- // //读取文件保存的根目录
- // string fileSaveRootDir = ConfigDirHelper.GetAppSetting("App", "FileRootPath");
- // //读取WMS文件保存的模块的根目录
- // string fileSaveDir = ConfigDirHelper.GetAppSetting("App", "WMSFiles");
- // //文件保存的相对文件夹(保存到wwwroot目录下)
- // string absoluteFileDir = fileSaveRootDir + @"\" + fileSaveDir;
- // //文件保存的路径(应用的工作目录+文件夹相对路径);
- // string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container" + absoluteFileDir;
- // var filePath = fileSavePath + getFileName;//获取到导入的excel
- // var import = await _importer.Import(filePath);
- // if (import.Exception != null)
- // {
- // if (import.Exception.Message.ToString() == "导入文件不存在!")
- // {
- // throw new BusinessException("8989", "文件容器配置的路径错误,请检查!");
- // }
- // else
- // {
- // throw new BusinessException("8989", import.Exception.Message.ToString());
- // }
- // }
- // else
- // {
- // if (import.TemplateErrors.Count > 0)
- // {
- // throw new BusinessException("8989", "模板错误!当前模板中字段不匹配!!请正确上传模板数据!");
- // }
- // import.ShouldNotBeNull();
- // if (import.Exception != null)
- // {
- // //导入的数据有异常
- // throw new BusinessException(import.Exception.ToString());
- // }
- // returnResult.totalSize = import.Data.Count;
- // if (import.RowErrors.Count > 0)
- // {
- // foreach (var itm in import.RowErrors)
- // {
- // string error = string.Empty;
- // foreach (var dic in itm.FieldErrors)
- // {
- // error += (dic.Key + dic.Value + "|");
- // }
-
- // _errorList.Add(string.Format("第{0}行{1}", itm.RowIndex.ToString(), error));
- // }
-
-
-
- // //自动保存“{ 目标文件名称}_.xlsx”的标注文件到目标位置
- // //导入的数据有错误,比如重复列,必填项为空等(不包含警告),主要看DTO的设置
- // import.HasError.ShouldBeTrue();//标识导入的数据有错误
- // returnResult.errSize = import.RowErrors.Count;
- // returnResult.errTemplate = Path.GetFileNameWithoutExtension(FileOriginName) + "_.xlsx";//返回错误模板名称作为参数
- // returnResult.errMessage = "RowErrors";
- // }
- // else
- // {
- // import.HasError.ShouldBeFalse();//标识导入的数据没有错误了
- // if (import.Data.Count > 0)
- // {
- // ImportList.AddRange(import.Data.ToList());
- // }
- // returnResult.errMessage = "SccessData";
- // }
- // }
- // }
- // if (_errorList.Count > 0)
- // {
- // throw new BusinessException("8989", string.Join("\r\n", _errorList));
- // }
- // return ImportList;//返回客户端
- // }
+ // public virtual async Task> UploadExcelImport([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService, ISettleAccountBranchEfCoreRepository repository=null)
+ //where T : class, new()
+ // {
+ // Type type = typeof(T);
+ // var ImportList = new List();
+ // ExcelImportResult returnResult = new ExcelImportResult();
+ // List _errorList = new List();
+
+
+
+
+ // //if (repository != null)
+ // //{
+ // // var importAttrib = type.GetCustomAttribute();
+ // // if (importAttrib != null)
+ // // {
+ // // var _columnList = repository.Where(p => p.ProjectName == importAttrib.Name);
+ // // if (_columnList.Count() > 0)
+ // // {
+ // // foreach (var itm in type.GetProperties())
+ // // {
+ // // var attrib = itm.GetCustomAttribute();
+ // // if (attrib != null)
+ // // {
+ // // var newColumn = _columnList.FirstOrDefault(p => p.OldColumnName == attrib.Name);
+ // // if (newColumn != null && !string.IsNullOrEmpty(newColumn.NewColumnName))
+ // // {
+
+ // // attrib.Name = !string.IsNullOrEmpty(newColumn.NewColumnName)? newColumn.NewColumnName:attrib.Name;
+
+ // // }
+ // // }
+ // // }
+ // // }
+ // // }
+ // //}
+
+
+ // foreach (var file in files)
+ // {
+ // if (file == null)
+ // {
+ // throw new BusinessException("上传附件不能为空!");
+ // }
+
+ // string FileOriginName = file.FileName;
+ // string getFileName = Path.GetFileName(FileOriginName);//获取附件名称
+ // using (var memoryStream = new MemoryStream())
+ // {
+ // //保存成物理文件
+ // await file.CopyToAsync(memoryStream);
+ // await _excelImportService.SaveBlobAsync(
+ // new SaveExcelImportInputDto
+ // {
+ // Name = Path.GetFileName(FileOriginName),
+ // Content = memoryStream.ToArray()
+ // }
+ // );
+ // }
+ // //读取文件保存的根目录
+ // string fileSaveRootDir = ConfigDirHelper.GetAppSetting("App", "FileRootPath");
+ // //读取WMS文件保存的模块的根目录
+ // string fileSaveDir = ConfigDirHelper.GetAppSetting("App", "WMSFiles");
+ // //文件保存的相对文件夹(保存到wwwroot目录下)
+ // string absoluteFileDir = fileSaveRootDir + @"\" + fileSaveDir;
+ // //文件保存的路径(应用的工作目录+文件夹相对路径);
+ // string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container" + absoluteFileDir;
+ // var filePath = fileSavePath + getFileName;//获取到导入的excel
+ // var import = await _importer.Import(filePath);
+ // if (import.Exception != null)
+ // {
+ // if (import.Exception.Message.ToString() == "导入文件不存在!")
+ // {
+ // throw new BusinessException("8989", "文件容器配置的路径错误,请检查!");
+ // }
+ // else
+ // {
+ // throw new BusinessException("8989", import.Exception.Message.ToString());
+ // }
+ // }
+ // else
+ // {
+ // if (import.TemplateErrors.Count > 0)
+ // {
+ // throw new BusinessException("8989", "模板错误!当前模板中字段不匹配!!请正确上传模板数据!");
+ // }
+ // import.ShouldNotBeNull();
+ // if (import.Exception != null)
+ // {
+ // //导入的数据有异常
+ // throw new BusinessException(import.Exception.ToString());
+ // }
+ // returnResult.totalSize = import.Data.Count;
+ // if (import.RowErrors.Count > 0)
+ // {
+ // foreach (var itm in import.RowErrors)
+ // {
+ // string error = string.Empty;
+ // foreach (var dic in itm.FieldErrors)
+ // {
+ // error += (dic.Key + dic.Value + "|");
+ // }
+
+ // _errorList.Add(string.Format("第{0}行{1}", itm.RowIndex.ToString(), error));
+ // }
+
+
+
+ // //自动保存“{ 目标文件名称}_.xlsx”的标注文件到目标位置
+ // //导入的数据有错误,比如重复列,必填项为空等(不包含警告),主要看DTO的设置
+ // import.HasError.ShouldBeTrue();//标识导入的数据有错误
+ // returnResult.errSize = import.RowErrors.Count;
+ // returnResult.errTemplate = Path.GetFileNameWithoutExtension(FileOriginName) + "_.xlsx";//返回错误模板名称作为参数
+ // returnResult.errMessage = "RowErrors";
+ // }
+ // else
+ // {
+ // import.HasError.ShouldBeFalse();//标识导入的数据没有错误了
+ // if (import.Data.Count > 0)
+ // {
+ // ImportList.AddRange(import.Data.ToList());
+ // }
+ // returnResult.errMessage = "SccessData";
+ // }
+ // }
+ // }
+ // if (_errorList.Count > 0)
+ // {
+ // throw new BusinessException("8989", string.Join("\r\n", _errorList));
+ // }
+ // return ImportList;//返回客户端
+ // }
@@ -305,10 +446,10 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
- public virtual async Task> ExtendExcelImport([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService, List p_list=null)
+ public virtual async Task> ExtendExcelImport([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService, List p_list = null)
where T : class, new()
{
-
+
Type type = typeof(T);
var ImportList = new List();
ExcelImportResult returnResult = new ExcelImportResult();
@@ -354,7 +495,7 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
{
ImportList = _excelHelper.ExcelToList();
}
-
+
}
return ImportList;//返回客户端
}
@@ -432,40 +573,40 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
/// 获取配置下面的具体属性的值
///
public class GetSetting
+{
+ public string option1 { get; }
+ public GetSetting(IConfiguration Configuration)
{
- public string option1 { get; }
- public GetSetting(IConfiguration Configuration)
- {
- this.option1 = Configuration.GetSection("option1").Value;
- }
+ this.option1 = Configuration.GetSection("option1").Value;
}
+}
-
-
- public class ExcelImportResult
- {
- ///
- /// 导入的数据总数
- ///
- public long totalSize { get; set; }
- ///
- /// 成功的个数
- ///
- public long succeessSize { get; set; }
- ///
- /// 错误数据个数
- ///
- public long errSize { get; set; }
- ///
- /// 导入错误生成的模板名称
- ///
- public string errTemplate { get; set; }
-
- ///
- /// 返回错误信息
- ///
- public string errMessage { get; set; }
- }
\ No newline at end of file
+public class ExcelImportResult
+{
+ ///
+ /// 导入的数据总数
+ ///
+ public long totalSize { get; set; }
+
+ ///
+ /// 成功的个数
+ ///
+ public long succeessSize { get; set; }
+
+ ///
+ /// 错误数据个数
+ ///
+ public long errSize { get; set; }
+ ///
+ /// 导入错误生成的模板名称
+ ///
+ public string errTemplate { get; set; }
+
+ ///
+ /// 返回错误信息
+ ///
+ public string errMessage { get; set; }
+}
\ No newline at end of file
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
index 05b4780c..4108b12e 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
@@ -1,4 +1,4 @@
-using AutoMapper;
+using AutoMapper;
using Win.Sfs.SettleAccount.EstimatedStockDiffReports;
using Win.Sfs.SettleAccount.Boms;
using Win.Sfs.SettleAccount.Entities.Boms;
@@ -488,7 +488,8 @@ namespace Win.Sfs.SettleAccount
.ForMember(x => x.Price, y => y.MapFrom(y => y.TotalPrice))
.ForMember(x => x.BeginTime, y => y.MapFrom(y => y.ValidFrom))
.ForMember(x => x.EndTime, y => y.MapFrom(y => y.ValidTo))
- .ForMember(x => x.ClientCode, y => y.MapFrom(y => y.Plant));
+ .ForMember(x => x.ClientCode, y => y.MapFrom(y => y.Plant))
+ .ForMember(x => x.Date, y => y.MapFrom(y => DateTime.ParseExact(y.Date, "dd.MM.yyyy", System.Globalization.CultureInfo.CurrentCulture)));
CreateMap();
@@ -978,7 +979,7 @@ namespace Win.Sfs.SettleAccount
CreateMap()
.ForMember(x => x.SettleBillNum, y => y.MapFrom(d => d.BillNum));
- CreateMap();
+ CreateMap();
}
}
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 c245ee6a..3cc4bf0f 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
@@ -1,7 +1,8 @@
-using SettleAccount.Bases;
+using SettleAccount.Bases;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
+using Win.Sfs.SettleAccount;
namespace SettleAccount.Domain.BQ;
[Display(Name = "公用结算导入主表")]
@@ -19,6 +20,12 @@ public class PUB_SA : FullAuditedAggregateRoot
[Display(Name = "状态")]
public string State { get; set; } = null!;
+ ///
+ /// 业务分类
+ ///
+ [Display(Name = "业务分类")]
+ public EnumBusinessType BusinessType { get; set; }
+
public PUB_SA(Guid guid, int version, string billNum, string state)
{
Version = version;
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs
index 7f5fe6a5..d5935ec2 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs
@@ -97,11 +97,12 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships
AppraisalCategory = appraisalCategory;
}
- public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode) : base(id)
+ public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode, string appraisalCategory) : base(id)
{
ErpMaterialCode = erpMaterialCode;
MaterialDesc = materialDesc;
SettleMaterialCode = settlMaterialCode;
+ AppraisalCategory = appraisalCategory;
}
}
}
\ No newline at end of file
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 01630b1a..2ea7ac34 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
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -36,6 +36,17 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
CustomerCode = customerCode;
}
+ public PriceList(Guid Id, string lu, decimal price, DateTime beginDate, DateTime endDate, string clientCode, DateTime date, string contractNo) : base(Id)
+ {
+ LU = lu;
+ Price = price;
+ BeginTime = beginDate;
+ EndTime = endDate;
+ ClientCode = clientCode;
+ Date = date;
+ ContractNo = contractNo;
+ }
+
public void Set(DateTime beginDate, DateTime endDate, decimal price, string materialCode, int type, string customerCode)
{
BeginTime = beginDate;
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
index af23c6ea..e6dff4a7 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListManager.cs
@@ -1,4 +1,4 @@
-using EFCore.BulkExtensions;
+using EFCore.BulkExtensions;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -85,9 +85,9 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var update = from itm1 in entities
join itm2 in pricelist
- on new { itm1.Type, itm1.MaterialCode,itm1.CustomerCode } equals new { itm2.Type, itm2.MaterialCode, itm2.CustomerCode }
+ on new { itm1.ClientCode, itm1.LU, itm1.BeginTime, itm1.EndTime } equals new { itm2.ClientCode, itm2.LU, itm2.BeginTime, itm2.EndTime }
where itm1.Price != itm2.Price
- select new PriceList(itm2.Id, itm2.BeginTime, itm2.EndTime, itm1.Price, itm2.MaterialCode, itm2.Type, itm2.ParentId, itm2.Version, itm1.CustomerCode);
+ select new PriceList(itm2.Id, itm2.LU, itm1.Price, itm2.BeginTime, itm2.EndTime, itm2.ClientCode, itm2.Date, itm2.ContractNo);
if (update.Count() > 0)
{
@@ -99,8 +99,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
{
var add = from itm1 in entities
join itm2 in pricelist
- on new { itm1.Type, itm1.MaterialCode }
- equals new { itm2.Type, itm2.MaterialCode }
+ on new { itm1.ClientCode, itm1.LU, itm1.BeginTime, itm1.EndTime }
+ equals new { itm2.ClientCode, itm2.LU, itm2.BeginTime, itm2.EndTime }
into temp
from itm3 in temp.DefaultIfEmpty()
where itm3 == null
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs
index 80143dd5..d062be09 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs
@@ -1,4 +1,4 @@
-using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations;
namespace Win.Sfs.SettleAccount
{
@@ -8,31 +8,31 @@ namespace Win.Sfs.SettleAccount
public enum EnumBusinessType
{
///
- ///未定义
+ /// 未定义
///
[Display(Name = "未定义")]
None = 0,
///
- ///直供件
+ /// 直供件
///
[Display(Name = "直供件")]
ZhiGongJian = 1,
///
- ///买单件
+ /// 买单件
///
[Display(Name = "买单件")]
MaiDanJian = 2,
///
- ///备件
+ /// 备件
///
[Display(Name = "备件")]
BeiJian = 3,
///
- ///印度件
+ /// 印度件
///
[Display(Name = "印度件")]
YingDuJian = 4,
@@ -44,12 +44,9 @@ namespace Win.Sfs.SettleAccount
HBPO = 5,
///
- ///印度件
+ /// 印度件
///
[Display(Name = "BBAC-JIS")]
BBAC = 6
-
-
-
}
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719022720_20230719-2.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719022720_20230719-2.Designer.cs
new file mode 100644
index 00000000..015df829
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719022720_20230719-2.Designer.cs
@@ -0,0 +1,4038 @@
+//
+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("20230719022720_20230719-2")]
+ partial class _202307192
+ {
+ 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.8")
+ .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("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("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("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("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ 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("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("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("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("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ 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("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("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_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("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("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ 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("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("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("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ 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("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("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("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("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("ShippingDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ 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("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("int");
+
+ 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("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("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("ShippingDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.Property("WmsBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SE_REPORT");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_SA_REPORT", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ 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("CustomerOfflineTime")
+ .HasColumnType("datetime2");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("EDIQty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("FixPrice")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("InjectionCode")
+ .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("MateType")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("MaterialDes")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("MaterialNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PJISSeqNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SEQty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("SeqNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ShippingDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.Property("WMSQty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("WmsBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SE_SA_REPORT");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_CAN_SA", 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")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_HBPO_CAN_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_CAN_SA_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("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property