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 e2b40529..740fb5a0 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
@@ -690,7 +690,7 @@ export default {
}
});
if (config.query.schema.properties.businessType.default) {
- formData.append("bussniType", config.query.schema.properties.businessType.default);
+ formData.append("businessType", config.query.schema.properties.businessType.default);
}
for (let i = 0; i < fileList.value.length; i++) {
formData.append(`files`, fileList.value[i].raw);
diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_sa_service.js b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_sa_service.js
index a56db239..61e89182 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_sa_service.js
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/wwwroot/models/pub_sa_service.js
@@ -21,7 +21,7 @@ const schema = {
};
const queryUrl = "settleaccount/pub_sa_service/get-list";
-const deleteUrl = "settleaccount/pub_sa_service/delete";
+const deleteUrl = "settleaccount/pub_sa_service/delete-list";
const importUrl = "settleaccount/pub_sa_service/import-by-business-type";
const queryMethod = "POST";
const deleteMethod = "POST";
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
new file mode 100644
index 00000000..5572831f
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs
@@ -0,0 +1,98 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Magicodes.ExporterAndImporter.Core;
+using Volo.Abp.Application.Dtos;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+
+///
+/// BBAC结算单
+///
+public class BBAC_SA_DTO : EntityDto
+{
+ ///
+ /// 期间
+ ///
+ [Display(Name = "期间")]
+ public int Version { get; set; }
+
+ ///
+ /// 结算单据
+ ///
+ [Display(Name = "结算单据")]
+ public string BillNum { get; set; }
+
+ ///
+ /// 出库单号
+ ///
+ [Display(Name = "出库单号")]
+ public string DNBillNum { get; set; }
+
+ ///
+ /// 1、新建 2、已有出库3、已有扣减寄售库
+ ///
+ [Display(Name = "状态")]
+ public string State { get; set; }
+
+ ///
+ /// 明细记录行数
+ ///
+ [Display(Name = "明细记录行数")]
+ public string RecordCount { get; set; }
+
+ ///
+ /// 工厂地点
+ ///
+ [Display(Name = "工厂地点")]
+ public string Site { get; set; }
+
+ ///
+ /// 业务类型
+ ///
+ [Display(Name = "业务类型")]
+ public EnumBusinessType BusinessType { get; set; }
+}
+
+///
+/// BBAC结算明细导入
+///
+public class BBAC_SA_DETAIL_IMPORT_DTO
+{
+ ///
+ /// 结算日期
+ ///
+ [Display(Name = "Posting Date")]
+ [ImporterHeader(Name = "Posting Date", Format = "yyyy/MM/dd HH:mm:ss")]
+ public DateTime SettleDate { set; get; }
+
+ ///
+ /// 结算分组号
+ ///
+ [Display(Name = "Reference")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ [ImporterHeader(Name = "Reference")]
+ public string GroupNum { get; set; }
+
+ ///
+ /// 客户零件号
+ ///
+ [Display(Name = "Material")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ [ImporterHeader(Name = "Material")]
+ public string LU { get; set; }
+
+ ///
+ /// 数量
+ ///
+ [Display(Name = "结算数量")]
+ [ImporterHeader(Name = "Qty")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 生产号
+ ///
+ [Display(Name = "External Call Number")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ [ImporterHeader(Name = "External Call Number")]
+ public string PN { get; set; }
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs
index a4523b04..9145bc23 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs
@@ -1,13 +1,14 @@
using System;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
+using Volo.Abp.Application.Dtos;
namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos;
///
/// HBPO结算单
///
-public class HBPO_SA_DTO
+public class HBPO_SA_DTO : EntityDto
{
///
/// 期间
@@ -60,7 +61,7 @@ public class HBPO_SA_DETAIL_IMPORT_DTO
///
/// 结算日期
///
- [Display(Name = "结算日期")]
+ [Display(Name = "ReceiveDate")]
[ImporterHeader(Name = "ReceiveDate", Format = "yyyy/MM/dd HH:mm:ss")]
public DateTime SettleDate { set; get; }
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
index 926de242..777f59b6 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs
@@ -145,6 +145,50 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos
public string GroupNum { get; set; }
}
+ ///
+ /// 买单件HBPO导入
+ ///
+ public class MaiDanJianHBPOImportDto
+ {
+ ///
+ /// 结算日期
+ ///
+ [Display(Name = "买单日期")]
+ [ImporterHeader(Name = "买单日期")]
+ public DateTime SettleDate { set; get; }
+
+ ///
+ /// 零件号
+ ///
+ [Display(Name = "零件号")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ [ImporterHeader(Name = "零件号")]
+ public string LU { get; set; }
+
+ ///
+ /// 生产号
+ ///
+ [Display(Name = "现产品生产号")]
+ [ImporterHeader(Name = "现产品生产号")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ public string PN { get; set; }
+
+ ///
+ /// 数量
+ ///
+ [Display(Name = "数量")]
+ [ImporterHeader(Name = "数量")]
+ public decimal Qty { get; set; }
+
+ ///
+ /// 结算分组号
+ ///
+ [Display(Name = "五联单号")]
+ [ImporterHeader(Name = "五联单号")]
+ [Required(ErrorMessage = "{0}不能为空")]
+ public string GroupNum { get; set; }
+ }
+
///
/// 备件导入
///
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
new file mode 100644
index 00000000..8e524c32
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
@@ -0,0 +1,441 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.LinqAsync;
+using System.Threading.Tasks;
+using AutoMapper;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using SettleAccount.Domain.BQ;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Caching;
+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.Prices;
+using Win.Sfs.SettleAccount.ExcelImporter;
+using Win.Sfs.SettleAccount.ExportReports;
+using Win.Sfs.SettleAccount.MaterialRelationships;
+using Win.Sfs.Shared.RepositoryBase;
+
+namespace Win.Sfs.SettleAccount.Entities.BQ;
+
+///
+/// JISBBAC结算
+///
+[AllowAnonymous]
+[Route("api/settleaccount/[controller]/[action]")]
+public class BBAC_SA_SERVICE : SettleAccountApplicationBase
+{
+ ///
+ /// BBAC结算仓储
+ ///
+ private readonly INormalEfCoreRepository _bbacSaRepository;
+
+ ///
+ /// BBAC结算明细仓储
+ ///
+ private readonly INormalEfCoreRepository _bbacSaDetailRepository;
+
+ ///
+ /// BBAC可结算仓储
+ ///
+ private readonly INormalEfCoreRepository _bbacCanSaRepository;
+
+ ///
+ /// BBAC可结算明细仓储
+ ///
+ private readonly INormalEfCoreRepository _bbacCanSaDetailRepository;
+
+ ///
+ /// BBAC不可结算明细仓储
+ ///
+ private readonly INormalEfCoreRepository _bbacNotSaDetailRepository;
+
+ ///
+ /// 销售价格仓储
+ ///
+ private readonly INormalEfCoreRepository _priceListRepository;
+
+ ///
+ /// 客户零件关系仓储
+ ///
+ private readonly INormalEfCoreRepository _materialRelationshipRepository;
+
+ ///
+ /// 替换件关系仓储
+ ///
+ private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository;
+
+ ///
+ /// 业务类型
+ ///
+ private readonly EnumBusinessType _businessType = EnumBusinessType.JisBBAC;
+
+ ///
+ /// 构造
+ ///
+ public BBAC_SA_SERVICE(INormalEfCoreRepository bbacSaRepository,
+ INormalEfCoreRepository bbacSaDetailRepository,
+ INormalEfCoreRepository bbacCanSaRepository,
+ INormalEfCoreRepository bbacCanSaDetailRepository,
+ INormalEfCoreRepository bbacNotSaDetailRepository,
+ INormalEfCoreRepository priceListRepository,
+ INormalEfCoreRepository materialRelationshipRepository,
+ INormalEfCoreRepository tbRePartsRelationshipRepository,
+ IDistributedCache cache,
+ IExcelImportAppService excelImportService,
+ ISnowflakeIdGenerator snowflakeIdGenerator,
+ ICommonManager commonManager
+ ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
+ {
+ _bbacSaRepository = bbacSaRepository;
+ _bbacSaDetailRepository = bbacSaDetailRepository;
+ _bbacCanSaRepository = bbacCanSaRepository;
+ _bbacCanSaDetailRepository = bbacCanSaDetailRepository;
+ _bbacNotSaDetailRepository = bbacNotSaDetailRepository;
+ _priceListRepository = priceListRepository;
+ _materialRelationshipRepository = materialRelationshipRepository;
+ _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository;
+ }
+
+ #region 导入、导出
+ ///
+ /// 导入
+ ///
+ [HttpPost]
+ public async Task ImportAsync([FromForm] IFormFileCollection files)
+ {
+ #region 导入数据转换、数据校验
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ var importHBOPSaDetails = ObjectMapper.Map, List>(result);
+
+ //Site包含CN1 亦庄
+ //Site包含CN5 顺义
+ var importCN1HBOPSaDetails = importHBOPSaDetails.FindAll(t => t.Site.Contains("CN1"));
+ var importCN5HBOPSaDetails = importHBOPSaDetails.FindAll(t => t.Site.Contains("CN5"));
+
+ //数据校验
+ var checkList = new List();
+ //结算分组号
+ var bbacSaGroupNums = importHBOPSaDetails.Select(t => t.GroupNum).Distinct();
+ //已存在的结算分组号
+ var havBBACSaGroupNums = (await _bbacSaDetailRepository.GetListAsync(t => bbacSaGroupNums.Contains(t.GroupNum))).Select(t => t.GroupNum).Distinct();
+ if (havBBACSaGroupNums.Any() == true)
+ {
+ foreach (var item in havBBACSaGroupNums)
+ {
+ checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty));
+ }
+ }
+
+ if (checkList.Count > 0)
+ {
+ return await ExportErrorReportAsync(checkList);
+ }
+ #endregion
+
+ if (importCN1HBOPSaDetails.Any())
+ {
+ await SaDataHandleAsync(importCN1HBOPSaDetails, "CN1");
+ }
+ if (importCN5HBOPSaDetails.Any())
+ {
+ await SaDataHandleAsync(importCN5HBOPSaDetails, "CN5");
+ }
+
+ return ApplicationConsts.SuccessStr;
+ }
+ #endregion
+
+ #region CURD
+ ///
+ /// 获取列表
+ ///
+ [HttpPost]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _bbacSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _bbacSaRepository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
+
+ ///
+ /// 删除
+ ///
+ [HttpPost]
+ public async Task DeleteAsync(Guid id)
+ {
+ //结算主表
+ BBAC_SA bbacSaDelEntity;
+ //结算明细
+ List bbacSaDetailDelEntitys;
+ //可结算主表
+ List bbacCanSaDelEntitys;
+ //可结算明细
+ List bbacCanSaDetailDelEntitys;
+ //不可结算
+ List bbacNotSaDetailDelEntitys;
+
+ bbacSaDelEntity = await _bbacSaRepository.FindAsync(id);
+ if (bbacSaDelEntity == null)
+ {
+ throw new UserFriendlyException($"未获取到结算单!", "400");
+ }
+ //结算单据
+ string bbacSaBillNum = bbacSaDelEntity.BillNum;
+
+ bbacCanSaDelEntitys = await _bbacCanSaRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum);
+ //验证可结算主表状态
+ if (bbacCanSaDelEntitys.Any(t => t.State != SettleBillState.未结状态))
+ {
+ throw new UserFriendlyException($"该单据可结算单状态无法删除!", "400");
+ }
+
+ bbacSaDetailDelEntitys = await _bbacSaDetailRepository.GetListAsync(t => t.BillNum == bbacSaBillNum);
+ bbacCanSaDetailDelEntitys = await _bbacCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum);
+ bbacNotSaDetailDelEntitys = await _bbacNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum);
+
+ //删除
+ await _bbacSaRepository.DeleteAsync(bbacSaDelEntity);
+ if (bbacSaDetailDelEntitys.Any())
+ {
+ await _bbacSaDetailRepository.DeleteManyAsync(bbacSaDetailDelEntitys);
+ }
+ if (bbacCanSaDelEntitys.Any())
+ {
+ await _bbacCanSaRepository.DeleteManyAsync(bbacCanSaDelEntitys);
+ }
+ if (bbacCanSaDetailDelEntitys.Any())
+ {
+ await _bbacCanSaDetailRepository.DeleteManyAsync(bbacCanSaDetailDelEntitys);
+ }
+ if (bbacNotSaDetailDelEntitys.Any())
+ {
+ await _bbacNotSaDetailRepository.DeleteManyAsync(bbacNotSaDetailDelEntitys);
+ }
+
+ }
+
+ ///
+ /// 删除
+ ///
+ [HttpPost]
+ public async Task DeleteListAsync(List ids)
+ {
+ //结算主表
+ List bbacSas = new List();
+ //结算明细
+ List bbacSaDetails = new List();
+ //可结算主表
+ List bbacCanSas = new List();
+ //可结算明细
+ List bbacCanSaDetails = new List();
+ //不可结算
+ List bbacNotSaDetails = new List();
+
+ foreach (var id in ids)
+ {
+ try
+ {
+ var bbacSaDelItems = await GetBBACSaDelItemsAsync(id);
+
+ bbacSas.AddRange(bbacSaDelItems.bbacSas);
+ bbacSaDetails.AddRange(bbacSaDelItems.bbacSaDetails);
+ bbacCanSas.AddRange(bbacSaDelItems.bbacCanSas);
+ bbacCanSaDetails.AddRange(bbacSaDelItems.bbacCanSaDetails);
+ bbacNotSaDetails.AddRange(bbacSaDelItems.bbacNotSaDetails);
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+
+ //删除
+ if (bbacSas.Any())
+ {
+ await _bbacSaRepository.DeleteManyAsync(bbacSas);
+ }
+ if (bbacSaDetails.Any())
+ {
+ await _bbacSaDetailRepository.DeleteManyAsync(bbacSaDetails);
+ }
+ if (bbacCanSas.Any())
+ {
+ await _bbacCanSaRepository.DeleteManyAsync(bbacCanSas);
+ }
+ if (bbacCanSaDetails.Any())
+ {
+ await _bbacCanSaDetailRepository.DeleteManyAsync(bbacCanSaDetails);
+ }
+ if (bbacNotSaDetails.Any())
+ {
+ await _bbacNotSaDetailRepository.DeleteManyAsync(bbacNotSaDetails);
+ }
+ }
+ #endregion
+
+ #region 私有方法
+ ///
+ /// 结算数据处理
+ ///
+ private async Task SaDataHandleAsync(List bbacSaDetails, string site)
+ {
+ //结算单号
+ var bbacSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA");
+ //结算主表
+ var bbacSa = new BBAC_SA()
+ {
+ BillNum = bbacSaBillNum,
+ State = "1",
+ Site = site,
+ };
+ //可结算单号
+ var bbacCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C");
+ //可结算主表
+ var bbacCanSa = new BBAC_CAN_SA()
+ {
+ BillNum = bbacCanSaBillNum,
+ SettleBillNum = bbacSaBillNum,
+ State = SettleBillState.未结状态,
+ BusinessType = _businessType,
+ Site = site,
+ };
+ //可结算明细
+ var bbacCanSaDetails = new List();
+ //不可结算明细
+ var bbacNotSaDetails = new List();
+ //客户零件关系
+ var materialRelationships = new List();
+
+ #region 处理结算数据
+ //销售价格
+ var priceListEntitys = await _priceListRepository.GetAllAsync();
+
+ bbacSaDetails.ForEach(bbacSaDetail =>
+ {
+ List luList = bbacSaDetail.LU.Split(" ").ToList();
+ bbacSaDetail.LU = luList[0].Replace(" ", "");
+ if (luList.Count > 1)
+ {
+ luList.RemoveAt(0);
+ var luAssemble = luList.Select(t => t.Replace(" ", ""));
+ bbacSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
+ }
+
+ bbacSaDetail.BillNum = bbacSaBillNum;
+ bbacSaDetail.KeyCode = bbacSaDetail.PN + bbacSaDetail.LU;
+
+ //根据物料号、结算日期获取价格
+ var priceListEntity = priceListEntitys.Find(t => t.LU == bbacSaDetail.LU && bbacSaDetail.SettleDate > t.BeginTime && bbacSaDetail.SettleDate < t.EndTime);
+ bbacSaDetail.Price = priceListEntity?.Price ?? default;
+ });
+
+ //导入的零件号集合
+ var importPubSaLUs = bbacSaDetails.Select(t => t.LU).Distinct();
+ var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode));
+ var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
+
+ /*
+ * (不存在的客户零件号)差集
+ * 转换为厂内零件号
+ * 转换规则6个空格替换成“-”
+ */
+ var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes);
+
+ noExistSettleMaterialCodes.ForEach(t =>
+ {
+ var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType.ToString());
+ materialRelationships.Add(materialRelationship);
+ });
+ #endregion
+
+ #region 入库数据赋值
+ //根据价格区分结算、不可结算
+ var bbacSaDetailsCanSes = bbacSaDetails.FindAll(t => t.Price != default);
+ var bbacSaDetailsNotCanSes = bbacSaDetails.FindAll(t => t.Price == default);
+
+ //可结算明细
+ bbacCanSaDetails = ObjectMapper.Map, List>(bbacSaDetailsCanSes);
+ //不可结算明细
+ bbacNotSaDetails = ObjectMapper.Map, List>(bbacSaDetailsNotCanSes);
+ #endregion
+
+ #region 添加入库
+ await _bbacSaRepository.InsertAsync(bbacSa);
+ await _bbacSaDetailRepository.InsertManyAsync(bbacSaDetails);
+ if (bbacCanSaDetails.Count > 0)
+ {
+ bbacCanSa.InvGroupNum = bbacCanSaDetails.Count.ToString();
+ bbacCanSaDetails.ForEach(bbacCanSaDetail =>
+ {
+ bbacCanSaDetail.BillNum = bbacCanSaDetail.InvGroupNum = bbacCanSaBillNum;
+ bbacCanSaDetail.BusinessType = _businessType;
+ });
+
+ await _bbacCanSaRepository.InsertAsync(bbacCanSa);
+ await _bbacCanSaDetailRepository.InsertManyAsync(bbacCanSaDetails);
+ }
+ if (bbacNotSaDetails.Count > 0)
+ {
+ bbacNotSaDetails.ForEach(bbacNotSaDetail =>
+ {
+ bbacNotSaDetail.BusinessType = _businessType;
+ });
+
+ await _bbacNotSaDetailRepository.InsertManyAsync(bbacNotSaDetails);
+ }
+ if (materialRelationships.Count > 0)
+ {
+ await _materialRelationshipRepository.InsertManyAsync(materialRelationships);
+ }
+ #endregion
+ }
+
+ ///
+ /// 获取结算关联项
+ ///
+ private async Task<(List bbacSas, List bbacSaDetails, List bbacCanSas, List bbacCanSaDetails, List bbacNotSaDetails)> GetBBACSaDelItemsAsync(Guid id)
+ {
+ //结算主表
+ List bbacSas = new List();
+ //结算明细
+ List bbacSaDetails = new List();
+ //可结算主表
+ List bbacCanSas = new List();
+ //可结算明细
+ List bbacCanSaDetails = new List();
+ //不可结算
+ List bbacNotSaDetails = new List();
+
+ var bbacSaEntity = await _bbacSaRepository.FirstOrDefaultAsync(t => t.Id.Equals(id));
+ if (bbacSaEntity != null)
+ {
+ //结算单据
+ string bbacSaBillNum = bbacSaEntity.BillNum;
+
+ bbacCanSas = await _bbacCanSaRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum);
+ //验证可结算主表状态
+ if (bbacCanSas.Any() && bbacCanSas.Any(t => t.State != SettleBillState.未结状态))
+ {
+ throw new UserFriendlyException($"{bbacSaBillNum} 该单据可结算单状态无法删除!", "400");
+ }
+
+ bbacSas.Add(bbacSaEntity);
+ bbacSaDetails = await _bbacSaDetailRepository.GetListAsync(t => t.BillNum == bbacSaBillNum);
+ bbacCanSaDetails = await _bbacCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum);
+ bbacNotSaDetails = await _bbacNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum);
+ }
+
+ return (bbacSas, bbacSaDetails, bbacCanSas, bbacCanSaDetails, bbacNotSaDetails);
+ }
+ #endregion
+}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
index 187cf6f4..317f2f88 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
@@ -1,28 +1,26 @@
+using System;
using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
using SettleAccount.Domain.BQ;
-using Volo.Abp.Application.Dtos;
-using Volo.Abp.Domain.Repositories;
using Volo.Abp;
-using Win.Sfs.SettleAccount.Entities.BQ.Dtos;
+using Volo.Abp.Application.Dtos;
using Volo.Abp.Caching;
using Win.Abp.Snowflakes;
using Win.Sfs.BaseData.ImportExcelCommon;
-using Win.Sfs.SettleAccount.CommonManagers;
-using Win.Sfs.SettleAccount.Entities.Prices;
-using Win.Sfs.SettleAccount.MaterialRelationships;
-using Win.Sfs.Shared.RepositoryBase;
-using System;
-using System.Linq;
-using Microsoft.AspNetCore.Http;
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.Prices;
using Win.Sfs.SettleAccount.ExcelImporter;
using Win.Sfs.SettleAccount.ExportReports;
-using OfficeOpenXml;
-using OfficeOpenXml.Core;
+using Win.Sfs.SettleAccount.MaterialRelationships;
+using Win.Sfs.Shared.RepositoryBase;
namespace Win.Sfs.SettleAccount.Entities.BQ;
@@ -73,6 +71,11 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
///
private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository;
+ ///
+ /// 业务类型
+ ///
+ private readonly EnumBusinessType _businessType = EnumBusinessType.JisHBPO;
+
///
/// 构造
///
@@ -107,10 +110,184 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
[HttpPost]
public async Task ImportAsync([FromForm] IFormFileCollection files)
{
- //业务类型
- var businessType = EnumBusinessType.JisHBPO;
+ #region 导入数据转换、数据校验
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ var importHBOPSaDetails = ObjectMapper.Map, List>(result);
+
+ //Site包含CN1 亦庄
+ //Site包含CN5 顺义
+ var importCN1HBOPSaDetails = importHBOPSaDetails.FindAll(t => t.Site.Contains("CN1"));
+ var importCN5HBOPSaDetails = importHBOPSaDetails.FindAll(t => t.Site.Contains("CN5"));
+
//数据校验
var checkList = new List();
+ //结算分组号
+ var hbpoSaGroupNums = importHBOPSaDetails.Select(t => t.GroupNum).Distinct();
+ //已存在的结算分组号
+ var havHBPOSaGroupNums = (await _hbpoSaDetailRepository.GetListAsync(t => hbpoSaGroupNums.Contains(t.GroupNum))).Select(t => t.GroupNum).Distinct();
+ if (havHBPOSaGroupNums.Any() == true)
+ {
+ foreach (var item in havHBPOSaGroupNums)
+ {
+ checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty));
+ }
+ }
+
+ if (checkList.Count > 0)
+ {
+ return await ExportErrorReportAsync(checkList);
+ }
+ #endregion
+
+ if (importCN1HBOPSaDetails.Any())
+ {
+ await SaDataHandleAsync(importCN1HBOPSaDetails, "CN1");
+ }
+ if (importCN5HBOPSaDetails.Any())
+ {
+ await SaDataHandleAsync(importCN5HBOPSaDetails, "CN5");
+ }
+
+ return ApplicationConsts.SuccessStr;
+ }
+ #endregion
+
+ #region CURD
+ ///
+ /// 获取列表
+ ///
+ [HttpPost]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _hbpoSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
+ var totalCount = await _hbpoSaRepository.GetCountByFilterAsync(input.Filters);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
+ }
+
+ ///
+ /// 删除
+ ///
+ [HttpPost]
+ public async Task DeleteAsync(Guid id)
+ {
+ //结算主表
+ HBPO_SA hbpoSaDelEntity;
+ //结算明细
+ List hbpoSaDetailDelEntitys;
+ //可结算主表
+ List hbpoCanSaDelEntitys;
+ //可结算明细
+ List hbpoCanSaDetailDelEntitys;
+ //不可结算
+ List hbpoNotSaDetailDelEntitys;
+
+ hbpoSaDelEntity = await _hbpoSaRepository.FindAsync(id);
+ if (hbpoSaDelEntity == null)
+ {
+ throw new UserFriendlyException($"未获取到结算单!", "400");
+ }
+ //结算单据
+ string hbpoSaBillNum = hbpoSaDelEntity.BillNum;
+
+ hbpoCanSaDelEntitys = await _hbpoCanSaRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
+ //验证可结算主表状态
+ if (hbpoCanSaDelEntitys.Any(t => t.State != SettleBillState.未结状态))
+ {
+ throw new UserFriendlyException($"该单据可结算单状态无法删除!", "400");
+ }
+
+ hbpoSaDetailDelEntitys = await _hbpoSaDetailRepository.GetListAsync(t => t.BillNum == hbpoSaBillNum);
+ hbpoCanSaDetailDelEntitys = await _hbpoCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
+ hbpoNotSaDetailDelEntitys = await _hbpoNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
+
+ //删除
+ await _hbpoSaRepository.DeleteAsync(hbpoSaDelEntity);
+ if (hbpoSaDetailDelEntitys.Any())
+ {
+ await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetailDelEntitys);
+ }
+ if (hbpoCanSaDelEntitys.Any())
+ {
+ await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSaDelEntitys);
+ }
+ if (hbpoCanSaDetailDelEntitys.Any())
+ {
+ await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetailDelEntitys);
+ }
+ if (hbpoNotSaDetailDelEntitys.Any())
+ {
+ await _hbpoNotSaDetailRepository.DeleteManyAsync(hbpoNotSaDetailDelEntitys);
+ }
+
+ }
+
+ ///
+ /// 删除
+ ///
+ [HttpPost]
+ public async Task DeleteListAsync(List ids)
+ {
+ //结算主表
+ List hbpoSas = new List();
+ //结算明细
+ List hbpoSaDetails = new List();
+ //可结算主表
+ List hbpoCanSas = new List();
+ //可结算明细
+ List hbpoCanSaDetails = new List();
+ //不可结算
+ List hbpoNotSaDetails = new List();
+
+ foreach (var id in ids)
+ {
+ try
+ {
+ var hbpoSaDelItems = await GetHBPOSaDelItemsAsync(id);
+
+ hbpoSas.AddRange(hbpoSaDelItems.hbpoSas);
+ hbpoSaDetails.AddRange(hbpoSaDelItems.hbpoSaDetails);
+ hbpoCanSas.AddRange(hbpoSaDelItems.hbpoCanSas);
+ hbpoCanSaDetails.AddRange(hbpoSaDelItems.hbpoCanSaDetails);
+ hbpoNotSaDetails.AddRange(hbpoSaDelItems.hbpoNotSaDetails);
+ }
+ catch (Exception)
+ {
+ throw;
+ }
+ }
+
+ //删除
+ if (hbpoSas.Any())
+ {
+ await _hbpoSaRepository.DeleteManyAsync(hbpoSas);
+ }
+ if (hbpoSaDetails.Any())
+ {
+ await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetails);
+ }
+ if (hbpoCanSas.Any())
+ {
+ await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSas);
+ }
+ if (hbpoCanSaDetails.Any())
+ {
+ await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetails);
+ }
+ if (hbpoNotSaDetails.Any())
+ {
+ await _hbpoNotSaDetailRepository.DeleteManyAsync(hbpoNotSaDetails);
+ }
+ }
+ #endregion
+
+ #region 私有方法
+ ///
+ /// 结算数据处理
+ ///
+ private async Task SaDataHandleAsync(List hbpoSaDetails, string site)
+ {
//结算单号
var hbpoSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA");
//结算主表
@@ -118,10 +295,9 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
{
BillNum = hbpoSaBillNum,
State = "1",
- BusinessType = businessType
+ BusinessType = _businessType,
+ Site = site,
};
- //结算明细
- var hbpoSaDetails = new List();
//可结算单号
var hbpoCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C");
//可结算主表
@@ -130,7 +306,8 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
BillNum = hbpoCanSaBillNum,
SettleBillNum = hbpoSaBillNum,
State = SettleBillState.未结状态,
- BusinessType = businessType
+ BusinessType = _businessType,
+ Site = site,
};
//可结算明细
var hbpoCanSaDetails = new List();
@@ -139,61 +316,32 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
//客户零件关系
var materialRelationships = new List();
- #region 导入数据转换、数据校验
- ExportImporter _exportImporter = new ExportImporter();
- var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
- var importPubSaDetails = ObjectMapper.Map, List>(result);
-
- return "";
-
- //结算分组号
- var hbpoSaGroupNums = importPubSaDetails.Select(t => t.GroupNum).Distinct();
-
- //已存在的结算分组号
- var havPubSaGroupNums = (await _hbpoSaDetailRepository.GetListAsync(t => hbpoSaGroupNums.Contains(t.GroupNum))).Select(t => t.GroupNum).Distinct();
- if (havPubSaGroupNums.Any() == true)
- {
- foreach (var item in havPubSaGroupNums)
- {
- checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty));
- }
- //throw new UserFriendlyException($"导入失败,结算分组号({string.Join(",", havPubSaGroupNums)})已存在", "400");
- }
-
- if (checkList.Count > 0)
- {
- return await ExportErrorReportAsync(checkList);
- }
- #endregion
-
-
#region 处理结算数据
//销售价格
var priceListEntitys = await _priceListRepository.GetAllAsync();
- importPubSaDetails.ForEach(importPubSaDetail =>
+ hbpoSaDetails.ForEach(hbpoSaDetail =>
{
- List luList = importPubSaDetail.LU.Split(" ").ToList();
- importPubSaDetail.LU = luList[0].Replace(" ", "");
+ List luList = hbpoSaDetail.LU.Split(" ").ToList();
+ hbpoSaDetail.LU = luList[0].Replace(" ", "");
if (luList.Count > 1)
{
luList.RemoveAt(0);
var luAssemble = luList.Select(t => t.Replace(" ", ""));
- importPubSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
+ hbpoSaDetail.LU += luAssemble.Aggregate(" ", (current, index) => current + index);
}
- importPubSaDetail.BillNum = hbpoSaBillNum;
- //importPubSaDetail.Site = "XX工厂";
- importPubSaDetail.KeyCode = importPubSaDetail.PN + importPubSaDetail.LU;
+ hbpoSaDetail.BillNum = hbpoSaBillNum;
+ hbpoSaDetail.KeyCode = hbpoSaDetail.PN + hbpoSaDetail.LU;
//根据物料号、结算日期获取价格
- var priceListEntity = priceListEntitys.Find(t => t.LU == importPubSaDetail.LU && importPubSaDetail.SettleDate > t.BeginTime && importPubSaDetail.SettleDate < t.EndTime);
- importPubSaDetail.Price = priceListEntity?.Price ?? 0;
- importPubSaDetail.BusinessType = businessType;
+ var priceListEntity = priceListEntitys.Find(t => t.LU == hbpoSaDetail.LU && hbpoSaDetail.SettleDate > t.BeginTime && hbpoSaDetail.SettleDate < t.EndTime);
+ hbpoSaDetail.Price = priceListEntity?.Price ?? default;
+ hbpoSaDetail.BusinessType = _businessType;
});
//导入的零件号集合
- var importPubSaLUs = importPubSaDetails.Select(t => t.LU).Distinct();
+ var importPubSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct();
var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => importPubSaLUs.Contains(t.SettleMaterialCode));
var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct();
@@ -206,19 +354,15 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
noExistSettleMaterialCodes.ForEach(t =>
{
- var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, businessType.ToString());
+ var materialRelationship = new MaterialRelationship(GuidGenerator.Create(), t.Replace(" ", "-"), "", t, _businessType.ToString());
materialRelationships.Add(materialRelationship);
});
#endregion
#region 入库数据赋值
- //结算明细
- hbpoSaDetails = importPubSaDetails;
-
- //不可结算 结算分组号码(根据价格区分结算、不可结算)
- var hbpoNotSaGroupNums = hbpoSaDetails.FindAll(t => t.Price == default(decimal)).Select(t => t.GroupNum).Distinct();
- var hbpoSaDetailsCanSes = hbpoSaDetails.FindAll(t => hbpoNotSaGroupNums.Contains(t.GroupNum) == false);
- var hbpoSaDetailsNotCanSes = hbpoSaDetails.FindAll(t => hbpoNotSaGroupNums.Contains(t.GroupNum) == true);
+ //根据价格区分结算、不可结算
+ var hbpoSaDetailsCanSes = hbpoSaDetails.FindAll(t => t.Price != default);
+ var hbpoSaDetailsNotCanSes = hbpoSaDetails.FindAll(t => t.Price == default);
//可结算明细
hbpoCanSaDetails = ObjectMapper.Map, List>(hbpoSaDetailsCanSes);
@@ -235,7 +379,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
hbpoCanSaDetails.ForEach(hbpoCanSaDetail =>
{
hbpoCanSaDetail.BillNum = hbpoCanSaDetail.InvGroupNum = hbpoCanSaBillNum;
- hbpoCanSaDetail.BusinessType = businessType;
+ hbpoCanSaDetail.BusinessType = _businessType;
});
await _hbpoCanSaRepository.InsertAsync(hbpoCanSa);
@@ -245,7 +389,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
{
hbpoNotSaDetails.ForEach(hbpoNotSaDetail =>
{
- hbpoNotSaDetail.BusinessType = businessType;
+ hbpoNotSaDetail.BusinessType = _businessType;
});
await _hbpoNotSaDetailRepository.InsertManyAsync(hbpoNotSaDetails);
@@ -255,79 +399,44 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase
await _materialRelationshipRepository.InsertManyAsync(materialRelationships);
}
#endregion
-
- return ApplicationConsts.SuccessStr;
- }
- #endregion
-
- #region CURD
- ///
- /// 获取列表
- ///
- [HttpPost]
- public async Task> GetListAsync(RequestDto input)
- {
- var entities = await _hbpoSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true);
- var totalCount = await _hbpoSaRepository.GetCountByFilterAsync(input.Filters);
- var dtos = ObjectMapper.Map, List>(entities);
- return new PagedResultDto(totalCount, dtos);
}
///
- /// 删除
+ /// 获取结算关联项
///
- [HttpPost]
- public async Task DeleteAsync(Guid id)
+ private async Task<(List hbpoSas, List hbpoSaDetails, List hbpoCanSas, List hbpoCanSaDetails, List hbpoNotSaDetails)> GetHBPOSaDelItemsAsync(Guid id)
{
//结算主表
- HBPO_SA hbpoSaDelEntity;
+ List hbpoSas = new List();
//结算明细
- List hbpoSaDetailDelEntitys;
+ List hbpoSaDetails = new List();
//可结算主表
- List hbpoCanSaDelEntitys;
+ List hbpoCanSas = new List();
//可结算明细
- List hbpoCanSaDetailDelEntitys;
+ List hbpoCanSaDetails = new List();
//不可结算
- List hbpoNotSaDetailDelEntitys;
+ List hbpoNotSaDetails = new List();
- hbpoSaDelEntity = await _hbpoSaRepository.FindAsync(id);
- if (hbpoSaDelEntity == null)
+ var hbpoSaEntity = await _hbpoSaRepository.FirstOrDefaultAsync(t => t.Id.Equals(id));
+ if (hbpoSaEntity != null)
{
- throw new UserFriendlyException($"未获取到结算单!", "400");
- }
- //结算单据
- string hbpoSaBillNum = hbpoSaDelEntity.BillNum;
+ //结算单据
+ string hbpoSaBillNum = hbpoSaEntity.BillNum;
- hbpoCanSaDelEntitys = await _hbpoCanSaRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
- //验证可结算主表状态
- if (hbpoCanSaDelEntitys.Any(t => t.State != SettleBillState.未结状态))
- {
- throw new UserFriendlyException($"该单据可结算单状态无法删除!", "400");
- }
-
- hbpoSaDetailDelEntitys = await _hbpoSaDetailRepository.GetListAsync(t => t.BillNum == hbpoSaBillNum);
- hbpoCanSaDetailDelEntitys = await _hbpoCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
- hbpoNotSaDetailDelEntitys = await _hbpoNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
+ hbpoCanSas = await _hbpoCanSaRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
+ //验证可结算主表状态
+ if (hbpoCanSas.Any() && hbpoCanSas.Any(t => t.State != SettleBillState.未结状态))
+ {
+ throw new UserFriendlyException($"{hbpoSaBillNum} 该单据可结算单状态无法删除!", "400");
+ }
- //删除
- await _hbpoSaRepository.DeleteAsync(hbpoSaDelEntity);
- if (hbpoSaDetailDelEntitys.Any())
- {
- await _hbpoSaDetailRepository.DeleteManyAsync(hbpoSaDetailDelEntitys);
- }
- if (hbpoCanSaDelEntitys.Any())
- {
- await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSaDelEntitys);
- }
- if (hbpoCanSaDetailDelEntitys.Any())
- {
- await _hbpoCanSaDetailRepository.DeleteManyAsync(hbpoCanSaDetailDelEntitys);
- }
- if (hbpoNotSaDetailDelEntitys.Any())
- {
- await _hbpoNotSaDetailRepository.DeleteManyAsync(hbpoNotSaDetailDelEntitys);
+ hbpoSas.Add(hbpoSaEntity);
+ hbpoSaDetails = await _hbpoSaDetailRepository.GetListAsync(t => t.BillNum == hbpoSaBillNum);
+ hbpoCanSaDetails = await _hbpoCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
+ hbpoNotSaDetails = await _hbpoNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum);
}
+ return (hbpoSas, hbpoSaDetails, hbpoCanSas, hbpoCanSaDetails, hbpoNotSaDetails);
}
#endregion
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
index 75c4e6cb..76829264 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
@@ -110,7 +110,6 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
public async Task ImportByBusinessTypeAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto)
{
string result = string.Empty;
- //return await ImportAsync(pubSaImportRequestDto.Files, pubSaImportRequestDto.BusinessType);
switch (pubSaImportRequestDto.BusinessType)
{
case EnumBusinessType.None:
@@ -128,6 +127,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
case EnumBusinessType.MaiDanJianBBAC:
break;
case EnumBusinessType.MaiDanJianHBPO:
+ result = await ImportMaiDanJianHBPOAsync(pubSaImportRequestDto.Files);
break;
case EnumBusinessType.BeiJian:
result = await ImportBeiJianAsync(pubSaImportRequestDto.Files);
@@ -476,6 +476,34 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianHBPO);
}
+ ///
+ /// 买单件HBPO导入
+ ///
+ private async Task ImportMaiDanJianHBPOAsync([FromForm] IFormFileCollection files)
+ {
+ #region 导入数据转换
+ ExportImporter _exportImporter = new ExportImporter();
+ var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService);
+
+ importResults.ForEach(importResult =>
+ {
+ importResult.SettleDate = DateTime.Now;
+ });
+
+ var importPubSaDetails = ObjectMapper.Map, List>(importResults);
+ #endregion
+
+ #region 数据校验
+ var checkList = await CheckAsync(importPubSaDetails);
+ if (checkList.Count > 0)
+ {
+ return await ExportErrorReportAsync(checkList);
+ }
+ #endregion
+
+ return await SaDataHandleAsync(importPubSaDetails, EnumBusinessType.BeiJian);
+ }
+
///
/// 备件导入
///
@@ -505,7 +533,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase
}
///
- /// 备件导入
+ /// 印度件导入
///
private async Task ImportYinDuJianAsync([FromForm] IFormFileCollection files)
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
index 053b9c19..c23bba28 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
@@ -1023,6 +1023,7 @@ namespace Win.Sfs.SettleAccount
CreateMap();
CreateMap();
CreateMap();
+ CreateMap();
CreateMap();
CreateMap();
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SA.cs
index 6755f078..4448a17c 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SA.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SA.cs
@@ -7,7 +7,7 @@ namespace SettleAccount.Domain.BQ;
[Display(Name = "BBAC结算导入")]
-public class BBAC_SA:FullAuditedAggregateRoot
+public class BBAC_SA : AuditedAggregateRoot
{
[Display(Name = "期间")]
public int Version { get; set; }
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803033051_20230803-1.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803033051_20230803-1.Designer.cs
new file mode 100644
index 00000000..c843a68a
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803033051_20230803-1.Designer.cs
@@ -0,0 +1,5120 @@
+//
+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("20230803033051_20230803-1")]
+ partial class _202308031
+ {
+ 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("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_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("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("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("Batch")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("BillCharacter")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BillTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CodeType")
+ .HasColumnType("nvarchar(max)");
+
+ 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("DeliverCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ErpToLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("FromLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("InjectionCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("MESConfigCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MatchNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Num")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Oper")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrderNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrigiCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PjsNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Position")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RealCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RefBillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RefVinCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Remark")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Seq")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SeqNumber")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ShippingDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ToLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UniqueCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.Property("VinCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("WmsBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SE_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SE_EDI", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssemblyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BeginDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property