wanggang 1 year ago
parent
commit
0ac592a5db
  1. 2
      code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json
  2. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs
  3. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs
  4. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs
  5. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs
  6. 51
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
  7. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs
  8. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs
  9. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs
  10. 29
      code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_CAN_SA_SERVICE.cs
  11. 121
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs
  12. 107
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs
  13. 37
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs
  14. 103
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  15. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs
  16. 82
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs
  17. 167
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs
  18. 12
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  19. 13
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs
  20. 3980
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230713031306_20230713-1.Designer.cs
  21. 206
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230713031306_20230713-1.cs
  22. 118
      code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs

2
code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json

@ -3,7 +3,7 @@
"CorsOrigins": "https://*.abc.com,http://localhost:9527,http://149.223.116.5:8088"
},
"ConnectionStrings": {
"Default": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True",
"Default": "Server=dev.ccwin-in.com,13319;Database=BJABP;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True",
"SettleAccountService": "Server=dev.ccwin-in.com,13319;Database=BQ_SA;User ID=ccwin-in;Password=Microsoft@2022;Trusted_Connection=False;TrustServerCertificate=True;"
},

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs

@ -1,13 +1,14 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// BBAC发运
/// </summary>
public class BBAC_SE_DETAIL_DTO
public class BBAC_SE_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs

@ -1,13 +1,14 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// BBAC的EDI数据
/// </summary>
public class BBAC_SE_EDI_DTO
public class BBAC_SE_EDI_DTO : EntityDto<Guid>
{
/// <summary>
/// LU+生产码

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs

@ -5,13 +5,14 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// HBPO发运单
/// </summary>
public class HBPO_SE_DETAIL_DTO
public class HBPO_SE_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs

@ -1,13 +1,14 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// HBPO的EDI数据
/// </summary>
public class HBPO_SE_EDI_DTO
public class HBPO_SE_EDI_DTO : EntityDto<Guid>
{
/// <summary>
/// LU+生产码

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

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// PUB结算
/// </summary>
public class PUB_SA_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间
/// </summary>
[Display(Name = "期间")]
public int Version { get; set; }
/// <summary>
/// 结算单据
/// </summary>
[Display(Name = "结算单据")]
public string BillNum { get; set; }
/// <summary>
/// 状态
/// </summary>
[Display(Name = "状态")]
public string State { get; set; }
}
/// <summary>
/// 导入
/// </summary>
public class PUB_SA_IMPORT_DTO
{
}
/// <summary>
/// 导出
/// </summary>
public class PUB_SA_EXPORT_DTO
{
}
}

3
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs

