Commit ff74650af6de1074f06c6cb64ae649f61f240a12

Authored by 邱一成
1 parent 95a1875c
Exists in master

优化内存问题

cloud/dahua/src/main/java/com/example/dahua/MyTask.java
... ... @@ -256,7 +256,7 @@ public class MyTask implements ApplicationRunner {
256 256 NetSDKLib.LLong lLong = GateModule.realLoadPic2(0, analyzerCallback, lLongMap.get(dev.getDevcieId()),dev.getDevcieId());
257 257 System.out.println("监听成功:"+dev.getDevcieId());
258 258 if (lLong.intValue() != -1) {
259   - it.remove();
  259 + //it.remove();
260 260 }
261 261 }
262 262 }
... ... @@ -322,7 +322,7 @@ public class MyTask implements ApplicationRunner {
322 322 if (gateBufferedImage != null) {
323 323 ImageIO.write(gateBufferedImage, "png", new File(snapPicPath));
324 324 }
325   - log.info("设备ID: {},卡号: {},抓拍照片存储地址:{}" ,szSn,card,snapPicPath);
  325 +
326 326 //验证设备id是否存在特殊字符
327 327 if(isMatch(REGEX_POSITIVE_Symbol, szSn)){
328 328 log.info("—设备ID异常: {},卡号: {}",szSn,card);
... ... @@ -342,6 +342,7 @@ public class MyTask implements ApplicationRunner {
342 342 } else{
343 343 card = cardNo(card);
344 344 }
  345 + log.info("设备ID: {},卡号: {},抓拍照片存储地址:{}" ,szSn,card,snapPicPath);
345 346 //根据卡号获取卡身份信息
346 347 CardBean cardBean = userDao.getCards(card);
347 348 String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
... ... @@ -415,7 +416,7 @@ public class MyTask implements ApplicationRunner {
415 416  
416 417 }
417 418 public final static String REGEX_POSITIVE_INTEGER = "^\\+?[1-9]\\d*$";
418   - public final static String REGEX_POSITIVE_Symbol = "\\\":?!.";
  419 + public final static String REGEX_POSITIVE_Symbol = ",,:?!.";
419 420 private boolean isMatch(String regex, String orginal) {
420 421 if (orginal == null || orginal.trim().equals("")) { //$NON-NLS-1$
421 422 return false;
... ...
cloud/dahua/src/main/java/com/example/dahua/module/GateModule.java
... ... @@ -714,7 +714,7 @@ public class GateModule {
714 714 /**
715 715 * 门禁卡记录集信息
716 716 */
717   -// NET_RECORDSET_ACCESS_CTL_CARD accessCardInfo = new NET_RECORDSET_ACCESS_CTL_CARD();
  717 + accessCardInfo = new NET_RECORDSET_ACCESS_CTL_CARD();
718 718 // 记录集编号, 修改、删除卡信息必须填写
719 719 accessCardInfo.nRecNo = recordNo;
720 720  
... ... @@ -784,7 +784,7 @@ public class GateModule {
784 784 /**
785 785 * 记录集操作
786 786 */
787   -// NET_CTRL_RECORDSET_PARAM update = new NET_CTRL_RECORDSET_PARAM();
  787 + update = new NET_CTRL_RECORDSET_PARAM();
788 788  
789 789 update.emType = EM_NET_RECORD_TYPE.NET_RECORD_ACCESSCTLCARD; // 记录集信息类型
790 790 update.pBuf = accessCardInfo.getPointer();
... ...