New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.modules.lmk.domain.form.ActivityReportForm; |
| | | import cn.lili.modules.lmk.service.ActivityService; |
| | | import cn.lili.modules.lmk.service.MyActivityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "小程序端活动管理", tags = "小程序端活动管理") |
| | | @RestController |
| | | @RequestMapping("/buyer/lmk/activityReport") |
| | | public class ActivityReportController { |
| | | |
| | | private final ActivityService activityService; |
| | | |
| | | private final MyActivityService myActivityService; |
| | | |
| | | @GetMapping() |
| | | @ApiOperation(value = "活动列表", notes = "活动列表") |
| | | public Result getAllActivity(){ |
| | | return activityService.all(); |
| | | } |
| | | |
| | | @PostMapping() |
| | | @ApiOperation(value = "报名活动", notes = "活动报名") |
| | | public Result activityReport(@RequestBody ActivityReportForm activityReportForm){ |
| | | |
| | | return myActivityService.activityReport(activityReportForm); |
| | | } |
| | | |
| | | @GetMapping("/getDetail/{activityId}") |
| | | @ApiOperation(value = "活动详情", notes = "活动详情") |
| | | public Result getActivityDetail(@PathVariable String activityId){ |
| | | return myActivityService.detailByUsr(activityId); |
| | | } |
| | | } |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.modules.lmk.domain.query.ActivityReportQuery; |
| | | import cn.lili.modules.lmk.domain.query.MyActivityQuery; |
| | | import cn.lili.modules.lmk.service.ActivityService; |
| | |
| | | @GetMapping("/getMyActivityList") |
| | | @ApiOperation(value = "获得我的活动列表", notes = "获得我的活动列表") |
| | | public Result getMyActivityList(MyActivityQuery query){ |
| | | |
| | | return myActivityService.getMyActivityList(query); |
| | | |
| | | } |
| | | |
| | | |
| | | @PutMapping("/cancelActivity") |
| | | @ApiOperation(value = "获得我的活动列表", notes = "获得我的活动列表") |
| | | public Result cancelActivity(@RequestBody ActivityReportQuery query){ |
| | | return myActivityService.cancelActivity(query); |
| | | @PutMapping("/activityCancel/{activityId}") |
| | | @ApiOperation(value = "取消活动", notes = "取消活动") |
| | | public Result activityCancel(@PathVariable String activityId){ |
| | | return myActivityService.activityCancel(activityId); |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.controller.lmk; |
| | | |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.form.StoreMemberForm; |
| | | import cn.lili.modules.lmk.domain.query.StoreMemberQuery; |
| | | import cn.lili.modules.lmk.service.StoreMemberService; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 用户权限管理(商家) 前端控制器 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-30 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "用户权限管理(商家)", tags = "用户权限管理(商家)管理") |
| | | @RestController |
| | | @RequestMapping("/buyer/lmk/lmk-user-permissions") |
| | | public class StoreMemberController { |
| | | // store_member |
| | | private final StoreMemberService storeMemberService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) StoreMemberForm form) { |
| | | return storeMemberService.add(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) StoreMemberForm form) { |
| | | return storeMemberService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return storeMemberService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return storeMemberService.remove(ids); |
| | | } |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(StoreMemberQuery query) { |
| | | return storeMemberService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return storeMemberService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return storeMemberService.all(); |
| | | } |
| | | } |
| | |
| | | public Result homePageInfoEdit(@RequestBody @Validated VideoHomePageInfoForm form) { |
| | | return videoService.homePageInfoEdit(form); |
| | | } |
| | | |
| | | @GetMapping("/wx/detail/{id}") |
| | | @ApiOperation(value = "小程序-获取视频详情", notes = "小程序-获取视频详情") |
| | | public Result wxDetail(@PathVariable("id") String id) { |
| | | return videoService.wxDetail(id); |
| | | } |
| | | } |
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 lombok.Data; |
| | | |
| | | @Data |
| | | @TableName("lmk_activity_report") |
| | | public class ActivityReport extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("activity_id") |
| | | private String activityId; |
| | | |
| | | @TableField("user_id") |
| | | private String userId; |
| | | |
| | | @TableField("cancel") |
| | | private Boolean cancel; |
| | | } |
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 zxl |
| | | * @since 2025-05-30 |
| | | */ |
| | | @Data |
| | | @TableName("lmk_store_member") |
| | | public class StoreMember extends BaseEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField("real_name") |
| | | /** 真实姓名 */ |
| | | private String realName; |
| | | |
| | | @TableField("role") |
| | | /** 角色 */ |
| | | private String role; |
| | | |
| | | @TableField("member_id") |
| | | /** 会员用户id */ |
| | | private String memberId; |
| | | /** 商户id */ |
| | | @TableField("store_id") |
| | | private String storeId; |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.modules.lmk.domain.entity.Activity; |
| | | import cn.lili.modules.lmk.domain.entity.ActivityReport; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | @Data |
| | | @ApiModel(value = "报名活动表单", description = "报名活动表单") |
| | | public class ActivityReportForm extends AbsForm { |
| | | |
| | | /** 活动id */ |
| | | @ApiModelProperty(value = "活动id") |
| | | @NotBlank |
| | | private String activityId; |
| | | |
| | | /** 是否取消报名 */ |
| | | @ApiModelProperty(value = "取消那报名") |
| | | private Boolean cancel; |
| | | |
| | | public static ActivityReport getEntityByForm(@NonNull ActivityReportForm form, ActivityReport entity) { |
| | | if(entity == null) { |
| | | entity = new ActivityReport(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.form; |
| | | |
| | | import cn.lili.base.AbsForm; |
| | | import cn.lili.group.Add; |
| | | import cn.lili.group.Update; |
| | | import cn.lili.modules.lmk.domain.entity.StoreMember; |
| | | import org.springframework.beans.BeanUtils; |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import org.springframework.lang.NonNull; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 用户权限管理(商家)表单 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "LmkUserPermissions表单", description = "用户权限管理(商家)表单") |
| | | public class StoreMemberForm extends AbsForm { |
| | | |
| | | @NotBlank(message = "真实姓名不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("真实姓名") |
| | | private String realName; |
| | | |
| | | @NotBlank(message = "电话号码不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("电话号码") |
| | | private String mobile; |
| | | |
| | | @NotBlank(message = "密码不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("密码") |
| | | private String password; |
| | | |
| | | |
| | | @NotBlank(message = "角色不能为空", groups = {Add.class, Update.class}) |
| | | @ApiModelProperty("角色Json字符串") |
| | | private String role; |
| | | |
| | | |
| | | public static StoreMember getEntityByForm(@NonNull StoreMemberForm form, StoreMember entity) { |
| | | if(entity == null) { |
| | | entity = new StoreMember(); |
| | | } |
| | | BeanUtils.copyProperties(form, entity); |
| | | return entity; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("作者id") |
| | | private String authorId; |
| | | |
| | | /** |
| | | * 是否是本人查询 |
| | | */ |
| | | @ApiModelProperty(hidden = true) |
| | | private Boolean authorSelf; |
| | | |
| | | } |
| | | |
| | |
| | | /** 是否取消*/ |
| | | private Boolean cancel; |
| | | |
| | | @NotBlank |
| | | private String id; |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.query; |
| | | |
| | | import cn.lili.base.AbsQuery; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 用户权限管理(商家)查询 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "LmkUserPermissions查询参数", description = "用户权限管理(商家)查询参数") |
| | | public class StoreMemberQuery extends AbsQuery { |
| | | |
| | | /** 真实姓名*/ |
| | | private String realName; |
| | | /** 店铺id */ |
| | | private String storeId; |
| | | } |
| | | |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.Activity; |
| | | import cn.lili.modules.lmk.domain.entity.ActivityReport; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ActivityReport中间表响应数据", description = "响应数据") |
| | |
| | | |
| | | /** 用户id*/ |
| | | private String userId; |
| | | |
| | | private Boolean cancel; |
| | | |
| | | public static ActivityReportVO getVoByEntity(@NonNull ActivityReport entity, ActivityReportVO vo) { |
| | | if(vo == null) { |
| | | vo = new ActivityReportVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | } |
| | |
| | | /** 报名人员集合*/ |
| | | private List<MemberVO> members; |
| | | |
| | | private Boolean isReport; |
| | | |
| | | public static ActivityVO getVoByEntity(@NonNull Activity entity, ActivityVO vo) { |
| | | if(vo == null) { |
| | | vo = new ActivityVO(); |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.StoreMember; |
| | | import org.springframework.lang.NonNull; |
| | | import org.springframework.beans.BeanUtils; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 用户权限管理(商家)展示 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-30 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "用户权限管理(商家)响应数据", description = "用户权限管理(商家)响应数据") |
| | | public class StoreMemberVO extends AbsVo { |
| | | |
| | | /** 电话 */ |
| | | @ApiModelProperty("电话") |
| | | private String mobile; |
| | | |
| | | /** 用户名 */ |
| | | @ApiModelProperty("用户名") |
| | | private String userName; |
| | | |
| | | /** 真实姓名 */ |
| | | @ApiModelProperty("真实姓名") |
| | | private String realName; |
| | | |
| | | /** 密码 */ |
| | | @ApiModelProperty("密码") |
| | | private String password; |
| | | |
| | | /** 角色 */ |
| | | @ApiModelProperty("角色") |
| | | private String role; |
| | | |
| | | /** 用户id */ |
| | | @ApiModelProperty("用户id") |
| | | private String memberId; |
| | | |
| | | /** 店铺id */ |
| | | @ApiModelProperty("店铺id") |
| | | private String storeId; |
| | | |
| | | public static StoreMemberVO getVoByEntity(@NonNull StoreMember entity, StoreMemberVO vo) { |
| | | if(vo == null) { |
| | | vo = new StoreMemberVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | | /** |
| | | * @author:xp |
| | | * @date:2025/6/4 14:23 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | public class VideoOption { |
| | | |
| | | /** |
| | | * 命令标识 |
| | | * |
| | | */ |
| | | private String command; |
| | | |
| | | /** |
| | | * 展示值 |
| | | * |
| | | */ |
| | | private String label; |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.domain.vo; |
| | | |
| | | import cn.lili.base.AbsVo; |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import cn.lili.modules.lmk.domain.form.WxVideoTagForm; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.lang.NonNull; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容展示 |
| | | * |
| | | * @author xp |
| | | * @since 2025-05-16 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "视频内容响应数据", description = "视频内容响应数据") |
| | | public class WxEditVideoVO extends AbsVo { |
| | | |
| | | |
| | | /** 图片封面 */ |
| | | @ApiModelProperty("图片封面") |
| | | private String coverUrl; |
| | | private String coverFileKey; |
| | | |
| | | /** 视频地址 */ |
| | | @ApiModelProperty("视频地址") |
| | | private String videoFileKey; |
| | | private String videoUrl; |
| | | |
| | | @ApiModelProperty("视频标签") |
| | | private List<WxVideoTagForm> tags; |
| | | |
| | | /** 视频填充模式 */ |
| | | @ApiModelProperty("视频填充模式") |
| | | private String videoFit; |
| | | |
| | | /** 视频标题 */ |
| | | @ApiModelProperty("视频标题") |
| | | private String title; |
| | | |
| | | /** 商品信息 */ |
| | | @ApiModelProperty("商品信息") |
| | | private String goodsId; |
| | | |
| | | @ApiModelProperty("视频长度:秒") |
| | | private Long videoDuration; |
| | | |
| | | |
| | | public static WxEditVideoVO getVoByEntity(@NonNull Video entity, WxEditVideoVO vo) { |
| | | if(vo == null) { |
| | | vo = new WxEditVideoVO(); |
| | | } |
| | | BeanUtils.copyProperties(entity, vo); |
| | | return vo; |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("评论数") |
| | | private Long commentNum; |
| | | |
| | | /** 视频拥有的操作 */ |
| | | @ApiModelProperty("视频支持的操作") |
| | | private List<VideoOption> options; |
| | | |
| | | @ApiModelProperty("视频状态") |
| | | private String status; |
| | | |
| | | |
| | | public static WxVideoVO getVoByEntity(@NonNull Video entity, WxVideoVO vo) { |
| | | if(vo == null) { |
New file |
| | |
| | | package cn.lili.modules.lmk.enums.general; |
| | | |
| | | import cn.lili.modules.lmk.domain.vo.VideoOption; |
| | | import lombok.Getter; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频支持的操作 |
| | | * |
| | | * @author:xp |
| | | * @date:2025/5/14 10:30 |
| | | */ |
| | | @Getter |
| | | public enum VideoSupportOpEnum { |
| | | |
| | | UP("UP", "发布"), |
| | | DOWN("DOWN", "下架"), |
| | | DELETE("DELETE", "删除"), |
| | | EDIT("EDIT", "编辑"), |
| | | ; |
| | | |
| | | private final String value; |
| | | |
| | | |
| | | private final String desc; |
| | | |
| | | VideoSupportOpEnum(String value, String desc) { |
| | | this.value = value; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | /** |
| | | * 根据视频状态获取到对应的操作 |
| | | * |
| | | * @param status |
| | | * @return |
| | | */ |
| | | public static List<VideoOption> getVideoOpByStatus(String status) { |
| | | if (VideoStatusEnum.AUDITING.getValue().equals(status)) { |
| | | return Arrays.asList(new VideoOption(EDIT.value, EDIT.desc), new VideoOption(DELETE.value, DELETE.desc)); |
| | | } else if (VideoStatusEnum.DISABLE.getValue().equals(status)) { |
| | | return Arrays.asList(new VideoOption(EDIT.value, EDIT.desc), new VideoOption(UP.value, UP.desc), new VideoOption(DELETE.value, DELETE.desc)); |
| | | } else if (VideoStatusEnum.PUBLISHED.getValue().equals(status)) { |
| | | return Arrays.asList(new VideoOption(EDIT.value, EDIT.desc), new VideoOption(DOWN.value, DOWN.desc), new VideoOption(DELETE.value, DELETE.desc)); |
| | | } else if (VideoStatusEnum.REJECT.getValue().equals(status)) { |
| | | return Arrays.asList(new VideoOption(EDIT.value, EDIT.desc), new VideoOption(DELETE.value, DELETE.desc)); |
| | | } |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | | * 获取含义 |
| | | * |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public static String getDescByValue(String value) { |
| | | if (StringUtils.isBlank(value)) { |
| | | return null; |
| | | } |
| | | for (VideoSupportOpEnum e : VideoSupportOpEnum.values()){ |
| | | if (value.equals(e.getValue())) { |
| | | return e.getDesc(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.Activity; |
| | | import cn.lili.modules.lmk.domain.entity.CustomerBlack; |
| | | import cn.lili.modules.lmk.domain.query.*; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityReportVO; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityVO; |
| | |
| | | |
| | | IPage getMembers(IPage page, @Param("query") ActivityMembersQuery query); |
| | | |
| | | List<MyActivityVo> getMyActivityList(@Param("query")MyActivityQuery query); |
| | | |
| | | int cancelActivity(String id); |
| | | |
| | | ActivityReportVO getActivityReport(@Param("query")ActivityReportQuery query); |
| | | List<MyActivityVo> getMyActivityList(@Param("query")MyActivityQuery query,@Param("userId") String userId); |
| | | |
| | | /** |
| | | * 批量更新活动 |
| | |
| | | * @return 受影响的行数 |
| | | */ |
| | | int batchUpdateActivities(@Param("list") List<Activity> activityList); |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.ActivityReport; |
| | | import cn.lili.modules.lmk.domain.query.ActivityReportQuery; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityReportVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 报名中间表接口 |
| | | */ |
| | | @Mapper |
| | | public interface ActivityReportMapper extends BaseMapper<ActivityReport> { |
| | | |
| | | /** |
| | | * 获得中间表的信息 |
| | | * @param activityId 活动id |
| | | * @param userId 用戶id |
| | | * @return |
| | | */ |
| | | ActivityReportVO getActivityReport(@Param("activityId") String activityId, @Param("userId") String userId); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.mapper; |
| | | |
| | | import cn.lili.modules.lmk.domain.entity.StoreMember; |
| | | import cn.lili.modules.lmk.domain.query.StoreMemberQuery; |
| | | import cn.lili.modules.lmk.domain.vo.StoreMemberVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * 用户权限管理(商家) Mapper 接口 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-30 |
| | | */ |
| | | @Mapper |
| | | public interface StoreMemberMapper extends BaseMapper<StoreMember> { |
| | | |
| | | /** |
| | | * id查找用户权限管理(商家) |
| | | * @param id |
| | | * @return |
| | | */ |
| | | StoreMemberVO getById(String id); |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | IPage getPage(IPage page, @Param("query") StoreMemberQuery query); |
| | | |
| | | } |
| | |
| | | import cn.lili.modules.lmk.domain.entity.Video; |
| | | import cn.lili.modules.lmk.domain.query.AuthorVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.ManagerVideoQuery; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import cn.lili.modules.lmk.domain.vo.VideoAccountVO; |
| | | import cn.lili.modules.lmk.domain.vo.WxVideoVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import cn.lili.modules.lmk.domain.vo.VideoVO; |
| | | import cn.lili.modules.lmk.domain.form.VideoForm; |
| | | import cn.lili.modules.lmk.domain.query.VideoQuery; |
| | | import java.util.List; |
| | | import cn.lili.modules.lmk.domain.vo.WxEditVideoVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 视频内容 Mapper 接口 |
| | |
| | | * @param query |
| | | */ |
| | | IPage getAuthorCollectVideoPage(IPage page, @Param("query") AuthorVideoQuery query); |
| | | |
| | | /** |
| | | * 小程序-视频详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | WxEditVideoVO wxDetail(@Param("id") String id); |
| | | } |
| | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.entity.Activity; |
| | | import cn.lili.modules.lmk.domain.form.ActivityForm; |
| | | import cn.lili.modules.lmk.domain.form.ActivityReportForm; |
| | | import cn.lili.modules.lmk.domain.query.ActivityMembersQuery; |
| | | import cn.lili.modules.lmk.domain.query.ActivityQuery; |
| | | import cn.lili.modules.lmk.domain.query.MyActivityQuery; |
| | |
| | | |
| | | Result activityMembersPage(ActivityMembersQuery query); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.entity.Activity; |
| | | import cn.lili.modules.lmk.domain.form.ActivityReportForm; |
| | | import cn.lili.modules.lmk.domain.query.ActivityReportQuery; |
| | | import cn.lili.modules.lmk.domain.query.MyActivityQuery; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityReportVO; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | public interface MyActivityService extends IService<Activity> { |
| | | public Result getMyActivityList(MyActivityQuery query); |
| | | |
| | | public Result cancelActivity(ActivityReportQuery query); |
| | | public Result activityCancel(String activityId); |
| | | |
| | | Result activityReport(ActivityReportForm activityReportForm); |
| | | |
| | | /** |
| | | * 获得报名中间表对象更具活动id ,(用户id)来自user上下文 |
| | | * @param activityId 活动id |
| | | * @return 未查到 返回 null |
| | | */ |
| | | ActivityReportVO userReport(String activityId); |
| | | |
| | | Result detailByUsr(String activityId); |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service; |
| | | |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.modules.lmk.domain.entity.StoreMember; |
| | | import cn.lili.modules.lmk.domain.form.StoreMemberForm; |
| | | import cn.lili.modules.lmk.domain.query.StoreMemberQuery; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户权限管理(商家) 服务类 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-30 |
| | | */ |
| | | public interface StoreMemberService extends IService<StoreMember> { |
| | | |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result add(StoreMemberForm form); |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | Result update(StoreMemberForm form); |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | Result remove(List<String> ids); |
| | | |
| | | /** |
| | | * id删除 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result removeById(String id); |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | Result page(StoreMemberQuery query); |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result detail(String id); |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | Result all(); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Result homePageInfoEdit(VideoHomePageInfoForm form); |
| | | |
| | | /** |
| | | * 小程序-视频详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | Result wxDetail(String id); |
| | | } |
| | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.enums.ActivityStatusEnum; |
| | | import cn.lili.modules.lmk.domain.entity.Activity; |
| | | import cn.lili.modules.lmk.domain.entity.CustomerBlack; |
| | | import cn.lili.modules.lmk.domain.entity.CustomerTagRef; |
| | | import cn.lili.modules.lmk.domain.entity.ActivityReport; |
| | | import cn.lili.modules.lmk.domain.form.ActivityForm; |
| | | import cn.lili.modules.lmk.domain.form.CustomerTagRefForm; |
| | | import cn.lili.modules.lmk.domain.form.ActivityReportForm; |
| | | import cn.lili.modules.lmk.domain.query.ActivityMembersQuery; |
| | | import cn.lili.modules.lmk.domain.query.ActivityQuery; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityReportVO; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityVO; |
| | | import cn.lili.modules.lmk.domain.vo.CustomerBlackVO; |
| | | import cn.lili.modules.lmk.mapper.ActivityMapper; |
| | | import cn.lili.modules.lmk.mapper.CustomerBlackMapper; |
| | | import cn.lili.modules.lmk.mapper.ActivityReportMapper; |
| | | import cn.lili.modules.lmk.service.ActivityService; |
| | | import cn.lili.modules.lmk.service.LmkFileService; |
| | | import cn.lili.modules.lmk.service.MyActivityService; |
| | | import cn.lili.modules.member.entity.vo.MemberVO; |
| | | import cn.lili.modules.member.service.MemberService; |
| | | import cn.lili.utils.PageUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import io.micrometer.core.instrument.util.StringUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | @RequiredArgsConstructor |
| | | public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> implements ActivityService { |
| | | |
| | | private final ActivityMapper activityMapper; |
| | | |
| | | private final LmkFileService lmkFileService; |
| | | |
| | | private final MyActivityService activityService; |
| | | |
| | | private final ActivityReportMapper activityReportMapper; |
| | | |
| | | @Override |
| | | public Result add(ActivityForm form) { |
| | |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | | public void updateByList(List<Activity> vo){ |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Result remove(List<String> ids) { |
| | | baseMapper.deleteBatchIds(ids); |
| | |
| | | |
| | | @Override |
| | | public Result removeById(String id) { |
| | | //TODO 先判断活动是否有报名人员 |
| | | //有的话不可删除 联中间表查询 |
| | | |
| | | |
| | | |
| | | |
| | | //删除,同时判断该对象的封面是否存在 ,存在则在云服务器删除 |
| | | ActivityVO vo = baseMapper.getById(id); |
| | | if (StringUtils.isNotEmpty(vo.getCover())){ |
| | | lmkFileService.deleteObject(vo.getCover()); |
| | | } |
| | | baseMapper.deleteById(id); |
| | | |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Result all() { |
| | | List<Activity> entities = baseMapper.selectList(null); |
| | | List<ActivityVO> vos = entities.stream() |
| | | .map(entity -> ActivityVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | List<ActivityVO> reportActivityVo =vos.stream().filter(item -> ActivityStatusEnum.REPORT.getType().equals(item.getStatus())).collect(Collectors.toList()); |
| | | return Result.ok().data(reportActivityVo); |
| | | } |
| | | |
| | | @Override |
| | |
| | | baseMapper.getMembers(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.modules.lmk.domain.entity.Activity; |
| | | import cn.lili.modules.lmk.domain.entity.ActivityReport; |
| | | import cn.lili.modules.lmk.domain.form.ActivityReportForm; |
| | | import cn.lili.modules.lmk.domain.query.ActivityReportQuery; |
| | | import cn.lili.modules.lmk.domain.query.MyActivityQuery; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityReportVO; |
| | | import cn.lili.modules.lmk.domain.vo.ActivityVO; |
| | | import cn.lili.modules.lmk.domain.vo.MyActivityVo; |
| | | import cn.lili.modules.lmk.mapper.ActivityMapper; |
| | | import cn.lili.modules.lmk.service.LmkFileService; |
| | | import cn.lili.modules.lmk.mapper.ActivityReportMapper; |
| | | import cn.lili.modules.lmk.service.MyActivityService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xkzhangsan.time.utils.StringUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | @RequiredArgsConstructor |
| | | public class MyActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> implements MyActivityService { |
| | | private final ActivityMapper activityMapper; |
| | | private final LmkFileService lmkFileService; |
| | | |
| | | private final ActivityReportMapper activityReportMapper; |
| | | |
| | | |
| | | @Override |
| | | public Result getMyActivityList(MyActivityQuery query) { |
| | | List<MyActivityVo> myActivityList = activityMapper.getMyActivityList(query); |
| | | String userId = UserContext.getCurrentUserId(); |
| | | List<MyActivityVo> myActivityList = activityMapper.getMyActivityList(query,userId); |
| | | |
| | | for (MyActivityVo vo : myActivityList) { |
| | | System.out.println(vo); |
| | | if (!"文字".equals(vo.getCoverType())){ |
| | | // String url = lmkFileService.getPreviewUrl(vo.getCover()); |
| | | // vo.setUrl(url); |
| | | } |
| | | } |
| | | return Result.ok().data(myActivityList); |
| | | } |
| | | |
| | | @Override |
| | | public Result cancelActivity(ActivityReportQuery query) { |
| | | public Result activityCancel(String activityId) { |
| | | // TODO 判断是否在报名时间内 在的话可以取消报名, (若有报名费需要退款) |
| | | ActivityReportVO vo = activityMapper.getActivityReport(query); |
| | | //获得中间表信息 |
| | | ActivityReportVO vo = userReport(activityId); |
| | | |
| | | Activity activity = activityMapper.selectById(vo.getActivityId()); |
| | | Activity activity = activityMapper.selectById(activityId); |
| | | |
| | | Date date = new Date(); |
| | | if(!date.before(activity.getReportStartTime()) && !date.after(activity.getReportEndTime())){ |
| | | int affectedRows = activityMapper.cancelActivity(vo.getId()); |
| | | |
| | | if (affectedRows > 0) { |
| | | boolean rowsAffected = new LambdaUpdateChainWrapper<ActivityReport>(activityReportMapper) |
| | | .eq(ActivityReport::getId, vo.getId()) // WHERE id = ? |
| | | .set(ActivityReport::getCancel, true) // SET cancel = true |
| | | .update(); // 执行更新 |
| | | |
| | | |
| | | if (rowsAffected) { |
| | | return Result.ok("活动取消成功"); |
| | | } else { |
| | | // 可选:记录警告日志 |
| | | throw new RuntimeException("活动不存在或已取消"); |
| | | return Result.error("活动不存在或已取消"); |
| | | } |
| | | }else { |
| | | throw new RuntimeException("活动已不在报名时间内无法取消"); |
| | | return Result.error("活动已不在报名时间内无法取消"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Result activityReport(ActivityReportForm reportActivityForm) { |
| | | //判断用户是否已经报名该活动 |
| | | ActivityReportVO reportVO = userReport(reportActivityForm.getActivityId()); |
| | | if (reportVO != null) { |
| | | //判断是否已取消过该活动 |
| | | if (reportVO.getCancel()){ |
| | | //重新报名 |
| | | |
| | | ActivityReport entity = ActivityReportForm.getEntityByForm(reportActivityForm, null); |
| | | entity.setId(reportVO.getId()); |
| | | entity.setUserId(UserContext.getCurrentUserId()); |
| | | entity.setCancel(false); |
| | | activityReportMapper.updateById(entity); |
| | | return Result.ok("成功"); |
| | | }else { |
| | | return Result.error("该活动已报名"); |
| | | } |
| | | |
| | | |
| | | } |
| | | ActivityReport entity = ActivityReportForm.getEntityByForm(reportActivityForm, null); |
| | | entity.setUserId(UserContext.getCurrentUserId()); |
| | | activityReportMapper.insert(entity); |
| | | return Result.ok("成功"); |
| | | } |
| | | |
| | | /** |
| | | * 获得中间表信息通过activityId,userId |
| | | * @param activityId 活动id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ActivityReportVO userReport(String activityId){ |
| | | |
| | | if (UserContext.getCurrentUserId() == null || UserContext.getCurrentUserId().isEmpty()){ |
| | | throw new RuntimeException("用户登录状态异常"); |
| | | } |
| | | return activityReportMapper.getActivityReport(activityId,UserContext.getCurrentUserId()); |
| | | } |
| | | |
| | | @Override |
| | | public Result detailByUsr(String activityId) { |
| | | ActivityVO vo = baseMapper.getById(activityId); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | |
| | | ActivityReportVO reportVO = userReport(activityId); |
| | | //则当前用户未报名 |
| | | if (reportVO == null){ |
| | | vo.setIsReport(false); |
| | | }else { |
| | | //已取消则可以报名 |
| | | if (reportVO.getCancel()){ |
| | | vo.setIsReport(false); |
| | | }else { |
| | | vo.setIsReport(true); |
| | | } |
| | | |
| | | } |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.base.Result; |
| | | |
| | | import cn.lili.common.security.AuthUser; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.modules.lmk.domain.entity.StoreMember; |
| | | import cn.lili.modules.lmk.domain.form.StoreMemberForm; |
| | | import cn.lili.modules.lmk.domain.query.StoreMemberQuery; |
| | | import cn.lili.modules.lmk.domain.vo.StoreMemberVO; |
| | | import cn.lili.modules.lmk.mapper.StoreMemberMapper; |
| | | import cn.lili.modules.lmk.service.StoreMemberService; |
| | | import cn.lili.modules.member.entity.dos.Member; |
| | | import cn.lili.modules.member.entity.dto.ManagerMemberEditDTO; |
| | | import cn.lili.modules.member.entity.dto.MemberAddDTO; |
| | | import cn.lili.modules.member.service.MemberService; |
| | | import cn.lili.utils.PageUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 用户权限管理(商家) 服务实现类 |
| | | * |
| | | * @author zxl |
| | | * @since 2025-05-30 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class StoreMemberServiceImpl extends ServiceImpl<StoreMemberMapper, StoreMember> implements StoreMemberService { |
| | | |
| | | private final StoreMemberMapper storeMemberMapper; |
| | | |
| | | private final MemberService memberService; |
| | | /** |
| | | * 添加 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result add(StoreMemberForm form) { |
| | | //插入到用户表中 |
| | | AuthUser currentUser = UserContext.getCurrentUser(); |
| | | String id = currentUser.getId(); |
| | | // String storeId = currentUser.getStoreId(); |
| | | String storeId = "12312323123"; |
| | | if (id == null || storeId == null) { |
| | | return Result.error("当前登录账户未绑定商户或用户id获取异常"); |
| | | } |
| | | |
| | | //插入会员表 |
| | | MemberAddDTO addDTO = new MemberAddDTO(); |
| | | addDTO.setMobile(form.getMobile()); |
| | | addDTO.setPassword(form.getPassword()); |
| | | addDTO.setUsername(form.getMobile()); |
| | | |
| | | Member member = memberService.addMember(addDTO); |
| | | |
| | | //插入用户权限表 |
| | | //id插入问题 |
| | | StoreMember entity = StoreMemberForm.getEntityByForm(form, null); |
| | | entity.setMemberId(member.getId()); |
| | | entity.setStoreId(storeId); |
| | | |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | * @param form |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result update(StoreMemberForm form) { |
| | | StoreMember entity = baseMapper.selectById(form.getId()); |
| | | |
| | | //TODO 是否需要判断密码新密码 |
| | | //会员修改密码,电话 |
| | | memberService.updateMemberPartProperties(entity.getMemberId(),form.getPassword(),form.getMobile()); |
| | | |
| | | //修改真实姓名 |
| | | entity.setRealName(form.getRealName()); |
| | | entity.setRole(form.getRole()); |
| | | 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) { |
| | | StoreMember entity = baseMapper.selectById(id); |
| | | memberService.removeById(entity.getMemberId()); |
| | | baseMapper.deleteById(id); |
| | | //同时删除用户 |
| | | |
| | | |
| | | return Result.ok("删除成功"); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result page(StoreMemberQuery query) { |
| | | AuthUser currentUser = UserContext.getCurrentUser(); |
| | | // String storeId = currentUser.getStoreId(); |
| | | String storeId = "12312323123"; |
| | | if (storeId == null) { |
| | | return Result.error("当前登录账户未绑定商户或用户id获取异常"); |
| | | } |
| | | IPage<StoreMemberVO> page = PageUtil.getPage(query, StoreMemberVO.class); |
| | | query.setStoreId(storeId); |
| | | baseMapper.getPage(page, query); |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | | /** |
| | | * 根据id查找 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detail(String id) { |
| | | StoreMemberVO vo = baseMapper.getById(id); |
| | | //密码是否需要解密 |
| | | |
| | | Assert.notNull(vo, "记录不存在"); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | | /** |
| | | * 列表 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result all() { |
| | | List<StoreMember> entities = baseMapper.selectList(null); |
| | | List<StoreMemberVO> vos = entities.stream() |
| | | .map(entity -> StoreMemberVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | return Result.ok().data(vos); |
| | | } |
| | | } |
| | |
| | | import cn.lili.modules.lmk.domain.vo.*; |
| | | import cn.lili.modules.lmk.enums.general.TagCreateTypeEnum; |
| | | import cn.lili.modules.lmk.enums.general.VideoStatusEnum; |
| | | import cn.lili.modules.lmk.enums.general.VideoSupportOpEnum; |
| | | import cn.lili.modules.lmk.enums.general.ViewTypeEnum; |
| | | import cn.lili.modules.lmk.service.*; |
| | | import cn.lili.modules.member.entity.dos.FootPrint; |
| | |
| | | private final MySubscribeService mySubscribeService; |
| | | private final MemberService memberService; |
| | | private final VideoAccountService videoAccountService; |
| | | |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | Assert.notNull(vo, "记录不存在"); |
| | | List<SimpleVideoTagVO> tags = videoTagRefService.getTagsByVideoIds(Arrays.asList(id)); |
| | | vo.setTagList(tags); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | return Result.ok().data(vo); |
| | | } |
| | | |
| | |
| | | case "collect": |
| | | AuthorVideoQuery query2 = new AuthorVideoQuery(); |
| | | query2.setAuthorId(query.getAuthorId()); |
| | | baseMapper.getAuthorVideoPage(page, query2); |
| | | baseMapper.getAuthorCollectVideoPage(page, query2); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | v.setGoods(new VideoGoodsVO()); |
| | | v.setTagList(tagMap.get(v.getId())); |
| | | v.setCollected(CollectionUtils.isNotEmpty(collectMap.get(v.getId()))); |
| | | v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | // v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey())); |
| | | v.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | v.setCoverUrl(cosUtil.getPreviewUrl(v.getCoverFileKey())); |
| | | v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId())); |
| | | }); |
| | |
| | | @Override |
| | | public Result getAuthorVideoPage(AuthorVideoQuery query) { |
| | | IPage<WxVideoVO> page = PageUtil.getPage(query, WxVideoVO.class); |
| | | query.setAuthorSelf(UserContext.getCurrentUserId().equals(query.getAuthorId())); |
| | | baseMapper.getAuthorVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoUrl())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | vo.setOptions(VideoSupportOpEnum.getVideoOpByStatus(vo.getStatus())); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | |
| | | baseMapper.getAuthorCollectVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoUrl())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | vo.setCollected(Boolean.TRUE); |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | |
| | | .update(); |
| | | return Result.ok("保存成功"); |
| | | } |
| | | |
| | | @Override |
| | | public Result wxDetail(String id) { |
| | | WxEditVideoVO vo = baseMapper.wxDetail(id); |
| | | if (Objects.isNull(vo)) { |
| | | return Result.error("视频不存在"); |
| | | } |
| | | vo.setCoverUrl(cosUtil.getPreviewUrl(vo.getCoverFileKey())); |
| | | // vo.setVideoUrl(cosUtil.getPreviewUrl(vo.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | List<WxVideoTagForm> tags = videoTagRefService.getTagsByVideoIds(Arrays.asList(vo.getId())) |
| | | .stream() |
| | | .map(i -> { |
| | | WxVideoTagForm tag = new WxVideoTagForm(); |
| | | tag.setTagName(i.getTagName()); |
| | | tag.setId(i.getId()); |
| | | return tag; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | vo.setTags(tags); |
| | | return Result.ok().data(vo); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public interface MemberService extends IService<Member> { |
| | | /** |
| | | * 用户权限管理修改用户 |
| | | * @param id 会员id |
| | | * @param password 密码 |
| | | * @param mobile 电话(账号) |
| | | * @return |
| | | */ |
| | | Member updateMemberPartProperties(String id,String password,String mobile); |
| | | |
| | | /** |
| | | * 默认密码 |
| | | */ |
| | | static String DEFAULT_PASSWORD = "111111"; |
| | |
| | | return member; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Member updateMemberPartProperties(String id,String password,String mobile) { |
| | | //查询会员信息 |
| | | Member member = this.getById(id); |
| | | //如果密码不为空则加密密码 |
| | | if (CharSequenceUtil.isNotBlank(password)) { |
| | | member.setPassword(new BCryptPasswordEncoder().encode(password)); |
| | | } |
| | | member.setMobile(mobile); |
| | | member.setUsername(mobile); |
| | | this.updateById(member); |
| | | return member; |
| | | } |
| | | |
| | | @Override |
| | | public IPage<MemberVO> getMemberPage(MemberSearchVO memberSearchVO, PageVO page) { |
| | | QueryWrapper<Member> queryWrapper = Wrappers.query(); |
| | |
| | | <result column="activity_report_id" property="activityReportId"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ActivityReportMap" type="cn.lili.modules.lmk.domain.vo.ActivityReportVO"> |
| | | <result column="activity_id" property="activityId"/> |
| | | <result column="user_id" property="userId"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getMyActivityList" resultMap="MyActivityResultMap"> |
| | |
| | | LEFT JOIN lmk_activity LA ON LAR.activity_id = LA.id |
| | | where LA.delete_flag = 0 |
| | | AND LAR.delete_flag = 0 |
| | | AND LAR.user_id = #{query.id} |
| | | AND LAR.user_id = #{userId} |
| | | AND LAR.cancel = #{query.cancel} |
| | | <if test="query.status == null or query.status == ''"> |
| | | AND LA.status != '已结束' |
| | |
| | | WHERE LAR.activity_id = #{query.id} |
| | | </select> |
| | | |
| | | |
| | | <update id="cancelActivity" > |
| | | UPDATE |
| | | lmk_activity_report LAR |
| | | SET LAR.cancel = true where LAR.id = #{id} |
| | | </update> |
| | | |
| | | |
| | | <select id="getActivityReport" resultMap="ActivityReportMap"> |
| | | SELECT LAR.* FROM lmk_activity_report LAR |
| | | WHERE LAR.user_id = #{query.userId} and LAR.activity_id = #{query.activityId} |
| | | </select> |
| | | |
| | | <update id="batchUpdateActivities"> |
| | | UPDATE lmk_activity |
| | | <trim prefix="SET" suffixOverrides=","> |
| | |
| | | #{item.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | </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.ActivityReportMapper"> |
| | | |
| | | <resultMap id="ActivityReportMap" type="cn.lili.modules.lmk.domain.vo.ActivityReportVO"> |
| | | <result column="activity_id" property="activityId"/> |
| | | <result column="user_id" property="userId"/> |
| | | </resultMap> |
| | | |
| | | <update id="cancelActivity" > |
| | | UPDATE |
| | | lmk_activity_report LAR |
| | | SET LAR.cancel = true where LAR.id = #{id} |
| | | </update> |
| | | |
| | | |
| | | <select id="getActivityReport" resultType="cn.lili.modules.lmk.domain.vo.ActivityReportVO"> |
| | | SELECT LAR.* FROM lmk_activity_report LAR |
| | | WHERE LAR.user_id = #{userId} and LAR.activity_id = #{activityId} |
| | | AND LAR.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.StoreMemberMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="cn.lili.modules.lmk.domain.vo.StoreMemberVO"> |
| | | <result column="real_name" property="realName" /> |
| | | <result column="mobile" property="mobile" /> |
| | | <result column="password" property="password" /> |
| | | <result column="role" property="role" /> |
| | | <result column="create_by" property="createBy" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_by" property="updateBy" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="delete_flag" property="deleteFlag" /> |
| | | |
| | | <result column="store_id" property="storeId" /> |
| | | <result column="member_id" property="memberId" /> |
| | | <result column="username" property="userName" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="getById" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSM.id, |
| | | LSM.real_name, |
| | | LSM.role, |
| | | LSM.store_id, |
| | | LSM.member_id, |
| | | LM.mobile, |
| | | LM.username |
| | | FROM lmk_store_member LSM |
| | | LEFT JOIN li_member LM |
| | | ON LM.id = LSM.member_id |
| | | where LSM.delete_flag = 0 |
| | | AND LM.delete_flag = 0 |
| | | AND LSM.id = #{id} |
| | | </select> |
| | | |
| | | |
| | | <select id="getPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | LSM.id, |
| | | LSM.real_name, |
| | | LSM.role, |
| | | LSM.store_id, |
| | | LSM.member_id, |
| | | LM.mobile, |
| | | LM.username |
| | | FROM lmk_store_member LSM |
| | | LEFT JOIN li_member LM |
| | | ON LM.id = LSM.member_id |
| | | where LSM.delete_flag = 0 |
| | | AND LM.delete_flag = 0 |
| | | <if test="query.realName != null and query.realName != ''"> |
| | | AND LSM.real_name LIKE CONCAT('%', #{query.realName}, '%') |
| | | </if> |
| | | AND LSM.store_id = #{query.storeId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="title" property="title" /> |
| | | <result column="collect_num" property="collectNum" /> |
| | | <result column="comment_num" property="commentNum" /> |
| | | <result column="status" property="status" /> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | lmk_video LV |
| | | LEFT JOIN li_member LM ON LV.author_id = LM.id |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.status = '1' AND LV.author_id = #{query.authorId} |
| | | LV.delete_flag = 0 |
| | | <if test="!query.authorSelf"> |
| | | AND LV.status = '1' |
| | | </if> |
| | | AND LV.author_id = #{query.authorId} |
| | | ORDER BY |
| | | LV.collect_num DESC |
| | | </select> |
| | |
| | | LMC.create_time DESC |
| | | </select> |
| | | |
| | | |
| | | <!-- 微信视频编辑详情 --> |
| | | <resultMap id="WxEditResultMap" type="cn.lili.modules.lmk.domain.vo.WxEditVideoVO"> |
| | | <id column="id" property="id"/> |
| | | <result column="cover_url" property="coverFileKey" /> |
| | | <result column="video_file_key" property="videoFileKey" /> |
| | | <result column="video_fit" property="videoFit" /> |
| | | <result column="title" property="title" /> |
| | | <result column="video_duration" property="videoDuration" /> |
| | | <result column="goods_id" property="goodsId" /> |
| | | </resultMap> |
| | | |
| | | <select id="wxDetail" resultMap="WxEditResultMap"> |
| | | SELECT |
| | | LV.author_id, |
| | | LV.cover_url, |
| | | LV.video_fit, |
| | | LV.video_duration, |
| | | LV.video_file_key, |
| | | LV.title, |
| | | LV.goods_id, |
| | | LV.goods_view_num, |
| | | LV.goods_order_num, |
| | | LV.recommend, |
| | | LV.status, |
| | | LV.play_num, |
| | | LV.comment_num, |
| | | LV.collect_num, |
| | | LV.weight, |
| | | LV.audit_pass_time, |
| | | LV.update_time, |
| | | LV.id |
| | | FROM |
| | | lmk_video LV |
| | | WHERE |
| | | LV.delete_flag = 0 AND LV.id = #{id} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | .list(); |
| | | Date now = new Date(); // 获取当前时间 |
| | | |
| | | |
| | | |
| | | for (Activity activity : activeActivities) { |
| | | if (isInProgress(now, activity)) { |
| | | activity.setStatus(ActivityStatusEnum.IN_PROGRESS.getType()); |
| | | } else if (isRecruiting(now, activity)) { |
| | | activity.setStatus(ActivityStatusEnum.REPORT.getType()); |
| | | } else if (now.before(activity.getReportStartTime())) { |
| | | } else if (now.before(activity.getReportStartTime())) { //在报名时间之前 |
| | | activity.setStatus(ActivityStatusEnum.NOT_STARTED.getType()); |
| | | } else { |
| | | }else if(now.after(activity.getReportEndTime()) && now.before(activity.getStartTime())){ //可能出现 在报名结束时间后, 活动开始之前的情况 |
| | | activity.setStatus(ActivityStatusEnum.NOT_STARTED.getType()); |
| | | } |
| | | else { |
| | | activity.setStatus(ActivityStatusEnum.ENDED.getType()); |
| | | } |
| | | } |
| | |
| | | XxlJobHelper.log("执行完成:活动状态改变"); |
| | | |
| | | } |
| | | |
| | | //活动开始时间之后,结束时间之前 在活动期间 |
| | | private boolean isInProgress(Date now, Activity activity) { |
| | | |
| | | return !now.before(activity.getStartTime()) && !now.after(activity.getEndTime()); |
| | | } |
| | | |
| | | //在报名期间 |
| | | private boolean isRecruiting(Date now, Activity activity) { |
| | | return !now.before(activity.getReportStartTime()) && !now.after(activity.getReportEndTime()); |
| | | } |