Преглед изворни кода

增加大华设备对接

Signed-off-by: haidong <chenloveguitar@qq.com>
doorRight设置
haidong пре 2 година
родитељ
комит
8f18c4f54b
2 измењених фајлова са 48 додато и 3 уклоњено
  1. +45
    -1
      src/main/java/com/netsdk/demo/module/GateModule.java
  2. +3
    -2
      src/main/java/com/yzx/impl/DaHua.java

+ 45
- 1
src/main/java/com/netsdk/demo/module/GateModule.java Прегледај датотеку

@@ -1038,7 +1038,51 @@ public class GateModule {
return null;
}

public static NET_RECORDSET_ACCESS_CTL_CARD[] findNextCardV2(LLong m_lFindHandle,int nFindCount) {
// 用于申请内存
NET_RECORDSET_ACCESS_CTL_CARD[] pstRecord = new NET_RECORDSET_ACCESS_CTL_CARD[nFindCount];
for(int i = 0; i < nFindCount; i++) {
pstRecord[i] = new NET_RECORDSET_ACCESS_CTL_CARD();
}

/**
* CLIENT_FindNextRecord 接口入参
*/
NET_IN_FIND_NEXT_RECORD_PARAM stNextIn = new NET_IN_FIND_NEXT_RECORD_PARAM();
stNextIn.lFindeHandle = m_lFindHandle;
stNextIn.nFileCount = nFindCount; //想查询的记录条数

/**
* CLIENT_FindNextRecord 接口出参
*/
NET_OUT_FIND_NEXT_RECORD_PARAM stNextOut = new NET_OUT_FIND_NEXT_RECORD_PARAM();
stNextOut.nMaxRecordNum = nFindCount;
stNextOut.pRecordList = new Memory(pstRecord[0].dwSize * nFindCount); // 申请内存
stNextOut.pRecordList.clear(pstRecord[0].dwSize * nFindCount);

ToolKits.SetStructArrToPointerData(pstRecord, stNextOut.pRecordList); // 将数组内存拷贝给指针

if(LoginModule.netsdk.CLIENT_FindNextRecord(stNextIn, stNextOut, 5000)) {
if(stNextOut.nRetRecordNum == 0) {
return null;
}

ToolKits.GetPointerDataToStructArr(stNextOut.pRecordList, pstRecord); // 获取卡信息

// 获取有用的信息
NET_RECORDSET_ACCESS_CTL_CARD[] pstRecordEx = new NET_RECORDSET_ACCESS_CTL_CARD[stNextOut.nRetRecordNum];
for(int i = 0; i < stNextOut.nRetRecordNum; i++) {
pstRecordEx[i] = new NET_RECORDSET_ACCESS_CTL_CARD();
pstRecordEx[i] = pstRecord[i];
}

return pstRecordEx;
}

return null;
}

/**
* 关闭查询
*/


+ 3
- 2
src/main/java/com/yzx/impl/DaHua.java Прегледај датотеку

@@ -203,7 +203,7 @@ public class DaHua implements IHardwareEquipment {
return true;
}
}else{//添加
if(this.addUserCard(userFaceInfo) && this.updateUserFace(employeeNo,userFaceInfo.getImageBytes())){
if(this.addUserCard(userFaceInfo) && this.addUserFace(employeeNo,userFaceInfo.getImageBytes())){
return true;
}
}
@@ -260,6 +260,7 @@ public class DaHua implements IHardwareEquipment {
String endTime = userFaceInfo.getEndTime();
String cardNo = userFaceInfo.getCardNo();
boolean b = GateModule.insertCardV2(info.getLoginHandle(),cardNo, employeeNo, employeeName, "", 0, 0, 0, 0, 1, startTime, endTime);

return b;
}

@@ -293,7 +294,7 @@ public class DaHua implements IHardwareEquipment {

// 查询具体信息
while(true) {
NetSDKLib.NET_RECORDSET_ACCESS_CTL_CARD[] pstRecord = GateModule.findNextCard(nFindCount);
NetSDKLib.NET_RECORDSET_ACCESS_CTL_CARD[] pstRecord = GateModule.findNextCardV2(this.info.getFindHandle(),nFindCount);
if(pstRecord == null) {
break;
}


Loading…
Откажи
Сачувај