diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
index f0499808..f0ada4a6 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
@@ -3,12 +3,14 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Shouldly;
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;
@@ -17,436 +19,451 @@ using Win.Sfs.SettleAccount.ExportReports;
using Win.Sfs.SettleAccount.MaterialRelationships;
using Win.Sfs.Shared.RepositoryBase;
-namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships
+namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships;
+
+///
+/// 客户零件关系
+///
+[AllowAnonymous]
+[Route("api/settleaccount/[controller]/[action]")]
+public class MaterialRelationshipAppService : SettleAccountApplicationBase
{
///
- /// 客户零件关系
+ /// 客户零件关系仓储
///
- [AllowAnonymous]
- [Route("api/settleaccount/[controller]/[action]")]
- public class MaterialRelationshipAppService : SettleAccountApplicationBase
+ private readonly INormalEfCoreRepository _repository;
+
+ ///
+ /// 构造
+ ///
+ public MaterialRelationshipAppService(
+ INormalEfCoreRepository repository,
+ IDistributedCache cache,
+ IExcelImportAppService excelImportService,
+ ISnowflakeIdGenerator snowflakeIdGenerator,
+ ICommonManager commonManager
+ ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
{
- ///
- /// 客户零件关系仓储
- ///
- private readonly INormalEfCoreRepository _repository;
-
- ///
- /// 构造
- ///
- public MaterialRelationshipAppService(
- INormalEfCoreRepository repository,
- IDistributedCache cache,
- IExcelImportAppService excelImportService,
- ISnowflakeIdGenerator snowflakeIdGenerator,
- ICommonManager commonManager
- ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager)
- {
- _repository = repository;
- }
+ _repository = repository;
+ }
- #region 导入、导出
- ///
- /// 导入
- ///
- [HttpPost]
- public async Task ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto)
- {
- var _exportImporter = new ExportImporter();
- var result = await _exportImporter.UploadExcelImport(materialRelationshipImportRequestDto.Files, _excelImportService).ConfigureAwait(false);
- var _ls = ObjectMapper.Map, List>(result);
- List _errorList = new List();
- var checkList = new List();
+ #region 导入、导出
+ ///
+ /// 导入
+ ///
+ [HttpPost]
+ public async Task ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto)
+ {
+ var exportImporter = new ExportImporter();
+ var inportDatas = await exportImporter.UploadExcelImport(materialRelationshipImportRequestDto.Files, _excelImportService).ConfigureAwait(false);
+ var entitys = ObjectMapper.Map, List>(inportDatas);
+ var errorList = new List();
+ var checkList = new List();
- if (_ls.Count > 0)
- {
- var query = from arc in _ls
- group arc by new { arc.SettleMaterialCode }
- into g
- where g.Count() > 1
- select g;
- foreach (var itm in query)
- {
- checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("客户物料号{0}有重复", itm.Key.SettleMaterialCode), string.Empty));
- }
- }
- if (checkList.Count > 0)
+ if (entitys.Count > 0)
+ {
+ var query = from arc in entitys
+ group arc by new { arc.SettleMaterialCode }
+ into g
+ where g.Count() > 1
+ select g;
+ foreach (var itm in query)
{
- string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false);
- return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName });
+ checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("客户物料号{0}有重复", itm.Key.SettleMaterialCode), string.Empty));
}
- foreach (var itm in _ls)
+ }
+ if (checkList.Count > 0)
+ {
+ string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false);
+ return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName });
+ }
+ foreach (var item in entitys)
+ {
+ var entity = _repository.FirstOrDefault(p => p.ErpMaterialCode == item.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian && p.SettleMaterialCode == item.SettleMaterialCode);
+ if (entity == null)
{
- var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian);
- if (_first != null)
- {
- _first.Update(itm.MaterialDesc, itm.SettleMaterialCode);
- await _repository.UpdateAsync(_first).ConfigureAwait(false);
- }
- else
- {
- itm.BusinessType = EnumBusinessType.BeiJian;
- await _repository.InsertAsync(itm).ConfigureAwait(false);
- }
+ item.BusinessType = EnumBusinessType.BeiJian;
+ await _repository.InsertAsync(item).ConfigureAwait(false);
}
- return new JsonResult(new { Code = 200, Message = "导入成功" });
}
+ return new JsonResult(new { Code = 200, Message = "导入成功" });
+ }
- ///
- /// 导出
- ///
- [HttpPost]
- public async Task ExportAsync(RequestDto input)
- {
- string fileName = $"客户零件关系_{Guid.NewGuid()}.xlsx";
- var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false);
- var dtos = ObjectMapper.Map, List>(entities);
+ ///
+ /// 导出
+ ///
+ [HttpPost]
+ public async Task ExportAsync(RequestDto input)
+ {
+ string fileName = $"客户零件关系_{Guid.NewGuid()}.xlsx";
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false);
+ var dtos = ObjectMapper.Map, List>(entities);
- ExportImporter _exportImporter = new ExportImporter();
- var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false);
- result.ShouldNotBeNull();
+ ExportImporter _exportImporter = new ExportImporter();
+ var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false);
+ result.ShouldNotBeNull();
- await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false);
- return fileName;
- }
- #endregion
-
- #region CURD
- ///
- /// 获取列表
- ///
- [HttpPost]
- public async Task> GetListAsync(RequestDto input)
- {
- var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
- var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
- var dtos = ObjectMapper.Map, List>(entities);
- return new PagedResultDto(totalCount, dtos);
- }
- #endregion
-
- #region 原方法(废弃)
- /////
- ///// 导入功能
- /////
- ///// 上传的文件(前端已经限制只能上传一个附件)
- /////
- //[HttpPost]
- //[Route("ExcelImport-Map")]
- //[DisableRequestSizeLimit]
- //public async Task MaterialRelationshipUploadExcelImportMap([FromForm] IFormFileCollection files)
- //{
- // ExportImporter _exportImporter = new ExportImporter();
- // var mapList = _mapRepository.Where(p => p.ProjectName == SettleAccountModuleName.MaterialRelationship).ToList();
- // var result = await _exportImporter.ExtendExcelImport(files, _excelImportService, mapList);
- // var _ls = ObjectMapper.Map, List>(result);
- // List _errorList = new List();
- // var checkList = new List();
- // if (_ls.Count > 0)
- // {
- // var query = from arc in _ls
- // group arc by new { arc.ErpMaterialCode }
- // into g
- // where g.Count() > 1
-
- // select g;
- // foreach (var itm in query)
- // {
- // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
- // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode));
- // }
- // }
- // foreach (var itm in _ls)
- // {
- // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode);
- // if (_first != null)
- // {
- // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode);
- // await _repository.UpdateAsync(_first);
- // }
- // else
- // {
- // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty));
- // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode));
- // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
- // //await _repository.InsertAsync(itm);
- // }
- // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
-
- // }
- // if (checkList.Count > 0)
- // {
- // return await ExportErrorReportAsync(checkList);
- // }
-
- // return ApplicationConsts.SuccessStr;
- //}
-
- /////
- ///// 导入功能
- /////
- ///// 上传的文件(前端已经限制只能上传一个附件)
- /////
- //[HttpPost]
- //[Route("ExcelImport")]
- //[DisableRequestSizeLimit]
- //public async Task MaterialRelationshipUploadExcelImport([FromForm] IFormFileCollection files)
- //{
-
- // ExportImporter _exportImporter = new ExportImporter();
- // var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
- // var _ls = ObjectMapper.Map, List>(result);
- // List _errorList = new List();
- // var checkList = new List();
-
- // if (_ls.Count > 0)
- // {
- // var query = from arc in _ls
- // group arc by new { arc.ErpMaterialCode }
- // into g
- // where g.Count() > 1
-
- // select g;
- // foreach (var itm in query)
- // {
- // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
- // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode));
- // }
- // }
- // foreach (var itm in _ls)
- // {
- // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode);
- // if (_first != null)
- // {
- // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode);
- // await _repository.UpdateAsync(_first);
- // }
- // else
- // {
- // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty));
- // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode));
- // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
- // //await _repository.InsertAsync(itm);
- // }
- // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
-
- // }
- // if (checkList.Count > 0)
- // {
- // return await ExportErrorReportAsync(checkList);
- // }
-
- // return ApplicationConsts.SuccessStr;
- //}
-
- /////
- ///// 按ID获取唯一实体
- /////
- /////
- ///// 返回实体全部属性
- /////
- ///// ID
- ///// 实体DTO
- //[HttpGet]
- //[Route("{id}")]
- //virtual public async Task GetAsync(Guid id)
- //{
- // var result = await GetFromCacheAsync(id);
- // var dto = ObjectMapper.Map(result);
- // return dto;
- //}
-
- //private async Task GetFromCacheAsync(Guid id)
- //{
- // var result = await _repository.GetAsync(id);
-
- // return result;
- //}
-
- //private async Task GetCountAsync(MaterialRelationshipRequestDto input)
- //{
- // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
- //}
-
- ///////
-
- /////
- ///// 根据筛选条件获取实体列表
- /////
- /////
- ///// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
- /////
- ///// 请求条件
- ///// 实体DTO列表
- //[HttpPost]
- //[Route("list")]
- //virtual public async Task> GetListAsync(MaterialRelationshipRequestDto input)
- //{
- // var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
- // input.SkipCount, true);
-
- // var totalCount = await GetCountAsync(input);
- // var dtos = ObjectMapper.Map, List>(entities);
-
- // return new PagedResultDto(totalCount, dtos);
- //}
-
- /////
- ///// 获取实体总数
- /////
- ///// 实体总数
- //[HttpGet]
- //[Route("count")]
- //virtual public async Task GetTotalCountAsync(Guid branchId)
- //{
- // return await _repository.GetCountAsync(branchId);
- //}
-
- /////
- ///// 获取全部实体列表
- /////
- ///// 实体DTO列表
- //[HttpGet]
- //[Route("all")]
- //virtual public async Task> GetAllAsync(Guid branchId)
- //{
- // var entities = await _repository.GetAllAsync(branchId, true);
-
- // var dtos = ObjectMapper.Map, List>(entities);
-
- // return new ListResultDto(dtos);
- //}
-
- /////
- ///// 新增实体
- /////
- ///// 新增实体DTO
- ///// 实体DTO
-
- //[HttpPost]
- //[Route("")]
- //virtual public async Task CreateAsync(MaterialRelationshipCreateDto input)
- //{
-
- // var _first = _repository.Where(p => p.ErpMaterialCode == input.ErpMaterialCode).FirstOrDefault();
-
- // if (_first != null)
- // {
- // throw new BusinessException("001", "已经存数据请修改后创建");
- // }
-
- // var entity = new MaterialRelationship(
- // GuidGenerator.Create(),
- // input.BranchId,
- // input.ErpMaterialCode,
-
- // input.MaterialDesc,
- // input.MaterialProperty,
- // input.SettleMaterialCode,
- // input.ShipMaterailCode,
- // input.AppraisalCategory
-
- // );
-
- // await _repository.InsertAsync(entity);
-
- // ////create cache
- // //await Cache.SetAsync(entity.Id.ToString(), entity,
- // // CacheStrategyConst.FIVE_MINUTES);
-
- // var dto = ObjectMapper.Map(entity);
- // return dto;
-
- //}
-
- /////
- ///// 修改实体
- /////
- ///// ID
- ///// 修改实体DTO
- ///// 实体DTO
- //[HttpPut]
- //[Route("{id}")]
- //virtual public async Task UpdateAsync(Guid id, MaterialRelationshipUpdateDto input)
- //{
- // var entity = await _repository.GetAsync(id);
- // if (entity != null)
- // {
- // entity.Update(input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode);
-
- // await _repository.UpdateAsync(entity);
-
- // var dto = ObjectMapper.Map(entity);
- // return dto;
- // }
- // else
- // {
- // return null;
- // }
-
- //}
-
- /////
- ///// 删除实体
- /////
- ///// ID
- ///// 无
- //[HttpDelete]
- //[Route("{id}")]
- //virtual public async Task DeleteAsync(Guid id)
- //{
- // var entity = await GetFromCacheAsync(id);
- // await Cache.DeleteAsync(id.ToString());
- // await _repository.DeleteAsync(id);
- //}
-
- /////
- ///// 按IDs删除实体列表
- /////
- ///// IDs
- ///// 是否执行成功
- //[HttpPost]
- //[Route("delete")]
- //virtual public async Task DeleteListAsync(List ids)
- //{
- // var _query = _repository.Where(p => ids.Contains(p.Id));
- // int i = await _query.BatchDeleteAsync();
-
- // if (i == 0)
- // {
- // return false;
- // }
- // return true;
- //}
- //[HttpPost]
- //[Route("Export")]
- //virtual public async Task ExportAsync(MaterialRelationshipRequestDto input)
- //{
- // //var _userId = CurrentUser.Id.Value.ToString();
- // string _fileName = string.Format("零件关系_{0}.xlsx", Guid.NewGuid().ToString());
- // var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
- // 0, true);
-
- // var dtoDetails = ObjectMapper.Map, List>(entities);
-
- // //声明导出容器
- // ExportImporter _exportImporter = new ExportImporter();
-
- // var result = await _exportImporter.ExcelExporter(dtoDetails);
-
- // result.ShouldNotBeNull();
-
- // //保存导出文件到服务器存成二进制
- // await _excelImportService.SaveBlobAsync(
- // new SaveExcelImportInputDto
- // {
- // Name = _fileName,
- // Content = result
- // }
- // );
- // return _fileName;
- //}
- #endregion
+ await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false);
+ return fileName;
+ }
+ #endregion
+ #region CURD
+ ///
+ /// 获取列表
+ ///
+ [HttpPost]
+ public async Task> GetListAsync(RequestDto input)
+ {
+ var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false);
+ var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false);
+ var dtos = ObjectMapper.Map, List>(entities);
+ return new PagedResultDto(totalCount, dtos);
}
+ #endregion
+
+ #region 原方法(废弃)
+ /////
+ ///// 导入功能
+ /////
+ ///// 上传的文件(前端已经限制只能上传一个附件)
+ /////
+ //[HttpPost]
+ //[Route("ExcelImport-Map")]
+ //[DisableRequestSizeLimit]
+ //public async Task MaterialRelationshipUploadExcelImportMap([FromForm] IFormFileCollection files)
+ //{
+ // ExportImporter _exportImporter = new ExportImporter();
+ // var mapList = _mapRepository.Where(p => p.ProjectName == SettleAccountModuleName.MaterialRelationship).ToList();
+ // var result = await _exportImporter.ExtendExcelImport(files, _excelImportService, mapList);
+ // var _ls = ObjectMapper.Map, List>(result);
+ // List _errorList = new List();
+ // var checkList = new List();
+ // if (_ls.Count > 0)
+ // {
+ // var query = from arc in _ls
+ // group arc by new { arc.ErpMaterialCode }
+ // into g
+ // where g.Count() > 1
+
+ // select g;
+ // foreach (var itm in query)
+ // {
+ // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
+ // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode));
+ // }
+ // }
+ // foreach (var itm in _ls)
+ // {
+ // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode);
+ // if (_first != null)
+ // {
+ // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode);
+ // await _repository.UpdateAsync(_first);
+ // }
+ // else
+ // {
+ // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty));
+ // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode));
+ // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
+ // //await _repository.InsertAsync(itm);
+ // }
+ // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
+
+ // }
+ // if (checkList.Count > 0)
+ // {
+ // return await ExportErrorReportAsync(checkList);
+ // }
+
+ // return ApplicationConsts.SuccessStr;
+ //}
+
+
+
+ /////
+ ///// 导入功能
+ /////
+ ///// 上传的文件(前端已经限制只能上传一个附件)
+ /////
+ //[HttpPost]
+ //[Route("ExcelImport")]
+ //[DisableRequestSizeLimit]
+ //public async Task MaterialRelationshipUploadExcelImport([FromForm] IFormFileCollection files)
+ //{
+
+
+ // ExportImporter _exportImporter = new ExportImporter();
+ // var result = await _exportImporter.UploadExcelImport(files, _excelImportService);
+ // var _ls = ObjectMapper.Map, List>(result);
+ // List _errorList = new List();
+ // var checkList = new List();
+
+ // if (_ls.Count > 0)
+ // {
+ // var query = from arc in _ls
+ // group arc by new { arc.ErpMaterialCode }
+ // into g
+ // where g.Count() > 1
+
+ // select g;
+ // foreach (var itm in query)
+ // {
+ // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty));
+ // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode));
+ // }
+ // }
+ // foreach (var itm in _ls)
+ // {
+ // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode);
+ // if (_first != null)
+ // {
+ // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode);
+ // await _repository.UpdateAsync(_first);
+ // }
+ // else
+ // {
+ // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty));
+ // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode));
+ // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
+ // //await _repository.InsertAsync(itm);
+ // }
+ // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create());
+
+ // }
+ // if (checkList.Count > 0)
+ // {
+ // return await ExportErrorReportAsync(checkList);
+ // }
+
+ // return ApplicationConsts.SuccessStr;
+ //}
+
+
+
+ /////
+ ///// 按ID获取唯一实体
+ /////
+ /////
+ ///// 返回实体全部属性
+ /////
+ ///// ID
+ ///// 实体DTO
+ //[HttpGet]
+ //[Route("{id}")]
+ //virtual public async Task GetAsync(Guid id)
+ //{
+ // var result = await GetFromCacheAsync(id);
+ // var dto = ObjectMapper.Map(result);
+ // return dto;
+ //}
+
+
+ //private async Task GetFromCacheAsync(Guid id)
+ //{
+ // var result = await _repository.GetAsync(id);
+
+
+ // return result;
+ //}
+
+
+ //private async Task GetCountAsync(MaterialRelationshipRequestDto input)
+ //{
+ // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters);
+ //}
+
+
+
+
+ ///////
+
+ /////
+ ///// 根据筛选条件获取实体列表
+ /////
+ /////
+ ///// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
+ /////
+ ///// 请求条件
+ ///// 实体DTO列表
+ //[HttpPost]
+ //[Route("list")]
+ //virtual public async Task> GetListAsync(MaterialRelationshipRequestDto input)
+ //{
+ // var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount,
+ // input.SkipCount, true);
+
+ // var totalCount = await GetCountAsync(input);
+ // var dtos = ObjectMapper.Map, List>(entities);
+
+ // return new PagedResultDto(totalCount, dtos);
+ //}
+
+
+ /////
+ ///// 获取实体总数
+ /////
+ ///// 实体总数
+ //[HttpGet]
+ //[Route("count")]
+ //virtual public async Task GetTotalCountAsync(Guid branchId)
+ //{
+ // return await _repository.GetCountAsync(branchId);
+ //}
+
+ /////
+ ///// 获取全部实体列表
+ /////
+ ///// 实体DTO列表
+ //[HttpGet]
+ //[Route("all")]
+ //virtual public async Task> GetAllAsync(Guid branchId)
+ //{
+ // var entities = await _repository.GetAllAsync(branchId, true);
+
+
+ // var dtos = ObjectMapper.Map, List>(entities);
+
+
+ // return new ListResultDto(dtos);
+ //}
+
+
+
+
+ /////
+ ///// 新增实体
+ /////
+ ///// 新增实体DTO
+ ///// 实体DTO
+
+ //[HttpPost]
+ //[Route("")]
+ //virtual public async Task CreateAsync(MaterialRelationshipCreateDto input)
+ //{
+
+
+ // var _first = _repository.Where(p => p.ErpMaterialCode == input.ErpMaterialCode).FirstOrDefault();
+
+ // if (_first != null)
+ // {
+ // throw new BusinessException("001", "已经存数据请修改后创建");
+ // }
+
+
+ // var entity = new MaterialRelationship(
+ // GuidGenerator.Create(),
+ // input.BranchId,
+ // input.ErpMaterialCode,
+
+ // input.MaterialDesc,
+ // input.MaterialProperty,
+ // input.SettleMaterialCode,
+ // input.ShipMaterailCode,
+ // input.AppraisalCategory
+
+
+ // );
+
+ // await _repository.InsertAsync(entity);
+
+ // ////create cache
+ // //await Cache.SetAsync(entity.Id.ToString(), entity,
+ // // CacheStrategyConst.FIVE_MINUTES);
+
+ // var dto = ObjectMapper.Map(entity);
+ // return dto;
+
+ //}
+
+ /////
+ ///// 修改实体
+ /////
+ ///// ID
+ ///// 修改实体DTO
+ ///// 实体DTO
+ //[HttpPut]
+ //[Route("{id}")]
+ //virtual public async Task UpdateAsync(Guid id, MaterialRelationshipUpdateDto input)
+ //{
+ // var entity = await _repository.GetAsync(id);
+ // if (entity != null)
+ // {
+ // entity.Update(input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode);
+
+ // await _repository.UpdateAsync(entity);
+
+
+ // var dto = ObjectMapper.Map(entity);
+ // return dto;
+ // }
+ // else
+ // {
+ // return null;
+ // }
+
+ //}
+
+ /////
+ ///// 删除实体
+ /////
+ ///// ID
+ ///// 无
+ //[HttpDelete]
+ //[Route("{id}")]
+ //virtual public async Task DeleteAsync(Guid id)
+ //{
+ // var entity = await GetFromCacheAsync(id);
+ // await Cache.DeleteAsync(id.ToString());
+ // await _repository.DeleteAsync(id);
+ //}
+
+ /////
+ ///// 按IDs删除实体列表
+ /////
+ ///// IDs
+ ///// 是否执行成功
+ //[HttpPost]
+ //[Route("delete")]
+ //virtual public async Task DeleteListAsync(List ids)
+ //{
+ // var _query = _repository.Where(p => ids.Contains(p.Id));
+ // int i = await _query.BatchDeleteAsync();
+
+ // if (i == 0)
+ // {
+ // return false;
+ // }
+ // return true;
+ //}
+ //[HttpPost]
+ //[Route("Export")]
+ //virtual public async Task ExportAsync(MaterialRelationshipRequestDto input)
+ //{
+ // //var _userId = CurrentUser.Id.Value.ToString();
+ // string _fileName = string.Format("零件关系_{0}.xlsx", Guid.NewGuid().ToString());
+ // var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
+ // 0, true);
+
+ // var dtoDetails = ObjectMapper.Map, List>(entities);
+
+ // //声明导出容器
+ // ExportImporter _exportImporter = new ExportImporter();
+
+ // var result = await _exportImporter.ExcelExporter(dtoDetails);
+
+ // result.ShouldNotBeNull();
+
+ // //保存导出文件到服务器存成二进制
+ // await _excelImportService.SaveBlobAsync(
+ // new SaveExcelImportInputDto
+ // {
+ // Name = _fileName,
+ // Content = result
+ // }
+ // );
+ // return _fileName;
+ //}
+ #endregion
+
}
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
index e3cb870e..50b53d74 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
@@ -74,11 +74,11 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
var _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImportByHeadDesc(files, _excelImportService).ConfigureAwait(false);
var filter = new List
- {
- "1040",
- "1046",
- "104T"
- };
+ {
+ "1040",
+ "1046",
+ "104T"
+ };
result = result.FindAll(p => filter.Contains(p.Plant)).ToList();
result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2);
var newPrice = ObjectMapper.Map, List>(result);
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
index 0514de29..a304dfb0 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs
@@ -236,7 +236,7 @@ namespace Win.Sfs.SettleAccount.ExcelImporter
{
if (import.TemplateErrors.Count > 0)
{
- throw new BusinessException("8989", "模板错误!当前模板中字段不匹配!!请正确上传模板数据!导入不对的列名:" + import.TemplateErrors.FirstOrDefault().RequireColumnName);
+ throw new BusinessException("8989", $"{FileOriginName} 文件模板错误!当前导入模板中未找到此字段:{import.TemplateErrors.FirstOrDefault().RequireColumnName}");
}
import.ShouldNotBeNull();
if (import.Exception != null)
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 f06522e8..ffefac8d 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
@@ -118,6 +118,11 @@ namespace SettleAccount.Domain.BQ
///
[MaxLength(100)]
public string ContractDocID { get; set; }
+ ///
+ /// 生产码类型
+ ///
+ [MaxLength(10)]
+ public string ProductionCodeType { get; set; }
public BBAC_SA_DETAIL(Guid p_guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, string category, string isReturn, DateTime settleDate, string groupNum, string invGroupNum) : base(p_guid)
{
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230919010624_20230919-1.Designer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230919010624_20230919-1.Designer.cs
new file mode 100644
index 00000000..0c6716c4
--- /dev/null
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230919010624_20230919-1.Designer.cs
@@ -0,0 +1,5828 @@
+//
+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("20230919010624_20230919-1")]
+ partial class _202309191
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
+ .HasAnnotation("Relational:MaxIdentifierLength", 128)
+ .HasAnnotation("ProductVersion", "5.0.17")
+ .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_CAN_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ErpLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvbillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("IsMaiDan")
+ .HasColumnType("bit");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_CAN_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_NOT_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("ErpLoc")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsMaiDan")
+ .HasColumnType("bit");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RealPartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_NOT_SA_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("SettleBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("State")
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_PD");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_PD_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DeleterId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("DeleterId");
+
+ b.Property("DeletionTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("DeletionTime");
+
+ b.Property("Extend1")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend2")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend3")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Extend4")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("InvGroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsDeleted")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bit")
+ .HasDefaultValue(false)
+ .HasColumnName("IsDeleted");
+
+ b.Property("IsMaiDan")
+ .HasColumnType("bit");
+
+ b.Property("KeyCode")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Qty")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RELU")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("REPN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("SettleDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Site")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_PD_DETAIL");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("DNBillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("LastModificationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("LastModificationTime");
+
+ b.Property("LastModifierId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("LastModifierId");
+
+ b.Property("Site")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("State")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Version")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Set_BBAC_SA");
+ });
+
+ modelBuilder.Entity("SettleAccount.Domain.BQ.BBAC_SA_DETAIL", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BillNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("Category")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("ContractDocID")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property("CreatorId")
+ .HasColumnType("uniqueidentifier")
+ .HasColumnName("CreatorId");
+
+ b.Property("CustomerPartCodeNoSpace")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("ExtraProperties")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ExtraProperties");
+
+ b.Property("GroupNum")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("IsReturn")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("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("MappingType")
+ .HasColumnType("int");
+
+ b.Property("PN")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("PartCode")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Price")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ProductionCodeType")
+ .HasMaxLength(10)
+ .HasColumnType("nvarchar(10)");
+
+ 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("AssembleData")
+ .HasColumnType("datetime2");
+
+ 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("BillNum")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BillTime")
+ .HasColumnType("datetime2");
+
+ b.Property("BillType")
+ .HasColumnType("int");
+
+ b.Property("BusinessType")
+ .HasColumnType("int");
+
+ b.Property("CodeType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("ConcurrencyStamp");
+
+ b.Property("CreateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("CreationTime")
+ .HasColumnType("datetime2")
+ .HasColumnName("CreationTime");
+
+ b.Property