提交 2764a8d1 authored 作者: 彭寒菲's avatar 彭寒菲

。。

上级 ff3b05ba
...@@ -110,6 +110,8 @@ ...@@ -110,6 +110,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="IMSApiClient.cs" /> <Compile Include="IMSApiClient.cs" />
<Compile Include="POChangeSyncdataService.cs" />
<Compile Include="POrderSyncdataService.cs" />
<Compile Include="PrepareMtrlService.cs" /> <Compile Include="PrepareMtrlService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ShortageAnalysisService.cs" /> <Compile Include="ShortageAnalysisService.cs" />
......
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LQKJ.K3.MFG.PRD.App.ServicePlugIn
{
[Kingdee.BOS.Util.HotUpdate]
[Description("采购变更单记录同步数据服务插件")]
public class POChangeSyncdataService : AbstractOperationServicePlugIn
{
public override void EndOperationTransaction(EndOperationTransactionArgs e)
{
List<string> list = new List<string>();
string id = base.BusinessInfo.GetForm().Id;
string text = base.Context.UserId.ToString();
string text2 = base.FormOperation.OperationName.ToString();
string operation = base.FormOperation.Operation;
DynamicObject[] dataEntitys = e.DataEntitys;
HashSet<string> hsFID = new HashSet<string>();
foreach (var item in dataEntitys)
{
var Entrys = item["POChangeEntry"] as DynamicObjectCollection;
foreach (var entry in Entrys)//OrderFid
{
if (!hsFID.Contains(entry["OrderFid"].ToString()))
{
hsFID.Add(entry["OrderFid"].ToString());
}
}
}
foreach (var fid in hsFID)
{
//DynamicObject dynamicObject = dataEntitys[i];
string text3 = fid;
string item = string.Format("insert into LQKJ_t_IMSSync(FID,F_LQKJ_SYNCDATAID,F_LQKJ_SYNCBILL,F_LQKJ_SYNDDATETIME,FCREATORID,FMODIFIERID,FCREATEDATE,FMODIFYDATE,F_LQKJ_SYNCCHECK,F_LQKJ_Operationname,F_LQKJ_operationinnercode)\r\n values(NEWID(),'{0}','{1}',null,'{2}','0',GETDATE(),GETDATE(),'0','{3}','{4}')", new object[]
{
text3,
"PUR_PurchaseOrder",
text,
text2,
operation
});
list.Add(item);
}
DBUtils.ExecuteBatch(base.Context, list, list.Count);
base.EndOperationTransaction(e);
}
}
}
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
namespace LQKJ.K3.MFG.PRD.App.ServicePlugIn
{
[Kingdee.BOS.Util.HotUpdate]
[Description("采购订单记录同步数据服务插件")]
public class POrderSyncdataService : AbstractOperationServicePlugIn
{
public override void EndOperationTransaction(EndOperationTransactionArgs e)
{
List<string> list = new List<string>();
string id = base.BusinessInfo.GetForm().Id;
string text = base.Context.UserId.ToString();
string text2 = base.FormOperation.OperationName.ToString();
string operation = base.FormOperation.Operation;
DynamicObject[] dataEntitys = e.DataEntitys;
HashSet<string> hs = new HashSet<string>();
string ids = "";
for (int i = 0; i < dataEntitys.Length; i++)
{
DynamicObject dynamicObject = dataEntitys[i];
ids += dynamicObject["Id"].ToString() + ",";
}
string SQL = $@"/*dialect*/select * from T_PUR_POORDER t1 left join T_PUR_POCHANGEENTRY t2 on t1.FID=t2.FOFID left join T_PUR_POCHANGE t3 on t3.FID=t2.FID where t2.FOFID in({ids.Remove(ids.LastIndexOf(','))}) and t3.FDOCUMENTSTATUS!='B'";
DataTable dt = DBUtils.ExecuteDataSet(this.Context, SQL).Tables[0];
foreach (DataRow row in dt.Rows)
{
hs.Add(row["FOFID"].ToString());
}
for (int i = 0; i < dataEntitys.Length; i++)
{
DynamicObject dynamicObject = dataEntitys[i];
string text3 = dynamicObject["Id"].ToString();
if (hs.Contains(text3)) continue;
string item = string.Format("insert into LQKJ_t_IMSSync(FID,F_LQKJ_SYNCDATAID,F_LQKJ_SYNCBILL,F_LQKJ_SYNDDATETIME,FCREATORID,FMODIFIERID,FCREATEDATE,FMODIFYDATE,F_LQKJ_SYNCCHECK,F_LQKJ_Operationname,F_LQKJ_operationinnercode)\r\n values(NEWID(),'{0}','{1}',null,'{2}','0',GETDATE(),GETDATE(),'0','{3}','{4}')", new object[]
{
text3,
id,
text,
text2,
operation
});
list.Add(item);
}
DBUtils.ExecuteBatch(base.Context, list, list.Count);
base.EndOperationTransaction(e);
}
}
}
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<ProjectRefPath>G:\OZT-kingdeeProject\欧智通\K3Cloud\bin</ProjectRefPath> <ProjectRefPath>G:\OZT-kingdeeProject\欧智通\K3Cloud\bin</ProjectRefPath>
<IsAutoCheckIn>1</IsAutoCheckIn> <IsAutoCheckIn>1</IsAutoCheckIn>
<IsStartScc>1</IsStartScc> <IsStartScc>1</IsStartScc>
<LastExpandPackageNodeID>-1</LastExpandPackageNodeID> <LastExpandPackageNodeID>a39d81b4-7108-46ae-a236-fe026c6c527e</LastExpandPackageNodeID>
<SCCCfg> <SCCCfg>
</SCCCfg> </SCCCfg>
</KDSolution> </KDSolution>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论