@ -5,13 +5,14 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// PUB发运数据
/// </summary>
public class PUB_SE_DETAIL_DTO
public class PUB_SE_DETAIL_DTO : EntityDto<Guid>
{
/// <summary>
/// 期间

4
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs

@ -1,5 +1,7 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
using Win.Sfs.Shared.DtoBase;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
@ -7,7 +9,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
/// <summary>
/// 采购价格单
/// </summary>
public class PURCHASE_PRICE_DTO
public class PURCHASE_PRICE_DTO : EntityDto<Guid>
{
/// <summary>
/// 零件号

4
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs

@ -1,12 +1,14 @@
using Magicodes.ExporterAndImporter.Core;
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
{
/// <summary>
/// 客户替换件关系
/// </summary>
public class TB_RePartsRelationship_DTO
public class TB_RePartsRelationship_DTO : EntityDto<Guid>
{
/// <summary>
/// 零件号

29
code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_CAN_SA_SERVICE.cs

@ -1,13 +1,40 @@
using System;
using SettleAccount.Bases;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Win.Sfs.SettleAccount.Bases;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
public interface ICAN_SA_SERVICE<TEntity, TEntityDto, TEntityDetailDto, TRequestMainInput, TRequestDetailInput, TExportDto>
where TEntity : SA_CAN_BASE
where TEntityDto : class, IEntityDto<Guid>, new()
where TEntityDetailDto : class, IEntityDto<Guid>, new()
where TRequestMainInput : PagedAndSortedResultRequestDto
where TRequestDetailInput : PagedAndSortedResultRequestDto
{
Task<bool> GenerateInvoice(TRequestMainInput input);
Task<PagedResultDto<TEntityDto>> MainQueryAsync(TRequestMainInput input);
Task<PagedResultDto<TEntityDetailDto>> DetailQueryAsync(TRequestDetailInput input);
Task<string> ExportAsync(TRequestMainInput input);
// List<ErrorData> ISettlementOrderCheckRule<TEntity>(List<TEntity> p_list, Configuation config) where TEntity : ISABASE
//bList<ErrorData> ISettlementOrderCheckState<TEntity>(List<TEntity> p_list) where TEntity:ISABASE
}
public interface IHBPO_CAN_SA_SERVICE
{
Task<bool> GenerateInvoice(HBPO_CAN_SA_REQ_DTO input);

121
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs

@ -0,0 +1,121 @@
using AutoMapper;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Bases;
using Shouldly;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Volo.Abp.ObjectMapping;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Entities.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Bases
{
public class CAN_SA_SERVICE<TEntity, TEntityDto, TEntityDetail, TEntityDetailDto, TRequestMainInput, TRequestDetailInput, TEntityDetailExportDto> :ApplicationService
where TEntity : class, IEntity<Guid>
where TEntityDetail:SA_CAN_BASE
where TEntityDto : class, IEntityDto<Guid>, new()
where TEntityDetailDto : class, IEntityDto<Guid>, new()
where TRequestMainInput : RequestInputBase
where TRequestDetailInput : RequestInputBase
where TEntityDetailExportDto : class, new()
{
private readonly INormalEfCoreRepository<TEntity, Guid> _repository;
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected CAN_SA_SERVICE(
INormalEfCoreRepository<TEntity, Guid> repository,
IExcelImportAppService excelImportService,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_excelImportService = excelImportService;
_repository = repository;
_detailRepository = detailRepository;
}
[HttpPost]
//[Route("detailquery")]
public virtual async Task<PagedResultDto<TEntityDetailDto>> DetailQueryAsync(TRequestDetailInput input)
{
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailDto>>(entitys);
return new PagedResultDto<TEntityDetailDto>(totalCount, dtos);
}
[HttpPost]
//[Route("export")]
public virtual async Task<string> ExportAsync(TRequestDetailInput input)
{
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailExportDto>>(entities);
var classDisplayName = typeof(TEntityDetailExportDto).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(TEntityDetailExportDto).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null;
switch (input.FileType)
{
case 0:
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
[HttpPost]
//[Route("generateinvoice")]
public Task<bool> GenerateInvoice(TRequestMainInput input)
{
throw new NotImplementedException();
}
[HttpPost]
//[Route("mainquery")]
public virtual async Task<PagedResultDto<TEntityDto>> MainQueryAsync(TRequestMainInput input)
{
var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var totalCount = await _repository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<TEntity>, List<TEntityDto>>(entitys);
return new PagedResultDto<TEntityDto>(totalCount, dtos);
}
}
}

107
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs

@ -0,0 +1,107 @@
using AutoMapper;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Csv;
using Magicodes.ExporterAndImporter.Excel;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Bases;
using Shouldly;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Entities;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Bases
{
internal class NOT_SA_SERVICE<TEntityDetail, TEntityDetailDto, TRequestDetailInput, TEntityDetailExportDto> : ApplicationService
where TEntityDetail : SA_CAN_BASE
where TEntityDetailDto : class, IEntityDto<Guid>, new()
where TRequestDetailInput : RequestInputBase
where TEntityDetailExportDto : class, new()
{
private readonly INormalEfCoreRepository<TEntityDetail, Guid> _detailRepository;
private readonly IExcelImportAppService _excelImportService;
protected NOT_SA_SERVICE(
IExcelImportAppService excelImportService,
INormalEfCoreRepository<TEntityDetail, Guid> detailRepository
)
{
_excelImportService = excelImportService;
_detailRepository = detailRepository;
}
[HttpPost]
//[Route("detailquery")]
public virtual async Task<PagedResultDto<TEntityDetailDto>> DetailQueryAsync(TRequestDetailInput input)
{
var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount);
var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters);
var dtos = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailDto>>(entitys);
return new PagedResultDto<TEntityDetailDto>(totalCount, dtos);
}
[HttpPost]
//[Route("export")]
public virtual async Task<string> ExportAsync(TRequestDetailInput input)
{
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true);
var dtoDetails = ObjectMapper.Map<List<TEntityDetail>, List<TEntityDetailExportDto>>(entities);
var classDisplayName = typeof(TEntityDetailExportDto).GetCustomAttribute<DisplayAttribute>()?.Name ?? typeof(TEntityDetailExportDto).Name;
string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx";
byte[] result = null;
switch (input.FileType)
{
case 0:
result = await _csv.ExportAsByteArray(dtoDetails);
break;
case 1:
result = await _excel.ExportAsByteArray(dtoDetails);
break;
}
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
Name = _fileName,
Content = result
}
);
return _fileName;
}
}
}

37
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/OrderNumberGenerator.cs

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Win.Sfs.SettleAccount.Bases
{
public class OrderNumberGenerator
{
private static readonly object lockObject = new object();
private static int sequence = 0;
/// <summary>
/// 如无类别
/// </summary>
/// <param name="p_OrderType"></param>
/// <returns></returns>
public static string GenerateOrderNumber(string p_OrderType)
{
lock (lockObject)
{
// 获取当前时间和日期部分
string currentDate = DateTime.Now.ToString("yyMMddHHmmss");
// 获取序列号部分
string sequenceNumber = Interlocked.Increment(ref sequence).ToString().PadLeft(6, '0');
// 拼接单号
string orderNumber = $"{p_OrderType}-{currentDate}-{sequenceNumber}";
return orderNumber;
}
}
}
}

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

@ -0,0 +1,103 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SettleAccount.Domain.BQ;
using Shouldly;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ
{
/// <summary>
/// PUB结算
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class PUB_SA_SERVICE : SettleAccountApplicationBase<TB_RePartsRelationship>
{
/// <summary>
/// PUB结算仓储
/// </summary>
private readonly INormalEfCoreRepository<PUB_SA, Guid> _repository;
/// <summary>
/// 构造
/// </summary>
public PUB_SA_SERVICE(INormalEfCoreRepository<PUB_SA, Guid> repository,
IDistributedCache<TB_RePartsRelationship> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
_repository = repository;
}
#region 导入、导出
/// <summary>
/// 导入
/// </summary>
[HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<PUB_SA_IMPORT_DTO>(files, _excelImportService);
var _ls = ObjectMapper.Map<List<PUB_SA_IMPORT_DTO>, List<PUB_SA>>(result);
await _repository.InsertManyAsync(_ls);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 导出
/// </summary>
[HttpPost]
public async Task<string> 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<PUB_SA>, List<PUB_SA_EXPORT_DTO>>(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
/// <summary>
/// 获取列表
/// </summary>
[HttpPost]
public async Task<PagedResultDto<PUB_SA_DTO>> 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<PUB_SA>, List<PUB_SA_DTO>>(entities);
return new PagedResultDto<PUB_SA_DTO>(totalCount, dtos);
}
/// <summary>
/// 删除
/// </summary>
[HttpPost]
public async Task DeleteAsync(Guid id)
{
await _repository.DeleteAsync(id);
}
#endregion
}
}

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

@ -24,7 +24,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
/// 采购价格单
/// </summary>
[AllowAnonymous]
[Route("api/settleaccount/PURCHASE_PRICE_LIST_Service")]
[Route("api/settleaccount/[controller]/[action]")]
public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase<PURCHASE_PRICE>
{
/// <summary>

82
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Shouldly;
using System;
@ -27,12 +27,12 @@ namespace Win.Sfs.SettleAccount.Boms
public class BomAppService : SettleAccountApplicationBase<Bom>
{
/// <summary>
/// BOM仓储
/// BOM�ִ�
/// </summary>
private readonly INormalEfCoreRepository<Bom, Guid> _repository;
/// <summary>
/// 构造
/// ����
/// </summary>
public BomAppService(
INormalEfCoreRepository<Bom, Guid> repository,
@ -45,9 +45,9 @@ namespace Win.Sfs.SettleAccount.Boms
_repository = repository;
}
#region 导出
#region ����
/// <summary>
/// 导出
/// ����
/// </summary>
[HttpPost]
public virtual async Task<string> ExportAsync(BomRequestDto input)
@ -57,14 +57,14 @@ namespace Win.Sfs.SettleAccount.Boms
0, true);
var dtoDetails = ObjectMapper.Map<List<Bom>, List<BomExportDto> >(entities);
//声明导出容器
//������������
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.ExcelExporter(dtoDetails);
result.ShouldNotBeNull();
//保存导出文件到服务器存成二进制
//���浼���ļ�����������ɶ�����
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
@ -78,7 +78,7 @@ namespace Win.Sfs.SettleAccount.Boms
#region CURD
/// <summary>
/// 获取列表
/// ��ȡ�б�
/// </summary>
[HttpPost]
public async Task<PagedResultDto<BomDto>> GetListAsync(BomRequestDto input)
@ -90,13 +90,13 @@ namespace Win.Sfs.SettleAccount.Boms
}
#endregion
#region 原方法(废弃)
// #region 导入导出功能
#region ԭ������������
// #region ���뵼������
// /// <summary>
// /// 导入功能
// /// ���빦��
// /// </summary>
// /// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
// /// <param name="files">�ϴ����ļ�(ǰ���Ѿ�����ֻ���ϴ�һ������)</param>
// /// <returns></returns>
// [HttpPost]
// [Route("ExcelImport-Map")]
@ -121,7 +121,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// if (itm.Count > 1)
// {
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("���ܵ��븸����{0},�ӱ���{1}���ظ�����", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
// }
// }
// var _id = GuidGenerator.Create();
@ -131,7 +131,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
// {
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty));
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("���������ݲ��������Ϻ�{0}��", itm.ParentItemCode), string.Empty));
// continue;
// }
// itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id, factory);
@ -150,9 +150,9 @@ namespace Win.Sfs.SettleAccount.Boms
// /// <summary>
// /// 导入功能
// /// ���빦��
// /// </summary>
// /// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
// /// <param name="files">�ϴ����ļ�(ǰ���Ѿ�����ֻ���ϴ�һ������)</param>
// /// <returns></returns>
// [HttpPost]
// [Route("ExcelImport")]
@ -176,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// if (itm.Count > 1)
// {
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("���ܵ��븸����{0},�ӱ���{1}���ظ�����", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
// }
// }
// var _id = GuidGenerator.Create();
@ -186,7 +186,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
// {
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty));
// checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("���������ݲ��������Ϻ�{0}��", itm.ParentItemCode), string.Empty));
// continue;
// }
// itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,_id,factory);
@ -201,7 +201,7 @@ namespace Win.Sfs.SettleAccount.Boms
// return ApplicationConsts.SuccessStr;
// }
// /// <summary>
// /// 导出文件
// /// �����ļ�
// /// </summary>
// /// <param name="input"></param>
// /// <returns></returns>
@ -212,7 +212,7 @@ namespace Win.Sfs.SettleAccount.Boms
// {
// IExporter _csv = new CsvExporter();
// IExporter _excel = new ExcelExporter();
// //导出加上版本过滤条件,不能全导出
// //�������ϰ汾��������������ȫ����
// if (input.ParentId != Guid.Empty)
// {
// input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() });
@ -225,23 +225,23 @@ namespace Win.Sfs.SettleAccount.Boms
// 0, true);
// var dtoDetails = ObjectMapper.Map<List<Bom>, List<BomExportDto>>(entities);
// string _fileName = string.Empty;
// //声明导出容器
// //������������
// byte[] result = null;
// switch (input.FileType)
// {
// case 0:
// _fileName = string.Format("产品结构_{0}.csv", input.UserId.ToString());
// _fileName = string.Format("��Ʒ�ṹ_{0}.csv", input.UserId.ToString());
// result = await _csv.ExportAsByteArray(dtoDetails);
// break;
// case 1:
// _fileName = string.Format("产品结构_{0}.xlsx", input.UserId.ToString());
// _fileName = string.Format("��Ʒ�ṹ_{0}.xlsx", input.UserId.ToString());
// result = await _excel.ExportAsByteArray(dtoDetails);
// break;
// }
// result.ShouldNotBeNull();
// //保存导出文件到服务器存成二进制
// //���浼���ļ�����������ɶ�����
// await _excelImportService.SaveBlobAsync(
// new SaveExcelImportInputDto
// {
@ -254,13 +254,13 @@ namespace Win.Sfs.SettleAccount.Boms
// #endregion
// /// <summary>
// /// 按ID获取唯一实体
// /// ��ID��ȡΨһʵ��
// /// </summary>
// /// <remarks>
// /// 返回实体全部属性
// /// ����ʵ��ȫ������
// /// </remarks>
// /// <param name="id">ID</param>
// /// <returns>实体DTO</returns>
// /// <returns>ʵ��DTO</returns>
// [HttpGet]
// [Route("{id}")]
//[Authorize(SettleAccountPermissions.Boms.Default)]
@ -291,9 +291,9 @@ namespace Win.Sfs.SettleAccount.Boms
// }
// /// <summary>
// /// 获取实体总数
// /// ��ȡʵ������
// /// </summary>
// /// <returns>实体总数</returns>
// /// <returns>ʵ������</returns>
// [HttpGet]
// [Route("count")]
//[Authorize(SettleAccountPermissions.Boms.Default)]
@ -305,10 +305,10 @@ namespace Win.Sfs.SettleAccount.Boms
// /// <summary>
// /// 删除实体
// /// ɾ��ʵ��
// /// </summary>
// /// <param name="id">ID</param>
// /// <returns></returns>
// /// <returns>��</returns>
// [HttpDelete]
// [Route("{id}")]
//[Authorize(SettleAccountPermissions.Boms.Delete)]
@ -320,10 +320,10 @@ namespace Win.Sfs.SettleAccount.Boms
// }
// /// <summary>
// /// 按IDs删除实体列表
// /// ��IDsɾ��ʵ���б�
// /// </summary>
// /// <param name="ids">IDs</param>
// /// <returns>是否执行成功</returns>
// /// <returns>�Ƿ�ִ�гɹ�</returns>
// [HttpPost]
// [Route("delete")]
//[Authorize(SettleAccountPermissions.Boms.Delete)]
@ -342,13 +342,13 @@ namespace Win.Sfs.SettleAccount.Boms
// ///// <summary>
// /// <summary>
// /// 根据筛选条件获取实体列表
// /// ����ɸѡ������ȡʵ���б�
// /// </summary>
// /// <remarks>
// /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
// /// ������������:ɸѡ�����б�,��������,��������,ҳ��
// /// </remarks>
// /// <param name="input">请求条件</param>
// /// <returns>实体DTO列表</returns>
// /// <param name="input">��������</param>
// /// <returns>ʵ��DTO�б�</returns>
// [HttpPost]
// [Route("list")]
// [Authorize(SettleAccountPermissions.Boms.Default)]
@ -372,13 +372,13 @@ namespace Win.Sfs.SettleAccount.Boms
// ///// <summary>
// /// <summary>
// /// 根据筛选条件获取实体列表
// /// ����ɸѡ������ȡʵ���б�
// /// </summary>
// /// <remarks>
// /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
// /// ������������:ɸѡ�����б�,��������,��������,ҳ��
// /// </remarks>
// /// <param name="input">请求条件</param>
// /// <returns>实体DTO列表</returns>
// /// <param name="input">��������</param>
// /// <returns>ʵ��DTO�б�</returns>
// [HttpPost]
// [Route("listVersion")]
// [Authorize(SettleAccountPermissions.Boms.Default)]

