2025-11-18 17:43:12 +08:00
|
|
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
|
|
|
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
|
|
|
|
|
using Kingdee.BOS.Orm.DataEntity;
|
|
|
|
|
|
using Kingdee.BOS.Util;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Gatedge.ScanCode.Basis.PlugIn.Bill.BAR_Record.ServicePlugIn
|
|
|
|
|
|
{
|
|
|
|
|
|
[Description("条码扫描记录-保存将条码明细行数写到单据头"), HotUpdate]
|
|
|
|
|
|
public class Save : AbstractOperationServicePlugIn
|
|
|
|
|
|
{
|
|
|
|
|
|
public override void OnPreparePropertys(PreparePropertysEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnPreparePropertys(e);
|
|
|
|
|
|
e.FieldKeys.Add("FBarSum");
|
|
|
|
|
|
e.FieldKeys.Add("FBarCount");
|
|
|
|
|
|
e.FieldKeys.Add("FBarCode");
|
|
|
|
|
|
e.FieldKeys.Add("FResultBillNo");
|
|
|
|
|
|
e.FieldKeys.Add("FMOInfo");
|
|
|
|
|
|
e.FieldKeys.Add("FBarMoEntryId");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-11 10:09:57 +08:00
|
|
|
|
|
|
|
|
|
|
public override void BeginOperationTransaction(BeginOperationTransactionArgs e)
|
2025-11-18 17:43:12 +08:00
|
|
|
|
{
|
2025-12-11 10:09:57 +08:00
|
|
|
|
base.BeginOperationTransaction(e);
|
|
|
|
|
|
foreach (var bill in e.DataEntitys)
|
2025-11-18 17:43:12 +08:00
|
|
|
|
{
|
|
|
|
|
|
var barEntityList = bill["FBarEntity"] as DynamicObjectCollection;
|
|
|
|
|
|
var resultEntityList = bill["FResultEntity"] as DynamicObjectCollection;
|
|
|
|
|
|
bill["FBarCount"] = barEntityList.Count;
|
|
|
|
|
|
bill["FResultCount"] = resultEntityList.Count;
|
|
|
|
|
|
var moList = barEntityList.Select(n => n["FBarMoEntryId"] as DynamicObject).ToList();
|
|
|
|
|
|
var moNoList = moList.Select(n => n["Number"].ToString() + '/' + n["FMOEntrySeq"].ToString()).Distinct();
|
|
|
|
|
|
|
|
|
|
|
|
var moInfo = string.Join(",", moNoList);
|
|
|
|
|
|
bill["FMOInfo"] = moInfo.Substring(0, Math.Min(50, moInfo.Length));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|