Browse Source

修改导入返回

master
mahao 1 year ago
parent
commit
f70cb44257
  1. 11
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/ApplicationConsts.cs
  2. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs
  3. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs
  4. 33
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs
  5. 13
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs
  6. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs
  7. 6
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs
  8. 8
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs
  9. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs
  10. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

11
code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/ApplicationConsts.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@ -112,6 +112,15 @@ namespace Win.Sfs.SettleAccount.Constant
/// </summary>
public const string SuccessStr = "Success";
/// <summary>
/// Success
/// </summary>
public const int SuccessCode = 200;
/// <summary>
/// 导入失败Code
/// </summary>
public const int ImportFailCode = 400;
/// <summary>
/// FIS发出未结算输出表

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs

@ -109,7 +109,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
/// 导入
/// </summary>
[HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files)
{
#region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter();
@ -138,7 +138,8 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -147,7 +148,7 @@ public class BBAC_SA_SERVICE : SettleAccountApplicationBase<BBAC_SA>
//await SaDataHandleAsync(importBBACSaDetails);
}
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#endregion

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs

@ -108,7 +108,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
/// 导入
/// </summary>
[HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files)
{
#region 导入数据转换、数据校验
ExportImporter _exportImporter = new ExportImporter();
@ -136,7 +136,8 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -149,7 +150,7 @@ public class HBPO_SA_SERVICE : SettleAccountApplicationBase<HBPO_SA>
await SaDataHandleAsync(importCN5HBOPSaDetails, "CN5");
}
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
#endregion

33
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs

