| | |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | |
| | | _stationMangerRepository = stationMangerRepository; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | } |
| | | private static object lock_reqPackTask = new object(); |
| | | /// <summary> |
| | | /// åé
ç åä»»å¡ |
| | | /// </summary> |
| | |
| | | /// <param name="deviceCode"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent ReqPackTask(string barCode,string deviceCode) |
| | | { |
| | | lock (lock_reqPackTask) |
| | | { |
| | | WebResponseContent content= new WebResponseContent(); |
| | | try |
| | |
| | | { |
| | | //è·åå½å空çåå¤çç åå·¥ä½ |
| | | List<string> stations = _stationMangerRepository.QueryData(x => x.StationDeviceCode == "CLC_CP" && x.IsOccupied == StationOccupiedEnum.None.ObjToInt()).Select(x => x.StationCode).ToList(); |
| | | //è·åç åé
置表æ¥è¯¢æé
ç½®çç åå·¥ä½ |
| | | List<Dt_Packaxis> packaxes = _packaxisRepository.QueryData(x => x.PackType == packinfo.PackType); |
| | | //è·åç åé
置表æ¥è¯¢å¯åé
å¹¶å·²é
ç½®çç åå·¥ä½ |
| | | List<Dt_Packaxis> packaxes = _packaxisRepository.QueryData(x => x.PackType == packinfo.PackType && stations.Contains(x.StationCode)); |
| | | if (packaxes.Count==0) |
| | | { |
| | | return content.Error("æªæ¾å°ç ååæ é
ç½®"); |
| | | return content.Error("æªæ¾å°å¯åé
ç åé
ç½®"); |
| | | } |
| | | List<string> packStations = packaxes.Select(x => x.StationCode).ToList(); |
| | | Dt_StationPackInfo? packInfoAssign = stationPackInfos.Where(x => x.PackType == 0 && x.AssignNum == 0 && stations.Contains(x.StationCode) && packStations.Contains(x.StationCode)).OrderByDescending(x => x.StationCode).FirstOrDefault(); |
| | | Dt_StationPackInfo? packInfoAssign = stationPackInfos.Where(x => x.PackType == 0 && x.AssignNum == 0 && packStations.Contains(x.StationCode)).OrderBy(x => x.OrderIndex).FirstOrDefault(); |
| | | if (packInfoAssign == null) |
| | | { |
| | | return content.Error("æªæ¾å°å¯åé
åä½"); |
| | |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ç åç»æå¹¶ä¸ä¼ ç åå·¥ä½ç åæç»æ°æ® |
| | |
| | | } |
| | | } |
| | | } |
| | | public class MDCount |
| | | { |
| | | public string MDNo { get; set; } |
| | | |
| | | public int Count { get; set; } |
| | | } |
| | | } |