| | |
| | | { |
| | | string[] targetCodesst = dt_StockInfo.PalletCode.Split("*"); |
| | | Dt_InboundOrder dt_Inbound = _inboundService.InbounOrderService.Repository.QueryFirst(x => x.OrderName == targetCodesst[0]); |
| | | if (dt_Inbound.Startingcolumn != 0 || dt_Inbound.Startingcolumn != 0) |
| | | if (dt_Inbound.Startingcolumn != 0 || dt_Inbound.Terminationcolumn != 0) |
| | | { |
| | | newLocation = _basicService.LocationInfoService.GetLocation2(locationInfos.RoadwayNo, Locationtype, dt_Inbound.Startingcolumn, dt_Inbound.Startingcolumn); |
| | | newLocation = _basicService.LocationInfoService.GetLocation2(locationInfos.RoadwayNo, Locationtype, dt_Inbound.Startingcolumn, dt_Inbound.Terminationcolumn); |
| | | } |
| | | else |
| | | { |
| | |
| | | loca.Add(newLocation); |
| | | loca.Add(locationInfos); |
| | | _basicService.LocationInfoService.UpdateData(loca); |
| | | BaseDal.AddData(dt_Task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content = WebResponseContent.Instance.OK(data: dt_Task); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼æªæ¾å°å¯¹åºçåºåä¿¡æ¯ï¼åºåç¼å·ï¼{pallid}"); |
| | | return content = WebResponseContent.Instance.Error($"ä¿®æ¹å¤±è´¥ï¼æªæ¾å°å¯¹åºçåºåä¿¡æ¯ï¼åºåç¼å·ï¼{pallid}"); |
| | | |
| | | } |
| | | } |
| | |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼æ¥éä¿¡æ¯ï¼{ex.Message}"); |
| | | return content = WebResponseContent.Instance.Error($"ä¿®æ¹å¤±è´¥ï¼æ¥éä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent ManualOutbound4(SaveModel saveModel) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_StockInfo> dtstockt = new List<Dt_StockInfo>(); |
| | | |
| | | |
| | | List<Dt_StockInfo> stocktData = _stockService.StockInfoService.Repository.QueryData(x => x.StockStatus == (int)StockStatusEmun.å·²å
¥åº); |
| | | string json = saveModel.DelKeys[0].ToString(); |
| | | List<int> palletCodes = JsonConvert.DeserializeObject<List<int>>(json); |
| | | |
| | | foreach (int pallid in palletCodes) |
| | | { |
| | | Dt_StockInfo stockt = stocktData.FirstOrDefault(x => x.Id == pallid); |
| | | if (stockt != null) |
| | | { |
| | | |
| | | stockt.Mgeneratetime = DateTime.Parse(saveModel.DelKeys[1].ToString()); |
| | | dtstockt.Add(stockt); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"ä¿®æ¹å¤±è´¥ï¼æªæ¾å°å¯¹åºçåºåä¿¡æ¯ï¼åºåç¼å·ï¼{pallid}"); |
| | | |
| | | } |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (dtstockt.Count > 0) |
| | | { |
| | | _stockService.StockInfoService.Repository.UpdateData(dtstockt); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | content = WebResponseContent.Instance.OK($"ä¿®æ¹æå"); |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content = WebResponseContent.Instance.Error($"ä¿®æ¹å¤±è´¥ï¼æ¥éä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | |
| | | BaseDal.DeleteData(task); |
| | | BaseDal.DeleteAndMoveIntoHty(task, OperateType.人工å é¤); |
| | | WriteLog.GetLog("任塿¥å¿").Write($"åºåºä»»å¡åæ¶æåï¼æçæ¡ç ï¼{task.PalletCode}", $"ä»»å¡åæ¶"); |
| | | WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "ä»»å¡å é¤"); |
| | | return content = WebResponseContent.Instance.Error($"åºåºä»»å¡åæ¶æå"); |
| | | |
| | | } |
| | |
| | | BaseDal.DeleteData(task); |
| | | BaseDal.DeleteAndMoveIntoHty(task, OperateType.人工å é¤); |
| | | WriteLog.GetLog("任塿¥å¿").Write($"å
¥åºä»»å¡åæ¶æåï¼æçæ¡ç ï¼{task.PalletCode}", $"ä»»å¡åæ¶"); |
| | | WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "ä»»å¡å é¤"); |
| | | return content = WebResponseContent.Instance.Error($"å
¥åºä»»å¡åæ¶æå"); |
| | | } |
| | | else if (task.TaskType == (int)TaskTypeEnum.RelocationIn) //åºå
ç§»åº |
| | | { |
| | | //å¤çåºåºçé»è¾ |
| | | Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (locationinfo.LocationStatus == LocationStatusEnum.Lock.ObjToInt() || locationinfo.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | } |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationinfo); |
| | | |
| | | Dt_LocationInfo locationinfo2 = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (locationinfo2.LocationStatus == LocationStatusEnum.Lock.ObjToInt()) |
| | | { |
| | | locationinfo2.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | } |
| | | if (locationinfo2.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt()) |
| | | { |
| | | locationinfo2.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | } |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationinfo2); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | stockInfo.StockStatus = (int)StockStatusEmun.å·²å
¥åº; |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id); |
| | | if (stocktdetail != null) |
| | | { |
| | | stocktdetail.Status = (int)StockStatusEmun.å·²å
¥åº; |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stocktdetail); |
| | | } |
| | | BaseDal.DeleteData(task); |
| | | BaseDal.DeleteAndMoveIntoHty(task, OperateType.人工å é¤); |
| | | WriteLog.GetLog("任塿¥å¿").Write($"å
¥åºä»»å¡åæ¶æåï¼æçæ¡ç ï¼{task.PalletCode}", $"ä»»å¡åæ¶"); |
| | | WebResponseContent webResponseContent = HttpHelper.Post<WebResponseContent>(ReceiveWCSTask, task.TaskNum, "ä»»å¡å é¤"); |
| | | return content = WebResponseContent.Instance.Error($"å
¥åºä»»å¡åæ¶æå"); |
| | | } |
| | | else |