diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java index e045aaa..5fe64ec 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wgz/controller/WgzAppController.java @@ -577,7 +577,7 @@ public class WgzAppController { //2、根据唯一标识获取到当前用户的招工 BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId); //3、根据招工id获取到具体招工信息 - BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId()); + BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId()); Map mp = new HashMap<>(); mp.put("beginWorkTime", appById.getBeginWorkTime()); mp.put("endWorkTime", appById.getEndWorkTime()); diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index e753835..85fab86 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -28,7 +28,7 @@ captcha: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 9099 + port: 9098 servlet: # 应用的访问路径 context-path: /ruoyi diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java index b3b5a3e..b39c1ea 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/impl/BgtProjectRecruitApplyServiceImpl.java @@ -249,7 +249,11 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl list = Arrays.asList(byId.getTypeOfWork().split(",")); + if (!list.contains(appById.getTypeOfWork())){ throw new RuntimeException("工种不匹配!"); } //4、判断当前用户是否已经申请过了,如果已经申请过了,就不能再次申请了 @@ -263,6 +267,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl此处代码将改写逻辑为:每天凌晨1分的时候直接找出已请假的人然后定时插入数据到打卡记录中标记为请假 // String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); // WgzLeave wgzLeave = iWgzLeaveService.FindAskForLeaveOrNotInfo(appUserId, by.getId(), formattedDate); @@ -174,7 +174,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl 0; - }else{ - //7、获取上次打卡时间与这次打卡时间的间隔是否超过3分钟 + if (we !=null) { + //获取上次打卡时间与这次打卡时间的间隔是否超过3分钟 boolean flag = isMinutesDifferenceGreaterThanThree(we.getClockInTime(), now); if (!flag){ throw new RuntimeException("打卡时间间隔不能少于3分钟"); @@ -212,6 +203,15 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl 0; + }else{ + wgzAttendance.setClockInTime(now); + LocalTime beginWorkTime = appById.getBeginWorkTime(); //上班 + if (!localTime.isBefore(beginWorkTime)) { + wgzAttendance.setLate(1); //迟到 + wgzAttendance.setLateTime(now); + wgzAttendance.setExceptionType("1,"); + } + return baseMapper.insert(wgzAttendance) > 0; } } @@ -237,7 +237,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl(). eq(BgtUser::getUserId, appById.getUserId())