1
This commit is contained in:
91
13.得米新材/Demi/DB_StaffData/OperationEventPlugInEx.cs
Normal file
91
13.得米新材/Demi/DB_StaffData/OperationEventPlugInEx.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using E_ZKEcc.Domian;
|
||||
using E_ZKEcc.Service;
|
||||
using E_ZKEccSDK.Request;
|
||||
using Kingdee.BOS.App.Data;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Demi.DB_StaffData
|
||||
{
|
||||
public class OperationEventPlugInEx : AbstractOperationServicePlugIn
|
||||
{
|
||||
public override void OnPreparePropertys(PreparePropertysEventArgs e)
|
||||
{
|
||||
base.OnPreparePropertys(e);
|
||||
e.FieldKeys.Add("FSTATUS");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 操作结束-事务内
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
public override void EndOperationTransaction(EndOperationTransactionArgs e)
|
||||
{
|
||||
base.EndOperationTransaction(e);
|
||||
|
||||
// 保存8提交9审核1反审核26删除3
|
||||
if (this.FormOperation.OperationId == 1)
|
||||
{
|
||||
if (e.DataEntitys.Any())
|
||||
{
|
||||
DoUpdateEmployeeFunc(e.DataEntitys);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核后进行人员更新
|
||||
/// </summary>
|
||||
/// <param name="DataEntitys"></param>
|
||||
private void DoUpdateEmployeeFunc(DynamicObject[] DataEntitys)
|
||||
{
|
||||
var apiInfo = GetE_ZKEccSDKAPIInfo();
|
||||
var service = new EmployeeService(apiInfo);
|
||||
|
||||
var list = new List<EmployeeUpdateRequest>();
|
||||
foreach (var entity in DataEntitys)
|
||||
{
|
||||
var domain = new EmployeeUpdateRequest();
|
||||
list.Add(domain);
|
||||
|
||||
domain.pin = entity["FNumber"].ToString();
|
||||
domain.name = entity["FName"].ToString();
|
||||
|
||||
//domain.deptnumber = item["FDeptName"].ToSafeTurnString();
|
||||
//暂时固定部门
|
||||
domain.deptnumber = "11001100";
|
||||
domain.identitycard = entity["IdentityCard"].ToString();
|
||||
}
|
||||
|
||||
var result = service.UpdateEmployee(list);
|
||||
|
||||
if (result.ret != 0)
|
||||
{
|
||||
throw new Exception(result.msg);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取E_ZKEcc考勤机api连接信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private ApiInfoDomian GetE_ZKEccSDKAPIInfo()
|
||||
{
|
||||
var vSql = "/*dialect*/ SELECT * FROM V_E_ZKEccSDK_API_INFO ";
|
||||
var dataTable = DBUtils.ExecuteDynamicObject(this.Context, vSql);
|
||||
var dataRow = dataTable[0];
|
||||
var apiInfo = new ApiInfoDomian
|
||||
{
|
||||
appKey = dataRow["appKey"].ToString(),
|
||||
apiVersion = dataRow["apiVersion"].ToString(),
|
||||
serverUrl = dataRow["serverUrl"].ToString()
|
||||
};
|
||||
|
||||
return apiInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
78
13.得米新材/Demi/Demi.csproj
Normal file
78
13.得米新材/Demi/Demi.csproj
Normal file
@@ -0,0 +1,78 @@
|
||||
<?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>{F88F3C4D-F3AA-40D9-925A-F291CE963554}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Demi</RootNamespace>
|
||||
<AssemblyName>Demi</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</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>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.App">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.App.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Core">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.DataEntity">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.DataEntity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="DB_StaffData\OperationEventPlugInEx.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\00.SDK\E_ZKEccSDK\E_ZKEccSDK.csproj">
|
||||
<Project>{9a0273e4-d584-4418-951c-020d4eff1732}</Project>
|
||||
<Name>E_ZKEccSDK</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\01.扩展\Extensions\ExtensionMethods.csproj">
|
||||
<Project>{beae0bf6-7ab9-4af5-83ce-d08e3c6880ef}</Project>
|
||||
<Name>ExtensionMethods</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\01.扩展\HandleUtils\HandleUtils.csproj">
|
||||
<Project>{d6a5e5a0-7529-4ffa-9f9d-b2c610919bf6}</Project>
|
||||
<Name>HandleUtils</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
36
13.得米新材/Demi/Properties/AssemblyInfo.cs
Normal file
36
13.得米新材/Demi/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("Demi")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Demi")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("f88f3c4d-f3aa-40d9-925a-f291ce963554")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Reference in New Issue
Block a user