11
This commit is contained in:
@@ -47,9 +47,9 @@
|
||||
<Reference Include="BouncyCastle.Crypto">
|
||||
<HintPath>..\..\..\派诺-裴豪\派诺功能\代码\Pilot_KD_Parino (2)\Pilot_KD_Parino\Pilot_KD_Parino\bin\Debug\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Castle.Core, Version=3.2.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
|
||||
<Reference Include="Castle.Core, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\派诺-裴豪\派诺功能\代码\Pilot_KD_Parino (2)\Pilot_KD_Parino\Pilot_KD_Parino\bin\Debug\Castle.Core.dll</HintPath>
|
||||
<HintPath>bin\Debug\Castle.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DevExpress.Data.v13.1, Version=13.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Kingdee.BOS;
|
||||
using Castle.Core.Internal;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.App;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
@@ -16,6 +17,7 @@ using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Pilot_KD_Parino.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
@@ -28,6 +30,8 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
string ADDRESS = "";
|
||||
string date = "";
|
||||
string fid = "0";
|
||||
DynamicObject sheet = null;
|
||||
|
||||
public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e)
|
||||
{
|
||||
//throw new KDBusinessException("", "至少进来了");
|
||||
@@ -35,10 +39,10 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
foreach (var rows in e.SelectedRows)
|
||||
{
|
||||
var Billobj = rows.DataEntity;
|
||||
|
||||
//var sdsas = JsonHelper.ToJson(Billobj);
|
||||
//Logger.Error("目标单据数据集合", sdsas, new Exception());
|
||||
|
||||
sheet = Billobj;
|
||||
var sdsas = JsonHelper.ToJson(Billobj);
|
||||
Logger.Error("目标单据数据集合", sdsas, new Exception());
|
||||
|
||||
string id = Convert.ToString(Billobj["Id"]);
|
||||
fid = id;
|
||||
string addressSql = $@"/*dialect*/SELECT F_Shippingaddress, FDate FROM dbo.T_SAL_DELIVERYNOTICE WHERE fid={id}";
|
||||
@@ -138,7 +142,7 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
}
|
||||
}
|
||||
|
||||
private IOperationResult Invoke(string source, string target, string tempFid, string sargetBillTypeId, ref int stockId)
|
||||
private IOperationResult Invoke(string source, string target, string tempFid, string sargetBillTypeId,ref int stockId)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -186,9 +190,58 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
if (date != "")
|
||||
{
|
||||
string addressSql = $@"/*dialect*/update T_SAL_DELIVERYNOTICE set FDate='{date}' WHERE fid={stocks3["Id"]}";
|
||||
|
||||
|
||||
DBServiceHelper.ExecuteDynamicObject(this.Context, addressSql);
|
||||
}
|
||||
|
||||
var itemList = sheet["SAL_DELIVERYNOTICEENTRY"] as DynamicObjectCollection;
|
||||
var newItemlist = stocks3["SAL_DELIVERYNOTICEENTRY"] as DynamicObjectCollection;
|
||||
Dictionary<string, decimal> MaterialCode = new Dictionary<string, decimal>();
|
||||
foreach (var item in itemList)
|
||||
{
|
||||
var Material = item["MaterialID"] as DynamicObject;
|
||||
if (Material != null)
|
||||
{
|
||||
string code2 = (Material["Number"].ToString());
|
||||
decimal qty = decimal.Parse(item["Qty"].ToString());
|
||||
if (!MaterialCode.ContainsKey(code2))
|
||||
{
|
||||
MaterialCode.Add(code2, qty);
|
||||
}
|
||||
else
|
||||
MaterialCode[code2] = MaterialCode[code2] + qty;
|
||||
}
|
||||
}
|
||||
|
||||
List<DynamicObject> deleteItem = new List<DynamicObject>();
|
||||
foreach (var item in newItemlist)
|
||||
{
|
||||
var Material = item["MaterialID"] as DynamicObject;
|
||||
if (Material != null)
|
||||
{
|
||||
string code2 = (Material["Number"].ToString());
|
||||
decimal qty = decimal.Parse(item["Qty"].ToString());
|
||||
if (MaterialCode.ContainsKey(code2))
|
||||
{
|
||||
if (MaterialCode[code2] != qty)
|
||||
{
|
||||
item["Qty"] = MaterialCode[code2];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
deleteItem.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (deleteItem.Count > 0)
|
||||
{
|
||||
deleteItem.ForEach(t =>
|
||||
{
|
||||
newItemlist.Remove(t);
|
||||
});
|
||||
saveResult = ServiceHelper.GetService<ISaveService>().Save(this.Context, destFormMetadata.BusinessInfo, destObjs, OperateOption.Create());
|
||||
}
|
||||
}
|
||||
|
||||
////合并保存操作结果
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user