From 59beb88bdf1f8bedd5538580e50038ffee6985d9 Mon Sep 17 00:00:00 2001 From: zxl <763096477@qq.com> Date: 星期五, 06 六月 2025 15:24:58 +0800 Subject: [PATCH] 优化我的收藏,活动报名,我的活动页面,活动页面后端逻辑,新增加载更多接口 --- framework/src/main/java/cn/lili/common/enums/CollectTypeEnum.java | 18 +++ framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsVO.java | 2 framework/src/main/java/cn/lili/modules/lmk/domain/query/MyCollectQuery.java | 2 buyer-api/src/main/java/cn/lili/controller/lmk/MyCollectController.java | 7 + buyer-api/src/main/java/cn/lili/controller/lmk/MyActivityController.java | 1 framework/src/main/java/cn/lili/modules/lmk/domain/vo/ActivityVO.java | 8 + framework/src/main/java/cn/lili/modules/lmk/service/impl/ActivityServiceImpl.java | 14 + framework/src/main/java/cn/lili/modules/lmk/service/MyActivityService.java | 2 framework/src/main/resources/mapper/lmk/MyCollectMapper.xml | 95 +++++++++++++++ framework/src/main/java/cn/lili/modules/lmk/service/MyCollectService.java | 2 framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java | 39 ++++++ framework/src/main/java/cn/lili/modules/member/service/MemberService.java | 8 + buyer-api/src/main/java/cn/lili/controller/lmk/ActivityReportController.java | 5 buyer-api/src/main/java/cn/lili/controller/lmk/StoreMemberController.java | 11 + framework/src/main/java/cn/lili/modules/lmk/mapper/ActivityMapper.java | 3 framework/src/main/java/cn/lili/modules/lmk/mapper/MyCollectMapper.java | 31 ++++ framework/src/main/java/cn/lili/modules/lmk/service/ActivityService.java | 2 framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreMemberForm.java | 1 framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java | 14 + framework/src/main/java/cn/lili/modules/lmk/service/impl/MyActivityServiceImpl.java | 11 + framework/src/main/resources/mapper/lmk/ActivityMapper.xml | 26 ++++ 21 files changed, 280 insertions(+), 22 deletions(-) diff --git a/buyer-api/src/main/java/cn/lili/controller/lmk/ActivityReportController.java b/buyer-api/src/main/java/cn/lili/controller/lmk/ActivityReportController.java index ff0bac3..78d6903 100644 --- a/buyer-api/src/main/java/cn/lili/controller/lmk/ActivityReportController.java +++ b/buyer-api/src/main/java/cn/lili/controller/lmk/ActivityReportController.java @@ -3,6 +3,7 @@ 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.domain.query.ActivityQuery; import cn.lili.modules.lmk.service.ActivityService; import cn.lili.modules.lmk.service.MyActivityService; import io.swagger.annotations.Api; @@ -24,8 +25,8 @@ @GetMapping() @ApiOperation(value = "娲诲姩鍒楄〃", notes = "娲诲姩鍒楄〃") - public Result getAllActivity(){ - return activityService.all(); + public Result getAllActivity(ActivityQuery query){ + return activityService.getCanReportPage(query); } @PostMapping() diff --git a/buyer-api/src/main/java/cn/lili/controller/lmk/MyActivityController.java b/buyer-api/src/main/java/cn/lili/controller/lmk/MyActivityController.java index 723ea1c..0fde279 100644 --- a/buyer-api/src/main/java/cn/lili/controller/lmk/MyActivityController.java +++ b/buyer-api/src/main/java/cn/lili/controller/lmk/MyActivityController.java @@ -26,6 +26,7 @@ } + @PutMapping("/activityCancel/{activityId}") @ApiOperation(value = "鍙栨秷娲诲姩", notes = "鍙栨秷娲诲姩") public Result activityCancel(@PathVariable String activityId){ diff --git a/buyer-api/src/main/java/cn/lili/controller/lmk/MyCollectController.java b/buyer-api/src/main/java/cn/lili/controller/lmk/MyCollectController.java index f4f10fa..03c7e90 100644 --- a/buyer-api/src/main/java/cn/lili/controller/lmk/MyCollectController.java +++ b/buyer-api/src/main/java/cn/lili/controller/lmk/MyCollectController.java @@ -53,4 +53,11 @@ return myCollectService.page(query); } + + @GetMapping("/getMyCollectList") + @ApiOperation(value = "鑾峰緱鎴戠殑鏀惰棌", notes = "鑾峰緱鎴戠殑鏀惰棌鍒楄〃") + public Result getMyCollectList(MyCollectQuery query){ + return myCollectService.getMyCollectList(query); + } + } diff --git a/buyer-api/src/main/java/cn/lili/controller/lmk/StoreMemberController.java b/buyer-api/src/main/java/cn/lili/controller/lmk/StoreMemberController.java index 1336c10..87891a6 100644 --- a/buyer-api/src/main/java/cn/lili/controller/lmk/StoreMemberController.java +++ b/buyer-api/src/main/java/cn/lili/controller/lmk/StoreMemberController.java @@ -7,8 +7,9 @@ import cn.lili.modules.lmk.domain.form.StoreMemberForm; import cn.lili.modules.lmk.domain.query.StoreMemberQuery; import cn.lili.modules.lmk.service.StoreMemberService; +import cn.lili.modules.member.entity.dos.Member; +import cn.lili.modules.member.service.MemberService; 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; @@ -31,12 +32,20 @@ // store_member private final StoreMemberService storeMemberService; + private final MemberService memberService; + @PostMapping @ApiOperation(value = "娣诲姞", notes = "娣诲姞") public Result add(@RequestBody @Validated(Add.class) StoreMemberForm form) { return storeMemberService.add(form); } + @PutMapping("/restPassword/{id}") + @ApiOperation(value = "閲嶇疆瀵嗙爜", notes = "閲嶇疆瀵嗙爜") + public Result restPassword(@PathVariable String id){ + return memberService.resetPassword(id); + } + @PutMapping @ApiOperation(value = "淇敼", notes = "淇敼") public Result update(@RequestBody @Validated(Update.class) StoreMemberForm form) { diff --git a/framework/src/main/java/cn/lili/common/enums/CollectTypeEnum.java b/framework/src/main/java/cn/lili/common/enums/CollectTypeEnum.java new file mode 100644 index 0000000..a71f5d4 --- /dev/null +++ b/framework/src/main/java/cn/lili/common/enums/CollectTypeEnum.java @@ -0,0 +1,18 @@ +package cn.lili.common.enums; + +import lombok.Getter; + +@Getter +public enum CollectTypeEnum { + video("video","瑙嗛"), + activity("activity","娲诲姩"), + store("store","搴楅摵"), + goods("goods","鍟嗗搧"); + private String type; + + private String desc; + CollectTypeEnum(String type,String desc) { + this.type = type; + this.desc = desc; + } +} diff --git a/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsVO.java b/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsVO.java index bf62838..43aea57 100644 --- a/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsVO.java +++ b/framework/src/main/java/cn/lili/modules/goods/entity/vos/GoodsVO.java @@ -35,4 +35,6 @@ @ApiModelProperty(value = "鎵瑰彂鍟嗗搧娑堣垂瑙勫垯鍒楄〃") private List<Wholesale> wholesaleList; + + private String id; } diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreMemberForm.java b/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreMemberForm.java index 183348b..8a1e5d3 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreMemberForm.java +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/form/StoreMemberForm.java @@ -30,7 +30,6 @@ @ApiModelProperty("鐢佃瘽鍙风爜") private String mobile; - @NotBlank(message = "瀵嗙爜涓嶈兘涓虹┖", groups = {Add.class, Update.class}) @ApiModelProperty("瀵嗙爜") private String password; diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/query/MyCollectQuery.java b/framework/src/main/java/cn/lili/modules/lmk/domain/query/MyCollectQuery.java index 092ea30..a7534de 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/domain/query/MyCollectQuery.java +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/query/MyCollectQuery.java @@ -18,5 +18,7 @@ @Data @ApiModel(value = "MyCollect鏌ヨ鍙傛暟", description = "鎴戠殑鏀惰棌鏌ヨ鍙傛暟") public class MyCollectQuery extends AbsQuery { + /** 鏀惰棌绫诲瀷*/ + private String type; } diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/ActivityVO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/ActivityVO.java index a239abb..bcb6689 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/domain/vo/ActivityVO.java +++ b/framework/src/main/java/cn/lili/modules/lmk/domain/vo/ActivityVO.java @@ -84,9 +84,15 @@ /** 鎶ュ悕浜哄憳闆嗗悎*/ private List<MemberVO> members; - + /** + * 鏄惁鎶ュ悕 + */ private Boolean isReport; + /** + * 鏄惁鏀惰棌 + */ + private Boolean isCollect; public static ActivityVO getVoByEntity(@NonNull Activity entity, ActivityVO vo) { if(vo == null) { vo = new ActivityVO(); diff --git a/framework/src/main/java/cn/lili/modules/lmk/mapper/ActivityMapper.java b/framework/src/main/java/cn/lili/modules/lmk/mapper/ActivityMapper.java index 06e725b..4f9b37f 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/mapper/ActivityMapper.java +++ b/framework/src/main/java/cn/lili/modules/lmk/mapper/ActivityMapper.java @@ -48,6 +48,5 @@ int batchUpdateActivities(@Param("list") List<Activity> activityList); - - + IPage getCanReportPage(IPage page,@Param("query") ActivityQuery query); } diff --git a/framework/src/main/java/cn/lili/modules/lmk/mapper/MyCollectMapper.java b/framework/src/main/java/cn/lili/modules/lmk/mapper/MyCollectMapper.java index a53ab46..4583073 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/mapper/MyCollectMapper.java +++ b/framework/src/main/java/cn/lili/modules/lmk/mapper/MyCollectMapper.java @@ -1,11 +1,9 @@ package cn.lili.modules.lmk.mapper; import cn.lili.modules.lmk.domain.entity.MyCollect; -import cn.lili.modules.lmk.domain.vo.SimpleMyCollectVO; -import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; +import cn.lili.modules.lmk.domain.vo.*; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import cn.lili.modules.lmk.domain.vo.MyCollectVO; import cn.lili.modules.lmk.domain.query.MyCollectQuery; import java.util.List; import org.apache.ibatis.annotations.Mapper; @@ -48,4 +46,31 @@ * @return */ List<CollectTypeNumVO> countNumGroupByType(@Param("type") String type); + + + /** + * 鑾峰緱鎴戠殑鏀惰棌 娲诲姩 + * @param page + * @param userId + * @return + */ + IPage getActivityCollectPage(IPage page,@Param("userId")String userId); + + /** + * 鑾峰緱鎴戠殑鏀惰棌 搴楅摵 + * @param page + * @param userId + * @return + */ + IPage getStoreCollectPage(IPage page,@Param("userId")String userId); + + /** + * 鑾峰緱鎴戠殑鏀惰棌 瑙嗛 + * @param page + * @param userId + * @return + */ + IPage getVideoCollectPage(IPage page,@Param("userId")String userId); + + IPage getGoodsCollectPage(IPage page,@Param("userId")String type); } diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/ActivityService.java b/framework/src/main/java/cn/lili/modules/lmk/service/ActivityService.java index dd890a6..5daea02 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/ActivityService.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/ActivityService.java @@ -56,6 +56,8 @@ */ Result detail(String id); + Result getCanReportPage(ActivityQuery query); + /** * 鍒楄〃 * @return diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/MyActivityService.java b/framework/src/main/java/cn/lili/modules/lmk/service/MyActivityService.java index ca43f8e..ead9ce6 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/MyActivityService.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/MyActivityService.java @@ -23,4 +23,6 @@ ActivityReportVO userReport(String activityId); Result detailByUsr(String activityId); + + } diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/MyCollectService.java b/framework/src/main/java/cn/lili/modules/lmk/service/MyCollectService.java index 3e4358e..29010ac 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/MyCollectService.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/MyCollectService.java @@ -80,4 +80,6 @@ * @return */ List<CollectTypeNumVO> countNumGroupByType(String type); + + Result getMyCollectList(MyCollectQuery query); } diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/ActivityServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/ActivityServiceImpl.java index 5999d78..cd97862 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/ActivityServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/ActivityServiceImpl.java @@ -3,12 +3,9 @@ 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.ActivityReport; 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.vo.ActivityReportVO; import cn.lili.modules.lmk.domain.vo.ActivityVO; import cn.lili.modules.lmk.mapper.ActivityMapper; import cn.lili.modules.lmk.mapper.ActivityReportMapper; @@ -18,7 +15,6 @@ import cn.lili.modules.member.entity.vo.MemberVO; 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; @@ -117,15 +113,25 @@ Assert.notNull(vo, "璁板綍涓嶅瓨鍦�"); return Result.ok().data(vo); } + @Override + public Result getCanReportPage(ActivityQuery query){ + IPage<ActivityVO> page = PageUtil.getPage(query, ActivityVO.class); + baseMapper.getCanReportPage(page, query); + return Result.ok().data(page.getRecords()).total(page.getTotal()); + } @Override public Result all() { + List<Activity> entities = baseMapper.selectList(null); List<ActivityVO> vos = entities.stream() .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); } diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyActivityServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyActivityServiceImpl.java index ca098d0..4238205 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyActivityServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyActivityServiceImpl.java @@ -15,6 +15,7 @@ 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.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.xkzhangsan.time.utils.StringUtil; @@ -23,7 +24,10 @@ import org.springframework.util.Assert; import java.util.Date; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -116,6 +120,13 @@ 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) + .one(); + vo.setIsCollect(activityReport != null); //鍒欏綋鍓嶇敤鎴锋湭鎶ュ悕 if (reportVO == null){ vo.setIsReport(false); diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java index 8a3ada6..28eb4e8 100644 --- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/MyCollectServiceImpl.java @@ -1,8 +1,9 @@ package cn.lili.modules.lmk.service.impl; +import cn.lili.common.enums.CollectTypeEnum; import cn.lili.common.security.context.UserContext; -import cn.lili.modules.lmk.domain.vo.SimpleMyCollectVO; -import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; +import cn.lili.modules.goods.entity.vos.GoodsVO; +import cn.lili.modules.lmk.domain.vo.*; import com.baomidou.mybatisplus.core.metadata.IPage; import cn.lili.modules.lmk.domain.entity.MyCollect; import cn.lili.modules.lmk.mapper.MyCollectMapper; @@ -11,7 +12,6 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import cn.lili.modules.lmk.domain.form.MyCollectForm; -import cn.lili.modules.lmk.domain.vo.MyCollectVO; import cn.lili.modules.lmk.domain.query.MyCollectQuery; import org.springframework.stereotype.Service; import lombok.RequiredArgsConstructor; @@ -35,6 +35,7 @@ private final MyCollectMapper myCollectMapper; + private final LmkFileServiceImpl fileService; /** * 娣诲姞 * @param form @@ -143,4 +144,36 @@ public List<CollectTypeNumVO> countNumGroupByType(String type) { return baseMapper.countNumGroupByType(type); } + + + @Override + public Result getMyCollectList(MyCollectQuery query) { + String userId = UserContext.getCurrentUserId(); + IPage<Object> page = PageUtil.getPage(query, Object.class); + if (CollectTypeEnum.activity.getType().equals(query.getType())){ + baseMapper.getActivityCollectPage(page, userId); + List<ActivityVO> activityVOS = page.getRecords().stream() + .filter(obj -> obj instanceof ActivityVO) + .map(obj -> (ActivityVO) obj) + .collect(Collectors.toList()); + for (ActivityVO activityVO : activityVOS) { + activityVO.setUrl(fileService.getPreviewUrl(activityVO.getCover())); + } + }else if (CollectTypeEnum.video.getType().equals(query.getType())) { + baseMapper.getVideoCollectPage(page, userId); + List<VideoVO> videoList = page.getRecords().stream() + .filter(obj -> obj instanceof VideoVO) + .map(obj -> (VideoVO) obj) + .collect(Collectors.toList()); + for (VideoVO video : videoList) { + video.setCoverUrl(fileService.getPreviewUrl(video.getCoverUrl())); + } + }else if (CollectTypeEnum.goods.getType().equals(query.getType())) { + baseMapper.getGoodsCollectPage(page, userId); + + } + + return Result.ok().data(page.getRecords()).total(page.getTotal()); + } + } diff --git a/framework/src/main/java/cn/lili/modules/member/service/MemberService.java b/framework/src/main/java/cn/lili/modules/member/service/MemberService.java index 614446c..f818a52 100644 --- a/framework/src/main/java/cn/lili/modules/member/service/MemberService.java +++ b/framework/src/main/java/cn/lili/modules/member/service/MemberService.java @@ -1,6 +1,7 @@ package cn.lili.modules.member.service; +import cn.lili.base.Result; import cn.lili.common.security.enums.UserEnums; import cn.lili.common.security.token.Token; import cn.lili.common.vo.PageVO; @@ -27,6 +28,13 @@ */ public interface MemberService extends IService<Member> { /** + * 閲嶇疆瀵嗙爜 榛樿鍊�123456 + * @param id 鐢ㄦ埛id + * @return + */ + Result resetPassword(String id); + + /** * 鐢ㄦ埛鏉冮檺绠$悊淇敼鐢ㄦ埛 * @param id 浼氬憳id * @param password 瀵嗙爜 diff --git a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java index 3cfd13a..bc00f42 100644 --- a/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/member/serviceimpl/MemberServiceImpl.java @@ -3,6 +3,7 @@ import cn.hutool.core.convert.Convert; import cn.hutool.core.text.CharSequenceUtil; +import cn.lili.base.Result; import cn.lili.cache.Cache; import cn.lili.cache.CachePrefix; import cn.lili.common.aop.annotation.DemoSite; @@ -49,7 +50,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.RequiredArgsConstructor; import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationEventPublisher; @@ -501,16 +501,20 @@ 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("閲嶇疆鎴愬姛"); + } @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); diff --git a/framework/src/main/resources/mapper/lmk/ActivityMapper.xml b/framework/src/main/resources/mapper/lmk/ActivityMapper.xml index 4b05374..832e884 100644 --- a/framework/src/main/resources/mapper/lmk/ActivityMapper.xml +++ b/framework/src/main/resources/mapper/lmk/ActivityMapper.xml @@ -112,6 +112,32 @@ <if test="query.reportStartTime != null">AND LA.report_start_time >= #{query.reportStartTime}</if> <if test="query.reportEndTime != null">AND LA.report_end_time <= #{query.reportEndTime}</if> </select> + + <select id="getCanReportPage" resultMap="BaseResultMap"> + SELECT + LA.id, + LA.activity_name, + LA.activity_type, + LA.report_start_time, + LA.report_end_time, + LA.start_time, + LA.end_time, + LA.status, + LA.recommend, + LA.cover, + LA.cover_type, + LA.limit_user_num, + LA.activity_location, + LA.activity_content + FROM + lmk_activity LA + WHERE + LA.delete_flag = 0 + AND LA.status = '鎶ュ悕涓�' + </select> + + + <resultMap id="memberMap" type="cn.lili.modules.member.entity.vo.MemberVO"> <id property="id" column="id"/> diff --git a/framework/src/main/resources/mapper/lmk/MyCollectMapper.xml b/framework/src/main/resources/mapper/lmk/MyCollectMapper.xml index 3f06bcb..573467c 100644 --- a/framework/src/main/resources/mapper/lmk/MyCollectMapper.xml +++ b/framework/src/main/resources/mapper/lmk/MyCollectMapper.xml @@ -66,4 +66,99 @@ ref_id </select> + + <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 --> + <resultMap id="activityBaseResult" type="cn.lili.modules.lmk.domain.vo.ActivityVO"> + <result column="activity_name" property="activityName" /> + <result column="activity_type" property="activityType"/> + <result column="report_start_time" property="reportStartTime" /> + <result column="report_end_time" property="reportEndTime" /> + <result column="start_time" property="startTime" /> + + <result column="end_time" property="endTime" /> + <result column="status" property="status" /> + <result column="recommend" property="recommend" /> + <result column="cover" property="cover" /> + <result column="cover_type" property="coverType" /> + <result column="limit_user_num" property="limitUserNum" /> + <result column="activity_location" property="activityLocation" /> + <result column="activity_content" property="activityContent" /> + </resultMap> + <select id="getActivityCollectPage" resultMap="activityBaseResult"> + SELECT + LA.* + FROM lmk_my_collect LMC + LEFT JOIN lmk_activity LA + ON LMC.ref_id = LA.id + WHERE LMC.collect_type = 'activity' and LMC.user_id = #{userId} + </select> + <resultMap id="videoBaseResult" type="cn.lili.modules.lmk.domain.vo.VideoVO"> + <id column="id" property="id"/> + <result column="author_id" property="authorId" /> + <result column="authorName" property="authorName" /> + <result column="cover_url" property="coverUrl" /> + <result column="video_file_key" property="videoFileKey" /> + <result column="video_fit" property="videoFit" /> + <result column="title" property="title" /> + <result column="goods_id" property="goodsId" /> + <result column="goods_view_num" property="goodsViewNum" /> + <result column="video_duration" property="videoDuration" /> + <result column="goods_order_num" property="goodsOrderNum" /> + <result column="recommend" property="recommend" /> + <result column="status" property="status" /> + <result column="play_num" property="playNum" /> + <result column="collect_num" property="collectNum" /> + <result column="comment_num" property="commentNum" /> + <result column="weight" property="weight" /> + <result column="audit_pass_time" property="auditPassTime" /> + <result column="update_time" property="updateTime" /> + </resultMap> + + <select id="getVideoCollectPage" resultMap="videoBaseResult"> + SELECT + LV.*, + LM.nick_name as authorName + FROM lmk_my_collect LMC + LEFT JOIN lmk_video LV + ON LMC.ref_id = LV.id + LEFT JOIN li_member LM ON LV.author_id = LM.id + WHERE LMC.collect_type = 'video' and LMC.user_id = #{userId} + and LV.delete_flag = 0 and LM.delete_flag= 0 and LMC.delete_flag =0 + </select> + + <resultMap id="storeBaseResult" type="cn.lili.modules.store.entity.vos.StoreBasicInfoVO"> + <id column="id" property="storeId"/> + <result column="store_name" property="storeName"/> + <result column="company_address_path" property="companyAddressPath"/> + <result column="store_logo" property="storeLogo"/> + <result column="store_desc" property="storeDesc"/> + </resultMap> + + <select id="getStoreCollectPage" resultMap="storeBaseResult"> + SELECT + LS.* + FROM lmk_my_collect LMC + LEFT JOIN li_store LS + ON LMC.ref_id = LS.id + WHERE LMC.collect_type = 'store' and LMC.user_id = #{userId} + and LS.delete_flag= 0 and LMC.delete_flag =0 + </select> + + <resultMap id="goodsBaseResult" type="cn.lili.modules.goods.entity.vos.GoodsVO"> + <id column="id" property="id"/> + <result column="goods_name" property="goodsName"/> + <result column="price" property="price"/> + <result column="mobile_intro" property="mobileIntro"/> + <result column="original" property="original"/> + </resultMap> + + <select id="getGoodsCollectPage" resultMap="goodsBaseResult"> + SELECT + LG.* + FROM lmk_my_collect LMC + LEFT JOIN li_goods LG + ON LMC.ref_id = LG.id + WHERE LMC.collect_type = 'goods' and LMC.user_id = #{userId} + and LG.delete_flag= 0 and LMC.delete_flag =0 + </select> </mapper> -- Gitblit v1.8.0