| | |
| | | InDate = a.InDate, |
| | | StockId = a.Id |
| | | }).ToList(); |
| | | StockViewDTO1? stockViewDTO = list.OrderByDescending(x => x.InDate).FirstOrDefault(); |
| | | StockViewDTO1? stockViewDTO = list.OrderBy(x => x.InDate).FirstOrDefault(); |
| | | if (stockViewDTO == null) throw new Exception("æªæ¾å°å¯åºåºç©ºæ"); |
| | | #region 夿æ¯å¦ä¸ºç¬¬ä¸æè´§ä½ |
| | | var strings = stockViewDTO.LocationCode.ToLower().Split('-'); |
| | | var Row = Convert.ToInt32(strings[0]); |
| | | if (Row == 1) |
| | | { |
| | | var locationcode = 2.ToString("000") + "-" + strings[1] + "-" + strings[2]; |
| | | var stockViewDTO1 = list.Where(x => x.LocationCode == locationcode).OrderBy(x => x.InDate).FirstOrDefault(); |
| | | if (stockViewDTO1 != null) stockViewDTO = stockViewDTO1; |
| | | } |
| | | #endregion |
| | | stockViewDTO = list.Where(x => x.LocationCode == stockViewDTO.LocationCode).OrderByDescending(x => x.InDate).FirstOrDefault(); |
| | | Dt_LocationInfo locationInfo = _dbBase.Queryable<Dt_LocationInfo>().Where(x => x.LocationCode == stockViewDTO.LocationCode).First(); |
| | | if (locationInfo == null) throw new Exception($"æªæ¾å°è´§ä½ã{stockViewDTO.LocationCode}ãä¿¡æ¯"); |
| | | Dt_StockInfo stockInfo = _stockService.Repository.QueryFirst(a => a.Id == stockViewDTO.StockId); |