a
This commit is contained in:
66
HW.PRD_MO/AfterSaveOperationServicePlugIn.cs
Normal file
66
HW.PRD_MO/AfterSaveOperationServicePlugIn.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Kingdee.BOS.App.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace HW.PRD_MO
|
||||
{
|
||||
[Description("【服务插件_ex】保存后更新生产用料单信息"), HotUpdate]
|
||||
public class AfterSaveOperationServicePlugIn : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void OnPreparePropertys(PreparePropertysEventArgs e)
|
||||
{
|
||||
base.OnPreparePropertys(e);
|
||||
//e.FieldKeys.Add("FWorkTimeType");
|
||||
|
||||
}
|
||||
|
||||
public override void EndOperationTransaction(EndOperationTransactionArgs e)
|
||||
{
|
||||
base.EndOperationTransaction(e);
|
||||
// 保存8提交9审核1反审核26
|
||||
if (this.FormOperation.OperationId == 8)
|
||||
{
|
||||
var dataEntitys = e.DataEntitys.ToList();
|
||||
//foreach (var data in dataEntitys)
|
||||
//{
|
||||
// var jsonStr = JsonConvert.SerializeObject(data, Formatting.Indented);
|
||||
|
||||
// var id = data["Id"];
|
||||
// var fformId = data["FFormId"];
|
||||
// var itemList = data["TreeEntity"] as DynamicObjectCollection;
|
||||
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// itemList.ToList().ForEach(item =>
|
||||
// {
|
||||
// var itemId = item["Id"];
|
||||
// var materialId = item["MaterialId_Id"].Long2Int();
|
||||
// var seq = item["Seq"].Long2Int();
|
||||
// var itemBom = item["BomId"] as DynamicObject;
|
||||
// var itemBomId = item["BomId_Id"].Long2Int();
|
||||
// if (itemBomId == 0 || itemBom != null)
|
||||
// {
|
||||
// var mjdm = itemBom["F_PAEZ_Base"];
|
||||
// var sql = @"update ";
|
||||
|
||||
// sb.AppendLine(sql);
|
||||
// }
|
||||
// });
|
||||
|
||||
// if (!sb.IsNullOrEmpty())
|
||||
// DBUtils.Execute(this.Context, "/*dialect*/" + sb.ToString());
|
||||
//}
|
||||
var idList = dataEntitys.Select(x => x["Id"]);
|
||||
var sql = $"IN ({string.Join(",", idList)})";
|
||||
DBUtils.Execute(this.Context, "/*dialect*/" + sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user