| | |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IBasicRepository _basicRepository; |
| | | private readonly IStockInfoRepository _stockInfoRepository; |
| | | private readonly IProStockInfoRepository _proStockInfoRepository; |
| | | public ILocationInfoRepository Repository => BaseDal; |
| | | |
| | | public LocationInfoService(ILocationInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IBasicRepository basicRepository, IStockInfoRepository stockInfoRepository) : base(BaseDal) |
| | | public LocationInfoService(ILocationInfoRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IBasicRepository basicRepository, IStockInfoRepository stockInfoRepository, IProStockInfoRepository proStockInfoRepository) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _basicRepository = basicRepository; |
| | | _stockInfoRepository = stockInfoRepository; |
| | | _proStockInfoRepository = proStockInfoRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢è´§ä½å¯¹åºçRFID |
| | | /// </summary> |
| | | /// <param name="locationCodes"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GetRfid(string[] locationCodes, int warehouseId = 0) |
| | | { |
| | | try |
| | | { |
| | | // åæ°éªè¯ |
| | | if (locationCodes == null || locationCodes.Length == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error("è´§ä½ç¼å·ä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | if (warehouseId == 1) |
| | | { |
| | | // æ¥è¯¢åæåºDt_StockInfo表ï¼è·åRFIDä¿¡æ¯ |
| | | var rawMaterialRfidList = _stockInfoRepository.QueryData() |
| | | .Where(x => locationCodes.Contains(x.LocationCode)) |
| | | .Select(x => new { x.LocationCode, x.RfidCode }) |
| | | .ToList(); |
| | | |
| | | var rfidList = rawMaterialRfidList.ToList(); |
| | | // è¿åç»æ |
| | | return WebResponseContent.Instance.OK(data: rfidList); |
| | | } |
| | | |
| | | if (warehouseId == 2) |
| | | { |
| | | // æ¥è¯¢æååºDt_ProStockInfo表ï¼è·åPalletCodeä¿¡æ¯ |
| | | var finishedProductRfidList =_proStockInfoRepository.QueryData() |
| | | .Where(x => locationCodes.Contains(x.LocationCode)) |
| | | .Select(x => new { x.LocationCode, RfidCode = x.PalletCode }) |
| | | .ToList(); |
| | | |
| | | var rfidList = finishedProductRfidList.ToList(); |
| | | // è¿åç»æ |
| | | return WebResponseContent.Instance.OK(data: rfidList); |
| | | } |
| | | // å¦ææ²¡æå¹é
çä»åºIDï¼è¿å空å表 |
| | | return WebResponseContent.Instance.OK(data: new List<object>()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine($"GetRfid å¼å¸¸: {ex.Message}"); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Dt_LocationInfo locationInfo = new Dt_LocationInfo() |
| | | { |
| | | WarehouseId = 0, |
| | | Column = j + 1, |
| | | Columns = j + 1, |
| | | EnableStatus = EnableStatusEnum.Normal.ObjToInt(), |
| | | Layer = k + 1, |
| | | LocationStatus = LocationStatusEnum.Free.ObjToInt(), |
| | |
| | | Row = i + 1, |
| | | Depth = depth, |
| | | }; |
| | | locationInfo.LocationCode = $"{locationInfo.RoadwayNo}-{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Column.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}-{locationInfo.Depth.ToString().PadLeft(2, '0')}"; |
| | | locationInfo.LocationName = $"{locationInfo.RoadwayNo}å··é{locationInfo.Row.ToString().PadLeft(3, '0')}è¡{locationInfo.Column.ToString().PadLeft(3, '0')}å{locationInfo.Layer.ToString().PadLeft(3, '0')}å±{locationInfo.Depth.ToString().PadLeft(2, '0')}æ·±"; |
| | | locationInfo.LocationCode = $"{locationInfo.RoadwayNo}-{locationInfo.Row.ToString().PadLeft(3, '0')}-{locationInfo.Columns.ToString().PadLeft(3, '0')}-{locationInfo.Layer.ToString().PadLeft(3, '0')}-{locationInfo.Depth.ToString().PadLeft(2, '0')}"; |
| | | locationInfo.LocationName = $"{locationInfo.RoadwayNo}å··é{locationInfo.Row.ToString().PadLeft(3, '0')}è¡{locationInfo.Columns.ToString().PadLeft(3, '0')}å{locationInfo.Layer.ToString().PadLeft(3, '0')}å±{locationInfo.Depth.ToString().PadLeft(2, '0')}æ·±"; |
| | | locationInfos.Add(locationInfo); |
| | | } |
| | | } |