diff --git a/00.SDK/E_ZKEccSDK/BaseService.cs b/00.SDK/E_ZKEccSDK/BaseService.cs
new file mode 100644
index 0000000..cf88533
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/BaseService.cs
@@ -0,0 +1,65 @@
+using E_ZKEcc.Domian;
+using HandleUtils;
+using Kingdee.BOS.Log;
+using Kingdee.BOS.TCP;
+using Kingdee.BOS.Util;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEcc
+{
+ public class BaseService
+ {
+
+ protected readonly string _appKey;
+ protected readonly string _appSecret;
+ protected readonly string _apiVersion;
+
+ protected readonly string _moduleName;
+ protected readonly string _moduleCnName;
+
+ protected readonly string _serverUrl;
+
+ protected string _actionName;
+ protected string _realServerUrl;
+
+ protected JsonSerializerSettings _serializerSettings;
+
+ public BaseService(ApiInfoDomian apiInfo, string moduleName, string moduleCnName = "")
+ {
+
+ _appKey = apiInfo.appKey;
+ _apiVersion = apiInfo.apiVersion;
+ _appSecret = apiInfo.appSecret;
+ _serverUrl = apiInfo.serverUrl;
+
+ _moduleName = moduleName;
+ _moduleCnName = moduleCnName;
+
+ _serializerSettings = new JsonSerializerSettings
+ {
+ NullValueHandling = NullValueHandling.Ignore
+ };
+ //_realServerUrl = $"{_serverUrl}/api/{_apiVersion}/{_moduleName}/{_apiName}/?Key={_appKey}";
+ }
+
+ ///
+ /// 执行请求
+ ///
+ ///
+ ///
+ public string DoExecute(string dataJson)
+ {
+ ////对json字符串进行url编码
+ //var requestData = EncryptHelper.UrlEncode(dataJson);
+ //var request = new Dictionary();
+ _realServerUrl = $"{_serverUrl}/api/{_apiVersion}/{_moduleName}/{_actionName}/?key={_appKey}";
+ string result = WebHelper.DoPost(_realServerUrl, dataJson);
+ return result;
+ }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Domian/ApiInfoDomian.cs b/00.SDK/E_ZKEccSDK/Domian/ApiInfoDomian.cs
new file mode 100644
index 0000000..df73200
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Domian/ApiInfoDomian.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEcc.Domian
+{
+ [Serializable]
+ public class ApiInfoDomian
+ {
+ public string appKey { get; set; }
+
+ public string appSecret { get; set; }
+
+ public string apiVersion { get; set; }
+
+ public string serverUrl { get; set; }
+
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Domian/EmployeeDomain.cs b/00.SDK/E_ZKEccSDK/Domian/EmployeeDomain.cs
new file mode 100644
index 0000000..a434fc9
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Domian/EmployeeDomain.cs
@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEcc.Domian
+{
+ [Serializable]
+ public class EmployeeDomain
+ {
+ ///
+ /// 人员编号 长度为1~24个字符 必填
+ ///
+ public string pin { get; set; }
+
+ ///
+ /// 名称。长度为1~20个字符
+ ///
+ public string name { get; set; }
+
+ ///
+ /// 人员所属部门编号(更新可以不填,新增必填)
+ ///
+ public string deptnumber { get; set; }
+
+ ///
+ /// 性别 。'M'表示男,'F'表示女 允许值: 'M', 'F'
+ ///
+ public string gender { get; set; }
+
+ ///
+ /// 身份证号
+ ///
+ public string identitycard { get; set; }
+
+ ///
+ /// 人员自助密码
+ ///
+ public string selfpassword { get; set; }
+
+ ///
+ /// 人员是否考勤
+ ///
+ public int? att { get; set; }
+
+ ///
+ /// 验证方式
+ ///
+ public int? comverifys { get; set; }
+
+ ///
+ /// 比对照片信息,BASE64格式
+ ///
+ public string enrollpic { get; set; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Domian/ResultDomian.cs b/00.SDK/E_ZKEccSDK/Domian/ResultDomian.cs
new file mode 100644
index 0000000..17d62b8
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Domian/ResultDomian.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEcc.Domian
+{
+ [Serializable]
+ public class ResultDomian
+ {
+ public string msg { get; set; }
+
+ public int ret { get; set; }
+
+ public ResultData data { get; set; }
+ }
+
+ [Serializable]
+ public class ResultDomian
+ {
+ public string msg { get; set; }
+
+ public int ret { get; set; }
+
+ public string[] error_list { get; set; }
+ }
+
+ [Serializable]
+ public class ResultData
+ {
+ public int count { get; set; }
+
+ public List items { get; set; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/E_ZKEccSDK.csproj b/00.SDK/E_ZKEccSDK/E_ZKEccSDK.csproj
new file mode 100644
index 0000000..8afddd2
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/E_ZKEccSDK.csproj
@@ -0,0 +1,81 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {9A0273E4-D584-4418-951C-020D4EFF1732}
+ Library
+ Properties
+ E_ZKEccSDK
+ E_ZKEccSDK
+ v4.0
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.dll
+
+
+ False
+ ..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Newtonsoft.Json.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {beae0bf6-7ab9-4af5-83ce-d08e3c6880ef}
+ ExtensionMethods
+
+
+ {d6a5e5a0-7529-4ffa-9f9d-b2c610919bf6}
+ HandleUtils
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/03.珠海市汇威精密制造有限公司/ProductionMaterialsReport/Properties/AssemblyInfo.cs b/00.SDK/E_ZKEccSDK/Properties/AssemblyInfo.cs
similarity index 83%
rename from 03.珠海市汇威精密制造有限公司/ProductionMaterialsReport/Properties/AssemblyInfo.cs
rename to 00.SDK/E_ZKEccSDK/Properties/AssemblyInfo.cs
index d125c48..1554bda 100644
--- a/03.珠海市汇威精密制造有限公司/ProductionMaterialsReport/Properties/AssemblyInfo.cs
+++ b/00.SDK/E_ZKEccSDK/Properties/AssemblyInfo.cs
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
-[assembly: AssemblyTitle("ProductionMaterialsReport")]
+[assembly: AssemblyTitle("E_ZKEccSDK")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ProductionMaterialsReport")]
-[assembly: AssemblyCopyright("Copyright © 2023")]
+[assembly: AssemblyProduct("E_ZKEccSDK")]
+[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
-[assembly: Guid("49af92f2-2dcf-42f4-ab29-12298575d803")]
+[assembly: Guid("9a0273e4-d584-4418-951c-020d4eff1732")]
// 程序集的版本信息由下列四个值组成:
//
diff --git a/00.SDK/E_ZKEccSDK/Request/DepartmentGetRequest.cs b/00.SDK/E_ZKEccSDK/Request/DepartmentGetRequest.cs
new file mode 100644
index 0000000..c2e901d
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Request/DepartmentGetRequest.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Request
+{
+ public class DepartmentGetRequest
+ {
+ public string deptnumber { get; set; }
+
+ public int? fetch_child { get; set; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Request/DepartmentUpdateRequest.cs b/00.SDK/E_ZKEccSDK/Request/DepartmentUpdateRequest.cs
new file mode 100644
index 0000000..2678b67
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Request/DepartmentUpdateRequest.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Request
+{
+ public class DepartmentUpdateRequest
+ {
+ ///
+ /// 部门编号。长度表示为1~40个字符(只能包含字母和数字)
+ /// 必填
+ ///
+ public string deptnumber { get; set; }
+
+ ///
+ /// 名称。
+ /// 长度表示为1~40个字符
+ /// (更新可以不填,新增必填)
+ ///
+ public string deptname { get; set; }
+
+ ///
+ /// 父部门编号。
+ /// 长度表示为1~40个字符
+ /// (更新可以不填,新增必填)
+ ///
+ public string parentnumber { get; set; }
+
+ ///
+ /// 部门地址
+ /// 可选
+ ///
+ public string deptaddr { get; set; }
+
+ ///
+ /// 联系人
+ /// 可选
+ ///
+ public string deptperson { get; set; }
+
+ ///
+ /// 联系电话
+ /// 可选
+ ///
+ public string deptphone { get; set; }
+
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Request/EmployeeGetRequest.cs b/00.SDK/E_ZKEccSDK/Request/EmployeeGetRequest.cs
new file mode 100644
index 0000000..c4aecfa
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Request/EmployeeGetRequest.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Request
+{
+ public class EmployeeGetRequest
+ {
+ public string pinlist { get; set; }
+ public int offduty { get; set; }
+ public string deptnumberlist { get; set; }
+ public int fetch_child { get; set; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Request/EmployeeUpdateRequest.cs b/00.SDK/E_ZKEccSDK/Request/EmployeeUpdateRequest.cs
new file mode 100644
index 0000000..4e7f41c
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Request/EmployeeUpdateRequest.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Request
+{
+ public class EmployeeUpdateRequest
+ {
+ ///
+ /// 人员编号 长度为1~24个字符 必填
+ ///
+ public string pin { get; set; }
+
+ ///
+ /// 名称。长度为1~20个字符
+ ///
+ public string name { get; set; }
+
+ ///
+ /// 人员所属部门编号(更新可以不填,新增必填)
+ ///
+ public string deptnumber { get; set; }
+
+ ///
+ /// 性别 。'M'表示男,'F'表示女 允许值: 'M', 'F'
+ ///
+ public string gender { get; set; }
+
+ ///
+ /// 身份证号
+ ///
+ public string identitycard { get; set; }
+
+ ///
+ /// 人员自助密码
+ ///
+ public string selfpassword { get; set; }
+
+ ///
+ /// 人员是否考勤
+ ///
+ public int? att { get; set; }
+
+ ///
+ /// 验证方式
+ ///
+ public int? comverifys { get; set; }
+
+ ///
+ /// 比对照片信息,BASE64格式
+ ///
+ public string enrollpic { get; set; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Request/TransactionGetRequest.cs b/00.SDK/E_ZKEccSDK/Request/TransactionGetRequest.cs
new file mode 100644
index 0000000..2c5c9ef
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Request/TransactionGetRequest.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Request
+{
+ public class TransactionGetRequest
+ {
+ ///
+ /// 开始时间 必填 开始时间结束时间跨度不得超过一个月 格式:%Y-%m-%d %H:%M:%S 示例:2018-04-25 00:00:01
+ ///
+ public string starttime { set; get; }
+ ///
+ /// 结束时间 必填
+ ///
+ public string endtime { set; get; }
+ public string pin { set; get; }
+ public string sn { set; get; }
+ public long? id { set; get; }
+ public int? number { set; get; }
+ public int? uploadPic { set; get; }
+ public int? getTemperature { set; get; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Response/DepartmentGetResponse.cs b/00.SDK/E_ZKEccSDK/Response/DepartmentGetResponse.cs
new file mode 100644
index 0000000..8d117a5
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Response/DepartmentGetResponse.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Response
+{
+ public class DepartmentGetResponse
+ {
+ ///
+ /// 部门编号
+ ///
+ public string deptnumber { get; set; }
+
+ public string deptname { get; set; }
+
+ public string deptperson { get; set; }
+
+ public string parentnumber { get; set; }
+
+ public string deptphone { get; set; }
+
+ public string deptaddr { get; set; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Response/EmployeeGetResponse.cs b/00.SDK/E_ZKEccSDK/Response/EmployeeGetResponse.cs
new file mode 100644
index 0000000..953ec06
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Response/EmployeeGetResponse.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Response
+{
+ public class EmployeeGetResponse
+ {
+ public string pin { get; set; }
+ public string name { get; set; }
+ public string deptnumber { get; set; }
+ public string deptname { get; set; }
+ public string position { get; set; }
+ public string gender { get; set; }
+ public string telephone { get; set; }
+ public string email { get; set; }
+ public string Card { get; set; }
+ public string mobile { get; set; }
+ public int status { get; set; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Response/TransactionGetResponse.cs b/00.SDK/E_ZKEccSDK/Response/TransactionGetResponse.cs
new file mode 100644
index 0000000..82edf46
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Response/TransactionGetResponse.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Response
+{
+ public class TransactionGetResponse
+ {
+ public int id { get; set; }
+ public string pin { get; set; }
+ public string ename { get; set; }
+ public string deptnumber { get; set; }
+ public string deptname { get; set; }
+ public string checktime { get; set; }
+ public string sn { get; set; }
+ public string alias { get; set; }
+ public int verify { get; set; }
+ public string stateno { get; set; }
+ public string state { get; set; }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/SQLServer/api信息视图.sql b/00.SDK/E_ZKEccSDK/SQLServer/api信息视图.sql
new file mode 100644
index 0000000..e3b1c2c
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/SQLServer/api信息视图.sql
@@ -0,0 +1,5 @@
+CREATE VIEW V_E_ZKEccSDK_API_INFO
+AS
+SELECT '3391hexqe5h0wv4z4veju_dvn7gntnr5oiv_dxjabqtt' AS appKey
+ ,'v2' AS apiVersion
+ ,'http://14.21.32.187:8088' AS serverUrl
\ No newline at end of file
diff --git a/00.SDK/E_ZKEccSDK/Service/DepartmentService.cs b/00.SDK/E_ZKEccSDK/Service/DepartmentService.cs
new file mode 100644
index 0000000..f0e0c1d
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Service/DepartmentService.cs
@@ -0,0 +1,97 @@
+using E_ZKEcc;
+using E_ZKEcc.Domian;
+using E_ZKEccSDK.Request;
+using E_ZKEccSDK.Response;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccSDK.Service
+{
+ public class DepartmentService : BaseService
+ {
+ public DepartmentService(ApiInfoDomian apiInfo) : base(apiInfo, "department")
+ {
+
+ }
+
+ ///
+ /// 删除部门
+ ///
+ ///
+ ///
+ public ResultDomian DeleteDepartment(string deptnumber)
+ {
+ _actionName = "delete";
+
+ try
+ {
+ var request = new { deptnumber };
+
+ var dataJson = JsonConvert.SerializeObject(request, Formatting.None, _serializerSettings);
+
+ var resultJson = this.DoExecute(dataJson);
+
+ var result = JsonConvert.DeserializeObject(resultJson);
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+ ///
+ /// 更新部门
+ ///
+ ///
+ ///
+ public ResultDomian UpdateDepartment(DepartmentUpdateRequest request)
+ {
+ _actionName = "update";
+
+ try
+ {
+ var dataJson = JsonConvert.SerializeObject(request, Formatting.None, _serializerSettings);
+
+ var resultJson = this.DoExecute(dataJson);
+
+ var result = JsonConvert.DeserializeObject(resultJson);
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+ ///
+ /// 获取部门信息
+ ///
+ ///
+ ///
+ public ResultDomian GetDepartment(DepartmentGetRequest request)
+ {
+ _actionName = "get";
+
+ try
+ {
+ var dataJson = JsonConvert.SerializeObject(request, Formatting.None, _serializerSettings);
+
+ var resultJson = this.DoExecute(dataJson);
+
+ var result = JsonConvert.DeserializeObject>(resultJson);
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Service/EmployeeService.cs b/00.SDK/E_ZKEccSDK/Service/EmployeeService.cs
new file mode 100644
index 0000000..1714cbd
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Service/EmployeeService.cs
@@ -0,0 +1,141 @@
+using E_ZKEcc.Domian;
+using ExtensionMethods;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using System.Text;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using E_ZKEccSDK.Response;
+using E_ZKEccSDK.Request;
+
+namespace E_ZKEcc.Service
+{
+ ///
+ /// 人员对接
+ ///
+ public class EmployeeService : BaseService
+ {
+ public EmployeeService(ApiInfoDomian apiInfo) : base(apiInfo, "employee")
+ {
+
+ }
+
+ #region 人员更新
+ ///
+ /// 人员更新
+ ///
+ ///
+ ///
+ public ResultDomian UpdateEmployee(List list)
+ {
+ _actionName = "update";
+ ResultDomian result;
+ try
+ {
+ var dataJson = JsonConvert.SerializeObject(list, Formatting.None, _serializerSettings);
+
+ var resultJson = this.DoExecute(dataJson);
+
+ result = JsonConvert.DeserializeObject(resultJson);
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+ #endregion
+
+ #region 人员离职
+ ///
+ /// 人员离职
+ ///
+ /// 人员编号
+ /// 离职日期 yyyy-MM-dd HH:MM
+ /// 离职类型 0 自离 1 辞退 2 辞职 3 调离 4 停薪留职 5 退休 6 死亡
+ /// 离职原因
+ ///
+ public ResultDomian LeaveEmployee(string pin, string leavedate, int leavetype, string reason = null)
+ {
+ _actionName = "leave";
+ ResultDomian result;
+ try
+ {
+ object data = new
+ {
+ pin,
+ leavedate,
+ leavetype,
+ reason
+ };
+
+ var dataJson = JsonConvert.SerializeObject(data, Formatting.None, _serializerSettings);
+
+ var resultJson = this.DoExecute(dataJson);
+
+ result = JsonConvert.DeserializeObject(resultJson);
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+
+ ///
+ /// 人员离职
+ ///
+ /// 人员编号
+ /// 离职日期 yyyy-MM-dd HH:MM
+ /// 离职类型 0 自离 1 辞退 2 辞职 3 调离 4 停薪留职 5 退休 6 死亡
+ /// 离职原因
+ ///
+ public ResultDomian LeaveEmployee(string pin, DateTime leavedate, int leavetype, string reason = null)
+ {
+ return LeaveEmployee(pin, leavedate.ToString("yyyy-MM-dd HH:MM"), leavetype, reason);
+ }
+ #endregion 人员离职
+
+ #region 获取人员信息
+ ///
+ /// 获取人员信息
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public ResultDomian GetEmployee(string pinlist, int offduty = 2, string deptnumberlist = null, int fetch_child = 0)
+ {
+ _actionName = "get";
+
+ try
+ {
+ var data = new EmployeeGetRequest
+ {
+ pinlist = pinlist,
+ offduty = offduty,
+ deptnumberlist = deptnumberlist,
+ fetch_child = fetch_child
+ };
+
+ var dataJson = JsonConvert.SerializeObject(data, Formatting.None, _serializerSettings);
+
+ var resultJson = this.DoExecute(dataJson);
+
+ var result = JsonConvert.DeserializeObject>(resultJson);
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+ #endregion
+ }
+}
diff --git a/00.SDK/E_ZKEccSDK/Service/TransactionService.cs b/00.SDK/E_ZKEccSDK/Service/TransactionService.cs
new file mode 100644
index 0000000..180051c
--- /dev/null
+++ b/00.SDK/E_ZKEccSDK/Service/TransactionService.cs
@@ -0,0 +1,105 @@
+using E_ZKEcc.Domian;
+using E_ZKEccSDK.Request;
+using E_ZKEccSDK.Response;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEcc.Service
+{
+ ///
+ /// 记录对接
+ ///
+ public class TransactionService : BaseService
+ {
+ public TransactionService(ApiInfoDomian apiInfo) : base(apiInfo, "transaction")
+ {
+
+ }
+ #region 获取考勤记录
+
+ ///
+ /// 获取考勤记录
+ ///
+ /// 必填 开始时间 开始时间结束时间跨度不得超过一个月 格式:%Y-%m-%d %H:%M:%S 示例:2018-04-25 00:00:01
+ /// 必填 结束时间
+ /// 人员编号
+ /// 设备序列号
+ /// 记录流水号 1.建议同步考勤记录到第三方数据库时使用id 2.记录流水号自动递增 3.存在id或number时,开始时间和结束时间可为非必选参数
+ /// 每次请求获取的记录数,建议控制在每次2000条以内
+ /// 是否传考勤照片 1.是 0.否
+ /// 是否传体温与是否佩戴口罩 1.是 0.否
+ ///
+ public ResultDomian GetTransaction(string starttime, string endtime, string pin = null, string sn = null, long? id = null, int? number = null, int? uploadPic = null, int? getTemperature = null)
+ {
+ _actionName = "get";
+ try
+ {
+ var request = new TransactionGetRequest();
+ request.starttime = starttime;
+ request.endtime = endtime;
+ request.pin = pin;
+ request.sn = sn;
+ request.id = id;
+ request.number = number;
+ request.uploadPic = uploadPic;
+ request.getTemperature = getTemperature;
+
+ var dataJson = JsonConvert.SerializeObject(request, Formatting.None, _serializerSettings);
+
+ var resultJson = this.DoExecute(dataJson);
+
+ var result = JsonConvert.DeserializeObject>(resultJson);
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ finally
+ {
+
+ }
+ }
+
+ ///
+ /// 获取考勤记录
+ ///
+ /// 必填 开始时间 开始时间结束时间跨度不得超过一个月 格式:%Y-%m-%d %H:%M:%S 示例:2018-04-25 00:00:01
+ /// 必填 结束时间
+ ///
+ public ResultDomian GetTransaction(DateTime starttime, DateTime endtime)
+ {
+ return GetTransaction(starttime.ToString("yyyy-MM-dd HH:MM"), endtime.ToString("yyyy-MM-dd HH:MM"));
+ }
+
+
+ ///
+ /// 获取考勤记录
+ ///
+ ///
+ ///
+ public ResultDomian GetTransaction(TransactionGetRequest request)
+ {
+ _actionName = "get";
+ try
+ {
+ var dataJson = JsonConvert.SerializeObject(request, Formatting.None, _serializerSettings);
+
+ var resultJson = this.DoExecute(dataJson);
+
+ var result = JsonConvert.DeserializeObject>(resultJson);
+
+ return result;
+ }
+ catch (Exception ex)
+ {
+ throw ex;
+ }
+ }
+ #endregion
+ }
+}
diff --git a/00.SDK/E_ZKEccTopSdk/BaseTopRequest.cs b/00.SDK/E_ZKEccTopSdk/BaseTopRequest.cs
new file mode 100644
index 0000000..7ee7ded
--- /dev/null
+++ b/00.SDK/E_ZKEccTopSdk/BaseTopRequest.cs
@@ -0,0 +1,95 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccTopSdk
+{
+ ///
+ /// 基础TOP请求类,存放一些通用的请求参数。
+ ///
+ public abstract class BaseTopRequest : ITopRequest where T : TopResponse
+ {
+ ///
+ /// HTTP请求URL参数
+ ///
+ internal TopDictionary otherParams;
+ ///
+ /// HTTP请求头参数
+ ///
+ private TopDictionary headerParams;
+ ///
+ /// 请求目标AppKey
+ ///
+ private string targetAppKey;
+
+ ///
+ /// 批量API请求的用户授权码
+ ///
+ private string batchApiSession;
+
+ ///
+ /// API在批量调用中的顺序
+ ///
+ private int batchApiOrder;
+
+ public void AddOtherParameter(string key, string value)
+ {
+ if (this.otherParams == null)
+ {
+ this.otherParams = new TopDictionary();
+ }
+ this.otherParams.Add(key, value);
+ }
+
+ public void AddHeaderParameter(string key, string value)
+ {
+ GetHeaderParameters().Add(key, value);
+ }
+
+ public IDictionary GetHeaderParameters()
+ {
+ if (this.headerParams == null)
+ {
+ this.headerParams = new TopDictionary();
+ }
+ return this.headerParams;
+ }
+
+ public string GetTargetAppKey()
+ {
+ return this.targetAppKey;
+ }
+
+ public void SetTargetAppKey(string targetAppKey)
+ {
+ this.targetAppKey = targetAppKey;
+ }
+
+ public string GetBatchApiSession()
+ {
+ return this.batchApiSession;
+ }
+
+ public void SetBatchApiSession(string session)
+ {
+ this.batchApiSession = session;
+ }
+
+ public int GetBatchApiOrder()
+ {
+ return this.batchApiOrder;
+ }
+
+ public void SetBatchApiOrder(int order)
+ {
+ this.batchApiOrder = order;
+ }
+
+ public abstract string GetApiName();
+
+ public abstract void Validate();
+
+ public abstract IDictionary GetParameters();
+ }
+}
diff --git a/00.SDK/E_ZKEccTopSdk/Constants.cs b/00.SDK/E_ZKEccTopSdk/Constants.cs
new file mode 100644
index 0000000..8e577b0
--- /dev/null
+++ b/00.SDK/E_ZKEccTopSdk/Constants.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace E_ZKEccTopSdk
+{
+ public sealed class Constants
+ {
+ public const string CHARSET_UTF8 = "utf-8";
+
+ public const string DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+ public const string DATE_TIME_MS_FORMAT = "yyyy-MM-dd HH:mm:ss.fff";
+
+ public const string SIGN_METHOD_MD5 = "md5";
+ public const string SIGN_METHOD_HMAC = "hmac";
+ public const string SIGN_METHOD_HMAC_SHA256 = "hmac-sha256";
+
+ public const string LOG_SPLIT = "^_^";
+ public const string LOG_FILE_NAME = "topsdk.log";
+
+ public const string ACCEPT_ENCODING = "Accept-Encoding";
+ public const string CONTENT_ENCODING = "Content-Encoding";
+ public const string CONTENT_ENCODING_GZIP = "gzip";
+
+ public const string ERROR_RESPONSE = "error_response";
+ public const string ERROR_CODE = "code";
+ public const string ERROR_MSG = "msg";
+
+ public const string QIMEN_CLOUD_ERROR_RESPONSE = "response";
+ public const string QIMEN_CLOUD_ERROR_CODE = "code";
+ public const string QIMEN_CLOUD_ERROR_MSG = "message";
+
+ public const string SDK_VERSION = "top-sdk-net-20211202";
+ public const string SDK_VERSION_CLUSTER = "top-sdk-net-cluster-20211202";
+
+ public const string APP_KEY = "app_key";
+ public const string FORMAT = "format";
+ public const string METHOD = "method";
+ public const string TIMESTAMP = "timestamp";
+ public const string VERSION = "v";
+ public const string SIGN = "sign";
+ public const string SIGN_METHOD = "sign_method";
+ public const string PARTNER_ID = "partner_id";
+ public const string SESSION = "session";
+ public const string FORMAT_XML = "xml";
+ public const string FORMAT_JSON = "json";
+ public const string SIMPLIFY = "simplify";
+ public const string TARGET_APP_KEY = "target_app_key";
+
+ public const string QM_ROOT_TAG_REQ = "request";
+ public const string QM_ROOT_TAG_RSP = "response";
+ public const string QM_CUSTOMER_ID = "customerId";
+ public const string QM_CONTENT_TYPE = "text/xml;charset=utf-8";
+ public const string QM_TARGETAPPKEY = "targetAppkey";
+
+ public const string CTYPE_DEFAULT = "application/octet-stream";
+ public const string CTYPE_FORM_DATA = "application/x-www-form-urlencoded";
+ public const string CTYPE_FILE_UPLOAD = "multipart/form-data";
+ public const string CTYPE_TEXT_XML = "text/xml";
+ public const string CTYPE_TEXT_PLAIN = "text/plain";
+ public const string CTYPE_APPLICATION_XML = "application/xml";
+ public const string CTYPE_APP_JSON = "application/json";
+ public const int READ_BUFFER_SIZE = 1024 * 4;
+ }
+}
diff --git a/00.SDK/E_ZKEccTopSdk/E_ZKEccTopSdk.csproj b/00.SDK/E_ZKEccTopSdk/E_ZKEccTopSdk.csproj
new file mode 100644
index 0000000..4f28ab0
--- /dev/null
+++ b/00.SDK/E_ZKEccTopSdk/E_ZKEccTopSdk.csproj
@@ -0,0 +1,63 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {F7C46C03-FBB3-4282-90F3-A713B7E4A5E7}
+ Library
+ Properties
+ E_ZKEccTopSdk
+ E_ZKEccTopSdk
+ v4.0
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ ..\..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Newtonsoft.Json.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/00.SDK/E_ZKEccTopSdk/Generated/FastJson/JSON.cs b/00.SDK/E_ZKEccTopSdk/Generated/FastJson/JSON.cs
new file mode 100644
index 0000000..d532ef0
--- /dev/null
+++ b/00.SDK/E_ZKEccTopSdk/Generated/FastJson/JSON.cs
@@ -0,0 +1,1003 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace FastJson
+{
+ public delegate string Serialize(object data);
+ public delegate object Deserialize(string data);
+
+ public sealed class JSONParameters
+ {
+ ///
+ /// Use the optimized fast Dataset Schema format (default = True)
+ ///
+ public bool UseOptimizedDatasetSchema = true;
+ ///
+ /// Use the fast GUID format (default = True)
+ ///
+ public bool UseFastGuid = true;
+ ///
+ /// Serialize null values to the output (default = True)
+ ///
+ public bool SerializeNullValues = true;
+ ///
+ /// Use the UTC date format (default = True)
+ ///
+ public bool UseUTCDateTime = true;
+ ///
+ /// Show the readonly properties of types in the output (default = False)
+ ///
+ public bool ShowReadOnlyProperties = false;
+ ///
+ /// Use the $types extension to optimise the output json (default = True)
+ ///
+ public bool UsingGlobalTypes = true;
+ ///
+ /// Ignore case when processing json and deserializing
+ ///
+ [Obsolete("Not needed anymore and will always match")]
+ public bool IgnoreCaseOnDeserialize = false;
+ ///
+ /// Anonymous types have read only properties
+ ///
+ public bool EnableAnonymousTypes = false;
+ ///
+ /// Enable fastJSON extensions $types, $type, $map (default = True)
+ ///
+ public bool UseExtensions = true;
+ ///
+ /// Use escaped unicode i.e. \uXXXX format for non ASCII characters (default = True)
+ ///
+ public bool UseEscapedUnicode = false;
+ ///
+ /// Output string key dictionaries as "k"/"v" format (default = False)
+ ///
+ public bool KVStyleStringDictionary = false;
+ ///
+ /// Output Enum values instead of names (default = False)
+ ///
+ public bool UseValuesOfEnums = false;
+ ///
+ /// Ignore attributes to check for (default : XmlIgnoreAttribute)
+ ///
+ public List IgnoreAttributes = new List { typeof(System.Xml.Serialization.XmlIgnoreAttribute) };
+ ///
+ /// If you have parametric and no default constructor for you classes (default = False)
+ ///
+ /// IMPORTANT NOTE : If True then all initial values within the class will be ignored and will be not set
+ ///
+ public bool ParametricConstructorOverride = false;
+ ///
+ /// Serialize DateTime milliseconds i.e. yyyy-MM-dd HH:mm:ss.nnn (default = false)
+ ///
+ public bool DateTimeMilliseconds = false;
+ ///
+ /// Maximum depth for circular references in inline mode (default = 20)
+ ///
+ public byte SerializerMaxDepth = 20;
+ ///
+ /// Inline circular or already seen objects instead of replacement with $i (default = False)
+ ///
+ public bool InlineCircularReferences = false;
+ ///
+ /// Save property/field names as lowercase (default = false)
+ ///
+ public bool SerializeToLowerCaseNames = false;
+ ///
+ /// Serialize property name with underline style
+ ///
+ public bool UseApiNamingStyle = false;
+
+ public void FixValues()
+ {
+ if (UseExtensions == false) // disable conflicting params
+ {
+ UsingGlobalTypes = false;
+ InlineCircularReferences = true;
+ }
+ if (EnableAnonymousTypes)
+ ShowReadOnlyProperties = true;
+ }
+ }
+
+ public static class JSON
+ {
+ ///
+ /// Globally set-able parameters for controlling the serializer
+ ///
+ public static JSONParameters Parameters = new JSONParameters();
+ ///
+ /// Create a formatted json string (beautified) from an object
+ ///
+ ///
+ ///
+ ///
+ public static string ToNiceJSON(object obj, JSONParameters param)
+ {
+ string s = ToJSON(obj, param);
+
+ return Beautify(s);
+ }
+ ///
+ /// Create a json representation for an object
+ ///
+ ///
+ ///
+ public static string ToJSON(object obj)
+ {
+ return ToJSON(obj, JSON.Parameters);
+ }
+ ///
+ /// Create a json representation for an object with parameter override on this call
+ ///
+ ///
+ ///
+ ///
+ public static string ToJSON(object obj, JSONParameters param)
+ {
+ param.FixValues();
+ Type t = null;
+
+ if (obj == null)
+ return "null";
+
+ if (obj.GetType().IsGenericType)
+ t = Reflection.Instance.GetGenericTypeDefinition(obj.GetType());
+ if (t == typeof(Dictionary<,>) || t == typeof(List<>))
+ param.UsingGlobalTypes = false;
+
+ // FEATURE : enable extensions when you can deserialize anon types
+ if (param.EnableAnonymousTypes) { param.UseExtensions = false; param.UsingGlobalTypes = false; }
+ return new JSONSerializer(param).ConvertToJSON(obj);
+ }
+ ///
+ /// Parse a json string and generate a Dictionary<string,object> or List<object> structure
+ ///
+ ///
+ ///
+ public static object Parse(string json)
+ {
+ return new JsonParser(json).Decode();
+ }
+#if net4
+ ///
+ /// Create a .net4 dynamic object from the json string
+ ///
+ ///
+ ///
+ public static dynamic ToDynamic(string json)
+ {
+ return new DynamicJson(json);
+ }
+#endif
+ ///
+ /// Create a typed generic object from the json
+ ///
+ ///
+ ///
+ ///
+ public static T ToObject(string json)
+ {
+ return new deserializer(Parameters).ToObject(json);
+ }
+ ///
+ /// Create a typed generic object from the json with parameter override on this call
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static T ToObject(string json, JSONParameters param)
+ {
+ return new deserializer(param).ToObject(json);
+ }
+ ///
+ /// Create an object from the json
+ ///
+ ///
+ ///
+ public static object ToObject(string json)
+ {
+ return new deserializer(Parameters).ToObject(json, null);
+ }
+ ///
+ /// Create an object from the json with parameter override on this call
+ ///
+ ///
+ ///
+ ///
+ public static object ToObject(string json, JSONParameters param)
+ {
+ return new deserializer(param).ToObject(json, null);
+ }
+ ///
+ /// Create an object of type from the json
+ ///
+ ///
+ ///
+ ///
+ public static object ToObject(string json, Type type)
+ {
+ return new deserializer(Parameters).ToObject(json, type);
+ }
+ ///
+ /// Fill a given object with the json represenation
+ ///
+ ///
+ ///
+ ///
+ public static object FillObject(object input, string json)
+ {
+ Dictionary ht = new JsonParser(json).Decode() as Dictionary;
+ if (ht == null) return null;
+ return new deserializer(Parameters).ParseDictionary(ht, null, input.GetType(), input);
+ }
+ ///
+ /// Deep copy an object i.e. clone to a new object
+ ///
+ ///
+ ///
+ public static object DeepCopy(object obj)
+ {
+ return new deserializer(Parameters).ToObject(ToJSON(obj));
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static T DeepCopy(T obj)
+ {
+ return new deserializer(Parameters).ToObject(ToJSON(obj));
+ }
+
+ ///
+ /// Create a human readable string from the json
+ ///
+ ///
+ ///
+ public static string Beautify(string input)
+ {
+ return Formatter.PrettyPrint(input);
+ }
+ ///
+ /// Register custom type handlers for your own types not natively handled by fastJSON
+ ///
+ ///
+ ///
+ ///
+ public static void RegisterCustomType(Type type, Serialize serializer, Deserialize deserializer)
+ {
+ Reflection.Instance.RegisterCustomType(type, serializer, deserializer);
+ }
+ ///
+ /// Clear the internal reflection cache so you can start from new (you will loose performance)
+ ///
+ public static void ClearReflectionCache()
+ {
+ Reflection.Instance.ClearReflectionCache();
+ }
+
+ internal static long CreateLong(out long num, string s, int index, int count)
+ {
+ num = 0;
+ bool neg = false;
+ for (int x = 0; x < count; x++, index++)
+ {
+ char cc = s[index];
+
+ if (cc == '-')
+ neg = true;
+ else if (cc == '+')
+ neg = false;
+ else
+ {
+ num *= 10;
+ num += (int)(cc - '0');
+ }
+ }
+ if (neg) num = -num;
+
+ return num;
+ }
+ }
+
+ internal class deserializer
+ {
+ public deserializer(JSONParameters param)
+ {
+ _params = param;
+ }
+
+ private JSONParameters _params;
+ private bool _usingglobals = false;
+ private Dictionary