@ -107,9 +107,9 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// 导入
/// </summary>
[HttpPost]
public async Task<string> ImportByBusinessTypeAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto)
public async Task<IActionResult> ImportByBusinessTypeAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto)
{
string result = string.Empty;
IActionResult result = new JsonResult(null);
switch (pubSaImportRequestDto.BusinessType)
{
case EnumBusinessType.None:
@ -428,7 +428,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary>
/// 直供件BBAC导入
/// </summary>
private async Task<string> ImportZhiGongJianBBACAsync([FromForm] IFormFileCollection files)
private async Task<IActionResult> ImportZhiGongJianBBACAsync([FromForm] IFormFileCollection files)
{
#region 导入数据转换
ExportImporter _exportImporter = new ExportImporter();
@ -440,7 +440,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -450,7 +451,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary>
/// 直供件HBPO导入
/// </summary>
private async Task<string> ImportZhiGongJianHBPOAsync([FromForm] IFormFileCollection files)
private async Task<IActionResult> ImportZhiGongJianHBPOAsync([FromForm] IFormFileCollection files)
{
#region 导入数据转换
ExportImporter _exportImporter = new ExportImporter();
@ -469,7 +470,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -479,7 +481,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary>
/// 买单件HBPO导入
/// </summary>
private async Task<string> ImportMaiDanJianHBPOAsync([FromForm] IFormFileCollection files)
private async Task<IActionResult> ImportMaiDanJianHBPOAsync([FromForm] IFormFileCollection files)
{
#region 导入数据转换
ExportImporter _exportImporter = new ExportImporter();
@ -497,7 +499,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -507,7 +510,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary>
/// 备件导入
/// </summary>
private async Task<string> ImportBeiJianAsync([FromForm] IFormFileCollection files)
private async Task<IActionResult> ImportBeiJianAsync([FromForm] IFormFileCollection files)
{
#region 导入数据转换
ExportImporter _exportImporter = new ExportImporter();
@ -525,7 +528,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -535,7 +539,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary>
/// 印度件导入
/// </summary>
private async Task<string> ImportYinDuJianAsync([FromForm] IFormFileCollection files)
private async Task<IActionResult> ImportYinDuJianAsync([FromForm] IFormFileCollection files)
{
#region 导入数据转换
ExportImporter _exportImporter = new ExportImporter();
@ -547,7 +551,8 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
var checkList = await CheckAsync(importPubSaDetails);
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -580,7 +585,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
/// <summary>
/// 结算数据处理
/// </summary>
private async Task<string> SaDataHandleAsync(List<PUB_SA_DETAIL> pubSaDetails, EnumBusinessType businessType)
private async Task<IActionResult> SaDataHandleAsync(List<PUB_SA_DETAIL> pubSaDetails, EnumBusinessType businessType)
{
//客户零件关系
var materialRelationships = new List<MaterialRelationship>();
@ -636,7 +641,7 @@ public class PUB_SA_SERVICE : SettleAccountApplicationBase<PUB_SA>
}
#endregion
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
/// <summary>

13
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs

@ -48,7 +48,7 @@ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase<PURCHASE_PRIC
/// 导入
/// </summary>
[HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<PURCHASE_PRICE_IMPORT_DTO>(files, _excelImportService);
@ -68,6 +68,11 @@ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase<PURCHASE_PRIC
checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("零件号{0}有重复", itm.Key.LU), string.Empty));
}
}
if (checkList.Count > 0)
{
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
foreach (var itm in _ls)
{
var _first = _repository.FirstOrDefault(p => p.LU == itm.LU);
@ -81,11 +86,7 @@ public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase<PURCHASE_PRIC
await _repository.InsertAsync(itm);
}
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
}
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
/// <summary>

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs

@ -58,7 +58,7 @@ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_Re
/// 导入
/// </summary>
[HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files)
public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<TB_RePartsRelationship_IMPORT_DTO>(files, _excelImportService);
@ -91,7 +91,8 @@ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_Re
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
foreach (var itm in _ls)
{
@ -106,7 +107,7 @@ public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase<TB_Re
await _repository.InsertAsync(itm);
}
}
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
/// <summary>

6
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -65,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
/// </summary>
[HttpPost]
[DisableRequestSizeLimit]
public async Task<string> CodeSettingUploadExcelImport([FromForm] IFormFileCollection files)
public async Task<IActionResult> CodeSettingUploadExcelImport([FromForm] IFormFileCollection files)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<CodeSettingImportDto>(files, _excelImportService);
@ -87,7 +87,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables
}
var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 };
//_repository.GetDbContext().BulkInsert(_ls, bulkConfig);
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
/// <summary>

8
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs

@ -10,6 +10,7 @@ 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;
@ -51,7 +52,7 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
/// 导入
/// </summary>
[HttpPost]
public async Task<string> ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto)
public async Task<IActionResult> ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto)
{
ExportImporter _exportImporter = new ExportImporter();
var result = await _exportImporter.UploadExcelImport<MaterialRelationshipImportDto>(materialRelationshipImportRequestDto.Files, _excelImportService);
@ -73,7 +74,8 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
foreach (var itm in _ls)
{
@ -90,7 +92,7 @@ public class MaterialRelationshipAppService : SettleAccountApplicationBase<Mater
await _repository.InsertAsync(itm);
}
}
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
/// <summary>

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs

@ -70,7 +70,7 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
/// 导入
/// </summary>
[HttpPost]
public virtual async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version)
public virtual async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files, string version)
{
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
@ -100,7 +100,8 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -110,7 +111,7 @@ public class PriceListAppService : SettleAccountApplicationBase<PriceList>
}
await _priceListManager.ImportAsync(entityList.ToList(), version);
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
/// <summary>

7
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs

@ -48,7 +48,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
/// 导入
/// </summary>
[HttpPost]
public async Task<string> ImportAsync([FromForm] IFormFileCollection files, string version)
public async Task<IActionResult> ImportAsync([FromForm] IFormFileCollection files, string version)
{
var checkList = new List<ErrorExportDto>();
ExportImporter _exportImporter = new ExportImporter();
@ -79,7 +79,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
}
if (checkList.Count > 0)
{
return await ExportErrorReportAsync(checkList);
string fileName = await ExportErrorReportAsync(checkList);
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, fileName = fileName });
}
#endregion
@ -89,7 +90,7 @@ namespace Win.Sfs.SettleAccount.Entities.Prices
}
await _priceListManagerBJ.ImportAsync(entityList, version);
return ApplicationConsts.SuccessStr;
return new JsonResult(new { Code = 200, Message = "导入成功" });
}
/// <summary>

Loading…
Cancel
Save