From 46e98339480d853fc78a014c34d7ff9fcaf13890 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 05 十二月 2024 14:09:02 +0800 Subject: [PATCH] 产线协议 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/LocationInfoService.cs | 37 +++++++++++++++++++++++++++++++++++-- 1 files changed, 35 insertions(+), 2 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 2ada49b..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" @@ -1,4 +1,5 @@ -锘縰sing OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; +锘縰sing Microsoft.AspNetCore.Mvc.RazorPages; +using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; using SqlSugar; using System; using System.Collections.Generic; @@ -37,7 +38,39 @@ { return BaseDal.QueryData(x => x.LocationCode == LocationCode).FirstOrDefault(); } - + public WebResponseContent UpdateStatus(List<string> locationCodes, int Statu) + { + WebResponseContent content = new WebResponseContent().OK(); + try + { + 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> /// 鍒嗛厤璐т綅 /// </summary> -- Gitblit v1.9.3