167
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs

@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Distributed;
using SettleAccount.Domain.BQ;
using Shouldly;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
@ -21,10 +22,12 @@ using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
using Win.Sfs.SettleAccount.CommonManagers;
using Win.Sfs.SettleAccount.Constant;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
using Win.Sfs.SettleAccount.Entities.CodeSettings;
using Win.Sfs.SettleAccount.Entities.ImportMap;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.Shared.CacheBase;
using Win.Sfs.Shared.RepositoryBase;
using Win.Utils;
namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
@ -33,83 +36,36 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// <summary>
/// 通用代码-相关应用服务
/// </summary>
[Authorize(SettleAccountPermissions.CodeSettings.Default)]
[AllowAnonymous]
[Route("api/settleaccount/[controller]/[action]")]
public class CodeSettingAppService : SettleAccountApplicationBase<CodeSetting>, ICodeSettingAppService
public class CodeSettingAppService : SettleAccountApplicationBase<CodeSetting>
{
private readonly ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> _mapRepository;
//private readonly ISettleAccountBranchEfCoreRepository<CodeSetting, Guid> _repository;
private readonly INormalEfCoreRepository<CodeSetting, Guid> _repository;
private readonly IExcelImportAppService _excelImportService;
private readonly ISettleAccountBranchEfCoreRepository<CodeSetting, Guid> _repository;
/// <summary>
/// 构建方法
/// </summary>
/// <param name="guidGenerator">构建UID</param>
/// <param name="objectMapper">自动map</param>
/// <param name="repository">仓储接口</param>
/// <param name="cache">缓存</param>
public CodeSettingAppService(IGuidGenerator guidGenerator,
IObjectMapper objectMapper,
ISettleAccountBranchEfCoreRepository<CodeSetting, Guid> repository,
ISettleAccountBranchEfCoreRepository<ImportColumnMap, Guid> mapRepository,
INormalEfCoreRepository<CodeSetting, Guid> repository,
IDistributedCache<CodeSetting> cache,
IExcelImportAppService excelImportService,
ISnowflakeIdGenerator snowflakeIdGenerator,
ICommonManager commonManager
) : base(cache,excelImportService,snowflakeIdGenerator,commonManager)
{
_mapRepository = mapRepository;
_repository = repository;
_excelImportService = excelImportService;
}
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[DisableRequestSizeLimit]
public async Task<string> CodeSettingUploadExcelImportMap([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
var _mapList= _mapRepository.Where(p => p.ProjectName == SettleAccountModuleName.CodeSetting).ToList();
var result = await _exportImporter.ExtendExcelImport<CodeSettingImportDto>(files, _excelImportService,_mapList);
var _ls = ObjectMapper.Map<List<CodeSettingImportDto>, List<CodeSetting>>(result);
foreach (var itm in _ls)
{
var _first = _repository.FirstOrDefault(p => p.Project == itm.Project && p.Value == itm.Value);
if (_first != null)
{
_first.Update(_first.Project, _first.Value, itm.Description);
await _repository.UpdateAsync(_first);
}
else
{
itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
await _repository.InsertAsync(itm);
}
}
var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 };
//_repository.GetDbContext().BulkInsert(_ls, bulkConfig);
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 导入功能
/// </summary>
/// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
/// <returns></returns>
[HttpPost]
[DisableRequestSizeLimit]
public async Task<string> CodeSettingUploadExcelImport([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<CodeSettingImportDto>(files, _excelImportService);
var _ls = ObjectMapper.Map<List<CodeSettingImportDto>, List<CodeSetting>>(result);
@ -133,16 +89,9 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
return ApplicationConsts.SuccessStr;
}
/// <summary>
/// 按ID获取唯一实体
/// </summary>
/// <remarks>
/// 返回实体全部属性
/// </remarks>
/// <param name="id">ID</param>
/// <returns>实体DTO</returns>
[HttpPost]
virtual public async Task<CodeSettingDto> GetAsync(Guid id)
{
@ -155,106 +104,21 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
private async Task<CodeSetting> GetFromCacheAsync(Guid id)
{
var result = await _repository.GetAsync(id);
return result;
}
private async Task<long> GetCountAsync(CodeSettingRequestDto input)
{
return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
}
///// <summary>
/// <summary>
/// 根据筛选条件获取实体列表
/// 获取列表
/// </summary>
/// <remarks>
/// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
/// </remarks>
/// <param name="input">请求条件</param>
/// <returns>实体DTO列表</returns>
[HttpPost]
virtual public async Task<PagedResultDto<CodeSettingDto>> GetListAsync(CodeSettingRequestDto input)
public async Task<PagedResultDto<CodeSettingDto>> GetListAsync(RequestDto input)
{
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
input.SkipCount, true);
var totalCount = await GetCountAsync(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<CodeSetting>, List<CodeSettingDto>>(entities);
dtos=dtos.OrderBy(p => p.Value).ToList();
return new PagedResultDto<CodeSettingDto>(totalCount, dtos);
}
/// <summary>
/// 获取实体总数
/// </summary>
/// <returns>实体总数</returns>
[HttpPost]
virtual public async Task<long> GetTotalCountAsync(Guid branchId)
{
return await _repository.GetCountAsync(branchId);
}
/// <summary>
/// 获取全部实体列表
/// </summary>
/// <returns>实体DTO列表</returns>
[HttpPost]
virtual public async Task<ListResultDto<CodeSettingDto>> GetAllAsync(Guid branchId)
{
var entities = await _repository.GetAllAsync(branchId, true);
var dtos = ObjectMapper.Map<List<CodeSetting>, List<CodeSettingDto>>(entities);
return new ListResultDto<CodeSettingDto>(dtos);
}
///// <summary>
///// 导入功能
///// </summary>
///// <param name="files">上传的文件(前端已经限制只能上传一个附件)</param>
///// <returns></returns>
//[HttpPost]
//[Route("UomExcelImport")]
////[AllowAnonymous]
//public async Task<List<CodeSettingImportDto>> UploadExcelImport([FromForm] IFormFileCollection files)
//{
// ExportImporter _exportImporter = new ExportImporter();
// var result = await _exportImporter.UploadExcelImport<CodeSettingImportDto>(files);
// return result;
//}
/// <summary>
/// 批量导入实体列表
/// </summary>
/// <remarks>
/// 以ID为依据,数据库中找不到ID的实体会新增,已有ID的实体会修改
/// </remarks>
/// <param name="entities">实体列表</param>
/// <returns>是否导入成功</returns>
//[HttpPost]
//[Route("import")]
//[Authorize(SettleAccountPermissions.CodeSettings.Create)]
//virtual public async Task<bool> ImportAsync(List<CodeSettingCreateDto> dtos)
//{
// var entities =ObjectMapper.Map<List<CodeSettingCreateDto>, List<CodeSetting>>(dtos);
// var result = await _repository.ImportAsync(entities);
// return result;
//}
/// <summary>
/// 新增实体
/// </summary>
@ -298,7 +162,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
virtual public async Task<string> ExportAsync(CodeSettingRequestDto input)
{
string _fileName = string.Format("通用代码设置_{0}.xlsx",DateTime.Now.ToString("yyyyMMdd"));
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue,
0, true);
var dtoDetails = ObjectMapper.Map<List<CodeSetting>, List<CodeSettingExportDto>>(entities);
@ -367,8 +231,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
[HttpPost]
virtual public async Task<bool> DeleteListAsync(List<Guid> ids)
{
var _query = _repository.Where(p => ids.Contains(p.Id));
int i= await _query.BatchDeleteAsync();
@ -377,7 +239,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
return false;
}
return true;
}

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

@ -136,11 +136,15 @@ namespace Win.Sfs.SettleAccount
CreateMapPURCHASE_PRICE();
CreateMapTB_RePartsRelationship();
CreateMapBBAC_SE_DETAIL();
CreateMapBBAC_SE_EDI();
CreateMapHBPO_SE_DETAIL();
CreateMapHBPO_SE_EDI();
CreateMapPUB_SE_DETAIL();
CreateMapPUB_SA();
}
#region BQ
@ -809,5 +813,13 @@ namespace Win.Sfs.SettleAccount
CreateMap<PUB_SE_DETAIL, PUB_SE_DETAIL_EXPORT_DTO>();
}
/// <summary>
/// PUB结算
/// </summary>
private void CreateMapPUB_SA()
{
CreateMap<PUB_SA, PUB_SA_DTO>();
}
}
}

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

