已删除3个文件
已修改24个文件
已重命名3个文件
已添加3个文件
| | |
| | | { |
| | | return TaskTypeGroup.OutbondGroup; |
| | | } |
| | | else if (!int.TryParse(Enum.Parse<TaskInStatusEnum>(taskType.ToString()).ToString(), out result)) |
| | | else if (!int.TryParse(Enum.Parse<TaskInboundTypeEnum>(taskType.ToString()).ToString(), out result)) |
| | | { |
| | | return TaskTypeGroup.InboundGroup; |
| | | } |
| | |
| | | /// è´¨æ£å
¥åº |
| | | /// </summary> |
| | | [Description("è´¨æ£å
¥åº")] |
| | | InQuality = 203 |
| | | InQuality = 203, |
| | | /// <summary> |
| | | /// å
¥ç©ºæ |
| | | /// </summary> |
| | | [Description("å
¥ç©ºæ")] |
| | | PalletInbound = 204, |
| | | } |
| | | |
| | | public enum TaskOutboundTypeEnum |
| | |
| | | /// </summary> |
| | | [Description("è´¨æ£åºåº")] |
| | | OutQuality = 103, |
| | | /// <summary> |
| | | /// åºç©ºæ |
| | | /// </summary> |
| | | [Description("åºç©ºæ")] |
| | | PalletOutbound = 104, |
| | | |
| | | } |
| | | /// <summary> |
| | | /// ç§»åº |
| | |
| | | task.TargetIsPickPlace = receiveWMSInfo.TargetIsPickPlace; |
| | | task.TargetAddress = receiveWMSInfo.TargetAddress; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.ExceptionMessage = null; |
| | | } |
| | | else |
| | | task.ExceptionMessage = content.Message; |
| | |
| | | //æä¸èèå¤è·¯å¾ |
| | | if (routers.Count > 0) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.InNew; |
| | | if (task.TaskType != TaskInboundTypeEnum.PalletInbound.ObjToInt()) |
| | | task.TaskState = (int)TaskInStatusEnum.InNew; |
| | | task.CurrentAddress = item.SourceAddress; |
| | | task.NextAddress = routers.FirstOrDefault().ChildPosi; |
| | | } |
| | |
| | | //} |
| | | #endregion |
| | | } |
| | | else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound) |
| | | else if (/*task.TaskType == (int)TaskInboundTypeEnum.Inbound*/_taskService.TaskInboundTypes.Contains(task.TaskType)) |
| | | { |
| | | var ShuttleCar = GetShuttleCarInfo(task.TargetAddress);//å
¥åºä»»å¡å¤æç»ç¹æ¯å¦æç©¿æ¢è½¦ |
| | | if (task.TargetIsPickPlace && ShuttleCar != null)//移走 |
| | |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "status", |
| | | title: "åºåæç»ç¶æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "stockStatusEmun", data: [] }, |
| | | }, |
| | | // { |
| | | // field: "status", |
| | | // title: "åºåæç»ç¶æ", |
| | | // type: "string", |
| | | // width: 120, |
| | | // align: "left", |
| | | // bind: { key: "stockStatusEmun", data: [] }, |
| | | // }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "operateType", |
| | | title: "æä½ç±»å", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "wMSId", |
| | | title: "WMSä»»å¡ä¸»é®", |
| | | type: "int", |
| | |
| | | /// <returns></returns> |
| | | public Dt_LocationInfo AssignLocation() |
| | | { |
| | | Dt_LocationInfo locationInfo = null; |
| | | locationInfo = BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.Row == 3, _emptyAssignOrderBy); |
| | | Dt_LocationInfo? locationInfo = null; |
| | | string CarChargingStation = AppSettings.Configuration[nameof(CarChargingStation)];//è·åç©¿æ¢è½¦å
çµä½ç½® |
| | | var ChargingStations = CarChargingStation.Split(","); |
| | | locationInfo = BaseDal.QueryFirst(x => !ChargingStations.Contains(x.LocationCode) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.Row == 3, _emptyAssignOrderBy); |
| | | |
| | | if (locationInfo == null) |
| | | locationInfo = BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.Row == 1), _emptyAssignOrderBy); |
| | | locationInfo = BaseDal.QueryFirst(x => !ChargingStations.Contains(x.LocationCode) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.Row == 1), _emptyAssignOrderBy); |
| | | if (locationInfo == null) |
| | | locationInfo = BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.Row == 2), _emptyAssignOrderBy); |
| | | locationInfo = BaseDal.QueryFirst(x => !ChargingStations.Contains(x.LocationCode) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.Row == 2), _emptyAssignOrderBy); |
| | | return locationInfo; |
| | | } |
| | | |
| | | public Dt_LocationInfo AssignLocation(string[] Stations) |
| | | { |
| | | Dt_LocationInfo? locationInfo = null; |
| | | locationInfo = BaseDal.QueryData(x => Stations.Contains(x.LocationCode) && x.CurrentQty < x.MaxQty - 1, _emptyAssignOrderBy).First(); |
| | | var locationInfos = BaseDal.QueryData(x => Stations.Contains(x.LocationCode) && x.CurrentQty < x.MaxQty - 1, _emptyAssignOrderBy); |
| | | if (locationInfos != null && locationInfos.Count > 0) |
| | | locationInfo = locationInfos[0]; |
| | | return locationInfo; |
| | | } |
| | | /// <summary> |
| | |
| | | /// <exception cref="Exception"></exception> |
| | | public Dt_LocationInfo AssignLocation(int inboundOrderCount) |
| | | { |
| | | Dt_LocationInfo locationInfo = BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.CurrentQty < 1 && x.Row == (inboundOrderCount > 1 ? 1 : 3), _emptyAssignOrderBy); |
| | | string CarChargingStation = AppSettings.Configuration[nameof(CarChargingStation)];//è·åç©¿æ¢è½¦å
çµä½ç½® |
| | | var ChargingStations = CarChargingStation.Split(","); |
| | | Dt_LocationInfo? locationInfo = null; |
| | | var locationInfos = BaseDal.QueryData(x => !ChargingStations.Contains(x.LocationCode) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.CurrentQty < 1 && x.Row == (inboundOrderCount > 1 ? 1 : 3), _emptyAssignOrderBy); |
| | | if (locationInfos.Count > 1 && locationInfos != null) locationInfo = locationInfos[0]; |
| | | |
| | | if (locationInfo == null) |
| | | { |
| | | var locationInfos = BaseDal.QueryData(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.CurrentQty < 1), _emptyAssignOrderBy); |
| | | if (locationInfos.Count > 1) locationInfo = locationInfos[0];//éé¢çä¸ä¸ªè´§ä½ç§»åº |
| | | locationInfos = BaseDal.QueryData(x => !ChargingStations.Contains(x.LocationCode) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() && x.CurrentQty < 1), _emptyAssignOrderBy); |
| | | if (locationInfos.Count > 1 && locationInfos != null) locationInfo = locationInfos[0];//éé¢çä¸ä¸ªè´§ä½ç§»åº |
| | | } |
| | | |
| | | return locationInfo; |
| | |
| | | { |
| | | return TaskTypeGroup.OutbondGroup; |
| | | } |
| | | else if (!int.TryParse(Enum.Parse<TaskInStatusEnum>(taskType.ToString()).ToString(), out result)) |
| | | else if (!int.TryParse(Enum.Parse<TaskInboundTypeEnum>(taskType.ToString()).ToString(), out result)) |
| | | { |
| | | return TaskTypeGroup.InboundGroup; |
| | | } |
| | |
| | | /// è´¨æ£å
¥åº |
| | | /// </summary> |
| | | [Description("è´¨æ£å
¥åº")] |
| | | InQuality = 203 |
| | | InQuality = 203, |
| | | |
| | | /// <summary> |
| | | /// å
¥ç©ºæ |
| | | /// </summary> |
| | | [Description("å
¥ç©ºæ")] |
| | | PalletInbound = 204, |
| | | } |
| | | |
| | | public enum TaskOutboundTypeEnum |
| | |
| | | /// </summary> |
| | | [Description("è´¨æ£åºåº")] |
| | | OutQuality = 103, |
| | | |
| | | /// <summary> |
| | | /// åºç©ºæ |
| | | /// </summary> |
| | | [Description("åºç©ºæ")] |
| | | PalletOutbound = 104, |
| | | } |
| | | |
| | | public enum TaskRelocationTypeEnum |
| | |
| | | [ImporterHeader(Name = "å建æ¶é´")] |
| | | [ExporterHeader(DisplayName = "å建æ¶é´")] |
| | | [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "å建æ¶é´")] |
| | | public DateTime CreateDate { get; set; }= DateTime.Now; |
| | | public DateTime CreateDate { get; set; } |
| | | |
| | | #endregion |
| | | |
| | |
| | | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] |
| | | [assembly: System.Reflection.AssemblyDescriptionAttribute("dddddddddddddddddddddddddddddddddddd")] |
| | | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.1.0")] |
| | | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.1+58ebc83f3892b4d84d2cb07a388ac361268a4a19")] |
| | | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.1")] |
| | | [assembly: System.Reflection.AssemblyProductAttribute("WIDESEA_Core")] |
| | | [assembly: System.Reflection.AssemblyTitleAttribute("WIDESEA_Core")] |
| | | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.1.0")] |
| | |
| | | 5be948cc7d84038f5664f907cc9b5068af9b31c625e366a3c7e4d48129ec9d99 |
| | | 264e59f6345328726b244104627f6ef423db410c687b2b588086157df0b522f6 |
| | |
| | | Dispatchertime = DateTime.Now, |
| | | }; |
| | | Db.Ado.BeginTran(); |
| | | _stockService.StockInfoService.AddStockEmpty(barcode); |
| | | WebResponseContent content = _stockService.StockInfoService.AddStockEmpty(barcode); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | _taskRepository.AddData(task); |
| | | List<WMSTaskDTO> wMSTaskDTOs = _mapper.Map<List<WMSTaskDTO>>(new List<Dt_Task> { task }); |
| | | var ResultData = HttpHelper.PostAsync(WCSInterfaceAddress.ReceiveTask, wMSTaskDTOs.ToJson(), headers: new Dictionary<string, string>()); |
| | | if (ResultData.Result == null) throw new Exception($"åWCSä¸å空æå
¥åºä»»å¡è¶
æ¶"); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result); |
| | | content = JsonConvert.DeserializeObject<WebResponseContent>(ResultData.Result); |
| | | if (content == null) throw new Exception($"ä¸å空æå
¥åºä»»å¡WCSæ ååº"); |
| | | if (!content.Status) throw new Exception(content.Message); |
| | | Db.Ado.CommitTran(); |
| | | } |
| | | else |
| | | throw new Exception($"æçå·ã{barcode}ãå·²åå¨ä»»å¡"); |
| | | #endregion |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.Outbound; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | |
| | | private readonly IStockInfoService _stockService; |
| | | private readonly IStockInfoDetailService _stockDetailService; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IBasicRepository _basicRepository; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly SqlSugarClient _dbBase; |
| | | |
| | | public IOutboundOrderRepository Repository => BaseDal; |
| | | |
| | | public OutboundOrderService(IOutboundOrderRepository BaseDal, IMapper mapper, IMaterielInfoService materielInfoService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService, IUnitOfWorkManage unitOfWorkManage,ITaskRepository taskRepository) : base(BaseDal) |
| | | public OutboundOrderService(IOutboundOrderRepository BaseDal, IBasicRepository basicRepository, IMapper mapper, IMaterielInfoService materielInfoService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService, IUnitOfWorkManage unitOfWorkManage,ITaskRepository taskRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _materielInfoService = materielInfoService; |
| | | _stockDetailService = stockDetailService; |
| | | _basicRepository = basicRepository; |
| | | _stockService = stockInfoService; |
| | | _dbBase = unitOfWorkManage.GetDbClient(); |
| | | _taskRepository = taskRepository; |
| | |
| | | { |
| | | ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>(); |
| | | ISugarQueryable<Dt_StockInfoDetail> sugarQueryable2 = _dbBase.Queryable<Dt_StockInfoDetail>(); |
| | | List<StockViewDTO1> list = sugarQueryable1.InnerJoin(sugarQueryable2, (a, b) => a.Id == b.StockId && b.MaterielName.Contains("空æ") && a.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt()).Select((a, b) => new StockViewDTO1 |
| | | List<StockViewDTO1> list = sugarQueryable1.InnerJoin(sugarQueryable2, (a, b) => a.Id == b.StockId && b.MaterielName.Contains("空æç") && a.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt()).Select((a, b) => new StockViewDTO1 |
| | | { |
| | | LocationCode = a.LocationCode, |
| | | PalletCode = a.PalletCode, |
| | |
| | | if (stockViewDTO == null) throw new Exception("æªæ¾å°å¯åºåºç©ºæ"); |
| | | Dt_LocationInfo locationInfo = _dbBase.Queryable<Dt_LocationInfo>().Where(x => x.LocationCode == stockViewDTO.LocationCode).First(); |
| | | if (locationInfo == null) throw new Exception($"æªæ¾å°è´§ä½ã{stockViewDTO.LocationCode}ãä¿¡æ¯"); |
| | | Dt_StockInfo stockInfo = sugarQueryable1.Where(x => x.Id == stockViewDTO.StockId).Includes(x => x.Details).First(); |
| | | Dt_StockInfo stockInfo = _stockService.Repository.QueryFirst(a => a.Id == stockViewDTO.StockId); |
| | | if (stockInfo == null) throw new Exception($"æªæ¾å°ç©ºæåºåä¿¡æ¯"); |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºä¸.ObjToInt(); |
| | | stockInfo.Details.ForEach(x => |
| | | { |
| | | x.Status = StockStatusEmun.åºåºä¸.ObjToInt(); |
| | | }); |
| | | locationInfo.CurrentQty--; |
| | | Dt_Task _Task = new Dt_Task() |
| | | { |
| | | CurrentAddress = locationInfo.LocationCode, |
| | | NextAddress = "SC01", |
| | | SourceAddress = locationInfo.LocationCode, |
| | | TargetAddress = "SC01", |
| | | SourceIsPickPlace = locationInfo.Row == 1 ? false : locationInfo.CurrentQty == locationInfo.MaxQty, |
| | | TargetIsPickPlace = false, |
| | | TargetAddress = "1008", |
| | | CreateDate = DateTime.Now, |
| | | Creater = "System", |
| | | PalletCode = stockViewDTO.PalletCode, |
| | |
| | | TaskType = TaskTypeEnum.PalletOutbound.ObjToInt(), |
| | | Dispatchertime = DateTime.Now, |
| | | }; |
| | | List<WMSTaskDTO> wMSTaskDTOs = _mapper.Map<List<WMSTaskDTO>>(_Task); |
| | | locationInfo.CurrentQty--; |
| | | List<WMSTaskDTO> wMSTaskDTOs = _mapper.Map<List<WMSTaskDTO>>(new List<Dt_Task>() { _Task }); |
| | | Db.Ado.BeginTran(); |
| | | _dbBase.Updateable(locationInfo); |
| | | _stockService.UpdateData(stockInfo); |
| | | _stockDetailService.UpdateData(stockInfo.Details); |
| | | _basicRepository.LocationInfoRepository.UpdateData(locationInfo); |
| | | _stockService.Repository.UpdateData(stockInfo); |
| | | _taskRepository.AddData(_Task); |
| | | var ResultData = HttpHelper.PostAsync(WCSInterfaceAddress.ReceiveTask, wMSTaskDTOs.ToJson(), headers: new Dictionary<string, string>()); |
| | | if (ResultData.Result == null) throw new Exception($"åWCSä¸å空æåºåºä»»å¡è¶
æ¶"); |
| | |
| | | //} |
| | | var task = BaseDal.QueryFirst(x => x.PalletCode == lineDTO.Barcode); |
| | | if (task == null) throw new Exception($"æªæ¾å°æçå·[{lineDTO.Barcode}]çå
¥åºä»»å¡"); |
| | | if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt()) return content; |
| | | if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt()) |
| | | { |
| | | task.NextAddress = "1004"; |
| | | task.CurrentAddress = lineDTO.stationCode; |
| | | task.TaskState = (int)InTaskStatusEnum.Line_InExecuting; |
| | | BaseDal.UpdateData(task); |
| | | return content; |
| | | } |
| | | if (task.TaskType != TaskTypeEnum.Inbound.ObjToInt()) throw new Exception($"æªæ¾å°æçå·[{lineDTO.Barcode}]çå
¥åºä»»å¡"); |
| | | |
| | | //if (task.TaskState != (int)InTaskStatusEnum.AGV_InFinish) throw new Exception($"æçå·[{lineDTO.Barcode}]çå
¥åºä»»å¡ç¶æä¸å¹é
"); |
| | |
| | | Dt_LocationInfo? locationInfo = null; |
| | | string CarChargingStation = AppSettings.Configuration[nameof(CarChargingStation)];//è·åç©¿æ¢è½¦å
çµä½ç½® |
| | | var ChargingStations = CarChargingStation.Split(","); |
| | | Dt_StockInfoDetail instockInfoDetail = _stockService.StockInfoDetailService.Repository.QueryData(x => x.MaterielCode == stockInfoDetail.MaterielCode).OrderByDescending(x => x.CreateDate).First(); |
| | | Dt_StockInfoDetail? instockInfoDetail = null; |
| | | var instockInfoDetails = _stockService.StockInfoDetailService.Repository.QueryData(x => x.MaterielCode == stockInfoDetail.MaterielCode && x.Status == StockStatusEmun.å·²å
¥åº.ObjToInt()); |
| | | if (instockInfoDetails != null && instockInfoDetails.Count > 0) |
| | | instockInfoDetail = instockInfoDetails.OrderByDescending(x => x.CreateDate).First(); |
| | | if (instockInfoDetail != null) instockInfo = _stockService.StockInfoService.Repository.GetStockInfo(instockInfoDetail.StockId); |
| | | if (instockInfo != null)//æ åºå |
| | | { |
| | |
| | | } |
| | | if (locationInfo == null) locationInfo = _basicService.LocationInfoService.AssignLocation(2);//éæ°åé
è´§ä½ |
| | | if (locationInfo == null) throw new Exception($"æ å¯å
¥è´§ä½"); |
| | | Dt_LocationInfo? locationInfo1 = null; |
| | | if (locationInfo.Row == 1) |
| | | { |
| | | locationInfo1 = _basicService.LocationInfoService.Repository.QueryFirst(x => x.Row == 2 && x.Layer == locationInfo.Layer && x.Column == locationInfo.Column); |
| | | locationInfo1.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | } |
| | | |
| | | task.TaskState = (int)InTaskStatusEnum.SC_InExecuting; |
| | | task.CurrentAddress = task.NextAddress; |
| | |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | if (locationInfo1 != null) _basicService.LocationInfoService.Repository.UpdateData(locationInfo1); |
| | | Db.Ado.CommitTran(); |
| | | |
| | | return WebResponseContent.Instance.OK(data: new ReceiveWMSInfo() |
| | |
| | | CurrentAddress = stockInfo.LocationCode, |
| | | Grade = 0, |
| | | PalletCode = stockInfo.PalletCode, |
| | | TargetIsPickPlace = false, |
| | | SourceIsPickPlace = locationInfo.Row == 1 ? false : stockInfo.SerialNumber == locationInfo.MaxQty, |
| | | NextAddress = "1008", |
| | | Roadway = locationInfo.RoadwayNo, |
| | | SourceAddress = stockInfo.LocationCode, |
| | |
| | | { |
| | | var locationInfo1 = _basicService.LocationInfoService.Repository.QueryFirst(x => x.Row == 2 && x.Column == locationInfo.Column && x.Layer == locationInfo.Layer); |
| | | stockInfos = _stockService.StockInfoService.Repository.QueryData(x => locationInfo1.LocationCode == x.LocationCode).OrderByDescending(x => x.SerialNumber).ToList(); |
| | | if (stockInfos == null|| stockInfos.Count < 1) |
| | | if (stockInfos == null || stockInfos.Count < 1) |
| | | { |
| | | return (dt_Tasks, locationInfos, stockInfos); |
| | | } |
| | |
| | | { |
| | | CurrentAddress = item.LocationCode, |
| | | SourceIsPickPlace = item.SerialNumber == 12, |
| | | TargetIsPickPlace = i == 12, |
| | | TargetIsPickPlace = i == 12 ? locationInfo2.Row != 1 : false, |
| | | Grade = 0, |
| | | PalletCode = item.PalletCode, |
| | | NextAddress = locationInfo2.LocationCode, |
| | |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == WMStask.TaskNum && x.TaskType == WMStask.TaskType); |
| | | if (task == null) return WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | if (task.TaskType == (int)TaskTypeEnum.Inbound) |
| | | if (TaskEnumHelper.GetTaskTypeGroup(task.TaskType) == TaskTypeGroup.InboundGroup) |
| | | { |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>(); |
| | | if (WMStask.TaskState != nextStatus) return WebResponseContent.Instance.Error($"该任å¡ç¶ææè¯¯,ä»»å¡å·:ã{task.TaskNum}ã,ä»»å¡ç¶æ:ã{task.TaskState}ã"); |
| | |
| | | break; |
| | | //case (int)TaskOutStatusEnum.Line_OutFinish: |
| | | |
| | | //break; |
| | | //break; |
| | | case (int)TaskOutStatusEnum.OutFinish: |
| | | UpdateTaskStatusOutFinish(task); |
| | | break; |
| | |
| | | } |
| | | if (Sourcelocation != null) |
| | | { |
| | | Sourcelocation.CurrentQty--; |
| | | if (task.TaskType == TaskOutboundTypeEnum.Outbound.ObjToInt()) Sourcelocation.CurrentQty--; |
| | | if (Sourcelocation.CurrentQty == 0) |
| | | { |
| | | Sourcelocation.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | |
| | | if (Sourcelocation.Row == 1 && Sourcelocation.LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | { |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.Row == 2 && x.Column == Sourcelocation.Column && x.Layer == Sourcelocation.Layer); |
| | | if (locationInfo.CurrentQty == 0 && locationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt()) |
| | | if (locationInfo.CurrentQty == 0 /*&& locationInfo.LocationStatus == LocationStatusEnum.Free.ObjToInt()*/) |
| | | { |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | locationInfo.EnableStatus = EnableStatusEnum.Normal.ObjToInt(); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | Dt_OutStockLockInfo? outStockLockInfo = _outboundService.OutboundStockLockInfoService.Repository.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | Dt_OutboundOrder? outboundOrder = null; |
| | | int overCount = 0; |
| | | if (outStockLockInfo != null) |
| | | { |
| | | Dt_OutboundOrder outboundOrder = null; |
| | | int overCount = 0; |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == outStockLockInfo.OrderDetailId); |
| | | if (outboundOrderDetail != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | outStockLockInfo.Status = OutLockStockStatusEnum.åºåºå®æ.ObjToInt(); |
| | | Db.Ado.BeginTran(); |
| | | if (outboundOrder != null && outboundOrder.Details.Count == overCount) |
| | | { |
| | | outboundOrder.OrderStatus = OutboundStatusEnum.åºåºå®æ.ObjToInt(); |
| | | _outboundService.OutboundOrderService.Repository.DeleteAndMoveIntoHty(outboundOrder, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _outboundService.OutboundOrderDetailService.Repository.DeleteAndMoveIntoHty(outboundOrder.Details, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | } |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfo); |
| | | Db.Ado.CommitTran(); |
| | | } |
| | | Db.Ado.BeginTran(); |
| | | if (outboundOrder != null && outboundOrder.Details.Count == overCount) |
| | | { |
| | | outboundOrder.OrderStatus = OutboundStatusEnum.åºåºå®æ.ObjToInt(); |
| | | _outboundService.OutboundOrderService.Repository.DeleteAndMoveIntoHty(outboundOrder, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _outboundService.OutboundOrderDetailService.Repository.DeleteAndMoveIntoHty(outboundOrder.Details, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | } |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _outboundService.OutboundStockLockInfoService.Repository.UpdateData(outStockLockInfo); |
| | | Db.Ado.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | |
| | | if (stockInfo.StockStatus != StockStatusEmun.å
¥åºä¸.ObjToInt()) throw new Exception($"æç[{task.PalletCode}],该ç»çç¶æä¸å¯å
¥åº"); |
| | | Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(x => x.StockId == stockInfo.Id); |
| | | |
| | | if (task.TaskType == TaskTypeEnum.PalletInbound.ObjToInt()) |
| | | { |
| | | stockInfo.SerialNumber = locationInfo.CurrentQty; |
| | | stockInfo.InDate = DateTime.Now; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | stockInfoDetail.Status = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = string.Empty; |
| | | Db.Ado.BeginTran(); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetail); |
| | | Db.Ado.CommitTran(); |
| | | return content; |
| | | } |
| | | #region å
¥åºå |
| | | Dt_InboundOrder inboundOrder = _inboundService.InbounOrderService.GetInboundOrder(stockInfoDetail.OrderNo); |
| | | if (inboundOrder == null || inboundOrder.Details == null) throw new Exception($"æªæ¾å°æç[{task.PalletCode}]çå
¥åºåæç»ä¿¡æ¯"); |
| | |
| | | res => { |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |
| | | title: "æå", |
| | | title: "空æå
¥åºç³è¯·æå", |
| | | type: "success" |
| | | }) |
| | | this.barcode = ""; |
| | |
| | | } |
| | | }, |
| | | PdaOutEmpty(){ |
| | | this.$u.post('/api/PDA/PdaOutEmpty').then( |
| | | this.$u.post('/api/PDA/OutEmpty').then( |
| | | res => { |
| | | if (res.status) { |
| | | this.$refs.uToast.show({ |