| | |
| | | using System.Threading.Tasks; |
| | | using Tiger.Model; |
| | | using Tiger.IBusiness; |
| | | using Tiger.Model.Entitys.MES.Position; |
| | | |
| | | namespace Tiger.Business.WMS.Transaction |
| | | { |
| | |
| | | { |
| | | public IOut_Default Init(string id, string userCode, string apiHost, string orgCode) |
| | | { |
| | | base.Init(id, apiHost, userCode, orgCode); |
| | | base.Init(id, userCode, apiHost, orgCode); |
| | | Logger.Console.Info($"Start {this.GetType().Name} Transaction[ID: {TransID}]"); |
| | | return this; |
| | | } |
| | |
| | | { |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = result.LocaleMsg; |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | var inv = result.Data as Inventory; |
| | | |
| | |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = Biz.L($"状态[{0}]异常,请重新扫描"); |
| | | action.LocaleMsg = Biz.L("WMS.Default.ScanItem.StatusException", string.Join(',', inv.StatusList.Select(x => x.GetDesc()))); |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | //储位验证 |
| | | if (inv.Location.IsNullOrEmpty()) |
| | |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = Biz.L($"条码[{0}]库存信息异常: 没有储位信息,请先上架后再扫描(储位Id: {1})"); |
| | | action.LocaleMsg = Biz.L("WMS.Default.ScanItem.LocationIsNull", inv.CurPkg.SN, inv.CurPkg.LOCATION_ID); |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | //物料验证 |
| | | if (inv.ItemInfo.IsNullOrEmpty() || inv.ItemInfo.IS_ACTIVE == "N") |
| | |
| | | action.IsSuccessed = false; |
| | | //action.LocaleMsg = Biz.L($"物料编码[{0}]不存在或者该物料未启用"); |
| | | action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ItemCodeNotExistsOrNotActive", inv.ItemInfo.ITEM_CODE.IsNullOrEmpty(inv.Barcode.ItemCode)); |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | CurInvItem = inv; |
| | | |
| | |
| | | action.Data.Command = Command = "ComfirmQty"; |
| | | //action.LocaleMsg = Biz.L("请确认条码[{0}]要下架的数量"); |
| | | action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ComfirmOutQty", input.SN); |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | } |
| | | |
| | |
| | | action.Data.Command = Command = "ComfirmQty"; |
| | | //action.LocaleMsg = Biz.L("下架数量不能小于等于零,请重新确认条码[{0}]的下架数量"); |
| | | action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ReComfirmOutQty", input.SN); |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | else if (qtyList.Any(q => q.QTY > CurInvItem.Items.First(i => i.SN == q.SN).QTY)) |
| | | { |
| | |
| | | action.Data.Command = Command = "ComfirmQty"; |
| | | //action.LocaleMsg = Biz.L("下架数量不能超过原条码数量,请重新确认条码[{0}]的下架数量"); |
| | | action.LocaleMsg = Biz.L("WMS.Default.ScanItem.ReComfirmExceedOutQty", input.SN); |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | else |
| | | { |
| | |
| | | action.IsSuccessed = false; |
| | | action.LocaleMsg = downResult.LocaleMsg; |
| | | ResetScan(); |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | |
| | | //灭灯 |
| | |
| | | //action.CatchExceptionWithLog(ex, $"扫描条码[{input.SN}]复核异常"); |
| | | action.CatchExceptionWithLog(ex, Biz.L("WMS.Default.ScanItem.ScanException", input.SN)); |
| | | } |
| | | return action; |
| | | return SetOutPutMqttMsg(action, input.Locale); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | //重置工序 |
| | | ResetScan(); |
| | | return action; |
| | | return SetOutPutMqttMsg(action, locale); |
| | | } |
| | | |
| | | #endregion |