This commit is contained in:
2025-03-10 11:45:45 +08:00
parent 11255deebc
commit 708458df71
16 changed files with 669 additions and 640 deletions

View File

@ -12,6 +12,7 @@ import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.validation.annotation.Validated;
import java.time.LocalDate;
import java.util.Collection;
import java.util.List;
@ -87,6 +88,11 @@ public interface IWgzMessageService extends IServicePlus<WgzMessage> {
*/
WgzAppRegistrationInformationRes userRegistrationInformation(Long messageId);
/**
* 判断招工是否已招满或已过期
*/
String JudgingRecruitment(Long recruitId, int num, LocalDate recruitEndTime);
/**
* 修改已读未读状态
*/

View File

@ -160,16 +160,13 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
//3、根据工地id得到完整的工地信息
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
// //4、查看当前用户是否有请假申请有请假申请并且通过那就无法进行打卡------------------>此处代码将改写逻辑为每天凌晨1分的时候直接找出已请假的人然后定时插入数据到打卡记录中标记为请假
// String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// WgzLeave wgzLeave = iWgzLeaveService.FindAskForLeaveOrNotInfo(appUserId, by.getId(), formattedDate);
// if (wgzLeave != null) { //表示有请假申请
// LocalDateTime startTime = wgzLeave.getStartTime();
// LocalDate localDate = startTime.toLocalDate();
// throw new RuntimeException("您有已通过的请假申请,请假时间为:"+localDate);
// }
//4、在进场时间时才能打卡如果有退场记录就不允许打卡
if (by.getEntryTime() == null) {
throw new RuntimeException("需要进场才能实现打卡操作!");
}
if (by.getLeaveTime() != null) {
throw new RuntimeException("您已离场,无法进行打卡操作!");
}
//5、查看当前人、当前工地、当天的打卡记录
String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
WgzAttendance we = publicFindByUserIdWait(appUserId, by.getRecruitId(), formattedDate);

View File

@ -36,6 +36,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.wgz.bo.WgzMessageQueryBo;
import com.ruoyi.wgz.mapper.WgzMessageMapper;
import com.ruoyi.wgz.service.IWgzMessageService;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.*;
@ -228,14 +230,10 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
* @param recruitEndTime 招工结束时间
* @return
*/
@Override
public String JudgingRecruitment(Long recruitId,int num,LocalDate recruitEndTime) {
//使用数据库行级锁
int count = baseMapper.countRecruitApply(recruitId);
// int count = iBgtProjectRecruitApplyService.count(
// Wrappers.<BgtProjectRecruitApply>lambdaQuery()
// .eq(BgtProjectRecruitApply::getRecruitId, recruitId)
// .in(BgtProjectRecruitApply::getStatus, Arrays.asList("3", "4"))
// );
if(count == num){
return "1";
}