From 8d7e2090fa7e18077b63fef0f69ea74e511559f2 Mon Sep 17 00:00:00 2001 From: mahao Date: Mon, 17 Jul 2023 17:24:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3BOM=E4=B9=B1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/Boms/BomAppService.cs | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs index 0ed42b08..29eb69cf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs @@ -27,12 +27,12 @@ namespace Win.Sfs.SettleAccount.Boms public class BomAppService : SettleAccountApplicationBase { /// - /// BOM�ִ� + /// BOM仓储 /// private readonly INormalEfCoreRepository _repository; /// - /// ���� + /// 构造 /// public BomAppService( INormalEfCoreRepository repository, @@ -40,14 +40,14 @@ namespace Win.Sfs.SettleAccount.Boms IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _repository = repository; } - #region ���� + #region 导出 /// - /// ���� + /// 导出 /// [HttpPost] public virtual async Task ExportAsync(BomRequestDto input) @@ -55,16 +55,16 @@ namespace Win.Sfs.SettleAccount.Boms string _fileName = string.Format("BOM_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); - var dtoDetails = ObjectMapper.Map, List >(entities); + var dtoDetails = ObjectMapper.Map, List>(entities); - //������������ + //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); var result = await _exportImporter.ExcelExporter(dtoDetails); result.ShouldNotBeNull(); - //���浼���ļ�����������ɶ����� + //保存导出文件到服务器存成二进制 await _excelImportService.SaveBlobAsync( new SaveExcelImportInputDto { @@ -78,7 +78,7 @@ namespace Win.Sfs.SettleAccount.Boms #region CURD /// - /// ��ȡ�б� + /// 获取列表 /// [HttpPost] public async Task> GetListAsync(BomRequestDto input) @@ -90,13 +90,13 @@ namespace Win.Sfs.SettleAccount.Boms } #endregion - #region ԭ������������ - // #region ���뵼������ + #region 原方法(废弃) + // #region 导入导出功能 // /// - // /// ���빦�� + // /// 导入功能 // /// - // /// �ϴ����ļ�(ǰ���Ѿ�����ֻ���ϴ�һ������) + // /// 上传的文件(前端已经限制只能上传一个附件) // /// // [HttpPost] // [Route("ExcelImport-Map")] @@ -121,7 +121,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // if (itm.Count > 1) // { - // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("���ܵ��븸����{0},�ӱ���{1}���ظ�����", itm.ParentItmeCode, itm.ChildItemCode), string.Empty)); + // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty)); // } // } // var _id = GuidGenerator.Create(); @@ -131,7 +131,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode)) // { - // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("���������ݲ��������Ϻ�{0}��", itm.ParentItemCode), string.Empty)); + // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty)); // continue; // } // itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id, factory); @@ -150,9 +150,9 @@ namespace Win.Sfs.SettleAccount.Boms // /// - // /// ���빦�� + // /// 导入功能 // /// - // /// �ϴ����ļ�(ǰ���Ѿ�����ֻ���ϴ�һ������) + // /// 上传的文件(前端已经限制只能上传一个附件) // /// // [HttpPost] // [Route("ExcelImport")] @@ -176,7 +176,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // if (itm.Count > 1) // { - // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("���ܵ��븸����{0},�ӱ���{1}���ظ�����", itm.ParentItmeCode, itm.ChildItemCode), string.Empty)); + // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("不能导入父编码{0},子编码{1}有重复数据", itm.ParentItmeCode, itm.ChildItemCode), string.Empty)); // } // } // var _id = GuidGenerator.Create(); @@ -186,7 +186,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // if (!_matList.Any(p => p.MaterialCode == itm.ParentItemCode)) // { - // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("���������ݲ��������Ϻ�{0}��", itm.ParentItemCode), string.Empty)); + // checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.ParentItemCode, string.Empty, string.Format("物料主数据不存在物料号{0}!", itm.ParentItemCode), string.Empty)); // continue; // } // itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,_id,factory); @@ -201,7 +201,7 @@ namespace Win.Sfs.SettleAccount.Boms // return ApplicationConsts.SuccessStr; // } // /// - // /// �����ļ� + // /// 导出文件 // /// // /// // /// @@ -212,7 +212,7 @@ namespace Win.Sfs.SettleAccount.Boms // { // IExporter _csv = new CsvExporter(); // IExporter _excel = new ExcelExporter(); - // //�������ϰ汾��������������ȫ���� + // //导出加上版本过滤条件,不能全导出 // if (input.ParentId != Guid.Empty) // { // input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "ParentId", Logic = EnumFilterLogic.And, Value = input.ParentId.ToString() }); @@ -225,23 +225,23 @@ namespace Win.Sfs.SettleAccount.Boms // 0, true); // var dtoDetails = ObjectMapper.Map, List>(entities); // string _fileName = string.Empty; - // //������������ + // //声明导出容器 // byte[] result = null; // switch (input.FileType) // { // case 0: - // _fileName = string.Format("��Ʒ�ṹ_{0}.csv", input.UserId.ToString()); + // _fileName = string.Format("产品结构_{0}.csv", input.UserId.ToString()); // result = await _csv.ExportAsByteArray(dtoDetails); // break; // case 1: - // _fileName = string.Format("��Ʒ�ṹ_{0}.xlsx", input.UserId.ToString()); + // _fileName = string.Format("产品结构_{0}.xlsx", input.UserId.ToString()); // result = await _excel.ExportAsByteArray(dtoDetails); // break; // } // result.ShouldNotBeNull(); - // //���浼���ļ�����������ɶ����� + // //保存导出文件到服务器存成二进制 // await _excelImportService.SaveBlobAsync( // new SaveExcelImportInputDto // { @@ -254,13 +254,13 @@ namespace Win.Sfs.SettleAccount.Boms // #endregion // /// - // /// ��ID��ȡΨһʵ�� + // /// 按ID获取唯一实体 // /// // /// - // /// ����ʵ��ȫ������ + // /// 返回实体全部属性 // /// // /// ID - // /// ʵ��DTO + // /// 实体DTO // [HttpGet] // [Route("{id}")] //[Authorize(SettleAccountPermissions.Boms.Default)] @@ -291,9 +291,9 @@ namespace Win.Sfs.SettleAccount.Boms // } // /// - // /// ��ȡʵ������ + // /// 获取实体总数 // /// - // /// ʵ������ + // /// 实体总数 // [HttpGet] // [Route("count")] //[Authorize(SettleAccountPermissions.Boms.Default)] @@ -305,10 +305,10 @@ namespace Win.Sfs.SettleAccount.Boms // /// - // /// ɾ��ʵ�� + // /// 删除实体 // /// // /// ID - // /// �� + // /// // [HttpDelete] // [Route("{id}")] //[Authorize(SettleAccountPermissions.Boms.Delete)] @@ -320,10 +320,10 @@ namespace Win.Sfs.SettleAccount.Boms // } // /// - // /// ��IDsɾ��ʵ���б� + // /// 按IDs删除实体列表 // /// // /// IDs - // /// �Ƿ�ִ�гɹ� + // /// 是否执行成功 // [HttpPost] // [Route("delete")] //[Authorize(SettleAccountPermissions.Boms.Delete)] @@ -342,13 +342,13 @@ namespace Win.Sfs.SettleAccount.Boms // ///// // /// - // /// ����ɸѡ������ȡʵ���б� + // /// 根据筛选条件获取实体列表 // /// // /// - // /// ������������:ɸѡ�����б�,��������,��������,ҳ�� + // /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 // /// - // /// �������� - // /// ʵ��DTO�б� + // /// 请求条件 + // /// 实体DTO列表 // [HttpPost] // [Route("list")] // [Authorize(SettleAccountPermissions.Boms.Default)] @@ -372,13 +372,13 @@ namespace Win.Sfs.SettleAccount.Boms // ///// // /// - // /// ����ɸѡ������ȡʵ���б� + // /// 根据筛选条件获取实体列表 // /// // /// - // /// ������������:ɸѡ�����б�,��������,��������,ҳ�� + // /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 // /// - // /// �������� - // /// ʵ��DTO�б� + // /// 请求条件 + // /// 实体DTO列表 // [HttpPost] // [Route("listVersion")] // [Authorize(SettleAccountPermissions.Boms.Default)]