From 896c08739dfa6526270755fe03bbe5963d8f9bf2 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周五, 29 11月 2024 15:55:27 +0800 Subject: [PATCH] 222 --- LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs | 34 ++++++++++++++++++++-------------- 1 files changed, 20 insertions(+), 14 deletions(-) diff --git a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs index 6ce3158..2e52b0f 100644 --- a/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs +++ b/LA24030_LuLiPackageLine_Wms/Admin.NET.Application/Service/WmsTask/WmsOperationTaskService.cs @@ -92,15 +92,28 @@ { throw Oops.Oh("鍙傛暟涓嶈兘涓虹┖"); } - var singlePackage = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync(); - if (singlePackage == null) + + var package = await _mesPackageGatherRep.AsQueryable().Where(x => x.PackageCode == input.PackageCode).FirstAsync(); + if (package == null) { throw Oops.Oh($"娌℃湁鎵惧埌鍖呭彿{input.PackageCode}鐨勬眹鎬绘暟鎹�"); } + + + var sysConfig = await _sysConfigRep.GetFirstAsync(x => x.Code == CommonConst.WmsBZ30_QiTao); + if (sysConfig == null) + { + throw Oops.Oh($"娌℃湁閰嶇疆 鍒ゆ柇榻愬 鍊�"); + } + if (!string.IsNullOrEmpty(sysConfig.Value) && sysConfig.Value != "鏃�") + { + throw Oops.Oh($"鍒ゆ柇榻愬鍊煎凡缁忓瓨鍦ㄥ�納sysConfig.Value},涓嶅厑璁告搷浣�"); + } + var setValue = ""; var _QiTaoReuslt = ""; - var other_orderList = await _mesPackageGatherRep.AsQueryable().Where(x => x.Info5 == singlePackage.Info5 && x.PackageCode != input.PackageCode).ToListAsync(); + var other_orderList = await _mesPackageGatherRep.AsQueryable().Where(x => x.Info5 == package.Info5 && x.PackageCode != input.PackageCode).ToListAsync(); var num = other_orderList.Where(x => x.UpiStatus == UpiStatusEnum.鍒濆 || x.UpiStatus == UpiStatusEnum.涓嶉綈鍖�).Count(); if (num > 0) { @@ -114,19 +127,12 @@ _QiTaoReuslt = "榻愬"; } - var sysConfig = await _sysConfigRep.GetFirstAsync(x => x.Code == CommonConst.WmsBZ30_QiTao); - if (sysConfig == null) - { - throw Oops.Oh($"娌℃湁閰嶇疆 鍒ゆ柇榻愬 鍊�"); - } - if (!string.IsNullOrEmpty(sysConfig.Value) && sysConfig.Value != "鏃�") - { - throw Oops.Oh($"鍒ゆ柇榻愬鍊煎凡缁忓瓨鍦ㄥ�納sysConfig.Value},涓嶅厑璁告搷浣�"); - } + + sysConfig.Value = setValue; await _sysConfigRep.UpdateAsync(sysConfig); - output = singlePackage.Adapt<ValidateQiTaoOutput>(); + output = package.Adapt<ValidateQiTaoOutput>(); output.QiTaoReuslt = _QiTaoReuslt; return output; } @@ -179,7 +185,7 @@ var list = await _mesOrderGatherRep.AsQueryable() .WhereIF(!string.IsNullOrWhiteSpace(input.Info5), u => u.Info5.Contains(input.Info5.Trim())) .WhereIF(!string.IsNullOrWhiteSpace(input.Info5), u => u.Info5.Contains(input.Info5.Trim())) - .Where(x=>((DateTime)x.CreateTime).ToString("yyyyMMdd")==DateTime.Now.ToString("yyyyMMdd")) + .Where(x => ((DateTime)x.CreateTime).ToString("yyyyMMdd") == DateTime.Now.ToString("yyyyMMdd")) .Where(x => x.IsKitting == false) .OrderBy(g => g.Id) .ToListAsync(); // 纭繚鑾峰彇缁撴灉涓� List -- Gitblit v1.9.3