This commit is contained in:
梁骏愉
2025-02-10 09:24:44 +08:00
parent 3d15fd4b7e
commit 17bb7e4131
56 changed files with 15484 additions and 502 deletions

View File

@@ -55,5 +55,6 @@ namespace CYG.AutoWriteOffWizardEditPlugInEx
}
}
}
}
}

View File

@@ -34,12 +34,20 @@
<Reference Include="Kingdee.BOS">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Apm, Version=8.2.886.8, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Apm.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.App">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.App.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.App.Core">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.App.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Contracts, Version=8.2.886.8, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Contracts.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Core">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Core.dll</HintPath>
</Reference>
@@ -50,6 +58,14 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.ServiceHelper.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.VerificationHelper, Version=8.2.886.8, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.VerificationHelper.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.BD.Contracts, Version=8.2.886.8, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.BD.Contracts.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.Core">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.Core.dll</HintPath>
</Reference>
@@ -80,6 +96,8 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
@@ -88,7 +106,15 @@
</ItemGroup>
<ItemGroup>
<Compile Include="AutoWriteOffWizardEditEx.cs" />
<Compile Include="FIN.AP.Business.PlugIn\AutoWriteOffWizardEditEx.cs" />
<Compile Include="FIN.App.Core.Match\MatchProcessEx.cs" />
<Compile Include="FIN.Business.PlugIn.Match\AutoWriteOffWizardEditEx.cs" />
<Compile Include="MatchServiceEx.cs" />
<Compile Include="MatchServiceHelperEx.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy $(TargetPath) "D:\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin"</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,106 @@
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using Kingdee.K3.FIN.AP.ServiceHelper;
using Kingdee.K3.FIN.Core;
using Kingdee.K3.FIN.ServiceHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace CYG.AutoWriteOffWizardEditPlugInEx.FIN.AP.Business.PlugIn
{
[Description("转销处理"),HotUpdate]
public class AutoWriteOffWizardEditEx : FIN.Business.PlugIn.Match.AutoWriteOffWizardEditEx
{
private List<long> _startOrgIds = new List<long>();
protected override Dictionary<long, DateTime> GetOrgStartDate(List<long> settleOrgs, string matchType)
{
string cateGory = "AP";
string sKey = "APStartDate";
if (base.View.Model.DataObject["FBillList"].ToString() == "2")
{
cateGory = "CN";
sKey = "CNStartDate";
}
else
{
switch (matchType)
{
case "1":
cateGory = "AP";
sKey = "APStartDate";
break;
case "3":
cateGory = "AR";
sKey = "ARStartDate";
break;
}
}
DynamicObjectCollection paramterByCtgOrgAcct = CommonServiceHelper.GetParamterByCtgOrgAcct(base.Context, cateGory, 0L, settleOrgs, sKey);
Dictionary<long, DateTime> dictionary = new Dictionary<long, DateTime>();
foreach (DynamicObject item in paramterByCtgOrgAcct)
{
long num = Convert.ToInt64(item["FOrgID"]);
_startOrgIds.Add(num);
dictionary.AddWithoutExists(num, Convert.ToDateTime(item["FValue"]));
}
return dictionary;
}
protected override Dictionary<long, DateTime> GetOrgLastestCloseAccountDate(List<long> settleOrgs, string matchType)
{
Dictionary<long, DateTime> dictionary = new Dictionary<long, DateTime>();
string text = "AP";
switch (matchType)
{
case "1":
text = "AP";
break;
case "3":
text = "AR";
break;
}
DynamicObjectCollection lastestCloseAcctDate = ClosingAccountServiceHelper.GetLastestCloseAcctDate(base.Context, settleOrgs, text);
if (base.View.Model.DataObject["FBillList"].ToString() == "2")
{
DynamicObjectCollection paramterByCtgOrgAcct = CommonServiceHelper.GetParamterByCtgOrgAcct(base.Context, "CN", 0L, settleOrgs, "CNCloseAcctEndDate");
foreach (DynamicObject item in paramterByCtgOrgAcct)
{
dictionary.AddWithoutExists(Convert.ToInt64(item["FOrgID"]), Convert.ToDateTime(item["FValue"]));
}
foreach (DynamicObject item2 in lastestCloseAcctDate)
{
long key = Convert.ToInt64(item2["FOrgID"]);
if (dictionary.ContainsKey(key))
{
DateTime value = Convert.ToDateTime(item2["FEndDate"]);
if (value.CompareTo(dictionary[key]) > 0)
{
dictionary[key] = value;
}
}
else
{
dictionary.Add(Convert.ToInt64(item2["FOrgID"]), Convert.ToDateTime(item2["FEndDate"]));
}
}
}
else
{
foreach (DynamicObject item3 in lastestCloseAcctDate)
{
dictionary.AddWithoutExists(Convert.ToInt64(item3["FOrgID"]), Convert.ToDateTime(item3["FEndDate"]));
}
}
return dictionary;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
using System;
using System.Collections.Generic;
using CYG.AutoWriteOffWizardEditPlugInEx.FIN.App.Core;
using Kingdee.BOS;
using Kingdee.BOS.Apm;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.K3.FIN.App.Core;
using Kingdee.K3.FIN.App.Core.Match;
using Kingdee.K3.FIN.App.Core.Match.Object;
using Kingdee.K3.FIN.Core.Match;
using Kingdee.K3.FIN.Core.Match.Object;
using Kingdee.K3.FIN.Core.Parameters;
namespace CYG.AutoWriteOffWizardEditPlugInEx
{
public class MatchServiceEx : MatchService
{
public override IOperationResult WriteOffMatch(Context ctx, MatchParameters para, List<Dictionary<long, MatchBillData>> schemeMatchDatas)
{
MatchProcessEx matchProcess = new MatchProcessEx();
if (ApmConfig.IsOpenApm())
{
matchProcess = ApmProxyHelper.CreateProxy<MatchProcessEx>(typeof(MatchProcessEx));
}
MatchCalParameters para2 = CalPara(ctx, para);
return matchProcess.WriteOffMatch(ctx, para2, schemeMatchDatas);
}
private MatchCalParameters CalPara(Context ctx, MatchParameters para)
{
MatchCalParameters matchCalParameters = new MatchCalParameters();
matchCalParameters.BillDirection = para.BillDirection;
matchCalParameters.FilterFromId = para.FilterFromId;
matchCalParameters.IsUnMatch = para.IsUnMatch;
matchCalParameters.MatchBillEntrys.AddRange(para.MatchBillEntrys);
matchCalParameters.MatchFromId = para.MatchFromId;
matchCalParameters.MatchType = para.MatchType;
matchCalParameters.SelectBillFromId = para.SelectBillFromId;
matchCalParameters.SettOrg = para.SettOrg;
matchCalParameters.SettOrgId = para.SettOrgId;
matchCalParameters.SpecialMatch = para.SpecialMatch;
matchCalParameters.OrgEndDate = para.OrgEndDate;
matchCalParameters.UserId = para.UserId;
matchCalParameters.CallBillInfo = para.CallBillInfo;
matchCalParameters.InnerClear = para.InnerClear;
matchCalParameters.GenBillDate = para.GenBillDate;
matchCalParameters.MatchBillDate = para.MatchBillDate;
matchCalParameters.MatchStartDate = para.MatchStartDate;
matchCalParameters.BatchGeneRecord = para.BatchGeneRecord;
matchCalParameters.settleOrgId = para.settleOrgId;
matchCalParameters.outCustomerId = para.outCustomerId;
matchCalParameters.WriteOff = para.WriteOff;
matchCalParameters.MatchMethodID = para.MatchMethodID;
matchCalParameters.CurrencyId = para.CurrencyId;
matchCalParameters.MultCurrencyId = para.MultCurrencyId;
matchCalParameters.SelectedSchemeId = para.SelectedSchemeId;
matchCalParameters.ContactUnitId = para.ContactUnitId;
matchCalParameters.Date = Convert.ToDateTime(CommonFunction.GetSystemTime(ctx).ToShortDateString());
matchCalParameters.ReversedOperationType = para.ReversedOperationType;
matchCalParameters.IsTimingMatch = para.IsTimingMatch;
matchCalParameters.MatchTaskId = para.MatchTaskId;
matchCalParameters.FilterString = para.FilterString;
matchCalParameters.SelectedBillType = para.SelectedBillType;
matchCalParameters.MatchControlConfig = GetMatchControl(ctx, para);
matchCalParameters.LogMatchID = para.LogMatchID;
matchCalParameters.LogMatchIsWriteforData = para.LogMatchIsWriteforData;
matchCalParameters.IsRedToBlue = para.IsRedToBlue;
matchCalParameters.IsRedToBlueInPushMatch = para.IsRedToBlueInPushMatch;
matchCalParameters.isAllRefund = para.isAllRefund;
matchCalParameters.transferMode = para.transferMode;
matchCalParameters.isWriteOffExpense = para.isWriteOffExpense;
matchCalParameters.strUserDefine = para.strUserDefine;
matchCalParameters.MustFields = para.MustFields;
matchCalParameters.JoinMatch = para.JoinMatch;
matchCalParameters.iMatchType = para.iMatchType;
matchCalParameters.writenoffBatchList = para.writenoffBatchList;
matchCalParameters.WriteOffBatch = para.WriteOffBatch;
matchCalParameters.UnMatchType = para.UnMatchType;
matchCalParameters.IsNewTimeMatch = para.IsNewTimeMatch;
matchCalParameters.filterOrgList = para.filterOrgList;
matchCalParameters.IsBadDebt = para.IsBadDebt;
matchCalParameters.AllReturnDic = para.AllReturnDic;
matchCalParameters.IsAllArrived = para.IsAllArrived;
matchCalParameters.ExtDebitDataTime = para.DebitDataTime;
matchCalParameters.ExtCreditDataTime = para.CreditDataTime;
matchCalParameters.IsBadDebtRecover = para.IsBadDebtRecover;
matchCalParameters.RecoverRecBillData = para.RecoverRecBillData;
matchCalParameters.baseDataTempTable = para.baseDataTempTable;
matchCalParameters.isRedList = para.isRedList;
matchCalParameters.IsNoAddBill = para.IsNoAddBill;
MatchCommonFunction.InitializationParameter(ctx, matchCalParameters);
return matchCalParameters;
}
private MatchControl GetMatchControl(Context ctx, MatchParameters para)
{
return MatchCommonFunction.GetMatchControl(ctx, para);
}
}
}

View File

@@ -0,0 +1,28 @@
using Kingdee.BOS;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.K3.FIN.Contracts;
using Kingdee.K3.FIN.Core.Match.Object;
using Kingdee.K3.FIN.Core.Parameters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CYG.AutoWriteOffWizardEditPlugInEx
{
public class MatchServiceHelperEx
{
public static IOperationResult WriteOffMatch(Context ctx, MatchParameters para, List<Dictionary<long, MatchBillData>> schemeMatchDatas)
{
IMatchService service = new MatchServiceEx();
try
{
return service.WriteOffMatch(ctx, para, schemeMatchDatas);
}
finally
{
ServiceFactory.CloseService(service);
}
}
}
}

View File

@@ -96,6 +96,9 @@
<Reference Include="Kingdee.K3.SCM.App.Core">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.SCM.App.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.SCM.App.Credit.Core">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.SCM.App.Credit.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.SCM.Contracts, Version=8.2.830.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.SCM.Contracts.dll</HintPath>
@@ -153,6 +156,7 @@
<Content Include="转销应收单触发器.sql" />
<Content Include="销售合同数据更新_202408161550.sql" />
<Content Include="销售合同数据计算\1.销售合同计算_更新合同类型.sql" />
<Content Include="销售合同数据计算\20241226.sql" />
<Content Include="销售合同数据计算\99.20240925_销售合同计算_筛选多个销售合同绑定同一个原销售订单号.sql" />
<Content Include="销售合同数据计算\3.销售合同计算_更新合同数据.sql" />
<Content Include="销售合同金额计算.sql" />

View File

@@ -15,7 +15,7 @@
AND t0.FFORBIDSTATUS = 'A'
)
, <>ٱ<EFBFBD> AS (
SELECT t0.FID,t0_l.FNAME,t0e.FENUMID,t0e.FSEQ,t0e.FVALUE,t0e_l.FCAPTION
SELECT t0.FID,t0_lD,t0e.FENUMID,t0e.FSEQ,t0e.FVALUE,t0e_l.FCAPTION
FROM T_META_FORMENUM t0
INNER JOIN T_META_FORMENUMITEM t0e on t0e.FID = t0.FID
INNER JOIN T_META_FORMENUM_L t0_l on t0.FID = t0_l.FID AND t0_l.FLOCALEID = 2052