|
@@ -41,189 +41,6 @@ import javax.annotation.Resource;
|
|
|
*/
|
|
|
public final class EventSearch {
|
|
|
|
|
|
- static AdminUserService adminUserService =new AdminUserService() {
|
|
|
- @Override
|
|
|
- public Long createUser(UserSaveReqVO createReqVO) {
|
|
|
- return 0L;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateUser(UserSaveReqVO updateReqVO) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateUserLogin(Long id, String loginIp) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateUserProfile(Long id, UserProfileUpdateReqVO reqVO) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateUserPassword(Long id, UserProfileUpdatePasswordReqVO reqVO) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public String updateUserAvatar(Long id, InputStream avatarFile) throws Exception {
|
|
|
- return "";
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateUserPassword(Long id, String password) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateUserStatus(Long id, Integer status) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void deleteUser(Long id) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public AdminUserDO getUserByUsername(String username) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public AdminUserDO getUserByMobile(String mobile) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<AdminUserDO> getUserPage(UserPageReqVO reqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<AdminUserDO> getUserPage1(UserPageReqVO reqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<AdminUserDO> getUserPage0(UserPageReqVO reqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<AdminUserDO> getDeptTeacherPage(UserPageReqVO reqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<AdminUserDO> getDeptStudentPage(UserPageReqVO reqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<AdminUserDO> getDeptUser() {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<AdminUserDO> getGraduateStudentPage(UserPageReqVO reqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<AdminUserDO> getGraduateStudentTPage(UserPageReqVO reqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<AdminUserDO> getSupervisor() {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public AdminUserDO getUser(Long id) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<AdminUserDO> getUserListByDeptIds(Collection<Long> deptIds) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<AdminUserDO> getUserListByPostIds(Collection<Long> postIds) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<AdminUserDO> getUserList(Collection<Long> ids) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void validateUserList(Collection<Long> ids) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<AdminUserDO> getUserListByNickname(String nickname) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public UserImportRespVO importUserList(List<UserImportExcelVO> importUsers, boolean isUpdateSupport) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public List<AdminUserDO> getUserListByStatus(Integer status) {
|
|
|
- return Collections.emptyList();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public boolean isPasswordMatch(String rawPassword, String encodedPassword) {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public AdminUserDO findUserByUserNumber(String userNumber) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- static StudentAttendanceService studentAttendanceService = new StudentAttendanceService() {
|
|
|
- @Override
|
|
|
- public Integer createStudentAttendance(StudentAttendanceSaveReqVO createReqVO) {
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void updateStudentAttendance(StudentAttendanceSaveReqVO updateReqVO) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void deleteStudentAttendance(Integer id) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public StudentAttendanceDO getStudentAttendance(Integer id) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<StudentAttendanceDO> getStudentAttendancePage(StudentAttendancePageReqVO pageReqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public PageResult<StudentAttendanceDO> getStudentAttendanceErrorPage(StudentAttendancePageReqVO pageReqVO) {
|
|
|
- return null;
|
|
|
- }
|
|
|
- };
|
|
|
|
|
|
private static List<Object> studentAttendance =new ArrayList<>();
|
|
|
|
|
@@ -235,7 +52,7 @@ public final class EventSearch {
|
|
|
* @throws UnsupportedEncodingException
|
|
|
* @throws InterruptedException
|
|
|
*/
|
|
|
- public static List<Object> searchAllEvent(int lUserID) throws UnsupportedEncodingException, InterruptedException {
|
|
|
+ public static List<Object> searchAllEvent(int lUserID ,AdminUserService adminUserService,StudentAttendanceService studentAttendanceService) throws UnsupportedEncodingException, InterruptedException {
|
|
|
int i = 0; //事件条数
|
|
|
HCNetSDK.NET_DVR_ACS_EVENT_COND struAcsEventCond = new HCNetSDK.NET_DVR_ACS_EVENT_COND();
|
|
|
struAcsEventCond.read();
|
|
@@ -246,14 +63,14 @@ public final class EventSearch {
|
|
|
//开始时间
|
|
|
struAcsEventCond.struStartTime.dwYear = 2024;
|
|
|
struAcsEventCond.struStartTime.dwMonth = 10;
|
|
|
- struAcsEventCond.struStartTime.dwDay = 21;
|
|
|
+ struAcsEventCond.struStartTime.dwDay =22 ;
|
|
|
struAcsEventCond.struStartTime.dwHour = 0;
|
|
|
struAcsEventCond.struStartTime.dwMinute = 0;
|
|
|
struAcsEventCond.struStartTime.dwSecond = 0;
|
|
|
//结束时间
|
|
|
struAcsEventCond.struEndTime.dwYear = 2024;
|
|
|
struAcsEventCond.struEndTime.dwMonth = 10;
|
|
|
- struAcsEventCond.struEndTime.dwDay = 21;
|
|
|
+ struAcsEventCond.struEndTime.dwDay = 23;
|
|
|
struAcsEventCond.struEndTime.dwHour = 23;
|
|
|
struAcsEventCond.struEndTime.dwMinute = 59;
|
|
|
struAcsEventCond.struEndTime.dwSecond = 59;
|
|
@@ -321,28 +138,45 @@ public final class EventSearch {
|
|
|
if (struAcsEventCfg.struAcsEventInfo.dwEmployeeNo!=0){
|
|
|
employeeNo = String.valueOf(struAcsEventCfg.struAcsEventInfo.dwEmployeeNo);
|
|
|
}
|
|
|
+
|
|
|
StudentAttendanceDO attendance =new StudentAttendanceDO();
|
|
|
- if (employeeNo != null && !employeeNo.equals("0")) {
|
|
|
- AdminUserDO user = adminUserService.findUserByUserNumber(employeeNo);
|
|
|
- System.out.println("用户"+user);
|
|
|
- if (user != null) {
|
|
|
- attendance.setStudentName(user.getNickname());//昵称
|
|
|
- attendance.setStudentId(user.getId());//学生id
|
|
|
- attendance.setDeptId(user.getDeptId());//工作间id
|
|
|
- attendance.setSupervisorId(user.getSupervisorId());//导师id
|
|
|
- attendance.setClockInStatus(transformClockStatus(parsedTime));//打卡状态
|
|
|
- }else {
|
|
|
- System.out.println("没有找到该用户"+employeeNo);
|
|
|
- }
|
|
|
- }
|
|
|
- //插入
|
|
|
attendance.setClockInTime(parsedTime);//打卡时间
|
|
|
attendance.setUserNumber(employeeNo);//学号
|
|
|
|
|
|
- //插入考勤表
|
|
|
- //TODO没插入成功
|
|
|
- Integer id = studentAttendanceService.createStudentAttendance(BeanUtils.toBean(attendance, StudentAttendanceSaveReqVO.class));
|
|
|
- System.out.println(id);
|
|
|
+ List<StudentAttendanceDO> ST = studentAttendanceService.getStudentAttendanceByUserNumber(employeeNo);//获取这个学生的所有考勤记录
|
|
|
+
|
|
|
+ boolean exists = false; // 用于标识是否存在打卡记录
|
|
|
+
|
|
|
+ if (ST != null && !ST.isEmpty()) {
|
|
|
+ for (StudentAttendanceDO attendanceRecord : ST) {
|
|
|
+ if (attendanceRecord.getClockInTime().equals(parsedTime)) {
|
|
|
+ exists = true; // 如果存在相同的打卡时间,标记为存在
|
|
|
+ break; // 找到后直接跳出循环
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!exists) { // 如果不存在,则进行打卡记录的创建
|
|
|
+ if (employeeNo != null && !employeeNo.equals("0")) {
|
|
|
+ System.out.println("学号:" + employeeNo);
|
|
|
+ AdminUserDO user = adminUserService.findUserByUserNumber(employeeNo);
|
|
|
+ System.out.println("用户" + user);
|
|
|
+ if (user != null) {
|
|
|
+ attendance.setStudentName(user.getNickname()); // 昵称
|
|
|
+ attendance.setStudentId(user.getId()); // 学生id
|
|
|
+ attendance.setDeptId(user.getDeptId()); // 工作间id
|
|
|
+ attendance.setSupervisorId(user.getSupervisorId()); // 导师id
|
|
|
+ attendance.setClockInStatus(transformClockStatus(parsedTime)); // 打卡状态
|
|
|
+ // attendance.setCreateTime(parsedTime); // 创建时间
|
|
|
+ // attendance.setDeleted(false);
|
|
|
+ Integer id = studentAttendanceService.createStudentAttendance(BeanUtils.toBean(attendance, StudentAttendanceSaveReqVO.class));
|
|
|
+ System.out.println(id);
|
|
|
+ } else {
|
|
|
+ System.out.println("没有找到该用户" + employeeNo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ System.out.println("打卡记录已存在,无法进行重复打卡。");
|
|
|
+ }
|
|
|
studentAttendance.add(attendance);
|
|
|
|
|
|
//人脸图片保存
|