新增:

1.客户价格管理
2.销售订单表单插件取值
This commit is contained in:
liangjunyu
2025-11-18 14:50:08 +08:00
parent 61b915d793
commit 4dd2091dee
74 changed files with 694 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,104 @@
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Metadata;
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.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice
{
[HotUpdate, Description("客户价格管理_表单插件")]
public class Bill : AbstractBillPlugIn
{
public override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
public override void AfterBindData(EventArgs e)
{
base.AfterBindData(e);
var limitCustomer = this.View.Model.GetValue("FLimitCustomer").Long2Int();
SetBillContral(limitCustomer == 1);
}
public override void DataChanged(DataChangedEventArgs e)
{
base.DataChanged(e);
if (e.Field.Key.EqualsIgnoreCase("FLimitCustomer"))
{
var val = e.NewValue.Long2Int();
SetBillContral(val == 1);
}
if (e.Field.Key.EqualsIgnoreCase("FCustID"))
{
var custId_Id = e.NewValue.Long2Int();
if (custId_Id > 0)
{
var custId = this.View.Model.GetValue("FCustID", e.Row) as DynamicObject;
//KHXYFL013
var creditClassificationId = custId["F_CreditClassification_Id"];
if (!creditClassificationId.IsNullOrEmptyOrWhiteSpace())
{
var creditClassification = custId["F_CreditClassification"] as DynamicObject;
var number = creditClassification["Number"].ToString();
this.View.Model.SetValue("FIsBigCust", number.EqualsIgnoreCase("KHXYFL013"), e.Row);
}
}
else
{
this.View.Model.SetValue("FIsBigCust", false, e.Row);
}
}
if (e.Field.Key.EqualsIgnoreCase("FMaterialId"))
{
var materialId_Id = e.NewValue.Long2Int();
if (materialId_Id > 0)
{
var materialId = this.View.Model.GetValue("FMaterialId", e.Row) as DynamicObject;
var cbj = materialId["F_CBJ"];
var jsj = materialId["F_JSJ"];
this.View.Model.SetValue("F_CostPrice", cbj, e.Row);
this.View.Model.SetValue("F_SettlePrice", jsj, e.Row);
}
else
{
this.View.Model.SetValue("F_CostPrice", 0, e.Row);
this.View.Model.SetValue("F_SettlePrice", 0, e.Row);
}
}
}
private void SetBillContral(bool visible)
{
visible = !visible;
this.View.GetControl("F_MaterialModelGroup").Visible = !visible;
this.View.GetControl("F_BigCustSettlePrice").Visible = !visible;
this.View.GetControl("FMaterialId").Visible = visible;
this.View.GetControl("FMaterialName").Visible = visible;
this.View.GetControl("FMaterialModel").Visible = visible;
this.View.GetControl("F_AgreePrice").Visible = visible;
this.View.GetControl("FTab_P1").Visible = visible;
//字段必录项 mustinput 必须为小写
this.View.GetControl("F_MaterialModelGroup").SetCustomPropertyValue("mustinput", !visible);
this.View.GetControl("F_BigCustSettlePrice").SetCustomPropertyValue("mustinput", !visible);
this.View.GetControl("FMaterialId").SetCustomPropertyValue("mustinput", visible);
this.View.GetControl("F_AgreePrice").SetCustomPropertyValue("mustinput", visible);
this.View.GetControl("FCustID").SetCustomPropertyValue("mustinput", visible);
}
}
}

View File

