This commit is contained in:
zt
2025-05-27 09:19:19 +08:00
parent 1612bbaf5c
commit 51ce8f2cf4
3 changed files with 28 additions and 6 deletions

View File

@ -421,6 +421,17 @@
return AjaxResult.success(iBgtProjectRecruitService.userProjectDetails(id));
}
/**
* 【首页】【招工列表】 务工者是否进入工地
*/
@ApiOperation("【首页】【招工列表】 务工者是否进入工地")
@GetMapping("/userIsInTheSite")
public AjaxResult<Boolean> userIsInTheSite() {
return AjaxResult.success(iBgtProjectRecruitApplyService.userIsInTheSite(SecurityUtils.getAppUserId()));
}
/**
* 【首页】【招工列表】【项目详情】 项目详情·申请报名(还未校验工种是否匹配工地岗位)
*/

View File

@ -121,6 +121,11 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
*/
Boolean userApplyForRegistration(Long id);
/**
* 务工者是否进入工地
*/
Boolean userIsInTheSite(Long wgzUserId);
/**
* 同意申请
*/

View File

@ -419,12 +419,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
throw new RuntimeException("未查询到您的考试信息!");
}
//3-2、是否已有工地
Integer i = baseMapper.selectCount(
new LambdaQueryWrapper<BgtProjectRecruitApply>().
eq(BgtProjectRecruitApply::getUserId, appUserId).
in(BgtProjectRecruitApply::getStatus, "3", "5")
);
if (i > 0) {
if (userIsInTheSite(appUserId)) {
throw new RuntimeException("已有工地!不可再次申请!");
}
//3-3、是否重复申请同一工地先检查最后一次是否离场或取消如果是就还能再次申请这个项目否则无法申请
@ -490,6 +486,16 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
return false;
}
@Override
public Boolean userIsInTheSite(Long wgzUserId) {
Integer i = baseMapper.selectCount(
new LambdaQueryWrapper<BgtProjectRecruitApply>().
eq(BgtProjectRecruitApply::getUserId, wgzUserId).
in(BgtProjectRecruitApply::getStatus, "3", "5")
);
return i>0;
}
@Override
public TableDataInfo<BgtProjectRecruitApplyVO> userList(BgtAttendanceDayDTO dto) {
Page<BgtAttendanceDayDTO> queryDTOPage = new Page<>();