From a0aaa4dd93013cc49832991b88476f865ac0cb14 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Thu, 26 Dec 2024 09:39:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E4=BA=A7=E7=BA=BF?= =?UTF-8?q?=20=E9=9B=B6=E4=BB=B6=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProductionLineItemAppService.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs index 927c12e56..b2d9b2523 100644 --- a/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs +++ b/be/Modules/BaseData/src/Win_in.Sfs.Basedata.Application/ProductionLineItems/ProductionLineItemAppService.cs @@ -90,9 +90,7 @@ public class ProductionLineItemAppService : await CheckItemBasicItemCodeAsync(importInput.ItemCode, validationRresult).ConfigureAwait(false); await CheckProductionLineProdLineCodeAsync(importInput.ProdLineCode, validationRresult).ConfigureAwait(false); await CheckSameItem(importInput.ProdLineCode, importInput.ItemCode, validationRresult).ConfigureAwait(false); - CheckProductionLineProdLineCodeJsonAsync(importInput.RawLocationCodeListJson, validationRresult); - CheckProductionLineProdLineCodeJsonAsync(importInput.ProductLocationCodeListJson, validationRresult); - CheckProductionLineProdLineCodeJsonAsync(importInput.WipLocationCodeListJson, validationRresult); + CheckProductionLineProdLineCodeJsonAsync(importInput,validationRresult); } private async Task CheckSameItem(string ProdLineCode,string ItemCode, List validationRresult) @@ -104,15 +102,16 @@ public class ProductionLineItemAppService : } } - private void CheckProductionLineProdLineCodeJsonAsync(string locationCodeList, List validationRresult) + private void CheckProductionLineProdLineCodeJsonAsync(ProductionLineItemImportInput input, + List validationRresult) { - if (string.IsNullOrEmpty(locationCodeList)) + if (string.IsNullOrEmpty(input.ProductLocationCodeListJson) && + string.IsNullOrEmpty(input.RawLocationCodeListJson) && + string.IsNullOrEmpty(input.WipLocationCodeListJson)) { - validationRresult.Add(new ValidationResult($"请维护生产线和库位关系")); + validationRresult.Add(new ValidationResult("[来源]成品/半成品库位 或 [来源]原材料库位 或 [完工]线边库位 不能都为空")); } - - } - [HttpPost("get-by-product")] + [HttpPost("get-by-product")] public virtual async Task> GetByProductLineCodeAsync(string productLineCode) { var entityList = await _repository.GetListAsync(p => p.ProdLineCode == productLineCode).ConfigureAwait(false);