HMI平板派工工序报工后自动关闭当前派工任务
【应用场景】
HMI平板派工工序报工后自动关闭当前派工任务
【实现步骤】
<1>扩展元数据 SFC_MobileComplexDispReportBillEdit,新增二开插件,继承于ComplexDispatchReportEdit,同时重写方法AfterInvokeBillOperation;代码如下:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Kingdee.BOS.Core.Metadata; using Kingdee.BOS.Orm; using Kingdee.BOS.Orm.DataEntity; using Kingdee.BOS.ServiceHelper; using Kingdee.K3.Core.MFG; using Kingdee.K3.Core.MFG.EnumConst; using Kingdee.K3.MFG.App; namespace Kingdee.K3.MFG.Mobile.Business.PlugIn.SFC.Complex { public class Class1 : ComplexDispatchReportEdit { /// <summary> /// 调用操作后 /// </summary> /// <param name="e"></param> public override void AfterInvokeBillOperation(BOS.Mobile.PlugIn.AfterInvokeBillOperationEventArgs e) { switch (e.OperationNumber) { case "Save": DynamicObject tempObject = e.OperationResult.SuccessDataEnity.FirstOrDefault(); DateTime currTime = AppServiceContext.GetSysDate(this.Context); long dispatchDetailEntryId = Convert.ToInt64( ((DynamicObjectCollection) tempObject["OptRptEntry"]).FirstOrDefault()[ "DispatchDetailEntryId"]); OQLFilter filter = OQLFilter.CreateHeadEntityFilter(string.Format("FOperId={0}", Convert.ToInt64( ((DynamicObjectCollection) tempObject["OptRptEntry"]).FirstOrDefault()["OptPlanOptId"]))); DynamicObject dispatchObj = BusinessDataServiceHelper.Load(this.Context, "SFC_DispatchDetail", null, filter) .FirstOrDefault(); DynamicObjectCollection entryColls = dispatchObj["DispatchDetailEntry"] as DynamicObjectCollection; DynamicObject entry = entryColls.Where(o => dispatchDetailEntryId.Equals(o["Id"])).FirstOrDefault(); if (entry != null) { if (Convert.ToDecimal(entry["FinishSelQty"]) == 0) { entryColls.Remove(entry); } else { entry[CONST_SFC_DispatchDetail.CONST_FEntity.ORM_BaseWorkQty] = entry[CONST_SFC_DispatchDetail.CONST_FEntity.ORM_BaseFinishSelQty]; entry[CONST_SFC_DispatchDetail.CONST_FEntity.ORM_WorkQty] = entry[CONST_SFC_DispatchDetail.CONST_FEntity.ORM_FinishSelQty]; entry[CONST_SFC_DispatchDetail.CONST_FEntity.ORM_WorkHeadQty] = entry[CONST_SFC_DispatchDetail.CONST_FEntity.ORM_FinishSelHeadQty]; entry["Status"] = SFCDispatchStatusConst.FinishStatus; entry["EndTime"] = currTime; } } FormMetadata metadata = (FormMetadata) MetaDataServiceHelper.Load(this.Context, MFGFormIdConst.SubSys_SFC.DispatchDetail); OperateOption option = OperateOption.Create(); option.SetVariableValue("IsMobileInvoke", true); var result = BusinessDataServiceHelper.Save(this.Context, metadata.BusinessInfo, dispatchObj, option); break; } base.AfterInvokeBillOperation(e); } } }
<2>拷贝插件组件到应用站点的WebSite\Bin目录下,重启IIS。
<3>BOSIDE扩展,注册表单插件,保存元数据,开发完毕。
【参考资料】
【二开案例.基础资料.联动查询(GetValue)】
https://vip.kingdee.com/article/127710528226504960
【金蝶云星空BOS二次开发案例演示】
https://vip.kingdee.com/article/94751030918525696
HMI平板派工工序报工后自动关闭当前派工任务
【应用场景】HMI平板派工工序报工后自动关闭当前派工任务【实现步骤】<1>扩展元数据 SFC_MobileComplexDispReportBillEdit,新增二开插件,...
点击下载文档
本文2024-09-23 03:29:19发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-159182.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章