1
This commit is contained in:
parent
566746e624
commit
c8027bd094
@ -27,6 +27,23 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice
|
||||
SetBillContral(limitCustomer == 1);
|
||||
}
|
||||
|
||||
public override void BeforeF7Select(BeforeF7SelectEventArgs e)
|
||||
{
|
||||
base.BeforeF7Select(e);
|
||||
}
|
||||
/// <summary>
|
||||
/// 下拉框根据编号取值前事件
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
public override void BeforeSetItemValueByNumber(BeforeSetItemValueByNumberArgs e)
|
||||
{
|
||||
base.BeforeSetItemValueByNumber(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 值更新事件
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
public override void DataChanged(DataChangedEventArgs e)
|
||||
{
|
||||
base.DataChanged(e);
|
||||
@ -36,28 +53,6 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice
|
||||
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();
|
||||
@ -85,6 +80,7 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice
|
||||
|
||||
this.View.GetControl("F_MaterialModelGroup").Visible = !visible;
|
||||
this.View.GetControl("F_BigCustSettlePrice").Visible = !visible;
|
||||
this.View.GetControl("F_BigCustDiscRate").Visible = !visible;
|
||||
|
||||
this.View.GetControl("FMaterialId").Visible = visible;
|
||||
this.View.GetControl("FMaterialName").Visible = visible;
|
||||
|
||||
@ -19,6 +19,7 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
base.OnPreparePropertys(e);
|
||||
//添加需要加载的字段:
|
||||
e.FieldKeys.Add("FLimitCustomer");
|
||||
//产品类型
|
||||
e.FieldKeys.Add("F_MaterialModelGroup");
|
||||
e.FieldKeys.Add("FMaterialId");
|
||||
e.FieldKeys.Add("FSeq");
|
||||
@ -29,6 +30,8 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
e.FieldKeys.Add("F_AgreePrice");
|
||||
|
||||
e.FieldKeys.Add("FCustID");
|
||||
e.FieldKeys.Add("FEntryEffectiveDate");//生效日期
|
||||
e.FieldKeys.Add("FEntryExpiryDate");//失效日期
|
||||
}
|
||||
|
||||
public override void OnAddValidators(AddValidatorsEventArgs e)
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using Kingdee.BOS;
|
||||
using Gatedge.K3.Pilot.PlugIn.Models.Validate;
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Core;
|
||||
using Kingdee.BOS.Core.Validation;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
@ -9,6 +10,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
{
|
||||
@ -20,16 +22,28 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
{
|
||||
var limitCustomer = data.DataEntity["LimitCustomer"].Long2Int();
|
||||
var entrys = data.DataEntity["BD_CustPriceEntry"] as DynamicObjectCollection;
|
||||
//var idx = 0;
|
||||
var periodValidityList = new List<PeriodValidity>();
|
||||
foreach (var entry in entrys)
|
||||
{
|
||||
var idx = entry["Seq"].Long2Int() - 1;
|
||||
var pvData = new PeriodValidity
|
||||
{
|
||||
Seq = entry["Seq"].Long2Int(),
|
||||
MaterialModelGroup = entry["MaterialModelGroup"]?.ToString(),
|
||||
MaterialId = entry["MaterialId_Id"].Long2Int(),
|
||||
EffectiveDate = entry["EffectiveDate"] is DateTime ed ? ed : DateTime.MinValue,
|
||||
ExpirationDate = entry["ExpiryDate"] is DateTime exd ? exd : DateTime.MinValue
|
||||
};
|
||||
|
||||
var seq = entry["Seq"].Long2Int();
|
||||
//大客户
|
||||
if (limitCustomer == 1)
|
||||
{
|
||||
if (entry["MaterialModelGroup"].IsNullOrEmptyOrWhiteSpace())
|
||||
var materialModelGroup = entry["MaterialModelGroup"]?.ToString();
|
||||
if (materialModelGroup.IsNullOrEmptyOrWhiteSpace())
|
||||
{
|
||||
var title = "物料规格类型必填!";
|
||||
var msg = $"限定客户类型为大客户时,{title}";
|
||||
var msg = $"客户类型为大客户时,{title}";
|
||||
var displayToFieldKey = "F_MaterialModelGroup";
|
||||
|
||||
validateContext.AddError(data
|
||||
@ -37,7 +51,7 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
displayToFieldKey// 出错的字段Key,可以空
|
||||
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
|
||||
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
|
||||
, idx// 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, seq// 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
|
||||
, msg // 错误的详细提示信息
|
||||
, title// 错误的简明提示信息
|
||||
@ -49,7 +63,7 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
if (entry["BigCustSettlePrice"].Convert<decimal>() == 0M)
|
||||
{
|
||||
var title = "大客户底价必填!";
|
||||
var msg = $"限定客户类型为大客户时,{title}";
|
||||
var msg = $"客户类型为大客户时,{title}";
|
||||
var displayToFieldKey = "F_BigCustSettlePrice";
|
||||
|
||||
validateContext.AddError(data
|
||||
@ -57,7 +71,7 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
displayToFieldKey// 出错的字段Key,可以空
|
||||
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
|
||||
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
|
||||
, idx// 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, seq// 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
|
||||
, msg // 错误的详细提示信息
|
||||
, title// 错误的简明提示信息
|
||||
@ -65,8 +79,15 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//设置分组Id
|
||||
var first = periodValidityList.FirstOrDefault(w => w.MaterialModelGroup.Contains(pvData.MaterialModelGroup) || pvData.MaterialModelGroup.Contains(w.MaterialModelGroup));
|
||||
|
||||
pvData.GroupId = first == null ? pvData.Seq : first.GroupId;
|
||||
}
|
||||
|
||||
periodValidityList.Add(pvData);
|
||||
|
||||
//协议客户
|
||||
if (limitCustomer == 2)
|
||||
{
|
||||
@ -81,7 +102,7 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
displayToFieldKey// 出错的字段Key,可以空
|
||||
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
|
||||
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
|
||||
, idx // 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, seq // 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
|
||||
, msg // 错误的详细提示信息
|
||||
, title// 错误的简明提示信息
|
||||
@ -101,7 +122,7 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
displayToFieldKey// 出错的字段Key,可以空
|
||||
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
|
||||
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
|
||||
, idx // 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, seq // 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
|
||||
, msg // 错误的详细提示信息
|
||||
, title// 错误的简明提示信息
|
||||
@ -109,12 +130,14 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
)
|
||||
);
|
||||
}
|
||||
//设置分组Id
|
||||
pvData.GroupId = pvData.MaterialId;
|
||||
}
|
||||
|
||||
if (limitCustomer == 0)
|
||||
{
|
||||
var title = "限定客户必填!";
|
||||
var msg = $"限定客户不能为空";
|
||||
var title = "客户类型必填!";
|
||||
var msg = $"客户类型不能为空";
|
||||
var displayToFieldKey = "FMaterialId";
|
||||
|
||||
validateContext.AddError(data
|
||||
@ -133,6 +156,56 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.BD_CustPrice.ServicePlugIn
|
||||
|
||||
}
|
||||
|
||||
if (limitCustomer != 0 && periodValidityList.Count > 1)
|
||||
{
|
||||
//筛选出需要校验的数据
|
||||
//大客户:产品类型不为空的
|
||||
//协议客户:物料Id不为0的
|
||||
var selList = periodValidityList.Where(w =>
|
||||
(limitCustomer == 1 && !w.MaterialModelGroup.IsNullOrEmptyOrWhiteSpace())
|
||||
|| (limitCustomer == 2 && !(w.MaterialId == 0))
|
||||
).ToList();
|
||||
|
||||
if (selList.Any())
|
||||
{
|
||||
var groupList = selList.GroupBy(g => g.GroupId).Where(wg => wg.Count() > 1).ToList();
|
||||
|
||||
foreach (var group in groupList)
|
||||
{
|
||||
var items = group.ToList().OrderBy(o => o.EffectiveDate).ToList();
|
||||
for (int i = 0; i < items.Count - 1; i++)
|
||||
{
|
||||
var currentItem = items[i];
|
||||
var currSeq = currentItem.Seq;
|
||||
for (int j = i + 1; j < items.Count; j++)
|
||||
{
|
||||
var compareItem = items[j];
|
||||
if (currentItem.ExpirationDate >= compareItem.EffectiveDate)
|
||||
{
|
||||
var seq = compareItem.Seq;
|
||||
var title = "同物料、产品类型,效期不能重叠!";
|
||||
var msg = $"第【{seq}】行与第【{currSeq}】行效期重叠!";
|
||||
var displayToFieldKey = "FEntryEffectiveDate";
|
||||
|
||||
validateContext.AddError(data
|
||||
, new ValidationErrorInfo(
|
||||
displayToFieldKey// 出错的字段Key,可以空
|
||||
, data.DataEntity["Id"].ToString() // 数据包内码,必填,后续操作会据此内码避开此数据包
|
||||
, data.DataEntityIndex // 出错的数据包在全部数据包中的顺序
|
||||
, seq// 出错的数据行在全部数据行中的顺序,如果校验基于单据头,此为0
|
||||
, "REF"// 错误编码,可以任意设定一个字符,主要用于追查错误来源
|
||||
, msg // 错误的详细提示信息
|
||||
, title// 错误的简明提示信息
|
||||
, ErrorLevel.Error // 错误级别:警告、错误...
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var entrys2 = data.DataEntity["BD_CustPriceCustEntry"] as DynamicObjectCollection;
|
||||
|
||||
if (limitCustomer != 1 && (entrys2 == null || entrys2.Count == 0))
|
||||
|
||||
@ -0,0 +1,43 @@
|
||||
using Kingdee.BOS;
|
||||
using Kingdee.BOS.Core.List.PlugIn;
|
||||
using Kingdee.BOS.Core.List.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;
|
||||
|
||||
namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.CUST_PAYMENT_PERIOD
|
||||
{
|
||||
[Description("【客户账期_列表插件】列表动态创建列"), HotUpdate]
|
||||
public class List : AbstractListPlugIn
|
||||
{
|
||||
public override void CreateListHeader(CreateListHeaderEventArgs e)
|
||||
{
|
||||
base.CreateListHeader(e);
|
||||
// 创建动态列1
|
||||
var header = e.ListHeader.AddChild();// 将动态列放在列表的最后面
|
||||
//var header = e.ListHeader.AddChild(0);// 将动态列放在列表的指定位置
|
||||
header.Caption = new LocaleValue("账期情况");
|
||||
header.Key = "FDynamicColumn1";
|
||||
header.FieldName = "FDynamicColumn1";
|
||||
header.ColType = SqlStorageType.Sqlnvarchar;
|
||||
header.Width = 200;
|
||||
header.Visible = true;
|
||||
header.ColIndex = e.ListHeader.GetChilds().Max(o => o.ColIndex) + 1;// 注意:列的显示顺序不是ColIndex决定的,而是由该列在ListHeader的childs集合中的位置决定的。
|
||||
|
||||
}
|
||||
|
||||
public override void FormatCellValue(FormatCellValueArgs args)
|
||||
{
|
||||
base.FormatCellValue(args);
|
||||
if (args.Header.Key.Equals("FDynamicColumn1", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
args.FormateValue = string.Format("{0}=>{1}", args.Header.Caption, DateTime.Now);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -22,6 +22,9 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.Sal_Order
|
||||
//物料
|
||||
if (e.Field.Key.EqualsIgnoreCase("FMaterialId"))
|
||||
{
|
||||
this.Model.SetValue("F_AGREEPRICE", 0, e.Row);
|
||||
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", 0, e.Row);
|
||||
|
||||
var materialId_Id = e.NewValue.Long2Int();
|
||||
if (materialId_Id == 0)
|
||||
return;
|
||||
@ -41,20 +44,20 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.Sal_Order
|
||||
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();
|
||||
// 大客户结算价
|
||||
var F_BIGCUSTSETTLEPRICE = data["F_BIGCUSTSETTLEPRICE"].Convert<decimal>();
|
||||
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", F_BIGCUSTSETTLEPRICE, e.Row);
|
||||
|
||||
if (number.EqualsIgnoreCase("KHXYFL013"))
|
||||
{
|
||||
// 大客户结算价
|
||||
var F_BIGCUSTSETTLEPRICE = data["F_BIGCUSTSETTLEPRICE"].Convert<decimal>();
|
||||
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", F_BIGCUSTSETTLEPRICE, e.Row);
|
||||
}
|
||||
}
|
||||
//大客户折扣率
|
||||
var F_BigCustDiscRate = data["F_BIGCUSTDISCRATE"].Convert<decimal>();
|
||||
this.Model.SetValue("F_BigCustDiscRate", F_BigCustDiscRate, e.Row);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Model.SetValue("F_AGREEPRICE", 0, e.Row);
|
||||
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", 0, e.Row);
|
||||
this.Model.SetValue("F_BigCustDiscRate", 0, e.Row);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,8 +65,6 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.Sal_Order
|
||||
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");
|
||||
@ -76,34 +77,36 @@ namespace Gatedge.K3.Pilot.PlugIn.BOSPlugIn.Sal_Order
|
||||
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);
|
||||
this.Model.SetValue("F_AGREEPRICE", 0, rowIndex);
|
||||
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", 0, rowIndex);
|
||||
this.Model.SetValue("F_BigCustDiscRate", 0, rowIndex);
|
||||
|
||||
if (resData != null && resData.Count > 0)
|
||||
if (materialId_Id > 0 && custId_Id > 0)
|
||||
{
|
||||
var data = resData[0];
|
||||
var resData = dal.GetMaterialPrice(materialId_Id, custId_Id, dateTime);
|
||||
|
||||
// 协议价
|
||||
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"]?.ToString();
|
||||
if (!creditClassificationId.IsNullOrEmptyOrWhiteSpace())
|
||||
if (resData != null && resData.Count > 0)
|
||||
{
|
||||
var creditClassification = custId["F_CreditClassification"] as DynamicObject;
|
||||
var number = creditClassification["Number"].ToString();
|
||||
var data = resData[0];
|
||||
|
||||
// 协议价
|
||||
var F_AGREEPRICE = data["F_AGREEPRICE"].Convert<decimal>();
|
||||
this.Model.SetValue("F_AGREEPRICE", F_AGREEPRICE, rowIndex);
|
||||
|
||||
// 大客户结算价
|
||||
var F_BIGCUSTSETTLEPRICE = data["F_BIGCUSTSETTLEPRICE"].Convert<decimal>();
|
||||
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", F_BIGCUSTSETTLEPRICE, rowIndex);
|
||||
|
||||
//大客户折扣率
|
||||
var F_BigCustDiscRate = data["F_BIGCUSTDISCRATE"].Convert<decimal>();
|
||||
this.Model.SetValue("F_BigCustDiscRate", F_BigCustDiscRate, rowIndex);
|
||||
|
||||
if (number.EqualsIgnoreCase("KHXYFL013"))
|
||||
{
|
||||
// 大客户结算价
|
||||
var F_BIGCUSTSETTLEPRICE = data["F_BIGCUSTSETTLEPRICE"].Convert<decimal>();
|
||||
this.Model.SetValue("F_BIGCUSTSETTLEPRICE", F_BIGCUSTSETTLEPRICE, rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.View.InvokeFieldUpdateService("FMaterialId", rowIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -92,14 +92,14 @@
|
||||
<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\CUST_PAYMENT_PERIOD\List.cs" />
|
||||
<Compile Include="BOSPlugIn\Sal_Order\Bill.cs" />
|
||||
<Compile Include="Models\Validate\PeriodValidity.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\DBService\BaseDAL.cs" />
|
||||
<Compile Include="Services\DBService\BDCustPriceDAL.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(TargetPath) "E:\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin"</PostBuildEvent>
|
||||
|
||||
43
Gatedge.K3.Pilot.PlugIn/Models/Validate/PeriodValidity.cs
Normal file
43
Gatedge.K3.Pilot.PlugIn/Models/Validate/PeriodValidity.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using Kingdee.BOS.Core.Metadata.EntityElement;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Gatedge.K3.Pilot.PlugIn.Models.Validate
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class PeriodValidity
|
||||
{
|
||||
|
||||
public int Seq { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品类型
|
||||
/// </summary>
|
||||
public string MaterialModelGroup { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料内码
|
||||
/// </summary>
|
||||
public int MaterialId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 生效日期
|
||||
/// </summary>
|
||||
public DateTime EffectiveDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 失效日期
|
||||
/// </summary>
|
||||
public DateTime ExpirationDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 分组ID
|
||||
/// </summary>
|
||||
public int GroupId { get; set; }
|
||||
}
|
||||
}
|
||||
@ -30,7 +30,9 @@ 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
|
||||
,t0_l.FNAME,t0_l.FSPECIFICATION,ISNULL(t1.F_AGREEPRICE,0) AS F_AGREEPRICE
|
||||
,ISNULL(t2.F_BIGCUSTSETTLEPRICE,0) AS F_BIGCUSTSETTLEPRICE
|
||||
,ISNULL(t2.F_BIGCUSTDISCRATE,0) AS F_BIGCUSTDISCRATE
|
||||
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 (
|
||||
@ -42,7 +44,7 @@ FROM T_BD_MATERIAL t0
|
||||
WHERE t1.FLIMITCUSTOMER = '2'
|
||||
AND t1.FDOCUMENTSTATUS = 'C'
|
||||
AND t1.FFORBIDSTATUS = 'A'
|
||||
AND t1e.FROWAUDITSTATUS = 'A'
|
||||
--AND t1e.FROWAUDITSTATUS = 'A'
|
||||
AND t1e.FFORBIDSTATUS = 'A'
|
||||
AND @dateTime BETWEEN t1e.FEFFECTIVEDATE AND t1e.FEXPRIYDATE
|
||||
AND t1.FUSEORGID = t0.FUSEORGID
|
||||
@ -51,12 +53,13 @@ FROM T_BD_MATERIAL t0
|
||||
) t1
|
||||
OUTER APPLY (
|
||||
SELECT TOP 1 t2e.F_BIGCUSTSETTLEPRICE
|
||||
,t2e.F_BIGCUSTDISCRATE
|
||||
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.FROWAUDITSTATUS = 'A'
|
||||
AND t2e.FFORBIDSTATUS = 'A'
|
||||
AND @dateTime BETWEEN t2e.FEFFECTIVEDATE AND t2e.FEXPRIYDATE
|
||||
AND t2.FUSEORGID = t0.FUSEORGID
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user