@@ -0,0 +1,46 @@
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
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.FormElement;
namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
{
[HotUpdate, Description("客户价格管理_保存操作")]
public class Save : AbstractOperationServicePlugIn
{
public override void OnPreparePropertys(PreparePropertysEventArgs e)
{
base.OnPreparePropertys(e);
//添加需要加载的字段:
e.FieldKeys.Add("FLimitCustomer");
e.FieldKeys.Add("F_MaterialModelGroup");
e.FieldKeys.Add("FMaterialId");
e.FieldKeys.Add("FSeq");
//大客户结算底价
e.FieldKeys.Add("F_BigCustSettlePrice");
//协议客户协议价
e.FieldKeys.Add("F_AgreePrice");
e.FieldKeys.Add("FCustID");
}
public override void OnAddValidators(AddValidatorsEventArgs e)
{
base.OnAddValidators(e);
//添加检查校验器:
if (this.FormOperation.OperationId == FormOperation.Operation_Save)
{
var validator = new SaveValidator();//新增的校验器
validator.EntityKey = "FBillHead";
e.Validators.Add(validator);//添加校验器
}
}
}
}

View File

@@ -0,0 +1,159 @@
using Kingdee.BOS;
using Kingdee.BOS.Core;
using Kingdee.BOS.Core.Validation;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using Kingdee.K3.BD.NewCode.Core.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
{
public class SaveValidator : AbstractValidator
{
public override void Validate(ExtendedDataEntity[] dataEntities, ValidateContext validateContext, Context ctx)
{
foreach (var data in dataEntities)
{
var limitCustomer = data.DataEntity["LimitCustomer"].Long2Int();
var entrys = data.DataEntity["BD_CustPriceEntry"] as DynamicObjectCollection;
foreach (var entry in entrys)
{
var idx = entry["Seq"].Long2Int() - 1;
//大客户
if (limitCustomer == 1)
{
if (entry["MaterialModelGroup"].IsNullOrEmptyOrWhiteSpace())
{
var title = "物料规格类型必填!";
var msg = $"限定客户类型为大客户时,{title}";
var displayToFieldKey = "F_MaterialModelGroup";
validateContext.AddError(data
, new ValidationErrorInfo(
displayToFieldKey// 出错的字段Key可以空
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
, idx// 出错的数据行在全部数据行中的顺序如果校验基于单据头此为0
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
, msg // 错误的详细提示信息
, title// 错误的简明提示信息
, ErrorLevel.Error // 错误级别:警告、错误...
)
);
}
if (entry["BigCustSettlePrice"].Convert<decimal>() == 0M)
{
var title = "大客户底价必填!";
var msg = $"限定客户类型为大客户时,{title}";
var displayToFieldKey = "F_BigCustSettlePrice";
validateContext.AddError(data
, new ValidationErrorInfo(
displayToFieldKey// 出错的字段Key可以空
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
, idx// 出错的数据行在全部数据行中的顺序如果校验基于单据头此为0
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
, msg // 错误的详细提示信息
, title// 错误的简明提示信息
, ErrorLevel.Error // 错误级别:警告、错误...
)
);
}
}
//协议客户
if (limitCustomer == 2)
{
if (entry["MaterialId_Id"].Long2Int() == 0)
{
var title = "物料编码必填!";
var msg = $"限定客户类型为协议客户时,{title}";
var displayToFieldKey = "FMaterialId";
validateContext.AddError(data
, new ValidationErrorInfo(
displayToFieldKey// 出错的字段Key可以空
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
, idx // 出错的数据行在全部数据行中的顺序如果校验基于单据头此为0
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
, msg // 错误的详细提示信息
, title// 错误的简明提示信息
, ErrorLevel.Error // 错误级别:警告、错误...
)
);
}
if (entry["AgreePrice"].Convert<decimal>() == 0M)
{
var title = "协议价必填!";
var msg = $"限定客户类型为协议客户时,{title}";
var displayToFieldKey = "F_AgreePrice";
validateContext.AddError(data
, new ValidationErrorInfo(
displayToFieldKey// 出错的字段Key可以空
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
, idx // 出错的数据行在全部数据行中的顺序如果校验基于单据头此为0
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
, msg // 错误的详细提示信息
, title// 错误的简明提示信息
, ErrorLevel.Error // 错误级别:警告、错误...
)
);
}
}
if (limitCustomer == 0)
{
var title = "限定客户必填!";
var msg = $"限定客户不能为空";
var displayToFieldKey = "FMaterialId";
validateContext.AddError(data
, new ValidationErrorInfo(
displayToFieldKey// 出错的字段Key可以空
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
, 0 // 出错的数据行在全部数据行中的顺序如果校验基于单据头此为0
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
, msg // 错误的详细提示信息
, title// 错误的简明提示信息
, ErrorLevel.Error // 错误级别:警告、错误...
)
);
}
}
var entrys2 = data.DataEntity["BD_CustPriceCustEntry"] as DynamicObjectCollection;
if (limitCustomer != 1 && (entrys2 == null || entrys2.Count == 0))
{
var title = "客户必填!";
var msg = $"{title}";
var displayToFieldKey = "FCustID";
validateContext.AddError(data
, new ValidationErrorInfo(
displayToFieldKey// 出错的字段Key可以空
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
, 0 // 出错的数据行在全部数据行中的顺序如果校验基于单据头此为0
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
, msg // 错误的详细提示信息
, title// 错误的简明提示信息
, ErrorLevel.Error // 错误级别:警告、错误...
)
);
}
}
}
}
}

View File

@@ -0,0 +1,114 @@
using Gatedge.K3.Pilot.PlugIn.Services.DBService;
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using Kingdee.K3.BD.NewCode.Core.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.Sal_Order
{
[HotUpdate, Description("销售订单_表单插件")]
public class Bill : AbstractBillPlugIn
{
public override void DataChanged(DataChangedEventArgs e)
{
base.DataChanged(e);
//物料
if (e.Field.Key.EqualsIgnoreCase("FMaterialId"))
{
var materialId_Id = e.NewValue.Long2Int();
if (materialId_Id == 0)
return;
var custId_Id = this.View.Model.DataObject["CustId_Id"].Long2Int();
if (custId_Id == 0)
return;
var dal = new BDCustPriceDAL(this.Context);
var dateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
var resData = dal.GetMaterialPrice(materialId_Id, custId_Id, dateTime);
if (resData != null && resData.Count > 0)
{
var data = resData[0];
// 协议价
var F_AGREEPRICE = data["F_AGREEPRICE"].Convert<decimal>();
this.Model.SetValue("F_AGREEPRICE", F_AGREEPRICE, e.Row);
var custId = this.View.Model.GetValue("FCustID") as DynamicObject;
var creditClassificationId = custId["F_CreditClassification_Id"];
if (!creditClassificationId.IsNullOrEmptyOrWhiteSpace())
{
var creditClassification = custId["F_CreditClassification"] as DynamicObject;
var number = creditClassification["Number"].ToString();
if (number.EqualsIgnoreCase("KHXYFL013"))
{
// 大客户结算价
var F_BIGCUSTSETTLEPRICE = data["F_BIGCUSTSETTLEPRICE"].Convert<decimal>();
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", F_BIGCUSTSETTLEPRICE, e.Row);
}
}
}
}
//客户
if (e.Field.Key.EqualsIgnoreCase("FCustID"))
{
var custId_Id = e.NewValue.Long2Int();
if (custId_Id == 0)
return;
var dal = new BDCustPriceDAL(this.Context);
var dateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
var details = this.View.BusinessInfo.GetEntity("FSaleOrderEntry");
if (details != null)
{
var entrys = this.View.Model.GetEntityDataObject(details);
foreach (var entry in entrys)
{
var rowIndex = this.View.Model.GetRowIndex(details, entry);
var materialId_Id = entry["MaterialId_Id"].Long2Int();
if (materialId_Id == 0)
continue;
var resData = dal.GetMaterialPrice(materialId_Id, custId_Id, dateTime);
if (resData != null && resData.Count > 0)
{
var data = resData[0];
// 协议价
var F_AGREEPRICE = data["F_AGREEPRICE"].Convert<decimal>();
this.Model.SetValue("F_AGREEPRICE", F_AGREEPRICE, rowIndex);
var custId = this.View.Model.GetValue("FCustID") as DynamicObject;
var creditClassificationId = custId["F_CreditClassification_Id"];
if (!creditClassificationId.IsNullOrEmptyOrWhiteSpace())
{
var creditClassification = custId["F_CreditClassification"] as DynamicObject;
var number = creditClassification["Number"].ToString();
if (number.EqualsIgnoreCase("KHXYFL013"))
{
// 大客户结算价
var F_BIGCUSTSETTLEPRICE = data["F_BIGCUSTSETTLEPRICE"].Convert<decimal>();
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", F_BIGCUSTSETTLEPRICE, rowIndex);
}
}
}
}
}
}
}
}
}

