20个文件已修改
1个文件已添加
1 文件已复制
1 文件已重命名
| | |
| | | AuthUser authUser = new Gson().fromJson(json, AuthUser.class); |
| | | |
| | | //校验redis中是否有权限 |
| | | if (cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.MEMBER,authUser.getId()) + jwt)) { |
| | | if (cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.MEMBER, authUser.getId()) + jwt) || |
| | | cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.STORE, authUser.getId()) + jwt)) { |
| | | //构造返回信息 |
| | | List<GrantedAuthority> auths = new ArrayList<>(); |
| | | auths.add(new SimpleGrantedAuthority("ROLE_" + authUser.getRole().name())); |
| | |
| | | <artifactId>framework</artifactId> |
| | | <version>${revision}</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | <version>${xxl-job}</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | <repositories> |
| | |
| | | <version>3.1.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | <version>${xxl-job}</version> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.qiniu</groupId> |
New file |
| | |
| | | package cn.lili.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | public enum ActivityCoverTypeEnum { |
| | | VIDEO("video","视频"), |
| | | IMAGE("image","图片"), |
| | | TEXT("text","文字"); |
| | | |
| | | private String type; |
| | | |
| | | private String desc; |
| | | |
| | | ActivityCoverTypeEnum(String type,String desc) { |
| | | this.type = type; |
| | | this.desc = desc; |
| | | } |
| | | } |
| | |
| | | |
| | | @Getter |
| | | public enum ActivityStatusEnum { |
| | | NOT_STARTED("未开始"), |
| | | REPORT("报名中"), |
| | | IN_PROGRESS("进行中"), |
| | | ENDED("已结束"); |
| | | UNPUBLISH("unPublish","未发布"), |
| | | PUBLISH("publish","已发布"), |
| | | TAKE_DOWN("takeDown","已下架"), |
| | | |
| | | NOT_STARTED("noStart","未开始"), |
| | | REPORT("report","报名中"), |
| | | IN_PROGRESS("inProgress","进行中"), |
| | | ENDED("end","已结束"); |
| | | |
| | | private String type; |
| | | |
| | | ActivityStatusEnum(String type) { |
| | | private String desc; |
| | | ActivityStatusEnum(String type, String desc) { |
| | | this.type = type; |
| | | |
| | | this.desc = desc; |
| | | } |
| | | |
| | | |
| | |
| | | if (StrUtil.isNotBlank(authUser.getPhone())) { |
| | | member = memberService.findByMobile(authUser.getPhone()); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(authUser.getUuid())) { |
| | | member = memberService.findByUUID(authUser.getUuid()); |
| | | } |
| | | |
| | | //如果未查到手机号的会员则使用第三方登录 |
| | | if (member == null) { |
| | | LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<Connect>(); |
| | |
| | | @TableField("activity_content") |
| | | private String activityContent; |
| | | |
| | | |
| | | /** 判断是否发布*/ |
| | | @TableField("publish") |
| | | private Boolean publish; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "活动详细内容(支持富文本)", example = "<p>活动流程:...</p>") |
| | | private String activityContent; |
| | | |
| | | /** 活动发布 */ |
| | | @ApiModelProperty(value = "活动发布", example = "") |
| | | private Boolean publish; |
| | | |
| | | public static Activity getEntityByForm(@NonNull ActivityForm form, Activity entity) { |
| | | if(entity == null) { |
| | | entity = new Activity(); |
| | |
| | | private Boolean isReport; |
| | | |
| | | /** |
| | | * 是否发布 |
| | | */ |
| | | private Boolean publish; |
| | | |
| | | |
| | | /** |
| | | * 是否收藏 |
| | | */ |
| | | private Boolean isCollect; |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.enums.ActivityCoverTypeEnum; |
| | | import cn.lili.common.enums.ActivityStatusEnum; |
| | | import cn.lili.modules.lmk.domain.entity.Activity; |
| | | import cn.lili.modules.lmk.domain.form.ActivityForm; |
| | |
| | | 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.utils.COSUtil; |
| | | import cn.lili.utils.PageUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | private final MyActivityService activityService; |
| | | |
| | | private final ActivityReportMapper activityReportMapper; |
| | | private final COSUtil cOSUtil; |
| | | |
| | | @Override |
| | | public Result add(ActivityForm form) { |
| | |
| | | entity.setStatus(ActivityStatusEnum.NOT_STARTED.getType()); |
| | | //默认不为推荐 |
| | | entity.setRecommend(false); |
| | | //默认未发布 |
| | | entity.setPublish(false); |
| | | |
| | | baseMapper.insert(entity); |
| | | return Result.ok("添加成功"); |
| | |
| | | |
| | | Activity entity = baseMapper.selectById(form.getId()); |
| | | //判断修改前的封面类型是否为文本,文本不需要删除文件 |
| | | if (!"文字".equals(entity.getCoverType())){ |
| | | if (!ActivityCoverTypeEnum.TEXT.getType().equals(entity.getCoverType())){ |
| | | //判断路径是否改变 |
| | | if (!form.getCover().equals(entity.getCover())) { |
| | | //删除云服务器中旧的图片 |
| | |
| | | public Result removeById(String id) { |
| | | //TODO 先判断活动是否有报名人员 |
| | | //有的话不可删除 联中间表查询 |
| | | |
| | | |
| | | |
| | | |
| | | //删除,同时判断该对象的封面是否存在 ,存在则在云服务器删除 |
| | | ActivityVO vo = baseMapper.getById(id); |
| | | if (StringUtils.isNotEmpty(vo.getCover())){ |
| | |
| | | |
| | | baseMapper.getPage(page, query); |
| | | for (ActivityVO vo : page.getRecords()) { |
| | | if (!"文字".equals(vo.getCoverType())){ |
| | | String url = lmkFileService.getPreviewUrl(vo.getCover()); |
| | | vo.setUrl(url); |
| | | if (!ActivityCoverTypeEnum.TEXT.getType().equals(vo.getCoverType())){ |
| | | vo.setUrl(cOSUtil.getPreviewUrl(vo.getCover())); |
| | | } |
| | | } |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | |
| | | @Override |
| | | public Result getCanReportPage(ActivityQuery query){ |
| | | IPage<ActivityVO> page = PageUtil.getPage(query, ActivityVO.class); |
| | | |
| | | //已发布的活动 |
| | | baseMapper.getCanReportPage(page, query); |
| | | |
| | | for(ActivityVO activityVO : page.getRecords()){ |
| | | activityVO.setUrl(cOSUtil.getPreviewUrl(activityVO.getCover())); |
| | | } |
| | | |
| | | return Result.ok().data(page.getRecords()).total(page.getTotal()); |
| | | } |
| | | |
| | |
| | | .map(entity -> ActivityVO.getVoByEntity(entity, null)) |
| | | .collect(Collectors.toList()); |
| | | List<ActivityVO> reportActivityVo =vos.stream().filter(item -> ActivityStatusEnum.REPORT.getType().equals(item.getStatus())).collect(Collectors.toList()); |
| | | |
| | | |
| | | |
| | | return Result.ok().data(reportActivityVo); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public Result activityChangeStatus(ActivityForm form) { |
| | | Activity entity = baseMapper.selectById(form.getId()); |
| | | entity.setStatus(form.getStatus()); |
| | | entity.setPublish(form.getPublish()); |
| | | if (!form.getPublish()){ |
| | | //下架判断是否有人员报名,有报名的话禁止提醒无法下架 |
| | | ActivityMembersQuery activityMembersQuery = new ActivityMembersQuery(); |
| | | activityMembersQuery.setId(form.getId()); |
| | | if((long)activityMembersPage(activityMembersQuery).get("total") > 0){ |
| | | return Result.error("该活动无法下架,已存在报名人员"); |
| | | } |
| | | |
| | | } |
| | | baseMapper.updateById(entity); |
| | | return Result.ok(); |
| | | } |
| | |
| | | package cn.lili.modules.lmk.service.impl; |
| | | |
| | | import cn.lili.base.Result; |
| | | import cn.lili.common.enums.ActivityCoverTypeEnum; |
| | | import cn.lili.common.enums.ActivityStatusEnum; |
| | | 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.entity.MyCollect; |
| | | 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.MyActivityVo; |
| | | import cn.lili.modules.lmk.mapper.ActivityMapper; |
| | | import cn.lili.modules.lmk.mapper.ActivityReportMapper; |
| | | import cn.lili.modules.lmk.mapper.MyCollectMapper; |
| | | import cn.lili.modules.lmk.service.MyActivityService; |
| | | import cn.lili.utils.COSUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | |
| | | private final ActivityMapper activityMapper; |
| | | |
| | | private final ActivityReportMapper activityReportMapper; |
| | | |
| | | private final COSUtil cOSUtil; |
| | | private final MyCollectMapper myCollectMapper; |
| | | |
| | | @Override |
| | | public Result getMyActivityList(MyActivityQuery query) { |
| | | String userId = UserContext.getCurrentUserId(); |
| | | List<MyActivityVo> myActivityList = activityMapper.getMyActivityList(query,userId); |
| | | |
| | | for (MyActivityVo myActivityVo : myActivityList){ |
| | | if (!ActivityCoverTypeEnum.TEXT.getType().equals(myActivityVo.getCoverType())){ |
| | | myActivityVo.setUrl(cOSUtil.getPreviewUrl(myActivityVo.getCover())); |
| | | } |
| | | } |
| | | return Result.ok().data(myActivityList); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public ActivityReportVO userReport(String activityId){ |
| | | |
| | | if (UserContext.getCurrentUserId() == null || UserContext.getCurrentUserId().isEmpty()){ |
| | | throw new RuntimeException("用户登录状态异常"); |
| | | } |
| | | return activityReportMapper.getActivityReport(activityId,UserContext.getCurrentUserId()); |
| | | } |
| | | |
| | | /**获得活动详情 并 活动账号报名活动情况,收藏情况 |
| | | * |
| | | * @param activityId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Result detailByUsr(String activityId) { |
| | | //查询活动详情 |
| | | ActivityVO vo = baseMapper.getById(activityId); |
| | | Assert.notNull(vo, "记录不存在"); |
| | | |
| | | //查询报名情况 |
| | | ActivityReportVO reportVO = userReport(activityId); |
| | | |
| | | ActivityReport activityReport = new LambdaQueryChainWrapper<>(activityReportMapper) |
| | | .eq(ActivityReport::getUserId, UserContext.getCurrentUserId()) |
| | | .eq(ActivityReport::getDeleteFlag,0) |
| | | .eq(ActivityReport::getActivityId,activityId) |
| | | //查询用户收藏情况 |
| | | MyCollect myCollect = new LambdaQueryChainWrapper<>(myCollectMapper) |
| | | .eq(MyCollect::getRefId,activityId) |
| | | .eq(MyCollect::getUserId,UserContext.getCurrentUserId()) |
| | | .eq(MyCollect::getDeleteFlag,false) |
| | | .one(); |
| | | vo.setIsCollect(activityReport != null); |
| | | vo.setIsCollect(myCollect != null); |
| | | if (!ActivityCoverTypeEnum.TEXT.getType().equals(vo.getCoverType())){ |
| | | vo.setUrl(cOSUtil.getPreviewUrl(vo.getCover())); |
| | | } |
| | | |
| | | //则当前用户未报名 |
| | | if (reportVO == null){ |
| | | vo.setIsReport(false); |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | 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())); |
| | | }); |
| | |
| | | baseMapper.getAuthorVideoPage(page, query); |
| | | for (WxVideoVO vo : page.getRecords()) { |
| | | 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"); |
| | | 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.getVideoFileKey())); |
| | | vo.setVideoUrl("https://videos.pexels.com/video-files/13602965/13602965-hd_1920_1080_30fps.mp4"); |
| | | 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()); |
| | |
| | | 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"); |
| | | 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 -> { |
| | |
| | | import cn.lili.common.security.sensitive.enums.SensitiveStrategy; |
| | | import cn.lili.common.utils.CommonUtil; |
| | | import cn.lili.mybatis.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | @ApiModelProperty(value = "店铺ID") |
| | | private String storeId; |
| | | |
| | | @ApiModelProperty(value = "uuId") |
| | | @TableField(value = "uu_id") |
| | | private String uuId; |
| | | |
| | | /** |
| | | * @see ClientTypeEnum |
| | | */ |
| | |
| | | this.lastLoginDate = new Date(); |
| | | } |
| | | |
| | | public Member(String username, String password, String face, String nickName, Integer sex,String mobile) { |
| | | public Member(String username, String password, String face, String nickName, Integer sex, String mobile) { |
| | | this.username = username; |
| | | this.password = password; |
| | | this.mobile = mobile; |
| | |
| | | boolean appSConfirm(String token, Integer code); |
| | | |
| | | QRLoginResultVo loginWithSession(String token); |
| | | |
| | | Member findByUUID(String uuid); |
| | | } |
| | |
| | | Member member = new Member(authUser.getUsername(), UuidUtils.getUUID(), authUser.getAvatar(), authUser.getNickname(), |
| | | authUser.getGender() != null ? Convert.toInt(authUser.getGender().getCode()) : 0, authUser.getPhone()); |
| | | member.setPassword(DEFAULT_PASSWORD); |
| | | member.setUuId(authUser.getUuid()); |
| | | // 发送会员注册信息 |
| | | registerHandler(member); |
| | | |
| | |
| | | this.updateById(member); |
| | | return member; |
| | | } |
| | | |
| | | @Override |
| | | public Result resetPassword(String id){ |
| | | String password = "123456"; |
| | | Member member = this.getById(id); |
| | | member.setPassword(new BCryptPasswordEncoder().encode(password)); |
| | | this.updateById(member); |
| | | return Result.ok("重置成功"); |
| | | public Result resetPassword(String id) { |
| | | String password = "123456"; |
| | | Member member = this.getById(id); |
| | | member.setPassword(new BCryptPasswordEncoder().encode(password)); |
| | | this.updateById(member); |
| | | return Result.ok("重置成功"); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Member updateMemberPartProperties(String id,String password,String mobile) { |
| | | public Member updateMemberPartProperties(String id, String password, String mobile) { |
| | | //查询会员信息 |
| | | Member member = this.getById(id); |
| | | member.setMobile(mobile); |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public Member findByUUID(String uuid) { |
| | | QueryWrapper<Member> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("uu_id", uuid); |
| | | return this.baseMapper.selectOne(queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 检测会员 |
| | | * |
| | |
| | | |
| | | @Override |
| | | public List<StoreUserMenuVO> findAllMenu(String clerkId, String memberId) { |
| | | String cacheKey = CachePrefix.STORE_USER_MENU.getPrefix() + memberId; |
| | | List<StoreUserMenuVO> menuList = (List<StoreUserMenuVO>) cache.get(cacheKey); |
| | | if (menuList == null || menuList.isEmpty()) { |
| | | menuList = storeMenuService.getUserRoleMenu(clerkId); |
| | | cache.put(cacheKey, menuList); |
| | | } |
| | | return menuList; |
| | | // String cacheKey = CachePrefix.STORE_USER_MENU.getPrefix() + memberId; |
| | | // List<StoreUserMenuVO> menuList = (List<StoreUserMenuVO>) cache.get(cacheKey); |
| | | // if (menuList == null || menuList.isEmpty()) { |
| | | // menuList = storeMenuService.getUserRoleMenu(clerkId); |
| | | // cache.put(cacheKey, menuList); |
| | | // } |
| | | // return menuList; |
| | | return storeMenuService.getUserRoleMenu(clerkId); |
| | | } |
| | | |
| | | |
| | |
| | | import cn.lili.common.security.token.Token; |
| | | import cn.lili.common.security.token.TokenUtil; |
| | | import cn.lili.common.security.token.base.AbstractTokenGenerate; |
| | | import cn.lili.modules.member.entity.dos.Clerk; |
| | | import cn.lili.modules.member.entity.dos.Member; |
| | | import cn.lili.modules.member.service.ClerkService; |
| | | import cn.lili.rocketmq.RocketmqSendCallbackBuilder; |
| | | import cn.lili.rocketmq.tags.MemberTagsEnum; |
| | | import org.apache.rocketmq.spring.core.RocketMQTemplate; |
| | |
| | | @Autowired |
| | | private RocketMQTemplate rocketMQTemplate; |
| | | |
| | | @Autowired |
| | | private ClerkService clerkService; |
| | | |
| | | @Override |
| | | public Token createToken(Member member, Boolean longTerm) { |
| | | |
| | |
| | | String destination = rocketmqCustomProperties.getMemberTopic() + ":" + MemberTagsEnum.MEMBER_LOGIN.name(); |
| | | rocketMQTemplate.asyncSend(destination, member, RocketmqSendCallbackBuilder.commonCallback()); |
| | | |
| | | Clerk clerk = clerkService.getClerkByMemberId(member.getId()); |
| | | |
| | | AuthUser authUser = AuthUser.builder() |
| | | .username(member.getUsername()) |
| | | .face(member.getFace()) |
| | | .id(member.getId()) |
| | | .role(UserEnums.MEMBER) |
| | | .role(clerk == null ? UserEnums.MEMBER : UserEnums.STORE) |
| | | .storeId(clerk == null ? null : clerk.getStoreId()) |
| | | .nickName(member.getNickName()) |
| | | .longTerm(longTerm) |
| | | .build(); |
| | |
| | | <result column="limit_user_num" property="limitUserNum" /> |
| | | <result column="activity_location" property="activityLocation" /> |
| | | <result column="activity_content" property="activityContent" /> |
| | | <result column="publish" property="publish" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="MyActivityResultMap" type="cn.lili.modules.lmk.domain.vo.MyActivityVo"> |
| | |
| | | AND LAR.user_id = #{userId} |
| | | AND LAR.cancel = #{query.cancel} |
| | | <if test="query.status == null or query.status == ''"> |
| | | AND LA.status != '已结束' |
| | | AND LA.status != 'end' |
| | | </if> |
| | | <if test="query.status != null and query.status != ''"> |
| | | AND LA.status = #{query.status} |
| | |
| | | LA.cover_type, |
| | | LA.limit_user_num, |
| | | LA.activity_location, |
| | | LA.activity_content |
| | | LA.activity_content, |
| | | LA.publish |
| | | FROM |
| | | lmk_activity LA |
| | | WHERE |
| | |
| | | LA.cover_type, |
| | | LA.limit_user_num, |
| | | LA.activity_location, |
| | | LA.activity_content |
| | | LA.activity_content, |
| | | LA.publish |
| | | FROM |
| | | lmk_activity LA |
| | | WHERE |
| | |
| | | lmk_activity LA |
| | | WHERE |
| | | LA.delete_flag = 0 |
| | | AND LA.status = '报名中' |
| | | AND LA.publish = 1 |
| | | </select> |
| | | |
| | | |
| | |
| | | <artifactId>framework</artifactId> |
| | | <version>${revision}</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.xuxueli</groupId> |
| | | <artifactId>xxl-job-core</artifactId> |
| | | <version>${xxl-job}</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
copy from framework/src/main/java/cn/lili/config/XxlJobConfig.java
copy to lmk-job/src/main/java/cn/lili/config/XxlJobConfig.java
| | |
| | | package cn.lili.controller.goods; |
| | | |
| | | import cn.lili.common.enums.ResultUtil; |
| | | import cn.lili.common.security.AuthUser; |
| | | import cn.lili.common.security.context.UserContext; |
| | | import cn.lili.common.utils.StringUtils; |
| | | import cn.lili.common.vo.ResultMessage; |
| | | import cn.lili.modules.goods.entity.vos.CategoryBrandVO; |
| | | import cn.lili.modules.goods.entity.vos.CategoryVO; |
| | | import cn.lili.modules.goods.service.CategoryBrandService; |
| | | import cn.lili.modules.goods.service.CategoryService; |
| | | import cn.lili.modules.member.entity.dos.Clerk; |
| | | import cn.lili.modules.member.service.ClerkService; |
| | | import cn.lili.modules.store.service.StoreDetailService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | */ |
| | | @Autowired |
| | | private StoreDetailService storeDetailService; |
| | | @Autowired |
| | | private ClerkService clerkService; |
| | | |
| | | @ApiOperation(value = "获取店铺经营的分类") |
| | | @GetMapping(value = "/all") |
| | | public ResultMessage<List<CategoryVO>> getListAll() { |
| | | |
| | | String storeId = Objects.requireNonNull(UserContext.getCurrentUser()).getStoreId(); |
| | | if (StringUtils.isEmpty(storeId)) { |
| | | Clerk clerk = clerkService.getClerkByMemberId(UserContext.getCurrentUserId()); |
| | | storeId = clerk.getStoreId(); |
| | | } |
| | | |
| | | //获取店铺经营范围 |
| | | String goodsManagementCategory = storeDetailService.getStoreDetail(storeId).getGoodsManagementCategory(); |
| | | return ResultUtil.data(this.categoryService.getStoreCategory(goodsManagementCategory.split(","))); |
| | |
| | | AuthUser authUser = new Gson().fromJson(json, AuthUser.class); |
| | | |
| | | //校验redis中是否有权限 |
| | | if (cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.STORE, authUser.getId()) + jwt)) { |
| | | if (cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.MEMBER, authUser.getId()) + jwt) || |
| | | cache.hasKey(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.STORE, authUser.getId()) + jwt) |
| | | ) { |
| | | //用户角色 |
| | | List<GrantedAuthority> auths = new ArrayList<>(); |
| | | auths.add(new SimpleGrantedAuthority("ROLE_" + authUser.getRole().name())); |
| | |
| | | //获取缓存中的权限 |
| | | Map<String, List<String>> permission = |
| | | (Map<String, List<String>>) cache.get(permissionCacheKey); |
| | | if (permission == null || permission.isEmpty()) { |
| | | //根据会员id查询店员信息 |
| | | Clerk clerk = clerkService.getClerkByMemberId(authUser.getId()); |
| | | if (clerk != null) { |
| | | permission = storeTokenGenerate.permissionList(storeMenuRoleService.findAllMenu(clerk.getId(), authUser.getId())); |
| | | cache.put(permissionCacheKey, permission); |
| | | } |
| | | // if (permission == null || permission.isEmpty()) { |
| | | //根据会员id查询店员信息 |
| | | Clerk clerk = clerkService.getClerkByMemberId(authUser.getId()); |
| | | if (clerk != null) { |
| | | permission = storeTokenGenerate.permissionList(storeMenuRoleService.findAllMenu(clerk.getId(), authUser.getId())); |
| | | cache.put(permissionCacheKey, permission); |
| | | } |
| | | //} |
| | | //获取数据(GET 请求)权限 |
| | | if (request.getMethod().equals(RequestMethod.GET.name())) { |
| | | //如果用户的超级权限和查阅权限都不包含当前请求的api |