| | |
| | | using System.Diagnostics; |
| | | using Newtonsoft.Json; |
| | | using System.Security.Policy; |
| | | using static WIDESEA_ITaskInfoService.ITaskService; |
| | | using MailKit.Search; |
| | | using WIDESEA_Common.Log; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | } |
| | | targetCodes[4] = "01"; |
| | | string LocationCode = string.Join("-", targetCodes); //ç»è£
æµ
åºä½å°å |
| | | Dt_LocationInfo locationInfos = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode); |
| | | Dt_LocationInfo locationInfos = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode && (x.LocationStatus == (int)LocationStatusEnum.Free || x.LocationStatus == (int)LocationStatusEnum.InStock)); |
| | | if (locationInfos == null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°è¯¥è´§ä½ä¿¡æ¯,è´§ä½ç¼å·:{locationInfos}"); |
| | |
| | | { |
| | | if (locationInfos.LocationStatus == (int)LocationStatusEnum.Free) //夿æµ
è´§ä½æ¯å¦æè´§ |
| | | { |
| | | return content = WebResponseContent.Instance.OK(data: TaskNum); |
| | | return content = WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode); |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == LocationCode && x.StockStatus== (int)StockStatusEmun.å·²å
¥åº); |
| | | if (dt_StockInfo == null) |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°è¯¥è´§ä½çåºåä¿¡æ¯,è´§ä½ç¼å·:{LocationCode}"); |
| | |
| | | { |
| | | Dt_LocationInfo newLocation; |
| | | //æ¥èµ°è´§ä½ï¼è¿è¡çæç§»åºä»»å¡ |
| | | newLocation = _basicService.LocationInfoService.GetLocation(locationInfos.RoadwayNo); //æ¿å°äºç§»åºåçè´§ä½ |
| | | int Locationtype = 9; //é»è®¤ä¸º9 |
| | | if (dt_StockInfo.MaterialType == (int)InventoryMaterialType.æå) |
| | | { |
| | | Locationtype = 11; |
| | | } |
| | | else if (dt_StockInfo.MaterialType == (int)InventoryMaterialType.åææ) |
| | | { |
| | | Locationtype = 10; |
| | | } |
| | | //newLocation = _basicService.LocationInfoService.GetLocation(locationInfos.RoadwayNo,Locationtype); //æ¿å°äºç§»åºåçè´§ä½ |
| | | if (dt_StockInfo.MaterialType == (int)InventoryMaterialType.æå) |
| | | { |
| | | 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.Terminationcolumn != 0) |
| | | { |
| | | newLocation = _basicService.LocationInfoService.GetLocation2(locationInfos.RoadwayNo, Locationtype, dt_Inbound.Startingcolumn, dt_Inbound.Terminationcolumn); |
| | | } |
| | | else |
| | | { |
| | | newLocation = _basicService.LocationInfoService.GetLocation(locationInfos.RoadwayNo, Locationtype); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | newLocation = _basicService.LocationInfoService.GetLocation(locationInfos.RoadwayNo, Locationtype); |
| | | } |
| | | |
| | | |
| | | //ç®æ è´§ä½æ¥æ¾åºä½æ¯å¦æè´§ |
| | | Dt_StockInfo dt_StockCurren = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == newLocation.LocationCode); |
| | | if (dt_StockCurren != null) return content = WebResponseContent.Instance.Error($"å
¥åºå¤±è´¥ï¼æçæ¡ç ï¼{dt_StockInfo.PalletCode}ï¼æ¥æ¾åºçè´§ä½ä¿¡æ¯å¯¹åºå·²æåºå"); |
| | | |
| | | Dt_Task taskcurren = BaseDal.QueryFirst(x => x.TargetAddress == newLocation.LocationCode); |
| | | if (taskcurren != null) return content = WebResponseContent.Instance.Error($"å
¥åºå¤±è´¥ï¼æçæ¡ç ï¼{dt_StockInfo.PalletCode}ï¼æ¥æ¾åºçè´§ä½ä¿¡æ¯å·²æå
¥åºä»»å¡"); |
| | | |
| | | bool crutaskthy = _taskHtyService.CrueeTaskHty(newLocation.LocationCode); |
| | | if (crutaskthy) return content = WebResponseContent.Instance.Error($"å
¥åºå¤±è´¥ï¼æçæ¡ç ï¼{dt_StockInfo.PalletCode}ï¼æ¥æ¾åºçè´§ä½å¨ä»»å¡åå²ä¿¡æ¯ä¸ï¼æå
¥åºæç§»åºä¿¡æ¯"); |
| | | |
| | | |
| | | if (newLocation != null) |
| | | { |
| | | Dt_Task dt_Task = new() |
| | |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | MaterialType = dt_StockInfo.MaterialType |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (locationInfos.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | |
| | | loca.Add(newLocation); |
| | | loca.Add(locationInfos); |
| | | _basicService.LocationInfoService.UpdateData(loca); |
| | | BaseDal.AddData(dt_Task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return content = WebResponseContent.Instance.OK(data: dt_Task); |
| | | } |
| | |
| | | |
| | | |
| | | public string ReceiveWMSTask = WIDESEA_Core.Helper.AppSettings.Configuration["ReceiveWMSTask"]; |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶èµ·ç¹éè¦ç空æçè¿è¡åºåº |
| | | /// </summary> |
| | | /// <param name="SourceAddress"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent Empty_outbound(string SourceAddress) |
| | | public WebResponseContent Empty_outbound(GenerateInv generate) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | | |
| | | try |
| | | { |
| | | Dt_LocationInfo locationInfos = _basicService.LocationInfoService.Repository.QueryFirst(x => x.RoadwayNo == "2" && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()); |
| | | if (locationInfos != null) |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TargetAddress == generate.SourceAddress); |
| | | if (task == null) |
| | | { |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == locationInfos.LocationCode); |
| | | if (dt_StockInfo != null) |
| | | string RoadwayNo = "1"; |
| | | if (generate.SourceAddress != "R01-002-041-001-01") |
| | | { |
| | | Dt_LocationInfo newSourceAddress; |
| | | newSourceAddress = _basicService.LocationInfoService.GetLocationplatform(SourceAddress); |
| | | if (newSourceAddress != null) |
| | | { |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = dt_StockInfo.PalletCode, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = locationInfos.RoadwayNo, |
| | | TaskType = TaskTypeEnum.Outbound.ObjToInt(), |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | SourceAddress = locationInfos.LocationCode, |
| | | TargetAddress = newSourceAddress.LocationCode, |
| | | CurrentAddress = locationInfos.LocationCode, |
| | | NextAddress = newSourceAddress.LocationCode, |
| | | Grade = 1, |
| | | Creater = "WMS", |
| | | Depth = locationInfos.Depth, |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | RoadwayNo = "2"; |
| | | } |
| | | Dt_LocationInfo locationInfos = _basicService.LocationInfoService.Repository.QueryFirst(x => x.RoadwayNo == RoadwayNo && x.EnableStatus != (int)EnableStatusEnum.Disable && x.Depth==1 && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()); |
| | | if(locationInfos == null) |
| | | { |
| | | locationInfos = _basicService.LocationInfoService.Repository.QueryFirst(x => x.RoadwayNo == RoadwayNo && x.Depth == 2 && x.EnableStatus != (int)EnableStatusEnum.Disable && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()); |
| | | } |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | dt_StockInfo.StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | dt_StockInfo.Remark = "çå¾
å åæºå®æåºåºä»»å¡"; |
| | | if (locationInfos.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()) |
| | | if (locationInfos != null) |
| | | { |
| | | Dt_StockInfo dt_StockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.LocationCode == locationInfos.LocationCode); |
| | | if (dt_StockInfo != null && dt_StockInfo.MaterialType == (int)InventoryMaterialType.空æ) |
| | | { |
| | | |
| | | |
| | | Dt_LocationInfo newSourceAddress; |
| | | newSourceAddress = _basicService.LocationInfoService.GetLocationplatform(generate.SourceAddress); |
| | | if (newSourceAddress != null) |
| | | { |
| | | locationInfos.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt(); |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = dt_StockInfo.PalletCode, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = locationInfos.RoadwayNo, |
| | | TaskType = TaskTypeEnum.PalletOutbound.ObjToInt(), |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | SourceAddress = locationInfos.LocationCode, |
| | | TargetAddress = newSourceAddress.LocationCode, |
| | | CurrentAddress = locationInfos.LocationCode, |
| | | NextAddress = newSourceAddress.LocationCode, |
| | | Grade = 1, |
| | | Creater = "WMS", |
| | | Depth = locationInfos.Depth, |
| | | CreateDate = DateTime.Now, |
| | | PalletCodequantity = (int)dt_StockInfo.Materialweight, |
| | | MaterialType = dt_StockInfo.MaterialType |
| | | }; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | dt_StockInfo.StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | dt_StockInfo.Remark = "çå¾
å åæºå®æåºåºä»»å¡"; |
| | | if (locationInfos.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()) |
| | | { |
| | | locationInfos.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt(); |
| | | } |
| | | BaseDal.AddData(dt_Task); |
| | | _basicService.LocationInfoService.UpdateData(locationInfos); |
| | | _stockService.StockInfoService.Repository.UpdateData(dt_StockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | return content = WebResponseContent.Instance.OK(data: dt_Task); |
| | | } |
| | | BaseDal.AddData(dt_Task); |
| | | _basicService.LocationInfoService.UpdateData(locationInfos); |
| | | _stockService.StockInfoService.Repository.UpdateData(dt_StockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | return content = WebResponseContent.Instance.OK(data: dt_Task); |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°ç«å°ç¼å·ï¼ç¼å·ï¼{generate.SourceAddress}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°ç«å°ç¼å·ï¼ç¼å·ï¼{SourceAddress}"); |
| | | return content = WebResponseContent.Instance.Error($"æ 该åºä½ç©ºæä¸ºåºåä¿¡æ¯ï¼åºä½ç¼å·ï¼{locationInfos.LocationCode}"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"该åºä½ç©ºæä¸ºåºåä¿¡æ¯ï¼åºä½ç¼å·ï¼{locationInfos.LocationCode}"); |
| | | return content = WebResponseContent.Instance.Error($"该巷éå·²æ 空æçï¼å··éå·:{RoadwayNo}å··é"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error("该巷éå·²æ 空æçï¼å··éå·:2å··é"); |
| | | return content = WebResponseContent.Instance.Error($"å·²æè¯¥ç«å°ç空æåºåºä»»å¡ï¼ç«å°ç¼å·{generate.SourceAddress}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼æ¥éä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶èµ·ç¹éè¦ç空æçè¿è¡åºåº |
| | | /// </summary> |
| | | /// <param name="SourceAddress"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent Rawmaterialout(GenerateInv3 generate) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | List<Dt_StockInfo> dt_StockInfo = _stockService.StockInfoService.Repository.QueryData(x => x.PalletCode.Contains(generate.PalletCode) && x.MaterialType== (int)InventoryMaterialType.åææ).OrderBy(x=>x.CreateDate).Take(generate.outCount).ToList(); |
| | | |
| | | if(dt_StockInfo.Count > 0) |
| | | { |
| | | for (int i = 0; i < dt_StockInfo.Count; i++) |
| | | { |
| | | Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == dt_StockInfo[i].LocationCode); //确认货ä½ä¿¡æ¯æ¯å¦å¯¹ä¸ |
| | | if (locationinfo != null) |
| | | { |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = dt_StockInfo[i].PalletCode, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = locationinfo.RoadwayNo, |
| | | TaskType = TaskTypeEnum.Outbound.ObjToInt(), |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | SourceAddress = locationinfo.LocationCode, |
| | | TargetAddress = locationinfo.RoadwayNo == "1" ? "R01-002-041-011-01" : "R02-002-027-011-01", |
| | | CurrentAddress = locationinfo.LocationCode, |
| | | NextAddress = locationinfo.RoadwayNo == "1" ? "R01-002-041-011-01" : "R02-002-027-011-01", |
| | | Grade = 1, |
| | | Creater = "WMS", |
| | | Depth = locationinfo.Depth, |
| | | CreateDate = DateTime.Now, |
| | | PalletCodequantity = (int)dt_StockInfo[i].Materialweight, |
| | | PLCTo = generate.TargetAddress == "R01-002-041-011-01" ? 1 : 2, |
| | | MaterialType = dt_StockInfo[i].MaterialType |
| | | }; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | dt_StockInfo[i].StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | dt_StockInfo[i].Remark = "çå¾
å åæºå®æåºåºä»»å¡"; |
| | | if (locationinfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | } |
| | | BaseDal.AddData(dt_Task); |
| | | _basicService.LocationInfoService.UpdateData(locationinfo); |
| | | _stockService.StockInfoService.Repository.UpdateData(dt_StockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | content = WebResponseContent.Instance.OK(data: dt_Task); |
| | | } |
| | | else |
| | | { |
| | | content = WebResponseContent.Instance.Error($"ç©æä¿¡æ¯ä¸è´§ä½ä¿¡æ¯ä¸å¯¹ï¼æçå·ï¼{dt_StockInfo[i].PalletCode}"); |
| | | } |
| | | } |
| | | return content; |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°åºåºçåºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | |
| | |
| | | public WebResponseContent ManualOutbound(SaveModel saveModel) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | | try |
| | | { |
| | | List<Dt_StockInfo> dtstockt = new List<Dt_StockInfo>(); |
| | |
| | | for (int i = 0; i < saveModel.DelKeys.Count; i++) |
| | | { |
| | | Dt_StockInfo stockt = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == saveModel.DelKeys[i].ToString()); |
| | | Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockt.Id); |
| | | stockt.StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | if(stockt.MaterialType != (int)InventoryMaterialType.空æ) |
| | | if (stockt.StockStatus == (int)StockStatusEmun.å·²å
¥åº && (stockt.Wlstatus == (int)InventoryMaterialStatus.åæ ¼ || stockt.Wlstatus == (int)InventoryMaterialStatus.è¿å·¥ || stockt.Wlstatus == (int)InventoryMaterialStatus.ç¹é) ) |
| | | { |
| | | stocktdetail.Status = (int)StockStatusEmun.åºåºéå®; |
| | | } |
| | | |
| | | |
| | | Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockt.LocationCode); |
| | | if (locationinfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | } |
| | | else if (locationinfo.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt(); |
| | | } |
| | | string LocationName = "R00-000-001-001-01"; |
| | | if (stockt.MaterialType == (int)InventoryMaterialType.åææ) |
| | | { |
| | | if (locationinfo.RoadwayNo == "1") |
| | | if(stockt.MaterialType != (int)InventoryMaterialType.åææ) |
| | | { |
| | | LocationName = "R01-002-000-005-01"; |
| | | Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockt.Id); |
| | | stockt.StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | if (stockt.MaterialType != (int)InventoryMaterialType.空æ) |
| | | { |
| | | stocktdetail.Status = (int)StockStatusEmun.åºåºéå®; |
| | | } |
| | | Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockt.LocationCode); |
| | | if (locationinfo.RoadwayNo == "1") |
| | | { |
| | | if (locationinfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | } |
| | | else if (locationinfo.LocationStatus == LocationStatusEnum.Pallet.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.PalletLock.ObjToInt(); |
| | | } |
| | | string LocationName = "R01-002-044-001-01"; |
| | | if (stockt.MaterialType == (int)InventoryMaterialType.空æ) |
| | | { |
| | | LocationName = "R01-002-043-001-01"; |
| | | } |
| | | Dt_LocationInfo newTargetAddress; |
| | | newTargetAddress = _basicService.LocationInfoService.GetLocationplatform(LocationName); |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = stockt.PalletCode, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = newTargetAddress.RoadwayNo, |
| | | TaskType = TaskTypeEnum.Outbound.ObjToInt(), |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | SourceAddress = locationinfo.LocationCode, |
| | | TargetAddress = newTargetAddress.LocationCode, |
| | | CurrentAddress = locationinfo.LocationCode, |
| | | NextAddress = newTargetAddress.LocationCode, |
| | | Grade = 1, |
| | | Creater = "WMS", |
| | | Depth = locationinfo.Depth, |
| | | CreateDate = DateTime.Now, |
| | | MaterialType= stockt.MaterialType |
| | | }; |
| | | dtstockt.Add(stockt); |
| | | locations.Add(locationinfo); |
| | | taskdt.Add(dt_Task); |
| | | if (stockt.MaterialType != (int)InventoryMaterialType.空æ) |
| | | { |
| | | dtstocktdetail.Add(stocktdetail); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼åªå¯åºåº1å··éçæçåæåï¼åºåºæ¡ç ï¼{saveModel.DelKeys[i].ToString()}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | LocationName = "R02-002-000-005-01"; |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼è¯·ä¸è¦éæ©åææåºåºï¼åºåºæ¡ç ï¼{saveModel.DelKeys[i].ToString()}"); |
| | | } |
| | | } |
| | | Dt_LocationInfo newTargetAddress; |
| | | newTargetAddress = _basicService.LocationInfoService.GetLocationplatform(LocationName); |
| | | Dt_Task dt_Task = new() |
| | | else |
| | | { |
| | | PalletCode = stockt.PalletCode, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = newTargetAddress.RoadwayNo, |
| | | TaskType = TaskTypeEnum.Outbound.ObjToInt(), |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | SourceAddress = locationinfo.LocationCode, |
| | | TargetAddress = newTargetAddress.LocationCode, |
| | | CurrentAddress = locationinfo.LocationCode, |
| | | NextAddress = newTargetAddress.LocationCode, |
| | | Grade = 1, |
| | | Creater = "WMS", |
| | | Depth = locationinfo.Depth, |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | dtstockt.Add(stockt); |
| | | locations.Add(locationinfo); |
| | | taskdt.Add(dt_Task); |
| | | if (stockt.MaterialType != (int)InventoryMaterialType.空æ) |
| | | { |
| | | dtstocktdetail.Add(stocktdetail); |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼è¯·éæ©å·²å
¥åºä¸ï¼åæ ¼ï¼è¿å·¥ï¼ç¹éï¼çç©æåºåºï¼ï¼ï¼ï¼åºåºæ¡ç ï¼{saveModel.DelKeys[i].ToString()}"); |
| | | } |
| | | |
| | | |
| | | } |
| | | var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTask, taskdt, "ä¸åä»»å¡å
¥åº"); |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockService.StockInfoService.Repository.UpdateData(dtstockt); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(dtstocktdetail); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locations); |
| | | BaseDal.AddData(taskdt); |
| | | |
| | | if (dtstockt.Count > 0) |
| | | { |
| | | _stockService.StockInfoService.Repository.UpdateData(dtstockt); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(dtstocktdetail); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locations); |
| | | BaseDal.AddData(taskdt); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | content = WebResponseContent.Instance.OK(); |
| | | return content; |
| | |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | |
| | | public WebResponseContent ManualOutbound2(SaveModel saveModel) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_StockInfo> dtstockt = new List<Dt_StockInfo>(); |
| | | List<Dt_LocationInfo> locations = new List<Dt_LocationInfo>(); |
| | | List<Dt_Task> taskdt = new List<Dt_Task>(); |
| | | List<Dt_StockInfoDetail> dtstocktdetail = new List<Dt_StockInfoDetail>(); |
| | | |
| | | |
| | | List<Dt_StockInfo> stocktData= _stockService.StockInfoService.Repository.QueryData(x=>x.StockStatus== (int)StockStatusEmun.å·²å
¥åº && x.MaterialType == (int)InventoryMaterialType.åææ); |
| | | List<Dt_LocationInfo> locationinfoData = _basicService.LocationInfoService.Repository.QueryData(x =>x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()); |
| | | List<Dt_StockInfoDetail> StockInfoDetailData = _stockService.StockInfoDetailService.Repository.QueryData(x => x.Status == (int)StockStatusEmun.å·²å
¥åº); |
| | | |
| | | |
| | | string json = saveModel.DelKeys[0].ToString(); |
| | | List<string> palletCodes = JsonConvert.DeserializeObject<List<string>>(json); |
| | | |
| | | foreach (var palletCode in palletCodes) |
| | | { |
| | | Dt_StockInfo stockt = stocktData.FirstOrDefault(x => x.PalletCode == palletCode); |
| | | if (stockt !=null) |
| | | { |
| | | if (stockt.StockStatus == (int)StockStatusEmun.å·²å
¥åº && (stockt.Wlstatus == (int)InventoryMaterialStatus.åæ ¼ || stockt.Wlstatus == (int)InventoryMaterialStatus.éè´§ || stockt.Wlstatus == (int)InventoryMaterialStatus.ç¹é)) |
| | | { |
| | | Dt_StockInfoDetail stocktdetail = StockInfoDetailData.FirstOrDefault(x => x.StockId == stockt.Id); |
| | | if(stocktdetail != null) |
| | | { |
| | | Dt_LocationInfo locationinfo = locationinfoData.FirstOrDefault(x => x.LocationCode == stockt.LocationCode); |
| | | if(locationinfo != null) |
| | | { |
| | | stockt.StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | if (locationinfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | } |
| | | |
| | | string TargetAdd = ""; |
| | | if (saveModel.DelKeys[1].ToString()=="20") |
| | | { |
| | | TargetAdd = "R02-001-021-001-02"; |
| | | }else if(saveModel.DelKeys[1].ToString() == "30") |
| | | { |
| | | TargetAdd = "R02-001-022-001-02"; |
| | | } |
| | | else if (saveModel.DelKeys[1].ToString() == "40") |
| | | { |
| | | TargetAdd = "R01-002-044-001-01"; |
| | | } |
| | | else |
| | | { |
| | | TargetAdd = locationinfo.RoadwayNo == "2" ? "R02-002-027-011-01" : "R01-002-041-011-01"; |
| | | } |
| | | |
| | | |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = stockt.PalletCode, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = locationinfo.RoadwayNo, |
| | | TaskType = TaskTypeEnum.Outbound.ObjToInt(), |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | SourceAddress = locationinfo.LocationCode, |
| | | TargetAddress = TargetAdd, |
| | | CurrentAddress = locationinfo.LocationCode, |
| | | NextAddress = TargetAdd, |
| | | Grade = 1, |
| | | Creater = "WMS", |
| | | Depth = locationinfo.Depth, |
| | | CreateDate = DateTime.Now, |
| | | PLCTo = int.Parse(saveModel.DelKeys[1].ToString()), |
| | | MaterialType=stockt.MaterialType |
| | | }; |
| | | dtstockt.Add(stockt); |
| | | locations.Add(locationinfo); |
| | | taskdt.Add(dt_Task); |
| | | dtstocktdetail.Add(stocktdetail); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼æªæ¾å°å¯¹åºçåºä½ä¿¡æ¯ï¼è¯·æ ¸å¯¹ï¼ï¼ï¼ï¼åºåºæ¡ç ï¼{palletCode}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼æªæ¾å°å¯¹åºçåºå详æ
ä¿¡æ¯ï¼è¯·æ ¸å¯¹ï¼ï¼ï¼ï¼åºåºæ¡ç ï¼{palletCode}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼è¯·éæ©å·²å
¥åºä¸ï¼åæ ¼ï¼ç¹éï¼éè´§ï¼çç©æåºåºï¼ï¼ï¼ï¼åºåºæ¡ç ï¼{palletCode}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼æªæ¾å°å¯¹åºæ¡ç çåºåä¿¡æ¯ï¼åºåºæ¡ç ï¼{palletCode}"); |
| | | |
| | | } |
| | | } |
| | | var responses = HttpHelper.Post<WebResponseContent>(ReceiveWMSTask, taskdt, "ä¸åä»»å¡å
¥åº"); |
| | | _unitOfWorkManage.BeginTran(); |
| | | if(dtstockt.Count > 0) |
| | | { |
| | | _stockService.StockInfoService.Repository.UpdateData(dtstockt); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(dtstocktdetail); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locations); |
| | | BaseDal.AddData(taskdt); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | content = WebResponseContent.Instance.OK($"åºåºæåï¼åºåºæ»æ°ï¼{palletCodes.Count}ï¼æåæ°éï¼{dtstockt.Count}"); |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼æ¥éä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent ManualOutbound3(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.Wlstatus = int.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; |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | public class PalletCodeList |
| | | { |
| | | public string PalletCode { get; set; } |
| | | } |
| | | |
| | | |
| | | public (Dt_Task?, Dt_LocationInfo?) AddRelocationTask(Dt_LocationInfo location, Dt_StockInfo stockInfo, Dt_Task task) |
| | | { |
| | |
| | | } |
| | | return (null, LocationStatusEnum.Free.ObjToInt()); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 人工æå¨åºåºï¼å é¤åºåï¼ |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent ManualOutboundDeleteinventory(SaveModel saveModel) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_StockInfo> dtstockt = new List<Dt_StockInfo>(); |
| | | List<Dt_LocationInfo> locations = new List<Dt_LocationInfo>(); |
| | | List<Dt_StockInfoDetail> dtstocktdetail = new List<Dt_StockInfoDetail>(); |
| | | |
| | | for (int i = 0; i < saveModel.DelKeys.Count; i++) |
| | | { |
| | | Dt_StockInfo stockt = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == saveModel.DelKeys[i].ToString()); |
| | | if (stockt.StockStatus == (int)StockStatusEmun.å·²å
¥åº) |
| | | { |
| | | Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockt.Id); |
| | | Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockt.LocationCode); |
| | | Dt_Task_Hty task_Hty = new Dt_Task_Hty() |
| | | { |
| | | TaskNum = 001, |
| | | PalletCode = stockt.PalletCode, |
| | | Roadway = locationinfo.RoadwayNo, |
| | | TaskType = (int)TaskTypeEnum.Outbound, |
| | | TaskStatus = (int)OutTaskStatusEnum.OutFinish, |
| | | SourceAddress = locationinfo.LocationCode, |
| | | TargetAddress = locationinfo.LocationCode, |
| | | CurrentAddress = locationinfo.LocationCode, |
| | | NextAddress = locationinfo.LocationCode, |
| | | Grade = 1, |
| | | Dispatchertime = DateTime.Now, |
| | | Creater = App.User.UserName, |
| | | CreateDate = DateTime.Now, |
| | | ModifyDate = DateTime.Now, |
| | | Modifier = App.User.UserName, |
| | | Remark = "人工åºåº", |
| | | PLCTo = 1, |
| | | PalletCodequantity = 1, |
| | | MaterialType = 1 |
| | | }; |
| | | _taskHtyService.AddData(task_Hty); |
| | | locationinfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | dtstockt.Add(stockt); |
| | | locations.Add(locationinfo); |
| | | if (stockt.MaterialType != (int)InventoryMaterialType.空æ) |
| | | { |
| | | dtstocktdetail.Add(stocktdetail); |
| | | } |
| | | WriteLog.GetLog("人工æå¨å é¤åºåä¿¡æ¯").Write($"æçæ¡ç ï¼{stockt.PalletCode},åºä½ç¼å·ï¼{stockt.LocationCode}", $"人工åºåºåºå"); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"åºåºå¤±è´¥ï¼è¯¥åºåä¿¡æ¯ä¸å¯è¿è¡åºåº"); |
| | | } |
| | | |
| | | } |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockService.StockInfoService.Repository.DeleteData(dtstockt); |
| | | _stockService.StockInfoDetailService.Repository.DeleteData(dtstocktdetail); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locations); |
| | | _unitOfWorkManage.CommitTran(); |
| | | content = WebResponseContent.Instance.OK(); |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content = WebResponseContent.Instance.Error($"æå¨åºåºä¿¡æ¯å¤±è´¥ï¼æ¥éä¿¡æ¯ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡åæ¶ |
| | | /// </summary> |
| | | /// <param name="saveModel"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent Cancelinventory(int taskNum) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if(task != null) |
| | | { |
| | | if(task.TaskType== (int)TaskTypeEnum.Outbound || task.TaskType == (int)TaskTypeEnum.PalletOutbound) |
| | | { |
| | | //å¤çåºåºçé»è¾ |
| | | Dt_LocationInfo locationinfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (locationinfo.LocationStatus == LocationStatusEnum.Lock.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | } |
| | | if (locationinfo.LocationStatus == LocationStatusEnum.PalletLock.ObjToInt()) |
| | | { |
| | | locationinfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | } |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationinfo); |
| | | 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 if(task.TaskType == (int)TaskTypeEnum.Inbound || task.TaskType == (int)TaskTypeEnum.PalletInbound) |
| | | { |
| | | //å¤çåºåºçé»è¾ |
| | | 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_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | _stockService.StockInfoService.Repository.DeleteData(stockInfo); |
| | | Dt_StockInfoDetail stocktdetail = _stockService.StockInfoDetailService.Repository.QueryFirst(x => x.StockId == stockInfo.Id); |
| | | if (stocktdetail != null) |
| | | { |
| | | _stockService.StockInfoDetailService.Repository.DeleteData(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 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 |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"该任å¡çä»»å¡ç±»åå¼å¸¸ï¼åæ¶å¤±è´¥"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error($"æªæ¾å°ä»»å¡å·"); |
| | | } |
| | | } |
| | | } |
| | | } |