From 35f2b88733ad43d60f24b43f727ab7fa6a4fb685 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com>
Date: Fri, 18 Oct 2024 14:44:13 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...lannedIssueRequestForDongyangAppService.cs | 89 +++++++++----------
.../UnplannedIssueRequestEventHandler.cs | 16 ++--
2 files changed, 50 insertions(+), 55 deletions(-)
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs
index 21e9ed830..5cd4d0a35 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/UnplannedIssueRequests/UnplannedIssueRequestForDongyangAppService.cs
@@ -98,52 +98,47 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA
///
///
///
- [HttpPost("import-dongyang")]
- public async Task ImportDYAsync([FromForm] SfsImportRequestInput requestInput, [Required] IFormFile file)
- {
-
- try
- {
-
- using var ms = new MemoryStream();
- await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
- var inputFileBytes = ms.GetAllBytes();
- var importList = _excelService.Import(inputFileBytes).ToList();
- await CreateByDYOAsync(importList, EnumUnplannedIssueType.IMPORT).ConfigureAwait(false);
-
-
- List errorsList = new List();
-
- foreach (var itm in importList)
- {
- if (string.IsNullOrEmpty(itm.CaseCode)
- || string.IsNullOrEmpty(itm.ItemCode)
- || itm.Qty == 0
- || string.IsNullOrEmpty(itm.ProjCapacityCode)
- || string.IsNullOrEmpty(itm.FromLocationErpCode)
+ //[HttpPost("import-dongyang")]
+ //public async Task ImportDYAsync([FromForm] SfsImportRequestInput requestInput, [Required] IFormFile file)
+ //{
+ // try
+ // {
+ // using var ms = new MemoryStream();
+ // await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false);
+ // var inputFileBytes = ms.GetAllBytes();
+ // var importList = _excelService.Import(inputFileBytes).ToList();
+ // await CreateByDYOAsync(importList).ConfigureAwait(false);
+ // List errorsList = new List();
+ // foreach (var itm in importList)
+ // {
+ // if (string.IsNullOrEmpty(itm.CaseCode)
+ // || string.IsNullOrEmpty(itm.ItemCode)
+ // || itm.Qty == 0
+ // || string.IsNullOrEmpty(itm.ProjCapacityCode)
+ // || string.IsNullOrEmpty(itm.FromLocationErpCode)
- )
- {
- itm.Explain = "此项错误";
- errorsList.Add(itm);
- }
- }
-
- if (errorsList.Count > 0)
- {
- var fileContent = _excelService.Export(errorsList);
- return new TestResult(fileContent.FileContents, ExportImportService.ContentType) { FileDownloadName =fileContent.FileDownloadName };
- }
-
- var fileContent1 = _excelService.Export(importList);
+ // )
+ // {
+ // itm.Explain = "此项错误";
+ // errorsList.Add(itm);
+ // }
+ // }
+
+ // if (errorsList.Count > 0)
+ // {
+ // var fileContent = _excelService.Export(errorsList);
+ // return new TestResult(fileContent.FileContents, ExportImportService.ContentType) { FileDownloadName =fileContent.FileDownloadName };
+ // }
+
+ // var fileContent1 = _excelService.Export(importList);
- return new JsonResult(new { Code = 200, FileDownloadName = fileContent1.FileDownloadName });
- }
- catch (Exception e)
- {
- throw new UserFriendlyException(e.Message);
- }
- }
+ // return new JsonResult(new { Code = 200, FileDownloadName = fileContent1.FileDownloadName });
+ // }
+ // catch (Exception e)
+ // {
+ // throw new UserFriendlyException(e.Message);
+ // }
+ //}
@@ -191,7 +186,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA
UnplannedIssueRequestDTO request = new UnplannedIssueRequestDTO();
try
{
- return await CreateByDYOAsync(p_list, EnumUnplannedIssueType.OA, true).ConfigureAwait(false);
+ return await CreateByDYOAsync(p_list, true).ConfigureAwait(false);
}
catch (Exception e)
{
@@ -205,7 +200,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA
- protected async Task CreateByDYOAsync(List p_list, EnumUnplannedIssueType type, bool isAutoSubmit=false)
+ protected async Task CreateByDYOAsync(List p_list, bool isAutoSubmit=false)
{
UnplannedIssueRequest request = new UnplannedIssueRequest();
if (p_list.Count == 0)
@@ -214,7 +209,7 @@ public class UnplannedIssueRequestForDongyangAppService : UnplannedIssueRequestA
}
var first = p_list.FirstOrDefault();
- request.UnplannedIssueType = type;
+
request.SetId(GuidGenerator.Create());
request.AutoCompleteJob = false;
request.AutoSubmit = isAutoSubmit;
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedIssueRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedIssueRequestEventHandler.cs
index db0b9bf9f..416610a25 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedIssueRequestEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/UnplannedIssueRequestEventHandler.cs
@@ -95,20 +95,20 @@ public class UnplannedIssueRequestEventHandler
}
else
{
- if (entity.UnplannedIssueType == EnumUnplannedIssueType.OA || entity.UnplannedIssueType == EnumUnplannedIssueType.IMPORT)
- {
+ //if (entity.UnplannedIssueType == EnumUnplannedIssueType.OA || entity.UnplannedIssueType == EnumUnplannedIssueType.IMPORT)
+ //{
//var job = await BuildUnplannedIssueJobCreateInputAsync(entity).ConfigureAwait(false);
var request= new UnplannedIssueRequest();
request.InjectFrom(entity);
await _unplannedIssueJobApp.CreateByRecommendAsync(request).ConfigureAwait(false);
- }
- else
- {
- var job = await BuildUnplannedIssueJobCreateInputAsync(entity).ConfigureAwait(false);
- await _unplannedIssueJobApp.CreateAsync(job).ConfigureAwait(false);
- }
+ //}
+ //else
+ //{
+ // var job = await BuildUnplannedIssueJobCreateInputAsync(entity).ConfigureAwait(false);
+ // await _unplannedIssueJobApp.CreateAsync(job).ConfigureAwait(false);
+ //}
}
}