优化
This commit is contained in:
		@ -288,11 +288,6 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
		//2、当前申请报名的工地信息
 | 
			
		||||
		BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(id);
 | 
			
		||||
		//3、检查当前用户是否实名认证
 | 
			
		||||
		Integer i = baseMapper.selectCount(
 | 
			
		||||
			new LambdaQueryWrapper<BgtProjectRecruitApply>().
 | 
			
		||||
				eq(BgtProjectRecruitApply::getUserId, appUserId).
 | 
			
		||||
				in(BgtProjectRecruitApply::getStatus, "3", "5")
 | 
			
		||||
		);
 | 
			
		||||
		WgzUser byId = wgzUserService.findByUserId(appUserId);
 | 
			
		||||
		if (byId == null) {
 | 
			
		||||
			throw new RuntimeException("查询不到用户信息!");
 | 
			
		||||
@ -301,6 +296,11 @@ 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) {
 | 
			
		||||
			throw new RuntimeException("已有工地!不可再次申请!");
 | 
			
		||||
		}
 | 
			
		||||
@ -309,6 +309,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
			new LambdaQueryWrapper<BgtProjectRecruitApply>().
 | 
			
		||||
				eq(BgtProjectRecruitApply::getUserId, appUserId).
 | 
			
		||||
				eq(BgtProjectRecruitApply::getRecruitId, id).
 | 
			
		||||
				orderByDesc(BgtProjectRecruitApply::getId).
 | 
			
		||||
				last("limit 1")
 | 
			
		||||
		);
 | 
			
		||||
		if (oneApply!=null && !(oneApply.getStatus().equals("6") || oneApply.getStatus().equals("7"))) {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user