| | |
| | | String BIRTHDAY_NULL = "未填写生日"; |
| | | |
| | | String BIRTHDAY_ERROR = "只有生日当月领取"; |
| | | |
| | | String COUPON_GET_ERROR = "该优惠券不可领取"; |
| | | |
| | | String COUPON_GET_ALL = "该优惠券已领取完"; |
| | | } |
| | |
| | | @TableField("verify_status") |
| | | private Integer verifyStatus; |
| | | |
| | | @TableField("verify_time") |
| | | private Date verifyTime; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | public R<OauthUserVo> oauthUser(@ApiParam(value = "成员授权获取到的code", required = true) @RequestParam("code") String code) throws IOException { |
| | | // 通过code获取访问用户敏感信息 |
| | | JSONObject result = qywxInnerService.getOauthUser(code); |
| | | QwUserDetailDto qwUserDetail = JSONObject.parseObject(result.toJSONString(), QwUserDetailDto.class); |
| | | //QwUserDetailDto qwUserDetail = new QwUserDetailDto(); |
| | | //qwUserDetail.setMobile("13882237106"); |
| | | //qwUserDetail.setUserid("146"); |
| | | //QwUserDetailDto qwUserDetail = JSONObject.parseObject(result.toJSONString(), QwUserDetailDto.class); |
| | | QwUserDetailDto qwUserDetail = new QwUserDetailDto(); |
| | | qwUserDetail.setMobile("13882237106"); |
| | | qwUserDetail.setUserid("146"); |
| | | // 1、查数据库获取人员 |
| | | QwH5LoginVo qwH5LoginVo = sysLoginService.qwH5Login(qwUserDetail); |
| | | // 2、生成Token |
| | |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.goods.domain.dto.*; |
| | | import com.ruoyi.goods.domain.vo.MgtGoodsEditInfoVo; |
| | | import com.ruoyi.goods.domain.vo.MgtGoodsPageVo; |
| | | import com.ruoyi.goods.domain.vo.MgtGoodsTotalVo; |
| | | import com.ruoyi.goods.service.goods.GoodsService; |
| | |
| | | List<MgtSelectGoodsPageVo> mgtSelectGoodsPageVos = goodsService.pageMgtSelectGoods(page,mgtSelectGoodsPageDto); |
| | | return R.ok(page.setRecords(mgtSelectGoodsPageVos)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getMgtGoodsEditInfo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "获取商品编辑信息") |
| | | public R<MgtGoodsEditInfoVo> getMgtGoodsEditInfo(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | MgtGoodsEditInfoVo mgtGoodsEditInfoVo = goodsService.getMgtGoodsEditInfo(mgtBaseGetDto); |
| | | return R.ok(mgtGoodsEditInfoVo); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.goods.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String activityName; |
| | | |
| | | @ApiModelProperty(value = "活动开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date activityStartTime; |
| | | |
| | | @ApiModelProperty(value = "活动结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date activityEndTime; |
| | | |
| | | @ApiModelProperty(value = "活动状态") |
| | |
| | | package com.ruoyi.goods.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.system.api.domain.vo.MgtSimpleShopVo; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private String activityName; |
| | | |
| | | @ApiModelProperty(value = "活动开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date activityStartTime; |
| | | |
| | | @ApiModelProperty(value = "活动结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date activityEndTime; |
| | | |
| | | @ApiModelProperty(value = "成团人数") |
New file |
| | |
| | | package com.ruoyi.goods.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @ClassName MgtGoodsEditInfoVo |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/7/11 16:46 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class MgtGoodsEditInfoVo { |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | private String goodsId; |
| | | |
| | | @ApiModelProperty(value = "商品状态1上架2下架") |
| | | private Integer goodsStatus; |
| | | |
| | | @ApiModelProperty(value = "商品类型1周期2服务3体验4单品") |
| | | private Integer goodsType; |
| | | |
| | | @ApiModelProperty(value = "商品分类id") |
| | | private Long goodsClassId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value = "商品图片") |
| | | private String goodsPicture; |
| | | |
| | | @ApiModelProperty(value = "商品视频") |
| | | private String goodsVideo; |
| | | |
| | | @ApiModelProperty(value = "商品banner 多个用,号隔开") |
| | | private String goodsBanners; |
| | | |
| | | @ApiModelProperty(value = "是否明确次数0否1是") |
| | | private Integer cycleNumFlag; |
| | | |
| | | @ApiModelProperty(value = "服务次数") |
| | | private Integer serviceNum; |
| | | |
| | | @ApiModelProperty(value = "商品简介") |
| | | private String goodsIntroduction; |
| | | |
| | | @ApiModelProperty(value = "建议售价") |
| | | private BigDecimal salesPrice; |
| | | |
| | | @ApiModelProperty(value = "最低售价") |
| | | private BigDecimal mininumPrice; |
| | | |
| | | @ApiModelProperty(value = "订金") |
| | | private BigDecimal subscription; |
| | | |
| | | @ApiModelProperty(value = "商品详情") |
| | | private String goodsDetail; |
| | | |
| | | @ApiModelProperty(value = "是否推荐0否1是") |
| | | private Integer recommendFlag; |
| | | |
| | | @ApiModelProperty(value = "商品调理问题") |
| | | private String goodsNurses; |
| | | |
| | | @ApiModelProperty(value = "商品标签") |
| | | private String goodsTags; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @version 1.0 |
| | | */ |
| | | List<GoodsFile> listByGoodsId(String goodsId); |
| | | |
| | | /** |
| | | * @description 通过goodsId删除 |
| | | * @author jqs |
| | | * @date 2023/7/11 16:50 |
| | | * @param goodsId |
| | | * @return void |
| | | */ |
| | | void deleteByGoodsId(String goodsId); |
| | | } |
| | |
| | | import com.ruoyi.goods.domain.dto.*; |
| | | import com.ruoyi.goods.domain.vo.*; |
| | | import com.ruoyi.system.api.domain.dto.AppActivityGoodsPageDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.system.api.domain.poji.goods.Goods; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.domain.vo.MerGoodsPriceListVo; |
| | |
| | | */ |
| | | List<AppSimpleActivityGoodsVo> pageAppActivityGoods(Page page, AppActivityGoodsPageDto appActivityGoodsPageDto); |
| | | |
| | | /** |
| | | * @description 获取商品编辑详情 |
| | | * @author jqs |
| | | * @date 2023/7/11 16:48 |
| | | * @param mgtBaseGetDto |
| | | * @return MgtGoodsEditInfoVo |
| | | */ |
| | | MgtGoodsEditInfoVo getMgtGoodsEditInfo(MgtBaseGetDto mgtBaseGetDto); |
| | | } |
| | |
| | | package com.ruoyi.goods.service.impl.goods; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | |
| | | List<GoodsFile> goodsFileList = this.list(queryWrapper); |
| | | return goodsFileList; |
| | | } |
| | | |
| | | /** |
| | | * @description 通过goodsId删除 |
| | | * @author jqs |
| | | * @date 2023/7/11 16:50 |
| | | * @param goodsId |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void deleteByGoodsId(String goodsId){ |
| | | LambdaUpdateWrapper<GoodsFile> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(GoodsFile::getDelFlag,0); |
| | | updateWrapper.eq(GoodsFile::getGoodsId,goodsId); |
| | | updateWrapper.set(GoodsFile::getDelFlag,1); |
| | | this.update(updateWrapper); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.goods.service.goods.ShopGoodsService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.dto.AppActivityGoodsPageDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import com.ruoyi.system.api.domain.poji.activity.ActivityGoods; |
| | | import com.ruoyi.system.api.domain.poji.config.SysClassification; |
| | | import com.ruoyi.system.api.domain.poji.goods.Goods; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | if(goods.getGoodsStatus()==-1){ |
| | | throw new ServiceException(AppErrorConstant.GOODS_DELETED); |
| | | } |
| | | //删除历史数据 |
| | | goodsFileService.deleteByGoodsId(goodsId); |
| | | } else { |
| | | if(goodsSame!=null){ |
| | | throw new ServiceException(AppErrorConstant.GOODS_DOUBLE); |
| | |
| | | goods.setSubscriptionFlag(0); |
| | | } |
| | | goods.setSubscription(mgtGoodsEditDto.getSubscription()); |
| | | goods.setGoodsDetail(mgtGoodsEditDto.getGoodsDetail()); |
| | | String goodsDetail = mgtGoodsEditDto.getGoodsDetail(); |
| | | if(StringUtils.isNotBlank(goodsDetail)){ |
| | | byte[] decodedBytes = Base64.getDecoder().decode(goodsDetail); |
| | | goodsDetail = new String(decodedBytes, StandardCharsets.UTF_8); |
| | | goods.setGoodsDetail(goodsDetail); |
| | | } |
| | | goods.setRecommendFlag(mgtGoodsEditDto.getRecommendFlag()); |
| | | goods.setGoodsNurses(mgtGoodsEditDto.getGoodsNurses()); |
| | | goods.setGoodsTags(mgtGoodsEditDto.getGoodsNurses()); |
| | |
| | | // 返回结果 |
| | | return appSimpleGoodsVoList; |
| | | } |
| | | |
| | | /** |
| | | * @description 获取商品编辑详情 |
| | | * @author jqs |
| | | * @date 2023/7/11 16:48 |
| | | * @param mgtBaseGetDto |
| | | * @return MgtGoodsEditInfoVo |
| | | */ |
| | | @Override |
| | | public MgtGoodsEditInfoVo getMgtGoodsEditInfo(MgtBaseGetDto mgtBaseGetDto){ |
| | | MgtGoodsEditInfoVo mgtGoodsEditInfoVo = new MgtGoodsEditInfoVo(); |
| | | Goods goods = this.getById(mgtBaseGetDto.getId()); |
| | | BeanUtils.copyProperties(goods,mgtGoodsEditInfoVo); |
| | | List<GoodsFile> goodsFileList = goodsFileService.listByGoodsId(goods.getGoodsId()); |
| | | if(goodsFileList!=null&&!goodsFileList.isEmpty()){ |
| | | StringJoiner goodsBannersSj = new StringJoiner(","); |
| | | for(GoodsFile goodsFile : goodsFileList){ |
| | | if(goodsFile.getFileType()==1){ |
| | | mgtGoodsEditInfoVo.setGoodsPicture(goodsFile.getFileUrl()); |
| | | }else if(goodsFile.getFileType()==2){ |
| | | mgtGoodsEditInfoVo.setGoodsVideo(goodsFile.getFileUrl()); |
| | | }else if(goodsFile.getFileType()==2){ |
| | | goodsBannersSj.add(goodsFile.getFileUrl()); |
| | | } |
| | | } |
| | | if(goodsBannersSj!=null){ |
| | | mgtGoodsEditInfoVo.setGoodsBanners(goodsBannersSj.toString()); |
| | | } |
| | | } |
| | | return mgtGoodsEditInfoVo; |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.member.domain.dto.AppMemberCouponPageDto; |
| | | import com.ruoyi.member.domain.vo.AppGetAbleCouponPageVo; |
| | | import com.ruoyi.member.domain.vo.AppMemberCouponPageVo; |
| | | import com.ruoyi.member.service.coupon.CouponService; |
| | | import com.ruoyi.member.service.member.MemberCouponService; |
| | | import com.ruoyi.member.service.member.MemberService; |
| | | import com.ruoyi.system.api.domain.dto.AppBaseGetDto; |
| | | import com.ruoyi.system.api.domain.dto.AppPageDto; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | | import io.swagger.annotations.Api; |
| | |
| | | @Resource |
| | | private MemberService memberService; |
| | | |
| | | @Resource |
| | | private MemberCouponService memberCouponService; |
| | | |
| | | @RequestMapping(value = "/pageAppUserGetAbleCoupon", method = RequestMethod.POST) |
| | | @ApiOperation(value = "用户分页获取可领取优惠券列表") |
| | | public R<Page<AppGetAbleCouponPageVo>> pagePlatformMerCoupon(@RequestBody AppPageDto appPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | if(userId!=null){ |
| | | Member member = memberService.getByUserId(userId); |
| | | if(member!=null&&member.getRelationShopId()!=null){ |
| | | } |
| | | } |
| | | Member member = memberService.getByUserId(userId); |
| | | Long shopId = member.getRelationShopId(); |
| | | appPageDto.setUserId(userId); |
| | | Page<AppGetAbleCouponPageVo> page = new Page<>(); |
| | | page.setSize(appPageDto.getPageSize()); |
| | | page.setCurrent(appPageDto.getPageNum()); |
| | | List<AppGetAbleCouponPageVo> unGetCouponPageVoList = couponService.pageAppUserGetAbleCoupon(page,appPageDto); |
| | | List<AppGetAbleCouponPageVo> unGetCouponPageVoList = couponService.pageAppUserGetAbleCoupon(page,appPageDto,shopId); |
| | | return R.ok(page.setRecords(unGetCouponPageVoList)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/appGetCoupon", method = RequestMethod.POST) |
| | | @ApiOperation(value = "用户领取优惠券") |
| | | public R appGetCoupon(@RequestBody AppBaseGetDto appBaseGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | Member member = memberService.getByUserId(userId); |
| | | Long shopId = member.getRelationShopId(); |
| | | appBaseGetDto.setUserId(userId); |
| | | couponService.appGetCoupon(appBaseGetDto.getId(),userId,shopId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageAppUserGetCoupon", method = RequestMethod.POST) |
| | | @ApiOperation(value = "用户分页获取已领取优惠券列表") |
| | | public R<Page<AppMemberCouponPageVo>> pageAppUserGetCoupon(@RequestBody AppMemberCouponPageDto appMemberCouponPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | appMemberCouponPageDto.setUserId(userId); |
| | | Page<AppMemberCouponPageVo> page = new Page<>(); |
| | | page.setSize(appMemberCouponPageDto.getPageSize()); |
| | | page.setCurrent(appMemberCouponPageDto.getPageNum()); |
| | | List<AppMemberCouponPageVo> memberCouponPageVoList = memberCouponService.pageAppUserGetCoupon(page,appMemberCouponPageDto); |
| | | return R.ok(page.setRecords(memberCouponPageVoList)); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.member.domain.vo.AppBirthdayCardVo; |
| | | import com.ruoyi.member.domain.vo.AppMemberPrizePageVo; |
| | | import com.ruoyi.member.domain.vo.AppSuggestPageVo; |
| | | import com.ruoyi.member.domain.vo.AppUserInfoVo; |
| | | import com.ruoyi.member.service.birthday.BirthdayCardService; |
| | |
| | | import com.ruoyi.member.service.member.MemberSuggestService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.dto.AppEditUserDto; |
| | | import com.ruoyi.system.api.domain.dto.AppPageDto; |
| | | import com.ruoyi.system.api.domain.dto.AppSuggestPageDto; |
| | | import com.ruoyi.system.api.domain.dto.AppUserSuggestDto; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | |
| | | } |
| | | return R.ok(appBirthdayCardVo); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pageAppMemberPrize", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取用户奖品列表") |
| | | public R<Page<AppMemberPrizePageVo>> pageAppMemberPrize(@RequestBody AppPageDto appPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | appPageDto.setUserId(userId); |
| | | Page<AppMemberPrizePageVo> page = new Page<>(); |
| | | page.setSize(appPageDto.getPageSize()); |
| | | page.setCurrent(appPageDto.getPageNum()); |
| | | List<AppMemberPrizePageVo> memberPrizePageVoList = birthdayCardService.pageAppMemberPrize(page,userId); |
| | | return R.ok(page.setRecords(memberPrizePageVoList)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.member.domain.dto; |
| | | |
| | | import com.ruoyi.system.api.domain.dto.AppPageDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName AppMemberCouponPageDto |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/7/11 17:08 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class AppMemberCouponPageDto extends AppPageDto { |
| | | |
| | | |
| | | @ApiModelProperty(value = "优惠券状态0已过期1已领取2已使用") |
| | | private Integer couponStatus; |
| | | |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName AppUnGetCouponPageVo |
| | |
| | | @ApiModelProperty(value = "优惠券id") |
| | | private String couponId; |
| | | |
| | | @ApiModelProperty("优惠券名称") |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String couponName; |
| | | |
| | | @ApiModelProperty("优惠券类型1.满减2.折扣3.代金4.商品") |
| | | @ApiModelProperty(value = "优惠券类型1.满减2.折扣3.代金4.商品") |
| | | private Integer couponType; |
| | | |
| | | @ApiModelProperty(value ="优惠券关联商户",hidden = true) |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty(value ="优惠券关联商品",hidden = true) |
| | | private String relGoodsIds; |
| | | |
| | | @ApiModelProperty(value = "使用限制") |
| | | private String shopName; |
| | | private List<String> goodsLimitList; |
| | | |
| | | @ApiModelProperty(value = "门槛金额") |
| | | private BigDecimal moneyThreshold; |
New file |
| | |
| | | package com.ruoyi.member.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName AppMemberCouponPageVo |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/7/11 15:55 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class AppMemberCouponPageVo { |
| | | |
| | | @ApiModelProperty(value = "用户优惠券id") |
| | | private String memberCouponId; |
| | | |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String couponName; |
| | | |
| | | @ApiModelProperty(value = "优惠券类型1.满减2.折扣3.代金4.商品") |
| | | private Integer couponType; |
| | | |
| | | @ApiModelProperty(value ="优惠券关联商户",hidden = true) |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty(value ="优惠券关联商品",hidden = true) |
| | | private String relGoodsIds; |
| | | |
| | | @ApiModelProperty(value = "使用限制") |
| | | private List<String> goodsLimitList; |
| | | |
| | | @ApiModelProperty(value = "门槛金额") |
| | | private BigDecimal moneyThreshold; |
| | | |
| | | @ApiModelProperty(value = "折扣金额") |
| | | private BigDecimal discountMoney; |
| | | |
| | | @ApiModelProperty(value = "折扣百分比") |
| | | private BigDecimal discountPercent; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.member.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName AppPrizePageVo |
| | | * @Description TODO |
| | | * @Author jqs |
| | | * @Date 2023/7/11 17:49 |
| | | * @Version 1.0 |
| | | */ |
| | | @Data |
| | | public class AppMemberPrizePageVo { |
| | | |
| | | @ApiModelProperty(value = "奖品id") |
| | | private String prizeId; |
| | | |
| | | @ApiModelProperty(value = "奖品名称") |
| | | private String prizeName; |
| | | |
| | | @ApiModelProperty(value = "奖品来源") |
| | | private String prizeFrom; |
| | | |
| | | @ApiModelProperty(value = "核销状态1未核销2已核销") |
| | | private Integer verifyStatus; |
| | | |
| | | @ApiModelProperty(value = "获奖时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author jqs34 |
| | | * @ClassName MerMemberPageVo |
| | |
| | | |
| | | @ApiModelProperty(value = "商品类型") |
| | | private String goodsType; |
| | | |
| | | @ApiModelProperty(value = "最近消费时间",hidden = true) |
| | | private Date lastPayTime; |
| | | |
| | | @ApiModelProperty(value = "活跃度") |
| | | private String memberActiveness; |
| | | } |
| | |
| | | package com.ruoyi.member.mapper.birthday; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.member.domain.pojo.birthday.BirthdayCard; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.member.domain.vo.AppMemberPrizePageVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return BirthdayCard |
| | | */ |
| | | BirthdayCard getMerShopBirthdayCard(@Param("shopId") Long shopId); |
| | | |
| | | |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/7/11 18:12 |
| | | * @param page |
| | | * @param userId |
| | | * @return List<AppMemberPrizePageVo> |
| | | */ |
| | | List<AppMemberPrizePageVo> pageAppMemberPrize(Page page, @Param("userId")Long userId); |
| | | } |
| | |
| | | import com.ruoyi.member.domain.dto.MgtCouponListDto; |
| | | import com.ruoyi.member.domain.dto.MgtCouponPageDto; |
| | | import com.ruoyi.member.domain.pojo.coupon.Coupon; |
| | | import com.ruoyi.member.domain.vo.MerCouponPageVo; |
| | | import com.ruoyi.member.domain.vo.MgtCouponAuditPageVo; |
| | | import com.ruoyi.member.domain.vo.MgtCouponPageVo; |
| | | import com.ruoyi.member.domain.vo.MgtCouponSimpleListVo; |
| | | import com.ruoyi.member.domain.vo.*; |
| | | import com.ruoyi.system.api.domain.dto.MerPageDto; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | List<String> listUserUnGetCoupon(@Param("userId")Long userId); |
| | | |
| | | |
| | | |
| | | /** |
| | | * @description 可领取优惠券列表 |
| | | * @author jqs |
| | | * @date 2023/7/11 10:32 |
| | | * @param page |
| | | * @param shopId |
| | | * @param unGetList |
| | | * @return List<AppGetAbleCouponPageVo> |
| | | */ |
| | | List<AppGetAbleCouponPageVo> getAbleCouponPageVoList(Page page, @Param("shopId") Long shopId, @Param("unGetList") List<String> unGetList); |
| | | } |
| | |
| | | package com.ruoyi.member.mapper.member; |
| | | |
| | | import com.ruoyi.system.api.domain.poji.member.MemberCoupon; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.member.domain.dto.AppMemberCouponPageDto; |
| | | import com.ruoyi.member.domain.vo.AppMemberCouponPageVo; |
| | | import com.ruoyi.system.api.domain.poji.member.MemberCoupon; |
| | | import com.ruoyi.system.api.domain.vo.AppMemberCouponVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @date 2023/5/3 1:47 |
| | | * @version 1.0 |
| | | */ |
| | | List<AppMemberCouponVo> listVoMemberCouponByUserId(Long userId); |
| | | List<AppMemberCouponVo> listVoMemberCouponByUserId(@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * @description 用户分页获取已领取优惠券列表 |
| | | * @author jqs |
| | | * @date 2023/7/11 16:25 |
| | | * @param page |
| | | * @param appMemberCouponPageDto |
| | | * @return List<AppMemberCouponPageVo> |
| | | */ |
| | | List<AppMemberCouponPageVo> pageAppUserGetCoupon(Page page,@Param("param") AppMemberCouponPageDto appMemberCouponPageDto); |
| | | } |
| | |
| | | package com.ruoyi.member.service.birthday; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.member.domain.dto.MerBirthdayEditDto; |
| | | import com.ruoyi.member.domain.dto.MgtBirthdayEditDto; |
| | | import com.ruoyi.member.domain.dto.MgtBirthdayGetDto; |
| | | import com.ruoyi.member.domain.pojo.birthday.BirthdayCard; |
| | | import com.ruoyi.member.domain.vo.AppBirthdayCardVo; |
| | | import com.ruoyi.member.domain.vo.MerBirthdayEditInfoVo; |
| | | import com.ruoyi.member.domain.vo.MerBirthdayGetVo; |
| | | import com.ruoyi.member.domain.vo.MgtBirthdayGetVo; |
| | | import com.ruoyi.member.domain.vo.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | AppBirthdayCardVo getBirthdayGift(Long userId, Long shopId); |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/7/11 18:12 |
| | | * @param page |
| | | * @param userId |
| | | * @return List<AppMemberPrizePageVo> |
| | | */ |
| | | List<AppMemberPrizePageVo> pageAppMemberPrize(Page page, Long userId); |
| | | } |
| | |
| | | * @param appPageDto |
| | | * @return List<AppUnGetCouponPageVo> |
| | | */ |
| | | List<AppGetAbleCouponPageVo> pageAppUserGetAbleCoupon(Page page, AppPageDto appPageDto); |
| | | List<AppGetAbleCouponPageVo> pageAppUserGetAbleCoupon(Page page, AppPageDto appPageDto, Long shopId); |
| | | |
| | | |
| | | |
| | | /** |
| | | * @description 用户领取优惠券 |
| | | * @author jqs |
| | | * @date 2023/7/11 15:04 |
| | | * @param couponId |
| | | * @param shopId |
| | | * @return void |
| | | */ |
| | | void appGetCoupon(String couponId,Long userId,Long shopId); |
| | | } |
| | |
| | | package com.ruoyi.member.service.impl.birthday; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | |
| | | giftDesc = giftSj.toString(); |
| | | birthdayGetVo.setGiftDesc(giftDesc); |
| | | } |
| | | birthdayGetVo.setCardStatus(birthdayCard.getCardStatus()); |
| | | }else{ |
| | | birthdayGetVo.setCardStatus(2); |
| | | } |
| | |
| | | // 创建新的生日卡 |
| | | BirthdayCard birthdayCard = new BirthdayCard(); |
| | | birthdayCard.setDelFlag(0); |
| | | birthdayCard.setShopId(0L); |
| | | birthdayCard.setShopId(merBirthdayEditDto.getShopId()); |
| | | birthdayCard.setCardStatus(merBirthdayEditDto.getCardStatus()); |
| | | // 根据卡状态设置开启或关闭时间 |
| | | if(merBirthdayEditDto.getCardStatus()==1){ |
| | |
| | | appBirthdayCardVo.setBirthdayGiftVoList(birthdayGiftVoList); |
| | | return appBirthdayCardVo; |
| | | } |
| | | |
| | | /** |
| | | * @description |
| | | * @author jqs |
| | | * @date 2023/7/11 18:02 |
| | | * @param page |
| | | * @param userId |
| | | * @return List<AppMemberPrizePageVo> |
| | | */ |
| | | @Override |
| | | public List<AppMemberPrizePageVo> pageAppMemberPrize(Page page, Long userId){ |
| | | return birthdayCardMapper.pageAppMemberPrize(page, userId); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.member.domain.dto.*; |
| | | import com.ruoyi.member.domain.pojo.coupon.*; |
| | | import com.ruoyi.member.service.coupon.*; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.poji.member.MemberCoupon; |
| | | import com.ruoyi.member.domain.vo.*; |
| | | import com.ruoyi.member.mapper.coupon.CouponMapper; |
| | | import com.ruoyi.member.service.coupon.*; |
| | | import com.ruoyi.member.service.member.MemberCouponService; |
| | | import com.ruoyi.member.service.member.MemberService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.poji.goods.Goods; |
| | | import com.ruoyi.system.api.domain.poji.member.MemberCoupon; |
| | | import com.ruoyi.system.api.domain.vo.MerGoodsPriceListVo; |
| | | import com.ruoyi.system.api.service.RemoteActivityService; |
| | | import com.ruoyi.system.api.service.RemoteGoodsService; |
| | |
| | | * @return List<AppUnGetCouponPageVo> |
| | | */ |
| | | @Override |
| | | public List<AppGetAbleCouponPageVo> pageAppUserGetAbleCoupon(Page page, AppPageDto appPageDto){ |
| | | public List<AppGetAbleCouponPageVo> pageAppUserGetAbleCoupon(Page page, AppPageDto appPageDto, Long shopId){ |
| | | //获取当前已领取完优惠券 |
| | | List<String> unGetList = couponMapper.listUserUnGetCoupon(appPageDto.getUserId()); |
| | | //List<AppGetAbleCouponPageVo> getAbleCouponPageVoList = couponMapper.getAbleCouponPageVoList( unGetList); |
| | | return null; |
| | | List<AppGetAbleCouponPageVo> getAbleCouponPageVoList = couponMapper.getAbleCouponPageVoList(page, shopId, unGetList); |
| | | //处理商品限制 |
| | | if(!getAbleCouponPageVoList.isEmpty()){ |
| | | String relGoodsIds; |
| | | List<Goods> goodsList; |
| | | List<String> goodsLimitList; |
| | | for(AppGetAbleCouponPageVo appGetAbleCouponPageVo : getAbleCouponPageVoList){ |
| | | relGoodsIds = appGetAbleCouponPageVo.getRelGoodsIds(); |
| | | goodsList = remoteGoodsService.listGoodsByGoodsId(relGoodsIds).getData(); |
| | | if(!goodsList.isEmpty()){ |
| | | goodsLimitList = goodsList.stream().map(goods -> { |
| | | String goodsName = goods.getGoodsName(); |
| | | goodsName = "限制" + goodsName + "适用"; |
| | | return goodsName; |
| | | }).collect(Collectors.toList()); |
| | | appGetAbleCouponPageVo.setGoodsLimitList(goodsLimitList); |
| | | } |
| | | } |
| | | } |
| | | return getAbleCouponPageVoList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * @description 用户领取优惠券 |
| | | * @author jqs |
| | | * @date 2023/7/11 15:04 |
| | | * @param couponId |
| | | * @param shopId |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void appGetCoupon(String couponId,Long userId,Long shopId){ |
| | | Coupon coupon = this.getById(couponId); |
| | | if(coupon==null||coupon.getDelFlag()==1||coupon.getCouponStatus()!=1||coupon.getSendType()!=1){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_GET_ERROR); |
| | | } |
| | | MemberCouponRecord memberCouponRecord = memberCouponRecordService.getByCouponIdAndUserId(couponId,userId); |
| | | if(memberCouponRecord!=null&&memberCouponRecord.getLimitFlag()==1){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_GET_ALL); |
| | | } |
| | | MemberCoupon memberCoupon = new MemberCoupon(); |
| | | String memberCouponId = IdUtils.simpleUUID(); |
| | | memberCoupon.setId(memberCouponId); |
| | | memberCoupon.setDelFlag(0); |
| | | memberCoupon.setCouponId(couponId); |
| | | memberCoupon.setUserId(userId); |
| | | memberCoupon.setShopId(shopId); |
| | | memberCoupon.setCouponType(coupon.getCouponType()); |
| | | memberCoupon.setCouponStatus(coupon.getCouponStatus()); |
| | | memberCoupon.setCouponName(coupon.getCouponName()); |
| | | memberCoupon.setSendType(coupon.getSendType()); |
| | | memberCoupon.setSendTimeType(coupon.getSendTimeType()); |
| | | memberCoupon.setSendTime(coupon.getSendTime()); |
| | | memberCoupon.setMoneyThreshold(coupon.getMoneyThreshold()); |
| | | memberCoupon.setDiscountMoney(coupon.getDiscountMoney()); |
| | | memberCoupon.setDiscountPercent(coupon.getDiscountPercent()); |
| | | memberCoupon.setUseScope(coupon.getUseScope()); |
| | | memberCoupon.setValidTimeType(coupon.getValidTimeType()); |
| | | memberCoupon.setValidStartTime(coupon.getValidStartTime()); |
| | | memberCoupon.setValidEndTime(coupon.getValidEndTime()); |
| | | memberCoupon.setValidDay(coupon.getValidDay()); |
| | | memberCoupon.setReceiveTime(new Date()); |
| | | //有效期处理1.时间段2.领取之日起 |
| | | if(coupon.getValidTimeType()==1){ |
| | | memberCoupon.setDeadlineTime(coupon.getValidEndTime()); |
| | | }else if(coupon.getValidTimeType()==2){ |
| | | memberCoupon.setDeadlineTime(DateUtils.addDays(new Date(),coupon.getValidDay())); |
| | | } |
| | | memberCoupon.setRelGoodsIds(coupon.getRelGoodsIds()); |
| | | memberCouponService.save(memberCoupon); |
| | | memberCouponRecordService.updateMemberCouponRecord(coupon,userId,1); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.member.domain.pojo.coupon.Coupon; |
| | | import com.ruoyi.member.domain.pojo.coupon.CouponTotal; |
| | | import com.ruoyi.member.domain.pojo.coupon.MemberCouponRecord; |
| | | import com.ruoyi.member.mapper.coupon.MemberCouponRecordMapper; |
| | | import com.ruoyi.member.service.coupon.CouponTotalService; |
| | | import com.ruoyi.member.service.coupon.MemberCouponRecordService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class MemberCouponRecordServiceImpl extends ServiceImpl<MemberCouponRecordMapper, MemberCouponRecord> implements MemberCouponRecordService { |
| | | |
| | | |
| | | @Resource |
| | | private CouponTotalService couponTotalService; |
| | | |
| | | /** |
| | | * @description 获取用户优惠券领取记录 |
| | |
| | | public void updateMemberCouponRecord(Coupon coupon, Long userId, Integer number) { |
| | | // 根据优惠券ID和用户ID获取会员优惠券记录 |
| | | MemberCouponRecord memberCouponRecord = this.getByCouponIdAndUserId(coupon.getCouponId(), userId); |
| | | CouponTotal couponTotal = couponTotalService.getById(coupon.getCouponId()); |
| | | if (memberCouponRecord != null) { |
| | | // 如果会员优惠券记录存在,则更新数量 |
| | | memberCouponRecord.setNum(memberCouponRecord.getNum() + number); |
| | |
| | | } else { |
| | | memberCouponRecord.setLimitFlag(0); |
| | | } |
| | | couponTotal.setSendUserCount(couponTotal.getSendUserCount()+1); |
| | | } |
| | | // 保存或更新会员优惠券记录 |
| | | this.saveOrUpdate(memberCouponRecord); |
| | | couponTotal.setSendCount(couponTotal.getSendCount()+number); |
| | | couponTotalService.saveOrUpdate(couponTotal); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.member.service.impl.member; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.member.domain.dto.AppMemberCouponPageDto; |
| | | import com.ruoyi.member.domain.vo.AppMemberCouponPageVo; |
| | | import com.ruoyi.member.mapper.member.MemberCouponMapper; |
| | | import com.ruoyi.member.service.member.MemberCouponService; |
| | | import com.ruoyi.system.api.constant.AppErrorConstant; |
| | | import com.ruoyi.system.api.domain.poji.goods.Goods; |
| | | import com.ruoyi.system.api.domain.poji.member.MemberCoupon; |
| | | import com.ruoyi.system.api.domain.poji.shop.Shop; |
| | | import com.ruoyi.system.api.domain.vo.AppMemberCouponVo; |
| | | import com.ruoyi.system.api.domain.vo.MerVerifyCouponGetVo; |
| | | import com.ruoyi.system.api.service.RemoteGoodsService; |
| | | import com.ruoyi.system.api.service.RemoteShopService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Resource |
| | | private RemoteGoodsService remoteGoodsService; |
| | | |
| | | @Resource |
| | | private RemoteShopService remoteShopService; |
| | | |
| | | /** |
| | | * @description: TODO |
| | |
| | | throw new ServiceException(AppErrorConstant.COUPON_EXPIRED); |
| | | }else if(memberCoupon.getCouponStatus()==2){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_USED); |
| | | }else if(memberCoupon.getCouponStatus()!=0){ |
| | | }else if(memberCoupon.getCouponStatus()==-1){ |
| | | throw new ServiceException(AppErrorConstant.COUPON_NO_FIND); |
| | | } |
| | | if(memberCoupon.getCouponType()!=4){ |
| | |
| | | return total; |
| | | } |
| | | |
| | | /** |
| | | * @description 用户分页获取已领取优惠券列表 |
| | | * @author jqs |
| | | * @date 2023/7/11 16:25 |
| | | * @param page |
| | | * @param appMemberCouponPageDto |
| | | * @return List<AppMemberCouponPageVo> |
| | | */ |
| | | @Override |
| | | public List<AppMemberCouponPageVo> pageAppUserGetCoupon(Page page, AppMemberCouponPageDto appMemberCouponPageDto){ |
| | | List<AppMemberCouponPageVo> memberCouponPageVoList = memberCouponMapper.pageAppUserGetCoupon(page, appMemberCouponPageDto); |
| | | if(!memberCouponPageVoList.isEmpty()){ |
| | | String relGoodsIds; |
| | | List<Goods> goodsList; |
| | | List<String> goodsLimitList; |
| | | Shop shop = null; |
| | | for(AppMemberCouponPageVo appGetAbleCouponPageVo : memberCouponPageVoList){ |
| | | relGoodsIds = appGetAbleCouponPageVo.getRelGoodsIds(); |
| | | goodsList = remoteGoodsService.listGoodsByGoodsId(relGoodsIds).getData(); |
| | | if(!goodsList.isEmpty()){ |
| | | goodsLimitList = goodsList.stream().map(goods -> { |
| | | String goodsName = goods.getGoodsName(); |
| | | goodsName = "限制" + goodsName + "适用"; |
| | | return goodsName; |
| | | }).collect(Collectors.toList()); |
| | | }else{ |
| | | goodsLimitList = new ArrayList<>(); |
| | | if(appGetAbleCouponPageVo.getShopId()!=null){ |
| | | if(shop!=null&&shop.getShopId().equals(appGetAbleCouponPageVo.getShopId())){ |
| | | }else{ |
| | | shop = remoteShopService.getShop(appGetAbleCouponPageVo.getShopId()).getData(); |
| | | } |
| | | goodsLimitList.add(shop.getShopName()+"通用"); |
| | | }else{ |
| | | goodsLimitList.add("全场通用"); |
| | | } |
| | | } |
| | | appGetAbleCouponPageVo.setGoodsLimitList(goodsLimitList); |
| | | } |
| | | } |
| | | return memberCouponPageVoList; |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public List<MerMemberPageVo> pageMerMember(Page page, MerMemberPageDto merMemberPageDto) { |
| | | List<Activeness> activenessList = remoteConfigService.listActiveness().getData(); |
| | | if (StringUtils.isNotBlank(merMemberPageDto.getMemberActiveness())) { |
| | | Activeness activeness = remoteConfigService.getActivenessByName(merMemberPageDto.getMemberActiveness()).getData(); |
| | | if (activeness != null) { |
| | | Date nowDay = DateUtils.getNowDate(); |
| | | String actStartDate = DateUtils.parseDateToStr("yyyy-MM-dd", DateUtils.addDays(nowDay, activeness.getEndDay())); |
| | | String actEndDate = DateUtils.parseDateToStr("yyyy-MM-dd", DateUtils.addDays(nowDay, activeness.getStartDay())); |
| | | merMemberPageDto.setActStartDate(actStartDate); |
| | | merMemberPageDto.setActEndDate(actEndDate); |
| | | if(!activenessList.isEmpty()){ |
| | | for(Activeness activeness : activenessList){ |
| | | if(activeness.getActivenessName().equals(merMemberPageDto.getMemberActiveness())){ |
| | | Date nowDay = DateUtils.getNowDate(); |
| | | String actStartDate = DateUtils.parseDateToStr("yyyy-MM-dd", DateUtils.addDays(nowDay, activeness.getEndDay())); |
| | | String actEndDate = DateUtils.parseDateToStr("yyyy-MM-dd", DateUtils.addDays(nowDay, activeness.getStartDay())); |
| | | merMemberPageDto.setActStartDate(actStartDate); |
| | | merMemberPageDto.setActEndDate(actEndDate); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | List<MerMemberPageVo> merMemberPageVoList = memberMapper.pageMerMember(page, merMemberPageDto); |
| | | //处理活跃度返回 |
| | | if (merMemberPageVoList != null && !merMemberPageVoList.isEmpty()) { |
| | | if (activenessList != null && !activenessList.isEmpty()) { |
| | | //生成活跃度时间段列表 |
| | | List<MgtActivenessJudgeVo> mgtActivenessJudgeVoList = new ArrayList<>(); |
| | | MgtActivenessJudgeVo mgtActivenessJudgeVo; |
| | | for (Activeness activeness : activenessList) { |
| | | mgtActivenessJudgeVo = new MgtActivenessJudgeVo(); |
| | | mgtActivenessJudgeVo.setStartDay(DateUtils.addDays(new Date(), activeness.getEndDay())); |
| | | mgtActivenessJudgeVo.setEndDay(DateUtils.addDays(new Date(), activeness.getStartDay() - 1)); |
| | | mgtActivenessJudgeVo.setActivenessName(activeness.getActivenessName()); |
| | | } |
| | | //活跃度赋值 |
| | | Date lastPayTime; |
| | | for (MerMemberPageVo mgtMemberPageVo : merMemberPageVoList) { |
| | | lastPayTime = mgtMemberPageVo.getLastPayTime(); |
| | | StringJoiner sj = new StringJoiner(","); |
| | | if (lastPayTime != null) { |
| | | for (MgtActivenessJudgeVo entity : mgtActivenessJudgeVoList) { |
| | | if (lastPayTime.compareTo(entity.getStartDay()) >= 0 && lastPayTime.compareTo(entity.getEndDay()) <= 0) { |
| | | sj.add(entity.getActivenessName()); |
| | | } |
| | | } |
| | | if (sj.length() > 0) { |
| | | mgtMemberPageVo.setMemberActiveness(sj.toString()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return merMemberPageVoList; |
| | | } |
| | | |
| | |
| | | package com.ruoyi.member.service.member; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.member.domain.dto.AppMemberCouponPageDto; |
| | | import com.ruoyi.member.domain.vo.AppMemberCouponPageVo; |
| | | import com.ruoyi.system.api.domain.poji.member.MemberCoupon; |
| | | import com.ruoyi.system.api.domain.vo.AppMemberCouponVo; |
| | | import com.ruoyi.system.api.domain.vo.MerVerifyCouponGetVo; |
| | |
| | | Integer totalMemberCouponByUserAndCoupon(Long userId,String couponId); |
| | | |
| | | |
| | | /** |
| | | * @description 用户分页获取已领取优惠券列表 |
| | | * @author jqs |
| | | * @date 2023/7/11 16:25 |
| | | * @param page |
| | | * @param appMemberCouponPageDto |
| | | * @return List<AppMemberCouponPageVo> |
| | | */ |
| | | List<AppMemberCouponPageVo> pageAppUserGetCoupon(Page page, AppMemberCouponPageDto appMemberCouponPageDto); |
| | | } |
| | |
| | | SELECT * |
| | | FROM t_birthday_card |
| | | WHERE del_flag = 0 AND card_status = 1 AND shop_id = 0 |
| | | AND shop_flag = 1 OR (shop_flag = 2 AND FIND_IN_SET(#{shop_id}, applicable_shop) > 0) |
| | | AND (shop_flag = 1 OR (shop_flag = 2 AND FIND_IN_SET(#{shopId}, applicable_shop) > 0)) |
| | | |
| | | </select> |
| | | |
| | | <select id="getPlatformBirthdayCard" resultType="com.ruoyi.member.domain.pojo.birthday.BirthdayCard"> |
| | | <select id="getMerShopBirthdayCard" resultType="com.ruoyi.member.domain.pojo.birthday.BirthdayCard"> |
| | | SELECT * |
| | | FROM t_birthday_card |
| | | WHERE del_flag = 0 AND card_status = 1 |
| | | AND shop_id = #{shop_id} |
| | | AND shop_id = #{shopId} |
| | | </select> |
| | | |
| | | <select id="pageAppMemberPrize" resultType="com.ruoyi.member.domain.vo.AppMemberPrizePageVo"> |
| | | SELECT |
| | | prize_id prizeId, |
| | | CASE gift_type |
| | | WHEN 1 THEN coupon_name |
| | | WHEN 2 THEN goods_name |
| | | WHEN 3 THEN gift_name |
| | | WHEN 4 THEN "现金" |
| | | END prizeName, |
| | | "生日卡" prizeFrom, |
| | | verify_status verifyStatus, |
| | | create_time createTime |
| | | FROM t_member_gift_record |
| | | WHERE del_flag = 0 AND user_id = #{userId} |
| | | </select> |
| | | </mapper> |
| | |
| | | UPDATE t_coupon_total set send_count = send_count + #{sendTotal}, send_user_count = send_user_count + sendPerson WHERE coupon_id = #{couponId} |
| | | </update> |
| | | |
| | | <select id="pagePlatformMerCoupon" resultType="com.ruoyi.member.domain.vo.MgtCouponPageVo"> |
| | | <select id="pagePlatformMerCoupon" resultType="com.ruoyi.member.domain.vo.MerCouponPageVo"> |
| | | SELECT |
| | | tc.coupon_id couponId, |
| | | tc.coupon_name couponName, |
| | | CASE tc.coupon_type |
| | | WHEN 1 THEN '满减' |
| | | WHEN 2 THEN '折扣' |
| | | WHEN 3 THEN '代金' |
| | | WHEN 4 THEN '商品' |
| | | END couponType, |
| | | tc.coupon_type couponType, |
| | | tc.valid_time_type validTimeType, |
| | | tc.valid_start_time validStartTime, |
| | | tc.valid_end_time validEndTime, |
| | |
| | | tc.create_time createTime |
| | | FROM t_coupon tc |
| | | LEFT JOIN t_coupon_total tct ON tc.coupon_id = tct.coupon_id |
| | | WHERE tc.del_flag = 0 AND tc.coupon_status = 2 AND tc.coupon_from = 1 |
| | | WHERE tc.del_flag = 0 AND tc.coupon_status = 1 AND tc.coupon_from = 1 |
| | | </select> |
| | | |
| | | <select id="pageShopMerCoupon" resultType="com.ruoyi.member.domain.vo.MgtCouponPageVo"> |
| | | <select id="pageShopMerCoupon" resultType="com.ruoyi.member.domain.vo.MerCouponPageVo"> |
| | | SELECT |
| | | tc.coupon_id couponId, |
| | | tc.coupon_name couponName, |
| | | CASE tc.coupon_type |
| | | WHEN 1 THEN '满减' |
| | | WHEN 2 THEN '折扣' |
| | | WHEN 3 THEN '代金' |
| | | WHEN 4 THEN '商品' |
| | | END couponType, |
| | | tc.coupon_type couponType, |
| | | tc.valid_time_type validTimeType, |
| | | tc.valid_start_time validStartTime, |
| | | tc.valid_end_time validEndTime, |
| | |
| | | tc.limit_number limitNumber |
| | | FROM t_coupon tc |
| | | LEFT JOIN t_coupon_total tct ON tc.coupon_id = tct.coupon_id |
| | | WHERE tc.del_flag = 0 AND tc.coupon_status = 2 AND tc.coupon_from = 2 AND tc.shop_id = #{param.shopId} |
| | | WHERE tc.del_flag = 0 AND tc.coupon_status = 1 AND tc.coupon_from = 2 AND tc.shop_id = #{param.shopId} |
| | | <if test="param.auditStatus != null and param.auditStatus != ''"> |
| | | AND tc.audit_status = #{param.auditStatus} |
| | | </if> |
| | |
| | | tc.coupon_id |
| | | FROM t_coupon tc |
| | | LEFT JOIN t_member_coupon_record tmcr ON tc.coupon_id = tmcr.coupon_id AND tmcr.user_id = #{userId} |
| | | WHERE tc.del_flag = 0 AND tc.coupon_status = 1 AND send_type = 1 AND tmcr.limit_flag = 1 |
| | | WHERE tc.del_flag = 0 AND tc.coupon_status = 1 AND tc.send_type = 1 AND tmcr.limit_flag = 1 |
| | | </select> |
| | | |
| | | <select id="getAbleCouponPageVoList" resultType="com.ruoyi.member.domain.vo.AppGetAbleCouponPageVo"> |
| | | SELECT |
| | | tc.coupon_id couponId, |
| | | tc.coupon_name couponName, |
| | | tc.coupon_type couponType, |
| | | tc.money_threshold moneyThreshold, |
| | | tc.discount_money discountMoney, |
| | | tc.discount_percent discountPercent |
| | | tc.rel_goods_ids relGoodsIds |
| | | FROM t_coupon tc |
| | | WHERE tc.dle_flag = 0 AND tc.coupon_status = 1 AND tc.send_type = 1 AND (tc.coupon_from = 1 OR (tc.coupon_from = 2 AND tc.shop_id = #{shopId})) |
| | | <if test="unGetList != null and unGetList.size()>0"> |
| | | AND tc.coupon_id NOT IN |
| | | <foreach collection="unGetList" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | tuc.deadline_time deadlineTime, |
| | | tuc.rel_goods_ids relGoodsIds |
| | | FROM t_member_coupon tuc |
| | | WHERE tuc.del_flag = 1 AND tuc.coupon_status = 1 AND tuc.coupon_type IN (1,2,3) |
| | | ORDER BY tuc.receive_time |
| | | WHERE tuc.del_flag = 0 AND tuc.coupon_status = 1 AND tuc.user_id = #{userId} AND tuc.coupon_type IN (1,2,3) |
| | | ORDER BY tuc.receive_time DESC |
| | | </select> |
| | | |
| | | <select id="pageAppUserGetCoupon" resultType="com.ruoyi.member.domain.vo.AppMemberCouponPageVo"> |
| | | SELECT |
| | | tuc.id memberCouponId, |
| | | tuc.coupon_type couponType, |
| | | tuc.coupon_name couponName, |
| | | tuc.money_threshold moneyThreshold, |
| | | tuc.discount_money discountMoney, |
| | | tuc.discount_percent discountPercent, |
| | | tuc.valid_start_time validStartTime, |
| | | tuc.deadline_time deadlineTime, |
| | | tuc.rel_goods_ids relGoodsIds, |
| | | tuc.shop_id shopId |
| | | FROM t_member_coupon tuc |
| | | WHERE tuc.del_flag = 0 AND tuc.coupon_status = 1 AND tuc.user_id = #{param.userId} |
| | | <if test="param.couponStatus != null"> |
| | | tuc.coupon_status = #{param.couponStatus} |
| | | </if> |
| | | ORDER BY tuc.receive_time DESC |
| | | </select> |
| | | </mapper> |
| | |
| | | tmt.useable_service_count surpNum, |
| | | tm.birthday birthday, |
| | | tm.user_tags userTags, |
| | | tm.goods_type goodsType |
| | | tm.goods_type goodsType, |
| | | tmt.last_pay_time lastPayTime |
| | | FROM t_member tm |
| | | INNER JOIN t_member_total tmt ON tm.member_id = tmt.member_id |
| | | WHERE tm.relation_shop_id = #{param.shopId} |
| | |
| | | public R<MerVerifyAwardVo> sureVerifyPrize(@RequestBody MerVerifyPrizeDto merVerifyPrizeDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | merVerifyPrizeDto.setUserId(userId); |
| | | MerVerifyAwardVo merVerifyAwardVo = new MerVerifyAwardVo(); |
| | | MerVerifyAwardVo merVerifyAwardVo = orderService.sureVerifyPrize(merVerifyPrizeDto); |
| | | return R.ok(merVerifyAwardVo); |
| | | } |
| | | |
| | |
| | | }else{ |
| | | merVerifyAwardVo.setGiftFrom("商户生日卡"); |
| | | } |
| | | |
| | | merVerifyAwardVo.setGiftType(memberGiftRecord.getGiftType()); |
| | | List<BirthdayGiftSendDto> giftSendDtoList = new ArrayList<>(); |
| | | BirthdayGiftSendDto birthdayGiftSendDto = new BirthdayGiftSendDto(); |
| | |
| | | break; |
| | | } |
| | | merVerifyAwardVo.setCreateTime(memberGiftRecord.getCreateTime()); |
| | | memberGiftRecord.setVerifyStatus(2); |
| | | memberGiftRecord.setVerifyTime(new Date()); |
| | | if(member.getBindingFlag()!=1){ |
| | | AppMemberBindingDto appMemberBindingDto = new AppMemberBindingDto(); |
| | | appMemberBindingDto.setBindingFlag(1); |
| | | appMemberBindingDto.setShopId(merVerifyPrizeDto.getShopId()); |
| | | Shop shop = remoteShopService.getShop(merVerifyPrizeDto.getShopId()).getData(); |
| | | appMemberBindingDto.setShopName(shop.getShopName()); |
| | | appMemberBindingDto.setUserId(merVerifyPrizeDto.getUserId()); |
| | | remoteMemberService.updateMemberBinding(appMemberBindingDto); |
| | | } |
| | | return merVerifyAwardVo; |
| | | } |
| | | |
| | |
| | | } |
| | | shop.setBelongUserId(mgtTransferShopDto.getTransferUserId()); |
| | | this.saveOrUpdate(shop); |
| | | ShopRelUser shopRelUser = new ShopRelUser(); |
| | | /*ShopRelUser shopRelUser = new ShopRelUser(); |
| | | shopRelUser.setDelFlag(0); |
| | | shopRelUser.setShopId(shop.getShopId()); |
| | | shopRelUser.setUserId(mgtTransferShopDto.getTransferUserId()); |
| | |
| | | shopRelUser.setUserMobile(sysUser.getPhonenumber()); |
| | | shopRelUser.setUserDeptId(sysUser.getDeptId()); |
| | | shopRelUser.setUserName(sysUser.getNickName()); |
| | | shopRelUserService.save(shopRelUser); |
| | | shopRelUserService.save(shopRelUser);*/ |
| | | } |
| | | |
| | | /** |