| | |
| | | using Tiger.Model; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Business.WMS.Common; |
| | | using Org.BouncyCastle.Ocsp; |
| | | using Tiger.Model.Sharetronic.Shelf; |
| | | using MailKit.Search; |
| | | using Tiger.Business.WMS.Extensions; |
| | | using static Tiger.Model.BIZ_WMS_PREP_BTH; |
| | | using Microsoft.CodeAnalysis.Options; |
| | | |
| | | namespace Tiger.Business.WMS.Transaction |
| | | { |
| | |
| | | var actQty = CurPrepDtl.QTY_PREP > CurPREP.BizType.GetActReqQty(CurPrepDtl) ? 0 : (CurPREP.BizType.GetActReqQty(CurPrepDtl) - CurPrepDtl.QTY_PREP); |
| | | if (inv != null && actQty > 0) |
| | | { |
| | | inv.poolItem = inv.Item.GetPoolItem(OrgCode, nameof(CurPREP.Order), CurPrepDtl.ORDER_NO, CurPrepDtl.ORDER_LINE, actQty, true); |
| | | inv.poolItem = inv.Item.GetPoolItem(OrgCode, TransID, nameof(CurPREP.Order), CurPrepDtl.ORDER_NO, CurPrepDtl.ORDER_LINE, actQty, true); |
| | | } |
| | | else |
| | | { |
| | |
| | | var actQty = CurPrepDtl.QTY_PREP > CurPREP.BizType.GetActReqQty(CurPrepDtl) ? 0 : (CurPREP.BizType.GetActReqQty(CurPrepDtl) - CurPrepDtl.QTY_PREP); |
| | | Result<List<SuggestItem>> result = Suggest(CurPrepDtl.ORDER_NO, CurPrepDtl.ITEM_CODE, option, input.AuthOption, actQty); |
| | | action.LocaleMsg = result.LocaleMsg; |
| | | if (result.IsException) |
| | | if (result.IsException || result.IsFailed) |
| | | { |
| | | action.IsSuccessed = false; |
| | | return action; |
| | |
| | | { |
| | | if (remain > 0) |
| | | { |
| | | inv.poolItem = inv.Item.GetPoolItem(input.AuthOption.OrgCode, nameof(CurPREP.Order), CurPrepDtl.ORDER_NO, CurPrepDtl.ORDER_LINE, remain, false); |
| | | inv.poolItem = inv.Item.GetPoolItem(OrgCode, TransID, nameof(CurPREP.Order), CurPrepDtl.ORDER_NO, CurPrepDtl.ORDER_LINE, remain, false); |
| | | remain -= inv.poolItem.ALLOC_QTY; |
| | | } |
| | | else |
| | |
| | | { |
| | | var prepDtl = MainDB.Queryable<BIZ_WMS_PREP_DTL>().Where(q => q.ID == CurPrepDtl.ID).First(); |
| | | prepDtl.Suggests = Suggests; |
| | | CurPrepDtl = prepDtl; |
| | | prepDtl.Deliverys = MainDB.Queryable<BIZ_WMS_PREP_SN>().Where(q => q.ORDER_NO == CurPrepDtl.ORDER_NO && q.ORDER_LINE == CurPrepDtl.ORDER_LINE && q.STATUS == WMS_ITEM.STATUSs.OffShelf.GetValue()).ToList(); |
| | | CurPrepDtl = prepDtl; |
| | | CurPREP.Order.Details.RemoveAll(q => q.ID == CurPrepDtl.ID); |
| | | CurPREP.Order.Details.Add(CurPrepDtl); |
| | | action.Data = CurPrepDtl; |
| | |
| | | action.LocaleMsg = Biz.L("WMS.Out_BIZ_WMS_PREP.ScanItem.NoNeedItemCode", inv.CurPkg.SN, CurPrepDtl.ITEM_CODE); |
| | | return action; |
| | | } |
| | | //判断是否在备料数量已经超过需求数量则不允许继续发料 |
| | | if (CurPrepDtl.QTY_PREP > CurPREP.BizType.GetActReqQty(CurPrepDtl)) |
| | | { |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = Biz.L($"当前物料[{0}]实际需求[{1}]已备料[{2}],无需继续下架,请放回原储位并选择其他物料行继续操作"); |
| | | action.LocaleMsg = Biz.L("WMS.Out_BIZ_WMS_PREP.ScanItem.PrepQtyEnough", CurPrepDtl.ITEM_CODE, CurPREP.BizType.GetActReqQty(CurPrepDtl), CurPrepDtl.QTY_PREP); |
| | | return action; |
| | | } |
| | | //判断是否在备料中的物料 |
| | | //if (!CurPREP.Order.Details.Any(q => q.ITEM_CODE == inv.ItemInfo.ITEM_CODE)) |
| | | //{ |
| | |
| | | // action.LocaleMsg = Biz.L("WMS.Out_BIZ_WMS_PREP.ScanItem.NoNeedItemCode", inv.ItemInfo.ITEM_CODE.IsNullOrEmpty(inv.Barcode.ItemCode)); |
| | | // return action; |
| | | //} |
| | | |
| | | |
| | | //ProcessingOrderDetail = input.SN; |
| | | //if (WMSContext.TransactionDic.Where(q => !string.IsNullOrWhiteSpace(q.Value.ProcessingSn)).Any(q => q.Value.ProcessingSn == ProcessingSn && q.Value.TransID != this.TransID)) |
| | | //{ |
| | |
| | | { |
| | | //action.LocaleMsg = Biz.L($"条码[{0}]扫描成功,备料物料[{1}]需求[{2}]还需备料[{3}],条码需要截料,发出数量[{4}]"); |
| | | //action.LocaleMsg = Biz.L($"条码[{0}]扫描成功,备料物料[{1}]需求[{2}]还需备料[{3}],请选择要超发还是截料?"); |
| | | action.LocaleMsg = Biz.L($"WMS.Out_BIZ_WMS_PREP.ScanItem.Success{(isNeedCut ? "" : "Confirm")}", CurInvItem.SN, CurInvItem.ItemInfo.ITEM_CODE, CurPREP.BizType.GetActReqQty(CurPrepDtl), actQty); |
| | | action.LocaleMsg = Biz.L($"WMS.Out_BIZ_WMS_PREP.ScanItem.Success{(isNeedCut ? "" : "Confirm")}", CurInvItem.SN, CurInvItem.ItemInfo.ITEM_CODE, CurPREP.BizType.GetActReqQty(CurPrepDtl), actQty, CurSn.Sum(q => q.QTY_DLVY)); |
| | | action.Data.Command = "ConfirmExceed"; |
| | | action.Data.Data = new |
| | | { |
| | |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = Biz.L($"条码[{0}]扫描成功,备料物料[{1}]需求[{2}]还需备料[{3}],条码需要截料,发出数量[{4}]"); |
| | | //action.LocaleMsg = Biz.L($"条码[{0}]扫描成功,备料物料[{1}]需求[{2}]还需备料[{3}],请选择要超发还是截料?"); |
| | | action.LocaleMsg = Biz.L($"WMS.Out_BIZ_WMS_PREP.ScanItem.Success{(isNeedCut ? "" : "Confirm")}", CurInvItem.SN, CurInvItem.ItemInfo.ITEM_CODE, CurPREP.BizType.GetActReqQty(CurPrepDtl), actQty); |
| | | action.LocaleMsg = Biz.L($"WMS.Out_BIZ_WMS_PREP.ScanItem.Success{(isNeedCut ? "" : "Confirm")}", CurInvItem.SN, CurInvItem.ItemInfo.ITEM_CODE, CurPREP.BizType.GetActReqQty(CurPrepDtl), actQty, CurSn.Sum(q => q.QTY_DLVY)); |
| | | action.Data.Command = "ConfirmExceed"; |
| | | action.Data.Data = new |
| | | { |
| | |
| | | /// <returns></returns> |
| | | public async Task<ApiAction> GenerateDlvyBatch(BaseInput input) |
| | | { |
| | | var range = input.Data.ToInt32().GetEnum<BATCH_RANGEs>(); |
| | | var range = input.Data.ToInt32().GetEnum<BIZ_WMS_PREP_BTH.BATCH_RANGEs>(); |
| | | //从数据库更新当前单据的所有信息 |
| | | CurPREP.Order = MainDB.Queryable<BIZ_WMS_PREP>().Where(q => q.ID == CurPREP.Order.ID).IncludesAllFirstLayer().First(); |
| | | var action = await CurPREP.Order.BIZ_TYPE.GetEnum<BIZ_WMS_PREP.BIZ_TYPEs>() .GenerateDlvyBatch(this, range); |
| | | return action; |
| | | } |
| | |
| | | //CloseLight(LocationHis).Wait(); |
| | | if (!(CurPREP?.Order?.ORDER_NO ?? "").IsNullOrEmpty()) |
| | | { |
| | | MainDB.Deleteable<WMS_ITEM_POOL>().Where(x => x.TRANS_NO == CurPREP.Order.ORDER_NO).ExecuteCommand(); |
| | | MainDB.Deleteable<WMS_ITEM_POOL>().Where(q => q.TRANS_NO == CurPREP.Order.ORDER_NO || q.TRANS_ID == TransID).ExecuteCommand(); |
| | | } |
| | | |
| | | this.IsFinished = true; |