| | |
| | | case (int)TaskOutboundTypeEnum.OutTray: |
| | | case (int)TaskOutboundTypeEnum.Outbound: |
| | | case (int)TaskOutboundTypeEnum.OutNG: |
| | | case (int)TaskOutboundTypeEnum.OutQuality: |
| | | |
| | | LogFactory.GetLog("任务完成").InfoFormat(true, "出库任务", ""); |
| | | return await CompleteStackTaskAsync(task, stock); |
| | |
| | | |
| | | // 获取组盘信息 |
| | | private DtBoxingInfo CreateBoxingInfo(ResultTrayCellsStatus result, string palletCode) |
| | | { |
| | | var boxing=_boxingInfoRepository.QueryFirst(x=>x.PalletCode== palletCode); |
| | | { |
| | | var boxing=_boxingInfoRepository.QueryFirst(x=>x.PalletCode == palletCode); |
| | | if (boxing == null) |
| | | { |
| | | return new DtBoxingInfo |
| | |
| | | }).ToList() |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | else { |
| | | _boxingInfoRepository.DeleteData(boxing); |
| | | return new DtBoxingInfo |
| | | { |
| | |
| | | IsFull = true, |
| | | ProcessCode = result.ProcessCode, |
| | | ProductionLine = result.ProductionLine, |
| | | BoxingInfoDetails = result.SerialNos.Select(serialNoObj => new DtBoxingInfoDetail |
| | | BoxingInfoDetails = result.SerialNos.Select(seriaINoObj => new DtBoxingInfoDetail |
| | | { |
| | | SerialNumber = serialNoObj.SerialNo, |
| | | OrderNo = serialNoObj.PositionNo.ToString(), |
| | | Status = serialNoObj.SerialNoStatus, |
| | | SerialNumber = seriaINoObj.SerialNo, |
| | | OrderNo = seriaINoObj.PositionNo.ToString(), |
| | | Status = seriaINoObj.SerialNoStatus, |
| | | MaterielCode = result.BindCode, |
| | | Remark = result.TrayBarcodePropertys.ToJsonString(), |
| | | }).ToList() |
| | | }; |
| | | } |
| | | |
| | | } |
| | | |
| | | // 获取工艺申请 |
| | |
| | | DtStockInfo stockInfo = tag == (int)TaskOutboundTypeEnum.Outbound |
| | | ? areaCode != "CWSC1" ? await QueryStockInfoForRealTrayAsync(areaCode, areaCodes, productionLine) : await QueryStockInfoForRealTrayCWAsync(areaCodes, productionLine) |
| | | : await QueryStockInfoForEmptyTrayAsync(areaCode, position); |
| | | |
| | | if (stockInfo == null) |
| | | { |
| | | return content.Error("库存信息不存在"); |
| | |
| | | } |
| | | else |
| | | { |
| | | task = CreateTask(stockInfo, "1049-1", taskType); |
| | | task = CreateTask(stockInfo, "1049-8", taskType); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | #region 更新库存信息(暂时不需要) |
| | | if (stock.IsFull) |
| | | { |
| | | // 查询符合条件的库存信息 |
| | | var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration); |
| | | //if (stock.IsFull) |
| | | //{ |
| | | // // 查询符合条件的库存信息 |
| | | // var stocks = _stockInfoRepository.QueryData(x => x.AreaCode == stock.AreaCode && x.ProductionLine == stock.ProductionLine && x.SpecialParameterDuration != stock.SpecialParameterDuration); |
| | | |
| | | // 查询任务信息 |
| | | var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList(); |
| | | // // 查询任务信息 |
| | | // var tasks = BaseDal.QueryData(x => x.PalletCode != stock.PalletCode && x.ProductionLine == stock.ProductionLine).Select(x => x.PalletCode).ToList(); |
| | | |
| | | if (stocks != null && stocks.Count > 0) |
| | | { |
| | | // 过滤出需要更新的库存信息 |
| | | var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList(); |
| | | foreach (var item in stocksToUpdate) |
| | | { |
| | | // 更新库存信息的特定参数 |
| | | item.SpecialParameterDuration = stock.SpecialParameterDuration; |
| | | item.ParameterInfos = stock.ParameterInfos; |
| | | item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration)); |
| | | } |
| | | if (stocksToUpdate.Count > 0) |
| | | { |
| | | // 异步更新库存信息 |
| | | var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate); |
| | | } |
| | | } |
| | | } |
| | | // if (stocks != null && stocks.Count > 0) |
| | | // { |
| | | // // 过滤出需要更新的库存信息 |
| | | // var stocksToUpdate = stocks.Where(item => !tasks.Contains(item.PalletCode)).ToList(); |
| | | // foreach (var item in stocksToUpdate) |
| | | // { |
| | | // // 更新库存信息的特定参数 |
| | | // item.SpecialParameterDuration = stock.SpecialParameterDuration; |
| | | // item.ParameterInfos = stock.ParameterInfos; |
| | | // item.OutboundTime = Convert.ToDateTime(item.LinedProcessFeedbackTime == null ? item.CreateDate : item.LinedProcessFeedbackTime).AddHours(Convert.ToDouble(stock.SpecialParameterDuration)); |
| | | // } |
| | | // if (stocksToUpdate.Count > 0) |
| | | // { |
| | | // // 异步更新库存信息 |
| | | // var isUpdates = await _stockInfoRepository.UpdateDataAsync(stocksToUpdate); |
| | | // } |
| | | // } |
| | | //} |
| | | #endregion |
| | | |
| | | // 添加历史任务 |