diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md
index ba83d683..53ab4401 100644
--- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md
+++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/scripts/README.md
@@ -1,5 +1,34 @@
# 数据库存储过程和自定义函数说明
+
+# 创建数据库
+
+USE [BQ_SA]
+
+CREATE DATABASE [BQ_SA]
+ CONTAINMENT = NONE
+ ON PRIMARY
+( NAME = N'BQ_SA1', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\BQ_SA1.mdf' , SIZE = 3022848KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ),
+ FILEGROUP [2022]
+( NAME = N'2022', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\2022.ndf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ),
+ FILEGROUP [2023]
+( NAME = N'2023', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\2023.ndf' , SIZE = 2629632KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ),
+ FILEGROUP [2024]
+( NAME = N'2024', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\2024.ndf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ),
+ FILEGROUP [2025]
+( NAME = N'2025', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\2025.ndf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ),
+ FILEGROUP [2026]
+( NAME = N'2026', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\2026.ndf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ),
+ FILEGROUP [2027]
+( NAME = N'2027', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\2027.ndf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ),
+ FILEGROUP [2028]
+( NAME = N'2028', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\2028.ndf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
+ LOG ON
+( NAME = N'BQ_SA1_log', FILENAME = N'D:\SqlServer2019\MSSQL15.JS\MSSQL\DATA\BQ_SA1_log.ldf' , SIZE = 4530176KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
+ WITH CATALOG_COLLATION = DATABASE_DEFAULT
+GO
+ALTER DATABASE [BQ_SA] SET COMPATIBILITY_LEVEL = 130
+
# 分区脚本,需要先在SQL SERVER清空数据,手工创建多个NDF物理文件,2022,、2023、2024等
USE [BQ_SA]
GO
diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs
index 03b8f4d6..0eab4120 100644
--- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs
+++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs
@@ -31,7 +31,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
{
///
- /// Ӧ÷
+ /// 区域相关应用服务
///
[Authorize(SettleAccountPermissions.Boms.Default)]
//[AllowAnonymous]
@@ -53,12 +53,12 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
private readonly ISettleAccountBranchEfCoreRepository _versionRepository;
///
- ///
+ /// 构建方法
///
- /// UID
- /// Զmap
- /// ִӿ
- ///
+ /// 构建UID
+ /// 自动map
+ /// 仓储接口
+ /// 缓存
public ErpShippingAppService(IGuidGenerator guidGenerator,
IObjectMapper objectMapper,
IExcelImportAppService excelImportService,
@@ -80,12 +80,12 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
_importColumnMapRepository = importColumnMapRepository;
}
- #region 뵼
+ #region 导入导出功能
///
- /// 빦
+ /// 导入功能
///
- /// ϴļ(ǰѾֻϴһ)
+ /// 上传的文件(前端已经限制只能上传一个附件)
///
//[HttpPost]
//[Route("ExcelImport-Map")]
@@ -95,7 +95,6 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
//public async Task ERPShippingDetailUploadExcelImportMap([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory)
//{
// var _mapList=_importColumnMapRepository.Where(p => p.ProjectName ==SettleAccountModuleName.ERPShippingDetail ).ToList();
-
// ExportImporter _exportImporter = new ExportImporter();
// var result = await _exportImporter.ExtendExcelImport(files, _excelImportService,_mapList);
// var entityList = ObjectMapper.Map, List>(result);
@@ -110,7 +109,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
// {
// if (itm.Count > 1)
// {
- // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ܵ븸{0},ӱ{1}ظ", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
+ // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
// }
// }
// var _id = GuidGenerator.Create();
@@ -120,7 +119,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
// {
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
// {
- // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("ݲϺ{0}", itm.ParentItemCode), string.Empty));
+ // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty));
// continue;
// }
// itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id, factory);
@@ -136,9 +135,9 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
//}
///
- /// 빦
+ /// 导入功能
///
- /// ϴļ(ǰѾֻϴһ)
+ /// 上传的文件(前端已经限制只能上传一个附件)
///
[HttpPost]
[Route("ExcelImport")]
@@ -161,7 +160,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
//{
// if (itm.Count > 1)
// {
- // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ܵ븸{0},ӱ{1}ظ", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
+ // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty));
// }
//}
//var _id = GuidGenerator.Create();
@@ -171,7 +170,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
//{
// if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode))
// {
- // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("ݲϺ{0}", itm.ParentItemCode), string.Empty));
+ // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty));
// continue;
// }
// itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,_id,factory);
@@ -188,7 +187,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
return ApplicationConsts.SuccessStr;
}
///
- /// ļ
+ /// 导出文件
///
///
///
@@ -199,7 +198,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
{
IExporter _csv = new CsvExporter();
IExporter _excel = new ExcelExporter();
- //ϰ汾ȫ
+ //导出加上版本过滤条件,不能全导出
if (!string.IsNullOrEmpty(input.Version))
{
input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version.ToString() });
@@ -211,14 +210,11 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
0, true).ConfigureAwait(false);
var dtoDetails = ObjectMapper.Map, List>(entities);
- var _fileName = string.Format("ERP_{0}.xlsx", Guid.NewGuid().ToString("N"));
- //
-
+ var _fileName = string.Format("ERP调拨_{0}.xlsx", Guid.NewGuid().ToString("N"));
+ //声明导出容器
var result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false);
-
result.ShouldNotBeNull();
-
- //浼ļɶ
+ //保存导出文件到服务器存成二进制
await _excelImportService.SaveBlobAsync(
new SaveExcelImportInputDto
{
@@ -231,13 +227,13 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
#endregion
///
- /// IDȡΨһʵ
+ /// 按ID获取唯一实体
///
///
- /// ʵȫ
+ /// 返回实体全部属性
///
/// ID
- /// ʵDTO
+ /// 实体DTO
[HttpGet]
[Route("{id}")]
@@ -259,9 +255,9 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
}
///
- /// ȡʵ
+ /// 获取实体总数
///
- /// ʵ
+ /// 实体总数
[HttpGet]
[Route("count")]
@@ -271,10 +267,10 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
}
///
- /// ɾʵ
+ /// 删除实体
///
/// ID
- ///
+ /// 无
[HttpDelete]
[Route("{id}")]
@@ -286,10 +282,10 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
}
///
- /// IDsɾʵб
+ /// 按IDs删除实体列表
///
/// IDs
- /// Ƿִгɹ
+ /// 是否执行成功
[HttpPost]
[Route("delete")]
@@ -307,13 +303,13 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
/////
///
- /// ɸѡȡʵб
+ /// 根据筛选条件获取实体列表
///
///
- /// :ɸѡб,,,ҳ
+ /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
///
- ///
- /// ʵDTOб
+ /// 请求条件
+ /// 实体DTO列表
[HttpPost]
[Route("list")]
@@ -337,13 +333,13 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
/////
///
- /// ɸѡȡʵб
+ /// 根据筛选条件获取实体列表
///
///
- /// :ɸѡб,,,ҳ
+ /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码
///
- ///
- /// ʵDTOб
+ /// 请求条件
+ /// 实体DTO列表
[HttpPost]
[Route("listVersion")]
@@ -351,7 +347,6 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails
{
var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue,
input.SkipCount, true).ConfigureAwait(false);
-
var totalCount = await GetCountAsync(input).ConfigureAwait(false);
var dtos = _objectMapper.Map, List>(entities);
//foreach (var itm in dtos)