|
|
@ -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>
|
|
|
|