提交 4dea07e8 authored 作者: 彭寒菲's avatar 彭寒菲

。。

上级
/k3cloud
/Bin/Output
/Bin/Logs
/Code/LF.K3.SCM.BusinessPlugin/.vs
/Code/LF.K3.SCM.BusinessPlugin/LF.K3.SCM.AppServerPlugin/obj
/Code/LF.K3.SCM.BusinessPlugin/LF.K3.SCM.BusinessPlugin/obj
/Bin
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kingdee.BOS;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core;
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Core.Validation;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Util;
using System.Data;
using System.Dynamic;
using System.ComponentModel;
using Kingdee.BOS.Core.Metadata.EntityElement;
namespace LF.K3.SCM.AppServerPlugin.AuditChecks
{
[Description("校验器")]
[HotUpdate]
public class AuditCheckPlugIn : AbstractValidator
{
public override void Validate(ExtendedDataEntity[] dataEntities, ValidateContext validateContext, Context ctx)
{
if (validateContext.IgnoreWarning)
{
return; // 警告已经被用户忽略,就不需要再次执行了
}
if (dataEntities == null || dataEntities.Length <= 0)
{
return;
}
DataTable dt = null;
List<string> listnumber = new List<string>();
var number = "";
foreach (var item in dataEntities)
{
listnumber.Add(item.BillNo);
}
var numbernew = listnumber.Distinct(); //去掉重复
foreach (var item in numbernew)
{
number +="'"+ item.Trim()+"'"+',';
}
number = number.TrimEnd(','); //去掉最后一个,
//获取BOM
dt = bom(number);
if (dt==null||dt.Rows.Count<=0)
{
return;
}
int i = 0;
foreach (var et in dataEntities)
{
//if (et.DataEntity[3].ToString() != dt.Rows[i]["BOMFMATERIALID"].ToString()) continue;
string zt = dt.Rows[i]["FDocumentStatus"].ToString();
//如果校验不通过,抛出校验异常
//如果是BOM则判状态是否审核,否者判断是否建了BOM
if (dt.Rows[i]["BOMFNUMBER"].ToString() == null || dt.Rows[i]["BOMFNUMBER"].ToString() == "")
{
string a = dt.Rows[i]["FERPCLSID"].ToString();
if (dt.Rows[i]["FERPCLSID"].ToString() == "2" || dt.Rows[i]["FERPCLSID"].ToString() == "3")
{
validateContext.AddError(et, new ValidationErrorInfo(
"",//出错的字段key,可以空
et.DataEntity["id"].ToString(),
et.DataEntityIndex,
et.RowIndex,
"E1",
"子项物料为" + dt.Rows[i]["FNUMBER"].ToString() + "未建BOM,请建BOM!",
"审核:",
ErrorLevel.FatalError
)
);
}
else
{
i++;
continue;
}
}
else
{
//if (zt == null || zt == "") continue;
if (zt != "C")
{
//Convert.ToString(et.DataEntity[0]) //数据包内码,必填,后续操作会据此内码避开此数据包
validateContext.AddError(et, new ValidationErrorInfo(
"",//出错的字段key,可以空
et.DataEntity["id"].ToString(),
et.DataEntityIndex,
et.RowIndex,
"E1",
"子项BOM版本为" + dt.Rows[i]["BOMFNUMBER"].ToString() + "未审核,请审核!",
"审核:",
ErrorLevel.FatalError
)
);
}
}
i++;
}
}
//获取BOM
public DataTable bom(string BillNo)
{
DataTable dt = null;
string sql = string.Format(@"/*dialect*/with stepCTE AS
(
select b.FMATERIALID as f, a.FMATERIALID as z,a.FID,a.FUNITID,a.FENTRYID,a.FSEQ,ma.FNUMBER,1 AS Lev from T_ENG_BOMCHILD a inner join ( select * from T_ENG_BOM where FNUMBER in({0})) b on a.FID=b.FID
inner join T_BD_MATERIAL ma on a.FMATERIALID=ma.FMATERIALID
union all
select c.f as f ,c.z as z,c.FID,c.FUNITID,c.FENTRYID,c.FSEQ,c.FNUMBER,cte.Lev+1 from
(
select a.FMATERIALID z ,b.FMATERIALID f,a.FID,a.FUNITID,a.FENTRYID,a.FSEQ,ma.FNUMBER from T_ENG_BOMCHILD a inner join T_ENG_BOM b on a.FID=b.FID inner join T_BD_MATERIAL ma on a.FMATERIALID=ma.FMATERIALID
) c
inner join stepCTE cte on cte.z=c.f
)
select stepCTE.*,f.FERPCLSID,engbom.FDOCUMENTSTATUS,engbom.FNUMBER as BOMFNUMBER,engbom.FMATERIALID as BOMFMATERIALID from stepCTE
left join t_BD_MaterialBase f on stepCTE.z=f.FMATERIALID
left join T_ENG_BOM engbom on stepCTE.FNUMBER=engbom.F_QAZ_TEXT1 where stepCTE.Lev=1", BillNo);
dt = DBServiceHelper.ExecuteDataSet(this.Context, sql).Tables[0];
return dt;
}
}
[Description("BOM审核校验")]
[HotUpdate]
public class AuditCheck : AbstractOperationServicePlugIn
{
//public override void OnPreparePropertys(PreparePropertysEventArgs e)
//{
// base.OnPreparePropertys(e);
// //加载父级物料编码
// e.FieldKeys.Add("FNUMBER");
//}
public override void OnAddValidators(AddValidatorsEventArgs e)
{
base.OnAddValidators(e);
AuditCheckPlugIn auditcheck = new AuditCheckPlugIn();
//是否需要校验,true需要
auditcheck.AlwaysValidate = true;
//校验单据体
auditcheck.EntityKey = "FTreeEntity";
//加载校验器
e.Validators.Add(auditcheck);
}
}
}
using Kingdee.BOS;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Validation;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LF.K3.SCM.AppServerPlugin.AuditChecks
{
[Description("磊飞任务校验器")]
[HotUpdate]
public class BOMTaskCheckServer : AbstractValidator
{
public override void Validate(ExtendedDataEntity[] dataEntities, ValidateContext validateContext, Context ctx)
{
List<string> FMATERIALID = new List<string>();
foreach (var dataEntity in dataEntities)
{
FMATERIALID.Add(dataEntity["PAREENTMATERIAL_Id"].ToString());
}
var wlID = "";
for (int i = 0; i < FMATERIALID.Count; i++)
{
wlID += FMATERIALID[i] + ",";
}
string sql = $@"/*dialect*/select t1.FNAME,t2.FID BOMID from T_BD_MATERIAL_L t1
left join T_ENG_BOM t2 on t2.FMATERIALID=t1.FMATERIALID
where t1.FMATERIALID in ({wlID.Remove(wlID.LastIndexOf(","))}) ";
DataTable dt = DBUtils.ExecuteDataSet(this.Context, sql).Tables[0];
if (dt.Rows.Count > 0)
{
int i = 0;
foreach (var et in dataEntities)
{
var BOMID = dt.Rows[i]["BOMID"].ToString();
if (!BOMID.IsNullOrEmptyOrWhiteSpace())
{
validateContext.AddError(et, new ValidationErrorInfo(
"",//出错的字段key,可以空
et.DataEntity["id"].ToString(),
et.DataEntityIndex,
et.RowIndex,
"E1",
"父项物料名称为'" + dt.Rows[i]["FNAME"].ToString() + "'已创建BOM!",
"保存:",
ErrorLevel.FatalError
)
);
}
else
{
i++;
continue;
}
i++;
}
}
}
}
[Description("BOM审核校验")]
[HotUpdate]
public class BOMTaskCheck : AbstractOperationServicePlugIn
{
public override void OnAddValidators(AddValidatorsEventArgs e)
{
base.OnAddValidators(e);
BOMTaskCheckServer auditcheck = new BOMTaskCheckServer();
//是否需要校验,true需要
auditcheck.AlwaysValidate = true;
//校验单据体
auditcheck.EntityKey = "FBillHead";
//加载校验器
e.Validators.Add(auditcheck);
}
}
}
using Kingdee.BOS;
using Kingdee.BOS.App.Data;
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.Data;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin
{
[Description("磊飞任务表保存插件,已作废")]
[HotUpdate]
public class BOMTaskEditionServer : AbstractOperationServicePlugIn
{
public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e)
{
List<string> FMATERIALID = new List<string>();
foreach (var dataEntity in e.DataEntitys)
{
FMATERIALID .Add(dataEntity["PAREENTMATERIAL_Id"].ToString());
}
var wlID = "";
for (int i = 0; i < FMATERIALID.Count; i++)
{
wlID += FMATERIALID[i]+",";
}
string sql = $@"/*dialect*/select t0.FID RWID,t1.FID BOMID,t1.FAPPROVEDATE from qaz_t_BOMTask001 T0
left join T_ENG_BOM T1 on t1.FMATERIALID=t0.FPAREENTMATERIAL
where t0.FPAREENTMATERIAL in ({wlID.Remove(wlID.LastIndexOf(","))}) ";
DataTable dt = DBUtils.ExecuteDataSet(this.Context, sql).Tables[0];
List<SqlObject> sqllist = new List<SqlObject>();
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
var RWID = dt.Rows[i]["RWID"].ToString();
var BOMID = dt.Rows[i]["BOMID"].ToString();
var FAPPROVEDATE = dt.Rows[i]["FAPPROVEDATE"].ToString();
if (!BOMID.IsNullOrEmptyOrWhiteSpace())
{
if (!FAPPROVEDATE.IsNullOrEmptyOrWhiteSpace())
{
string updatesql = $@"/*dialect*/update qaz_t_BOMTask001 set FBOM={BOMID},F_QAZ_DATE='{FAPPROVEDATE}' where FID={RWID}";
sqllist.Add(new SqlObject(updatesql, new List<SqlParam>()));
}
else
{
string updatesql = $@"/*dialect*/update qaz_t_BOMTask001 set FBOM={BOMID} where FID={RWID}";
sqllist.Add(new SqlObject(updatesql, new List<SqlParam>()));
}
}
}
}
var a = DBUtils.ExecuteBatch(this.Context, sqllist);
base.AfterExecuteOperationTransaction(e);
}
}
}
using Kingdee.BOS;
using Kingdee.BOS.App.Data;
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;
namespace LF.K3.SCM.AppServerPlugin
{
[Description("BOM审核插件")]
[HotUpdate]
public class BOMTaskExamineServer : AbstractOperationServicePlugIn
{
public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e)
{
List<string> ApproveDate = new List<string>();
List<string> FMATERIALID = new List<string>();
foreach (var dataEntity in e.DataEntitys)
{
if (!dataEntity["ApproveDate"].ToString().IsNullOrEmptyOrWhiteSpace())
{
ApproveDate.Add(dataEntity["ApproveDate"].ToString());
FMATERIALID.Add(dataEntity["MATERIALID_Id"].ToString());
}
}
List<SqlObject> sqllist = new List<SqlObject>();
for (int i = 0; i < ApproveDate.Count; i++)
{
string sql = $@"/*dialect*/update qaz_t_BOMTask001 set F_QAZ_DATE='{ApproveDate[i]}' where FID in (
select FID from qaz_t_BOMTask001 T0
WHERE FPAREENTMATERIAL = {FMATERIALID[i]}) ";
sqllist.Add(new SqlObject(sql, new List<SqlParam>()));
}
var a = DBUtils.ExecuteBatch(this.Context, sqllist);
base.AfterExecuteOperationTransaction(e);
}
}
}
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin
{
[Description("磊飞任务表保存服务插件")]
[HotUpdate]
public class BOMTaskServer : AbstractOperationServicePlugIn
{
}
}
using Kingdee.BOS;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.Bill.PlugIn.Args;
using Kingdee.BOS.Core.DynamicForm.Operation;
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.Dynamic;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin
{
[Description("物料清单表保存插件")]
[HotUpdate]
public class BomTaskSaveServer : AbstractOperationServicePlugIn
{
public override void AfterExecuteOperationTransaction(AfterExecuteOperationTransaction e)
{
List<string> FMATERIALID = new List<string>();
List<string> ID = new List<string>();
foreach (var dataEntity in e.DataEntitys)
{
FMATERIALID.Add(dataEntity["MATERIALID_Id"].ToString());
ID.Add(dataEntity["Id"].ToString());
}
List<SqlObject> sqllist = new List<SqlObject>();
for (int i = 0; i < FMATERIALID.Count; i++)
{
string sql = $@"/*dialect*/update qaz_t_BOMTask001 set FBOM={ID[i]} where FID in (
select FID from qaz_t_BOMTask001 T0
WHERE FPAREENTMATERIAL = {FMATERIALID[i]}) ";
sqllist.Add(new SqlObject(sql, new List<SqlParam>()));
}
var a = DBUtils.ExecuteBatch(this.Context, sqllist);
base.AfterExecuteOperationTransaction(e);
}
}
}
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace LF.K3.SCM.AppServerPlugin.ChangeReceiveDate
{
[HotUpdate]
[Description("签收日期变更单审核")]
public class Audit : AbstractOperationServicePlugIn
{
const string sql = "update T_SAL_OUTSTOCK set F_QAZ_ARRIVALTIME = '{0}' where FBILLNO = '{1}' ";
public override void OnPreparePropertys(PreparePropertysEventArgs e)
{
e.FieldKeys.Add("F_qaz_outStock");
e.FieldKeys.Add("F_qaz_arrivalTimeAC");
base.OnPreparePropertys(e);
}
public override void BeginOperationTransaction(BeginOperationTransactionArgs e)
{
List<string> sqls = new List<string>();
foreach(DynamicObject data in e.DataEntitys)
{
var entry = data["qaz_ChangeReceiveDEntry"] as DynamicObjectCollection;
foreach (var entryData in entry)
{
var outStockNo = entryData["F_qaz_outStock"] as string;
var arrivalTimeAC = entryData["F_qaz_arrivalTimeAC"];
sqls.Add(string.Format(sql, arrivalTimeAC == null ? "" : arrivalTimeAC, outStockNo));
}
}
DBUtils.ExecuteBatch(this.Context, sqls, sqls.Count);
base.BeginOperationTransaction(e);
}
}
}
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin.ChangeReceiveDate
{
[HotUpdate]
[Description("签收日期变更单审核")]
public class UnAudit : AbstractOperationServicePlugIn
{
const string sql = "update T_SAL_OUTSTOCK set F_QAZ_ARRIVALTIME = '{0}' where FBILLNO = '{1}' ";
public override void OnPreparePropertys(PreparePropertysEventArgs e)
{
e.FieldKeys.Add("F_qaz_outStock");
e.FieldKeys.Add("F_qaz_arrivalTimeBC");
base.OnPreparePropertys(e);
}
public override void BeginOperationTransaction(BeginOperationTransactionArgs e)
{
List<string> sqls = new List<string>();
foreach (DynamicObject data in e.DataEntitys)
{
var entry = data["qaz_ChangeReceiveDEntry"] as DynamicObjectCollection;
foreach (var entryData in entry)
{
var outStockNo = entryData["F_qaz_outStock"] as string;
var arrivalTimeBC = entryData["F_qaz_arrivalTimeBC"];
sqls.Add(string.Format(sql, arrivalTimeBC == null ? "": arrivalTimeBC, outStockNo));
}
}
DBUtils.ExecuteBatch(this.Context, sqls, sqls.Count);
base.BeginOperationTransaction(e);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin.CreateBOM
{
public enum FieldValueType
{
/// <summary>
/// 普通值
/// </summary>
Common = 0,
/// <summary>
/// 基础资料代码
/// </summary>
ItemNumber = 1,
/// <summary>
/// 基础资料内码
/// </summary>
ItemId = 2,
/// <summary>
/// 弹性域编码
/// </summary>
FlexNumber = 3,
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin.CreateBOM
{
/// <summary>
/// 物料参数
/// </summary>
public class MaterialArgs
{
/// <summary>
/// 父项物料编码
/// </summary>
public string MATERIALID { get; set; }
/// <summary>
/// 子项物料编码
/// </summary>
public string MATERIALIDCHILD { get; set; }
/// <summary>
/// 物料分组
/// </summary>
public string Group { get; set; }
/// <summary>
/// 数据状态
/// </summary>
public string DOCUMENTSTATUS { get; set; }
}
}
<?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>{13901A33-300F-4B49-8A81-A20ED3C8B4F8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LF.K3.SCM.AppServerPlugin</RootNamespace>
<AssemblyName>LF.K3.SCM.AppServerPlugin</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\K3Cloud\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Kingdee.BOS, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\LeiFei\K3Cloud\bin\Kingdee.BOS.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.App, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\LeiFei\K3Cloud\bin\Kingdee.BOS.App.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.BusinessEntity, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\LeiFei\K3Cloud\bin\Kingdee.BOS.BusinessEntity.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Contracts, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\LeiFei\K3Cloud\bin\Kingdee.BOS.Contracts.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Core, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\LeiFei\K3Cloud\bin\Kingdee.BOS.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.DataEntity, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\LeiFei\K3Cloud\bin\Kingdee.BOS.DataEntity.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.ServiceFacade.KDServiceFx, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.ServiceFacade.KDServiceFx.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.ServiceHelper, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\LeiFei\K3Cloud\bin\Kingdee.BOS.ServiceHelper.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.WebApi.ServicesStub, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.WebApi.ServicesStub.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.Core, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\LeiFei\K3Cloud\bin\Kingdee.K3.Core.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<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.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AuditChecks\AuditCheckPlugIn.cs" />
<Compile Include="AuditChecks\BOMTaskCheckServer.cs" />
<Compile Include="BOMTaskEditionServer.cs" />
<Compile Include="BOMTaskExamineServer.cs" />
<Compile Include="BomTaskSaveServer.cs" />
<Compile Include="ChangeReceiveDate\Audit.cs" />
<Compile Include="ChangeReceiveDate\UnAudit.cs" />
<Compile Include="CreateBOM\CreateBOM.cs" />
<Compile Include="CreateBOM\FieldValueType.cs" />
<Compile Include="CreateBOM\MaterialArgs.cs" />
<Compile Include="OverdueReceivables\ReportFilter.cs" />
<Compile Include="OverdueReceivables\ReportServerPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SaveLeifeiMaterial\FieldValueType.cs" />
<Compile Include="SaveLeifeiMaterial\LeifeiMaterialArgs.cs" />
<Compile Include="SaveLeifeiMaterial\SaveMaterialChanges.cs" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin.OverdueReceivables
{
/// <summary>
/// 报表过滤
/// </summary>
class ReportFilter
{
/// <summary>
/// 动态区间间隔时间
/// </summary>
public long DynamicStep { get; set; }
/// <summary>
/// 静态区间间隔时间
/// </summary>
public long StaticStep { get; set; }
/// <summary>
/// 查询报表日
/// </summary>
public DateTime? StaticDate { get; set; }
/// <summary>
/// 组织
/// </summary>
public long OrgId { get; set; }
/// <summary>
/// 区域
/// </summary>
public string Area { get; set; }
/// <summary>
/// 销售员
/// </summary>
public long Saler { get; set; }
/// <summary>
/// 客户
/// </summary>
public long Customer { get; set; }
/// <summary>
/// 工程
/// </summary>
public string Project { get; set; }
/// <summary>
/// 币种
/// </summary>
public long Currency { get; set; }
/// <summary>
/// 合同号
/// </summary>
public string Contract { get; set; }
/// <summary>
/// 合同签署日期开始
/// </summary>
public DateTime? SignBeginDate { get; set; }
/// <summary>
/// 合同签署日期结束
/// </summary>
public DateTime? SignEndDate { get; set; }
/// <summary>
/// 合同金额开始
/// </summary>
public decimal ContractBeginAmount { get; set; }
/// <summary>
/// 合同金额结束
/// </summary>
public decimal ContractEndAmount { get; set; }
/// <summary>
/// 应收金额开始
/// </summary>
public decimal ReceiveableBeginAmount { get; set; }
/// <summary>
/// 应收金额结束
/// </summary>
public decimal ReceiveableEndAmount { get; set; }
/// <summary>
/// 逾期金额大于
/// </summary>
public decimal OverdueBeginAmount { get; set; }
/// <summary>
/// 逾期金额小于
/// </summary>
public decimal OverdueEndAmount { get; set; }
/// <summary>
/// 客户类别
/// </summary>
public string CustTypeId { get; set; }
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LF.K3.SCM.AppServerPlugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LF.K3.SCM.AppServerPlugin")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("13901a33-300f-4b49-8a81-a20ed3c8b4f8")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin.SaveLeifeiMaterial
{
public enum FieldValueType
{
/// <summary>
/// 普通值
/// </summary>
Common = 0,
/// <summary>
/// 基础资料代码
/// </summary>
ItemNumber = 1,
/// <summary>
/// 基础资料内码
/// </summary>
ItemId = 2,
/// <summary>
/// 弹性域编码
/// </summary>
FlexNumber = 3,
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.AppServerPlugin.SaveLeifeiMaterial
{
public class LeifeiMaterialArgs
{
/// <summary>
///物料编码
/// </summary>
public string Materialcoding { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 规格型号
/// </summary>
public string Specification { get; set; }
/// <summary>
/// 规格型号2
/// </summary>
public string F_qaz_Remark { get; set; }
/// <summary>
/// 数据状态
/// </summary>
public string DOCUMENTSTATUS { get; set; }
/// <summary>
/// 物料分组
/// </summary>
public string MaterialGroup { get; set; }
/// <summary>
/// 12NC
/// </summary>
public string F12NC { get; set; }
/// <summary>
/// 产品系列
/// </summary>
public string Productseries { get; set; }
/// <summary>
/// 品牌
/// </summary>
public string Brand { get; set; }
/// <summary>
/// 物料属性
/// </summary>
public string ErpCls { get; set; }
}
}

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LF.K3.SCM.BusinessPlugin", "LF.K3.SCM.BusinessPlugin\LF.K3.SCM.BusinessPlugin.csproj", "{FB3CE191-DC61-4AD8-B31D-201FE753A4C7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LF.K3.SCM.AppServerPlugin", "LF.K3.SCM.AppServerPlugin\LF.K3.SCM.AppServerPlugin.csproj", "{13901A33-300F-4B49-8A81-A20ED3C8B4F8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FB3CE191-DC61-4AD8-B31D-201FE753A4C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB3CE191-DC61-4AD8-B31D-201FE753A4C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB3CE191-DC61-4AD8-B31D-201FE753A4C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB3CE191-DC61-4AD8-B31D-201FE753A4C7}.Release|Any CPU.Build.0 = Release|Any CPU
{13901A33-300F-4B49-8A81-A20ED3C8B4F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13901A33-300F-4B49-8A81-A20ED3C8B4F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13901A33-300F-4B49-8A81-A20ED3C8B4F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13901A33-300F-4B49-8A81-A20ED3C8B4F8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6D9DAE99-00BF-44D2-8A31-3DFC7FA34A3B}
EndGlobalSection
EndGlobal
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.Bill.PlugIn.Args;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Dynamic;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.BusinessPlugin
{
[Description("BOM任务表保存插件")]
[HotUpdate]
public class BOMEditServer : AbstractBillPlugIn
{
//public override void AfterSave(AfterSaveEventArgs e)
//{
// base.AfterSave(e);
// //var a = this.Model.GetValue("FPAREENTMATERIAL");
// //var b=this.View.GetControl("FPAREENTMATERIAL").ToString();
// //var a = ((DynamicObject)this.Model.GetValue("FPAREENTMATERIAL",))["ID"];
// //var a=this.View.Model.DataObject["FPAREENTMATERIAL"].ToString();
// string FormTitle = this.View.GetFormTitle();
// var a=this.View.Model.GetValue("FPAREENTMATERIAL", 2);
// string sql = $@"select * from qaz_t_BOMTask001 where FPAREENTMATERIAL={a}";
//}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.Metadata.FieldElement;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Orm.Metadata.DataEntity;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using System.ComponentModel;
using Kingdee.BOS.Util;
using System.Data;
using Kingdee.BOS.Core.Metadata.EntityElement;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Core.List;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Log;
namespace LF.K3.SCM.BusinessPlugin
{
[Description("干预套打数据")]
[HotUpdate]
public class BOMPrintPlugin : AbstractBillPlugIn
{
public override void OnPrepareNotePrintData(PreparePrintDataEventArgs e)
{
if (e.DataSourceId == "FTreeEntity")
{
//存储子项
Dictionary<long, DataRow[]> dicdr = new Dictionary<long, DataRow[]>();
DataRow[] dr = null;
//获取父项fid
string id = e.DataObjects[0][0].ToString();
//获取父项
DynamicObject[] obj = e.DataObjects;
Logger.Info("获取实体", "实体类型:" + obj);
//创建空的DynamicObject
DynamicObject tra = new DynamicObject(e.DynamicObjectType);
//DynamicObject集合
List<DynamicObject> result = new List<DynamicObject>();
//存储已经添加过的物料
HashSet<string> hs = new HashSet<string>();
DataTable dt = null;
//动态字段注册
DynamicObjectType dot = e.DataObjects[0].DynamicObjectType;
dot.RegisterSimpleProperty(
"bh",
typeof(object),
attributes: new SimplePropertyAttribute() { Alias = "bh" }
);
for (int i = 0; i < obj.Length; i++)
{
DynamicObject qureyObjs = new DynamicObject(dot);
foreach (var p in e.DataObjects[i].DynamicObjectType.Properties)
{
qureyObjs[p] = e.DataObjects[i][p];
}
qureyObjs["bh"] = qureyObjs["FTreeEntity_FSEQ"];
e.DataObjects[i] = qureyObjs;
}
dt = Material(id);
if (dt.Rows.Count <= 0 || dt == null)return ;
for (int j = 0; j < dt.Rows.Count; j++)
{
if (Convert.ToInt32(dt.Rows[j]["Lev"]) == 1) continue;
int a = Convert.ToInt32(dt.Rows[j]["f"]);
int dtCount = dt.Rows.Count;
if (j == dtCount-1)
{
int Last = Convert.ToInt32(dt.Rows[j]["f"]);
dr = dt.Select("f=" + Last + "");
dicdr.Add(Last, dr);
break;
}
int b= Convert.ToInt32(dt.Rows[j + 1]["f"]);
if (a == b) continue;
dr = dt.Select("f="+a+ "");
dicdr.Add(a,dr);
}
while (obj.Length != result.Count)
{
foreach (DynamicObject item in obj)
{
result.Add(item);
//循环子项集合
foreach (var dic in dicdr)
{
if (hs.Contains(dic.Key.ToString())) continue;
long d = dic.Key;
int idd = Convert.ToInt32(item["FMATERIALIDCHILD_Id"]);
if (d == idd)
{
DataRow[] a = dic.Value;
for (int i = 0; i < a.Length; i++)
{
object[] s = a[i].ItemArray;
tra["FID"] = s[2];
tra["FCHILDUNITID_U"] = "0";
tra["FNUMERATOR"] = s[0];
tra["FPOSITIONNO"] = s[4];
tra["FMATERIALIDCHILD_Id"] = s[1];
tra["FCHILDUNITID_Id"] = s[5];
tra["FENTRYID"] = s[6];
tra["FTreeEntity_FSEQ"] = s[7];
tra["FUseOrgId"] = "1";
tra["FMATERIALIDCHILD_FNumber"] = s[8];
//tra["FCHILDUNITID_FName"] = "Pce";
tra["FMEMO"] = s[10];
tra["bh"] = item["bh"]+"."+ s[7];
result.Add(tra);
hs.Add(dic.Key.ToString()); //把添加的存在已添加集合
tra = new DynamicObject(e.DynamicObjectType);
}
}
}
}
obj = result.ToArray();
if (hs.Count!= dicdr.Count)
{
result = new List<DynamicObject>();
}
}
Kingdee.BOS.ServiceHelper.DBServiceHelper.LoadReferenceObject(this.Context, result.ToArray(), e.DynamicObjectType);
e.DataObjects = result.ToArray();
//DynamicObject a = e.DataObjects[0].DynamicObjectType.CreateInstance() as DynamicObject;
}
base.OnPrepareNotePrintData(e);
}
//查询子项物料
public DataTable Material(string id)
{
string sql = string.Format(@"/*dialect*/with stepCTE AS
(
select b.FMATERIALID as f, a.FMATERIALID as z,a.FID,a.FNUMERATOR,a.FPOSITIONNO,a.FUNITID,a.FENTRYID,a.FSEQ,ma.FNUMBER,1 AS Lev from T_ENG_BOMCHILD a inner join ( select * from T_ENG_BOM where fid={0}) b on a.FID=b.FID
inner join T_BD_MATERIAL ma on a.FMATERIALID=ma.FMATERIALID
union all
select c.f as f ,c.z as z,c.FID,c.FNUMERATOR,c.FPOSITIONNO,c.FUNITID,c.FENTRYID,c.FSEQ,c.FNUMBER,cte.Lev+1 from
(
select a.FMATERIALID z ,b.FMATERIALID f,a.FID,a.FNUMERATOR,a.FPOSITIONNO,a.FUNITID,a.FENTRYID,a.FSEQ,ma.FNUMBER from T_ENG_BOMCHILD a inner join T_ENG_BOM b on a.FID=b.FID inner join T_BD_MATERIAL ma on a.FMATERIALID=ma.FMATERIALID
) c
inner join stepCTE cte on cte.z=c.f
)
select stepCTE.*,T_ENG_BOMCHILD_l.FMEMO from stepCTE left join T_ENG_BOMCHILD_l on stepCTE.FENTRYID=T_ENG_BOMCHILD_l.FENTRYID", id);
return DBUtils.ExecuteDataSet(this.Context, sql).Tables[0];
}
}
}
using Kingdee.BOS.Core.Bill.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;
namespace LF.K3.SCM.BusinessPlugin
{
[Description("引入")]
[HotUpdate]
public class BOMTaskImportPluginL: AbstractBillPlugIn
{
public override void DataChanged(DataChangedEventArgs e)
{
if(e.Key== "F_qaz_Text")
{
this.Model.SetItemValueByNumber("FStructureDuty", e.NewValue.ToString(), 0);
}
if (e.Key == "F_qaz_Text1")
{
this.Model.SetItemValueByNumber("FOpticsDuty", e.NewValue.ToString(), 0);
}
if (e.Key == "F_qaz_Text2")
{
this.Model.SetItemValueByNumber("FElectronicsDuty", e.NewValue.ToString(),0);
}
if (e.Key == "F_qaz_Text3")
{
this.Model.SetItemValueByNumber("FProductMan", e.NewValue.ToString(),0);
}
base.DataChanged(e);
}
}
}
using Kingdee.BOS;
using Kingdee.BOS.Contracts.Report;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Core.List.PlugIn.Args;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Core.SqlBuilder;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Util;
using Kingdee.K3.Core.MFG;
using Kingdee.K3.Core.MFG.EntityHelper;
using Kingdee.K3.MFG.ServiceHelper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.BusinessPlugin
{
[Description("磊飞任务表过滤")]
[HotUpdate]
public class BomTaskFilter : AbstractListPlugIn
{
int GV = 0;
public override void PrepareFilterParameter(FilterArgs e)
{
base.PrepareFilterParameter(e);
//定义过滤条件的字符串
string filterString = "";
if (GV == 2)
{
//加载的时候,获取发布主控台设置的参数ListSet,My
string listType1 = this.View.OpenParameter.GetCustomParameter("ListSetALL") as string;
//判断字符串 listType的值是否为空,或者为空格,与My,不区分大小写对比
if (!string.IsNullOrWhiteSpace(listType1) && listType1.Equals("ALL", StringComparison.OrdinalIgnoreCase))
{
//创建人ID等于登录用户ID
filterString = string.Format("FID is not null");
}
//原本的过滤条件e.FilterString
if (!string.IsNullOrWhiteSpace(e.FilterString) && !string.IsNullOrWhiteSpace(filterString))
{
e.FilterString += "AND";
}
}
else
{
//加载的时候,获取发布主控台设置的参数ListSet,My
string listType = this.View.OpenParameter.GetCustomParameter("ListSet") as string;
//判断字符串 listType的值是否为空,或者为空格,与My,不区分大小写对比
if (!string.IsNullOrWhiteSpace(listType) && listType.Equals("My", StringComparison.OrdinalIgnoreCase))
{
//创建人ID等于登录用户ID
filterString = string.Format("FID in (SELECT FID FROM T_BOMpersoniable where FPERSONLIABLE={0})", this.Context.UserId);
}
//原本的过滤条件e.FilterString
if (!string.IsNullOrWhiteSpace(e.FilterString) && !string.IsNullOrWhiteSpace(filterString))
{
e.FilterString += "AND";
}
}
e.FilterString += filterString;
}
public override void BarItemClick(BarItemClickEventArgs e)
{
base.BarItemClick(e);
//点击查看全部
if (e.BarItemKey == "btnSelAll")
{
GV = 2;
this.View.Refresh();
}
//点击查看我的
if (e.BarItemKey == "btnSelMy")
{
GV = 1;
this.View.Refresh();
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.BusinessPlugin
{
//子项
public class ChirdNode
{
public string parentid { get; set; }
public string Name { get; set; }
public string Number { get; set; }
public string text { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Core.DynamicForm;
using System.ComponentModel;
using Kingdee.BOS.Util;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.List;
using System.Dynamic;
using Kingdee.BOS.Core.Bill;
using Kingdee.BOS.Core.Enums;
namespace LF.K3.SCM.BusinessPlugin
{
[Description("物料编码导入功能")]
[HotUpdate]
public class ImportExcelPlugin : AbstractListPlugIn
{
public override void BarItemClick(BarItemClickEventArgs e)
{
base.BarItemClick(e);
if (e.BarItemKey == "btn_daoru")
{
                //显示动态表单
                DynamicFormShowParameter forParameter = new DynamicFormShowParameter();
//获取动态表单的唯一标识
forParameter.FormId = "qaz_uploadFile";
this.View.ShowForm(forParameter);
}
if (e.BarItemKey == "btn_tbReplace")
{
var lv = this.View as IListView;
if (lv == null) { return; }
string billno = "";
var selectedRows = lv.SelectedRowsInfo;
if (selectedRows == null || selectedRows.Count == 0)
{
this.View.ShowMessage("当前没有行被选中!");
return;
}
else
{
for (int i = 0; i < selectedRows.Count; i++)
{
billno+= selectedRows[i].PrimaryKeyValue.ToString()+",";
}
}
//DynamicFormShowParameter forParameter = new DynamicFormShowParameter();
////获取动态表单的唯一标识
//forParameter.FormId = "qaz_GGReplace";
//forParameter.CustomComplexParams.Add("billno", billno);
//this.View.ShowForm(forParameter);
DynamicFormShowParameter dynamicFormShowParameter =new DynamicFormShowParameter();
dynamicFormShowParameter.FormId = "qaz_GGReplace";
dynamicFormShowParameter.CustomParams.Add("billno", billno);
this.View.ShowForm(dynamicFormShowParameter);
this.View.ReturnToParentWindow(dynamicFormShowParameter);
}
//新增磊飞物料
if (e.BarItemKey== "qaz_insertButton")
{
//BillShowParameter showParameter = new BillShowParameter();
//单据的唯一标识
//showParameter.FormId = "kbc90a32b48de4855a8df67ff959da039";
//打开方式,到主界面一个新的页签
//showParameter.OpenStyle.ShowType = ShowType.MainNewTabPage;
//this.View.ShowForm(showParameter);
ListShowParameter listshow = new ListShowParameter();
//FormId你要调用那个单据的列表,唯一标识
listshow.FormId = "kbc90a32b48de4855a8df67ff959da039";
//打开方式,到主界面一个新的页签
listshow.OpenStyle.ShowType = ShowType.MainNewTabPage;
//全部显示,默认全部显示
listshow.ListType = Convert.ToInt32(BOSEnums.Enu_ListType.List);
this.View.ShowForm(listshow);
}
//打开新增磊飞物料列表
if (e.BarItemKey == "qaz_tbButton")
{
ListShowParameter listshow = new ListShowParameter();
//FormId你要调用那个单据的列表,唯一标识
listshow.FormId = "kbc90a32b48de4855a8df67ff959da039";
//打开方式,到主界面一个新的页签
listshow.OpenStyle.ShowType = ShowType.MainNewTabPage;
//全部显示,默认全部显示
listshow.ListType = Convert.ToInt32(BOSEnums.Enu_ListType.List);
this.View.ShowForm(listshow);
}
}
}
}
<?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>{FB3CE191-DC61-4AD8-B31D-201FE753A4C7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LF.K3.SCM.BusinessPlugin</RootNamespace>
<AssemblyName>LF.K3.SCM.BusinessPlugin</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\K3Cloud\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</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>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Kingdee.BOS, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.App, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.App.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Contracts, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.Contracts.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.Core, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.DataEntity, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.DataEntity.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.RemoteProxy, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.RemoteProxy.dll</HintPath>
</Reference>
<Reference Include="Kingdee.BOS.ServiceHelper, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.BOS.ServiceHelper.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.BD.ServiceHelper, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.K3.BD.ServiceHelper.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.Core, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.K3.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.MFG.App, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.K3.MFG.App.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.MFG.BusinessCommon, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.K3.MFG.BusinessCommon.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.MFG.ENG.Common.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.K3.MFG.ENG.Common.Core.dll</HintPath>
</Reference>
<Reference Include="Kingdee.K3.MFG.ServiceHelper, Version=7.6.2003.9, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\K3Cloud\bin\Kingdee.K3.MFG.ServiceHelper.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="BOMEditServer.cs" />
<Compile Include="BOMPrintPlugin.cs" />
<Compile Include="BomTaskFilter.cs" />
<Compile Include="BOMTaskImportPlugin.cs" />
<Compile Include="ChirdNode.cs" />
<Compile Include="DynamicForm.BomTree.cs" />
<Compile Include="DynamicForm.BomTree1.cs" />
<Compile Include="ImportDatePlugin.cs" />
<Compile Include="ImportExcelPlugin.cs" />
<Compile Include="LastOutWarningPlugin.cs" />
<Compile Include="GGReplaceModel.cs" />
<Compile Include="OutStockEditPlugin.cs" />
<Compile Include="OutStockListPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RecConditionEditPlugin.cs" />
<Compile Include="TreeColorExpress.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
</PropertyGroup>
</Project>
\ No newline at end of file
using Kingdee.BOS.Core.Warn.PlugIn;
using Kingdee.BOS.Core.Warn.PlugIn.Args;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.BusinessPlugin
{
[HotUpdate]
[Description("末次出库监控插件")]
public class LastOutWarningPlugin: AbstractWarnServicePlugIn
{
public override void AfterWarnConditionParse(AfterWarnConditionParseArgs e)
{
string text = " exists (select 1 from T_SAL_OUTSTOCK T1 where T1.F_QAZ_ISLASTOUT = '1' and T0.FID > T1.FID and T0.F_QAZ_ASSISTANT1 = T1.F_QAZ_ASSISTANT1) and T0.F_QAZ_ISLASTOUT = '0' ";
if (string.IsNullOrWhiteSpace(e.Filter))
{
e.Filter = text;
}
else
{
e.Filter = " and " + text;
}
base.AfterWarnConditionParse(e);
}
}
}
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Util;
using System;
using System.ComponentModel;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Core.Bill.PlugIn.Args;
using System.Data;
using Kingdee.BOS.Orm.DataEntity;
namespace LF.K3.SCM.BusinessPlugin
{
[HotUpdate]
[Description("销售出库单表单插件")]
public class OutStockEditPlugin: AbstractBillPlugIn
{
public override void AfterBindData(EventArgs e)
{
SetArrivalTime();
base.AfterBindData(e);
}
/// <summary>
/// 设置预计到货时间
/// </summary>
private void SetArrivalTime()
{
int shipingDays = GetShippingDays();
if (this.View.Model.GetValue("FDate") == null) return;
var date = Convert.ToDateTime(this.View.Model.GetValue("FDate"));
date = date.AddDays(shipingDays);
this.View.Model.SetValue("F_qaz_arrivalTime", date);
}
/// <summary>
/// 获取运输天数
/// </summary>
/// <returns></returns>
private int GetShippingDays()
{
return Convert.ToInt32(SystemParameterServiceHelper.GetParamter(this.Context, 0, 0, "qaz_outStock", "F_qaz_ShippingDays"));
}
public override void DataChanged(DataChangedEventArgs e)
{
if (e.Field.Key == "FDate")
{
SetArrivalTime();
}
base.DataChanged(e);
}
public override void BeforeSave(BeforeSaveEventArgs e)
{
string contractId = this.Model.DataObject["F_qaz_Assistant1_Id"] as string;
if (string.IsNullOrEmpty(contractId)) return;
string sql = $"select 1 from T_SAL_OUTSTOCK where F_qaz_isLastOut = '1' and F_QAZ_ASSISTANT1 = '{contractId}'";
using (IDataReader reader = DBServiceHelper.ExecuteReader(this.Context, sql))
{
if (reader.Read())
{
return;
}
}
sql = $"select F_QAZ_AMOUNT from T_BAS_ASSISTANTDATAENTRY where FEntryID = '{contractId}' ";
decimal contractAmount = 0;
using (IDataReader reader = DBServiceHelper.ExecuteReader(this.Context, sql))
{
if (reader.Read())
{
contractAmount = Convert.ToDecimal(reader["F_QAZ_AMOUNT"]);
}
else
{
return;
}
}
sql = $"select isnull(sum(FALLAMOUNT), 0) FALLAMOUNT from T_SAL_OUTSTOCKENTRY_F where FID in (select FID from T_SAL_OUTSTOCK where F_qaz_isLastOut = '0' and F_QAZ_ASSISTANT1 = '{contractId}') and FID <> {this.Model.DataObject["Id"]}";
decimal outStockSumAmount = 0;
using (IDataReader reader = DBServiceHelper.ExecuteReader(this.Context, sql))
{
if (reader.Read())
{
outStockSumAmount = Convert.ToDecimal(reader["FALLAMOUNT"]);
}
}
var entity = this.Model.GetEntityDataObject(this.Model.BillBusinessInfo.GetEntity("FEntity"));
decimal curOutAmount = 0;
foreach (DynamicObject entityObj in entity)
{
curOutAmount += Convert.ToDecimal(entityObj["AllAmount"]);
}
if (outStockSumAmount + curOutAmount - contractAmount < 0.1m && outStockSumAmount + curOutAmount - contractAmount > -0.1m)
{
this.Model.SetValue("F_qaz_isLastOut", true);
}
base.BeforeSave(e);
}
}
}
using Kingdee.BOS.Core.DynamicForm;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.List;
using Kingdee.BOS.Core.List.PlugIn;
using Kingdee.BOS.Core.Log;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
namespace LF.K3.SCM.BusinessPlugin
{
[HotUpdate]
[Description("销售出库单列表插件")]
public class OutStockListPlugin: AbstractListPlugIn
{
public override void AfterDoOperation(AfterDoOperationEventArgs e)
{
ShowOutboundParameters(e.Operation.Operation);
ModifyLastOut(e.Operation.Operation);
base.AfterDoOperation(e);
}
/// <summary>
/// 显示出库参数设置
/// </summary>
/// <param name="key"></param>
private void ShowOutboundParameters(string key)
{
if (key != "OutboundParameters") return;
DynamicFormShowParameter showParameter = new DynamicFormShowParameter();
showParameter.FormId = "qaz_outStock";
this.View.ShowForm(showParameter);
}
/// <summary>
/// 修改末次出库
/// </summary>
/// <param name="key"></param>
private void ModifyLastOut(string key)
{
if (key != "ConfirmLastOut") return;
List<string> outStocks = new List<string>();
if (this.ListView.SelectedRowsInfo.Count == 0)
{
this.View.ShowWarnningMessage("请选择需要修改末次出库的数据。");
return;
}
foreach (ListSelectedRow listSelectedRow in this.ListView.SelectedRowsInfo)
{
outStocks.Add(listSelectedRow.PrimaryKeyValue);
}
string sql = "select F_QAZ_ASSISTANT1, max(FDATE) FDATE, max(F_QAZ_ISLASTOUT) F_QAZ_ISLASTOUT from T_SAL_OUTSTOCK where FID in ({0}) and FID in (select FID from T_SAL_OUTSTOCKFIN where FISGENFORIOS = '0') group by F_QAZ_ASSISTANT1 ";
sql = string.Format("select T2.FBILLNO, T2.FID, T2.F_QAZ_ASSISTANT1, T2.FDATE, T2.F_QAZ_ISLASTOUT from ({0}) T1 inner join T_SAL_OUTSTOCK T2 on T1.F_QAZ_ASSISTANT1 = T2.F_QAZ_ASSISTANT1 and T1.FDATE = T2.FDATE where T2.FID in (select FID from T_SAL_OUTSTOCKFIN where FISGENFORIOS = '0')", sql);
sql = string.Format(sql, string.Join(",", outStocks));
bool isMultContract = false;
bool hasLastOut = false;
string billNo = string.Empty;
long id = 0;
string contractId = string.Empty;
using (IDataReader reader = DBServiceHelper.ExecuteReader(this.Context, sql))
{
while (reader.Read())
{
billNo = reader["FBILLNO"] as string;
string curContractId = reader["F_QAZ_ASSISTANT1"] as string;
if (string.IsNullOrWhiteSpace(curContractId)) continue;
if (contractId == string.Empty)
{
contractId = curContractId;
}
else if(curContractId != contractId)
{
isMultContract = true;
}
long curId = Convert.ToInt64(reader["FID"]);
if (curId > id)
{
id = curId;
string isLastOut = reader["F_QAZ_ISLASTOUT"] as string;
if (isLastOut == "1")
{
hasLastOut = true;
}
else
{
hasLastOut = false;
}
}
}
}
if (string.IsNullOrWhiteSpace(contractId))
{
this.View.ShowWarnningMessage("请选择有合同号的出库单。");
return;
}
if (isMultContract)
{
this.View.ShowWarnningMessage("请选择同一个合同的出库单。");
return;
}
if (hasLastOut)
{
this.View.ShowWarnningMessage("该合同已经存在末次出库的出库单。");
return;
}
this.View.ShowWarnningMessage($"将把出库单\"{billNo}\"作为末次出库单,请确认!", options: MessageBoxOptions.OKCancel,
action:(result) =>
{
if (result == MessageBoxResult.OK)
{
string updateSQL = $"update T_SAL_OUTSTOCK set F_QAZ_ISLASTOUT = '0' where F_QAZ_ASSISTANT1 = '{contractId}'";
DBServiceHelper.Execute(this.Context, updateSQL);
updateSQL = $"update T_SAL_OUTSTOCK set F_QAZ_ISLASTOUT = '1' where FBILLNO = '{billNo}'";
DBServiceHelper.Execute(this.Context, updateSQL);
this.View.ShowMessage($"已将出库单\"{billNo}\"作为末次出库单");
LogObject logObject = new LogObject();
logObject.pkValue = id.ToString();
logObject.OperateName = "确定末次出库";
logObject.ObjectTypeId = "SAL_OUTSTOCK";
logObject.Environment = OperatingEnvironment.BizOperate;
logObject.SubSystemId = "23";
logObject.Description = $"\"{this.Context.UserName}\"把销售出库单\"{billNo}\"修改成末次出库。";
LogServiceHelper.WriteLog(this.Context, logObject);
}
});
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("LF.K3.SCM.BusinessPlugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LF.K3.SCM.BusinessPlugin")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("fb3ce191-dc61-4ad8-b31d-201fe753a4c7")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using Kingdee.BOS.Core.Bill.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;
namespace LF.K3.SCM.BusinessPlugin
{
[HotUpdate]
[Description("收款条件表单插件")]
public class RecConditionEditPlugin : AbstractBillPlugIn
{
public override void DataChanged(DataChangedEventArgs e)
{
ComputeSendAllRate(e.Field.Key);
ComputeAllRate1(e.Field.Key);
ComputeAllRate2(e.Field.Key);
ComputeLastRate(e.Field.Key);
ComputeLastRate44(e.Field.Key);
ComputeRate1(e.Field.Key, e.Row);
ComputeRate2(e.Field.Key, e.Row);
ComputeDay1(e.Field.Key, e.Row);
ComputeDay2(e.Field.Key, e.Row);
ComputeDate(e.Field.Key, e.Row);
base.DataChanged(e);
}
/// <summary>
/// 计算发货款总比例
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeSendAllRate(string fieldKey)
{
if (fieldKey != "F_qaz_PrePayRate" && fieldKey != "F_qaz_SendRate") return;
decimal prePayRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_PrePayRate"));
decimal sendRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_SendRate"));
this.Model.SetValue("F_qaz_SendAllRate", prePayRate + sendRate);
}
/// <summary>
/// 计算发货款总比例
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeAllRate1(string fieldKey)
{
if (fieldKey != "F_qaz_PrePayRate" && fieldKey != "F_qaz_SendRate" && fieldKey != "F_qaz_Rate1") return;
decimal prePayRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_PrePayRate"));
decimal sendRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_SendRate"));
decimal rate1 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate1"));
this.Model.SetValue("F_qaz_AllRate1", prePayRate + sendRate + rate1);
}
/// <summary>
/// 计算发货款总比例
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeAllRate2(string fieldKey)
{
if (fieldKey != "F_qaz_PrePayRate" && fieldKey != "F_qaz_SendRate" && fieldKey != "F_qaz_Rate1" && fieldKey != "F_qaz_Rate2") return;
decimal prePayRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_PrePayRate"));
decimal sendRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_SendRate"));
decimal rate1 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate1"));
decimal rate2 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate2"));
this.Model.SetValue("F_qaz_AllRate2", prePayRate + sendRate + rate1 + rate2);
}
/// <summary>
/// 计算剩余比例
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeLastRate44(string fieldKey)
{
var payWay = this.Model.GetValue("F_qaz_PayWay") as string;
if (payWay != "4") return;
if (fieldKey != "F_qaz_Rate") return;
decimal prePayRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_PrePayRate"));
decimal sendRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_SendRate"));
decimal rate1 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate1"));
decimal rate2 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate2"));
this.Model.SetValue("F_qaz_LastRate", 100 - prePayRate - sendRate - rate1 - rate2);
}
/// <summary>
/// 计算剩余比例
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeLastRate(string fieldKey)
{
if (fieldKey != "F_qaz_PrePayRate" && fieldKey != "F_qaz_SendRate" && fieldKey != "F_qaz_Rate1" && fieldKey != "F_qaz_Rate2") return;
decimal prePayRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_PrePayRate"));
decimal sendRate = Convert.ToDecimal(this.Model.GetValue("F_qaz_SendRate"));
decimal rate1 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate1"));
decimal rate2 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate2"));
this.Model.SetValue("F_qaz_LastRate", 100 - prePayRate - sendRate - rate1 - rate2);
}
/// <summary>
/// 计算剩余比例
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeRate1(string fieldKey, int index)
{
var payWay = this.Model.GetValue("F_qaz_PayWay") as string;
if (payWay == "4") return;
if (fieldKey != "F_qaz_Rate" && index != 0) return;
decimal rate1 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate"));
this.Model.SetValue("F_qaz_Rate1", rate1);
}
/// <summary>
/// 计算剩余比例
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeRate2(string fieldKey, int index)
{
var payWay = this.Model.GetValue("F_qaz_PayWay") as string;
if (payWay == "4") return;
if (fieldKey != "F_qaz_Rate" && index != 1) return;
decimal rate1 = Convert.ToDecimal(this.Model.GetValue("F_qaz_Rate", 1));
this.Model.SetValue("F_qaz_Rate2", rate1);
}
/// <summary>
/// 计算收款1天数
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeDay1(string fieldKey, int index)
{
if (fieldKey != "F_qaz_Day" && index != 0) return;
int rate1 = Convert.ToInt32(this.Model.GetValue("F_qaz_Day"));
this.Model.SetValue("F_qaz_AllDay1", rate1);
}
/// <summary>
/// 计算收款2天数
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeDay2(string fieldKey, int index)
{
if (fieldKey != "F_qaz_Day" && index != 1) return;
int rate1 = Convert.ToInt32(this.Model.GetValue("F_qaz_Day", 1));
this.Model.SetValue("F_qaz_AllDay2", rate1);
}
/// <summary>
/// 收款日期
/// </summary>
/// <param name="fieldKey"></param>
private void ComputeDate(string fieldKey, int index)
{
if (fieldKey != "F_qaz_Date" && index != 0) return;
var date = this.Model.GetValue("F_qaz_Date");
this.Model.SetValue("F_qaz_RecDate", date);
}
}
}
using Kingdee.BOS.Core.DynamicForm.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
using Kingdee.BOS.Util;
using Kingdee.K3.Core.MFG.Utils;
using Kingdee.K3.MFG.BusinessCommon.BillPlugIn;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
namespace LF.K3.SCM.BusinessPlugin
{
[Description("树形颜色标识,已作废")]
[HotUpdate]
public class TreeColorExpress : AbstractMFGDynamicFormPlugIn
{
public override void OnLoad(EventArgs e)
{
base.OnLoad(e);
long num = View.GetParam("BOMID", 0L);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<AssemblyModel xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Id>0d7e9a83-4aa6-4ae4-ad80-f17d71da52f0</Id>
<MasterId>K3Cloud</MasterId>
<Name>程序集包</Name>
<Developer>
<Id>IJCF-EGLJ-QKRT-ZENJ-SCXH</Id>
<DevCode>qaz</DevCode>
<Level>1</Level>
<Name>qaz</Name>
</Developer>
<RequiredPackages />
<ExclusivePackages />
<IsSuperPkg>false</IsSuperPkg>
<IncludedExtended>false</IncludedExtended>
<DevPhase>Unknown</DevPhase>
<CanBeStopped>false</CanBeStopped>
<DeployEdition>ALL</DeployEdition>
<Deploy>Business</Deploy>
<PackageCategory>FuncPackage</PackageCategory>
<IsReplace>true</IsReplace>
<LocaleId>0</LocaleId>
<Issues />
<Links />
<PreInstallMsg />
<AfterInstallMsg />
<PlugIns />
<KDServices>
<DataEntities />
<Contracts />
<ServiceHelpers />
<AppServices />
<Resources />
</KDServices>
<OtherComponents />
<TestPlugIns />
<Resources>
<KDComponent xsi:type="ConentComponent">
<Target>CompileAndPackage</Target>
<Name>LF.K3.SCM.BusinessPlugin.dll</Name>
<ComponentPath>..\K3Cloud\Bin\LF.K3.SCM.BusinessPlugin.dll</ComponentPath>
<Type>ContentFile</Type>
<OpeType>AddOrUpdate</OpeType>
<IsSign>false</IsSign>
<OutputPath>Bin</OutputPath>
<Condition />
</KDComponent>
<KDComponent xsi:type="ConentComponent">
<Target>CompileAndPackage</Target>
<Name>LF.K3.SCM.AppServerPlugin.dll</Name>
<ComponentPath>..\K3Cloud\Bin\LF.K3.SCM.AppServerPlugin.dll</ComponentPath>
<Type>ContentFile</Type>
<OpeType>AddOrUpdate</OpeType>
<IsSign>false</IsSign>
<OutputPath>Bin</OutputPath>
<Condition />
</KDComponent>
</Resources>
<BusinessPlugIns />
</AssemblyModel>
\ No newline at end of file
/****** Script Date: 2022-02-16 10:04:24******/
/****** Object:Data 权限对象 Script Date: 2022-02-16 09:09:40 ******/
DELETE T_SEC_PERMISSIONOBJECT WHERE FITEMID='61d3b20fdb5e43' ;
INSERT INTO T_SEC_PERMISSIONOBJECT(FITEMID,FFORBIDSTATUS,FNUMBER,FSUBSYSTEMID,FISSYSPRESET) VALUES ('61d3b20fdb5e43','A',N'BD_LFBOM','6002','0') ;
/****** Object:Data 权限对象多语言 Script Date: 2022-02-16 09:09:40 ******/
DELETE T_SEC_PERMISSIONOBJECT_L WHERE FITEMID='61d3b20fdb5e43' AND FLOCALEID=2052 ;
INSERT INTO T_SEC_PERMISSIONOBJECT_L(FPKID,FITEMID,FLOCALEID,FNAME) VALUES ('61d3b20fdb5e44','61d3b20fdb5e43',2052,N'磊飞物料') ;
/****** Object:Data 权限对象中权限项集合 Script Date: 2022-02-16 09:09:40 ******/
DELETE T_SEC_PERMISSIONOBJECTENTRY WHERE FITEMID='61d3b20fdb5e43' ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d536bdef7f1e','135ab7637ee448aca73b234a443f2875') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d536bdef7f1d','24f64c0dbfa945f78a6be123197a63f5') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d3b20fdb5e49','47afe3d45bc84016b416a1206e121d45') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d3b20fdb5e48','4ce350fdd203407cab4939d50f0022cc') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d3b20fdb5e46','5aca03ef63434e8cbc85c7c5a6f182b5') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','620a2026b5b788','6e44119a58cb4a8e86f6c385e14a17ad') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d536bdef7f1f','d09da0cfa98e41a8ae07f904f639b527') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d3b20fdb5e47','dd4d4cb1f143409da5777ec417cff26b') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d3b20fdb5e4a','e4d6cdd9125a4ee5a32a4c27c12dadc9') ;
INSERT INTO T_SEC_PERMISSIONOBJECTENTRY(FITEMID,FENTRYID,FPERMISSIONITEMID) VALUES ('61d3b20fdb5e43','61d3b20fdb5e45','fce8b1aca2144beeb3c6655eaf78bc34') ;
/****** Script Date: 2022-02-16 09:28:43******/
IF NOT EXISTS (SELECT 1 FROM T_META_CONSOLEDETAIL WHERE FDetailFuncId='61c44537bc5244')
BEGIN
/****** Object:Data Script Date: 2022-02-16 09:28:26 ******/
DELETE T_META_CONSOLEDETAIL WHERE FDetailFuncId='61c44537bc5244'
INSERT INTO T_META_CONSOLEDETAIL(FDETAILFUNCID,FSUBFUNCID,FNUMBER,FOBJECTID,FTYPE,FSTATUS,FPERMISSIONITEMID,FSEQ,FPARAM,FCUSTOMPARAMS,FTHUMB,FLEVEL,FVISIBLE,FFUNCTIONGROUP,FAUTHPMOBJECTTYPEID,FHTMLSTATUS,FEXCELSTATUS,FH5OBJECTID) VALUES ('61c44537bc5244','600202',N'LFBOMRWB','qaz_BOMTASK','1','1','6e44119a58cb4a8e86f6c385e14a17ad',101,N'{"FormId":"qaz_BOMTASK","ShowType":"1","formType":"list"}',N'{"ListSet":"My","ListSetALL":"ALL"}',' ',null,29,0,' ','1','0',null)
/****** Object:Data Script Date: 2022-02-16 09:28:26 ******/
DELETE T_META_CONSOLEDETAIL_L WHERE FDetailFuncId = '61c44537bc5244' AND FLOCALEID =2052
INSERT INTO T_META_CONSOLEDETAIL_L(FPKID,FDETAILFUNCID,FLOCALEID,FNAME,FDESCRIPTION) VALUES ('61c44537bc5245','61c44537bc5244',2052,N'磊飞BOM任务表',N' ')
END;
<?xml version="1.0" encoding="utf-8"?>
<DataModel xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Id>0d88086c-8c2d-41db-9c36-9600a7c587aa</Id>
<MasterId>K3Cloud</MasterId>
<Name>元数据包</Name>
<Developer>
<Id>IJCF-EGLJ-QKRT-ZENJ-SCXH</Id>
<DevCode>qaz</DevCode>
<Level>1</Level>
<Name>qaz</Name>
</Developer>
<RequiredPackages />
<ExclusivePackages />
<IsSuperPkg>false</IsSuperPkg>
<IncludedExtended>false</IncludedExtended>
<DevPhase>Unknown</DevPhase>
<CanBeStopped>false</CanBeStopped>
<DeployEdition>ALL</DeployEdition>
<PatchType>ALL</PatchType>
<Deploy>Business</Deploy>
<PackageCategory>FuncPackage</PackageCategory>
<IsReplace>true</IsReplace>
<LocaleId>0</LocaleId>
<Issues />
<Links />
<PreInstallMsg />
<AfterInstallMsg />
<BasedBOSPackageId>K3CloudV1.0_MuPan3_BOS_DM</BasedBOSPackageId>
<CommonScript>
<CommonScripts Seq="0">
<Scripts />
</CommonScripts>
</CommonScript>
<LinkBusinessObjects>
<DynamicLinkBusinessObject>
<Target>CompileAndPackage</Target>
<Caption>基础资料</Caption>
<Name>6002</Name>
<ComponentPath>6002_51c046d1</ComponentPath>
</DynamicLinkBusinessObject>
</LinkBusinessObjects>
<BusinessObjects />
<ResourceObject />
<StartScript>
<SchemaScript Seq="0">
<Scripts />
</SchemaScript>
<ConsoleMenuScript Seq="0">
<Scripts />
</ConsoleMenuScript>
<InstallPlugIns />
<SimpleDataScript Seq="0">
<Scripts>
<SqlScript Target="CompileAndPackage" ComponentPath="Start\BasicData\SimpleData\a8032de8-5be4-4d20-b0fd-8bef14090835.sql" SqlSyntaxType="KSQL" Assertion="GO" Seq="0" Id="a8032de8-5be4-4d20-b0fd-8bef14090835.sql" UniqueScope="ISV" VerRule="ByContent" Level="0" Name="预插数据">预插数据</SqlScript>
<SqlScript Target="CompileAndPackage" ComponentPath="Start\BasicData\SimpleData\8685e115-0040-444b-a277-eb8fc2807b19.sql" SqlSyntaxType="KSQL" Assertion="Semicolon" Seq="0" Id="8685e115-0040-444b-a277-eb8fc2807b19.sql" UniqueScope="ISV" VerRule="ByContent" Level="0" Name="磊飞任务表预插数据">磊飞任务表预插数据</SqlScript>
<SqlScript Target="CompileAndPackage" ComponentPath="Start\BasicData\SimpleData\1fc3419e-12fd-44b2-bd4c-144395a21a07.sql" SqlSyntaxType="KSQL" Assertion="Semicolon" Seq="0" Id="1fc3419e-12fd-44b2-bd4c-144395a21a07.sql" UniqueScope="ISV" VerRule="ByContent" Level="0" Name="磊飞预插数据">磊飞预插数据</SqlScript>
<SqlScript Target="CompileAndPackage" ComponentPath="Start\BasicData\SimpleData\5551d23f-b6eb-4855-828a-a5deb44530e0.sql" SqlSyntaxType="SQLSERVER" Assertion="GO" Seq="0" Id="5551d23f-b6eb-4855-828a-a5deb44530e0.sql" UniqueScope="ISV" VerRule="ByContent" Level="0" Name="物料导入存储过程脚本">物料导入存储过程脚本</SqlScript>
</Scripts>
</SimpleDataScript>
<DependentDataScript Seq="0">
<Scripts />
</DependentDataScript>
<PrepareDatas />
</StartScript>
<AutoUpdateTable>true</AutoUpdateTable>
<StopScript />
</DataModel>
\ No newline at end of file
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论