View File

@@ -0,0 +1,107 @@
<?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>{B44EFC58-0B28-4CB5-A3DA-EB01B39C9358}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Gatedge.K3.Pilot.PlugIn</RootNamespace>
<AssemblyName>Gatedge.K3.Pilot.PlugIn</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="Kingdee.BOS">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.App">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.App.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.App.Core">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.App.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Contracts">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.Contracts.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Core">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.DataEntity">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.DataEntity.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.ServiceHelper">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.ServiceHelper.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.VerificationHelper">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.VerificationHelper.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Web">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.Web.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Web.HTML">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.Web.HTML.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Web.HTML.Core">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.Web.HTML.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.WebApi.FormService">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.BOS.WebApi.FormService.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.BD.Contracts">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.K3.BD.Contracts.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.BD.NewCode.Core">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.K3.BD.NewCode.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.BD.ServiceHelper">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.K3.BD.ServiceHelper.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.Core">
<HintPath>..\..\..\..\2.珠海英搏尔电气股份有限公司\0.软件工程\Gatedge.Enpower.BOS\Library\Kingdee.K3.Core.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="BOSPlugIn\BD_CustPrice\Bill.cs" />
<Compile Include="BOSPlugIn\BD_CustPrice\ServicePlugIn\Save.cs" />
<Compile Include="BOSPlugIn\BD_CustPrice\ServicePlugIn\SaveValidator.cs" />
<Compile Include="BOSPlugIn\Sal_Order\Bill.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\DBService\BaseDAL.cs" />
<Compile Include="Services\DBService\BDCustPriceDAL.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy $(TargetPath) "E:\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin"</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("Gatedge.K3.Pilot.PlugIn")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Gatedge.K3.Pilot.PlugIn")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("b44efc58-0b28-4cb5-a3da-eb01b39c9358")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,74 @@
using Kingdee.BOS;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.ServiceHelper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gatedge.K3.Pilot.PlugIn.Services.DBService
{
public class BDCustPriceDAL : BaseDAL
{
public BDCustPriceDAL(Context context) : base(context)
{
}
/// <summary>
/// 获取物料的协议价、大客户底价
/// </summary>
/// <param name="materialId"></param>
/// <param name="custId"></param>
/// <param name="dateTime"></param>
/// <returns></returns>
public DynamicObjectCollection GetMaterialPrice(int materialId, int custId, string dateTime)
{
var sql = $@"/*dialect*/
declare @FMaterialID int,@custId int,@dateTime datetime
SET @custId = {custId}
SET @FMaterialID = {materialId}
SET @dateTime = '{dateTime}'
SELECT t0.FMATERIALID,t0.FNUMBER,t0.FUSEORGID
,t0_l.FNAME,t0_l.FSPECIFICATION,ISNULL(t1.F_AGREEPRICE,0) AS F_AGREEPRICE,ISNULL(t2.F_BIGCUSTSETTLEPRICE,0) AS F_BIGCUSTSETTLEPRICE
FROM T_BD_MATERIAL t0
INNER JOIN T_BD_MATERIAL_L t0_l on t0_l.FMATERIALID = t0.FMATERIALID AND t0_l.FLOCALEID = 2052
OUTER APPLY (
SELECT TOP 1 t1e.F_AGREEPRICE
FROM T_BD_CustPrice t1
INNER JOIN T_BD_CustPriceEntry t1e on t1.FID = t1e.FID
INNER JOIN T_BD_CustPriceCustEntry t1ce on t1.FID = t1ce.FID
AND t1ce.FCUSTID = @custId
WHERE t1.FLIMITCUSTOMER = '2'
AND t1.FDOCUMENTSTATUS = 'C'
AND t1.FFORBIDSTATUS = 'A'
AND t1e.FROWAUDITSTATUS = 'A'
AND t1e.FFORBIDSTATUS = 'A'
AND @dateTime BETWEEN t1e.FEFFECTIVEDATE AND t1e.FEXPRIYDATE
AND t1.FUSEORGID = t0.FUSEORGID
AND t1e.FMATERIALID = t0.FMATERIALID
ORDER BY t1e.FMATERIALID
) t1
OUTER APPLY (
SELECT TOP 1 t2e.F_BIGCUSTSETTLEPRICE
FROM T_BD_CustPrice t2
INNER JOIN T_BD_CustPriceEntry t2e on t2.FID = t2e.FID
WHERE t2.FLIMITCUSTOMER = '1'
AND t2.FDOCUMENTSTATUS = 'C'
AND t2.FFORBIDSTATUS = 'A'
AND t2e.FROWAUDITSTATUS = 'A'
AND t2e.FFORBIDSTATUS = 'A'
AND @dateTime BETWEEN t2e.FEFFECTIVEDATE AND t2e.FEXPRIYDATE
AND t2.FUSEORGID = t0.FUSEORGID
AND CHARINDEX(t2e.F_MATERIALMODELGROUP,t0_l.FSPECIFICATION) = 1
ORDER BY t2e.FMATERIALID
) t2
WHERE 1 = 1
AND t0.FMATERIALID = @FMaterialID
";
return DBServiceHelper.ExecuteDynamicObject(this.Context, sql);
}
}
}

