/// <summary> /// 讲信息传送入EPM的API /// </summary> /// <param name="pack">singlePackage对象</param> /// <param name="newItem">PackageItem对象</param> public void notifyEpm(SinglePackage pack, PackageItem newItem, string productionline) { try { Dictionary<string, string> data = new Dictionary<string, string>(); data.Add("entityId", productionline); data.Add("packTime", ((long)(DateTime.Now - new DateTime(1970, 1, 1)).TotalMilliseconds).ToString()); data.Add("productNr", newItem.itemUid.ToString()); data.Add("partId", pack.partNr); new EpmService().AddProductPack(data); } catch (Exception e) { LogUtil.Logger.Error(e.Message); } }
/// <summary> /// 讲信息传送入EPM的API /// </summary> /// <param name="pack">singlePackage对象</param> /// <param name="newItem">PackageItem对象</param> public void notifyEpm(SinglePackage pack, PackageItem newItem, string productionline) { try { Dictionary <string, string> data = new Dictionary <string, string>(); data.Add("entityId", productionline); data.Add("packTime", ((long)(DateTime.Now - new DateTime(1970, 1, 1)).TotalMilliseconds).ToString()); data.Add("productNr", newItem.itemUid.ToString()); data.Add("partId", pack.partNr); new EpmService().AddProductPack(data); } catch (Exception e) { LogUtil.Logger.Error(e.Message); } }
public ValidateMsg <SinglePackage> SingleCheckStore(string packageId) { using (IUnitOfWork unit = MSSqlHelper.DataContext()) { ValidateMsg <SinglePackage> msg = new ValidateMsg <SinglePackage>() { Valid = true }; try { ISinglePackageRep spr = new SinglePackageRep(unit); SinglePackage sp = spr.GetSingleById(packageId); msg.Target = sp; if (sp == null) { msg.Valid = false; msg.Message.Add("包装箱:" + packageId + " 不存在"); } else if (!PackageStatusHelper.CanStoredStatus(sp.status)) { msg.Valid = false; msg.Message.Add("包装箱:" + packageId + " 还未结束包装或标签为开箱标签!"); } else if (!spr.Valid(sp.packageID)) { msg.Valid = false; msg.Message.Add("包装箱:" + packageId + " 已经入库!"); } } catch (Exception e) { msg.Valid = false; msg.Message.Add("错误:" + e.Message); } return(msg); } }
public bool Valid(SinglePackage obj) { throw new NotImplementedException(); }