| @@ -1038,7 +1038,51 @@ public class GateModule { | |||||
| return null; | 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; | |||||
| } | |||||
| /** | /** | ||||
| * 关闭查询 | * 关闭查询 | ||||
| */ | */ | ||||
| @@ -203,7 +203,7 @@ public class DaHua implements IHardwareEquipment { | |||||
| return true; | return true; | ||||
| } | } | ||||
| }else{//添加 | }else{//添加 | ||||
| if(this.addUserCard(userFaceInfo) && this.updateUserFace(employeeNo,userFaceInfo.getImageBytes())){ | |||||
| if(this.addUserCard(userFaceInfo) && this.addUserFace(employeeNo,userFaceInfo.getImageBytes())){ | |||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| @@ -260,6 +260,7 @@ public class DaHua implements IHardwareEquipment { | |||||
| String endTime = userFaceInfo.getEndTime(); | String endTime = userFaceInfo.getEndTime(); | ||||
| String cardNo = userFaceInfo.getCardNo(); | String cardNo = userFaceInfo.getCardNo(); | ||||
| boolean b = GateModule.insertCardV2(info.getLoginHandle(),cardNo, employeeNo, employeeName, "", 0, 0, 0, 0, 1, startTime, endTime); | boolean b = GateModule.insertCardV2(info.getLoginHandle(),cardNo, employeeNo, employeeName, "", 0, 0, 0, 0, 1, startTime, endTime); | ||||
| return b; | return b; | ||||
| } | } | ||||
| @@ -293,7 +294,7 @@ public class DaHua implements IHardwareEquipment { | |||||
| // 查询具体信息 | // 查询具体信息 | ||||
| while(true) { | 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) { | if(pstRecord == null) { | ||||
| break; | break; | ||||
| } | } | ||||