From 88827229c6fbcc1131f91c212e4012db62bd9c24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 27 Jul 2023 16:53:10 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=9F=BA=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs | 145 + .../Entities/BQ/IINVOICE_SERVICE.cs | 9 +- .../Bases/BASE_SERVICE.cs | 2 +- .../Bases/BA_SERVICE.cs | 153 +- .../Bases/CAN_SA_SERVICE.cs | 21 +- .../Bases/NOT_SA_SERVICE.cs | 15 +- .../Bases/PD_SERVICE.cs | 16 +- .../Entities/BQ/BBAC_BA_SERVICE.cs | 498 +- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 127 +- .../Entities/BQ/BBAC_NOT_SA_SERVICE.cs | 15 +- .../Entities/BQ/BBAC_PD_SERVICE.cs | 4 +- .../Entities/BQ/HBPO_BA_SERVICE.cs | 4 +- .../Entities/BQ/HBPO_CAN_SA_SERVICE.cs | 36 +- .../Entities/BQ/HBPO_NOT_SA_SERVICE.cs | 11 +- .../Entities/BQ/HBPO_PD_SERVICE.cs | 4 +- .../Entities/BQ/PUB_BA_SERVICE.cs | 4 +- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 29 +- .../Entities/BQ/PUB_NOT_SA_SERVICE.cs | 13 +- .../Entities/BQ/PUB_PD_SERVICE.cs | 4 +- .../Entities/BQ/BBAC_ADJ_DETAIL.cs | 125 - .../Entities/BQ/BBAC_CAN_SA.cs | 4 +- .../Entities/BQ/INVOICE_GRP.cs | 70 +- .../Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs | 10 + .../Entities/BQ/Managers/INV_MNG.cs | 45 +- ...AccountDbContextModelCreatingExtensions.cs | 36 +- .../20230727085151_202307270004.Designer.cs | 4874 +++++++++++++++++ .../Migrations/20230727085151_202307270004.cs | 93 + .../SettleAccountDbContextModelSnapshot.cs | 106 +- 28 files changed, 5998 insertions(+), 475 deletions(-) create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs delete mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_ADJ_DETAIL.cs create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.Designer.cs create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.cs diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs new file mode 100644 index 00000000..10a71d46 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs @@ -0,0 +1,145 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Volo.Abp.Application.Dtos; +using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Filter; + +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; + public class PUB_ADJ_DETAIL_DTO : EntityDto + { + + /// + ///工厂地点 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } + /// + ///扩展1 + /// + [Display(Name = "扩展1")] + public string Extend1 { get; set; } + /// + ///作废发票号 + /// + [Display(Name = "作废发票号")] + public string OldInvBillNum { get; set; } + /// + ///发票号 + /// + [Display(Name = "发票号")] + public string InvBillNum { get; set; } + public decimal Price { get; set; } + public int Version { get; set; } + public string SettleBillNum { get; set; } + public DateTime SettleDate { get; set; } + public string InvGroupNum { get; set; } + public string LU { get; set; } + public string PN { get; set; } + public string KeyCode { get; set; } + public decimal Qty { get; set; } + public string GroupNum { get; set; } + + } + public class PUB_ADJ_DETAIL_EXP_DTO + { + /// + ///工厂地点 + /// + [ExporterHeader(DisplayName = "工厂地点")] + public string Site { get; set; } + /// + ///扩展1 + /// + [ExporterHeader(DisplayName = "扩展1")] + public string Extend1 { get; set; } + /// + ///作废发票号 + /// + [ExporterHeader(DisplayName = "作废发票号")] + public string OldInvBillNum { get; set; } + /// + ///发票号 + /// + [ExporterHeader(DisplayName = "发票号")] + public string InvBillNum { get; set; } + public decimal Price { get; set; } + public int Version { get; set; } + public string SettleBillNum { get; set; } + public DateTime SettleDate { get; set; } + public string InvGroupNum { get; set; } + public string LU { get; set; } + public string PN { get; set; } + public string KeyCode { get; set; } + public decimal Qty { get; set; } + public string GroupNum { get; set; } + + } + + + + public class PUB_ADJ_DETAIL_IMP_DTO + { + /// + ///工厂地点 + /// + [ImporterHeader(Name = "工厂地点")] + public string Site { get; set; } + /// + ///扩展1 + /// + [ImporterHeader(Name = "扩展1")] + public string Extend1 { get; set; } + /// + ///作废发票号 + /// + [ImporterHeader(Name = "作废发票号")] + public string OldInvBillNum { get; set; } + /// + ///发票号 + /// + [ImporterHeader(Name = "发票号")] + public string InvBillNum { get; set; } + public decimal Price { get; set; } + public int Version { get; set; } + public string SettleBillNum { get; set; } + public DateTime SettleDate { get; set; } + public string InvGroupNum { get; set; } + public string LU { get; set; } + public string PN { get; set; } + public string KeyCode { get; set; } + public decimal Qty { get; set; } + public string GroupNum { get; set; } + + } + + + + public class PUB_ADJ_DETAIL_REQ_DTO : RequestInputBase + +{ + + [Display(Name = "工厂地点")] + public string Site { get; set; } + [Display(Name = "扩展1")] + public string Extend1 { get; set; } + [Display(Name = "作废发票号")] + public string OldInvBillNum { get; set; } + [Display(Name = "发票号")] + public string InvBillNum { get; set; } + public string InvGroupNum { get; set; } + public string LU { get; set; } + public string PN { get; set; } + public string KeyCode { get; set; } + public string GroupNum { get; set; } + + } + + + + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs index 96d96494..adf9dfb2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -10,12 +10,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IINVOICE_SERVICE { -//Import -//ApprovalPassed -//Reject -//MainQuery -//DetailQuery -//Sync_QAD + Task ApprovalPassed(INVOICE_GRP_REQ_DTO input); Task> MainQueryAsync(INVOICE_GRP_REQ_DTO input); Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs index a859f92b..a98616eb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs @@ -23,7 +23,7 @@ namespace Win.Sfs.SettleAccount.Bases { - private readonly IExcelImportAppService _excelImportService; + protected readonly IExcelImportAppService _excelImportService; protected readonly ISnowflakeIdGenerator _snowflakeIdGenerator; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index 328c169b..44ff5c9e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -1,3 +1,5 @@ +using CodeArts.Db.Lts; +using DocumentFormat.OpenXml.Bibliography; using EFCore.BulkExtensions; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; @@ -20,11 +22,14 @@ using Volo.Abp.Application.Services; using Volo.Abp.Domain.Entities; 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.BQ.Managers; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; +using Win.Sfs.SettleAccount.Migrations; +using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Bases @@ -32,39 +37,41 @@ namespace Win.Sfs.SettleAccount.Bases public abstract class BA_SERVICE: BASE_SERVICE { protected readonly INormalEfCoreRepository _repository; - private readonly INormalEfCoreRepository _wRepository; - private readonly INormalEfCoreRepository _sRepository; - private readonly INormalEfCoreRepository _mRepository; - private readonly BBAC_CAN_SA_MNG _pubMng; - private readonly HBPO_CAN_SA_MNG _bbacMng; - private readonly PUB_CAN_SA_MNG _hbpoMng; - private readonly INV_MNG _invMng; + protected readonly INormalEfCoreRepository _wRepository; + protected readonly INormalEfCoreRepository _sRepository; + protected readonly INormalEfCoreRepository _mRepository; + protected readonly INormalEfCoreRepository _adjRepository; + protected readonly HBPO_CAN_SA_MNG _pubMng; + protected readonly BBAC_CAN_SA_MNG _bbacMng; + protected readonly PUB_CAN_SA_MNG _hbpoMng; + protected readonly INV_MNG _invMng; - //private readonly INormalEfCoreRepository _detailRepository; - private readonly IExcelImportAppService _excelImportService; - + protected BA_SERVICE( + INormalEfCoreRepository adjRepository, INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, IExcelImportAppService excelImportService, - BBAC_CAN_SA_MNG pubMng, - HBPO_CAN_SA_MNG bbacMng, + HBPO_CAN_SA_MNG pubMng, + BBAC_CAN_SA_MNG bbacMng, PUB_CAN_SA_MNG hbpoMng, INV_MNG invMng + //INormalEfCoreRepository detailRepository ) { - _excelImportService = excelImportService; + _repository = repository; _wRepository = wRepository; _mRepository = mRepository; _sRepository = sRepository; + _adjRepository = adjRepository; _pubMng = pubMng; _bbacMng = bbacMng; _hbpoMng = hbpoMng; @@ -72,17 +79,44 @@ namespace Win.Sfs.SettleAccount.Bases } + protected BA_SERVICE(IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + INormalEfCoreRepository pubRepository, + INormalEfCoreRepository repository, + INormalEfCoreRepository wRepository, + INormalEfCoreRepository sRepository, + INormalEfCoreRepository mRepository, + + BBAC_CAN_SA_MNG pubMng, + HBPO_CAN_SA_MNG bbacMng, + PUB_CAN_SA_MNG hbpoMng, + INV_MNG invMng + + + ) : + base(excelImportService, snowflakeIdGenerator, commonManager) + { + + } + + public virtual async Task GenerateInvoice(INVOICE_GRP_REQ_DTO input) + { + + await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核); + + return ApplicationConsts.SuccessStr; + } + /// - /// 审核发票通过 + /// 发票重开 /// /// /// - - - public virtual async Task GenerateInvoice(INVOICE_GRP_REQ_DTO input) + public virtual async Task ReissueInvoice(INVOICE_GRP_REQ_DTO input) { - await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核); + // await _invMng.SetForwardState(input.InvGroupNum, SettleBillState.商务已审核); return ApplicationConsts.SuccessStr; @@ -111,18 +145,16 @@ namespace Win.Sfs.SettleAccount.Bases { INVOICE_GRP_DETAIL_DTO entity=new INVOICE_GRP_DETAIL_DTO(); - var m= await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var m= await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting,int.MaxValue, input.SkipCount); var mdtos = ObjectMapper.Map, List>(m); - var w=await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var w=await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); var wdtos = ObjectMapper.Map, List>(w); - var s=await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); + var s=await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); var sdtos = ObjectMapper.Map, List>(s); entity.INVOICE_NOT_SETTLE = sdtos; entity.INVOICE_WAIT_DETAIL = wdtos; entity.INVOICE_MAP_GROUP = mdtos; return entity; - - } /// /// 导出文件 @@ -196,5 +228,80 @@ namespace Win.Sfs.SettleAccount.Bases return ApplicationConsts.SuccessStr; } + protected virtual async Task> GetMapGroupAsync(INVOICE_GRP_REQ_DTO input) + { + var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var mdtos = ObjectMapper.Map, List>(m); + return mdtos; + } + protected virtual async Task> GetDetailAsync(INVOICE_GRP_REQ_DTO input) + { + var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var wdtos = ObjectMapper.Map, List>(w); + return wdtos; + } + protected virtual async Task> GetNotDetailAsync(INVOICE_GRP_REQ_DTO input) + { + var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var sdtos = ObjectMapper.Map, List>(s); + return sdtos; + } + + protected virtual async Task> GetNotDetailAsync(string p_invbillNum) + { + List filters = new List(); + + filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); + return await _sRepository.GetListByFilterAsync(filters); + + + } + + protected virtual async Task> GetAjdmentDetail(INVOICE_GRP_REQ_DTO input) + { + var s = await _adjRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var sdtos = ObjectMapper.Map, List>(s); + return sdtos; + } + protected virtual async Task> GetAjdmentDetail(string p_invbillNum) + { + List filters = new List(); + filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); + + var s = await _adjRepository.GetListByFilterAsync(filters); + var sdtos = ObjectMapper.Map, List>(s); + return sdtos; + } + protected virtual async Task> GetMapGroupAsync(string p_invbillNum) + { + List filters = new List(); + + filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); + var m = await _mRepository.GetListByFilterAsync(filters); + var mdtos = ObjectMapper.Map, List>(m); + return mdtos; + } + /// + /// 通过发票号获取发票 + /// + /// + /// + protected virtual async Task GetInvoiceGroupByInvBillNum(string p_invbillNum) + { + List filters = new List(); + + filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); + var ls= await _repository.GetListByFilterAsync(filters); + if(ls!=null && ls.Count()>0) + { + return ls.FirstOrDefault(); + + } + return null; + + } + + + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index 67c431ff..d85dd704 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -22,6 +22,7 @@ using Volo.Abp.ObjectMapping; using Volo.Abp.TenantManagement.EntityFrameworkCore; 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; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; @@ -139,34 +140,30 @@ namespace Win.Sfs.SettleAccount.Bases where TRequestDetailInput : RequestInputBase where TEntityDetailExportDto : class, new() { - protected readonly INormalEfCoreRepository _repository; protected readonly INormalEfCoreRepository _detailRepository; private readonly IExcelImportAppService _excelImportService; protected readonly INV_MNG _invmng; - //private readonly CAN_SA_MNG _bbacMng; - - + protected CAN_SA_SERVICE( - INormalEfCoreRepository repository, IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + INormalEfCoreRepository repository, INormalEfCoreRepository detailRepository, - //CAN_SA_MNG bbacMng, - - - INV_MNG invmng + INV_MNG invmng ) + : base(excelImportService, snowflakeIdGenerator, commonManager) { - - _invmng= invmng; + _invmng = invmng; _excelImportService = excelImportService; _repository = repository; _detailRepository = detailRepository; - } + /// ///查询明细 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs index f21c0f78..8348d160 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs @@ -1,4 +1,4 @@ -using AutoMapper; +using AutoMapper; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; using Magicodes.ExporterAndImporter.Excel; @@ -17,6 +17,7 @@ using Volo.Abp.Application.Services; using Volo.Abp.Domain.Entities; 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; @@ -37,19 +38,19 @@ namespace Win.Sfs.SettleAccount.Bases protected readonly INormalEfCoreRepository _detailRepository; - protected readonly IExcelImportAppService _excelImportService; - - protected NOT_SA_SERVICE( + protected NOT_SA_SERVICE( IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + INormalEfCoreRepository detailRepository - ) + : base(excelImportService, snowflakeIdGenerator, commonManager) { - _excelImportService = excelImportService; - _detailRepository = detailRepository; } + /// /// 查询明细 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs index a376ea5f..5e369036 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -18,6 +18,7 @@ using Volo.Abp.Application.Services; using Volo.Abp.Domain.Entities; 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; @@ -38,21 +39,18 @@ namespace Win.Sfs.SettleAccount.Bases private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; - private readonly IExcelImportAppService _excelImportService; - - protected PD_SERVICE( - INormalEfCoreRepository repository, + public PD_SERVICE( IExcelImportAppService excelImportService, - INormalEfCoreRepository detailRepository + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + INormalEfCoreRepository repository, - ) + INormalEfCoreRepository detailRepository + ) : base(excelImportService, snowflakeIdGenerator, commonManager) { - _excelImportService = excelImportService; _repository = repository; _detailRepository = detailRepository; - - } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index 6ea26d16..9afa4b66 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -1,15 +1,26 @@ +using DocumentFormat.OpenXml.Bibliography; +using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components; +using Microsoft.EntityFrameworkCore; using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; +using System.Security.Policy; using System.Text; using System.Threading.Tasks; +using Volo.Abp; using Volo.Abp.Application.Services; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; +using Win.Sfs.SettleAccount.Constant; +using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; +using Win.Sfs.SettleAccount.Entities.Prices; +using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ @@ -21,8 +32,493 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [Route("api/settleaccount/[controller]/[action]")] public class BBAC_BA_SERVICE : BA_SERVICE { - public BBAC_BA_SERVICE(INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, IExcelImportAppService excelImportService, BBAC_CAN_SA_MNG pubMng, HBPO_CAN_SA_MNG bbacMng, PUB_CAN_SA_MNG hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng) + + + private readonly INormalEfCoreRepository _adjRepository; + private readonly INormalEfCoreRepository _priceRepository; + + + public BBAC_BA_SERVICE(IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + INormalEfCoreRepository pubRepository, + INormalEfCoreRepository repository, + INormalEfCoreRepository wRepository, + INormalEfCoreRepository sRepository, + INormalEfCoreRepository mRepository, + BBAC_CAN_SA_MNG pubMng, + HBPO_CAN_SA_MNG bbacMng, + PUB_CAN_SA_MNG hbpoMng, + INV_MNG invMng, + INormalEfCoreRepository adjRepository, + INormalEfCoreRepository priceRepository + + ) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, pubMng, bbacMng, hbpoMng, invMng) { + _adjRepository = adjRepository; + _priceRepository = priceRepository; + + } + + /// + /// 发票重开 + /// + /// + /// + public virtual async Task ReissueInvoice(string p_invbillnum) + { + var mappingList= await GetMapGroupAsync(p_invbillnum);//结算分组 + if (mappingList != null && mappingList.Count() > 0) + { + var version=int.Parse(DateTime.Now.ToString("yyyymm")); + var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + var inv= await GetInvoiceGroupByInvBillNum(p_invbillnum); + if (inv != null) + { + var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum, gList);//结算分组对应结算零件 + var adjlist=await _adjRepository.Where(p=>p.InvBillNum==inv.InvbillNum).ToListAsync(); + if(adjlist!=null && adjlist.Count()>0) + { + foreach (var itm in adjlist) + { + bbaclist.Add(new BBAC_CAN_SA_DETAIL( + guid: GuidGenerator.Create(), + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + category: itm.BusinessType, + isReturn: itm.Qty > 0 ? false : true, + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + contactid: itm.Extend1//生产号 + )); + } + } + var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); + //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 + var dto1s = ObjectMapper.Map, List>(entitys); + + var priceList = _priceRepository.ToList();//价格单 + + var inner = from d in dto1s + join p in priceList on d.LU equals p.LU + where + d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + select d; + var left = from d in dto1s + join p in inner on new { d.LU, d.PN } equals new { p.LU, p.PN } + into temp + from tm in temp.DefaultIfEmpty()//校验错误项 + where tm == null + select d; + + List errorList = new List(); + + foreach (var error in left) + { + errorList.Add(new ERR_EXP_DTO() { ItemCode = error.LU, CustomCode = "业务类别BBAC", Version = version.ToString(), Message = "LU:{0}PN:{1},下线日期:{2}没有对应区间销售价格表!" }); + } + if (errorList.Count() > 0) + { + return await ExportErrorReportAsync(errorList); + } + var q = from d in dto1s + join p in priceList on d.LU equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + select new TEMP_CAN_SA_DETAIL + { + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = d.ContractDocID, + BeginDate = p.BeginTime, + EndDate = p.EndTime + }; + var dtos = q.ToList(); + + if (dtos != null && dtos.Count > 0) + { + if (p_invbillnum.Substring(0, 1) == "INV")//一次开票 + { + // dtos = dtos.OrderBy(p => p.SettleDate).ToList(); + var _query = dtos.GroupBy(p => new { p.GroupNum }).Select(p => new { GroupNum = p.Key.GroupNum, Amt = p.Sum(itm => itm.Amt) }).OrderBy(p => p.Amt); + Dictionary dic = new Dictionary();//原本 + Dictionary copyDic = new Dictionary();//变换数组副本 + foreach (var itm in _query.ToList()) + { + dic.Add(itm.GroupNum, itm.Amt); + copyDic.Add(itm.GroupNum, itm.Amt); + } + Dictionary> invoiceMap = new Dictionary>(); + foreach (var itm in dic) + { + if (copyDic.ContainsKey(itm.Key) == true)//是否存在分组 + { + string invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV"); + List invoiceGroupNumList = new List();//每个发票对应的结算分组号 + List List = new List(); + decimal sum = itm.Value;//初始分组合计金额 + //List luList = dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU + p.ContractDocID).Distinct().ToList(); //初始LU种类 + foreach (var _itm1 in copyDic) + { + if (itm.Key == _itm1.Key)//相同结算分组项不计算,已初始化 + { + invoiceGroupNumList.Add(itm.Key); + continue; + } + //var grouplist = dtos.Where(p => p.GroupNum == _itm1.Key).Select(p => p.LU + p.ContractDocID).Distinct().ToList();//每项LU种类 + //luList.AddRange(grouplist); + //luList = luList.Distinct().ToList(); + //if (luList.Count > 20)//累加零件不超过20种 + //{ + // continue; + //} + sum += _itm1.Value; + if (sum > 10000000) + { + break; + } + invoiceGroupNumList.Add(_itm1.Key);//所有条件都满足添加发票和结算分组对应关系 + } + invoiceMap.Add(invoiceBillNum, invoiceGroupNumList);//记录发票对应关系 + foreach (var rem in invoiceGroupNumList)//移除已经开票分组 + { + copyDic.Remove(rem); + } + } + } + if (invoiceMap.Keys.Count > 0) + { + var groupList = new List(); + var notDetialList = new List(); + var detailList = new List(); + var invlist = new List(); + + // string str = JsonConvert.SerializeObject(invoiceMap); + + foreach (var itm in invoiceMap)//分组影响和 + { + var key = itm.Key;//发票票号 + var ls = itm.Value;//结算分组号列表 + var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.LU, p.Price, p.ContractDocID, p.BeginDate, p.EndDate }) + .Select(itm => new + { + InvGroupNum = itm.Key.InvGroupNum, + LU = itm.Key.LU, + ContactDocID = itm.Key.ContractDocID, + Price = itm.Key.Price, + Amt = itm.Sum(p => p.Amt), + Qty = itm.Sum(k => k.Qty), + BeginDate = itm.Key.BeginDate, + EndDate = itm.Key.EndDate + }) + .ToList(); + decimal amt = detailDtos.Sum(k => k.Amt); + decimal txtAmt = Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2); + var mapList = new List(); + foreach (var groupnum in ls) + { + mapList.Add(new INVOICE_MAP_GROUP( + guid: GuidGenerator.Create(), + version: version, + invbillNum: key, + invGroupNum: inv.InvGroupNum, + settleGroupNum: groupnum, + amt: 0, + extend1: string.Empty, + extend2: string.Empty + ) + ); + } + if (mapList.Count > 0) + { + groupList.AddRange(mapList); + } + List _entityDetailList = new List(); + foreach (var detail in detailDtos) + { + _entityDetailList.Add( + new INVOICE_WAIT_DETAIL( + guid: GuidGenerator.Create(), + version: version, + invbillNum: key, + invGroupNum:inv.InvGroupNum, + lU: detail.LU, + qty: detail.Qty, + bussiessType: EnumBusinessType.BBAC, + amt: detail.Amt, + pRICE: detail.Price, + extend1: detail.ContactDocID, + extend2: string.Empty, + beginDate: detail.BeginDate, + endDate: detail.EndDate + )); + } + if (_entityDetailList.Count > 0) + { + detailList.AddRange(_entityDetailList); + } + + #region 原有新发票生成时 + //var notls = notList.GroupBy(p => new { p.GroupNum, p.LU }) + // .Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); + //var innotls = new List(); + //foreach (var nitm in notls) + //{ + // innotls.Add(new INVOICE_NOT_SETTLE( + // guid: GuidGenerator.Create(), + // version: main.Version, + // invGroupNum: main.InvGroupNum, + // settleGroupNum: nitm.GroupNum, + // lU: string.Empty, + // lU1: nitm.LU, + // extend1: string.Empty, + // extend2: string.Empty, + // qty: nitm.Qty + // )); + //} + //if (innotls.Count > 0) + //{ + // notDetialList.AddRange(innotls); + //} + #endregion + var invbill = new INVOICE_GRP + (guid: GuidGenerator.Create(), + realnvBillNum: string.Empty, + invbillNum: key, + amt: amt, + taxAmt: txtAmt, + fileName: string.Empty, + businessType: EnumBusinessType.BBAC, + invGroupNum: inv.InvGroupNum, + state: SettleBillState.已开票, + invoiceBillState: InvoiceBillState.正常, + tax:0, + parent:inv.InvbillNum + ); + invlist.Add(invbill); + } + var notlist=await GetNotDetailAsync(p_invbillnum); + if (notlist != null && notlist.Count > 0) + { + foreach (var nitm in notlist) + { + notDetialList.Add(new INVOICE_NOT_SETTLE( + guid: GuidGenerator.Create(), + version: version, + invGroupNum: nitm.InvGroupNum, + settleGroupNum: nitm.SettleGroupNum, + lU: string.Empty, + lU1: nitm.LU, + extend1: string.Empty, + extend2: string.Empty, + qty: nitm.Qty + )); + } + } + await _repository.DbContext.BulkInsertAsync(invlist); + await _repository.DbContext.BulkInsertAsync(groupList); + await _repository.DbContext.BulkInsertAsync(detailList); + await _repository.DbContext.BulkInsertAsync(notDetialList); + } + } + else//二次开票 + { + var groups1 = dtos.GroupBy(p => new { p.LU, p.ContractDocID, p.Price, p.BeginDate, p.EndDate }).Select(p => new TMEP_INV + { + BeginDate = p.Key.BeginDate, + EndDate = p.Key.EndDate, + LU = p.Key.LU, + ContractDocID = p.Key.ContractDocID, + Amt = p.Sum(itm => itm.Amt), + Qty = p.Sum(itm => itm.Qty), + Price = p.Key.Price + }).ToList();//汇总记录不出现重复值 + var groups = dtos.GroupBy(p => new { p.LU, p.ContractDocID, p.Price, p.BeginDate, p.EndDate }).Select(p => new TMEP_INV + { + BeginDate = p.Key.BeginDate, + EndDate = p.Key.EndDate, + LU = p.Key.LU, + ContractDocID = p.Key.ContractDocID, + Amt = p.Sum(itm => itm.Amt), + Qty = p.Sum(itm => itm.Qty), + Price = p.Key.Price + }).ToList();//汇总记录不出现重复值 + Dictionary> invoiceMap = new Dictionary>();//发票和发票明细关系 + foreach (var group in groups) + { + int i = groups1.Count(p => p.LU == group.LU + && p.ContractDocID == group.ContractDocID + && p.BeginDate == group.BeginDate + && p.EndDate == group.EndDate + ); + if (i > 0) + { + string invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("CINV"); + List tempList = new List(); + decimal sum = group.Amt;//初始合计金额 + int partCount = 0; + foreach (var group1 in groups1) + { + if (group.LU == group1.LU && group1.ContractDocID == group.ContractDocID + && group.BeginDate == group1.BeginDate + && group.EndDate == group1.EndDate + ) + { + tempList.Add(group1); + partCount++;//符合条件加入到零件中 + continue; + } + partCount++; + if (partCount > 30) + { + continue; + } + sum += group1.Amt; + if (sum > 10000000) + { + break; + } + tempList.Add(group1); + } + invoiceMap.Add(invoiceBillNum, tempList); + var query = from itm in groups1 + join itm1 in tempList + on new { itm.LU, itm.ContractDocID, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.ContractDocID, itm1.BeginDate, itm1.EndDate } into temp + from tm in temp + where tm == null + select new TMEP_INV + { + LU = itm.LU, + ContractDocID = itm.ContractDocID, + Amt = itm.Amt, + Qty = itm.Qty, + BeginDate = itm.BeginDate, + EndDate = itm.EndDate + }; + groups1 = query.ToList(); + } + } + if (invoiceMap.Count > 0) + { + var groupList = new List(); + var notDetialList = new List(); + var detailList = new List(); + var invlist = new List(); + foreach (var group in invoiceMap) + { + var key = group.Key;//发票票号 + var ls = group.Value;//发票明细 + List _entityDetailList = new List(); + foreach (var detail in ls) + { + _entityDetailList.Add( + new INVOICE_WAIT_DETAIL( + guid: GuidGenerator.Create(), + version: version, + invbillNum: key, + invGroupNum: inv.InvGroupNum, + lU: detail.LU, + qty: detail.Qty, + bussiessType: EnumBusinessType.BBAC, + amt: detail.Amt, + pRICE: detail.Price, + extend1: detail.ContractDocID, + extend2: string.Empty, + beginDate: detail.BeginDate, + endDate: detail.EndDate + )); + } + if (_entityDetailList.Count > 0) + { + detailList.AddRange(_entityDetailList); + } + decimal amt = detailList.Sum(k => k.Amt); + decimal txtAmt = Math.Round(detailList.Sum(k => k.Amt), 2); + var contractList = ls.Select(p => p.ContractDocID).Distinct(); + var _groupList = dtos.Where(p => contractList.Contains(p.ContractDocID)).GroupBy(p => new { p.GroupNum }) + .Select(p => new { GroupNum = p.Key.GroupNum, Amt = p.Sum(itm => itm.Amt) }).Distinct(); + List group1 = new List(); + + foreach (var en in _groupList) + { + group1.Add( + new INVOICE_MAP_GROUP( + guid: GuidGenerator.Create(), + version: version, + invbillNum: key, + invGroupNum: inv.InvGroupNum, + settleGroupNum: en.GroupNum, + amt: en.Amt, + extend1: string.Empty, + extend2: string.Empty)); + } + if (group1.Count > 0) + { + groupList.AddRange(group1); + } + + var invbill = new INVOICE_GRP + (guid: GuidGenerator.Create(), + realnvBillNum: string.Empty, + invbillNum: key, + amt: amt, + taxAmt: txtAmt, + fileName: string.Empty, + businessType: EnumBusinessType.BBAC, + invGroupNum: inv.InvGroupNum, + state: SettleBillState.已开票, + invoiceBillState: InvoiceBillState.正常, + tax: 0, + parent: inv.InvbillNum + ); + invlist.Add(invbill); + } + await _repository.DbContext.BulkInsertAsync(invlist); + await _repository.DbContext.BulkInsertAsync(groupList); + await _repository.DbContext.BulkInsertAsync(detailList); + //await _repository.DbContext.BulkInsertAsync(notDetialList); + + } + + } + } + } + else + { + throw new BusinessException("8989", $"不存发票号为:{p_invbillnum}发票"); + } + } + else + { + throw new BusinessException("8989", $"不存发票号:{p_invbillnum}对应的结算分组号"); + } + + return ApplicationConsts.SuccessStr; + + } + + + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index e8a76508..808921ad 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -26,14 +26,12 @@ using Newtonsoft.Json; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.ExportReports; using Microsoft.EntityFrameworkCore.Migrations; +using Win.Abp.Snowflakes; +using Win.Sfs.SettleAccount.CommonManagers; +using Volo.Abp; namespace Win.Sfs.SettleAccount.Entities.BQ { - - - - - /// /// BBAC-JIS可结算单 @@ -57,22 +55,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly BBAC_CAN_SA_MNG _bbacMng; - - public BBAC_CAN_SA_SERVICE( + public BBAC_CAN_SA_SERVICE(IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, INormalEfCoreRepository repository, - IExcelImportAppService excelImportService, INormalEfCoreRepository detailRepository, - INormalEfCoreRepository notRepository, - BBAC_CAN_SA_MNG bbacMng, INV_MNG invmng, - INormalEfCoreRepository priceRepository - ) : base(repository, excelImportService, detailRepository, invmng) + INormalEfCoreRepository notRepository, + INormalEfCoreRepository priceRepository, + BBAC_CAN_SA_MNG bbacMng + + ) + : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng) { _notRepository = notRepository; _bbacMng = bbacMng; _priceRepository = priceRepository; - } + + /// /// 生成发票 /// @@ -85,7 +86,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var main =await _bbacMng.GetMainAsync(input.BillNum); if (main != null) { - if (await _bbacMng.SetForwardState(main,SettleBillState.已开票)) + if (await _bbacMng.SetForwardState(main, SettleBillState.已开票)) { var entitys = await _bbacMng.GetDetalListAsync(input.BillNum);//可结算 var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); @@ -93,51 +94,53 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var notList = _notRepository.Where(p => groupNumList.Contains(p.GroupNum)).ToList();//不能结算 var dto1s = ObjectMapper.Map, List>(entitys); - var priceList=_priceRepository.ToList();//价格单 + var priceList = _priceRepository.ToList();//价格单 var inner = from d in dto1s join p in priceList on d.LU equals p.LU where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime select d; - var left= from d in dto1s join p in inner on new { d.LU,d.PN } equals new {p.LU,p.PN} + var left = from d in dto1s + join p in inner on new { d.LU, d.PN } equals new { p.LU, p.PN } - into temp from tm in temp.DefaultIfEmpty()//校验错误项 - where tm ==null - select d; + into temp + from tm in temp.DefaultIfEmpty()//校验错误项 + where tm == null + select d; - List errorList=new List(); + List errorList = new List(); foreach (var error in left) { - errorList.Add(new ERR_EXP_DTO() { ItemCode=error.LU, CustomCode="业务类别BBAC", Version=main.Version.ToString(), Message="LU:{0}PN:{1},下线日期:{2}没有对应区间销售价格表!" }); + errorList.Add(new ERR_EXP_DTO() { ItemCode = error.LU, CustomCode = "业务类别BBAC", Version = main.Version.ToString(), Message = "LU:{0}PN:{1},下线日期:{2}没有对应区间销售价格表!" }); } - if(errorList.Count()>0) + if (errorList.Count() > 0) { return await ExportErrorReportAsync(errorList); } var q = from d in dto1s - join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime - select new TEMP_CAN_SA_DETAIL - { - SettleBillNum = d.SettleBillNum, - Site = d.Site, - Version = d.Version, - Price = p.Price, - BillNum = d.BillNum, - SettleDate = d.SettleDate, - InvGroupNum = d.InvGroupNum, - LU = d.LU, - MaterialDesc = d.MaterialDesc, - PN = d.PN, - Qty = d.Qty, - GroupNum = d.GroupNum, - Amt = Math.Round(d.Qty*p.Price,2), - ContractDocID = d.ContractDocID, - BeginDate=p.BeginTime, - EndDate=p.EndTime - }; + join p in priceList on d.LU equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime + select new TEMP_CAN_SA_DETAIL + { + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = d.ContractDocID, + BeginDate = p.BeginTime, + EndDate = p.EndTime + }; var dtos = q.ToList(); if (dtos != null && dtos.Count > 0) @@ -163,7 +166,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ List List = new List(); decimal sum = itm.Value;//初始分组合计金额 //List luList = dtos.Where(p => p.GroupNum == itm.Key).Select(p => p.LU + p.ContractDocID).Distinct().ToList(); //初始LU种类 - foreach (var _itm1 in copyDic) { if (itm.Key == _itm1.Key)//相同结算分组项不计算,已初始化 @@ -297,7 +299,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ businessType: EnumBusinessType.BBAC, invGroupNum: main.InvGroupNum, state: SettleBillState.已开票, - invoiceBillState: InvoiceBillState.正常 + invoiceBillState: InvoiceBillState.正常, + tax: 0, + parent: string.Empty ); invlist.Add(invbill); } @@ -311,7 +315,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { var groups1 = dtos.GroupBy(p => new { p.LU, p.ContractDocID, p.Price, p.BeginDate, p.EndDate }).Select(p => new TMEP_INV { - BeginDate=p.Key.BeginDate, EndDate=p.Key.EndDate, + BeginDate = p.Key.BeginDate, + EndDate = p.Key.EndDate, LU = p.Key.LU, ContractDocID = p.Key.ContractDocID, Amt = p.Sum(itm => itm.Amt), @@ -333,8 +338,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { int i = groups1.Count(p => p.LU == group.LU && p.ContractDocID == group.ContractDocID - &&p.BeginDate==group.BeginDate - &&p.EndDate==group.EndDate + && p.BeginDate == group.BeginDate + && p.EndDate == group.EndDate ); if (i > 0) { @@ -369,12 +374,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invoiceMap.Add(invoiceBillNum, tempList); var query = from itm in groups1 join itm1 in tempList - on new { itm.LU, itm.ContractDocID,itm.BeginDate,itm.EndDate } equals new { itm1.LU, itm1.ContractDocID, itm1.BeginDate, itm1.EndDate } into temp - from tm in temp where tm==null + on new { itm.LU, itm.ContractDocID, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.ContractDocID, itm1.BeginDate, itm1.EndDate } into temp + from tm in temp + where tm == null select new TMEP_INV - { LU = itm.LU, ContractDocID = itm.ContractDocID, - Amt = itm.Amt, Qty = itm.Qty,BeginDate=itm.BeginDate, - EndDate=itm.EndDate + { + LU = itm.LU, + ContractDocID = itm.ContractDocID, + Amt = itm.Amt, + Qty = itm.Qty, + BeginDate = itm.BeginDate, + EndDate = itm.EndDate }; groups1 = query.ToList(); } @@ -407,8 +417,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ extend2: string.Empty, beginDate: detail.BeginDate, endDate: detail.EndDate - - )); } if (_entityDetailList.Count > 0) @@ -450,7 +458,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ businessType: EnumBusinessType.BBAC, invGroupNum: main.InvGroupNum, state: SettleBillState.已开票, - invoiceBillState: InvoiceBillState.正常 + invoiceBillState: InvoiceBillState.正常, + tax: 0, + parent: string.Empty ); invlist.Add(invbill); } @@ -464,7 +474,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } } } - + } + else + { + throw new BusinessException("8989", string.Format("{0}不存在该可结算单号", input.BillNum)); } return ApplicationConsts.SuccessStr; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs index a0890649..b6db52bb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs @@ -10,8 +10,10 @@ using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; @@ -35,14 +37,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly BBAC_NOT_SA_MNG _bbacNotMng; - public BBAC_NOT_SA_SERVICE( - BBAC_NOT_SA_MNG bbacNotMng, - IExcelImportAppService excelImportService, - INormalEfCoreRepository detailRepository) : base(excelImportService, detailRepository) + + + + public BBAC_NOT_SA_SERVICE(IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, INormalEfCoreRepository detailRepository, BBAC_NOT_SA_MNG bbacNotMng) : + base(excelImportService, snowflakeIdGenerator, commonManager, detailRepository) { _bbacNotMng = bbacNotMng; - } + [HttpPost] public override async Task GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs index 43837a7f..7d59a57d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs @@ -7,8 +7,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.Shared.RepositoryBase; @@ -23,7 +25,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BBAC_PD_DETAIL, BBAC_PD_DETAIL_DTO, BBAC_PD_REQ_DTO, BBAC_PD_DETAIL_REQ_DTO, BBAC_PD_DETAIL_EXP_DTO> { - protected BBAC_PD_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService, INormalEfCoreRepository detailRepository) : base(repository, excelImportService, detailRepository) + public BBAC_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository repository, INormalEfCoreRepository detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository) { } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs index 64a02721..429fedec 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs @@ -7,8 +7,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.Shared.RepositoryBase; @@ -18,7 +20,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [Route("api/settleaccount/[controller]/[action]")] public class HBPO_BA_SERVICE : BA_SERVICE { - public HBPO_BA_SERVICE(INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, IExcelImportAppService excelImportService, BBAC_CAN_SA_MNG pubMng, HBPO_CAN_SA_MNG bbacMng, PUB_CAN_SA_MNG hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng) + public HBPO_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository pubRepository, INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, BBAC_CAN_SA_MNG pubMng, HBPO_CAN_SA_MNG bbacMng, PUB_CAN_SA_MNG hbpoMng, INV_MNG invMng) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, pubMng, bbacMng, hbpoMng, invMng) { } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs index 62a3cb2b..62202216 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs @@ -11,8 +11,10 @@ using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.ObjectMapping; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; @@ -39,22 +41,35 @@ namespace Win.Sfs.SettleAccount.Entities.BQ HBPO_CAN_SA_DETAIL_EXP_DTO > { - private INormalEfCoreRepository _notRepository; + private readonly INormalEfCoreRepository _notRepository; private readonly INormalEfCoreRepository _priceRepository; private readonly HBPO_CAN_SA_MNG _hbpoMng; - public HBPO_CAN_SA_SERVICE(INormalEfCoreRepository repository, - IExcelImportAppService excelImportService, + + + public HBPO_CAN_SA_SERVICE(IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + INormalEfCoreRepository repository, INormalEfCoreRepository detailRepository, INV_MNG invmng, INormalEfCoreRepository notRepository, - HBPO_CAN_SA_MNG hbpoMng, - INormalEfCoreRepository priceRepository - ) : base(repository, excelImportService, detailRepository, invmng) + INormalEfCoreRepository priceRepository, + HBPO_CAN_SA_MNG hbpoMng + + + ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng) { + _priceRepository = priceRepository; _notRepository = notRepository; _hbpoMng = hbpoMng; } + + + + + + /// /// 生成发票 /// @@ -278,8 +293,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ businessType: EnumBusinessType.HBPO, invGroupNum: main.InvGroupNum, state: SettleBillState.已开票, - invoiceBillState: InvoiceBillState.正常 - + invoiceBillState: InvoiceBillState.正常, + tax: 0, + parent: string.Empty ); invlist.Add(invbill); } @@ -419,7 +435,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ businessType: EnumBusinessType.HBPO, invGroupNum: main.InvGroupNum, state: SettleBillState.已开票, - invoiceBillState: InvoiceBillState.正常 + invoiceBillState: InvoiceBillState.正常, + tax: 0, + parent: string.Empty ); invlist.Add(invbill); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs index cc5772b2..89122e4a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs @@ -10,8 +10,10 @@ using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; @@ -32,13 +34,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { private readonly HBPO_NOT_SA_MNG _hbpoNotMng; + + public HBPO_NOT_SA_SERVICE(IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, INormalEfCoreRepository detailRepository, HBPO_NOT_SA_MNG hbpoNotMng - ) : base(excelImportService, detailRepository) + ) : base(excelImportService, snowflakeIdGenerator, commonManager, detailRepository) { - _hbpoNotMng= hbpoNotMng; + _hbpoNotMng = hbpoNotMng; } + public override async Task GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input) { var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs index d3561ea3..1f7ff5b1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs @@ -7,8 +7,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.Shared.RepositoryBase; @@ -21,7 +23,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ HBPO_PD_DETAIL, HBPO_PD_DETAIL_DTO, HBPO_PD_REQ_DTO, HBPO_PD_DETAIL_REQ_DTO, HBPO_PD_DETAIL_EXP_DTO> { - protected HBPO_PD_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService, INormalEfCoreRepository detailRepository) : base(repository, excelImportService, detailRepository) + public HBPO_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository repository, INormalEfCoreRepository detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository) { } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs index 9d42f0e5..3df748a7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs @@ -7,8 +7,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.Shared.RepositoryBase; @@ -18,7 +20,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [Route("api/settleaccount/[controller]/[action]")] public class PUB_BA_SERVICE : BA_SERVICE { - public PUB_BA_SERVICE(INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, IExcelImportAppService excelImportService, BBAC_CAN_SA_MNG pubMng, HBPO_CAN_SA_MNG bbacMng, PUB_CAN_SA_MNG hbpoMng, INV_MNG invMng) : base(repository, wRepository, sRepository, mRepository, excelImportService, pubMng, bbacMng, hbpoMng, invMng) + public PUB_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository pubRepository, INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, INormalEfCoreRepository mRepository, BBAC_CAN_SA_MNG pubMng, HBPO_CAN_SA_MNG bbacMng, PUB_CAN_SA_MNG hbpoMng, INV_MNG invMng) : base(excelImportService, snowflakeIdGenerator, commonManager, pubRepository, repository, wRepository, sRepository, mRepository, pubMng, bbacMng, hbpoMng, invMng) { } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs index 444e87d7..74eef318 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs @@ -6,8 +6,10 @@ using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; @@ -38,18 +40,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly PUB_CAN_SA_MNG _pubMng; private readonly INormalEfCoreRepository _priceRepository; private readonly INormalEfCoreRepository _pricebjRepository; - public PUB_CAN_SA_SERVICE(INormalEfCoreRepository repository, - IExcelImportAppService excelImportService, + + public PUB_CAN_SA_SERVICE + (IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + INormalEfCoreRepository repository, INormalEfCoreRepository detailRepository, - INormalEfCoreRepository priceRepository, - INormalEfCoreRepository pricebjRepository, INV_MNG invmng, - PUB_CAN_SA_MNG pubMng) : base(repository, excelImportService, detailRepository, invmng) + INormalEfCoreRepository priceRepository, + INormalEfCoreRepository pricebjRepository, + PUB_CAN_SA_MNG pubMng + + ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng) { _pubMng = pubMng; _priceRepository = priceRepository; _pricebjRepository = pricebjRepository; } + + [HttpPost] public async override Task GenerateInvoice(PUB_CAN_SA_REQ_DTO input) { @@ -274,7 +284,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ businessType: EnumBusinessType.HBPO, invGroupNum: main.InvGroupNum, state: SettleBillState.已开票, - invoiceBillState: InvoiceBillState.正常 + invoiceBillState: InvoiceBillState.正常, + tax:0, + parent:string.Empty + ); invlist.Add(invbill); @@ -416,7 +429,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ businessType: EnumBusinessType.HBPO, invGroupNum: main.InvGroupNum, state: SettleBillState.已开票, - invoiceBillState: InvoiceBillState.正常 + invoiceBillState: InvoiceBillState.正常, + tax:0, + parent:string.Empty ); invlist.Add(invbill); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs index b0abc85f..52d03cfb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs @@ -10,8 +10,10 @@ using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; @@ -28,14 +30,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ PUB_NOT_SA_DETAIL_EXP_DTO> { private readonly PUB_NOT_SA_MNG _pubNotMng; - public PUB_NOT_SA_SERVICE( - IExcelImportAppService excelImportService, + + + public PUB_NOT_SA_SERVICE(IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, INormalEfCoreRepository detailRepository, PUB_NOT_SA_MNG pubNotMng - ) : base(excelImportService, detailRepository) + ) : base(excelImportService, snowflakeIdGenerator, commonManager, detailRepository) { - _pubNotMng = pubNotMng; } + public override async Task GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input) { var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs index b59acbab..0ef7cf8c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs @@ -7,8 +7,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.Shared.RepositoryBase; @@ -21,7 +23,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ PUB_PD_DETAIL, PUB_PD_DETAIL_DTO, PUB_PD_REQ_DTO, PUB_PD_DETAIL_REQ_DTO, PUB_PD_DETAIL_EXP_DTO> { - protected PUB_PD_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService, INormalEfCoreRepository detailRepository) : base(repository, excelImportService, detailRepository) + public PUB_PD_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository repository, INormalEfCoreRepository detailRepository) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository) { } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_ADJ_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_ADJ_DETAIL.cs deleted file mode 100644 index 645bfb46..00000000 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_ADJ_DETAIL.cs +++ /dev/null @@ -1,125 +0,0 @@ -using SettleAccount.Bases; -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.SettleAccount; - -namespace SettleAccount.Domain.BQ; - - -[Display(Name = "BBAC不可结算导入明细")] -public class BBAC_ADJ_DETAIL:SA_NOT_BASE -{ - ///// - ///// 对应字段(Material+ExternalCalNumber) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string SettleBillNum { get; set; } = null!; - - ///// - ///// 对应字段Material - ///// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段ExternalCalNumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 选择工厂导入 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - /// - /// 对应字段Quantity - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - ///// - ///// 匹配价格表对应区间对应地点带出 - ///// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - /// - /// ExternalCallNumber包含(R0)为买单件 1为JIS 2.为买单件 - /// - [Display(Name = "业务类别")] - public EnumBusinessType BusinessType { get; set; } - - /// - /// 对应字段MovementType,996正常,997为退货 - /// - [Display(Name = "是否退货")] - public string IsReturn { get; set; } = null!; - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - - ///// - ///// 对应字段PostingDate - ///// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - /// - /// 对应字段Reference - /// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - [Display(Name = "合同号")] - public string ContractDocID { get; set; } - [Display(Name = "作废发票号")] - public string OldInvBillNum { get; set; } - - [Display(Name = "发票号")] - public string InvBillNum { get; set; } - - public BBAC_ADJ_DETAIL() - { - - } - - public BBAC_ADJ_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, string isReturn, string invGroupNum, DateTime settleDate, string groupNum,string contractDocID, string oldinv, string inv) - { - Id = guid; - KeyCode = keyCode; - Version = version; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - BusinessType = category; - IsReturn = isReturn; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - GroupNum = groupNum; - ContractDocID = contractDocID; - - - OldInvBillNum = oldinv; - - - InvBillNum =inv; - - } -} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs index 00c8aa21..89b4a4a4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs @@ -110,7 +110,7 @@ public class BBAC_CAN_SA_DETAIL: SA_CAN_BASE /// 对应字段MovementType,996正常,997为退货 /// [Display(Name = "是否退货")] - public string IsReturn { get; set; } = null!; + public bool IsReturn { get; set; } =false; @@ -137,7 +137,7 @@ public class BBAC_CAN_SA_DETAIL: SA_CAN_BASE } - public BBAC_CAN_SA_DETAIL(Guid guid,string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, string isReturn, + public BBAC_CAN_SA_DETAIL(Guid guid,string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, bool isReturn, DateTime settleDate, string groupNum, string invGroupNum ,string contactid ):base(guid) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs index 96bbb7a1..54796196 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs @@ -19,6 +19,13 @@ public class INVOICE_GRP : FullAuditedAggregateRoot [Display(Name = "税后金额")] public decimal TaxAmt { get; set; } + [Display(Name = "税额")] + public decimal Tax { get; set; } + + [Display(Name = "原发票号")] + public string ParentInvbillNum{ get; set; } + + [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } = null!; @@ -40,7 +47,7 @@ public class INVOICE_GRP : FullAuditedAggregateRoot - public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, EnumBusinessType businessType, SettleBillState state,InvoiceBillState invoiceBillState) + public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, string invGroupNum, string fileName, EnumBusinessType businessType, SettleBillState state,InvoiceBillState invoiceBillState,decimal tax,string parent) { Id= guid; RealnvBillNum = realnvBillNum; @@ -52,6 +59,9 @@ public class INVOICE_GRP : FullAuditedAggregateRoot BusinessType = businessType; State = state; InvoiceState = invoiceBillState; + ParentInvbillNum = parent; + Tax = tax; + } @@ -61,61 +71,3 @@ public class INVOICE_GRP : FullAuditedAggregateRoot } } -//[ShangWuShenHeGroup] -//[Hidden] -//[Display(Name = "财务管理审核明细")] -//public class INVOICE_DETAIL : BaseEntity -//{ -// [Display(Name = "零件号")] -// public string LU { get; set; } = null!; - -// [Display(Name = "单价")] -// public decimal PRICE { get; set; } - -// [Display(Name = "数量")] -// public decimal Qty { get; set; } - -// [Display(Name = "金额")] -// public decimal Amt { get; set; } - -// [Display(Name = "发票号")] -// public string InvbillNum { get; set; } = null!; -// [Display(Name = "发票分组号")] -// public string InvGroupNum { get; set; } = null!; -//[ShangWuShenHeGroup] -//[Display(Name = "待开票明细")] -//public class INVOICE_WAIT_DETAIL : BaseEntity -//{ -// [Display(Name = "发票号")] -// public string InvbillNum { get; set; } = null!; - -// [Display(Name = "零件号")] -// public string LU { get; set; } = null!; - -// [Display(Name = "单价")] -// public decimal PRICE { get; set; } - -// [Display(Name = "数量")] -// public decimal Qty { get; set; } - -// [Display(Name = "金额")] -// public decimal Amt { get; set; } - -// [Display(Name = "扩展字段1")] -// public string Extend1 { get; set; } = null!; - -// [Display(Name = "扩展字段2")] -// public string Extend2 { get; set; } = null!; - -// [Display(Name = "扩展字段3")] -// public string Extend3 { get; set; } = null!; - -// [Display(Name = "扩展字段4")] -// public string Extend4 { get; set; } = null!; -// [Display(Name = "期间")] -// public int Version { get; set; } -// [Display(Name = "发票分组号")] -// public string InvGroupNum { get; set; } = null!; -// [Display(Name = "业务分类")] -// public string BussiessType { get; set; } = null!; -//} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs index 4a3bf854..ef6bbccf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs @@ -247,6 +247,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync(); } + /// + /// 获取发票对应结算分组所有零件 + /// + /// + /// + public virtual async Task> GetContainsAsync(string p_canSettleBillNum, List p_list) + { + return await _detailRepository.Where(p =>p.InvGroupNum==p_canSettleBillNum && p_list.Contains(p.GroupNum)).ToListAsync(); + } + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs index 79670bcb..8296c818 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs @@ -25,12 +25,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers private readonly INormalEfCoreRepository _groupRepository; private readonly INormalEfCoreRepository _detailRepository; private readonly INormalEfCoreRepository _notRepository; + + private readonly INormalEfCoreRepository _adjRepository; + private readonly PUB_CAN_SA_MNG _pubMng; private readonly BBAC_CAN_SA_MNG _bbacMng; private readonly HBPO_CAN_SA_MNG _hbpoMng; public INV_MNG ( - PUB_CAN_SA_MNG pubMng, + PUB_CAN_SA_MNG pubMng, BBAC_CAN_SA_MNG bbacMng, HBPO_CAN_SA_MNG hbpoMng, @@ -39,7 +42,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers INormalEfCoreRepository repository, INormalEfCoreRepository groupRepository, INormalEfCoreRepository detailRepository, - INormalEfCoreRepository notRepository + INormalEfCoreRepository notRepository, + INormalEfCoreRepository adjRepository ) { //_canRepository = canRepository; @@ -47,6 +51,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _detailRepository = detailRepository; _groupRepository = groupRepository; _notRepository = notRepository; + _adjRepository = adjRepository; _pubMng = pubMng; _bbacMng = bbacMng; _hbpoMng = hbpoMng; @@ -215,8 +220,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } break; } - - var flag = await SetSettleState(p_entiy, p_State,false); if (flag == false) { @@ -224,7 +227,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } await _repository.UpdateAsync(p_entiy); - return true; } @@ -242,6 +244,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { return await _repository.Where(p => p.InvbillNum == p_groupbillNum).FirstOrDefaultAsync(); } + + /// + /// 获得发票主表 + /// + /// + /// + public virtual async Task GetInvoiceAsync(string p_invbillNum) + { + return await _repository.Where(p => p.InvbillNum == p_invbillNum).FirstOrDefaultAsync(); + } + + + + /// /// 客户已收票 /// @@ -268,10 +284,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers ); var bbacDetail = new List(); - - - - foreach (var itm in entityDetail) { bbacDetail.Add( @@ -295,8 +307,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers extend3: string.Empty, extend4: string.Empty )); - - await _repository.DbContext.BulkInsertAsync(new List() { bbac }); await _repository.DbContext.BulkInsertAsync(bbacDetail); return true; @@ -406,14 +416,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } public virtual async Task Reject(INVOICE_GRP p_entity) { - if (await Reject(p_entity.InvGroupNum)) return true; else return false; - - } /// /// 退回 @@ -446,28 +453,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers await _repository.DbContext.BulkDeleteAsync(notList); await _repository.DbContext.BulkDeleteAsync(detailList); //await _repository.DbContext.BulkUpdateAsync(canList); - - - } if (p_entity.State == SettleBillState.已扣减) { } } - } else { } - - - - return true; - - } /// /// 返回到财务审核状态 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index f92736fa..4862d0ad 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -1197,24 +1197,24 @@ namespace Win.Sfs.SettleAccount private static void ConfigureBBAC_ADJ_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { - builder.Entity(b => - { - b.ToTable($"{options.TablePrefix}_BBAC_ADJ_DETAIL", options.Schema); - - b.ConfigureByConvention(); - b.Property(x => x.Site).HasMaxLength(50); - b.Property(x => x.IsReturn).HasMaxLength(50); - b.Property(x => x.ContractDocID).HasMaxLength(50); - b.Property(x => x.OldInvBillNum).HasMaxLength(50); - b.Property(x => x.InvBillNum).HasMaxLength(50); - b.Property(x => x.SettleBillNum).HasMaxLength(50); - b.Property(x => x.InvGroupNum).HasMaxLength(50); - b.Property(x => x.LU).HasMaxLength(50); - b.Property(x => x.PN).HasMaxLength(50); - b.Property(x => x.KeyCode).HasMaxLength(50); - b.Property(x => x.GroupNum).HasMaxLength(50); - b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); - }); + //builder.Entity(b => + //{ + // b.ToTable($"{options.TablePrefix}_BBAC_ADJ_DETAIL", options.Schema); + + // b.ConfigureByConvention(); + // b.Property(x => x.Site).HasMaxLength(50); + // b.Property(x => x.IsReturn).HasMaxLength(50); + // b.Property(x => x.ContractDocID).HasMaxLength(50); + // b.Property(x => x.OldInvBillNum).HasMaxLength(50); + // b.Property(x => x.InvBillNum).HasMaxLength(50); + // b.Property(x => x.SettleBillNum).HasMaxLength(50); + // b.Property(x => x.InvGroupNum).HasMaxLength(50); + // b.Property(x => x.LU).HasMaxLength(50); + // b.Property(x => x.PN).HasMaxLength(50); + // b.Property(x => x.KeyCode).HasMaxLength(50); + // b.Property(x => x.GroupNum).HasMaxLength(50); + // b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); + //}); } private static void ConfigureVmi(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.Designer.cs new file mode 100644 index 00000000..d02d70c6 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.Designer.cs @@ -0,0 +1,4874 @@ +// +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("20230727085151_202307270004")] + partial class _202307270004 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.17") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_CAN_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractDocID") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsReturn") + .HasMaxLength(50) + .HasColumnType("bit"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SettleDate") + .HasColumnType("datetime2"); + + b.Property("Site") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_CAN_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_NOT_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractDocID") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsReturn") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("KeyCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PN") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("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_ADJ_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .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("OldInvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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_HBPO_ADJ_DETAIL"); + }); + + 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("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_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("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .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_HBPO_CAN_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_NOT_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("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_HBPO_NOT_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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_HBPO_PD_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DNBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("RecordCount") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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_HBPO_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("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_HBPO_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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_HBPO_SE_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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_HBPO_SE_EDI"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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_HBPO_SE_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.HBPO_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("Qty") + .HasColumnType("decimal(18,2)"); + + 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_HBPO_SE_SA_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_GRP", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvoiceState") + .HasColumnType("int"); + + 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("ParentInvbillNum") + .HasColumnType("nvarchar(max)"); + + b.Property("RealnvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Tax") + .HasColumnType("decimal(18,2)"); + + b.Property("TaxAmt") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_GRP"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_MAP_GROUP", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .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("SettleGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_MAP_GROUP"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_NOT_SETTLE", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + 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("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("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LU1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SettleGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_NOT_SETTLE"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.INVOICE_WAIT_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Amt") + .HasColumnType("decimal(18,2)"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BussiessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvbillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PRICE") + .HasColumnType("decimal(18,2)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_INVOICE_WAIT_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.JIT_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("Qty") + .HasColumnType("decimal(18,2)"); + + 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_JIT_SE_SA_REPORT"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_ADJ_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .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("OldInvBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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_PUB_ADJ_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_CAN_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("SettleBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Site") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_CAN_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_CAN_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .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_PUB_CAN_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_NOT_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + 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("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_PUB_NOT_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_PD_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend2") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend3") + .HasColumnType("nvarchar(max)"); + + b.Property("Extend4") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("InvGroupNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("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_PUB_PD_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_SA", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("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("State") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Version") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SA"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_SA_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + 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("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("GroupNum") + .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_PUB_SA_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PUB_SE_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BusinessType") + .HasMaxLength(50) + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Extend1") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend2") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Extend3") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + 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("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Version") + .HasColumnType("int"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SE_DETAIL"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.PURCHASE_PRICE", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.ToTable("Set_PURCHASE_PRICE"); + }); + + modelBuilder.Entity("SettleAccount.Domain.BQ.TB_RePartsRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("RepLU") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_TB_RePartsRelationship"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Boms.Bom", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BomLevel") + .HasColumnType("int"); + + b.Property("BomType") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChildItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ChildItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("ChildItemUom") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("EffectiveTime") + .HasColumnType("datetime2"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExpireTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IssuePosition") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OperateProcess") + .HasColumnType("int"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentItemCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("ParentItemDesc") + .HasMaxLength(2048) + .HasColumnType("nvarchar(2048)"); + + b.Property("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ScrapPercent") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("ParentItemCode", "ChildItemCode", "Version") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_bom"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.BBAC_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("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("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_BBAC_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.HBPO_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("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("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_HBPO_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.PUB_SEC_DETAIL", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Category") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerOfflineTime") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DiffQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FixPrice") + .HasColumnType("decimal(18,2)"); + + 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("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("PrimitiveLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ReplaceLU") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("SAQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SEQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("WmsBillNum") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PUB_SEC_DETAIL"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Cron") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("IsDisabled") + .HasColumnType("bit"); + + b.Property("IsRunning") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Service") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Set_JobItem"); + + b.HasData( + new + { + Id = new Guid("ef3d8e8a-a88e-ca1f-e615-714c6bc48824"), + Cron = "0 0 8 26 *", + IsDisabled = false, + IsRunning = false, + Name = "库存快照", + Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiService" + }); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("End") + .HasColumnType("datetime2"); + + b.Property("Exception") + .HasColumnType("nvarchar(max)"); + + b.Property("JobId") + .HasColumnType("uniqueidentifier"); + + b.Property("Start") + .HasColumnType("datetime2"); + + b.Property("Success") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("JobId"); + + b.ToTable("Set_JobLog"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiBalance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CustomOrderNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("Desc") + .HasColumnType("nvarchar(max)"); + + b.Property("ErpToLoc") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("LU") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PartCode") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("ProType") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasAlternateKey("ErpToLoc", "PartCode", "LU"); + + b.ToTable("Set_VmiBalance"); + + b.HasData( + new + { + Id = new Guid("cd6b8f09-2146-73d3-cade-4e832627b4f6"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + Desc = "test", + ErpToLoc = "key1", + LU = "key3", + PartCode = "key2", + Qty = 0m, + ShippingDate = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) + }); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Number") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("Number") + .IsUnique(); + + b.ToTable("Set_VmiCategory"); + + b.HasData( + new + { + Id = new Guid("b3b321dd-5e0e-55b0-5548-70a742e9a4db"), + Name = "发运入库", + Number = "100", + Type = 0 + }, + new + { + Id = new Guid("a04d00ac-0e9c-064d-b7ce-af0b4d7c8c6b"), + Name = "结算出库", + Number = "200", + Type = 1 + }, + new + { + Id = new Guid("c9199f7f-7cc8-7423-d608-f206167ae0b6"), + Name = "客户退货", + Number = "300", + Type = 1 + }, + new + { + Id = new Guid("5fda8ad4-f424-a9e1-8174-72c0f29fc225"), + Name = "调整入库", + Number = "400", + Type = 0 + }, + new + { + Id = new Guid("42230472-9f26-7484-ff2a-451878e9955f"), + Name = "调整出库", + Number = "500", + Type = 1 + }); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BalanceDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Category") + .HasColumnType("nvarchar(max)"); + + b.Property("CodeType") + .HasColumnType("nvarchar(max)"); + + b.Property("Count") + .HasColumnType("decimal(18,2)"); + + b.Property("CreatedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedDate") + .HasColumnType("datetime2"); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Desc") + .HasColumnType("nvarchar(max)"); + + b.Property("ErpToLoc") + .HasColumnType("nvarchar(max)"); + + b.Property("F2") + .HasColumnType("nvarchar(max)"); + + b.Property("G2") + .HasColumnType("nvarchar(max)"); + + b.Property("GroupId") + .HasColumnType("nvarchar(max)"); + + b.Property("H2") + .HasColumnType("nvarchar(max)"); + + b.Property("I2") + .HasColumnType("nvarchar(max)"); + + b.Property("J2") + .HasColumnType("nvarchar(max)"); + + b.Property("K2") + .HasColumnType("nvarchar(max)"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("MatchNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("PjsNum") + .HasColumnType("nvarchar(max)"); + + b.Property("ProType") + .HasColumnType("nvarchar(max)"); + + b.Property("Qty") + .HasColumnType("decimal(18,2)"); + + b.Property("SeqNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("ShippingDate") + .HasColumnType("datetime2"); + + b.Property("Tmpe4") + .HasColumnType("nvarchar(max)"); + + b.Property("UniqueCode") + .HasColumnType("nvarchar(max)"); + + b.Property("VinCode") + .HasColumnType("nvarchar(max)"); + + b.Property("VmiCategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("VmiType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VmiCategoryId"); + + b.ToTable("Set_VmiLog"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiSnapshot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("Path") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_VmiSnapshot"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Boms.BomVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + 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("Period") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Year") + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.ToTable("Set_bom_version"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.CodeSettings.CodeSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + 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("Project") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_CodeSetting"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Controls.CentralizedControl", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Enabled") + .HasColumnType("bit"); + + 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("Period") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("State") + .HasColumnType("bit"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.Property("Year") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("Year", "Period") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_control"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Materials.Material", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerPartCode") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EstimateType") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("EstimateTypeDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .HasColumnType("nvarchar(max)"); + + 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("MaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.Property("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Unit") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + b.HasKey("Id"); + + b.HasIndex("MaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_material"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginTime") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("BusinessType") + .HasColumnType("int"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractNo") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceList"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListBJ", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BeginDate") + .HasColumnType("datetime2"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ClientCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContractNo") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("CustomerCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("EndDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LU") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("MaterialCode") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("Version") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListBJ"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .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("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersion"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.Prices.PriceListVersionBJ", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Factory") + .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("Period") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Year") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Set_PriceListVersionBJ"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.TaskJob", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("Creator") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DownFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Email") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("Error") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("FileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + 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("Name") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("RealDownFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("RealFileName") + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("ServiceName") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("State") + .HasColumnType("nvarchar(max)"); + + b.Property("TaskId") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Type") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Set_TaskJob"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.MaterialRelationships.MaterialRelationship", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppraisalCategory") + .HasColumnType("nvarchar(max)"); + + b.Property("BranchId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .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("Enabled") + .HasColumnType("bit"); + + b.Property("ErpMaterialCode") + .IsRequired() + .HasMaxLength(36) + .HasColumnType("nvarchar(36)"); + + 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("MaterialDesc") + .HasColumnType("nvarchar(max)"); + + b.Property("MaterialProperty") + .HasColumnType("nvarchar(max)"); + + b.Property("Remark") + .HasColumnType("nvarchar(max)"); + + b.Property("SettleMaterialCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ShipMaterailCode") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ErpMaterialCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("Set_relationship"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobLog", b => + { + b.HasOne("Win.Sfs.SettleAccount.Entities.BQ.Vmi.JobItem", "Job") + .WithMany() + .HasForeignKey("JobId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Job"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiLog", b => + { + b.HasOne("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiCategory", null) + .WithMany("Logs") + .HasForeignKey("VmiCategoryId"); + }); + + modelBuilder.Entity("Win.Sfs.SettleAccount.Entities.BQ.Vmi.VmiCategory", b => + { + b.Navigation("Logs"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.cs new file mode 100644 index 00000000..90fc830b --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.cs @@ -0,0 +1,93 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Win.Sfs.SettleAccount.Migrations +{ + public partial class _202307270004 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Set_BBAC_ADJ_DETAIL"); + + migrationBuilder.AddColumn( + name: "ParentInvbillNum", + table: "Set_INVOICE_GRP", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Tax", + table: "Set_INVOICE_GRP", + type: "decimal(18,2)", + nullable: false, + defaultValue: 0m); + + migrationBuilder.AlterColumn( + name: "IsReturn", + table: "Set_BBAC_CAN_SA_DETAIL", + type: "bit", + maxLength: 50, + nullable: false, + defaultValue: false, + oldClrType: typeof(string), + oldType: "nvarchar(50)", + oldMaxLength: 50, + oldNullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ParentInvbillNum", + table: "Set_INVOICE_GRP"); + + migrationBuilder.DropColumn( + name: "Tax", + table: "Set_INVOICE_GRP"); + + migrationBuilder.AlterColumn( + name: "IsReturn", + table: "Set_BBAC_CAN_SA_DETAIL", + type: "nvarchar(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(bool), + oldType: "bit", + oldMaxLength: 50); + + migrationBuilder.CreateTable( + name: "Set_BBAC_ADJ_DETAIL", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + BusinessType = table.Column(type: "int", nullable: false), + ConcurrencyStamp = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + ContractDocID = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + GroupNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + InvBillNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + InvGroupNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + IsReturn = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + KeyCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + LU = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + OldInvBillNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + PN = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Price = table.Column(type: "decimal(18,2)", nullable: false), + Qty = table.Column(type: "decimal(18,2)", nullable: false), + SettleBillNum = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + SettleDate = table.Column(type: "datetime2", nullable: false), + Site = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Version = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Set_BBAC_ADJ_DETAIL", x => x.Id); + }); + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs index 72efe6e9..4d4a70b6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/SettleAccountDbContextModelSnapshot.cs @@ -21,102 +21,6 @@ namespace Win.Sfs.SettleAccount.Migrations .HasAnnotation("ProductVersion", "5.0.17") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_ADJ_DETAIL", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("BusinessType") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("ContractDocID") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("ExtraProperties") - .HasColumnType("nvarchar(max)") - .HasColumnName("ExtraProperties"); - - b.Property("GroupNum") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("InvBillNum") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("InvGroupNum") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("IsReturn") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("KeyCode") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("LU") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("OldInvBillNum") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - 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_ADJ_DETAIL"); - }); - modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b => { b.Property("Id") @@ -221,9 +125,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasMaxLength(50) .HasColumnType("nvarchar(50)"); - b.Property("IsReturn") + b.Property("IsReturn") .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasColumnType("bit"); b.Property("KeyCode") .HasMaxLength(50) @@ -2072,6 +1976,9 @@ namespace Win.Sfs.SettleAccount.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); + b.Property("ParentInvbillNum") + .HasColumnType("nvarchar(max)"); + b.Property("RealnvBillNum") .HasMaxLength(50) .HasColumnType("nvarchar(50)"); @@ -2079,6 +1986,9 @@ namespace Win.Sfs.SettleAccount.Migrations b.Property("State") .HasColumnType("int"); + b.Property("Tax") + .HasColumnType("decimal(18,2)"); + b.Property("TaxAmt") .HasColumnType("decimal(18,2)"); From e13ad32a8f68852e379aec4885a6fe2998c28eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 27 Jul 2023 16:57:25 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/BBAC_BA_SERVICE.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index 9afa4b66..47eb6fbf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -265,7 +265,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invGroupNum:inv.InvGroupNum, lU: detail.LU, qty: detail.Qty, - bussiessType: EnumBusinessType.BBAC, + bussiessType: EnumBusinessType.JisHBPO, amt: detail.Amt, pRICE: detail.Price, extend1: detail.ContactDocID, @@ -309,7 +309,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ amt: amt, taxAmt: txtAmt, fileName: string.Empty, - businessType: EnumBusinessType.BBAC, + businessType: EnumBusinessType.JisBBAC, invGroupNum: inv.InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, @@ -440,7 +440,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invGroupNum: inv.InvGroupNum, lU: detail.LU, qty: detail.Qty, - bussiessType: EnumBusinessType.BBAC, + bussiessType: EnumBusinessType.JisBBAC, amt: detail.Amt, pRICE: detail.Price, extend1: detail.ContractDocID, @@ -485,7 +485,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ amt: amt, taxAmt: txtAmt, fileName: string.Empty, - businessType: EnumBusinessType.BBAC, + businessType: EnumBusinessType.JisBBAC, invGroupNum: inv.InvGroupNum, state: SettleBillState.已开票, invoiceBillState: InvoiceBillState.正常, From fb990f31158f1c06446a23b20f261c0885f35c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Thu, 27 Jul 2023 17:30:45 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index 47eb6fbf..e1a8a522 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -411,6 +411,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { LU = itm.LU, ContractDocID = itm.ContractDocID, + Price = itm.Price, Amt = itm.Amt, Qty = itm.Qty, BeginDate = itm.BeginDate, From 7944312ae179b47e94a61fbfc8d1a9142442dd04 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Thu, 27 Jul 2023 17:46:31 +0800 Subject: [PATCH 4/5] update --- .../SettleAccount.HttpApi.Host.csproj | 11 +- .../SettleAccount.HttpApi.Host/Startup.cs | 66 +----- .../appsettings.json | 3 +- .../host/SettleAccount.HttpApi.Host/start.cmd | 11 + .../host/SettleAccount.HttpApi.Host/stop.cmd | 3 + .../wwwroot/components/list/index.js | 18 +- .../wwwroot/views/base-data/job-item.js | 4 +- .../Entities/BQ/JobHostdService.cs | 204 ++++++++++++++++++ .../Entities/BQ/JobItemAppService.cs | 140 +----------- .../Entities/BQ/VmiAppService.cs | 2 +- ...AccountDbContextModelCreatingExtensions.cs | 5 +- 11 files changed, 244 insertions(+), 223 deletions(-) create mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/start.cmd create mode 100644 code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/stop.cmd create mode 100644 code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj index e285db5f..d1964be3 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj @@ -1,5 +1,4 @@ - - + @@ -87,8 +86,12 @@ - - + + PreserveNewest + + + PreserveNewest + diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs index c1859db9..5168422c 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs @@ -1,8 +1,4 @@ -using System; -using System.Linq; using System.Text.RegularExpressions; -using Coravel; -using Coravel.Invocable; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc.ApplicationModels; @@ -11,10 +7,9 @@ using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.AspNetCore.StaticFiles; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using NUglify.Helpers; using SettleAccount.Job.SignalR; +using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -using Win.Sfs.SettleAccount.Entities.BQ.Vmi; namespace Win.Sfs.SettleAccount; @@ -23,14 +18,12 @@ public class Startup public void ConfigureServices(IServiceCollection services) { services.AddSignalR(o => o.EnableDetailedErrors = true); - AppDomain.CurrentDomain.GetAssemblies().SelectMany(o => o.GetTypes()) - .Where(o => o.IsClass && !o.IsAbstract && o.IsAssignableTo(typeof(IJobService))) - .ForEach(o => services.AddTransient(o)); - services.AddScheduler(); + JobHostdService.AddService(services); + services.AddSingleton(); + services.AddHostedService(o => o.GetRequiredService()); services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); services.AddApplication(); @@ -51,57 +44,6 @@ public class Startup { app.UseRouting(); app.UseEndpoints(endpoints => endpoints.MapHub("/api/hub")); - app.ApplicationServices.UseScheduler(scheduler => - { - //scheduler.Schedule().EveryMinute(); - scheduler.Schedule().EveryMinute(); - - using var scope = app.ApplicationServices.CreateScope(); - var jobs = scope.ServiceProvider.GetService().Set().ToList(); - jobs?.ForEach(job => - { - var jobId = job.Id; - using var scope = app.ApplicationServices.CreateScope(); - var serviceType = AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()).FirstOrDefault(o => o.FullName == job.Service); - if (serviceType != null) - { - if (scope.ServiceProvider.GetService(serviceType) is IJobService jobService) - { - scheduler.Schedule(() => - { - using var scope = app.ApplicationServices.CreateScope(); - var db = scope.ServiceProvider.GetService(); - var jobItemRepository = db.Set(); - var jobLogRepository = db.Set(); - var jobItem = jobItemRepository.FirstOrDefault(o => o.Id == jobId); - if (!jobItem.IsDisabled) - { - jobItem.IsRunning = true; - db.SaveChanges(); - var jobLog = new JobLog { JobId = jobId, Start = DateTime.Now }; - try - { - jobService.Invoke(); - jobLog.Success = true; - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - jobLog.Exception = ex.ToString(); - } - finally - { - jobLog.End = DateTime.Now; - jobLogRepository.Add(jobLog); - jobItem.IsRunning = false; - db.SaveChanges(); - } - } - }).Cron(job.Cron); - } - } - }); - }); var contentTypeProvider = new FileExtensionContentTypeProvider(); contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = contentTypeProvider }); diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json index 5f575aad..ad037e61 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/appsettings.json @@ -69,8 +69,7 @@ "AuthServer": { - "Authority": "http://dev.ccwin-in.com:10580", - //"Authority": "http://localhost:10130", + "Authority": "http://*:10582", "ClientId": "basic-web", "ClientSecret": "1q2w3e*" }, diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/start.cmd b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/start.cmd new file mode 100644 index 00000000..90a86864 --- /dev/null +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/start.cmd @@ -0,0 +1,11 @@ +@echo off + +tasklist|find /i "SettleAccount.HttpApi.Host.exe" + +if %errorlevel% == 0 ( +  exit +) + +%1 start mshta vbscript:createobject("wscript.shell").run("""%~0"" ::",0)(window.close)&&exit + +start /b SettleAccount.HttpApi.Host.exe --urls http://dev.ccwin-in.com:10582 diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/stop.cmd b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/stop.cmd new file mode 100644 index 00000000..d147d6c6 --- /dev/null +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/stop.cmd @@ -0,0 +1,3 @@ +@ECHO OFF + +taskkill /im SettleAccount.HttpApi.Host.exe /f /t \ No newline at end of file diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js index 3a842eab..5b5d1d57 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/components/list/index.js @@ -197,7 +197,7 @@ export default { @@ -383,14 +383,13 @@ export default { const columns = ref([]); const filterDrawer = ref(false); const subDrawer = ref(false); - const subListQuery = ref({}); + const subListQuery = ref(props.query ?? {}); const tableLoading = ref(false); const selectedRows = ref([]); const dialogVisible = ref(false); const route = useRoute(); const router = useRouter(); const { t } = useI18n(); - const appStore = useAppStore(); // 注释一下代码暂停权限验证 // const buttons = ref(props.buttons ?? route.meta.children.filter((o) => o.meta.hasPermission)); // 添加下行代码暂停权限验证 @@ -704,14 +703,11 @@ export default { const showList = (value, nav, config) => { if (!subDrawer.value) { const targetRoute = router.getRoutes().find((o) => o.meta?.path === nav); - // subListQuery.value = { - // query: value, - // buttons: targetRoute.meta.children, - // config, - // }; - subListQuery.value.query = value; - subListQuery.value.buttons = targetRoute.meta.children; - subListQuery.value.config = config; + subListQuery.value = { + query: value, + buttons: targetRoute.meta.children, + config, + }; subDrawer.value = true; } }; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js index 022c98a4..bff1c136 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/views/base-data/job-item.js @@ -14,8 +14,8 @@ export default { console.log(item.path, item, rows); console.log(showList); const config = useConfig2(); - // config.query.schema.properties.filters.default[0].value = rows[0].id; - showList({ jobId: rows[0].id }, "/base-data/job-log", config); + config.query.schema.properties.filters.default[0].value = rows[0].id; + showList({ test: "test" }, "/base-data/job-log", config); }; return { config, onCommand }; }, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs new file mode 100644 index 00000000..5f5ee604 --- /dev/null +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Cronos; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Win.Sfs.SettleAccount.Entities.BQ.Vmi; + +namespace Win.Sfs.SettleAccount.Entities.BQ; + +public class JobHostdService : BackgroundService +{ + private readonly object _lockObj = new object(); + private readonly IServiceProvider _serviceProvider; + private CancellationToken _stoppingToken; + + public JobHostdService(IServiceProvider serviceProvider) + { + this._serviceProvider = serviceProvider; + } + + public static List ServiceTypes { get; private set; } + public ConcurrentDictionary> Jobs { get; } = new(); + + public static void AddService(IServiceCollection services) + { + ServiceTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(o => o.GetTypes()) + .Where(o => o.IsClass && !o.IsAbstract && o.IsAssignableTo(typeof(IJobService))) + .ToList(); + ServiceTypes.ForEach(o => + { + services.AddTransient(typeof(IJobService), o); + services.AddTransient(o); + }); + } + + public void AddJob(JobItem job) + { + lock (_lockObj) + { + if (!Jobs.Keys.Any(o => o.Id == job.Id)) + { + try + { + var source = new CancellationTokenSource(); + var token = source.Token; + var thread = new Thread(async () => + { + try + { + var expression = CronExpression.Parse(job.Cron, job.Cron.Split(' ').Length == 5 ? CronFormat.Standard : CronFormat.IncludeSeconds); + var serviceType = ServiceTypes.FirstOrDefault(o => o.FullName == job.Service); + if (serviceType != null) + { + while (!_stoppingToken.IsCancellationRequested && !token.IsCancellationRequested) + { + try + { + var now = DateTime.UtcNow; + var nextUtc = expression.GetNextOccurrence(now); + var span = nextUtc - now; + await Task.Delay(span.Value).ConfigureAwait(false); + Debug.WriteLine($"{job.Name} 定时任务开始执行"); + using var scope = this._serviceProvider.CreateScope(); + if (scope.ServiceProvider.GetService(serviceType) is IJobService jobService) + { + if (!job.IsDisabled) + { + var jobItem = this.GetJobItem(job.Id); + if (!jobItem.IsRunning) + { + this.JobItemStart(job.Id); + } + try + { + jobService.Invoke(); + this.JobItemSuccess(job.Id); + Debug.WriteLine($"{job.Name} 定时任务执行成功"); + } + catch (Exception ex) + { + Debug.WriteLine($"{job.Name} 定时任务执行失败:{ex.Message}"); + Console.WriteLine(ex.ToString()); + this.JobItemFaild(job.Id, ex); + } + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + }); + thread.IsBackground = true; + if (this.Jobs.TryAdd(job, new Tuple(source, thread))) + { + thread.Start(); + Debug.WriteLine($"{job.Name} 定时任务线程启动"); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + } + } + + private void JobItemFaild(Guid id, Exception ex) + { + using var scope = this._serviceProvider.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var entity = db.Set().FirstOrDefault(o => o.Id == id); + if (entity != null) + { + entity.IsRunning = false; + var log = db.Set().FirstOrDefault(o => o.JobId == id); + log.End = DateTime.Now; + log.Success = false; + log.Exception = ex.ToString(); + db.SaveChanges(); + } + } + + private void JobItemSuccess(Guid id) + { + using var scope = this._serviceProvider.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var entity = db.Set().FirstOrDefault(o => o.Id == id); + if (entity != null) + { + entity.IsRunning = false; + var log = db.Set().FirstOrDefault(o => o.JobId == id); + log.End = DateTime.Now; + log.Success = true; + db.SaveChanges(); + } + } + + private void JobItemStart(Guid id) + { + using var scope = this._serviceProvider.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var entity = db.Set().FirstOrDefault(o => o.Id == id); + if (entity != null) + { + entity.IsRunning = true; + var log = db.Set().Add(new JobLog { Start = DateTime.Now, JobId = entity.Id }); + db.SaveChanges(); + } + } + + private JobItem GetJobItem(Guid id) + { + using var scope = this._serviceProvider.CreateScope(); + return scope.ServiceProvider.GetRequiredService().Set().AsNoTracking().FirstOrDefault(o => o.Id == id); + } + + public void RemoveJob(JobItem item) + { + lock (_lockObj) + { + var key = this.Jobs.Keys.FirstOrDefault(o => o.Id == item.Id); + if (key != null) + { + try + { + if (this.Jobs.TryRemove(key, out var value)) + { + value.Item1.Cancel(); + value.Item2.Interrupt(); + value.Item2.Join(); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + } + } + + protected override Task ExecuteAsync(CancellationToken stoppingToken) + { + this._stoppingToken = stoppingToken; + using var scope = this._serviceProvider.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var jobs = db.Set().AsNoTracking().ToList(); + jobs.ForEach(this.AddJob); + return Task.CompletedTask; + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs index 6a6f59b9..674596d1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Linq.Dynamic.Core; using System.Threading; @@ -20,145 +21,6 @@ using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ; -public class JobHostdService : BackgroundService -{ - private readonly object _lockObj = new object(); - private readonly IServiceProvider _serviceProvider; - private CancellationToken _stoppingToken; - - public JobHostdService(IServiceProvider serviceProvider) - { - this._serviceProvider = serviceProvider; - } - - public ConcurrentDictionary> Jobs { get; } = new(); - - public static List ServiceTypes { get; private set; } - - public static void AddService(IServiceCollection services) - { - ServiceTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(o => o.GetTypes()) - .Where(o => o.IsClass && !o.IsAbstract && o.IsAssignableTo(typeof(IJobService))) - .ToList(); - ServiceTypes.ForEach(o => - { - services.AddTransient(typeof(IJobService), o); - services.AddTransient(o); - }); - } - - public void AddJob(JobItem job) - { - lock (_lockObj) - { - if (!Jobs.Keys.Any(o => o.Id == job.Id)) - { - try - { - var source = new CancellationTokenSource(); - var token = source.Token; - var thread = new Thread(async () => - { - var expression = CronExpression.Parse(job.Cron); - using var scope1 = this._serviceProvider.CreateScope(); - var serviceType = ServiceTypes.FirstOrDefault(o => o.FullName == job.Service); - if (serviceType != null) - { - while (!_stoppingToken.IsCancellationRequested && !token.IsCancellationRequested) - { - - try - { - var nextUtc = expression.GetNextOccurrence(DateTime.UtcNow); - var span = nextUtc - DateTime.UtcNow; - await Task.Delay(span.Value).ConfigureAwait(false); - using var scope = this._serviceProvider.CreateScope(); - if (scope.ServiceProvider.GetService(serviceType) is IJobService jobService) - { - var db = scope.ServiceProvider.GetService(); - var jobItemRepository = db.Set(); - var jobLogRepository = db.Set(); - var jobItem = jobItemRepository.FirstOrDefault(o => o.Id == job.Id); - if (!jobItem.IsDisabled) - { - jobItem.IsRunning = true; - db.SaveChanges(); - var jobLog = new JobLog { JobId = job.Id, Start = DateTime.Now }; - try - { - jobService.Invoke(); - jobLog.Success = true; - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - jobLog.Exception = ex.ToString(); - } - finally - { - jobLog.End = DateTime.Now; - jobLogRepository.Add(jobLog); - jobItem.IsRunning = false; - db.SaveChanges(); - } - } - } - } - catch (Exception) - { - throw; - } - } - } - }); - thread.IsBackground = true; - if (this.Jobs.TryAdd(job, new Tuple(source, thread))) - { - thread.Start(); - } - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - } - } - } - - public void RemoveJob(JobItem item) - { - lock (_lockObj) - { - var key = this.Jobs.Keys.FirstOrDefault(o => o.Id == item.Id); - if (key != null) - { - try - { - if (this.Jobs.TryRemove(key, out var value)) - { - value.Item1.Cancel(); - value.Item2.Interrupt(); - value.Item2.Join(); - } - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - } - } - } - - protected override Task ExecuteAsync(CancellationToken stoppingToken) - { - this._stoppingToken = stoppingToken; - using var scope = this._serviceProvider.CreateScope(); - var db = scope.ServiceProvider.GetRequiredService(); - var jobs = db.Set().AsNoTracking().ToList(); - jobs.ForEach(this.AddJob); - return Task.CompletedTask; - } -} [Route("api/settleaccount/[controller]/[action]")] public class JobItemAppService : ApplicationService, ITransientDependency diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index 582b0374..855d6be4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -75,7 +75,7 @@ public class VmiAppService : ApplicationService, IVmiService, IJobService, ITran using var dbContext = new VmiSqliteContext(connectionString); if (!dbContext.GetService().Exists() && dbContext.Database.EnsureCreated()) { - var list = this._balanceRepository.AsNoTracking().ToList(); + var list = this._balanceRepository.ToList(); foreach (var item in list) { dbContext.Set().Add(item); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index fac649ec..1af20c64 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -60,6 +60,7 @@ namespace Win.Sfs.SettleAccount builder.ConfigureTB_RePartsRelationship(options); //同步位置标记 builder.ConfigureSyncPositionFlag(options); + #endregion 基础数据 #region 北汽结算 @@ -1010,7 +1011,7 @@ namespace Win.Sfs.SettleAccount b.Property(x => x.BussiessType).HasMaxLength(50); b.Property(x => x.Extend1).HasMaxLength(50); b.Property(x => x.Extend2).HasMaxLength(50); - + b.Property(x => x.ConcurrencyStamp).HasMaxLength(50); }); } @@ -1281,7 +1282,7 @@ namespace Win.Sfs.SettleAccount }); //seed - builder.Entity().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiService" }); + builder.Entity().HasData(new JobItem("vmi".ToGuid()) { Name = "库存快照", Cron = "0 0 8 26 *", Service = "Win.Sfs.SettleAccount.Entities.BQ.VmiAppService" }); builder.Entity().HasData(new VmiCategory("发运入库".ToGuid()) { Type = VmiType.In, Name = "发运入库", Number = "100" }); builder.Entity().HasData(new VmiCategory("结算出库".ToGuid()) { Type = VmiType.Out, Name = "结算出库", Number = "200" }); builder.Entity().HasData(new VmiCategory("客户退货".ToGuid()) { Type = VmiType.Out, Name = "客户退货", Number = "300" }); From eb20f5b169904d39677efa8528db4331b32be2f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Fri, 28 Jul 2023 08:27:32 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index e1a8a522..60342a74 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -213,9 +213,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var notDetialList = new List(); var detailList = new List(); var invlist = new List(); - // string str = JsonConvert.SerializeObject(invoiceMap); - foreach (var itm in invoiceMap)//分组影响和 { var key = itm.Key;//发票票号 @@ -478,7 +476,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { groupList.AddRange(group1); } - var invbill = new INVOICE_GRP (guid: GuidGenerator.Create(), realnvBillNum: string.Empty,