@@ -147,9 +147,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -186,9 +186,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -120,9 +120,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_fullname', | |||
keyId: 'name', | |||
callback: function (_data) { | |||
callback(_data['f_departmentid']); | |||
callback(_data['id']); | |||
} | |||
}); | |||
} | |||
@@ -203,9 +203,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -26,7 +26,7 @@ var bootstrap = function ($, learun) { | |||
bind: function () { | |||
var loginInfo = top.learun.clientdata.get(['userinfo']); | |||
$('#ReceiveUser').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }).lrselectSet(loginInfo.userId); | |||
$('#PDepartment').lrDataSourceSelect({ code: 'classdata', value: 'f_departmentid', text: 'f_fullname' }).lrselectSet(loginInfo.departmentId); | |||
$('#PDepartment').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }).lrselectSet(loginInfo.departmentId); | |||
$('#Ass_ReceiveItem').jfGrid({ | |||
headData: [ | |||
{ | |||
@@ -26,7 +26,7 @@ var bootstrap = function ($, learun) { | |||
bind: function () { | |||
var loginInfo = top.learun.clientdata.get(['userinfo']); | |||
$('#ReceiveUser').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }).lrselectSet(loginInfo.userId); | |||
$('#PDepartment').lrDataSourceSelect({ code: 'classdata', value: 'f_departmentid', text: 'f_fullname' }).lrselectSet(loginInfo.departmentId); | |||
$('#PDepartment').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }).lrselectSet(loginInfo.departmentId); | |||
$('#Ass_ReceiveItem').jfGrid({ | |||
headData: [ | |||
{ | |||
@@ -183,9 +183,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -282,7 +282,7 @@ | |||
var companys = $.parseJSON(msg).data.data; | |||
var str = '<option value="">请选择</option>'; | |||
$.each(companys, function (i, item) { | |||
str += '<option value="' + item.f_departmentid + '">' + item.f_fullname + '</option>' | |||
str += '<option value="' + item.id + '">' + item.name + '</option>' | |||
}) | |||
$("#F_DepartmentId").html(str); | |||
}, | |||
@@ -347,9 +347,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -368,9 +368,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -301,7 +301,7 @@ | |||
var companys = $.parseJSON(msg).data.data; | |||
var str = '<option value="">请选择</option>'; | |||
$.each(companys, function (i, item) { | |||
str += '<option value="' + item.f_departmentid + '">' + item.f_fullname + '</option>' | |||
str += '<option value="' + item.id + '">' + item.name + '</option>' | |||
}) | |||
$("#F_DepartmentId").html(str); | |||
}, | |||
@@ -5,11 +5,7 @@ | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Record" > | |||
<div class="lr-form-item-title">员工名字</div> | |||
<input id="UserName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Record" > | |||
<div class="lr-form-item-title">部门</div> | |||
<div id="Department" ></div> | |||
<div id="UserNo" type="text" class="form-control"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ADR_Record" > | |||
<div class="lr-form-item-title">考勤类型</div> | |||
@@ -21,6 +21,8 @@ var bootstrap = function ($, learun) { | |||
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree', | |||
param: {} | |||
}); | |||
$('#UserNo').lrDataSourceSelect({ code: 'BaseUser', value: 'f_account', text: 'f_realname' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
@@ -98,23 +98,55 @@ var bootstrap = function ($, learun) { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/ADR_Record/GetPageList', | |||
headData: [ | |||
{ label: "员工名字", name: "UserName", width: 100, align: "left" }, | |||
{ | |||
label: "员工名字", name: "UserNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser', | |||
key: value, | |||
keyId: 'f_account', | |||
callback: function (_data) { | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "员工编号", name: "UserNo", width: 100, align: "left" }, | |||
{ | |||
label: "部门", name: "Department", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('department', { | |||
console.log(value); | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data.name); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "考勤类型", name: "ADType", width: 100, align: "left" }, | |||
{ | |||
label: "考勤类型", name: "ADType", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'ADType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} }, | |||
{ label: "考勤时间", name: "ADTime", width: 100, align: "left" }, | |||
{ label: "打卡时间", name: "ClockTime", width: 100, align: "left" }, | |||
{ label: "打卡结果", name: "ClockStatus", width: 100, align: "left" }, | |||
{ | |||
label: "打卡结果", name: "ClockStatus", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'ADStatus', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} }, | |||
{ label: "打卡地点", name: "ClockPlace", width: 100, align: "left" }, | |||
], | |||
mainId: 'ID', | |||
@@ -246,9 +246,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -259,9 +259,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -15,7 +15,7 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#Department').lrDataSourceSelect({ code: 'classdata', value: 'f_departmentid', text: 'f_fullname' }); | |||
$('#Department').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#UnitName').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); | |||
$('#Type').lrDataItemSelect({ code: 'EUserType' }); | |||
$('#RelationShip').lrDataItemSelect({ code: 'ERelationship' }); | |||
@@ -119,9 +119,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -16,7 +16,7 @@ var bootstrap = function ($, learun) { | |||
}, | |||
bind: function () { | |||
$('#Creater').lrDataSourceSelect({ code: 'BaseUser', value: 'f_userid', text: 'f_realname' }); | |||
$('#Department').lrDataSourceSelect({ code: 'classdata', value: 'f_departmentid', text: 'f_fullname' }); | |||
$('#Department').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#UnitName').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); | |||
$('#Type').lrDataItemSelect({ code: 'EUserType' }); | |||
$('#RelationShip').lrDataItemSelect({ code: 'ERelationship' }); | |||
@@ -113,9 +113,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -83,9 +83,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -29,10 +29,10 @@ var bootstrap = function ($, learun) { | |||
{ | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
sync: true, | |||
callback: function (_data) { | |||
callback(_data.f_fullname); | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
@@ -15,7 +15,7 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#WPDepartment').lrDataSourceSelect({ code: 'classdata', value: 'f_departmentid', text: 'f_fullname' }); | |||
$('#WPDepartment').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#WPUser').lrDataSourceSelect({ code: 'BaseUser', value: 'f_userid', text: 'f_realname' }); | |||
$('#WPTimeType').lrDataItemSelect({ code: 'WorkPlanType' }); | |||
$('#WPFile').lrUploader(); | |||
@@ -45,7 +45,7 @@ var bootstrap = function ($, learun) { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#WPDepartment').lrDataSourceSelect({ code: 'classdata', value: 'f_departmentid', text: 'f_fullname' }); | |||
$('#WPDepartment').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#WPUser').lrDataSourceSelect({ code: 'BaseUser', value: 'f_userid', text: 'f_realname' }); | |||
$('#WPTimeType').lrDataItemSelect({ code: 'WorkPlanType' }); | |||
// 刷新 | |||
@@ -110,9 +110,9 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
callback(_data['f_fullname']); | |||
callback(_data['name']); | |||
} | |||
}); | |||
} | |||
@@ -15,7 +15,7 @@ var bootstrap = function ($, learun) { | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#WSDepartment').lrDataSourceSelect({ code: 'classdata', value: 'f_departmentid', text: 'f_fullname' }); | |||
$('#WSDepartment').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#WSUser').lrDataSourceSelect({ code: 'BaseUser', value: 'f_userid', text: 'f_realname' }); | |||
$('#WSTimeType').lrDataItemSelect({ code: 'WorkSummaryType' }); | |||
$('#WSFile').lrUploader(); | |||
@@ -45,7 +45,7 @@ var bootstrap = function ($, learun) { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#WSDepartment').lrDataSourceSelect({ code: 'classdata', value: 'f_departmentid', text: 'f_fullname' }); | |||
$('#WSDepartment').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#WSUser').lrDataSourceSelect({ code: 'BaseUser', value: 'f_userid', text: 'f_realname' }); | |||
$('#WSTimeType').lrDataItemSelect({ code: 'WorkSummaryType' }); | |||
// 刷新 | |||
@@ -486,9 +486,9 @@ | |||
sync: true, | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
result = _data.f_fullname; | |||
result = _data.name; | |||
} | |||
}); | |||
return result; | |||
@@ -527,9 +527,9 @@ | |||
sync: true, | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', | |||
key: value, | |||
keyId: 'f_departmentid', | |||
keyId: 'id', | |||
callback: function (_data) { | |||
result = _data.f_fullname; | |||
result = _data.name; | |||
} | |||
}); | |||
return result; | |||
@@ -29,9 +29,23 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
try | |||
{ | |||
var baseDataName = this.BaseRepository().getDbConnection().Database; | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT * "); | |||
strSql.Append(" FROM ADR_Record t "); | |||
strSql.Append(@"SELECT t.ID, | |||
emp.F_RealName UserName, | |||
t.UserNo, | |||
emp.F_DepartmentId Department , | |||
t.ADType, | |||
t.ADTime, | |||
t.ClockTime, | |||
t.ClockStatus, | |||
t.ClockPlace, | |||
t.ADYear, | |||
t.ADMonth, | |||
t.ADDay, | |||
t.ADPhoto | |||
"); | |||
strSql.Append($" FROM ADR_Record t RIGHT JOIN {baseDataName}.dbo.LR_Base_User emp ON t.UserNo=emp.F_Account"); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
@@ -45,13 +59,15 @@ namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
if (!queryParam["UserName"].IsEmpty()) | |||
{ | |||
dp.Add("UserName", "%" + queryParam["UserName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.UserName Like @UserName "); | |||
strSql.Append(" AND emp.EmpName Like @UserName "); | |||
} | |||
if (!queryParam["Department"].IsEmpty()) | |||
{ | |||
dp.Add("Department",queryParam["Department"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Department = @Department "); | |||
strSql.Append(" AND emp.F_DepartmentId = @Department "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<ADR_RecordEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
@@ -1,54 +1,57 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<configuration> | |||
<configSections> | |||
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration"/> | |||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> | |||
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration" /> | |||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> | |||
</configSections> | |||
<connectionStrings> | |||
<add name="ConnectionPfcMisDBString" connectionString="server=192.168.100.225;database=CollegeMIS;Max Pool Size=1000;Min Pool Size=5;UID=sa;Pwd=Jykj@2019;" providerName="System.Data.SqlClient"/> | |||
<add name="ConnectionPfcMisDBString2" connectionString="server=192.168.100.225;database=CollegeMIS_金隅;Max Pool Size=1000;Min Pool Size=5;UID=sa;Pwd=Jykj@2019;" providerName="System.Data.SqlClient"/> | |||
<add name="CoreDBString" connectionString="server=192.168.100.225;database=adms7ultimate2;Max Pool Size=1000;Min Pool Size=5;UID=sa;Pwd=Jykj@2019;" providerName="System.Data.SqlClient"/> | |||
<add name="CoreDBString2" connectionString="server=192.168.100.225;database=adms7ultimate2_金隅;Max Pool Size=1000;Min Pool Size=5;UID=sa;Pwd=Jykj@2019;" providerName="System.Data.SqlClient"/> | |||
<add name="HangfireConnString" connectionString="Server=192.168.100.225;Initial Catalog=Hangfire;User ID=sa;Password=Jykj@2019" providerName="System.Data.SqlClient"/> | |||
<add name="YKTDBString" connectionString="Data Source=xcykt;Persist Security Info=True;User ID=xcysdata;Password=xcysdata2019;Unicode=True" providerName="System.Data.OracleClient"/> | |||
<add name="mjDBString" connectionString="Server=112.45.152.8,17049;Initial Catalog=mjxtjh;User ID=mjxtjh;Password=s1RKFzJvIG7KfcNRtntZ" providerName="System.Data.SqlClient"/> | |||
<add name="tsDBString" connectionString="Server=112.45.152.8,17049;Initial Catalog=tsgxtjh;User ID=tsgxtjh;Password=Qs6cYOzFoQupbr12MFZm" providerName="System.Data.SqlClient"/> | |||
<add name="ConnectionPfcMisDBString" connectionString="server=192.168.100.225;database=CollegeMIS;Max Pool Size=1000;Min Pool Size=5;UID=sa;Pwd=Jykj@2019;" providerName="System.Data.SqlClient" /> | |||
<add name="ConnectionPfcMisDBString2" connectionString="server=192.168.100.225;database=CollegeMIS_金隅;Max Pool Size=1000;Min Pool Size=5;UID=sa;Pwd=Jykj@2019;" providerName="System.Data.SqlClient" /> | |||
<add name="CoreDBString" connectionString="server=192.168.100.225;database=adms7ultimate2;Max Pool Size=1000;Min Pool Size=5;UID=sa;Pwd=Jykj@2019;" providerName="System.Data.SqlClient" /> | |||
<add name="CoreDBString2" connectionString="server=192.168.100.225;database=adms7ultimate2_金隅;Max Pool Size=1000;Min Pool Size=5;UID=sa;Pwd=Jykj@2019;" providerName="System.Data.SqlClient" /> | |||
<add name="HangfireConnString" connectionString="Server=192.168.100.225;Initial Catalog=Hangfire;User ID=sa;Password=Jykj@2019" providerName="System.Data.SqlClient" /> | |||
<add name="YKTDBString" connectionString="Data Source=xcykt;Persist Security Info=True;User ID=xcysdata;Password=xcysdata2019;Unicode=True" providerName="System.Data.OracleClient" /> | |||
<add name="mjDBString" connectionString="Server=112.45.152.8,17049;Initial Catalog=mjxtjh;User ID=mjxtjh;Password=s1RKFzJvIG7KfcNRtntZ" providerName="System.Data.SqlClient" /> | |||
<add name="tsDBString" connectionString="Server=112.45.152.8,17049;Initial Catalog=tsgxtjh;User ID=tsgxtjh;Password=Qs6cYOzFoQupbr12MFZm" providerName="System.Data.SqlClient" /> | |||
<!--考勤机对接--> | |||
<add name="BaseDb" connectionString="Server=123.57.209.16;Initial Catalog=adms7ultimate2_西昌;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" /> | |||
<add name="CollegeMIS" connectionString="Server=123.57.209.16;Initial Catalog=CollegeMIS_西昌;User ID=sa;Password=bjqjkj@2014~2015!" providerName="System.Data.SqlClient" /> | |||
</connectionStrings> | |||
<startup> | |||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/> | |||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> | |||
</startup> | |||
<appSettings> | |||
<add key="dbbackuppath" value="D:\数字化校园\lr7test\Publish\Resource\DataBaseBackup"/> | |||
<add key="AttendancePhotoPath" value="D:\数字化校园\lr7test\Publish\Resource\AttendancePhoto"/> | |||
<add key="dbbackuppath" value="E:\西昌程序单校区版2019_09_16\Learun.Framework.Ultimate V7\Learun.Application.Web\Resource\DataBaseBackup" /> | |||
<add key="AttendancePhotoPath" value="E:\西昌程序单校区版2019_09_16\Learun.Framework.Ultimate V7\Learun.Application.Web\Resource\AttendancePhoto" /> | |||
</appSettings> | |||
<runtime> | |||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |||
<dependentAssembly> | |||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/> | |||
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0"/> | |||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> | |||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" /> | |||
</dependentAssembly> | |||
<dependentAssembly> | |||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral"/> | |||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0"/> | |||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" /> | |||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" /> | |||
</dependentAssembly> | |||
<dependentAssembly> | |||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/> | |||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1"/> | |||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | |||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" /> | |||
</dependentAssembly> | |||
<dependentAssembly> | |||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/> | |||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/> | |||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> | |||
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> | |||
</dependentAssembly> | |||
<dependentAssembly> | |||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/> | |||
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0"/> | |||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | |||
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" /> | |||
</dependentAssembly> | |||
</assemblyBinding> | |||
</runtime> | |||
<unity> | |||
<typeAliases> | |||
<typeAlias alias="IDatabase" type="Learun.DataBase.IDatabase,Learun.DataBase"/> | |||
<typeAlias alias="SqlServer" type="Learun.DataBase.SqlServer.Database,Learun.DataBase.SqlServer"/> | |||
<typeAlias alias="IDatabase" type="Learun.DataBase.IDatabase,Learun.DataBase" /> | |||
<typeAlias alias="SqlServer" type="Learun.DataBase.SqlServer.Database,Learun.DataBase.SqlServer" /> | |||
</typeAliases> | |||
<containers> | |||
<container name="IOCcontainer"> | |||
@@ -59,21 +62,21 @@ | |||
<entityFramework> | |||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> | |||
<parameters> | |||
<parameter value="v13.0"/> | |||
<parameter value="v13.0" /> | |||
</parameters> | |||
</defaultConnectionFactory> | |||
<providers> | |||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/> | |||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> | |||
</providers> | |||
</entityFramework> | |||
<system.serviceModel> | |||
<bindings> | |||
<basicHttpBinding> | |||
<binding name="SynServiceSoap"/> | |||
<binding name="SynServiceSoap" /> | |||
</basicHttpBinding> | |||
</bindings> | |||
<client> | |||
<endpoint address="http://192.168.100.27:801/SynService.asmx" binding="basicHttpBinding" bindingConfiguration="SynServiceSoap" contract="SynServiceReference.SynServiceSoap" name="SynServiceSoap"/> | |||
<endpoint address="http://192.168.100.27:801/SynService.asmx" binding="basicHttpBinding" bindingConfiguration="SynServiceSoap" contract="SynServiceReference.SynServiceSoap" name="SynServiceSoap" /> | |||
</client> | |||
</system.serviceModel> | |||
</configuration> |
@@ -0,0 +1,357 @@ | |||
using System; | |||
using System.Runtime.InteropServices; | |||
namespace AlarmCSharpDemo | |||
{ | |||
/// <summary> | |||
/// CHCNetSDK 的摘要说明。 | |||
/// </summary> | |||
public class CHCNetSDK | |||
{ | |||
public CHCNetSDK() | |||
{ | |||
// | |||
// TODO: 在此处添加构造函数逻辑 | |||
// | |||
} | |||
//常量 | |||
public const int SERIALNO_LEN = 48;//序列号长度 | |||
public const int NAME_LEN = 32;//用户名长度 | |||
public const int PASSWD_LEN = 16;//密码长度 | |||
public const int MACADDR_LEN = 6;//mac地址长度 | |||
public const int MAX_NAMELEN = 16;//DVR本地登陆名 | |||
public const int ACS_CARD_NO_LEN = 32; //门禁卡号长度 | |||
public delegate void LOGINRESULTCALLBACK(int lUserID, int dwResult, IntPtr lpDeviceInfo, IntPtr pUser); | |||
/********************************************************* | |||
Function: EXCEPYIONCALLBACK | |||
Desc: (回调函数) | |||
Input: | |||
Output: | |||
Return: | |||
**********************************************************/ | |||
public delegate void EXCEPYIONCALLBACK(uint dwType, int lUserID, int lHandle, IntPtr pUser); | |||
public delegate bool MSGCallBack_V31(int lCommand, ref NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser); | |||
//报警设备信息 | |||
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)] | |||
public struct NET_DVR_ALARMER | |||
{ | |||
public byte byUserIDValid;/* userid是否有效 0-无效,1-有效 */ | |||
public byte bySerialValid;/* 序列号是否有效 0-无效,1-有效 */ | |||
public byte byVersionValid;/* 版本号是否有效 0-无效,1-有效 */ | |||
public byte byDeviceNameValid;/* 设备名字是否有效 0-无效,1-有效 */ | |||
public byte byMacAddrValid; /* MAC地址是否有效 0-无效,1-有效 */ | |||
public byte byLinkPortValid;/* login端口是否有效 0-无效,1-有效 */ | |||
public byte byDeviceIPValid;/* 设备IP是否有效 0-无效,1-有效 */ | |||
public byte bySocketIPValid;/* socket ip是否有效 0-无效,1-有效 */ | |||
public int lUserID; /* NET_DVR_Login()返回值, 布防时有效 */ | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sSerialNumber;/* 序列号 */ | |||
public uint dwDeviceVersion;/* 版本信息 高16位表示主版本,低16位表示次版本*/ | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sDeviceName;/* 设备名字 */ | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byMacAddr;/* MAC地址 */ | |||
public ushort wLinkPort; /* link port */ | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sDeviceIP;/* IP地址 */ | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sSocketIP;/* 报警主动上传时的socket IP地址 */ | |||
public byte byIpProtocol; /* Ip协议 0-IPV4, 1-IPV6 */ | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 11, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes2; | |||
} | |||
[StructLayoutAttribute(LayoutKind.Sequential)] | |||
public struct NET_DVR_LOCAL_GENERAL_CFG | |||
{ | |||
public byte byExceptionCbDirectly; //0-通过线程池异常回调,1-直接异常回调给上层 | |||
public byte byNotSplitRecordFile; //回放和预览中保存到本地录像文件不切片 0-默认切片,1-不切片 | |||
public byte byResumeUpgradeEnable; //断网续传升级使能,0-关闭(默认),1-开启 | |||
public byte byAlarmJsonPictureSeparate; //控制JSON透传报警数据和图片是否分离,0-不分离,1-分离(分离后走COMM_ISAPI_ALARM回调返回) | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes; //保留 | |||
public Int64 i64FileSize; //单位:Byte | |||
public uint dwResumeUpgradeTimeout; //断网续传重连超时时间,单位毫秒 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 236, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes1; //预留 | |||
} | |||
public const int NET_DVR_DEV_ADDRESS_MAX_LEN = 129; | |||
public const int NET_DVR_LOGIN_USERNAME_MAX_LEN = 64; | |||
public const int NET_DVR_LOGIN_PASSWD_MAX_LEN = 64; | |||
[StructLayout(LayoutKind.Sequential)] | |||
public struct NET_DVR_USER_LOGIN_INFO | |||
{ | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NET_DVR_DEV_ADDRESS_MAX_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sDeviceAddress; | |||
public byte byUseTransport; | |||
public ushort wPort; | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NET_DVR_LOGIN_USERNAME_MAX_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sUserName; | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NET_DVR_LOGIN_PASSWD_MAX_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sPassword; | |||
public LOGINRESULTCALLBACK cbLoginResult; | |||
public IntPtr pUser; | |||
public bool bUseAsynLogin; | |||
public byte byProxyType; //0:不使用代理,1:使用标准代理,2:使用EHome代理 | |||
public byte byUseUTCTime; //0-不进行转换,默认,1-接口上输入输出全部使用UTC时间,SDK完成UTC时间与设备时区的转换,2-接口上输入输出全部使用平台本地时间,SDK完成平台本地时间与设备时区的转换 | |||
public byte byLoginMode; //0-Private, 1-ISAPI, 2-自适应 | |||
public byte byHttps; //0-不适用tls,1-使用tls 2-自适应 | |||
public int iProxyID; //代理服务器序号,添加代理服务器信息时,相对应的服务器数组下表值 | |||
public byte byVerifyMode; //认证方式,0-不认证,1-双向认证,2-单向认证;认证仅在使用TLS的时候生效; | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 119, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes3; | |||
} | |||
//NET_DVR_Login_V30()参数结构 | |||
[StructLayoutAttribute(LayoutKind.Sequential)] | |||
public struct NET_DVR_DEVICEINFO_V30 | |||
{ | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sSerialNumber; //序列号 | |||
public byte byAlarmInPortNum; //报警输入个数 | |||
public byte byAlarmOutPortNum; //报警输出个数 | |||
public byte byDiskNum; //硬盘个数 | |||
public byte byDVRType; //设备类型, 1:DVR 2:ATM DVR 3:DVS ...... | |||
public byte byChanNum; //模拟通道个数 | |||
public byte byStartChan; //起始通道号,例如DVS-1,DVR - 1 | |||
public byte byAudioChanNum; //语音通道数 | |||
public byte byIPChanNum; //最大数字通道个数,低位 | |||
public byte byZeroChanNum; //零通道编码个数 //2010-01-16 | |||
public byte byMainProto; //主码流传输协议类型 0-private, 1-rtsp,2-同时支持private和rtsp | |||
public byte bySubProto; //子码流传输协议类型0-private, 1-rtsp,2-同时支持private和rtsp | |||
public byte bySupport; //能力,位与结果为0表示不支持,1表示支持, | |||
//bySupport & 0x1, 表示是否支持智能搜索 | |||
//bySupport & 0x2, 表示是否支持备份 | |||
//bySupport & 0x4, 表示是否支持压缩参数能力获取 | |||
//bySupport & 0x8, 表示是否支持多网卡 | |||
//bySupport & 0x10, 表示支持远程SADP | |||
//bySupport & 0x20, 表示支持Raid卡功能 | |||
//bySupport & 0x40, 表示支持IPSAN 目录查找 | |||
//bySupport & 0x80, 表示支持rtp over rtsp | |||
public byte bySupport1; // 能力集扩充,位与结果为0表示不支持,1表示支持 | |||
//bySupport1 & 0x1, 表示是否支持snmp v30 | |||
//bySupport1 & 0x2, 支持区分回放和下载 | |||
//bySupport1 & 0x4, 是否支持布防优先级 | |||
//bySupport1 & 0x8, 智能设备是否支持布防时间段扩展 | |||
//bySupport1 & 0x10, 表示是否支持多磁盘数(超过33个) | |||
//bySupport1 & 0x20, 表示是否支持rtsp over http | |||
//bySupport1 & 0x80, 表示是否支持车牌新报警信息2012-9-28, 且还表示是否支持NET_DVR_IPPARACFG_V40结构体 | |||
public byte bySupport2; /*能力,位与结果为0表示不支持,非0表示支持 | |||
bySupport2 & 0x1, 表示解码器是否支持通过URL取流解码 | |||
bySupport2 & 0x2, 表示支持FTPV40 | |||
bySupport2 & 0x4, 表示支持ANR | |||
bySupport2 & 0x8, 表示支持CCD的通道参数配置 | |||
bySupport2 & 0x10, 表示支持布防报警回传信息(仅支持抓拍机报警 新老报警结构) | |||
bySupport2 & 0x20, 表示是否支持单独获取设备状态子项 | |||
bySupport2 & 0x40, 表示是否是码流加密设备*/ | |||
public ushort wDevType; //设备型号 | |||
public byte bySupport3; //能力集扩展,位与结果为0表示不支持,1表示支持 | |||
//bySupport3 & 0x1, 表示是否多码流 | |||
// bySupport3 & 0x4 表示支持按组配置, 具体包含 通道图像参数、报警输入参数、IP报警输入、输出接入参数、 | |||
// 用户参数、设备工作状态、JPEG抓图、定时和时间抓图、硬盘盘组管理 | |||
//bySupport3 & 0x8为1 表示支持使用TCP预览、UDP预览、多播预览中的"延时预览"字段来请求延时预览(后续都将使用这种方式请求延时预览)。而当bySupport3 & 0x8为0时,将使用 "私有延时预览"协议。 | |||
//bySupport3 & 0x10 表示支持"获取报警主机主要状态(V40)"。 | |||
//bySupport3 & 0x20 表示是否支持通过DDNS域名解析取流 | |||
public byte byMultiStreamProto;//是否支持多码流,按位表示,0-不支持,1-支持,bit1-码流3,bit2-码流4,bit7-主码流,bit-8子码流 | |||
public byte byStartDChan; //起始数字通道号,0表示无效 | |||
public byte byStartDTalkChan; //起始数字对讲通道号,区别于模拟对讲通道号,0表示无效 | |||
public byte byHighDChanNum; //数字通道个数,高位 | |||
public byte bySupport4; | |||
public byte byLanguageType;// 支持语种能力,按位表示,每一位0-不支持,1-支持 | |||
// byLanguageType 等于0 表示 老设备 | |||
// byLanguageType & 0x1表示支持中文 | |||
// byLanguageType & 0x2表示支持英文 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 9, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes2; //保留 | |||
} | |||
[StructLayout(LayoutKind.Sequential)] | |||
public struct NET_DVR_DEVICEINFO_V40 | |||
{ | |||
public NET_DVR_DEVICEINFO_V30 struDeviceV30; | |||
public byte bySupportLock; //设备支持锁定功能,该字段由SDK根据设备返回值来赋值的。bySupportLock为1时,dwSurplusLockTime和byRetryLoginTime有效 | |||
public byte byRetryLoginTime; //剩余可尝试登陆的次数,用户名,密码错误时,此参数有效 | |||
public byte byPasswordLevel; //admin密码安全等级0-无效,1-默认密码,2-有效密码,3-风险较高的密码。当用户的密码为出厂默认密码(12345)或者风险较高的密码时,上层客户端需要提示用户更改密码。 | |||
public byte byProxyType;//代理类型,0-不使用代理, 1-使用socks5代理, 2-使用EHome代理 | |||
public uint dwSurplusLockTime; //剩余时间,单位秒,用户锁定时,此参数有效 | |||
public byte byCharEncodeType; //字符编码类型 | |||
public byte bySupportDev5;//支持v50版本的设备参数获取,设备名称和设备类型名称长度扩展为64字节 | |||
public byte bySupport; //能力集扩展,位与结果:0- 不支持,1- 支持 | |||
// bySupport & 0x1: 保留 | |||
// bySupport & 0x2: 0-不支持变化上报 1-支持变化上报 | |||
public byte byLoginMode; //登录模式 0-Private登录 1-ISAPI登录 | |||
public int dwOEMCode; | |||
public int iResidualValidity; //该用户密码剩余有效天数,单位:天,返回负值,表示密码已经超期使用,例如“-3表示密码已经超期使用3天” | |||
public byte byResidualValidity; // iResidualValidity字段是否有效,0-无效,1-有效 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 243, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes2; | |||
} | |||
//报警布防参数结构体 | |||
[StructLayoutAttribute(LayoutKind.Sequential)] | |||
public struct NET_DVR_SETUPALARM_PARAM | |||
{ | |||
public uint dwSize; | |||
public byte byLevel;//布防优先级:0- 一等级(高),1- 二等级(中),2- 三等级(低,保留) | |||
public byte byAlarmInfoType;//上传报警信息类型(智能交通摄像机支持):0- 老报警信息(NET_DVR_PLATE_RESULT),1- 新报警信息(NET_ITS_PLATE_RESULT) | |||
public byte byRetAlarmTypeV40; | |||
public byte byRetDevInfoVersion; | |||
public byte byRetVQDAlarmType; | |||
public byte byFaceAlarmDetection; | |||
public byte bySupport; | |||
public byte byBrokenNetHttp; | |||
public ushort wTaskNo; | |||
public byte byDeployType; //布防类型:0-客户端布防,1-实时布防 | |||
public byte bySubScription; //订阅,按位表示,未开启订阅不上报 //占位 //Bit7-移动侦测人车分类是否传图;0-不传图(V30上报),1-传图(V40上报) | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes1; | |||
public byte byAlarmTypeURL; | |||
//bit0-表示人脸抓拍报警上传(INTER_FACESNAP_RESULT);0-表示二进制传输,1-表示URL传输(设备支持的情况下,设备支持能力根据具体报警能力集判断,同时设备需要支持URL的相关服务,当前是”云存储“) | |||
//bit1-表示EVENT_JSON中图片数据长传类型;0-表示二进制传输,1-表示URL传输(设备支持的情况下,设备支持能力根据具体报警能力集判断) | |||
//bit2 - 人脸比对(报警类型为COMM_SNAP_MATCH_ALARM)中图片数据上传类型:0 - 二进制传输,1 - URL传输 | |||
//bit3 - 行为分析(报警类型为COMM_ALARM_RULE)中图片数据上传类型:0 - 二进制传输,1 - URL传输,本字段设备是否支持,对应软硬件能力集中<isSupportBehaviorUploadByCloudStorageURL>节点是否返回且为true | |||
public byte byCustomCtrl;//Bit0- 表示支持副驾驶人脸子图上传: 0-不上传,1-上传 | |||
} | |||
//校时结构参数 | |||
[StructLayoutAttribute(LayoutKind.Sequential)] | |||
public struct NET_DVR_TIME | |||
{ | |||
public uint dwYear; | |||
public uint dwMonth; | |||
public uint dwDay; | |||
public uint dwHour; | |||
public uint dwMinute; | |||
public uint dwSecond; | |||
} | |||
/*IP地址*/ | |||
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)] | |||
public struct NET_DVR_IPADDR | |||
{ | |||
/// char[16] | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sIpV4; | |||
/// BYTE[128] | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes; | |||
public void Init() | |||
{ | |||
byRes = new byte[128]; | |||
} | |||
} | |||
[StructLayoutAttribute(LayoutKind.Sequential)] | |||
public struct NET_DVR_ACS_EVENT_INFO | |||
{ | |||
public uint dwSize; | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byCardNo; //卡号,为0无效 | |||
public byte byCardType; //卡类型,1-普通卡,2-残疾人卡,3-黑名单卡,4-巡更卡,5-胁迫卡,6-超级卡,7-来宾卡,为0无效 | |||
public byte byWhiteListNo; //白名单单号,1-8,为0无效 | |||
public byte byReportChannel; //报告上传通道,1-布防上传,2-中心组1上传,3-中心组2上传,为0无效 | |||
public byte byCardReaderKind; //读卡器属于哪一类,0-无效,1-IC读卡器,2-身份证读卡器,3-二维码读卡器,4-指纹头 | |||
public uint dwCardReaderNo; //读卡器编号,为0无效 | |||
public uint dwDoorNo; //门编号(楼层编号),为0无效 | |||
public uint dwVerifyNo; //多重卡认证序号,为0无效 | |||
public uint dwAlarmInNo; //报警输入号,为0无效 | |||
public uint dwAlarmOutNo; //报警输出号,为0无效 | |||
public uint dwCaseSensorNo; //事件触发器编号 | |||
public uint dwRs485No; //RS485通道号,为0无效 | |||
public uint dwMultiCardGroupNo; //群组编号 | |||
public ushort wAccessChannel; //人员通道号 | |||
public byte byDeviceNo; //设备编号,为0无效 | |||
public byte byDistractControlNo;//分控器编号,为0无效 | |||
public uint dwEmployeeNo; //工号,为0无效 | |||
public ushort wLocalControllerID; //就地控制器编号,0-门禁主机,1-64代表就地控制器 | |||
public byte byInternetAccess; //网口ID:(1-上行网口1,2-上行网口2,3-下行网口1) | |||
public byte byType; //防区类型,0:即时防区,1-24小时防区,2-延时防区 ,3-内部防区,4-钥匙防区 5-火警防区 6-周界防区 7-24小时无声防区 8-24小时辅助防区,9-24小时震动防区,10-门禁紧急开门防区,11-门禁紧急关门防区 0xff-无 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byMACAddr; //物理地址,为0无效 | |||
public byte bySwipeCardType;//刷卡类型,0-无效,1-二维码 | |||
public byte byMask;//是否带口罩:0-保留,1-未知,2-不戴口罩,3-戴口罩 | |||
public uint dwSerialNo; //事件流水号,为0无效 | |||
public byte byChannelControllerID; //通道控制器ID,为0无效,1-主通道控制器,2-从通道控制器 | |||
public byte byChannelControllerLampID; //通道控制器灯板ID,为0无效(有效范围1-255) | |||
public byte byChannelControllerIRAdaptorID; //通道控制器红外转接板ID,为0无效(有效范围1-255) | |||
public byte byChannelControllerIREmitterID; //通道控制器红外对射ID,为0无效(有效范围1-255) | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes; | |||
} | |||
[StructLayoutAttribute(LayoutKind.Sequential)] | |||
public struct NET_DVR_ACS_ALARM_INFO | |||
{ | |||
public uint dwSize; | |||
public uint dwMajor; //报警主类型,参考宏定义 | |||
public uint dwMinor; //报警次类型,参考宏定义 | |||
public NET_DVR_TIME struTime; //时间 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NAMELEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] sNetUser;//网络操作的用户名 | |||
public NET_DVR_IPADDR struRemoteHostAddr;//远程主机地址 | |||
public NET_DVR_ACS_EVENT_INFO struAcsEventInfo; //详细参数 | |||
public uint dwPicDataLen; //图片数据大小,不为0是表示后面带数据 | |||
public IntPtr pPicData; | |||
public ushort wInductiveEventType; //归纳事件类型,0-无效,客户端判断该值为非0值后,报警类型通过归纳事件类型区分,否则通过原有报警主次类型(dwMajor、dwMinor)区分 | |||
public byte byPicTransType; //图片数据传输方式: 0-二进制;1-url | |||
public byte byRes1; //保留字节 | |||
public uint dwIOTChannelNo; //IOT通道号 | |||
public IntPtr pAcsEventInfoExtend; //byAcsEventInfoExtend为1时,表示指向一个NET_DVR_ACS_EVENT_INFO_EXTEND结构体 | |||
public byte byAcsEventInfoExtend; //pAcsEventInfoExtend是否有效:0-无效,1-有效 | |||
public byte byTimeType; //时间类型:0-设备本地时间,1-UTC时间(struTime的时间) | |||
public byte byRes2; //保留字节 | |||
public byte byAcsEventInfoExtendV20; //pAcsEventInfoExtendV20是否有效:0-无效,1-有效 | |||
public IntPtr pAcsEventInfoExtendV20; //byAcsEventInfoExtendV20为1时,表示指向一个NET_DVR_ACS_EVENT_INFO_EXTEND_V20结构体 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes; | |||
} | |||
public const int NET_SDK_EMPLOYEE_NO_LEN = 32; //工号长度 | |||
public const int NET_SDK_UUID_LEN = 36; //UUID长度 | |||
public const int NET_DEV_NAME_LEN = 64; //设备名称长度 | |||
[StructLayoutAttribute(LayoutKind.Sequential)] | |||
public struct NET_DVR_ACS_EVENT_INFO_EXTEND | |||
{ | |||
public int dwFrontSerialNo; //事件流水号,为0无效(若该字段为0,平台根据dwSerialNo判断是否丢失事件;若该字段不为0,平台根据该字段和dwSerialNo字段共同判断是否丢失事件)(主要用于解决报警订阅后导致dwSerialNo不连续的情况) | |||
public byte byUserType; //人员类型:0-无效,1-普通人(主人),2-来宾(访客),3-黑名单人,4-管理员 | |||
public byte byCurrentVerifyMode; //读卡器当前验证方式:0-无效,1-休眠,2-刷卡+密码,3-刷卡,4-刷卡或密码,5-指纹,6-指纹+密码,7-指纹或刷卡,8-指纹+刷卡,9-指纹+刷卡+密码,10-人脸或指纹或刷卡或密码,11-人脸+指纹,12-人脸+密码,13-人脸+刷卡,14-人脸,15-工号+密码,16-指纹或密码,17-工号+指纹,18-工号+指纹+密码,19-人脸+指纹+刷卡,20-人脸+密码+指纹,21-工号+人脸,22-人脸或人脸+刷卡,23-指纹或人脸,24-刷卡或人脸或密码,25-刷卡或人脸,26-刷卡或人脸或指纹,27-刷卡或指纹或密码 | |||
public byte byCurrentEvent; //是否为实时事件:0-无效,1-是(实时事件),2-否(离线事件) | |||
public byte byPurePwdVerifyEnable; //设备是否支持纯密码认证, 0-不支持,1-支持 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byEmployeeNo; //工号(人员ID)(对于设备来说,如果使用了工号(人员ID)字段,byEmployeeNo一定要传递,如果byEmployeeNo可转换为dwEmployeeNo,那么该字段也要传递;对于上层平台或客户端来说,优先解析byEmployeeNo字段,如该字段为空,再考虑解析dwEmployeeNo字段) | |||
public byte byAttendanceStatus; //考勤状态:0-未定义,1-上班,2-下班,3-开始休息,4-结束休息,5-开始加班,6-结束加班 | |||
public byte byStatusValue; //考勤状态值 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes2; | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NET_SDK_UUID_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byUUID; //UUID(该字段仅在对接萤石平台过程中才会使用) | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NET_DEV_NAME_LEN, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byDeviceName; //设备序列号 | |||
[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 24, ArraySubType = UnmanagedType.I1)] | |||
public byte[] byRes; | |||
} | |||
/********************************************************* | |||
Function: NET_DVR_Init | |||
Desc: 初始化SDK,调用其他SDK函数的前提。 | |||
Input: | |||
Output: | |||
Return: TRUE表示成功,FALSE表示失败。 | |||
**********************************************************/ | |||
[DllImport(@"..\bin\HCNetSDK.dll")] | |||
public static extern bool NET_DVR_Init(); | |||
//启用日志文件写入接口 | |||
[DllImport(@"..\bin\HCNetSDK.dll")] | |||
public static extern bool NET_DVR_SetLogToFile(int bLogEnable, string strLogDir, bool bAutoDel); | |||
[DllImport(@"..\bin\HCNetSDK.dll")] | |||
public static extern bool NET_DVR_SetSDKLocalCfg(int enumType, IntPtr lpInBuff); | |||
[DllImport(@"..\bin\HCNetSDK.dll")] | |||
public static extern uint NET_DVR_GetLastError(); | |||
[DllImport(@"..\bin\HCNetSDK.dll")] | |||
public static extern bool NET_DVR_SetExceptionCallBack_V30(uint nMessage, IntPtr hWnd, EXCEPYIONCALLBACK fExceptionCallBack, IntPtr pUser); | |||
[DllImport(@"..\bin\HCNetSDK.dll")] | |||
public static extern bool NET_DVR_SetDVRMessageCallBack_V31(MSGCallBack_V31 fMessageCallBack, IntPtr pUser); | |||
[DllImport(@"HCNetSDK.dll")] | |||
public static extern int NET_DVR_Login_V40(ref NET_DVR_USER_LOGIN_INFO pLoginInfo, ref NET_DVR_DEVICEINFO_V40 lpDeviceInfo); | |||
[DllImport(@"..\bin\HCNetSDK.dll")] | |||
public static extern int NET_DVR_SetupAlarmChan_V41(int lUserID, ref NET_DVR_SETUPALARM_PARAM lpSetupParam); | |||
} | |||
} |
@@ -22,12 +22,12 @@ | |||
<TargetFrameworkProfile /> | |||
</PropertyGroup> | |||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||
<PlatformTarget>AnyCPU</PlatformTarget> | |||
<PlatformTarget>x64</PlatformTarget> | |||
<DebugSymbols>true</DebugSymbols> | |||
<DebugType>full</DebugType> | |||
<Optimize>false</Optimize> | |||
<OutputPath>bin\Debug\</OutputPath> | |||
<DefineConstants>DEBUG;TRACE</DefineConstants> | |||
<DefineConstants>TRACE;DEBUG</DefineConstants> | |||
<ErrorReport>prompt</ErrorReport> | |||
<WarningLevel>4</WarningLevel> | |||
</PropertyGroup> | |||
@@ -68,8 +68,9 @@ | |||
<Reference Include="Microsoft.Practices.Unity.RegistrationByConvention"> | |||
<HintPath>..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath> | |||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> | |||
<Private>True</Private> | |||
</Reference> | |||
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> | |||
@@ -91,6 +92,7 @@ | |||
<Reference Include="System.Xml" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="CHCNetSDK.cs" /> | |||
<Compile Include="ProjectInstaller.cs"> | |||
<SubType>Component</SubType> | |||
</Compile> | |||
@@ -105,7 +107,6 @@ | |||
</Compile> | |||
<Compile Include="Program.cs" /> | |||
<Compile Include="Properties\AssemblyInfo.cs" /> | |||
<Compile Include="海康考勤机必须文件\CHCNetSDK.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<None Include="App.config"> | |||
@@ -165,10 +165,10 @@ namespace Quanjiang.DigitalScholl.JobService | |||
/// <summary> | |||
/// 海康登录回调 | |||
/// </summary> | |||
/// <param name="lUserID"></param> | |||
/// <param name="dwResult"></param> | |||
/// <param name="lpDeviceInfo"></param> | |||
/// <param name="pUser"></param> | |||
/// <param name = "lUserID" ></ param > | |||
/// < param name="dwResult"></param> | |||
/// <param name = "lpDeviceInfo" ></ param > | |||
/// < param name="pUser"></param> | |||
public void cbLoginCallBack(int lUserID, int dwResult, IntPtr lpDeviceInfo, IntPtr pUser) | |||
{ | |||
try | |||
@@ -264,10 +264,10 @@ namespace Quanjiang.DigitalScholl.JobService | |||
/// <summary> | |||
/// 海康异常回调 | |||
/// </summary> | |||
/// <param name="dwType"></param> | |||
/// <param name="lUserID"></param> | |||
/// <param name="lHandle"></param> | |||
/// <param name="pUser"></param> | |||
/// <param name = "dwType" ></ param > | |||
/// < param name="lUserID"></param> | |||
/// <param name = "lHandle" ></ param > | |||
/// < param name="pUser"></param> | |||
public void cbExceptionCB(uint dwType, int lUserID, int lHandle, IntPtr pUser) | |||
{ | |||
//异常消息信息类型 | |||
@@ -288,12 +288,12 @@ namespace Quanjiang.DigitalScholl.JobService | |||
/// <summary> | |||
/// 海康报警事件回调 | |||
/// </summary> | |||
/// <param name="lCommand"></param> | |||
/// <param name="pAlarmer"></param> | |||
/// <param name="pAlarmInfo"></param> | |||
/// <param name="dwBufLen"></param> | |||
/// <param name="pUser"></param> | |||
/// <returns></returns> | |||
/// <param name = "lCommand" ></ param > | |||
/// < param name="pAlarmer"></param> | |||
/// <param name = "pAlarmInfo" ></ param > | |||
/// < param name="dwBufLen"></param> | |||
/// <param name = "pUser" ></ param > | |||
/// < returns ></ returns > | |||
public bool MsgCallback_V31(int lCommand, ref CHCNetSDK.NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser) | |||
{ | |||
try | |||
@@ -1,7 +1,11 @@ | |||
安装: | |||
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe Quanjiang.DigitalScholl.JobService.exe | |||
64位 | |||
%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\installutil.exe Quanjiang.DigitalScholl.JobService.exe | |||
卸载: | |||
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\installutil.exe /u Quanjiang.DigitalScholl.JobService.exe | |||
64位卸载 | |||
%SystemRoot%\Microsoft.NET\Framework64\v4.0.30319\installutil.exe /u Quanjiang.DigitalScholl.JobService.exe | |||
调试: | |||
安装服务后,附加到进程 Quanjiang.DigitalScholl.JobService.exe | |||
注意: |
@@ -2,6 +2,6 @@ | |||
<packages> | |||
<package id="Hangfire.Core" version="1.7.3" targetFramework="net45" requireReinstallation="true" /> | |||
<package id="Microsoft.DependencyValidation.Analyzers" version="0.10.0" targetFramework="net461" /> | |||
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" /> | |||
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net461" /> | |||
<package id="Owin" version="1.0" targetFramework="net45" /> | |||
</packages> |
@@ -0,0 +1,20 @@ | |||
The MIT License (MIT) | |||
Copyright (c) 2007 James Newton-King | |||
Permission is hereby granted, free of charge, to any person obtaining a copy of | |||
this software and associated documentation files (the "Software"), to deal in | |||
the Software without restriction, including without limitation the rights to | |||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |||
the Software, and to permit persons to whom the Software is furnished to do so, | |||
subject to the following conditions: | |||
The above copyright notice and this permission notice shall be included in all | |||
copies or substantial portions of the Software. | |||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | |||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | |||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | |||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |