Administrator
5 days ago 7ce91deef10015a897a1b00558b048e89763b837
src/main/java/cc/mrbird/febs/mall/service/impl/HappyActivityServiceImpl.java
@@ -54,6 +54,7 @@
    private final HappyActivityOptionMapper happyActivityOptionMapper;
    private final HappyActivityConnectMapper happyActivityConnectMapper;
    private final HappyActivityOrderMapper happyActivityOrderMapper;
    private final HappyActivityCommentMapper happyActivityCommentMapper;
    private final HappyActivityOrderItemMapper happyActivityOrderItemMapper;
    private final IXcxPayService iXcxPayService;
    private final IApiMallMemberWalletService iApiMallMemberWalletService;
@@ -114,6 +115,14 @@
        );
        if(happyActivity != null){
            BeanUtil.copyProperties(happyActivity,apiActivityVo);
            Integer commentCount = happyActivityCommentMapper.selectCount(
                    new LambdaQueryWrapper<HappyActivityComment>()
                            .eq(HappyActivityComment::getActivityId, happyActivity.getId())
                            .eq(HappyActivityComment::getShowState, StateUpDownEnum.UP.getCode())
            );
            apiActivityVo.setCommentCount(commentCount);
            List<HappyFollow> happyFollows = happyFollowMapper.selectList(
                    new LambdaQueryWrapper<HappyFollow>()
                            .select(HappyFollow::getId, HappyFollow::getType)
@@ -920,12 +929,43 @@
                Long activityId = happyActivityOrder.getActivityId();
                Integer numCnt = happyActivityOrder.getNumCnt();
                this.baseMapper.updateHappyActivitySurplusCnt(activityId,numCnt);
            });
                happyActivityOrder.setDeleteFlag(StateUpDownEnum.UP.getCode());
                happyActivityOrderMapper.updateById(happyActivityOrder);
            });
        }
    }
    @Override
    public FebsResponse addComment(ApiPayOrderAddCommentDto dto) {
        // 获取当前登录用户的ID
        Long memberId = LoginUserUtil.getLoginUser().getId();
        Long orderId = dto.getOrderId();
        HappyActivityOrder happyActivityOrder = happyActivityOrderMapper.selectById(orderId);
        if(StateUpDownEnum.ORDER_STATE_USED.getCode() != happyActivityOrder.getState()){
            throw new FebsException("该订单状态不是已使用状态!");
        }
        happyActivityOrder.setState(StateUpDownEnum.ORDER_STATE_COMMENT.getCode());
        happyActivityOrderMapper.updateById(happyActivityOrder);
        HappyActivity happyActivity = this.baseMapper.selectById(happyActivityOrder.getActivityId());
        HappyActivityComment happyActivityComment = new HappyActivityComment();
        happyActivityComment.setActivityId(happyActivity.getId());
        happyActivityComment.setActivityName(happyActivity.getName());
        happyActivityComment.setMemberId(memberId);
        happyActivityComment.setOrderId(orderId);
        happyActivityComment.setStar(dto.getStar());
        happyActivityComment.setComment(dto.getComment());
        happyActivityComment.setImages(dto.getImages());
        happyActivityCommentMapper.insert(happyActivityComment);
        return new FebsResponse().success().message("操作成功");
    }
    @Override
    public FebsResponse voteActivityHot(Long id) {
        ApiVoteActivityHotVo apiVoteActivityHotVo = new ApiVoteActivityHotVo();