Commit 0d02a0e3b65a37fa1b563b6965b58505e0a4b7b9
1 parent
eae49103
Exists in
master
修改提交
Showing
7 changed files
with
126 additions
and
123 deletions
Show diff stats
cloud/dahua/src/main/java/com/example/dahua/MyTask.java
1 | package com.example.dahua; | 1 | package com.example.dahua; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
4 | +import com.alibaba.fastjson.JSONObject; | ||
4 | import com.example.dahua.bean.*; | 5 | import com.example.dahua.bean.*; |
5 | import com.example.dahua.dao.UserDao; | 6 | import com.example.dahua.dao.UserDao; |
6 | import com.example.dahua.enums.EnumDeviceType; | 7 | import com.example.dahua.enums.EnumDeviceType; |
@@ -409,84 +410,82 @@ public class MyTask implements ApplicationRunner { | @@ -409,84 +410,82 @@ public class MyTask implements ApplicationRunner { | ||
409 | String userId = new String(msg.szUserID).trim(); | 410 | String userId = new String(msg.szUserID).trim(); |
410 | //开门错误码 | 411 | //开门错误码 |
411 | int messageCode = msg.nErrorCode; | 412 | int messageCode = msg.nErrorCode; |
413 | + //刷卡结果,1表示成功, 0表示失败 | ||
414 | + int status = msg.bStatus; | ||
412 | //处理心跳 | 415 | //处理心跳 |
413 | saveAttendanceService(szSn,"",0,1); | 416 | saveAttendanceService(szSn,"",0,1); |
414 | String newCard = ""; | 417 | String newCard = ""; |
418 | + log.info("设备ID: 【{}】,上报卡号: 【{}】,状态: 【{}】,code: 【{}】",szSn,card,status,messageCode); | ||
419 | + if(StringUtils.isEmpty(card)) return -1; | ||
420 | + //关联设备信息 | ||
421 | + AttendanceBean attendance = myTaskUtil.userDao.getDeviceByDeviceId(szSn); | ||
422 | + if(Objects.isNull(attendance)) return -1; | ||
423 | + if(StringUtils.isEmpty(attendance.getSchool_id())) return -1; | ||
415 | try { | 424 | try { |
416 | - if (!StringUtils.isEmpty(card)) { | ||
417 | - //根据卡号获取卡身份信息 | ||
418 | - CardBean cardBean = myTaskUtil.userDao.getCards(card); | ||
419 | - if(cardBean ==null){ | ||
420 | - newCard = cardNo(card); | ||
421 | - cardBean = myTaskUtil.userDao.getCards(newCard); | ||
422 | - } | ||
423 | - if(cardBean ==null){ | ||
424 | - log.info("卡号有误!!设备ID: 【{}】,上报卡号: 【{}】",szSn,card); | ||
425 | - return -1; | ||
426 | - } | ||
427 | - // 缓存抓拍人脸 | ||
428 | - String fileName = StringUtils.isEmpty(userId) ? card + ".png" : userId + ".png"; | ||
429 | - String snapPicPath = path + "\\" + fileName; | ||
430 | - byte[] buffer = pBuffer.getByteArray(0, dwBufSize); | ||
431 | - ByteArrayInputStream byteArrInputGlobal = new ByteArrayInputStream(buffer); | ||
432 | - gateBufferedImage = ImageIO.read(byteArrInputGlobal); | ||
433 | - if (gateBufferedImage != null) { | ||
434 | - ImageIO.write(gateBufferedImage, "png", new File(snapPicPath)); | ||
435 | - } | ||
436 | - snapPicPath = snapPicPath.replaceFirst("\\.", "http://120.26.116.253:8080"); | ||
437 | - snapPicPath = snapPicPath.replace("FaceRecoder", "image"); | ||
438 | - //关联设备信息 | ||
439 | - AttendanceBean attendanceBean = myTaskUtil.userDao.getDeviceByDeviceId(szSn); | ||
440 | - if(attendanceBean !=null){ | ||
441 | - if(!StringUtils.isEmpty(attendanceBean.getSchool_id())){ | ||
442 | - int schoolId = Integer.parseInt(attendanceBean.getSchool_id()); | ||
443 | - String clintName = attendanceBean.getName(); | ||
444 | - //门禁进出类型:1进0出 | ||
445 | - int eventType = 0; | ||
446 | - if(StringUtils.isEmpty(attendanceBean.getOutOrIn())){ | ||
447 | - eventType = EnumSzBusinessType.EnumDeviceInAndOut.OUT.code; | ||
448 | - }else{ | ||
449 | - eventType = Integer.parseInt(attendanceBean.getOutOrIn()); | ||
450 | - } | ||
451 | - //刷卡时间 | ||
452 | - String eventTime = DateUtils.date2String(new Date(), DateUtils.format2); | ||
453 | - //老师 | ||
454 | - TeacherBean teacherBean = null; | ||
455 | - if (cardBean.getType() == 0) { | ||
456 | - //老师人脸信息,保存人脸记录表 | ||
457 | - teacherBean = myTaskUtil.userDao.getTeacherWithId(cardBean.getUser_id()); | ||
458 | - myTaskUtil.sendRecordDao.addFaceRecoder(szSn, teacherBean.getUser_id(), teacherBean.getName(), snapPicPath,eventType, | ||
459 | - eventTime, card,messageCode ==20?EnumSendFaceType.TIME_INTERVAL_ERROR.message:"",schoolId); | ||
460 | - } | ||
461 | - UserInfoBean userInfoBean = null; | ||
462 | - if (cardBean.getType() == 2) { | ||
463 | - //学生人脸信息,保存人脸记录表 | ||
464 | - userInfoBean = myTaskUtil.userDao.getStudentWithid(cardBean.getUser_id()); | ||
465 | - myTaskUtil.sendRecordDao.addFaceRecoder(szSn, userInfoBean.getUser_id(), userInfoBean.getName(), snapPicPath,eventType, | ||
466 | - eventTime, card,messageCode ==20?EnumSendFaceType.TIME_INTERVAL_ERROR.message:"",schoolId); | ||
467 | - } | ||
468 | - //刷卡结果,1表示成功, 0表示失败 | ||
469 | - int status = msg.bStatus; | ||
470 | - String result = status == 1 ? "开门成功" : "开门失败"; | ||
471 | - String openMsg = eventType ==1 ? "进" : "出" ; | ||
472 | - if(szSn.startsWith("ytj")) { | ||
473 | - log.info("出入信息:学校【{}】,开门方向:【{}】",schoolId,status); | ||
474 | - // 艺校考勤OA | ||
475 | - if(schoolId == 12 && status ==1){ | ||
476 | - int intOrOut = eventType ==1 ? 1 : 2; | ||
477 | - if(userInfoBean !=null){ | ||
478 | - log.info("【{}】出入信息:方向【{}】,开门结果【{}】",userInfoBean.getName(),openMsg,result); | ||
479 | - sendRecordToSXYX(userInfoBean.getName(),userInfoBean.getUser_id(),intOrOut,eventTime,""); | ||
480 | - } | ||
481 | - if(teacherBean != null){ | ||
482 | - sendRecordToSXYX(teacherBean.getName(),teacherBean.getUser_id(),intOrOut,eventTime,getScene(clintName)); | ||
483 | - } | ||
484 | - }else{ | ||
485 | - //保存考勤记录 | ||
486 | - kaoQinRecord(status, eventType, card, szSn, eventTime,lAnalyzerHandle); | ||
487 | - } | ||
488 | - } | 425 | + //根据卡号获取卡身份信息 |
426 | + CardBean cardBean = myTaskUtil.userDao.getCards(card); | ||
427 | + if(cardBean ==null){ | ||
428 | + newCard = cardNo(card); | ||
429 | + cardBean = myTaskUtil.userDao.getCards(newCard); | ||
430 | + } | ||
431 | + if(cardBean ==null){ | ||
432 | + log.info("卡号有误!!设备ID: 【{}】,上报卡号: 【{}】",szSn,card); | ||
433 | + return -1; | ||
434 | + } | ||
435 | + // 缓存抓拍人脸 | ||
436 | + String fileName = StringUtils.isEmpty(userId) ? card + ".png" : userId + ".png"; | ||
437 | + String snapPicPath = path + "\\" + fileName; | ||
438 | + byte[] buffer = pBuffer.getByteArray(0, dwBufSize); | ||
439 | + ByteArrayInputStream byteArrInputGlobal = new ByteArrayInputStream(buffer); | ||
440 | + gateBufferedImage = ImageIO.read(byteArrInputGlobal); | ||
441 | + if (gateBufferedImage != null) { | ||
442 | + ImageIO.write(gateBufferedImage, "png", new File(snapPicPath)); | ||
443 | + } | ||
444 | + snapPicPath = snapPicPath.replaceFirst("\\.", "http://120.26.116.253:8080"); | ||
445 | + snapPicPath = snapPicPath.replace("FaceRecoder", "image"); | ||
446 | + | ||
447 | + int schoolId = Integer.parseInt(attendance.getSchool_id()); | ||
448 | + String clintName = attendance.getName(); | ||
449 | + //门禁进出类型:1进0出 | ||
450 | + int eventType = 0; | ||
451 | + if(StringUtils.isEmpty(attendance.getOutOrIn())){ | ||
452 | + eventType = EnumSzBusinessType.EnumDeviceInAndOut.OUT.code; | ||
453 | + }else{ | ||
454 | + eventType = Integer.parseInt(attendance.getOutOrIn()); | ||
455 | + } | ||
456 | + //刷卡时间 | ||
457 | + String eventTime = DateUtils.date2String(new Date(), DateUtils.format2); | ||
458 | + //老师 | ||
459 | + TeacherBean teacherBean = null; | ||
460 | + if (cardBean.getType() == 0) { | ||
461 | + //老师人脸信息,保存人脸记录表 | ||
462 | + teacherBean = myTaskUtil.userDao.getTeacherWithId(cardBean.getUser_id()); | ||
463 | + myTaskUtil.sendRecordDao.addFaceRecoder(szSn, teacherBean.getUser_id(), teacherBean.getName(), snapPicPath,eventType, | ||
464 | + eventTime, card,messageCode ==20?EnumSendFaceType.TIME_INTERVAL_ERROR.message:"",schoolId); | ||
465 | + } | ||
466 | + UserInfoBean userInfoBean = null; | ||
467 | + if (cardBean.getType() == 2) { | ||
468 | + //学生人脸信息,保存人脸记录表 | ||
469 | + userInfoBean = myTaskUtil.userDao.getStudentWithid(cardBean.getUser_id()); | ||
470 | + myTaskUtil.sendRecordDao.addFaceRecoder(szSn, userInfoBean.getUser_id(), userInfoBean.getName(), snapPicPath,eventType, | ||
471 | + eventTime, card,messageCode ==20?EnumSendFaceType.TIME_INTERVAL_ERROR.message:"",schoolId); | ||
472 | + } | ||
473 | + String result = status == 1 ? "开门成功" : "开门失败"; | ||
474 | + String openMsg = eventType ==1 ? "进" : "出" ; | ||
475 | + if(szSn.contains("ytj")) { | ||
476 | + // 艺校考勤OA | ||
477 | + if(schoolId == 12 && status ==1){ | ||
478 | + int intOrOut = eventType ==1 ? 1 : 2; | ||
479 | + if(userInfoBean !=null){ | ||
480 | + log.info("【{}】出入信息:方向【{}】,开门结果【{}】",userInfoBean.getName(),openMsg,result); | ||
481 | + sendRecordToSXYX(userInfoBean.getName(),userInfoBean.getUser_id(),intOrOut,eventTime,""); | ||
489 | } | 482 | } |
483 | + if(teacherBean != null){ | ||
484 | + sendRecordToSXYX(teacherBean.getName(),teacherBean.getUser_id(),intOrOut,eventTime,getScene(clintName)); | ||
485 | + } | ||
486 | + }else{ | ||
487 | + //保存考勤记录 | ||
488 | + kaoQinRecord(status, eventType, card, szSn, eventTime,lAnalyzerHandle); | ||
490 | } | 489 | } |
491 | } | 490 | } |
492 | } catch (IOException e2) { | 491 | } catch (IOException e2) { |
@@ -629,6 +628,10 @@ public class MyTask implements ApplicationRunner { | @@ -629,6 +628,10 @@ public class MyTask implements ApplicationRunner { | ||
629 | 628 | ||
630 | } | 629 | } |
631 | 630 | ||
631 | + public static void main(String[] args) { | ||
632 | + System.out.println(cardNo("45318FBE")); | ||
633 | + } | ||
634 | + | ||
632 | private static MqttManager mqttManager; | 635 | private static MqttManager mqttManager; |
633 | /** | 636 | /** |
634 | * 大华设备考勤记录 | 637 | * 大华设备考勤记录 |
@@ -648,15 +651,12 @@ public class MyTask implements ApplicationRunner { | @@ -648,15 +651,12 @@ public class MyTask implements ApplicationRunner { | ||
648 | checkIn.setFlag(eventType == EnumSzBusinessType.EnumDeviceInAndOut.INT.code ? 0:1); | 651 | checkIn.setFlag(eventType == EnumSzBusinessType.EnumDeviceInAndOut.INT.code ? 0:1); |
649 | checkIn.setCheckTime(eventTime); | 652 | checkIn.setCheckTime(eventTime); |
650 | myTaskUtil.searchMapper.checkIn(checkIn); | 653 | myTaskUtil.searchMapper.checkIn(checkIn); |
651 | - | ||
652 | if (checkIn.getIsSuccess() == 1) { | 654 | if (checkIn.getIsSuccess() == 1) { |
653 | log.info("考勤成功: checkIn: {}, 方向:{}",JsonUtils.nonDefaultMapper().toJson(checkIn),eventType == 1 ? "进门" : "出门"); | 655 | log.info("考勤成功: checkIn: {}, 方向:{}",JsonUtils.nonDefaultMapper().toJson(checkIn),eventType == 1 ? "进门" : "出门"); |
654 | //考勤成功 | 656 | //考勤成功 |
655 | String content = "考勤成功!,设备:" + deviceId + "卡号:" + cardNo + "方向:" + (eventType == 1 ? "进门" : "出门") + "______" + eventTime; | 657 | String content = "考勤成功!,设备:" + deviceId + "卡号:" + cardNo + "方向:" + (eventType == 1 ? "进门" : "出门") + "______" + eventTime; |
656 | - | ||
657 | // //开始推送看板 | 658 | // //开始推送看板 |
658 | // sendMQMess(deviceId,cardNo,eventType); | 659 | // sendMQMess(deviceId,cardNo,eventType); |
659 | - | ||
660 | //记录学生考勤签到记录 | 660 | //记录学生考勤签到记录 |
661 | FileUtils.getInstance().writeLogs(content, FileUtils.qiandaoSuccess); | 661 | FileUtils.getInstance().writeLogs(content, FileUtils.qiandaoSuccess); |
662 | } else { | 662 | } else { |
cloud/dahua/src/main/java/com/example/dahua/dao/UserDao.java
@@ -14,7 +14,7 @@ public interface UserDao { | @@ -14,7 +14,7 @@ public interface UserDao { | ||
14 | @Select("select clint_id from SZ_Attendance where school_id = #{schoolId} and clint_type = 29") | 14 | @Select("select clint_id from SZ_Attendance where school_id = #{schoolId} and clint_type = 29") |
15 | List<String> selectDeviceBySchoolId(@Param("schoolId") Integer schoolId); | 15 | List<String> selectDeviceBySchoolId(@Param("schoolId") Integer schoolId); |
16 | 16 | ||
17 | - @Select("select clint_id from SZ_Attendance where clint_id = #{clintId}") | 17 | + @Select("select * from SZ_Attendance where clint_id = #{clintId}") |
18 | AttendanceBean getDeviceByDeviceId(@Param("clintId") String clintId); | 18 | AttendanceBean getDeviceByDeviceId(@Param("clintId") String clintId); |
19 | 19 | ||
20 | @Select("select clint_type from SZ_Attendance where clint_id = #{deviceId}") | 20 | @Select("select clint_type from SZ_Attendance where clint_id = #{deviceId}") |
cloud/dahua/src/main/resources/logback-spring.xml
@@ -9,9 +9,9 @@ | @@ -9,9 +9,9 @@ | ||
9 | 9 | ||
10 | <!--日志文件存储的基础路径: ${user.home} 为当前服务器用户主目录--> | 10 | <!--日志文件存储的基础路径: ${user.home} 为当前服务器用户主目录--> |
11 | <!--100--> | 11 | <!--100--> |
12 | -<!-- <property name="LOG_PATH" value="D:\dahua\logs"/>--> | 12 | + <property name="LOG_PATH" value="E:\dahua\logs"/> |
13 | <!--137--> | 13 | <!--137--> |
14 | - <property name="LOG_PATH" value="C:\\workspace\\dahua\\logs"/> | 14 | +<!-- <property name="LOG_PATH" value="C:\\workspace\\dahua\\logs"/>--> |
15 | 15 | ||
16 | <!--日志文件基础名称--> | 16 | <!--日志文件基础名称--> |
17 | <property name="BASE_FILE_NAME" value="dahua"/> | 17 | <property name="BASE_FILE_NAME" value="dahua"/> |
cloud/haikangface/src/main/java/com/sincere/haikangface/service/impl/BaseService.java
@@ -29,6 +29,7 @@ import java.io.FileOutputStream; | @@ -29,6 +29,7 @@ import java.io.FileOutputStream; | ||
29 | import java.io.IOException; | 29 | import java.io.IOException; |
30 | import java.text.SimpleDateFormat; | 30 | import java.text.SimpleDateFormat; |
31 | import java.util.*; | 31 | import java.util.*; |
32 | +import java.util.function.Function; | ||
32 | import java.util.stream.Collectors; | 33 | import java.util.stream.Collectors; |
33 | 34 | ||
34 | /** | 35 | /** |
@@ -481,11 +482,13 @@ public class BaseService { | @@ -481,11 +482,13 @@ public class BaseService { | ||
481 | * @return | 482 | * @return |
482 | */ | 483 | */ |
483 | public List<SendRecordBean> getSendRecordList(SendFaceBean faceBean) { | 484 | public List<SendRecordBean> getSendRecordList(SendFaceBean faceBean) { |
484 | - List<SendRecordBean> students = sendRecordDao.getSendRecordList(faceBean.getSchoolId(),faceBean.getDeviceList(),faceBean.getStatus()); | ||
485 | - //去重重复数据 | ||
486 | - List<SendRecordBean> studentList = students.stream().collect(Collectors.collectingAndThen( | ||
487 | - Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(SendRecordBean::getNum))),ArrayList::new)); | ||
488 | - return studentList; | 485 | + List<SendRecordBean> students = sendRecordDao |
486 | + .getSendRecordList(faceBean.getSchoolId(),faceBean.getDeviceList(),faceBean.getStatus()); | ||
487 | + students = students.parallelStream() | ||
488 | + .collect(Collectors.toMap(t-> Arrays.asList(t.getSchoolId(), t.getNum(),t.getDeviceID()), | ||
489 | + Function.identity(),(oldValue, newValue) -> oldValue)) | ||
490 | + .values().stream().collect(Collectors.toList()); | ||
491 | + return students; | ||
489 | } | 492 | } |
490 | 493 | ||
491 | 494 | ||
@@ -566,7 +569,7 @@ public class BaseService { | @@ -566,7 +569,7 @@ public class BaseService { | ||
566 | return deviceDao.selectDeviceBySchoolId(schoolId); | 569 | return deviceDao.selectDeviceBySchoolId(schoolId); |
567 | } | 570 | } |
568 | 571 | ||
569 | - public String checkUserFace(StudentBean studentBean,Integer userType,Integer schoolId){ | 572 | + public String checkUserFace(StudentBean studentBean,Integer userType,Integer schoolId){ |
570 | String cardNum = userType.intValue()==1 ? studentBean.getTeacher_num():studentBean.getStudent_num(); | 573 | String cardNum = userType.intValue()==1 ? studentBean.getTeacher_num():studentBean.getStudent_num(); |
571 | String photo = userType.intValue()==1?studentBean.getFace():studentBean.getPhoto(); | 574 | String photo = userType.intValue()==1?studentBean.getFace():studentBean.getPhoto(); |
572 | if (StringUtils.isBlank(photo) || StringUtils.isBlank(cardNum)) return null; | 575 | if (StringUtils.isBlank(photo) || StringUtils.isBlank(cardNum)) return null; |
@@ -627,11 +630,11 @@ public class BaseService { | @@ -627,11 +630,11 @@ public class BaseService { | ||
627 | } | 630 | } |
628 | 631 | ||
629 | public boolean checkSendRecord(List<SendRecordBean> sendRecords,String sno,Integer schoolId,String cardNum){ | 632 | public boolean checkSendRecord(List<SendRecordBean> sendRecords,String sno,Integer schoolId,String cardNum){ |
630 | - SendRecordBean record = sendRecords.stream().filter(s->Objects.equals(s.getDeviceID(),sno) && | 633 | + List<SendRecordBean> records = sendRecords.stream().filter(s->Objects.equals(s.getDeviceID(),sno) && |
631 | Objects.equals(s.getStatus(),1) && Objects.equals(s.getSchoolId(),schoolId) && | 634 | Objects.equals(s.getStatus(),1) && Objects.equals(s.getSchoolId(),schoolId) && |
632 | - Objects.equals(s.getNum(),cardNum)).findFirst().orElse(null); | ||
633 | - if(Objects.nonNull(record)) return true; | ||
634 | - return false; | 635 | + Objects.equals(s.getNum(),cardNum)).collect(Collectors.toList()); |
636 | + if(CollectionUtils.isEmpty(records)) return false; | ||
637 | + return true; | ||
635 | } | 638 | } |
636 | 639 | ||
637 | public void deleteCardFace(Integer schoolId,String deviceId,String cardNo) { | 640 | public void deleteCardFace(Integer schoolId,String deviceId,String cardNo) { |
cloud/haikangface/src/main/java/com/sincere/haikangface/service/impl/UserOperateServiceImpl.java
@@ -326,42 +326,41 @@ public class UserOperateServiceImpl implements UserOperateService { | @@ -326,42 +326,41 @@ public class UserOperateServiceImpl implements UserOperateService { | ||
326 | public void sendFaceForNoSend(SendFaceBean faceBean,List<StudentBean> studentList,List<String> deviceIds){ | 326 | public void sendFaceForNoSend(SendFaceBean faceBean,List<StudentBean> studentList,List<String> deviceIds){ |
327 | log.info("统计学校共有:"+studentList.size()+"张卡,"+deviceIds.size()+"台设备." ); | 327 | log.info("统计学校共有:"+studentList.size()+"张卡,"+deviceIds.size()+"台设备." ); |
328 | List<SendRecordBean> sendRecords = baseService.getSendRecordList(faceBean); | 328 | List<SendRecordBean> sendRecords = baseService.getSendRecordList(faceBean); |
329 | - List<SendRecordBean> list = sendRecords.parallelStream() | ||
330 | - .collect(Collectors.toMap(t-> Arrays.asList(t.getSchoolId(),t.getNum(),t.getDeviceID()), | ||
331 | - Function.identity(),(oldValue, newValue) -> oldValue)) | ||
332 | - .values().stream().collect(Collectors.toList()); | ||
333 | - studentList.stream().forEach(s->{ | ||
334 | - String userName = s.getName(); | ||
335 | - String studentCode = s.getStudentCode(); | ||
336 | - String studentNum = s.getStudent_num(); | ||
337 | - String filePath = baseService.checkUserFace(s, faceBean.getUserType(), faceBean.getSchoolId()); | ||
338 | - if(StringUtils.isBlank(filePath)) return; | ||
339 | - File file = new File(filePath); | ||
340 | - if(!file.exists()) return; | ||
341 | - String targetPath = FileUtils.picPathComp + file.getName(); | ||
342 | - try { | ||
343 | - CompressPic.CompressPic(file.getAbsolutePath(), targetPath); | ||
344 | - } catch (Exception e) { | ||
345 | - log.error("压缩图片失败:",e); | ||
346 | - return; | ||
347 | - } | ||
348 | - for(String sno : deviceIds){ | 329 | + for(String sno : deviceIds){ |
330 | + studentList.stream().forEach(s->{ | ||
349 | try{ | 331 | try{ |
350 | - if(baseService.checkSendRecord(list,sno, faceBean.getSchoolId(), studentNum)) continue; | 332 | + String userName = s.getName(); |
333 | + String studentCode = s.getStudentCode(); | ||
334 | + String studentNum = s.getStudent_num(); | ||
335 | + String filePath = baseService.checkUserFace(s, faceBean.getUserType(), faceBean.getSchoolId()); | ||
336 | + if(StringUtils.isBlank(filePath)) return; | ||
337 | + File file = new File(filePath); | ||
338 | + if(!file.exists()) return; | ||
339 | + String targetPath = FileUtils.picPathComp + file.getName(); | ||
340 | + try { | ||
341 | + CompressPic.CompressPic(file.getAbsolutePath(), targetPath); | ||
342 | + } catch (Exception e) { | ||
343 | + log.error("压缩图片失败:",e); | ||
344 | + return; | ||
345 | + } | ||
346 | + if(baseService.checkSendRecord(sendRecords,sno, faceBean.getSchoolId(), studentNum)) { | ||
347 | + return; | ||
348 | + } | ||
351 | Integer clintType = userDao.getClintTypeByDeviceId(sno); | 349 | Integer clintType = userDao.getClintTypeByDeviceId(sno); |
352 | - if(clintType.intValue()== 18 || clintType.intValue()== 28) | 350 | + if(clintType.intValue()== 22 || clintType.intValue()== 29){ |
353 | HttpUtil.uploadDHImgForOne(filePath, faceBean.getSchoolId(), studentCode,sno); | 351 | HttpUtil.uploadDHImgForOne(filePath, faceBean.getSchoolId(), studentCode,sno); |
354 | - | ||
355 | - if(clintType.intValue()== 22 || clintType.intValue()== 29) | 352 | + } |
353 | + if(clintType.intValue()== 18 || clintType.intValue()== 28){ | ||
356 | baseService.sendImg(file.getAbsolutePath(), targetPath, sno, studentNum, userName, | 354 | baseService.sendImg(file.getAbsolutePath(), targetPath, sno, studentNum, userName, |
357 | String.valueOf(faceBean.getUserType()), faceBean.getSchoolId()); | 355 | String.valueOf(faceBean.getUserType()), faceBean.getSchoolId()); |
356 | + } | ||
358 | }catch (Exception e){ | 357 | }catch (Exception e){ |
359 | - log.error("人脸下发失败"); | 358 | + log.error("人脸下发失败,{}",e); |
360 | e.printStackTrace(); | 359 | e.printStackTrace(); |
361 | - continue; | 360 | + return; |
362 | } | 361 | } |
363 | - } | ||
364 | - }); | 362 | + }); |
363 | + } | ||
365 | } | 364 | } |
366 | 365 | ||
367 | @Override | 366 | @Override |
@@ -466,7 +465,7 @@ public class UserOperateServiceImpl implements UserOperateService { | @@ -466,7 +465,7 @@ public class UserOperateServiceImpl implements UserOperateService { | ||
466 | //下发设备集合 | 465 | //下发设备集合 |
467 | List<String> deviceList = baseService.getDeviceList(faceBean.getDeviceIds(),faceBean.getSchoolId()); | 466 | List<String> deviceList = baseService.getDeviceList(faceBean.getDeviceIds(),faceBean.getSchoolId()); |
468 | //根据类型获取下发用户信息 | 467 | //根据类型获取下发用户信息 |
469 | - List<StudentBean> studentBeans = Objects.equals(faceBean.getUserType(),EnumSzBusinessType.EnumUserType.TEACHER.code) ? | 468 | + List<StudentBean> studentBeans = !Objects.equals(faceBean.getUserType(),EnumSzBusinessType.EnumUserType.TEACHER.code) ? |
470 | baseService.getStudentByClassId(faceBean) : baseService.getTeacherList(faceBean.getSchoolId()); | 469 | baseService.getStudentByClassId(faceBean) : baseService.getTeacherList(faceBean.getSchoolId()); |
471 | //异步执行下发 | 470 | //异步执行下发 |
472 | this.sendFaceForNoSend(faceBean,studentBeans,deviceList); | 471 | this.sendFaceForNoSend(faceBean,studentBeans,deviceList); |
cloud/haikangface/src/main/resources/logback-spring.xml
@@ -8,7 +8,8 @@ | @@ -8,7 +8,8 @@ | ||
8 | <!--<include resource="org/springframework/boot/logging/logback/defaults.xml" />--> | 8 | <!--<include resource="org/springframework/boot/logging/logback/defaults.xml" />--> |
9 | 9 | ||
10 | <!--日志文件存储的基础路径: ${user.home} 为当前服务器用户主目录--> | 10 | <!--日志文件存储的基础路径: ${user.home} 为当前服务器用户主目录--> |
11 | - <property name="LOG_PATH" value="D:/haikang/haikang-logs"/> | 11 | + <property name="LOG_PATH" value="E:/haikang/haikang-logs"/> |
12 | +<!-- <property name="LOG_PATH" value="D:/haikang/haikang-logs"/>--> | ||
12 | 13 | ||
13 | <!--日志文件基础名称--> | 14 | <!--日志文件基础名称--> |
14 | <property name="BASE_FILE_NAME" value="haikang"/> | 15 | <property name="BASE_FILE_NAME" value="haikang"/> |
cloud/pom.xml
@@ -25,13 +25,13 @@ | @@ -25,13 +25,13 @@ | ||
25 | </properties> | 25 | </properties> |
26 | 26 | ||
27 | <modules> | 27 | <modules> |
28 | - <module>server1</module> | ||
29 | - <module>server2</module> | 28 | +<!-- <module>server1</module>--> |
29 | +<!-- <module>server2</module>--> | ||
30 | <!-- <module>autho</module>--> | 30 | <!-- <module>autho</module>--> |
31 | <module>common</module> | 31 | <module>common</module> |
32 | <module>dahua</module> | 32 | <module>dahua</module> |
33 | <module>haikangface</module> | 33 | <module>haikangface</module> |
34 | - <module>quartz</module> | 34 | +<!-- <module>quartz</module>--> |
35 | <!-- <module>getaway</module>--> | 35 | <!-- <module>getaway</module>--> |
36 | <!-- <module>haikang</module>--> | 36 | <!-- <module>haikang</module>--> |
37 | <!-- <module>consumer</module>--> | 37 | <!-- <module>consumer</module>--> |
@@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
43 | <!-- <module>independence</module>--> | 43 | <!-- <module>independence</module>--> |
44 | <!-- <module>zkAttendance</module>--> | 44 | <!-- <module>zkAttendance</module>--> |
45 | <!-- <module>user_search</module>--> | 45 | <!-- <module>user_search</module>--> |
46 | - <module>fIle-center</module> | 46 | +<!-- <module>fIle-center</module>--> |
47 | <!-- <module>RibbonConsume</module>--> | 47 | <!-- <module>RibbonConsume</module>--> |
48 | </modules> | 48 | </modules> |
49 | 49 |