Merge branch 'master' of http://8.130.121.29:3000/yuyubo/Pilot_KD_Parino_yuyubo
This commit is contained in:
46
.gitignore
vendored
46
.gitignore
vendored
@@ -58,3 +58,49 @@
|
||||
/Pilot_KD_Parino/obj/Debug/Pilot_KD_Parino.pdb
|
||||
/Pilot_KD_Parino/packages.config
|
||||
/.vs
|
||||
/NoPackageMachine/bin/Debug/EZ.DB.dll
|
||||
/NoPackageMachine/bin/Debug/K3Cloud.WebApi.Client.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.App.Core.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.App.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.ApprovalFlow.PlugIns.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.BusinessEntity.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.Contracts.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.Core.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.DataEntity.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.ServiceHelper.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.VerificationHelper.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.Web.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.WebApi.Client.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.WebApi.FormService.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.WebApi.ServicesStub.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.BOS.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.Core.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.FIN.App.Core.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.FIN.CB.App.Report.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.FIN.HS.App.Report.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.MFG.App.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.MFG.PLN.App.MrpModel.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.App.Core.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.App.Credit.Core.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.App.Sal.ServicePlugIn.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.App.Stock.Report.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.App.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.Business.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.Common.BusinessEntity.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.Contracts.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.Core.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.ServiceHelper.dll
|
||||
/NoPackageMachine/bin/Debug/Kingdee.K3.SCM.Stock.Business.PlugIn.dll
|
||||
/NoPackageMachine/bin/Debug/Newtonsoft.Json.dll
|
||||
/NoPackageMachine/bin/Debug/NoPackageMachine.dll
|
||||
/NoPackageMachine/bin/Debug/NoPackageMachine.pdb
|
||||
/NoPackageMachine/bin/Debug/Oracle.DataAccess.dll
|
||||
/NoPackageMachine/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs
|
||||
/NoPackageMachine/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
|
||||
/NoPackageMachine/obj/Debug/NoPackag.8916CF04.Up2Date
|
||||
/NoPackageMachine/obj/Debug/NoPackageMachine.csproj.AssemblyReference.cache
|
||||
/NoPackageMachine/obj/Debug/NoPackageMachine.csproj.CopyComplete
|
||||
/NoPackageMachine/obj/Debug/NoPackageMachine.csproj.CoreCompileInputs.cache
|
||||
/NoPackageMachine/obj/Debug/NoPackageMachine.csproj.FileListAbsolute.txt
|
||||
/NoPackageMachine/obj/Debug/NoPackageMachine.dll
|
||||
/NoPackageMachine/obj/Debug/NoPackageMachine.pdb
|
||||
|
||||
BIN
Component/EZ.DB.dll
Normal file
BIN
Component/EZ.DB.dll
Normal file
Binary file not shown.
BIN
Component/K3Cloud.WebApi.Client.dll
Normal file
BIN
Component/K3Cloud.WebApi.Client.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.App.Core.dll
Normal file
BIN
Component/Kingdee.BOS.App.Core.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.App.dll
Normal file
BIN
Component/Kingdee.BOS.App.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.ApprovalFlow.PlugIns.dll
Normal file
BIN
Component/Kingdee.BOS.ApprovalFlow.PlugIns.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.BusinessEntity.dll
Normal file
BIN
Component/Kingdee.BOS.BusinessEntity.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.Contracts.dll
Normal file
BIN
Component/Kingdee.BOS.Contracts.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.Core.dll
Normal file
BIN
Component/Kingdee.BOS.Core.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.DataEntity.dll
Normal file
BIN
Component/Kingdee.BOS.DataEntity.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.ServiceHelper.dll
Normal file
BIN
Component/Kingdee.BOS.ServiceHelper.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.VerificationHelper.dll
Normal file
BIN
Component/Kingdee.BOS.VerificationHelper.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.Web.dll
Normal file
BIN
Component/Kingdee.BOS.Web.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.WebApi.Client.dll
Normal file
BIN
Component/Kingdee.BOS.WebApi.Client.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.WebApi.FormService.dll
Normal file
BIN
Component/Kingdee.BOS.WebApi.FormService.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.WebApi.ServicesStub.dll
Normal file
BIN
Component/Kingdee.BOS.WebApi.ServicesStub.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.BOS.dll
Normal file
BIN
Component/Kingdee.BOS.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.Core.dll
Normal file
BIN
Component/Kingdee.K3.Core.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.FIN.App.Core.dll
Normal file
BIN
Component/Kingdee.K3.FIN.App.Core.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.FIN.CB.App.Report.dll
Normal file
BIN
Component/Kingdee.K3.FIN.CB.App.Report.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.FIN.HS.App.Report.dll
Normal file
BIN
Component/Kingdee.K3.FIN.HS.App.Report.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.MFG.App.dll
Normal file
BIN
Component/Kingdee.K3.MFG.App.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.MFG.PLN.App.MrpModel.dll
Normal file
BIN
Component/Kingdee.K3.MFG.PLN.App.MrpModel.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.App.Core.dll
Normal file
BIN
Component/Kingdee.K3.SCM.App.Core.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.App.Credit.Core.dll
Normal file
BIN
Component/Kingdee.K3.SCM.App.Credit.Core.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.App.Sal.ServicePlugIn.dll
Normal file
BIN
Component/Kingdee.K3.SCM.App.Sal.ServicePlugIn.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.App.Stock.Report.dll
Normal file
BIN
Component/Kingdee.K3.SCM.App.Stock.Report.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.App.dll
Normal file
BIN
Component/Kingdee.K3.SCM.App.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.Business.dll
Normal file
BIN
Component/Kingdee.K3.SCM.Business.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.Common.BusinessEntity.dll
Normal file
BIN
Component/Kingdee.K3.SCM.Common.BusinessEntity.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.Contracts.dll
Normal file
BIN
Component/Kingdee.K3.SCM.Contracts.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.Core.dll
Normal file
BIN
Component/Kingdee.K3.SCM.Core.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.ServiceHelper.dll
Normal file
BIN
Component/Kingdee.K3.SCM.ServiceHelper.dll
Normal file
Binary file not shown.
BIN
Component/Kingdee.K3.SCM.Stock.Business.PlugIn.dll
Normal file
BIN
Component/Kingdee.K3.SCM.Stock.Business.PlugIn.dll
Normal file
Binary file not shown.
BIN
Component/Newtonsoft.Json.dll
Normal file
BIN
Component/Newtonsoft.Json.dll
Normal file
Binary file not shown.
77
NoPackageMachine/GetSingleLuoJi.cs
Normal file
77
NoPackageMachine/GetSingleLuoJi.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using Kingdee.BOS.BusinessEntity.BusinessFlow;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.List.PlugIn;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Kingdee.K3.SCM.Common.BusinessEntity.Sales;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NoPackageMachine
|
||||
{
|
||||
[Description("销售订单列表获取裸机信息#列表插件:审核后获取单据体中成品编码下的裸机信息"), HotUpdate]
|
||||
public class GetSingleLuoJi : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void BeforeExecuteOperationTransaction(BeforeExecuteOperationTransaction e)
|
||||
{
|
||||
base.BeforeExecuteOperationTransaction(e);
|
||||
var formId = this.BusinessInfo.GetForm().Id;
|
||||
// 获取销售订单信息
|
||||
foreach (var rows in e.SelectedRows)
|
||||
{
|
||||
var entry = rows.DataEntity;
|
||||
var s = JsonConvert.SerializeObject(entry);
|
||||
var order = JsonConvert.DeserializeObject<SalOrderModel>(s);
|
||||
foreach (var item in order.SaleOrderEntry)
|
||||
{
|
||||
string sql = string.Format("/*dialect*/select m0.FNUMBER PMaterialCode,m.FMATERIALID,m.FNUMBER MaterialCode,t.FSPECIFICATION FModel,sum(isnull(i.FBASEQTY,0)) AS Qty from T_ENG_BOM a left jOIN T_ORG_ORGANIZATIONS O ON O.FORGID = a.FUSEORGID " +
|
||||
"left join T_ENG_BOMCHILD b on a.FID=b.FID " +
|
||||
"left join T_BD_MATERIAL m0 on m0.FMATERIALID=a.FMATERIALID " +
|
||||
"left join T_BD_MATERIAL m on m.FMATERIALID=b.FMATERIALID " +
|
||||
"left join T_BD_MATERIAL_L t on t.FMATERIALID=m.FMATERIALID " +
|
||||
"left join T_BD_MATERIALBASE s on s.FMATERIALID=m.FMATERIALID " +
|
||||
"left join t_BD_MaterialStock ms on ms.fmaterialid=m.fmaterialid " +
|
||||
"left join T_STK_INVENTORY i on i.FMATERIALID=m.FMASTERID and i.fstockorgid=m0.fuseorgid " +
|
||||
"left JOIN T_BD_Stock invSIC ON invSIC.FSTOCKID = i.FSTOCKID " +
|
||||
"left JOIN T_BD_Stock SIC ON SIC.FSTOCKID = ms.FSTOCKID " +
|
||||
"where a.FDOCUMENTSTATUS='C' and a.FFORBIDSTATUS='A' and O.fnumber='PL' and m0.FMATERIALID='{0}' and (m.fnumber like 'N.%' or m.fnumber like 'M.%') group by m0.FNUMBER,m.FNUMBER,t.FSPECIFICATION,m.FMATERIALID", item.MaterialId_Id);
|
||||
var data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
if (data != null && data.Count > 0)
|
||||
{
|
||||
if (formId == "SAL_SaleOrder")
|
||||
{
|
||||
if (data.Count > 1)
|
||||
{
|
||||
sql = string.Format("/*dialect*/update t_sal_orderentry set F_ISLUOJI='是' where FENTRYID={0}", item.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format("/*dialect*/update t_sal_orderentry set F_ISLUOJI='否',F_LUOJICODE='{0}',F_LUOJIDESC='{1}',F_LJBM='{2}' where FENTRYID={3}", data[0]["MaterialCode"].ToString(), data[0]["FModel"].ToString(), data[0]["FMATERIALID"].ToString(), item.Id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data.Count > 1)
|
||||
{
|
||||
sql = string.Format("/*dialect*/update t_sal_xorderentry set F_ISLUOJI='是' where FENTRYID={0}", item.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = string.Format("/*dialect*/update t_sal_xorderentry set F_ISLUOJI='否',F_LUOJICODE='{0}',F_LUOJIDESC='{1}',F_LJBM='{2}' where FENTRYID={3}", data[0]["MaterialCode"].ToString(), data[0]["FModel"].ToString(), data[0]["FMATERIALID"].ToString(), item.Id);
|
||||
}
|
||||
}
|
||||
DBServiceHelper.Execute(this.Context, sql);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
53
NoPackageMachine/GetSonMachines.cs
Normal file
53
NoPackageMachine/GetSonMachines.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Core.List;
|
||||
using Kingdee.BOS.Core.List.PlugIn;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Kingdee.BOS.Core.Metadata.EntityElement;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
|
||||
namespace NoPackageMachine
|
||||
{
|
||||
[Description("销售订单获取裸机信息#按钮列表插件:点击按钮显示裸机信息动态表单"), HotUpdate]
|
||||
public class GetSonMachines: AbstractListPlugIn
|
||||
{
|
||||
public override void BarItemClick(BarItemClickEventArgs e)
|
||||
{
|
||||
base.BarItemClick(e);
|
||||
if (e.BarItemKey.EqualsIgnoreCase("LJBM_tbButton"))
|
||||
{
|
||||
|
||||
//获取选中行
|
||||
var listView = this.View as IListView;
|
||||
var selectedRows = listView.SelectedRowsInfo;
|
||||
if (selectedRows == null || selectedRows.Count == 0)
|
||||
{
|
||||
this.View.ShowMessage("列表中的销售订单没有被选中");
|
||||
return;
|
||||
}
|
||||
if (selectedRows.Count > 1)
|
||||
{
|
||||
this.View.ShowMessage("列表中的销售订单不能多选");
|
||||
return;
|
||||
}
|
||||
var materialID = selectedRows.Select(c => c.DataRow["FMaterialId_Id"]).ToList()[0].ToString();
|
||||
|
||||
//var Params = string.Join(",", number);
|
||||
DynamicFormShowParameter parameter = new DynamicFormShowParameter();
|
||||
parameter.OpenStyle.ShowType = ShowType.Floating;
|
||||
//选择需要打开的窗体FID
|
||||
parameter.FormId = "VRYF_LJBM_FORM"; //YKQC_LJBM_FORM 测试环境
|
||||
parameter.MultiSelect = false;
|
||||
//获取的FID以字符串发送到输出的窗体
|
||||
parameter.CustomComplexParams.Add("EntryPrimaryKeys", materialID);
|
||||
this.View.ShowForm(parameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
NoPackageMachine/Model/SalOrderEntryModel.cs
Normal file
15
NoPackageMachine/Model/SalOrderEntryModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NoPackageMachine
|
||||
{
|
||||
public class SalOrderEntryModel
|
||||
{
|
||||
public int FID { get; set; }
|
||||
public int Id { get; set; }
|
||||
public int MaterialId_Id { get; set; }
|
||||
}
|
||||
}
|
||||
16
NoPackageMachine/Model/SalOrderModel.cs
Normal file
16
NoPackageMachine/Model/SalOrderModel.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NoPackageMachine
|
||||
{
|
||||
public class SalOrderModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string FBILLNO { get; set; }
|
||||
public string F_CONTRACTNUMBER { get; set; }
|
||||
public List<SalOrderEntryModel> SaleOrderEntry = new List<SalOrderEntryModel>();
|
||||
}
|
||||
}
|
||||
17
NoPackageMachine/Model/SonMachine.cs
Normal file
17
NoPackageMachine/Model/SonMachine.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NoPackageMachine
|
||||
{
|
||||
public class SonMachine
|
||||
{
|
||||
public int RowNum { get; set; }
|
||||
public string PMaterialCode { get; set; }
|
||||
public string MaterialCode { get; set; }
|
||||
public string FModel { get; set; }
|
||||
public decimal Qty { get; set; }
|
||||
}
|
||||
}
|
||||
156
NoPackageMachine/NoPackageMachine.csproj
Normal file
156
NoPackageMachine/NoPackageMachine.csproj
Normal file
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{9788649F-42E6-4687-A1BF-5064CF806553}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>NoPackageMachine</RootNamespace>
|
||||
<AssemblyName>NoPackageMachine</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="EZ.DB">
|
||||
<HintPath>..\Component\EZ.DB.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K3Cloud.WebApi.Client">
|
||||
<HintPath>..\Component\K3Cloud.WebApi.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS">
|
||||
<HintPath>..\Component\Kingdee.BOS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.App">
|
||||
<HintPath>..\Component\Kingdee.BOS.App.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.App.Core">
|
||||
<HintPath>..\Component\Kingdee.BOS.App.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.ApprovalFlow.PlugIns">
|
||||
<HintPath>..\Component\Kingdee.BOS.ApprovalFlow.PlugIns.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.BusinessEntity">
|
||||
<HintPath>..\Component\Kingdee.BOS.BusinessEntity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Contracts">
|
||||
<HintPath>..\Component\Kingdee.BOS.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Core">
|
||||
<HintPath>..\Component\Kingdee.BOS.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.DataEntity">
|
||||
<HintPath>..\Component\Kingdee.BOS.DataEntity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.ServiceHelper">
|
||||
<HintPath>..\Component\Kingdee.BOS.ServiceHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.VerificationHelper">
|
||||
<HintPath>..\Component\Kingdee.BOS.VerificationHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Web">
|
||||
<HintPath>..\Component\Kingdee.BOS.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.WebApi.Client">
|
||||
<HintPath>..\Component\Kingdee.BOS.WebApi.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.WebApi.FormService">
|
||||
<HintPath>..\Component\Kingdee.BOS.WebApi.FormService.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.WebApi.ServicesStub">
|
||||
<HintPath>..\Component\Kingdee.BOS.WebApi.ServicesStub.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.Core">
|
||||
<HintPath>..\Component\Kingdee.K3.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.App.Core">
|
||||
<HintPath>..\Component\Kingdee.K3.FIN.App.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.CB.App.Report">
|
||||
<HintPath>..\Component\Kingdee.K3.FIN.CB.App.Report.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.HS.App.Report">
|
||||
<HintPath>..\Component\Kingdee.K3.FIN.HS.App.Report.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.MFG.App">
|
||||
<HintPath>..\Component\Kingdee.K3.MFG.App.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.MFG.PLN.App.MrpModel">
|
||||
<HintPath>..\Component\Kingdee.K3.MFG.PLN.App.MrpModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.App">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.App.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.App.Core">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.App.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.App.Credit.Core">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.App.Credit.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.App.Sal.ServicePlugIn">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.App.Sal.ServicePlugIn.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.App.Stock.Report">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.App.Stock.Report.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.Business">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.Business.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.Common.BusinessEntity">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.Common.BusinessEntity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.Contracts">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.Core">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.ServiceHelper">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.ServiceHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.SCM.Stock.Business.PlugIn">
|
||||
<HintPath>..\Component\Kingdee.K3.SCM.Stock.Business.PlugIn.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GetSingleLuoJi.cs" />
|
||||
<Compile Include="GetSonMachines.cs" />
|
||||
<Compile Include="Model\SalOrderEntryModel.cs" />
|
||||
<Compile Include="Model\SalOrderModel.cs" />
|
||||
<Compile Include="NoPackageMaterialForm.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Model\SonMachine.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
58
NoPackageMachine/NoPackageMaterialForm.cs
Normal file
58
NoPackageMachine/NoPackageMaterialForm.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.List;
|
||||
using Kingdee.BOS.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace NoPackageMachine
|
||||
{
|
||||
[Description("动态窗口插件:获取产品的裸机编码和库存"), HotUpdate]
|
||||
public class NoPackageMaterialForm: AbstractDynamicFormPlugIn
|
||||
{
|
||||
string ListFidS = null;
|
||||
public override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
//接受传输的值
|
||||
ListFidS = Convert.ToString(this.View.OpenParameter.GetCustomParameter("EntryPrimaryKeys"));
|
||||
string sql = string.Format("/*dialect*/select m0.FNUMBER PMaterialCode,m.FNUMBER MaterialCode,t.FSPECIFICATION FModel,sum(isnull(i.FBASEQTY,0)) AS Qty from T_ENG_BOM a left jOIN T_ORG_ORGANIZATIONS O ON O.FORGID = a.FUSEORGID " +
|
||||
"left join T_ENG_BOMCHILD b on a.FID=b.FID " +
|
||||
"left join T_BD_MATERIAL m0 on m0.FMATERIALID=a.FMATERIALID " +
|
||||
"left join T_BD_MATERIAL m on m.FMATERIALID=b.FMATERIALID " +
|
||||
"left join T_BD_MATERIAL_L t on t.FMATERIALID=m.FMATERIALID " +
|
||||
"left join T_BD_MATERIALBASE s on s.FMATERIALID=m.FMATERIALID " +
|
||||
"left join t_BD_MaterialStock ms on ms.fmaterialid=m.fmaterialid " +
|
||||
"left join T_STK_INVENTORY i on i.FMATERIALID=m.FMASTERID and i.fstockorgid=m0.fuseorgid " +
|
||||
"left JOIN T_BD_Stock invSIC ON invSIC.FSTOCKID = i.FSTOCKID " +
|
||||
"left JOIN T_BD_Stock SIC ON SIC.FSTOCKID = ms.FSTOCKID " +
|
||||
"where a.FDOCUMENTSTATUS='C' and a.FFORBIDSTATUS='A' and O.fnumber='PL' and m0.FMATERIALID='{0}' and (m.fnumber like 'N.%' or m.fnumber like 'M.%') group by m0.FNUMBER,m.FNUMBER,t.FSPECIFICATION", ListFidS);
|
||||
List<SonMachine> sonMachines = new List<SonMachine>();
|
||||
//var result = DBServiceHelper.ExecuteScalar<List<SonMachine>>(this.Context, sql, sonMachines);
|
||||
var data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
|
||||
int num = 0;
|
||||
foreach (var one in data)
|
||||
{
|
||||
this.View.Model.SetValue("F_MaterialCode", one["MaterialCode"], num);
|
||||
this.View.Model.SetValue("F_FModel", one["FModel"], num);
|
||||
this.View.Model.SetValue("F_Qty", one["Qty"], num);
|
||||
num++;
|
||||
}
|
||||
//foreach(SonMachine sonMachine in result)
|
||||
//{
|
||||
// //this.View.Model.SetValue("PMaterialCode", sonMachine.PMaterialCode, num);
|
||||
// this.View.Model.SetValue("F_MaterialCode", sonMachine.MaterialCode, num);
|
||||
// this.View.Model.SetValue("F_FModel", sonMachine.FModel, num);
|
||||
// this.View.Model.SetValue("F_Qty", sonMachine.Qty, num);
|
||||
// num++;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
36
NoPackageMachine/Properties/AssemblyInfo.cs
Normal file
36
NoPackageMachine/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("NoPackageMachine")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("NoPackageMachine")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("9788649f-42e6-4687-a1bf-5064cf806553")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -5,6 +5,8 @@ VisualStudioVersion = 17.11.35327.3
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pilot_KD_Parino", "Pilot_KD_Parino\Pilot_KD_Parino.csproj", "{D8751053-74AF-4619-A5BE-939ADFF10991}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoPackageMachine", "NoPackageMachine\NoPackageMachine.csproj", "{9788649F-42E6-4687-A1BF-5064CF806553}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,6 +17,10 @@ Global
|
||||
{D8751053-74AF-4619-A5BE-939ADFF10991}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D8751053-74AF-4619-A5BE-939ADFF10991}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D8751053-74AF-4619-A5BE-939ADFF10991}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9788649F-42E6-4687-A1BF-5064CF806553}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9788649F-42E6-4687-A1BF-5064CF806553}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9788649F-42E6-4687-A1BF-5064CF806553}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9788649F-42E6-4687-A1BF-5064CF806553}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -143,14 +143,16 @@ namespace Pilot_KD_Parino.Common
|
||||
#region
|
||||
Row newRowfour = table.InsertRow(previousRowfour, 1);
|
||||
newRowfour.Cells[1].ReplaceText("{9}", Convert.ToString(Rows[0][11]));
|
||||
int j = 0;
|
||||
foreach (var Row in Rows)
|
||||
{
|
||||
Row newRowthree = table.InsertRow(previousRowthree, 1);
|
||||
Row newRowthree = table.InsertRow(previousRowthree, 1+j);
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
newRowthree.Cells[i].ReplaceText("{" + i.ToString() + "}", Convert.ToString(Row[i]));
|
||||
}
|
||||
document.ReplaceText("{10}", Convert.ToString(Row[10]));
|
||||
j++;
|
||||
}
|
||||
Row newRow = table.InsertRow(previousRow, 1);
|
||||
newRow.Cells[0].ReplaceText("{0}", string.Format("{0}、{1}", ConvertToChineseUppercase(Index), Convert.ToString(item)));
|
||||
|
||||
@@ -335,8 +335,10 @@
|
||||
<Compile Include="Opportunities\YJFT_AuditPlugIn.cs" />
|
||||
<Compile Include="Planorder\List.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\FaHuoHeXiaoYanZheng.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\FUpdateAmount.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\HeXiaoJiLu.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\HeXiaoJiLuYanZheng.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\FaHuoHeXiaoJiLuSave.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\HeXiaoJiLuSave.cs" />
|
||||
<Compile Include="QPHY_AutoWrireRecord\UpdateAmount.cs" />
|
||||
<Compile Include="QPHY_AutoWrire\Bill.cs" />
|
||||
|
||||
88
Pilot_KD_Parino/QPHY_AutoWrireRecord/FaHuoHeXiaoJiLuSave.cs
Normal file
88
Pilot_KD_Parino/QPHY_AutoWrireRecord/FaHuoHeXiaoJiLuSave.cs
Normal file
@@ -0,0 +1,88 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.App.Core;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Log;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Pilot_KD_Parino.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Pilot_KD_Parino.QPHY_AutoWrireRecord
|
||||
{
|
||||
[Description("发货通知单核销记录单保存前校验插件"), HotUpdate]
|
||||
public class FaHuoHeXiaoJiLuSave : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void BeforeDoSaveExecute(BeforeDoSaveExecuteEventArgs e)
|
||||
{
|
||||
base.BeforeDoSaveExecute(e);
|
||||
var dd = e.DataEntities[0];
|
||||
if (dd["DocumentStatus"].ToString() == "C")
|
||||
{
|
||||
return;
|
||||
}
|
||||
var sssd = JsonHelper.ToJson(dd);
|
||||
Logger.Error("发货通知单核销记录单保", sssd, new Exception());
|
||||
var list1 = dd["FEntity"] as DynamicObjectCollection;
|
||||
var list2 = dd["FEntity2"] as DynamicObjectCollection;
|
||||
var amount1 = list1.Sum(t => decimal.Parse(t["FALLAMOUNT22"]?.ToString()));
|
||||
var amount2 = list2.Sum(t => decimal.Parse(t["FALLAMOUNT33"]?.ToString()));
|
||||
//throw new KDBusinessException("", $@"销售单明细本次核销合计金额{amount1},收款单明细本次核销合计金额{amount2},{amount1}不等于{amount2},不允许保存");
|
||||
|
||||
|
||||
|
||||
if (amount1 != amount2)
|
||||
{
|
||||
throw new KDBusinessException("", $@"发货通知单本次核销合计金额{amount1.ToString("F2")},收款单明细本次核销合计金额{amount2.ToString("F2")},{amount1.ToString("F2")}不等于{amount2.ToString("F2")},不允许保存");
|
||||
}
|
||||
|
||||
|
||||
var billList = list1.Select(t => t["FBILLNO2"]).ToList();
|
||||
string bill = string.Join("','", billList);
|
||||
string sql = $@"/*dialect*/SELECT bb.F_CONTRACTNUMBER,bb.F_AMOUNT,fin.FBillAllAmount,bb.F_expenses, a.FBILLNO
|
||||
,(fin.FBillAllAmount+bb.F_expenses-bb.F_AMOUNT) AS XiaoFamount
|
||||
,C.FBILLALLAMOUNT-A.F_AMOUNT as FaHuoFamount
|
||||
FROM T_SAL_DELIVERYNOTICE a
|
||||
INNER JOIN T_SAL_DELIVERYNOTICEFIN C ON C.FID =A.FID
|
||||
INNER JOIN VRYF_t_Cust_Entry100024 b
|
||||
ON a.FBILLNO=b.FBILLNO2
|
||||
INNER JOIN dbo.T_SAL_ORDER bb
|
||||
ON a.F_PAPERCONTRACT=bb.F_CONTRACTNUMBER
|
||||
INNER JOIN dbo.T_SAL_ORDERFIN fin ON bb.FID=fin.FID
|
||||
WHERE a.FBILLNO in ('{bill}') ";
|
||||
var data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
var one1 = (from q in data
|
||||
join b in list1 on q["FBILLNO"].ToString() equals b["FBILLNO2"].ToString()
|
||||
where decimal.Parse(b["FALLAMOUNT22"]?.ToString()) > decimal.Parse(q["XiaoFamount"]?.ToString())
|
||||
|| decimal.Parse(b["FALLAMOUNT22"]?.ToString()) > decimal.Parse(q["FaHuoFamount"]?.ToString())
|
||||
select q["FBILLNO"]).ToList();
|
||||
if (one1.Count > 0)
|
||||
{
|
||||
throw new KDBusinessException("", $@"发货通知单编号{string.Join(",", one1)} 核销金额+已核销金额 大于 订单总金额 ");
|
||||
}
|
||||
|
||||
billList = list2.Select(t => t["FBILLNO3"]).ToList();
|
||||
bill = string.Join("','", billList);
|
||||
sql = $@"/*dialect*/SELECT a.FBILLNO,(a.FRECAMOUNTFOR-a.F_AMOUNT) as F_AMOUNT FROM dbo.T_AR_RECEIVEBILL a
|
||||
WHERE a.FBILLNO in ('{bill}') ";
|
||||
data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
|
||||
one1 = (from q in data
|
||||
join b in list2 on q["FBILLNO"].ToString() equals b["FBILLNO3"].ToString()
|
||||
where decimal.Parse(b["FALLAMOUNT33"]?.ToString()) > decimal.Parse(q["F_AMOUNT"]?.ToString())
|
||||
select q["FBILLNO"]).ToList();
|
||||
if (one1.Count > 0)
|
||||
{
|
||||
throw new KDBusinessException("", $@"收款单编号{string.Join(",", one1)} 核销金额+已核销金额 大于 订单总金额 ");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
68
Pilot_KD_Parino/QPHY_AutoWrireRecord/FaHuoHeXiaoYanZheng.cs
Normal file
68
Pilot_KD_Parino/QPHY_AutoWrireRecord/FaHuoHeXiaoYanZheng.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Log;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Pilot_KD_Parino.Common;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace Pilot_KD_Parino.QPHY_AutoWrireRecord
|
||||
{
|
||||
[Description("发货通知提交和审核前校验插件"), HotUpdate]
|
||||
public class FaHuoHeXiaoYanZheng : AbstractOperationServicePlugIn
|
||||
{
|
||||
DynamicObject sheet = null;
|
||||
public override void BeforeExecuteOperationTransaction(BeforeExecuteOperationTransaction e)
|
||||
{
|
||||
|
||||
base.BeforeExecuteOperationTransaction(e);
|
||||
foreach (var rows in e.SelectedRows)
|
||||
{
|
||||
var Billobj = rows.DataEntity;
|
||||
sheet = Billobj;
|
||||
var sdsas = JsonHelper.ToJson(Billobj);
|
||||
Logger.Error("发货通知单核销记录提交或者审核", sdsas, new Exception());
|
||||
//获取单据Id
|
||||
string Id = sheet["Id"].ToString();
|
||||
string sql = $@"/*dialect*/SELECT bb.F_CONTRACTNUMBER,bb.F_AMOUNT,fin.FBillAllAmount,bb.F_expenses, a.FBILLNO
|
||||
,(fin.FBillAllAmount+bb.F_expenses-bb.F_AMOUNT) AS XiaoFamount
|
||||
,C.FBILLALLAMOUNT-A.F_AMOUNT as FaHuoFamount,b.FALLAMOUNT22
|
||||
FROM T_SAL_DELIVERYNOTICE a
|
||||
INNER JOIN T_SAL_DELIVERYNOTICEFIN C ON C.FID =A.FID
|
||||
INNER JOIN VRYF_t_Cust_Entry100024 b
|
||||
ON a.FBILLNO=b.FBILLNO2
|
||||
INNER JOIN dbo.T_SAL_ORDER bb
|
||||
ON a.F_PAPERCONTRACT=bb.F_CONTRACTNUMBER
|
||||
INNER JOIN dbo.T_SAL_ORDERFIN fin ON bb.FID=fin.FID
|
||||
WHERE b.fid={Id} ";
|
||||
var data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
var one1 = data.Where(q => decimal.Parse(q["FALLAMOUNT22"]?.ToString()) > decimal.Parse(q["XiaoFamount"]?.ToString())
|
||||
|| decimal.Parse(q["FALLAMOUNT22"]?.ToString()) > decimal.Parse(q["FaHuoFamount"]?.ToString()))
|
||||
.Select(q => q["FBILLNO"]).ToList();
|
||||
if (one1.Count > 0)
|
||||
{
|
||||
throw new KDBusinessException("", $@"发货通知单编号{string.Join(",", one1)} 核销金额+已核销金额 大于 订单总金额 ");
|
||||
}
|
||||
|
||||
sql = $@"/*dialect*/SELECT a.FBILLNO,(a.FRECAMOUNTFOR-a.F_AMOUNT) as F_AMOUNT,b.FALLAMOUNT33 FROM dbo.T_AR_RECEIVEBILL a
|
||||
INNER JOIN VRYF_t_Cust_Entry100025 b
|
||||
ON a.FBILLNO=b.FBILLNO3
|
||||
WHERE b.FID={Id} ";
|
||||
data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
one1 = data.Where(q => decimal.Parse(q["FALLAMOUNT33"]?.ToString()) > decimal.Parse(q["F_AMOUNT"]?.ToString()))
|
||||
.Select(q => q["FBILLNO"]).ToList();
|
||||
if (one1.Count > 0)
|
||||
{
|
||||
throw new KDBusinessException("", $@"收款单编号{string.Join(",", one1)} 核销金额+已核销金额 大于 订单总金额 ");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
using DevExpress.Data.PLinq.Helpers;
|
||||
using Kingdee.BOS.App;
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.Metadata;
|
||||
using Kingdee.BOS.Core.Metadata.FieldElement;
|
||||
using Kingdee.BOS.Log;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Org.BouncyCastle.Asn1.X509;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace Pilot_KD_Parino.QPHY_AutoWrireRecord
|
||||
{
|
||||
[HotUpdate]
|
||||
[Description("收款核销5_2025-04-07")]
|
||||
public class HeXiaoJiLu : AbstractDynamicFormPlugIn
|
||||
{
|
||||
|
||||
#region DataChanged(单据体值更新事件)
|
||||
/// <summary>
|
||||
/// 单据体值更新事件
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
public override void DataChanged(DataChangedEventArgs e)
|
||||
{
|
||||
return;
|
||||
base.DataChanged(e);
|
||||
|
||||
//this.View.ShowMessage(e.Field.Key.ToString());
|
||||
if (e.Field.Key.Equals("FCONTRACTNUMBER") )
|
||||
{
|
||||
//this.View.ShowMessage("22");
|
||||
var entity = this.View.BusinessInfo.GetEntity("FEntity");
|
||||
if (entity == null)
|
||||
return;
|
||||
var tempRow = this.Model.GetEntityDataObject(entity, e.Row);//行数据包
|
||||
if (tempRow["F_VRYF_Base_qtr"] != null && tempRow["F_VRYF_Base_qtr"].ToString() != "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//var json = JsonUtil.Serialize(tempRow);
|
||||
//Logger.Error("采购订单信息", json, new Exception());
|
||||
if (tempRow["F_MBBA_Text_qtr"] != null && tempRow["F_MBBA_Text_qtr"].ToString() != "")
|
||||
{
|
||||
string heTong = tempRow["F_MBBA_Text_qtr"].ToString();
|
||||
long orgId = this.Context.CurrentOrganizationInfo.ID;
|
||||
string sql1 = string.Format($@"/*dialect*/SELECT TOP 1 a.*,b.Fname FROM dbo.T_SAL_ORDER a WITH(NOLOCK)
|
||||
LEFT JOIN dbo.V_BD_SALESMAN_L b WITH(NOLOCK) ON a.FSalerId=b.fid WHERE a.F_contractnumber='{heTong}' and a.FSALEORGID='{orgId}'");
|
||||
this.View.ShowMessage(sql1);
|
||||
Logger.Error("采购订单信息", sql1, new Exception());
|
||||
var sql1List = DBUtils.ExecuteDynamicObject(Context, sql1);
|
||||
if (sql1List != null && sql1List.Count > 0)
|
||||
{
|
||||
var one = sql1List.FirstOrDefault();
|
||||
//FormMetadata destFormMetadata = ServiceHelper.GetService<IMetaDataService>().Load(this.Context, "SAL_SaleOrder", one["FID"].ToString(), true) as FormMetadata;
|
||||
//var sale = BusinessDataServiceHelper.LoadSingle(this.Context, one["FID"], (destFormMetadata.BusinessInfo.GetField("F_VRYF_Base_qtr") as BaseDataField).RefFormDynamicObjectType);
|
||||
//DynamicObjectCollection FEntity = this.View.Model.DataObject["FEntity"] as DynamicObjectCollection;
|
||||
//var dsds = this.View.GetControl("F_VRYF_Base_qtr");
|
||||
//dsds.SetValue(one["FBILLNO"]);
|
||||
|
||||
//var tempRow2 = FEntity[e.Row];
|
||||
//tempRow2["F_VRYF_Base_qtr"] = sale;
|
||||
|
||||
//this.View.Model.SetValue("F_VRYF_Base_qtr", sale, e.Row);
|
||||
this.View.Model.SetValue("F_VRYF_Base_qtr", one["FID"], e.Row);
|
||||
//this.View.Model.SetValue("F_VRYF_Base_qtr", one["FBILLNO"], e.Row);
|
||||
//this.View.Model.SetValue("F_VRYF_Base_qtr", one["FBILLNO"], e.Row);
|
||||
//this.View.Model.SetValue("F_VRYF_Base_qtr", one["FBILLNO"], e.Row);
|
||||
this.View.UpdateView("FEntity");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,11 @@ namespace Pilot_KD_Parino.QPHY_AutoWrireRecord
|
||||
{
|
||||
base.BeforeDoSaveExecute(e);
|
||||
var dd = e.DataEntities[0];
|
||||
if (dd["DocumentStatus"].ToString() == "C")
|
||||
{
|
||||
return;
|
||||
}
|
||||
string Id = dd["Id"].ToString();
|
||||
var sssd = JsonHelper.ToJson(dd);
|
||||
Logger.Error("核销记录单", sssd, new Exception());
|
||||
var list1 = dd["FEntity"] as DynamicObjectCollection;
|
||||
@@ -41,13 +46,23 @@ namespace Pilot_KD_Parino.QPHY_AutoWrireRecord
|
||||
|
||||
var billList = list1.Select(t => t["FBILLNO2"]).ToList();
|
||||
string bill = string.Join("','",billList);
|
||||
string sql = $@"/*dialect*/ SELECT a.FBILLNO,(b.FBillAllAmount- isnull(a.F_AMOUNT,0)) as F_AMOUNT FROM dbo.T_SAL_ORDER a
|
||||
LEFT JOIN dbo.T_SAL_ORDERFIN b ON a.FID=b.FID
|
||||
WHERE a.FBILLNO in ('{bill}') ";
|
||||
// string sql = $@"/*dialect*/ SELECT a.FBILLNO,(SUM(c.FAllAmount)- isnull(a.F_AMOUNT,0)) as F_AMOUNT FROM dbo.T_SAL_ORDER a
|
||||
//LEFT JOIN dbo.T_SAL_ORDERENTRY_F c ON a.FID=c.FID
|
||||
//WHERE a.FBILLNO in ('{bill}') AND c.FAllAmount>0
|
||||
//GROUP BY a.FBILLNO,a.F_AMOUNT ";
|
||||
|
||||
string sql = $@"/*dialect*/SELECT bb.F_CONTRACTNUMBER,bb.F_AMOUNT,fin.FBillAllAmount,bb.F_expenses, bb.FBILLNO
|
||||
,(bb.ZhengShuHeJi+bb.F_expenses-bb.F_AMOUNT) AS XiaoFamount
|
||||
,b.FALLAMOUNT22
|
||||
FROM T_AutoWrireRecordEntry b
|
||||
INNER JOIN dbo.ZZV_SalOrder bb
|
||||
ON b.FBILLNO2=bb.FBILLNO
|
||||
INNER JOIN dbo.T_SAL_ORDERFIN fin ON bb.FID=fin.FID
|
||||
WHERE bb.FBILLNO in ('{bill}')";
|
||||
var data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
var one1 = (from q in data
|
||||
join b in list1 on q["FBILLNO"].ToString() equals b["FBILLNO2"].ToString()
|
||||
where decimal.Parse(b["FALLAMOUNT22"]?.ToString()) > decimal.Parse(q["F_AMOUNT"]?.ToString())
|
||||
where decimal.Parse(b["FALLAMOUNT22"]?.ToString()) > decimal.Parse(q["XiaoFamount"]?.ToString())
|
||||
select q["FBILLNO"]).ToList();
|
||||
if (one1.Count > 0)
|
||||
{
|
||||
|
||||
72
Pilot_KD_Parino/QPHY_AutoWrireRecord/HeXiaoJiLuYanZheng.cs
Normal file
72
Pilot_KD_Parino/QPHY_AutoWrireRecord/HeXiaoJiLuYanZheng.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using DevExpress.Data.PLinq.Helpers;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.App;
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Core.DynamicForm;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.Metadata;
|
||||
using Kingdee.BOS.Core.Metadata.FieldElement;
|
||||
using Kingdee.BOS.Log;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Org.BouncyCastle.Asn1.X509;
|
||||
using Pilot_KD_Parino.Common;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace Pilot_KD_Parino.QPHY_AutoWrireRecord
|
||||
{
|
||||
[Description("销售核销单提交和审核前校验插件"), HotUpdate]
|
||||
public class HeXiaoJiLuYanZheng : AbstractOperationServicePlugIn
|
||||
{
|
||||
DynamicObject sheet = null;
|
||||
public override void BeforeExecuteOperationTransaction(BeforeExecuteOperationTransaction e)
|
||||
{
|
||||
|
||||
base.BeforeExecuteOperationTransaction(e);
|
||||
foreach (var rows in e.SelectedRows)
|
||||
{
|
||||
var Billobj = rows.DataEntity;
|
||||
sheet = Billobj;
|
||||
var sdsas = JsonHelper.ToJson(Billobj);
|
||||
Logger.Error("销售销记录提交或者审核3", sdsas, new Exception());
|
||||
//获取单据Id
|
||||
string Id = sheet["Id"].ToString();
|
||||
string sql = $@"/*dialect*/SELECT bb.F_CONTRACTNUMBER,bb.F_AMOUNT,fin.FBillAllAmount,bb.F_expenses, bb.FBILLNO
|
||||
,(bb.ZhengShuHeJi+bb.F_expenses-bb.F_AMOUNT) AS XiaoFamount
|
||||
,b.FALLAMOUNT22
|
||||
FROM T_AutoWrireRecordEntry b
|
||||
INNER JOIN dbo.ZZV_SalOrder bb
|
||||
ON b.FBILLNO2=bb.FBILLNO
|
||||
INNER JOIN dbo.T_SAL_ORDERFIN fin ON bb.FID=fin.FID
|
||||
WHERE b.fid={Id} ";
|
||||
var data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
var one1 = data.Where(q => decimal.Parse(q["FALLAMOUNT22"]?.ToString()) > decimal.Parse(q["XiaoFamount"]?.ToString()))
|
||||
.Select(q => q["FBILLNO"]).ToList();
|
||||
if (one1.Count > 0)
|
||||
{
|
||||
throw new KDBusinessException("", $@"销售单编号{string.Join(",", one1)} 核销金额+已核销金额 大于 订单总金额 ");
|
||||
}
|
||||
|
||||
sql = $@"/*dialect*/SELECT a.FBILLNO,(a.FRECAMOUNTFOR-a.F_AMOUNT) as F_AMOUNT,b.FALLAMOUNT33 FROM dbo.T_AR_RECEIVEBILL a
|
||||
INNER JOIN T_AutoWrireRecordEntry2 b
|
||||
ON a.FBILLNO=b.FBILLNO3
|
||||
WHERE b.FID={Id} ";
|
||||
data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
|
||||
one1 = data.Where(q => decimal.Parse(q["FALLAMOUNT33"]?.ToString()) > decimal.Parse(q["F_AMOUNT"]?.ToString()))
|
||||
.Select(q => q["FBILLNO"]).ToList();
|
||||
if (one1.Count > 0)
|
||||
{
|
||||
throw new KDBusinessException("", $@"收款单编号{string.Join(",", one1)} 核销金额+已核销金额 大于 订单总金额 ");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace Pilot_KD_Parino.SQL
|
||||
C.FBILLALLAMOUNT_LC AS 'FALLAMOUNT' ,
|
||||
C.FBILLALLAMOUNT as 'FALLAMOUNTY',
|
||||
ISNULL(A.F_AMOUNT,0) as 'FYAMOUNT',
|
||||
C.FBILLALLAMOUNT+a.F_EXPENSES-A.F_AMOUNT as 'FDAMOUNT2',
|
||||
a.ZhengShuHeJi+a.F_EXPENSES-A.F_AMOUNT as 'FDAMOUNT2',
|
||||
C.FSETTLECURRID as 'FCurr',
|
||||
case when DATEDIFF(MONTH, A.FDATE, GETDATE())<3 then 'True' else 'False' end as 'FIs30' ,
|
||||
'销售订单' as 'FTYPE',
|
||||
@@ -113,7 +113,7 @@ GROUP BY F_PaperNumber, FSALEORGID
|
||||
,a.F_EXPENSES
|
||||
,(SELECT ll.FNAME FROM dbo.T_BD_CURRENCY_L ll WITH(NOLOCK) where ll.FCURRENCYID=c.FSettleCurrId ) AS [FBiBie]
|
||||
, c.FExchangeRate FHuiLv
|
||||
FROM T_SAL_ORDER A
|
||||
FROM ZZV_SalOrder A
|
||||
INNER JOIN T_SAL_ORDERFIN C ON C.FID =A.FID
|
||||
WHERE
|
||||
C.FBILLALLAMOUNT_LC >0
|
||||
@@ -150,6 +150,12 @@ GROUP BY F_PaperNumber, FSALEORGID
|
||||
C.FBILLALLAMOUNT as 'FALLAMOUNTY',
|
||||
ISNULL(A.F_AMOUNT,0) as 'FYAMOUNT',
|
||||
C.FBILLALLAMOUNT-A.F_AMOUNT as 'FDAMOUNT2',
|
||||
(SELECT TOP 1
|
||||
(fin.FBillAllAmount+bb.F_expenses-bb.F_AMOUNT) AS XiaoFamount
|
||||
FROM dbo.T_SAL_ORDER bb
|
||||
INNER JOIN dbo.T_SAL_ORDERFIN fin ON bb.FID=fin.FID
|
||||
WHERE a.F_PAPERCONTRACT=bb.F_CONTRACTNUMBER AND a.FSALEORGID=bb.FSALEORGID ) AS FDAMOUNT2222,
|
||||
|
||||
C.FSETTLECURRID as 'FCurr',
|
||||
case when DATEDIFF(MONTH, A.FDATE, GETDATE())<3 then 'True' else 'False' end as 'FIs30' ,
|
||||
'发货通知单' as 'FTYPE',
|
||||
@@ -182,7 +188,9 @@ GROUP BY F_PaperNumber, FSALEORGID
|
||||
AND A.FDOCUMENTSTATUS = 'C' AND ISNULL(A.F_Papercontract,'')!=''
|
||||
AND (A.F_AMOUNT < C.FBILLALLAMOUNT
|
||||
or A.F_AMOUNT IS NULL) {where}
|
||||
) A ORDER BY A.FCUSTID,a.FID desc ");
|
||||
) A
|
||||
WHERE a.FDAMOUNT2 <= a.FDAMOUNT2222
|
||||
ORDER BY A.FCUSTID,a.FID desc ");
|
||||
return DBServiceHelper.ExecuteDynamicObject(ctx, sql.ToString(), null, null, CommandType.Text, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,15 +114,14 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
//获取单据转换规则
|
||||
ConvertRuleElement ruleElement;
|
||||
|
||||
var ruleElementList = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).ToList();
|
||||
if (target == "PUR_PurchaseOrder")
|
||||
{
|
||||
var ruleMetaData = ConvertServiceHelper.GetConvertRule(this.Context, "d124a6be-5f97-4d1f-b5fd-e20e53e0ed2a");
|
||||
ruleElement = ruleMetaData.Rule;
|
||||
ruleElement = ruleElementList.Where(t => t.OriginKey == "d124a6be-5f97-4d1f-b5fd-e20e53e0ed2a").FirstOrDefault();
|
||||
}
|
||||
else if (target == "SAL_SaleOrder")
|
||||
{
|
||||
var ruleMetaData = ConvertServiceHelper.GetConvertRule(this.Context, "8ee74811-5784-40a8-80c4-a94cd43eed70");
|
||||
ruleElement = ruleMetaData.Rule;
|
||||
ruleElement = ruleElementList.Where(t => t.OriginKey == "8ee74811-5784-40a8-80c4-a94cd43eed70").FirstOrDefault();
|
||||
}
|
||||
else
|
||||
ruleElement = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).FirstOrDefault();
|
||||
|
||||
@@ -582,8 +582,30 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
{
|
||||
IOperationResult result = new OperationResult();
|
||||
//获取单据转换规则
|
||||
ConvertRuleElement ruleElement = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).FirstOrDefault();
|
||||
ConvertRuleElement ruleElement;
|
||||
var ruleElementList = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).ToList();
|
||||
if (source == "PUR_PurchaseOrder" && target== "PUR_ReceiveBill")
|
||||
{
|
||||
ruleElement = ruleElementList.Where(t => t.OriginKey == "cc8862d6-9368-4f7d-bc83-38ce217b6ba1").FirstOrDefault();
|
||||
|
||||
}
|
||||
else if (source == "PUR_ReceiveBill" && target == "STK_InStock")
|
||||
{
|
||||
ruleElement = ruleElementList.Where(t => t.OriginKey == "e51ffa3e-3a6f-4084-8868-9370f5977bcc").FirstOrDefault();
|
||||
|
||||
}
|
||||
else if (source == "SAL_SaleOrder" && target == "SAL_DELIVERYNOTICE")
|
||||
{
|
||||
ruleElement = ruleElementList.Where(t => t.OriginKey == "9090ab67-7255-4a33-a457-a70fa2d90536").FirstOrDefault();
|
||||
|
||||
}
|
||||
else if (source == "SAL_DELIVERYNOTICE" && target == "SAL_OUTSTOCK")
|
||||
{
|
||||
ruleElement = ruleElementList.Where(t => t.OriginKey == "59bef03a-5c03-426b-8cc3-7631d11a951b").FirstOrDefault();
|
||||
|
||||
}
|
||||
else
|
||||
ruleElement = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).FirstOrDefault();
|
||||
//如下代码 直接通过查询数据库获取单据转换源单数据
|
||||
ListSelectedRowCollection rows = new ListSelectedRowCollection();
|
||||
int i = 0;
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
getSourceSql = $@"/*dialect*/SELECT FSTABLENAME,FSBILLID,FENTRYID FROM T_PUR_ReqEntry_LK
|
||||
WHERE FSBILLID = {tempFid} and FSTABLENAME='T_SAL_ORDERENTRY' ";
|
||||
dt = DBServiceHelper.ExecuteDynamicObject(this.Context, getSourceSql);
|
||||
|
||||
if (dt == null || dt.Count == 0 || dt.Count>1)
|
||||
{
|
||||
//throw new KDBusinessException("", "没有找到跨组织的采购申请单:" + getSourceSql);
|
||||
@@ -87,6 +88,12 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
}
|
||||
else
|
||||
{
|
||||
var FSBILLIDList = dt.Select(t => t["FSBILLID"].ToString()).Distinct().ToList();
|
||||
if (FSBILLIDList.Count > 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//采购订单
|
||||
tempFid = int.Parse(dt.Select(t => t["FSBILLID"]).FirstOrDefault().ToString());
|
||||
tablename = dt.Select(t => t["FSTABLENAME"]).FirstOrDefault().ToString();
|
||||
@@ -98,13 +105,18 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
getSourceSql = $@"/*dialect*/SELECT FSTABLENAME,FSBILLID,FENTRYID FROM t_PUR_POOrderEntry_LK
|
||||
WHERE FSBILLID = {tempFid} and FSTABLENAME='T_PUR_ReqEntry' ";
|
||||
dt = DBServiceHelper.ExecuteDynamicObject(this.Context, getSourceSql);
|
||||
if (dt == null || dt.Count == 0 || dt.Count > 1)
|
||||
if (dt == null || dt.Count == 0)
|
||||
{
|
||||
//throw new KDBusinessException("", "没有找到跨组织的采购订单:" + getSourceSql);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
var FSBILLIDList2 = dt.Select(t => t["FSBILLID"].ToString()).Distinct().ToList();
|
||||
if (FSBILLIDList2.Count > 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//兴诺的销售订单
|
||||
tempFid = int.Parse(dt.Select(t => t["FSBILLID"]).FirstOrDefault().ToString());
|
||||
tablename = dt.Select(t => t["FSTABLENAME"]).FirstOrDefault().ToString();
|
||||
@@ -154,9 +166,15 @@ namespace Pilot_KD_Parino.Sal_Order
|
||||
{
|
||||
IOperationResult result = new OperationResult();
|
||||
//获取单据转换规则
|
||||
ConvertRuleElement ruleElement = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).FirstOrDefault();
|
||||
ConvertRuleElement ruleElement;
|
||||
var ruleElementList = ServiceHelper.GetService<IConvertService>().GetConvertRules(this.Context, source, target).ToList();
|
||||
var akdos = JsonHelper.ToJson(ruleElementList);
|
||||
Logger.Error("获取单据转换规则", akdos, new Exception());
|
||||
|
||||
//如下代码 直接通过查询数据库获取单据转换源单数据
|
||||
ruleElement = ruleElementList.Where(t => t.OriginKey == "9090ab67-7255-4a33-a457-a70fa2d90536").FirstOrDefault();
|
||||
//var ruleMetaData = ConvertServiceHelper.GetConvertRule(this.Context, "9090ab67-7255-4a33-a457-a70fa2d90536");
|
||||
//ruleElement = ruleMetaData.Rule;
|
||||
//如下代码 直接通过查询数据库获取单据转换源单数据 9090ab67-7255-4a33-a457-a70fa2d90536
|
||||
ListSelectedRowCollection rows = new ListSelectedRowCollection();
|
||||
int i = 0;
|
||||
ListSelectedRow row = new ListSelectedRow(tempFid, string.Empty, i++, source);
|
||||
|
||||
82
Pilot_KD_Parino/Sal_Order/SaleOrderJieSuanJia.cs
Normal file
82
Pilot_KD_Parino/Sal_Order/SaleOrderJieSuanJia.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Log;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Pilot_KD_Parino.Common;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
|
||||
namespace Pilot_KD_Parino.Sal_Order
|
||||
{
|
||||
[Description("销售订单提交时刷结算价相关字段"), HotUpdate]
|
||||
public class SaleOrderJieSuanJia : AbstractOperationServicePlugIn
|
||||
{
|
||||
|
||||
DynamicObject sheet = null;
|
||||
public override void BeforeExecuteOperationTransaction(BeforeExecuteOperationTransaction e)
|
||||
{
|
||||
|
||||
base.BeforeExecuteOperationTransaction(e);
|
||||
foreach (var rows in e.SelectedRows)
|
||||
{
|
||||
var Billobj = rows.DataEntity;
|
||||
sheet = Billobj;
|
||||
var sdsas = JsonHelper.ToJson(Billobj);
|
||||
Logger.Error("销售订单对象", sdsas, new Exception());
|
||||
//获取单据Id
|
||||
string Id = sheet["Id"].ToString();
|
||||
string sql = $@"/*dialect*/UPDATE T_SAL_ORDERENTRY SET F_SettlementP=b.F_JSJ,F_SettlementAmount=FQty*b.F_JSJ
|
||||
FROM (SELECT b.FENTRYID, c.FMaterialId,c.F_JSJ ,fin.FExchangeRate ,F_SettlementP FROM dbo.T_SAL_ORDER a
|
||||
LEFT JOIN dbo.T_SAL_ORDERENTRY b ON a.fid=b.FID
|
||||
LEFT JOIN T_BD_MATERIAL c ON b.FMaterialId=c.FMATERIALID
|
||||
LEFT JOIN dbo.T_SAL_ORDERFIN fin ON a.fid=fin.FID
|
||||
WHERE b.FID={Id}) b
|
||||
WHERE T_SAL_ORDERENTRY.FENTRYID=b.FENTRYID;
|
||||
|
||||
exec [UPDATESpecialContracts] {Id} ";
|
||||
DBServiceHelper.Execute(this.Context, sql);
|
||||
|
||||
// UPDATE T_SAL_ORDER SET F_VRYF_Amount_yrr = b.F_SettlementAmount, F_differenceAmount = fin.FBillAllAmount_LC - b.F_SettlementAmount
|
||||
//FROM(SELECT b.FID, sum(F_SettlementAmount) F_SettlementAmount from dbo.T_SAL_ORDERENTRY b
|
||||
//WHERE b.FID ={ Id}
|
||||
// GROUP BY b.FID ) b
|
||||
// LEFT JOIN dbo.T_SAL_ORDERFIN fin ON b.fid = fin.FID
|
||||
//WHERE T_SAL_ORDER.FID = b.FID;
|
||||
|
||||
|
||||
|
||||
sql = $@"/*dialect*/SELECT FMaterialId FROM dbo.T_SAL_ORDERENTRY
|
||||
WHERE FID= {Id} AND F_SettlementP IS null";
|
||||
var data = DBServiceHelper.ExecuteDynamicObject(this.Context, sql, null, null, CommandType.Text, null);
|
||||
if (data != null && data.Count > 0 )
|
||||
{
|
||||
var FMaterialIdList = data.Select(t => t["FMaterialId"].ToString()).ToList();
|
||||
var SaleOrderEntryList = sheet["SaleOrderEntry"] as DynamicObjectCollection;
|
||||
string mese = "";
|
||||
foreach (var item in SaleOrderEntryList)
|
||||
{
|
||||
if (FMaterialIdList.Contains(item["MaterialId_Id"].ToString()))
|
||||
{
|
||||
var name = item["MaterialId"] as DynamicObject;
|
||||
mese += $@"第{item["Seq"].ToString()}分录的物料编码 {name["Number"].ToString()} 的结算价不能为空;
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
if (mese != "")
|
||||
{
|
||||
throw new KDBusinessException("", mese);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
13
更新核销金额.sql
13
更新核销金额.sql
@@ -18,17 +18,21 @@ WHERE fid=@fid
|
||||
UPDATE T_AutoWrireRecordEntry2 SET FALLAMOUNT3=FALLAMOUNT33,FCONTRACTNUMBER2=(SELECT STRING_AGG(FCONTRACTNUMBER,',') FROM T_AutoWrireRecordEntry WHERE fid= T_AutoWrireRecordEntry2.FID)
|
||||
WHERE fid=@fid
|
||||
|
||||
DECLARE @custID1 INT=0,@cusId2 INT=0
|
||||
DECLARE @custID1 INT=0,@cusId2 INT=0,@custIDcount INT =0;
|
||||
|
||||
SELECT @custID1=a.FCustId FROM dbo.T_SAL_ORDER a
|
||||
LEFT JOIN T_AutoWrireRecordEntry b ON a.FBILLNO=b.FBILLNO2
|
||||
WHERE b.fid=@fid
|
||||
|
||||
SELECT @custIDcount=COUNT(DISTINCT a.FCustId ) FROM dbo.T_SAL_ORDER a
|
||||
LEFT JOIN T_AutoWrireRecordEntry b ON a.FBILLNO=b.FBILLNO2
|
||||
WHERE b.fid=@fid
|
||||
|
||||
SELECT @cusId2=a.FCONTACTUNIT FROM dbo.T_AR_RECEIVEBILL a
|
||||
LEFT JOIN T_AutoWrireRecordEntry2 b ON a.FBILLNO=b.FBILLNO3
|
||||
WHERE b.fid=@fid
|
||||
|
||||
IF(@custID1 !=@cusId2 )
|
||||
IF(@custID1 >0 AND @cusId2 >0 and @custID1 !=@cusId2 OR @custIDcount >1)
|
||||
begin
|
||||
UPDATE T_AutoWrireRecord SET F_KUAKEHU='<EFBFBD><EFBFBD>' WHERE FID=@fid
|
||||
update T_AutoWrireRecord SET F_YeWuDate=FCreateDate
|
||||
@@ -36,11 +40,12 @@ begin
|
||||
end
|
||||
ELSE
|
||||
begin
|
||||
UPDATE T_AutoWrireRecord SET F_KUAKEHU='<EFBFBD><EFBFBD>' WHERE FID=@fid
|
||||
UPDATE T_AutoWrireRecord SET F_KUAKEHU='<EFBFBD><EFBFBD>' WHERE FID=@fid
|
||||
|
||||
UPDATE T_AutoWrireRecord SET F_YeWuDate=b.FDATE3
|
||||
FROM T_AutoWrireRecordEntry2 b
|
||||
WHERE T_AutoWrireRecord.FID=@fid AND F_YeWuDate IS NULL AND b.FID=T_AutoWrireRecord.FID
|
||||
END
|
||||
|
||||
UPDATE C SET F_Amount =c.F_Amount+ISNULL( d.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)
|
||||
FROM T_AutoWrireRecord A
|
||||
@@ -54,7 +59,7 @@ begin
|
||||
GROUP BY B.FBILLNO2
|
||||
) d ON d.FBILLNO2 =b.FBILLNO2
|
||||
WHERE a.FID =@FID ;
|
||||
end
|
||||
|
||||
|
||||
--<EFBFBD><EFBFBD>Ӧ<EFBFBD>յ<EFBFBD><EFBFBD>ۼƺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
UPDATE C SET F_Amount =c.F_Amount+ISNULL( d.<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,0)
|
||||
|
||||
Reference in New Issue
Block a user