生产订单二开字段(支持计划确认)携带至生产用料清单
1、生产订单二开新增文本字段,基础资料字段,如下图:
![订单1.webp](/download/010019d013daf53c45bb8f3980b08520f065.webp)
![订单2.webp](/download/01003254f1f5403a4b708962a5fbd6a5526a.webp)
2、生产用料清单二开新增文本字段,基础资料字段,如下图:
![订单3.webp](/download/010079e08472da0a4b879d5a64a267879fe5.webp)
![订单4.webp](/download/0100e72fe55388564d73b04c7ac7d8bb2e09.webp)
3、二开插件挂在生产用料清单的保存上面,如下图:
![订单5.webp](/download/010017de9f358d65421a9339891f856b9c99.webp)
二开代码示例如下:
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using Kingdee.K3.Core.MFG.EntityHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.K3.MFG.App;
using Kingdee.BOS.Orm;
using Kingdee.BOS.Core.List;
using Kingdee.K3.Core.MFG.EnumConst;
using Kingdee.BOS;
namespace EK.Kingdee.K3.MFG.PRD.App.ServicePlugIn
{
[Description("生产订单计划确认,携带生产订单上表体二开字段携带至用料清单的表体")]
public class MoEKFieldToPPBOM : AbstractOperationServicePlugIn
{
public override void BeginOperationTransaction(global::Kingdee.BOS.Core.DynamicForm.PlugIn.Args.BeginOperationTransactionArgs e)
{
base.BeginOperationTransaction(e);
if (e.DataEntitys.IsEmpty()) return;
//CONST_PRD_PPBOM:需要引用kingdee.k3.mfg.prd.commom.cord.dll
long[] moEntryIds = e.DataEntitys.Select(s => s.GetDynamicValue<long>(CONST_PRD_PPBOM.CONST_FBillHead.ORM_MOEntryID)).Distinct().ToList().ToArray();
string sql = string.Format(@"SELECT T.FENTRYID,T.FEKTEXT,T.FEKCUSTOMID FROM T_PRD_MOENTRY T INNER JOIN {0} TT ON T.FENTRYID=TT.FID ", StringUtils.GetSqlWithCardinality(moEntryIds.Length, "@MOENTRYIDS", 1));
List<SqlParam> sqlParmas = new List<SqlParam>();
sqlParmas.Add(new SqlParam("@MOENTRYIDS", KDDbType.udt_inttable, moEntryIds));
DynamicObjectCollection objs = AppServiceContext.DbUtils.ExecuteDynamicObject(this.Context, sql, sqlParmas.ToArray());
Dictionary<long, IGrouping<long, DynamicObject>> dicObjs = new Dictionary<long, IGrouping<long, DynamicObject>>();
if (!objs.IsEmpty())
{
dicObjs = objs.GroupBy(g => g.GetDynamicValue<long>("FENTRYID")).ToDictionary(d => d.Key);
}
foreach (DynamicObject data in e.DataEntitys)
{
DynamicObjectCollection entryDatas = data.GetDynamicValue<DynamicObjectCollection>(CONST_PRD_PPBOM.CONST_FEntity.ENTITY_ORM_PPBomEntry);
foreach (DynamicObject entryData in entryDatas)
{
long moEntryId = entryData.GetDynamicValue<long>(CONST_PRD_PPBOM.CONST_FEntity.ORM_MoEntryId);
IGrouping<long, DynamicObject> igObjs;
if (dicObjs.TryGetValue(moEntryId, out igObjs))
{
string ekText = igObjs.FirstOrDefault().GetDynamicValue<string>("FEKTEXT");
long erCustomId = igObjs.FirstOrDefault().GetDynamicValue<long>("FEKCUSTOMID");
entryData.SetDynamicObjectItemValue("EKTEXT", ekText); //用料清单上二开文本字段的属性名
entryData.SetDynamicObjectItemValue("EKCUSTOMID_ID",erCustomId);//基础资料,辅助资料等需要用属性名_ID
}
}
}
}
}
}
生产订单二开字段(支持计划确认)携带至生产用料清单
1、生产订单二开新增文本字段,基础资料字段,如下图:![订单1.webp](/download/010019d013daf53c45bb8f3980b08520f065.webp)![订单2.webp]...
点击下载文档
本文2024-09-23 03:21:29发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-158345.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章