View File

@@ -0,0 +1,18 @@
using Kingdee.BOS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Gatedge.K3.Pilot.PlugIn.Services.DBService
{
public class BaseDAL
{
public Context Context { get; private set; }
public BaseDAL(Context context)
{
this.Context = context;
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]

View File

@@ -0,0 +1 @@
76d6b4cc683fc0c1109d7648667b185f6a4dc7510c4736abe4bd191d9e2d9aa5

View File

@@ -0,0 +1,25 @@
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Gatedge.K3.Pilot.PlugIn.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Gatedge.K3.Pilot.PlugIn.pdb
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.App.Core.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.App.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.Contracts.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.Core.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.DataEntity.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.ServiceHelper.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.VerificationHelper.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.Web.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.Web.HTML.Core.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.Web.HTML.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.BOS.WebApi.FormService.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.K3.BD.Contracts.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.K3.BD.NewCode.Core.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.K3.BD.ServiceHelper.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Kingdee.K3.Core.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Newtonsoft.Json.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\bin\Debug\Oracle.DataAccess.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\obj\Debug\Gatedge.K3.Pilot.PlugIn.csproj.AssemblyReference.cache
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\obj\Debug\Gatedge.K3.Pilot.PlugIn.csproj.CoreCompileInputs.cache
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\obj\Debug\Gatedge..4146081E.Up2Date
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\obj\Debug\Gatedge.K3.Pilot.PlugIn.dll
E:\Work\珠海格致软件有限公司\0.开发任务\5.珠海派诺科技股份有限公司\0.软件工程\Pilot_KD_Parino_yuyubo\Gatedge.K3.Pilot.PlugIn\obj\Debug\Gatedge.K3.Pilot.PlugIn.pdb