1
zj
2025-09-25 5e179f4180fd2dc93623699af614df9a2497ded6
ruoyi-admin/src/main/java/com/ruoyi/im/ImApiController.java
@@ -352,7 +352,7 @@
        userTeamAndPositionOut.setInsureNumber(activeNumber);
        positions.forEach(f->{
            if(userPolicyList.size() >= f.getNumberPeople()){
            if(activeNumber >= f.getNumberPeople()){
                userTeamAndPositionOut.setPosition(f.getPosition());
                userTeamAndPositionOut.setSalary(f.getSalary());
            }
@@ -381,12 +381,24 @@
     * 产品信息列表
     */
    @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);