| | |
| | | userTeamAndPositionOut.setInsureNumber(activeNumber); |
| | | |
| | | positions.forEach(f->{ |
| | | if(userPolicyList.size() >= f.getNumberPeople()){ |
| | | if(activeNumber >= f.getNumberPeople()){ |
| | | userTeamAndPositionOut.setPosition(f.getPosition()); |
| | | userTeamAndPositionOut.setSalary(f.getSalary()); |
| | | } |
| | |
| | | * 产品信息列表 |
| | | */ |
| | | @GetMapping("/getProduct") |
| | | public Result getProduct() { |
| | | public Result getProduct(@RequestParam("account") String account) { |
| | | UserAccount userAccount = userAccountService.getOne(new LambdaQueryWrapper<>(UserAccount.class).eq(UserAccount::getCloudMessageAccount, account)); |
| | | if(ObjectUtil.isEmpty(userAccount)){ |
| | | return Result.error("账号不存在!"); |
| | | } |
| | | LambdaQueryWrapper<InsuranceProduct> wrapper = new LambdaQueryWrapper<>(); |
| | | // 按创建时间倒序排列 |
| | | wrapper.orderByDesc(InsuranceProduct::getCreatedAt); |
| | | List<InsuranceProduct> list = insuranceProductService.list(wrapper); |
| | | list.forEach(f->{ |
| | | long count = userPolicyService.count(new LambdaQueryWrapper<>(UserPolicy.class) |
| | | .eq(UserPolicy::getUserId, userAccount.getId()) |
| | | .eq(UserPolicy::getProductId,f.getId()) |
| | | .ne(UserPolicy::getApprovalStatus,2) |
| | | ); |
| | | if(count > 0){ |
| | | f.setIsBuy(true); |
| | | } |
| | | List<InsuranceFeature> features = insuranceFeatureService.list(new LambdaQueryWrapper<InsuranceFeature>() |
| | | .eq(InsuranceFeature::getProductId, f.getId())); |
| | | f.setProductFeature(features); |