From 5be0f5bc3b9a83a3b30c9915bd5309279d140244 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期三, 27 十一月 2024 08:39:17 +0800 Subject: [PATCH] WMS入库单功能和页面优化 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs | 34 +++++++++++++++++++++++++++++----- 1 files changed, 29 insertions(+), 5 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs" index 2f1c49b..5f072a9 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs" @@ -40,12 +40,36 @@ } public WebResponseContent UpdateStatus(List<string> locationCodes, int Statu) { - List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => locationCodes.Contains(x.LocationCode)); - locationInfos.ForEach(x => + WebResponseContent content = new WebResponseContent().OK(); + try { - x.LocationStatus = Statu; - }); - return UpdateData(locationInfos); + List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => locationCodes.Contains(x.LocationCode)); + foreach (var locationCode in locationCodes.GroupBy(x => x)) + { + if (locationCode.Count() > 2) throw new Exception("璐т綅缁戝畾鏌滃彿杩囧"); + if (locationCode.Count() > 1) + { + var location = locationInfos.Where(x => x.LocationCode == locationCode.Key).FirstOrDefault(); + if (location != null && location.LocationStatus == Statu) throw new Exception("璐т綅缁戝畾鏌滃彿杩囧"); + if(locationCode.Count() == 2) location.EnableStatus = EnableStatusEnum.OnlyOut.ObjToInt(); + } + //else + //{ + // throw new Exception("璐т綅缁戝畾鏌滃彿杩囧"); + //} + } + locationInfos.ForEach(x => + { + if (x.MaxQty == 12 || x.LocationStatus == Statu) x.EnableStatus = EnableStatusEnum.OnlyOut.ObjToInt(); + x.LocationStatus = Statu;//LocationStatusEnum.PalletLock.ObjToInt() + }); + content = UpdateData(locationInfos); + } + catch (Exception ex) + { + content.Error(ex.Message); + } + return content; } /// <summary> /// 鍒嗛厤璐т綅 -- Gitblit v1.9.3