@ -65,6 +65,7 @@ namespace Win.Sfs.SettleAccount
);
#region 基础数据
builder.ConfigureCodeSetting(options);
//价格
builder.ConfigurePriceListVersion(options);
builder.ConfigurePriceList(options);
@ -295,6 +296,18 @@ namespace Win.Sfs.SettleAccount
});
}
/// <summary>
/// 通用代码
/// </summary>
private static void ConfigureCodeSetting(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{
builder.Entity<CodeSetting>(b =>
{
b.ToTable($"{options.TablePrefix}_CodeSetting", options.Schema);
b.ConfigureByConvention();
});
}
private static void ConfigurePriceList(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options)
{

3980
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230713031306_20230713-1.Designer.cs

File diff suppressed because it is too large

206
code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230713031306_20230713-1.cs

@ -0,0 +1,206 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Win.Sfs.SettleAccount.Migrations
{
public partial class _202307131 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "State",
table: "Set_INVOICE_GRP",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "Extend1",
table: "Set_HBPO_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend2",
table: "Set_HBPO_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend3",
table: "Set_HBPO_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend4",
table: "Set_HBPO_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Site",
table: "Set_HBPO_SE_EDI",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AlterColumn<int>(
name: "State",
table: "Set_HBPO_CAN_SA",
type: "int",
maxLength: 50,
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend1",
table: "Set_BBAC_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend2",
table: "Set_BBAC_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend3",
table: "Set_BBAC_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Extend4",
table: "Set_BBAC_SE_EDI",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Site",
table: "Set_BBAC_SE_EDI",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AlterColumn<int>(
name: "State",
table: "Set_BBAC_CAN_SA",
type: "int",
maxLength: 50,
nullable: false,
defaultValue: 0,
oldClrType: typeof(string),
oldType: "nvarchar(50)",
oldMaxLength: 50,
oldNullable: true);
migrationBuilder.CreateTable(
name: "Set_CodeSetting",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Project = table.Column<string>(type: "nvarchar(max)", nullable: true),
Value = table.Column<string>(type: "nvarchar(max)", nullable: true),
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true),
BranchId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Enabled = table.Column<bool>(type: "bit", nullable: false),
Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Set_CodeSetting", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Set_CodeSetting");
migrationBuilder.DropColumn(
name: "State",
table: "Set_INVOICE_GRP");
migrationBuilder.DropColumn(
name: "Extend1",
table: "Set_HBPO_SE_EDI");
migrationBuilder.DropColumn(
name: "Extend2",
table: "Set_HBPO_SE_EDI");
migrationBuilder.DropColumn(
name: "Extend3",
table: "Set_HBPO_SE_EDI");
migrationBuilder.DropColumn(
name: "Extend4",
table: "Set_HBPO_SE_EDI");
migrationBuilder.DropColumn(
name: "Site",
table: "Set_HBPO_SE_EDI");
migrationBuilder.DropColumn(
name: "Extend1",
table: "Set_BBAC_SE_EDI");
migrationBuilder.DropColumn(
name: "Extend2",
table: "Set_BBAC_SE_EDI");
migrationBuilder.DropColumn(
name: "Extend3",
table: "Set_BBAC_SE_EDI");
migrationBuilder.DropColumn(
name: "Extend4",
table: "Set_BBAC_SE_EDI");
migrationBuilder.DropColumn(
name: "Site",
table: "Set_BBAC_SE_EDI");
migrationBuilder.AlterColumn<string>(
name: "State",
table: "Set_HBPO_CAN_SA",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50);
migrationBuilder.AlterColumn<string>(
name: "State",
table: "Set_BBAC_CAN_SA",
type: "nvarchar(50)",
maxLength: 50,
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldMaxLength: 50);
}
}
}

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

