Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
# framework/src/main/java/cn/lili/modules/lmk/domain/entity/PrizeActivity.java
# framework/src/main/java/cn/lili/modules/lmk/mapper/ActivityRefPrizeMapper.java
| | |
| | | |
| | | @TableField("prize_activity_id") |
| | | /** 抽奖活动id */ |
| | | private Long prizeActivityId; |
| | | private String prizeActivityId; |
| | | |
| | | @TableField("prize_id") |
| | | /** 奖品id */ |
| | | private Long prizeId; |
| | | private String prizeId; |
| | | |
| | | @TableField("prize_content") |
| | | /** 奖品内容 */ |
| | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import org.apache.ibatis.type.LocalDateTimeTypeHandler; |
| | |
| | | private String activityCover; |
| | | |
| | | @TableField("enable_status") |
| | | /** 是否开启活动 */ |
| | | /** 是否开启活动 */ |
| | | private String enableStatus; |
| | | |
| | | |
| | |
| | | |
| | | @TableField("coupon_id") |
| | | /** 优惠卷id */ |
| | | private Long couponId; |
| | | private String couponId; |
| | | |
| | | @TableField("prize_content") |
| | | /** 奖品内容 */ |
| | |
| | | |
| | | @NotNull(message = "抽奖活动id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("抽奖活动id") |
| | | private Long prizeActivityId; |
| | | private String prizeActivityId; |
| | | |
| | | @NotNull(message = "奖品id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("奖品id") |
| | | private Long prizeId; |
| | | private String prizeId; |
| | | |
| | | @NotNull(message = "每日最大中奖数不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("每日最大中奖数") |
| | | private Integer maxPreDay; |
| | | |
| | | @NotBlank(message = "奖品内容不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("奖品内容") |
| | |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.PrizeActivity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | @NotNull(message = "活动开始时间不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("活动开始时间") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date beginTime; |
| | | |
| | | @NotNull(message = "活动结束时间不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("活动结束时间") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | |
| | | @NotNull(message = "每日最大抽奖上限不能为空", groups = {Add.class, Update.class}) |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | |
| | | @Data |
| | | @ApiModel(value = "PrizeActivity查询参数", description = "抽奖活动查询参数") |
| | | public class PrizeActivityQuery extends AbsQuery { |
| | | |
| | | public String activityName; |
| | | |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date beginTime; |
| | | |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | public Date endTime; |
| | | } |
| | | |
| | |
| | | @Data |
| | | @ApiModel(value = "PrizeDraw查询参数", description = "抽奖活动奖品查询参数") |
| | | public class PrizeDrawQuery extends AbsQuery { |
| | | /** |
| | | * 奖品名 |
| | | */ |
| | | private String prizeName; |
| | | /** |
| | | * 奖品类型 |
| | | */ |
| | | private String prizeType; |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * lmk-shop-java |
| | | * |
| | | * @author : zxl |
| | | * @date : 2025-08-14 10:37 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "VideoCommentMangerQuery查询参数", description = "管理端视频评论查询参数") |
| | | public class VideoCommentMangerQuery extends AbsQuery { |
| | | |
| | | @ApiModelProperty("视频id") |
| | | private String videoId; |
| | | |
| | | @ApiModelProperty("评论内容") |
| | | private String commentContent; |
| | | |
| | | @ApiModelProperty("用户名称") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("起始时间") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date startTime; |
| | | @ApiModelProperty("结束时间") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date endTime; |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * lmk-shop-java |
| | | * 补充奖品相关信息 |
| | | * |
| | | * @author : zxl |
| | | * @date : 2025-08-21 09:44 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "补充奖品相关信息", description = "补充奖品相关信息") |
| | | public class ActivityRefPrizeInfoVO extends ActivityRefPrizeVO{ |
| | | private String prizeCover; |
| | | private String prizeCoverUrl; |
| | | private String prizeName; |
| | | private String prizeType; |
| | | } |
| | |
| | | |
| | | /** 抽奖活动id */ |
| | | @ApiModelProperty("抽奖活动id") |
| | | private Long prizeActivityId; |
| | | private String prizeActivityId; |
| | | |
| | | /** 奖品id */ |
| | | @ApiModelProperty("奖品id") |
| | | private Long prizeId; |
| | | private String prizeId; |
| | | |
| | | /** 奖品内容 */ |
| | | @ApiModelProperty("奖品内容") |
| | |
| | | @ApiModelProperty("是否开启活动") |
| | | private String enableStatus; |
| | | |
| | | private String activityCoverUrl; |
| | | |
| | | private String activityImgUrl; |
| | | |
| | | |
| | | public static PrizeActivityVO getVoByEntity(@NonNull PrizeActivity entity, PrizeActivityVO vo) { |
| | | if(vo == null) { |
| | | vo = new PrizeActivityVO(); |
| | |
| | | @ApiModelProperty("奖品图片") |
| | | private String prizeImg; |
| | | |
| | | private String prizeCoverUrl; |
| | | |
| | | private String prizeImgUrl; |
| | | public static PrizeDrawVO getVoByEntity(@NonNull PrizeDraw entity, PrizeDrawVO vo) { |
| | | if(vo == null) { |
| | | vo = new PrizeDrawVO(); |
New file |
| | |
| | | package cn.lili.modules.lmk.enums.general; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * lmk-shop-java |
| | | * 抽奖活动状态 |
| | | * |
| | | * @author : zxl |
| | | * @date : 2025-08-21 11:43 |
| | | **/ |
| | | @AllArgsConstructor |
| | | @Getter |
| | | public enum PrizeActivityStatusEnum { |
| | | /** |
| | | * 抽奖活动状态 |
| | | */ |
| | | OFF("off"), |
| | | ON("on"); |
| | | private final String description; |
| | | } |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.ActivityRefPrize; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityRefPrizeInfoVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityRefPrizeVO; |
| | |
| | | |
| | | String lockPrizeRef(@Param("refId") String refId);; |
| | | |
| | | |
| | | List<ActivityRefPrizeInfoVO> getActivityRefPrizeByActivityId(String prizeActivityId); |
| | | } |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.VideoComment; |
| | | import cn.lili.modules.lmk.domain.query.VideoCommentMangerQuery; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | */ |
| | | VideoCommentVO getById(String id); |
| | | |
| | | |
| | | IPage getManagerPage (IPage page, @Param("query") VideoCommentMangerQuery query); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | |
| | | public interface ActivityRefPrizeService extends IService<ActivityRefPrize> { |
| | | |
| | | /** |
| | | * 根据抽奖活动id 返回奖品集合 |
| | | * @param prizeActivityId |
| | | * @return |
| | | */ |
| | | Result getActivityRefPrizeByActivityId(String prizeActivityId); |
| | | |
| | | /** |
| | | * 更具奖品id活动相关活动 |
| | | * @param prizeId |
| | | * @return |
| | | */ |
| | | Result getPrizeByIdAndPrizeActivityId(String prizeId); |
| | | |
| | | /** |
| | | * 新增奖品 |
| | | * @param prizeActivityId |
| | | * @param list |
| | | * @return |
| | | */ |
| | | Result addList(String prizeActivityId,List<ActivityRefPrizeForm> list); |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | |
| | | */ |
| | | public interface PrizeActivityService extends IService<PrizeActivity> { |
| | | |
| | | Result publishPrizeActivity(String id); |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | |
| | | * @since 2025-08-14 |
| | | */ |
| | | public interface PrizeDrawService extends IService<PrizeDraw> { |
| | | /** |
| | | * 返回能否修改,以及若是优惠劵类型,返回优惠劵信息。 |
| | | * @param prizeDrawId |
| | | * @return |
| | | */ |
| | | Result canUpDatePrizeDraw(String prizeDrawId); |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | */ |
| | | Result add(PrizeDrawForm form); |
| | | |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | |
| | | import cn.lili.modules.lmk.domain.entity.ThumbsUpRecord; |
| | | import cn.lili.modules.lmk.domain.entity.VideoComment; |
| | | import cn.lili.modules.lmk.domain.form.ThumbsUpRecordForm; |
| | | import cn.lili.modules.lmk.domain.query.VideoCommentMangerQuery; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | |
| | | */ |
| | | public interface VideoCommentService extends IService<VideoComment> { |
| | | |
| | | Result mangerComment(VideoCommentMangerQuery query); |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityRefPrizeInfoVO; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.ActivityRefPrize; |
| | | import cn.lili.modules.lmk.mapper.ActivityRefPrizeMapper; |
| | | import cn.lili.modules.lmk.service.ActivityRefPrizeService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.ActivityRefPrizeForm; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityRefPrizeVO; |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional |
| | | public class ActivityRefPrizeServiceImpl extends ServiceImpl<ActivityRefPrizeMapper, ActivityRefPrize> implements ActivityRefPrizeService { |
| | | |
| | | private final ActivityRefPrizeMapper activityRefPrizeMapper; |
| | | private final COSUtil cosUtil; |
| | | @Override |
| | | public Result getActivityRefPrizeByActivityId(String prizeActivityId){ |
| | | //以及奖品对应信息 |
| | | List<ActivityRefPrizeInfoVO> activityRefPrizeByActivityIds = activityRefPrizeMapper.getActivityRefPrizeByActivityId(prizeActivityId); |
| | | for (ActivityRefPrizeInfoVO activityRefPrizeInfoVO : activityRefPrizeByActivityIds){ |
| | | if (StringUtils.isNotBlank(activityRefPrizeInfoVO.getPrizeCover())){ |
| | | activityRefPrizeInfoVO.setPrizeCoverUrl(cosUtil.getPreviewUrl(activityRefPrizeInfoVO.getPrizeCover())); |
| | | } |
| | | } |
| | | return Result.ok().data(activityRefPrizeByActivityIds); |
| | | } |
| | | |
| | | @Override |
| | | public Result getPrizeByIdAndPrizeActivityId(String prizeId){ |
| | | List<ActivityRefPrize> activityRefPrizeList = new LambdaQueryChainWrapper<>(baseMapper) |
| | | .eq(ActivityRefPrize::getPrizeId,prizeId) |
| | | .eq(ActivityRefPrize::getDeleteFlag,Boolean.FALSE) |
| | | .list(); |
| | | return Result.ok().data(activityRefPrizeList); |
| | | } |
| | | |
| | | @Override |
| | | public Result addList(String prizeActivityId,List<ActivityRefPrizeForm> list){ |
| | | //先删除再重新添加 |
| | | baseMapper.delete(new LambdaQueryWrapper<ActivityRefPrize>().eq(ActivityRefPrize::getPrizeActivityId,prizeActivityId)); |
| | | |
| | | List<ActivityRefPrize> activityRefPrizeList = new ArrayList<>(); |
| | | if (!list.isEmpty()){ |
| | | for (ActivityRefPrizeForm activityRefPrizeForm : list){ |
| | | ActivityRefPrize activityRefPrize = ActivityRefPrizeForm.getEntityByForm(activityRefPrizeForm,null); |
| | | //初始化锁的版本 |
| | | activityRefPrize.setPrizeActivityId(prizeActivityId); |
| | | activityRefPrize.setRemainNum(activityRefPrizeForm.getPrizeNum()); |
| | | activityRefPrize.setVersion(0); |
| | | activityRefPrizeList.add(activityRefPrize); |
| | | } |
| | | this.saveBatch(activityRefPrizeList); |
| | | } |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | public Result remove(List<String> ids) { |
| | | //判断活动id是否已经存在报名人员 |
| | | for(String id : ids){ |
| | | canDeleteActivity(id); |
| | | |
| | | Result result = canDeleteActivity(id); |
| | | Integer code = (Integer) result.get("code"); |
| | | if (code != 200){ |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | return Result.ok("删除成功"); |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.lmk.domain.entity.ActivityRefPrize; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityRefPrizeInfoVO; |
| | | import cn.lili.modules.lmk.enums.general.PrizeActivityStatusEnum; |
| | | import cn.lili.modules.lmk.service.ActivityRefPrizeService; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.PrizeActivity; |
| | | import cn.lili.modules.lmk.mapper.PrizeActivityMapper; |
| | |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @RequiredArgsConstructor |
| | | public class PrizeActivityServiceImpl extends ServiceImpl<PrizeActivityMapper, PrizeActivity> implements PrizeActivityService { |
| | | |
| | | private final ActivityRefPrizeService activityRefPrizeService; |
| | | private final PrizeActivityMapper prizeActivityMapper; |
| | | |
| | | private final COSUtil cOSUtil; |
| | | |
| | | @Override |
| | | public Result publishPrizeActivity(String id) { |
| | | PrizeActivity prizeActivity = baseMapper.selectById(id); |
| | | //判断活动是否存在奖品 存在允许开启 |
| | | |
| | | Object data = activityRefPrizeService.getActivityRefPrizeByActivityId(id).get("data"); |
| | | |
| | | if (data instanceof List<?>) { |
| | | List<?> rawList = (List<?>) data; |
| | | List<ActivityRefPrizeInfoVO> list = new ArrayList<>(); |
| | | for (Object item : rawList) { |
| | | if (item instanceof ActivityRefPrizeInfoVO) { |
| | | list.add((ActivityRefPrizeInfoVO) item); |
| | | } |
| | | } |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return Result.error("开启抽奖活动前请设置奖品"); |
| | | } |
| | | // 使用 list |
| | | } |
| | | |
| | | |
| | | if (PrizeActivityStatusEnum.OFF.getDescription().equals(prizeActivity.getEnableStatus())) { |
| | | prizeActivity.setEnableStatus(PrizeActivityStatusEnum.ON.getDescription()); |
| | | baseMapper.updateById(prizeActivity); |
| | | return Result.ok("启动成功"); |
| | | }else { |
| | | prizeActivity.setEnableStatus(PrizeActivityStatusEnum.OFF.getDescription()); |
| | | baseMapper.updateById(prizeActivity); |
| | | return Result.ok("关闭成功"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | public Result page(PrizeActivityQuery query) { |
| | | IPage<PrizeActivityVO> page = PageUtil.getPage(query, PrizeActivityVO.class); |
| | | baseMapper.getPage(page, query); |
| | | |
| | | for (PrizeActivityVO vo : page.getRecords()) { |
| | | if (StringUtils.isNotBlank(vo.getActivityCover())){ |
| | | vo.setActivityCoverUrl(cOSUtil.getPreviewUrl(vo.getActivityCover())); |
| | | } |
| | | if (StringUtils.isNotBlank(vo.getActivityImg())){ |
| | | vo.setActivityImgUrl(cOSUtil.getPreviewUrl(vo.getActivityImg())); |
| | | } |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.lmk.domain.entity.ActivityRefPrize; |
| | | import cn.lili.modules.lmk.service.ActivityRefPrizeService; |
| | | import cn.lili.modules.promotion.entity.vos.CouponVO; |
| | | import cn.lili.modules.promotion.service.CouponService; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.PrizeDraw; |
| | | import cn.lili.modules.lmk.mapper.PrizeDrawMapper; |
| | |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | public class PrizeDrawServiceImpl extends ServiceImpl<PrizeDrawMapper, PrizeDraw> implements PrizeDrawService { |
| | | |
| | | private final PrizeDrawMapper prizeDrawMapper; |
| | | |
| | | private final ActivityRefPrizeService activityRefPrizeService; |
| | | |
| | | private final CouponService couponService; |
| | | |
| | | private final COSUtil cOSUtil; |
| | | |
| | | @Override |
| | | public Result canUpDatePrizeDraw(String prizeDrawId) { |
| | | PrizeDraw prizeDraw = baseMapper.selectById(prizeDrawId); |
| | | CouponVO detail = new CouponVO(); |
| | | if (StringUtils.isNotBlank(prizeDraw.getCouponId())){ |
| | | detail = couponService.getDetail(prizeDraw.getCouponId()); |
| | | } |
| | | Result result = Result.ok(); |
| | | result.data(detail); |
| | | Object data = activityRefPrizeService.getPrizeByIdAndPrizeActivityId(prizeDrawId).get("data"); |
| | | |
| | | if (data instanceof List<?>) { |
| | | List<?> rawList = (List<?>) data; |
| | | List<ActivityRefPrize> list = new ArrayList<>(); |
| | | for (Object item : rawList) { |
| | | if (item instanceof ActivityRefPrize) { |
| | | list.add((ActivityRefPrize) item); |
| | | } |
| | | } |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | return result.put("state",true); |
| | | }else{ |
| | | return result.put("state",false); |
| | | } |
| | | // 使用 list |
| | | } |
| | | return result.put("state",false); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | @Override |
| | | public Result update(PrizeDrawForm form) { |
| | | PrizeDraw entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | |
| | | public Result page(PrizeDrawQuery query) { |
| | | IPage<PrizeDrawVO> page = PageUtil.getPage(query, PrizeDrawVO.class); |
| | | baseMapper.getPage(page, query); |
| | | for (PrizeDrawVO vo : page.getRecords()) { |
| | | if (StringUtils.isNotBlank(vo.getPrizeCover())){ |
| | | vo.setPrizeCoverUrl(cOSUtil.getPreviewUrl(vo.getPrizeCover())); |
| | | } |
| | | if (StringUtils.isNotBlank(vo.getPrizeImg())){ |
| | | vo.setPrizeImgUrl(cOSUtil.getPreviewUrl(vo.getPrizeImg())); |
| | | } |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | |
| | | public Result add(StoreMemberForm form) { |
| | | String storeId =UserContext.getCurrentUser().getStoreId(); |
| | | System.out.println(storeId); |
| | | // storeId = "1376433565247471616"; //测试用 |
| | | // |
| | | if ( storeId == null){ |
| | | return null; |
| | | } |
| | |
| | | import cn.lili.modules.lmk.constant.RedisKeyExpireConstant; |
| | | import cn.lili.modules.lmk.domain.entity.ThumbsUpRecord; |
| | | import cn.lili.modules.lmk.domain.form.ThumbsUpRecordForm; |
| | | import cn.lili.modules.lmk.domain.query.VideoCommentMangerQuery; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import cn.lili.modules.lmk.enums.general.VideoCommentStatusEnum; |
| | | import cn.lili.modules.lmk.event.event.VideoCommentNumCacheEvent; |
| | |
| | | private final RocketmqCustomProperties rocketmqCustomProperties; |
| | | private final ApplicationEventPublisher eventPublisher; |
| | | |
| | | @Override |
| | | public Result mangerComment(VideoCommentMangerQuery query) { |
| | | IPage<VideoCommentVO> page = PageUtil.getPage(query, VideoCommentVO.class); |
| | | baseMapper.getManagerPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | |
| | | } |
| | | if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) { |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | |
| | | String coverFileKey = v.getCoverFileKey(); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(coverFileKey)); |
| | | if (StringUtils.isNotBlank(coverFileKey) && !coverFileKey.contains("http")) { |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(coverFileKey)); |
| | | } |
| | | |
| | | } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) { |
| | | v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList())); |
| | | } |
| | |
| | | public Result resetPassword(String id) { |
| | | String password = "111111"; |
| | | Member member = this.getById(id); |
| | | member.setPassword(new BCryptPasswordEncoder().encode(password)); |
| | | member.setPassword(new BCryptPasswordEncoder().encode(SecureUtil.md5(password))); |
| | | this.updateById(member); |
| | | return Result.ok("重置成功"); |
| | | } |
| | |
| | | <result column="remain_num" property="remainNum" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="activityRefPrizeInfoMap" type="cn.lili.modules.lmk.domain.vo.ActivityRefPrizeInfoVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="prize_activity_id" property="prizeActivityId" /> |
| | | <result column="prize_id" property="prizeId" /> |
| | | <result column="prize_content" property="prizeContent" /> |
| | | <result column="prize_num" property="prizeNum" /> |
| | | <result column="prize_probability" property="prizeProbability" /> |
| | | <result column="version" property="version" /> |
| | | <result column="remain_num" property="remainNum" /> |
| | | <result column="prize_name" property="prizeName" /> |
| | | <result column="prize_cover" property="prizeCover"/> |
| | | <result column="prize_type" property="prizeType"/> |
| | | </resultMap> |
| | | <select id="getActivityRefPrizeByActivityId" resultMap="activityRefPrizeInfoMap"> |
| | | SELECT |
| | | LARP.prize_activity_id, |
| | | LARP.prize_id, |
| | | LARP.prize_content, |
| | | LARP.prize_num, |
| | | LARP.prize_probability, |
| | | LARP.version, |
| | | LARP.remain_num, |
| | | LARP.id, |
| | | LPD.prize_name, |
| | | LPD.prize_cover, |
| | | LPD.prize_type |
| | | FROM |
| | | lmk_activity_ref_prize LARP |
| | | LEFT JOIN |
| | | lmk_prize_draw LPD ON LARP.prize_id = LPD.id |
| | | where LARP.prize_activity_id = #{prizeActivityId} AND LARP.delete_flag = 0 |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | |
| | | lmk_prize_activity LPA |
| | | WHERE |
| | | LPA.delete_flag = 0 |
| | | <if test="query.activityName != null and query.activityName !=''"> |
| | | AND LPA.activity_name LIKE CONCAT('%',#{query.ctivityName},'%') |
| | | </if> |
| | | <if test="query.beginTime != null">AND LPA.begin_time >= #{query.beginTime}</if> |
| | | <if test="query.endTime != null">AND LPA.end_time <= #{query.endTime}</if> |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | lmk_prize_draw LPD |
| | | WHERE |
| | | LPD.delete_flag = 0 |
| | | <if test="query.prizeName != null and query.prizeName != ''"> |
| | | AND LPD.prize_name like concat('%',#{query.prizeName},'%') |
| | | </if> |
| | | <if test="query.prizeType != null and query.prizeType != ''"> |
| | | AND LPD.prize_type = #{query.prizeType} |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | LVC.id = #{id} AND LVC.delete_flag = 0 |
| | | </select> |
| | | |
| | | <select id="getManagerPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LVC.video_id, |
| | | LVC.comment_content, |
| | | LVC.reply_id, |
| | | LVC.reply_user_id, |
| | | LVC.reply_user_nickname, |
| | | LVC.master_comment_id, |
| | | LVC.status, |
| | | LVC.thumbs_up_num, |
| | | LVC.id, |
| | | LVC.user_id, |
| | | LVC.user_nickname, |
| | | LVC.user_avatar, |
| | | LVC.create_time |
| | | FROM |
| | | lmk_video_comment LVC |
| | | WHERE |
| | | LVC.video_id = #{query.videoId} AND LVC.delete_flag = 0 |
| | | <if test="query.commentContent != null and query.commentContent !=''"> |
| | | AND LVC.comment_content like concat('%',#{query.commentContent},'%') |
| | | </if> |
| | | <if test="query.nickName != null and query.nickName !=''"> |
| | | AND LVC.user_nickname like concat('%',#{query.nickName},'%') |
| | | </if> |
| | | <if test="query.startTime != null"> |
| | | AND LVC.create_time >= #{query.startTime} |
| | | </if> |
| | | <if test="query.endTime != null"> |
| | | AND LVC.create_time <= #{query.endTime} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.ActivityRefPrizeForm; |
| | | import cn.lili.modules.lmk.domain.form.PrizeActivityForm; |
| | | import cn.lili.modules.lmk.domain.query.PrizeActivityQuery; |
| | | import cn.lili.modules.lmk.service.ActivityRefPrizeService; |
| | | import cn.lili.modules.lmk.service.PrizeActivityService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.Size; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * lmk-shop-java |
| | | * 抽奖活动 |
| | | * |
| | | * @author : zxl |
| | | * @date : 2025-08-14 16:27 |
| | | **/ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/activity-prize") |
| | | public class PrizeActivityController { |
| | | |
| | | private final PrizeActivityService prizeActivityService; |
| | | |
| | | private final ActivityRefPrizeService activityRefPrizeService; |
| | | @GetMapping |
| | | public Result getPage(PrizeActivityQuery query){ |
| | | return prizeActivityService.page(query); |
| | | } |
| | | @GetMapping("/{id}") |
| | | public Result detail(@PathVariable("id") String id){ |
| | | return prizeActivityService.detail(id); |
| | | } |
| | | @PutMapping |
| | | public Result edit(@RequestBody PrizeActivityForm form){ |
| | | return prizeActivityService.update(form); |
| | | } |
| | | @PostMapping |
| | | public Result add(@RequestBody PrizeActivityForm form){ |
| | | return prizeActivityService.add(form); |
| | | } |
| | | @DeleteMapping("/{id}") |
| | | public Result del(@PathVariable("id") String id){ |
| | | return prizeActivityService.removeById(id); |
| | | } |
| | | @PostMapping("/addActivityRefPrizeList/{id}") |
| | | public Result addListByPrizeDraw(@PathVariable("id") String prizeActivityId,@RequestBody @Valid @Size(max = 5, message = "奖品数量必须在1到5个之间") List<ActivityRefPrizeForm> list){ |
| | | return activityRefPrizeService.addList(prizeActivityId,list); |
| | | } |
| | | |
| | | @GetMapping("/getActivityRefPrizeByActivityId/{id}") |
| | | public Result getActivityRefPrizeByActivityId(@PathVariable("id") String prizeActivityId){ |
| | | return activityRefPrizeService.getActivityRefPrizeByActivityId(prizeActivityId); |
| | | } |
| | | |
| | | @PutMapping("/publishPrizeActivity/{id}") |
| | | public Result publishPrizeActivity(@PathVariable("id") String id){ |
| | | return prizeActivityService.publishPrizeActivity(id); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.entity.ActivityRefPrize; |
| | | import cn.lili.modules.lmk.domain.form.PrizeDrawForm; |
| | | import cn.lili.modules.lmk.domain.query.PrizeDrawQuery; |
| | | import cn.lili.modules.lmk.service.ActivityRefPrizeService; |
| | | import cn.lili.modules.lmk.service.PrizeDrawService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * lmk-shop-java |
| | | * |
| | | * @author : zxl |
| | | * @date : 2025-08-18 15:49 |
| | | **/ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/prizeDraw") |
| | | public class PrizeDrawController { |
| | | private final PrizeDrawService prizeDrawService; |
| | | private final ActivityRefPrizeService activityRefPrizeService; |
| | | @GetMapping |
| | | public Result getPage(PrizeDrawQuery query){ |
| | | return prizeDrawService.page(query); |
| | | } |
| | | @GetMapping("/{id}") |
| | | public Result detail(@PathVariable("id") String id){ |
| | | return prizeDrawService.detail(id); |
| | | } |
| | | @PutMapping |
| | | public Result edit(@RequestBody PrizeDrawForm form){ |
| | | return prizeDrawService.update(form); |
| | | } |
| | | @PostMapping |
| | | public Result add(@RequestBody PrizeDrawForm form){ |
| | | return prizeDrawService.add(form); |
| | | } |
| | | @DeleteMapping("/{id}") |
| | | public Result del(@PathVariable("id") String id){ |
| | | return prizeDrawService.removeById(id); |
| | | } |
| | | |
| | | @GetMapping("/canUpDatePrizeDraw/{id}") |
| | | public Result canUpDatePrizeDraw(@PathVariable("id") String id){ |
| | | return prizeDrawService.canUpDatePrizeDraw(id); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.query.VideoCommentMangerQuery; |
| | | import cn.lili.modules.lmk.service.VideoCommentService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * lmk-shop-java |
| | | * 管理端评价管理 |
| | | * |
| | | * @author : zxl |
| | | * @date : 2025-08-14 10:50 |
| | | **/ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/manager/lmk/videoComment") |
| | | public class VideoCommentController { |
| | | private final VideoCommentService videoCommentService; |
| | | |
| | | @GetMapping() |
| | | public Result getPage(VideoCommentMangerQuery query){ |
| | | return videoCommentService.mangerComment(query); |
| | | } |
| | | @DeleteMapping("/{id}") |
| | | public Result delete(@PathVariable("id")String id){ |
| | | return videoCommentService.removeById(id); |
| | | } |
| | | } |