New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 店铺优惠卷对应关系 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_store_coupon") |
| | | public class StoreCoupon extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("store_id") |
| | | /** 店铺id */ |
| | | private Long storeId; |
| | | |
| | | @TableField("store_name") |
| | | /** 店铺名称 */ |
| | | private Long storeName; |
| | | |
| | | @TableField("coupon_id") |
| | | /** 优惠卷id */ |
| | | private Long couponId; |
| | | |
| | | @TableField("coupon_name") |
| | | /** 优惠卷名称 */ |
| | | private String couponName; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.entity; |
| | | |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 店铺优惠卷领取记录 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_store_coupon_claim_record") |
| | | public class StoreCouponClaimRecord extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("store_name") |
| | | /** 店铺名称 */ |
| | | private String storeName; |
| | | |
| | | @TableField("coupon_id") |
| | | /** 优惠卷id */ |
| | | private Long couponId; |
| | | |
| | | @TableField("coupon_name") |
| | | /** 优惠卷名称 */ |
| | | private String couponName; |
| | | |
| | | @TableField("store_id") |
| | | /** 店铺id */ |
| | | private Long storeId; |
| | | |
| | | @TableField("user_id") |
| | | /** 用户id */ |
| | | private Long userId; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.StoreCouponClaimRecord; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 店铺优惠卷领取记录表单 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "StoreCouponClaimRecord表单", description = "店铺优惠卷领取记录表单") |
| | | public class StoreCouponClaimRecordForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "店铺名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("店铺名称") |
| | | private String storeName; |
| | | |
| | | @NotNull(message = "优惠卷id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("优惠卷id") |
| | | private Long couponId; |
| | | |
| | | @NotBlank(message = "优惠卷名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("优惠卷名称") |
| | | private String couponName; |
| | | |
| | | @NotNull(message = "店铺id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | @NotNull(message = "用户id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | public static StoreCouponClaimRecord getEntityByForm(@NonNull StoreCouponClaimRecordForm form, StoreCouponClaimRecord entity) { |
| | | if(entity == null) { |
| | | entity = new StoreCouponClaimRecord(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.group.Update; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.StoreCoupon; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 店铺优惠卷对应关系表单 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "StoreCoupon表单", description = "店铺优惠卷对应关系表单") |
| | | public class StoreCouponForm extends AbsForm { |
| | | |
| | | @NotNull(message = "店铺id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | @NotNull(message = "店铺名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("店铺名称") |
| | | private Long storeName; |
| | | |
| | | @NotNull(message = "优惠卷id不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("优惠卷id") |
| | | private Long couponId; |
| | | |
| | | @NotBlank(message = "优惠卷名称不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("优惠卷名称") |
| | | private String couponName; |
| | | |
| | | public static StoreCoupon getEntityByForm(@NonNull StoreCouponForm form, StoreCoupon entity) { |
| | | if(entity == null) { |
| | | entity = new StoreCoupon(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 店铺优惠卷领取记录查询 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "StoreCouponClaimRecord查询参数", description = "店铺优惠卷领取记录查询参数") |
| | | public class StoreCouponClaimRecordQuery extends AbsQuery { |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 店铺优惠卷对应关系查询 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "StoreCoupon查询参数", description = "店铺优惠卷对应关系查询参数") |
| | | public class StoreCouponQuery extends AbsQuery { |
| | | } |
| | | |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.StoreCouponClaimRecord; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 店铺优惠卷领取记录展示 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "店铺优惠卷领取记录响应数据", description = "店铺优惠卷领取记录响应数据") |
| | | public class StoreCouponClaimRecordVO extends AbsVo { |
| | | |
| | | /** 店铺名称 */ |
| | | @ApiModelProperty("店铺名称") |
| | | private String storeName; |
| | | |
| | | /** 优惠卷id */ |
| | | @ApiModelProperty("优惠卷id") |
| | | private Long couponId; |
| | | |
| | | /** 优惠卷名称 */ |
| | | @ApiModelProperty("优惠卷名称") |
| | | private String couponName; |
| | | |
| | | /** 店铺id */ |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | /** 用户id */ |
| | | @ApiModelProperty("用户id") |
| | | private Long userId; |
| | | |
| | | public static StoreCouponClaimRecordVO getVoByEntity(@NonNull StoreCouponClaimRecord entity, StoreCouponClaimRecordVO vo) { |
| | | if(vo == null) { |
| | | vo = new StoreCouponClaimRecordVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.StoreCoupon; |
| | | import java.util.List; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 店铺优惠卷对应关系展示 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "店铺优惠卷对应关系响应数据", description = "店铺优惠卷对应关系响应数据") |
| | | public class StoreCouponVO extends AbsVo { |
| | | |
| | | /** 店铺id */ |
| | | @ApiModelProperty("店铺id") |
| | | private Long storeId; |
| | | |
| | | /** 店铺名称 */ |
| | | @ApiModelProperty("店铺名称") |
| | | private Long storeName; |
| | | |
| | | /** 优惠卷id */ |
| | | @ApiModelProperty("优惠卷id") |
| | | private Long couponId; |
| | | |
| | | /** 优惠卷名称 */ |
| | | @ApiModelProperty("优惠卷名称") |
| | | private String couponName; |
| | | |
| | | public static StoreCouponVO getVoByEntity(@NonNull StoreCoupon entity, StoreCouponVO vo) { |
| | | if(vo == null) { |
| | | vo = new StoreCouponVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * lmk-shop-java |
| | | * |
| | | * @author : zxl |
| | | * @date : 2025-09-25 15:36 |
| | | **/ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class VideoViewCompletionRateVO { |
| | | private String complete_rate; |
| | | |
| | | private Long total_views; |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.StoreCouponClaimRecord; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.StoreCouponClaimRecordVO; |
| | | import cn.lili.modules.lmk.domain.form.StoreCouponClaimRecordForm; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponClaimRecordQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 店铺优惠卷领取记录 Mapper 接口 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Mapper |
| | | public interface StoreCouponClaimRecordMapper extends BaseMapper<StoreCouponClaimRecord> { |
| | | |
| | | /** |
| | | * id查找店铺优惠卷领取记录 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | StoreCouponClaimRecordVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") StoreCouponClaimRecordQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.StoreCoupon; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.StoreCouponVO; |
| | | import cn.lili.modules.lmk.domain.form.StoreCouponForm; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponQuery; |
| | | import java.util.List; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 店铺优惠卷对应关系 Mapper 接口 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Mapper |
| | | public interface StoreCouponMapper extends BaseMapper<StoreCoupon> { |
| | | |
| | | /** |
| | | * id查找店铺优惠卷对应关系 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | StoreCouponVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") StoreCouponQuery query); |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.StoreCouponClaimRecord; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.StoreCouponClaimRecordForm; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponClaimRecordQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 店铺优惠卷领取记录 服务类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | public interface StoreCouponClaimRecordService extends IService<StoreCouponClaimRecord> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(StoreCouponClaimRecordForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(StoreCouponClaimRecordForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(StoreCouponClaimRecordQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.StoreCoupon; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.form.StoreCouponForm; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponQuery; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 店铺优惠卷对应关系 服务类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | public interface StoreCouponService extends IService<StoreCoupon> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(StoreCouponForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(StoreCouponForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(StoreCouponQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.StoreCouponClaimRecord; |
| | | import cn.lili.modules.lmk.mapper.StoreCouponClaimRecordMapper; |
| | | import cn.lili.modules.lmk.service.StoreCouponClaimRecordService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.StoreCouponClaimRecordForm; |
| | | import cn.lili.modules.lmk.domain.vo.StoreCouponClaimRecordVO; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponClaimRecordQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 店铺优惠卷领取记录 服务实现类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class StoreCouponClaimRecordServiceImpl extends ServiceImpl<StoreCouponClaimRecordMapper, StoreCouponClaimRecord> implements StoreCouponClaimRecordService { |
| | | |
| | | private final StoreCouponClaimRecordMapper storeCouponClaimRecordMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(StoreCouponClaimRecordForm form) { |
| | | StoreCouponClaimRecord entity = StoreCouponClaimRecordForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(StoreCouponClaimRecordForm form) { |
| | | StoreCouponClaimRecord entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | baseMapper.deleteBatchIds(ids); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result removeById(String id) { |
| | | baseMapper.deleteById(id); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(StoreCouponClaimRecordQuery query) { |
| | | IPage<StoreCouponClaimRecordVO> page = PageUtil.getPage(query, StoreCouponClaimRecordVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | StoreCouponClaimRecordVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<StoreCouponClaimRecord> entities = baseMapper.selectList(null); |
| | | List<StoreCouponClaimRecordVO> vos = entities.stream() |
| | | .map(entity -> StoreCouponClaimRecordVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import cn.lili.modules.lmk.domain.entity.StoreCoupon; |
| | | import cn.lili.modules.lmk.mapper.StoreCouponMapper; |
| | | import cn.lili.modules.lmk.service.StoreCouponService; |
| | | import cn.lili.base.Result; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import cn.lili.modules.lmk.domain.form.StoreCouponForm; |
| | | import cn.lili.modules.lmk.domain.vo.StoreCouponVO; |
| | | import cn.lili.modules.lmk.domain.query.StoreCouponQuery; |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | import cn.lili.utils.PageUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 店铺优惠卷对应关系 服务实现类 |
| | | * |
| | | * @author peng |
| | | * @since 2025-09-25 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class StoreCouponServiceImpl extends ServiceImpl<StoreCouponMapper, StoreCoupon> implements StoreCouponService { |
| | | |
| | | private final StoreCouponMapper storeCouponMapper; |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(StoreCouponForm form) { |
| | | StoreCoupon entity = StoreCouponForm.getEntityByForm(form, null); |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(StoreCouponForm form) { |
| | | StoreCoupon entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | baseMapper.deleteBatchIds(ids); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result removeById(String id) { |
| | | baseMapper.deleteById(id); |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(StoreCouponQuery query) { |
| | | IPage<StoreCouponVO> page = PageUtil.getPage(query, StoreCouponVO.class); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | StoreCouponVO vo = baseMapper.getById(id); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<StoreCoupon> entities = baseMapper.selectList(null); |
| | | List<StoreCouponVO> vos = entities.stream() |
| | | .map(entity -> StoreCouponVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
| | |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Delete; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 浏览历史数据处理层 |
| | |
| | | "WHERE li_foot_print.member_id = ${memberId} AND latest_footprints.id IS NULL; ") |
| | | void deleteLastFootPrint(String memberId); |
| | | |
| | | |
| | | @Select("SELECT " + |
| | | "lfp.ref_id AS GoodsId, " + |
| | | "lg.goods_name AS GoodsName, "+ |
| | | "COUNT(*) AS view_count " + |
| | | "FROM li_foot_print lfp " + |
| | | "LEFT JOIN li_goods lg ON lfp.ref_id = lg.id " + |
| | | "WHERE lfp.delete_flag = 0 " + |
| | | "AND lfp.create_time BETWEEN #{startTime} AND #{endTime} " + |
| | | "AND lfp.view_type = 'goods' " + |
| | | "AND lg.goods_name is not null " + |
| | | "GROUP BY lfp.ref_id " + // 按商品ID分组 |
| | | "ORDER BY view_count DESC " + |
| | | "LIMIT #{currentLimit}" |
| | | ) |
| | | List<Map<String,Object>> selectViewAndCompletionRateCountByDay(Date startTime, |
| | | Date endTime, |
| | | Integer currentLimit); |
| | | |
| | | /** |
| | | * 按视频维度统计:每个视频的总浏览数和完播率 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @return 包含视频ID、名称、总浏览数、完播率的列表 |
| | | */ |
| | | @Select({ |
| | | "SELECT", |
| | | " lfp.ref_id AS video_id, " + |
| | | " lmk.title, " + |
| | | " COUNT(*) AS total_views, " + |
| | | " ROUND(" + |
| | | " IF(COUNT(*) = 0, 0," + |
| | | " (SUM(" + |
| | | " CASE WHEN ( " + |
| | | " CAST(lfp.play_at AS DECIMAL(10,3)) >= CAST(lmk.video_duration AS DECIMAL(10,3)) " + |
| | | " OR " + |
| | | " CAST(lfp.play_at AS DECIMAL(10,3)) / CAST(lmk.video_duration AS DECIMAL(10,3)) > 0.9 " + |
| | | " ) THEN 1 " + |
| | | " ELSE 0 " + |
| | | " END " + |
| | | " ) / COUNT(*)) * 100 " + |
| | | " ), 2 " + |
| | | " ) AS complete_rate " + |
| | | "FROM li_foot_print lfp" + |
| | | " LEFT JOIN lmk_video lmk ON lfp.ref_id = lmk.id " + // 按实际关联字段调整 |
| | | "WHERE " + |
| | | " lfp.delete_flag = 0", |
| | | " AND lfp.view_type = 'video' " +// 只统计视频类型 |
| | | " AND lfp.create_time BETWEEN #{startTime} AND #{endTime} " + |
| | | " AND lmk.video_duration > 0 " + |
| | | " AND ref_id IS NOT NULL AND lmk.title IS NOT NULL "+ |
| | | "GROUP BY lfp.ref_id "+ |
| | | "ORDER BY total_views DESC " + |
| | | "LIMIT #{currentLimit}" |
| | | }) |
| | | List<Map<String, Object>> selectEachVideoStats( |
| | | Date startTime, |
| | | Date endTime, |
| | | Integer currentLimit |
| | | ); |
| | | |
| | | } |
| | |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | | import cn.lili.modules.member.entity.dto.FootPrintQueryParams; |
| | | import cn.lili.modules.search.entity.dos.EsGoodsIndex; |
| | | import cn.lili.modules.statistics.entity.dto.StatisticsQueryParam; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | |
| | | */ |
| | | long getFootprintNum(); |
| | | |
| | | Result getViewAndCompletionRateCount(StatisticsQueryParam queryParam); |
| | | } |
| | |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.goods.entity.dos.GoodsSku; |
| | | import cn.lili.modules.goods.service.GoodsSkuService; |
| | | import cn.lili.modules.lmk.domain.query.FootPrintQuery; |
| | | import cn.lili.modules.lmk.domain.vo.SimpleVideoTagVO; |
| | | import cn.lili.modules.lmk.domain.vo.VideoFootInfoVo; |
| | | import cn.lili.modules.lmk.domain.vo.VideoFootVO; |
| | | import cn.lili.modules.lmk.domain.vo.VideoVO; |
| | | import cn.lili.modules.lmk.domain.vo.*; |
| | | import cn.lili.modules.lmk.mapper.VideoMapper; |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | | import cn.lili.modules.member.entity.dto.FootPrintQueryParams; |
| | | import cn.lili.modules.member.mapper.FootprintMapper; |
| | | import cn.lili.modules.member.service.FootprintService; |
| | | import cn.lili.modules.search.entity.dos.EsGoodsIndex; |
| | | import cn.lili.modules.statistics.entity.dto.StatisticsQueryParam; |
| | | import cn.lili.mybatis.util.PageUtil; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.IntStream; |
| | |
| | | return this.count(lambdaQueryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public Result getViewAndCompletionRateCount(StatisticsQueryParam queryParam) { |
| | | Date startTime = null; |
| | | Date endTime = new Date(); // 结束时间默认是当前时间 |
| | | List<String> dateList = new ArrayList<>(); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); // 用于日期计算的日历实例 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | int days = 0; |
| | | switch (queryParam.getSearchType()) { |
| | | case "TODAY": |
| | | // 今天:从今天0点到现在 |
| | | calendar.setTime(new Date()); // 重置为当前时间 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); // 小时设为0(24小时制) |
| | | calendar.set(Calendar.MINUTE, 0); // 分钟设为0 |
| | | calendar.set(Calendar.SECOND, 0); // 秒设为0 |
| | | calendar.set(Calendar.MILLISECOND, 0); // 毫秒设为0 |
| | | startTime = calendar.getTime(); // 得到今天0点的Date对象 |
| | | dateList.add(sdf.format(startTime)); |
| | | break; |
| | | case "YESTERDAY": |
| | | // 昨天:从昨天0点到昨天23:59:59.999 |
| | | calendar.setTime(new Date()); |
| | | calendar.add(Calendar.DATE, -1); // 日期减1天(变为昨天) |
| | | |
| | | // 设置昨天0点 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | startTime = calendar.getTime(); |
| | | |
| | | // 设置昨天23:59:59.999 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | calendar.set(Calendar.MILLISECOND, 999); |
| | | endTime = calendar.getTime(); |
| | | |
| | | dateList.add(sdf.format(startTime)); |
| | | break; |
| | | case "LAST_SEVEN": |
| | | // 过去七天:从7天前0点到现在(含今天共7天) |
| | | calendar.setTime(new Date()); |
| | | calendar.add(Calendar.DATE, -6); // 日期减6天(7天前的今天) |
| | | |
| | | // 设置7天前0点 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | startTime = calendar.getTime(); |
| | | |
| | | days = 7; |
| | | // 循环生成7天的日期字符串 |
| | | Calendar tempCalendar = Calendar.getInstance(); |
| | | tempCalendar.setTime(startTime); |
| | | for (int i = 0; i < days; i++) { |
| | | dateList.add(sdf.format(tempCalendar.getTime())); |
| | | tempCalendar.add(Calendar.DATE, 1); // 每天累加1天 |
| | | } |
| | | break; |
| | | case "LAST_THIRTY": |
| | | // 过去30天:从30天前0点到现在(含今天共30天) |
| | | calendar.setTime(new Date()); |
| | | calendar.add(Calendar.DATE, -29); // 日期减29天(30天前的今天) |
| | | |
| | | // 设置30天前0点 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | startTime = calendar.getTime(); |
| | | |
| | | days = 30; |
| | | // 循环生成30天的日期字符串 |
| | | Calendar tempCalendar30 = Calendar.getInstance(); |
| | | tempCalendar30.setTime(startTime); |
| | | for (int i = 0; i < days; i++) { |
| | | dateList.add(sdf.format(tempCalendar30.getTime())); |
| | | tempCalendar30.add(Calendar.DATE, 1); // 每天累加1天 |
| | | } |
| | | break; |
| | | default: |
| | | return Result.error("不支持的时间范围类型"); |
| | | } |
| | | if ("goods".equals(queryParam.getCurrentType())){ |
| | | List<Map<String, Object>> maps = baseMapper.selectViewAndCompletionRateCountByDay(startTime, endTime,queryParam.getCurrentLimit()); |
| | | Map<String,Long> viewPrintMap = maps.stream() |
| | | .collect(Collectors.toMap( |
| | | map -> { |
| | | String goodsId = Objects.toString(map.get("GoodsId"), ""); // 空值处理 |
| | | String goodsName = Objects.toString(map.get("GoodsName"), ""); // 空值处理 |
| | | return goodsName + " | " + goodsId; // 用|分隔,方便后续拆分 |
| | | }, |
| | | map-> Long.valueOf(map.get("view_count").toString()), |
| | | (existing, replacement) -> existing, |
| | | LinkedHashMap::new // 指定使用 LinkedHashMap,保留插入顺序 |
| | | )); |
| | | List<String> yData = new ArrayList<>(); |
| | | List<Long> xData = new ArrayList<>(); |
| | | |
| | | for (Map.Entry<String, Long> entry : viewPrintMap.entrySet()){ |
| | | yData.add(entry.getKey()); |
| | | xData.add(entry.getValue()); |
| | | } |
| | | Map<String,Object> data = new HashMap<>(); |
| | | data.put("yData", yData); |
| | | data.put("xData", xData); |
| | | return Result.ok().data(data); |
| | | }else{ |
| | | List<Map<String, Object>> maps = baseMapper.selectEachVideoStats(startTime, endTime,queryParam.getCurrentLimit()); |
| | | Map<String, VideoViewCompletionRateVO> viewPrintMap = maps.stream() |
| | | .collect(Collectors.toMap( |
| | | map -> { |
| | | String videoId = Objects.toString(map.get("video_id"), ""); // 空值处理 |
| | | String videoName = Objects.toString(map.get("title"), ""); // 空值处理 |
| | | return videoName + " | " + videoId; // 用|分隔,方便后续拆分 |
| | | }, |
| | | map-> { |
| | | VideoViewCompletionRateVO vo = new VideoViewCompletionRateVO(); |
| | | vo.setTotal_views(Long.valueOf(map.get("total_views").toString())); |
| | | vo.setComplete_rate(map.get("complete_rate").toString()); |
| | | return vo; |
| | | }, |
| | | (existing, replacement) -> existing, |
| | | LinkedHashMap::new // 指定使用 LinkedHashMap,保留插入顺序 |
| | | )); |
| | | List<String> yData = new ArrayList<>(); |
| | | List<Long> xData = new ArrayList<>(); |
| | | List<String> rateData = new ArrayList<>(); |
| | | |
| | | for (Map.Entry<String, VideoViewCompletionRateVO> entry : viewPrintMap.entrySet()){ |
| | | yData.add(entry.getKey()); |
| | | xData.add(entry.getValue().getTotal_views()); |
| | | rateData.add(entry.getValue().getComplete_rate()); |
| | | } |
| | | Map<String,Object> data = new HashMap<>(); |
| | | data.put("yData", yData); |
| | | data.put("xData", xData); |
| | | data.put("rateData", rateData); |
| | | return Result.ok().data(data); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | " ORDER BY " + |
| | | " day ASC") |
| | | List<Map<String, Object>> selectOrderCountByDay(Date startTime, Date endTime); |
| | | |
| | | @Select("SELECT " + |
| | | " DATE(create_time) AS day, " + |
| | | " HOUR(create_time) AS hour," + |
| | | " COUNT(*) AS count " + |
| | | " FROM" + |
| | | " li_order o" + |
| | | " WHERE " + |
| | | " o.create_time BETWEEN #{startTime} AND #{endTime} " + |
| | | " GROUP BY" + |
| | | " day " + |
| | | " ORDER BY " + |
| | | " day , hour ASC") |
| | | List<Map<String, Object>> selectOrderTimePeriod(Date startTime, Date endTime); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Result getOrderCount(StatisticsQueryParam queryParam); |
| | | |
| | | Result getOrderTimePeriod(StatisticsQueryParam queryParam); |
| | | } |
| | |
| | | map -> map.get("day").toString(), // 日期字符串(如2023-09-19) |
| | | map -> Long.valueOf(map.get("count").toString()) // 订单数量 |
| | | )); |
| | | System.out.println(dayCountMap); |
| | | |
| | | List<Long> orderCounts = new ArrayList<>(); |
| | | for (String date : dateList) { |
| | | // 核心:存在则取查询结果,不存在则补0 |
| | | orderCounts.add(dayCountMap.getOrDefault(date, 0L)); |
| | | } |
| | | System.out.println(orderCounts); |
| | | |
| | | |
| | | return Result.ok().data(orderCounts); |
| | | } |
| | | |
| | | @Override |
| | | public Result getOrderTimePeriod(StatisticsQueryParam queryParam) { |
| | | Date startTime = null; |
| | | Date endTime = new Date(); // 结束时间默认是当前时间 |
| | | List<String> dateList = new ArrayList<>(); |
| | | |
| | | Calendar calendar = Calendar.getInstance(); // 用于日期计算的日历实例 |
| | | for (int i =0;i<=24;i++){ |
| | | dateList.add(i + "点"); |
| | | } |
| | | switch (queryParam.getSearchType()) { |
| | | case "TODAY": |
| | | // 今天:从今天0点到现在 |
| | | calendar.setTime(new Date()); // 重置为当前时间 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); // 小时设为0(24小时制) |
| | | calendar.set(Calendar.MINUTE, 0); // 分钟设为0 |
| | | calendar.set(Calendar.SECOND, 0); // 秒设为0 |
| | | calendar.set(Calendar.MILLISECOND, 0); // 毫秒设为0 |
| | | startTime = calendar.getTime(); // 得到今天0点的Date对象 |
| | | break; |
| | | case "YESTERDAY": |
| | | // 昨天:从昨天0点到昨天23:59:59.999 |
| | | calendar.setTime(new Date()); |
| | | calendar.add(Calendar.DATE, -1); // 日期减1天(变为昨天) |
| | | |
| | | // 设置昨天0点 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | startTime = calendar.getTime(); |
| | | |
| | | // 设置昨天23:59:59.999 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar.set(Calendar.MINUTE, 59); |
| | | calendar.set(Calendar.SECOND, 59); |
| | | calendar.set(Calendar.MILLISECOND, 999); |
| | | endTime = calendar.getTime(); |
| | | |
| | | break; |
| | | case "LAST_SEVEN": |
| | | // 过去七天:从7天前0点到现在(含今天共7天) |
| | | calendar.setTime(new Date()); |
| | | calendar.add(Calendar.DATE, -6); // 日期减6天(7天前的今天) |
| | | |
| | | // 设置7天前0点 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | startTime = calendar.getTime(); |
| | | |
| | | break; |
| | | case "LAST_THIRTY": |
| | | // 过去30天:从30天前0点到现在(含今天共30天) |
| | | calendar.setTime(new Date()); |
| | | calendar.add(Calendar.DATE, -29); // 日期减29天(30天前的今天) |
| | | |
| | | // 设置30天前0点 |
| | | calendar.set(Calendar.HOUR_OF_DAY, 0); |
| | | calendar.set(Calendar.MINUTE, 0); |
| | | calendar.set(Calendar.SECOND, 0); |
| | | calendar.set(Calendar.MILLISECOND, 0); |
| | | startTime = calendar.getTime(); |
| | | |
| | | break; |
| | | default: |
| | | return Result.error("不支持的时间范围类型"); |
| | | } |
| | | List<Map<String, Object>> maps = baseMapper.selectOrderTimePeriod(startTime,endTime); |
| | | |
| | | Map<String, Long> dayCountMap = maps.stream() |
| | | .collect(Collectors.toMap( |
| | | map -> map.get("day").toString(), // 日期字符串(如2023-09-19) |
| | | map -> Long.valueOf(map.get("count").toString()) // 订单数量 |
| | | )); |
| | | |
| | | List<Long> orderCounts = new ArrayList<>(); |
| | | for (String date : dateList) { |
| | | // 核心:存在则取查询结果,不存在则补0 |
| | | orderCounts.add(dayCountMap.getOrDefault(date, 0L)); |
| | | } |
| | | |
| | | |
| | | return Result.ok().data(orderCounts); |
| | | } |
| | |
| | | @ApiModelProperty(value = "店铺ID") |
| | | private String storeId; |
| | | |
| | | @ApiModelProperty(value = "类型:商品goods 、视频video") |
| | | private String currentType; |
| | | |
| | | @ApiModelProperty(value = "显示排名:10,20,30") |
| | | private Integer currentLimit; |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.lili.modules.lmk.mapper.StoreCouponClaimRecordMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.StoreCouponClaimRecordVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="store_name" property="storeName" /> |
| | | <result column="coupon_id" property="couponId" /> |
| | | <result column="coupon_name" property="couponName" /> |
| | | <result column="store_id" property="storeId" /> |
| | | <result column="user_id" property="userId" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSCCR.store_name, |
| | | LSCCR.coupon_id, |
| | | LSCCR.coupon_name, |
| | | LSCCR.store_id, |
| | | LSCCR.user_id, |
| | | LSCCR.id |
| | | FROM |
| | | lmk_store_coupon_claim_record LSCCR |
| | | WHERE |
| | | LSCCR.id = #{id} AND LSCCR.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSCCR.store_name, |
| | | LSCCR.coupon_id, |
| | | LSCCR.coupon_name, |
| | | LSCCR.store_id, |
| | | LSCCR.user_id, |
| | | LSCCR.id |
| | | FROM |
| | | lmk_store_coupon_claim_record LSCCR |
| | | WHERE |
| | | LSCCR.delete_flag = 0 |
| | | </select> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="cn.lili.modules.lmk.mapper.StoreCouponMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.StoreCouponVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="store_id" property="storeId" /> |
| | | <result column="store_name" property="storeName" /> |
| | | <result column="coupon_id" property="couponId" /> |
| | | <result column="coupon_name" property="couponName" /> |
| | | </resultMap> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSC.store_id, |
| | | LSC.store_name, |
| | | LSC.coupon_id, |
| | | LSC.coupon_name, |
| | | LSC.id |
| | | FROM |
| | | lmk_store_coupon LSC |
| | | WHERE |
| | | LSC.id = #{id} AND LSC.delete_flag = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSC.store_id, |
| | | LSC.store_name, |
| | | LSC.coupon_id, |
| | | LSC.coupon_name, |
| | | LSC.id |
| | | FROM |
| | | lmk_store_coupon LSC |
| | | WHERE |
| | | LSC.delete_flag = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.lmk.domain.vo.PvUvVO; |
| | | import cn.lili.modules.lmk.enums.general.StatisticsSearchTypeEnum; |
| | | import cn.lili.modules.member.service.FootprintService; |
| | | import cn.lili.modules.order.order.service.OrderService; |
| | | import cn.lili.modules.statistics.entity.dto.StatisticsQueryParam; |
| | | import cn.lili.modules.statistics.entity.vo.PlatformViewVO; |
| | |
| | | @RequestMapping("/manager/lmk/statistics") |
| | | public class StatisticsController { |
| | | private final OrderService orderService; |
| | | |
| | | private final FootprintService footprintService; |
| | | |
| | | @ApiOperation(value = "获取pv、uv流量数据 表单获取") |
| | | @GetMapping("/pvUv") |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 视频/商品 完播率和浏览量统计 |
| | | * @param queryParam |
| | | * @return |
| | | */ |
| | | @GetMapping("/viewAndCompletionRateCount") |
| | | public Result getViewAndCompletionRateCount(StatisticsQueryParam queryParam) { |
| | | return footprintService.getViewAndCompletionRateCount(queryParam); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/orderTimePeriod") |
| | | public Result getOrderTimePeriod(StatisticsQueryParam queryParam) { |
| | | return orderService.getOrderTimePeriod(queryParam); |
| | | |
| | | } |
| | | } |