| | |
| | | 锘縰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; |
| | |
| | | { |
| | | 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> |