| | |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Repository; |
| | | using WIDESEA_StorageBasicRepository; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | |
| | | WebResponseContent response = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | //å¦ä»»å¡å·²åå¨å è¿åæ¤ä»»å¡ |
| | | var checkTask = _taskRepository.QueryFirst(x => x.PalletCode == json.PalletCode && x.PVI == json.PVI); |
| | | if (checkTask != null) |
| | | { |
| | | return response.OK("ç³è¯·å
¥åºæå", data: checkTask); |
| | | } |
| | | |
| | | var carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI && x.PalletCode == json.PalletCode); |
| | | |
| | | if (carInfo == null) throw new Exception("æªç¥ç©ºæ¬ä¿¡æ¯,æ æ³å
¥åº"); |
| | | //{ |
| | | // Dt_CarBodyInfo _CarBodyInfo = new Dt_CarBodyInfo //æµè¯ |
| | | // { |
| | | // PVI = "J25000660", |
| | | // RFID = json.PVI, |
| | | // BodyStatus = 0, |
| | | // CarType = 1, |
| | | // }; |
| | | //} |
| | | if (carInfo == null) |
| | | { |
| | | Dt_CarBodyInfo dt_CarBodyInfo = new Dt_CarBodyInfo |
| | | { |
| | | PalletCode = json.PalletCode, |
| | | CarType = 3, |
| | | PVI = json.PalletCode, |
| | | RFID = json.PalletCode, |
| | | BodyStatus = 0 |
| | | }; |
| | | _carBodyInfoRepository.AddData(dt_CarBodyInfo); |
| | | |
| | | carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI && x.PalletCode == json.PalletCode); |
| | | } |
| | | |
| | | var maxGroup = _locationRepository.QueryData(x => x.LocationType == 3 && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable) |
| | | .GroupBy(x => x.RoadwayNo) |
| | |
| | | TaskNum = _taskRepository.GetTaskNo().Result, |
| | | Creater = "Systeam", |
| | | PVI = json.PVI, |
| | | |
| | | CarType = carInfo.CarType |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | _taskRepository.AddData(newtask); |
| | | //location.LocationStatus = (int)LocationEnum.InStockDisable; |
| | | //_locationRepository.UpdateData(location); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | response.OK("空æ¬ç³è¯·å
¥åºæå", data: newtask); |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | response.Error($"请æ±å··éå·å¤±è´¥:{ex.Message}"); |
| | | response.Error($"空æ¬è¯·æ±å··éå·å¤±è´¥:{ex.Message}"); |
| | | } |
| | | return response; |
| | | } |