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 8bcf7fd..32300c6 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 @@ -336,6 +336,16 @@ public class WgzAppController { return AjaxResult.success(iBgtProjectRecruitApplyService.userApplyForRegistration(id)); } + /** + * 【首页】【项目详情】 项目详情·确认|拒绝报名 + */ + @ApiOperation("【首页】【项目详情】 项目详情·确认|拒绝报名)") + //@PreAuthorize("@ss.hasPermi('wgzApp:user:userConfirmRegistration')") + @GetMapping("/WgzAppUserConfirmRegistration/{id}") + public AjaxResult userConfirmRegistration(@Validated WgzAppConfirmRegistrationReq req) { + return AjaxResult.success(iBgtProjectRecruitApplyService.userConfirmRegistration(req)); + } + /** * 【首页】【已报名项目】 已报名项目 */ @@ -407,16 +417,19 @@ public class WgzAppController { res.setEntryTime(by.getEntryTime()). setLeaveTime(by.getLeaveTime()). setAmount(recruitAmount); - //3、查询当前进行中的项目是否有工资结算 - WgzPayCalculation gz = iWgzPayCalculationService.findByUserIdRecruitIdNewestData(appUserId, appById.getId()); - if (gz != null){ + //3、查询当前进行中的项目是否有工资结算(多次追加) + List gzs = iWgzPayCalculationService.findByUserIdRecruitIdNewestData(appUserId, appById.getId()); + BigDecimal addSum = new BigDecimal(0); + for (WgzPayCalculation gz : gzs) { //金额*天数=实际工资 - res.setAppliedAmount(gz.getRecruitAmount().multiply(BigDecimal.valueOf(gz.getNum()))); - res.setNameOfApplicant(gz.getUserName()); + BigDecimal multiply = gz.getRecruitAmount().multiply(BigDecimal.valueOf(gz.getNum())); + addSum = addSum.add(multiply); } + res.setAppliedAmount(addSum); + res.setNameOfApplicant(gzs.get(0).getUserName()); if(i!=0){ //总的金额/结算的金额=百分比 - BigDecimal divide = res.getTotalAmount().divide(res.getAmount(), 2, BigDecimal.ROUND_HALF_UP); + BigDecimal divide = res.getAppliedAmount().divide(res.getTotalAmount(), 2, BigDecimal.ROUND_HALF_UP); res.setPercentage(divide.doubleValue()); } return AjaxResult.success(res); diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitApplyService.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitApplyService.java index 3329d7a..15e805e 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitApplyService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitApplyService.java @@ -9,6 +9,7 @@ import com.ruoyi.bgt.domain.dto.BgtScoreDTO; import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO; import com.ruoyi.common.core.mybatisplus.core.IServicePlus; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.wgz.bo.req.WgzAppConfirmRegistrationReq; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RequestBody; import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq; @@ -115,5 +116,8 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus userUnderway(@Validated WgzAppUnderwayReq req); - + /** + * 项目详情·确认|拒绝报名 + */ + Boolean userConfirmRegistration(@Validated WgzAppConfirmRegistrationReq req); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitService.java b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitService.java index 486edff..5cf25b0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/bgt/service/IBgtProjectRecruitService.java @@ -85,7 +85,7 @@ public interface IBgtProjectRecruitService extends IServicePlus1){ throw new RuntimeException("异常,查询到用户同时在多个工地务工!"); } + if (bgtProjectRecruitApplies.isEmpty()){ + return null; + } return bgtProjectRecruitApplies.get(0); } @@ -181,18 +185,18 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl(). eq(BgtProjectRecruitApply::getUserId, appUserId). - eq(BgtProjectRecruitApply::getStatus, "3") + in(BgtProjectRecruitApply::getStatus, "3","5") ); if (i>0){ throw new RuntimeException("已有工地!不可再次申请!"); } - WgzUser byId = wgzUserService.getById(appUserId); + WgzUser byId = wgzUserService.findByUserId(appUserId); if (!Objects.equals(appById.getTypeOfWork(), byId.getTypeOfWork())){ throw new RuntimeException("工种不匹配!"); } @@ -284,4 +288,12 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl findByUserIdRecruitIdNewestData(Long userId, Long recruitId); /** * 查询列表 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzUserService.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzUserService.java index 99b8d64..62258cf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzUserService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/IWgzUserService.java @@ -92,4 +92,9 @@ public interface IWgzUserService extends IServicePlus { * 务工者APP实名认证 */ Boolean userRealNameAuthentication(@Validated @RequestBody WgzAppRealNameAuthenticationReq req); + + /** + * 根据务工者唯一标识获取数据 + */ + WgzUser findByUserId(Long userId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java index 42b0e80..e6a7564 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzPayCalculationServiceImpl.java @@ -161,13 +161,12 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl findByUserIdRecruitIdNewestData(Long userId, Long recruitId) { LambdaQueryWrapper eq = new LambdaQueryWrapper(). eq(WgzPayCalculation::getUserId, userId). eq(WgzPayCalculation::getRecruitId, recruitId). - orderByDesc(WgzPayCalculation::getCreateTime). - last("limit 1"); - return baseMapper.selectOne(eq); + eq(WgzPayCalculation::getAuditorType, "2"); + return baseMapper.selectList(eq); } @Override diff --git a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzUserServiceImpl.java index c31a5a4..a4f31c1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wgz/service/impl/WgzUserServiceImpl.java @@ -190,4 +190,9 @@ public class WgzUserServiceImpl extends ServicePlusImpl return true; } + @Override + public WgzUser findByUserId(Long userId) { + return baseMapper.selectOne(new LambdaQueryWrapper().eq(WgzUser::getUserId, userId)); + } + } diff --git a/ruoyi/uploadPath/upload/2025/02/25/ba44dbbc-df3c-46d8-9a0b-240f62505103.png b/ruoyi/uploadPath/upload/2025/02/25/ba44dbbc-df3c-46d8-9a0b-240f62505103.png new file mode 100644 index 0000000..9b5574b Binary files /dev/null and b/ruoyi/uploadPath/upload/2025/02/25/ba44dbbc-df3c-46d8-9a0b-240f62505103.png differ