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 9696be8..29a6969 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 @@ -288,11 +288,6 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl(). - 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(). + eq(BgtProjectRecruitApply::getUserId, appUserId). + in(BgtProjectRecruitApply::getStatus, "3", "5") + ); if (i > 0) { throw new RuntimeException("已有工地!不可再次申请!"); } @@ -309,6 +309,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl(). 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"))) {