| | |
| | | |
| | | private List<MES_WIP_PKG> GetPackageList(WipPkgItem parent) |
| | | { |
| | | List<MES_WIP_PKG> list = new() { parent.Package }; |
| | | List<MES_WIP_PKG> list = new(); |
| | | if (!parent.Package.IsNullOrEmpty()) |
| | | { |
| | | list.Add(parent.Package); |
| | | } |
| | | foreach (var item in parent.Items) |
| | | { |
| | | item.Package.PARENT_SN = parent.Package.SN; |
| | | item.Package.PARENT_SN = parent.Package?.SN; |
| | | list.AddRange(GetPackageList(item)); |
| | | } |
| | | return list; |
| | |
| | | } |
| | | if (_pkgList.Any()) |
| | | { |
| | | db.Insertable(_pkgList, CurPosition.UserCode).ExecuteCommand(); |
| | | db.Storageable(_pkgList, CurPosition.UserCode).ExecuteCommand(); |
| | | foreach (var pkg in _pkgList) |
| | | { |
| | | //包装信息保存到在制品信息表 |
| | |
| | | CurPosition.NeedTemporaryStoreDBCommitAction = false; |
| | | //删除工序上下文中的包装记录 |
| | | CurPosition.Context.Remove("CurPackage"); |
| | | //action.LocaleMsg = new($"条码[{CurPkg.Item.Package?.SN}]包装完成"); |
| | | action.LocaleMsg = new("MES.WorkAction.PackingAction.PackingSuccess", CurPkg.Item.Package.SN); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | CurPosition.Context.Add("CurPackage", CurPkg); |
| | | } |
| | | //action.LocaleMsg = new($"条码[{CurPosition.CurSN}]包装完成"); |
| | | action.LocaleMsg = new("MES.WorkAction.PackingAction.PackingSuccess", CurPosition.CurSN); |
| | | } |
| | | |
| | | IsFinished = true; |
| | | action.Data.ShortMsg = new("包装完成", ShortMessage.Types.Success); |
| | | action.LocaleMsg = new($"条码[{CurPkg.Item.Package.SN}]包装完成"); |
| | | action.LocaleMsg = new("MES.WorkAction.PackingAction.PackingSuccess", CurPkg.Item.Package.SN); |
| | | |
| | | return action; |
| | | } |
| | | |