@ -79,9 +79,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("State")
b.Property<int>("State")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("int");
b.Property<int>("Version")
.HasColumnType("int");
@ -679,6 +679,22 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Extend1")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Extend2")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Extend3")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Extend4")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -720,6 +736,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Site")
.HasColumnType("nvarchar(max)");
b.Property<int>("Version")
.HasColumnType("int");
@ -1000,9 +1019,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("State")
b.Property<int>("State")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
.HasColumnType("int");
b.Property<int>("Version")
.HasColumnType("int");
@ -1584,6 +1603,22 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Extend1")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Extend2")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Extend3")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Extend4")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
@ -1625,6 +1660,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Site")
.HasColumnType("nvarchar(max)");
b.Property<int>("Version")
.HasColumnType("int");
@ -1919,6 +1957,9 @@ namespace Win.Sfs.SettleAccount.Migrations
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<int>("State")
.HasColumnType("int");
b.Property<decimal>("TaxAmt")
.HasColumnType("decimal(18,2)");
@ -3267,6 +3308,75 @@ namespace Win.Sfs.SettleAccount.Migrations
b.ToTable("Set_bom_version");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.CodeSettings.CodeSetting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<Guid>("BranchId")
.HasColumnType("uniqueidentifier");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("Description")
.HasColumnType("nvarchar(max)");
b.Property<bool>("Enabled")
.HasColumnType("bit");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Project")
.HasColumnType("nvarchar(max)");
b.Property<string>("Remark")
.HasColumnType("nvarchar(max)");
b.Property<string>("Value")
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Set_CodeSetting");
});
modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Controls.CentralizedControl", b =>
{
b.Property<Guid>("Id")

Loading…
Cancel
Save