| | |
| | | @TableField("person_ids") |
| | | private String personIds; |
| | | |
| | | @ApiModelProperty(value = "上架状态:0-下架 1-上架") |
| | | @TableField("shelf_status") |
| | | private Integer shelfStatus; |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.other.api.feignClient.VipSettingClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2024/12/10 13:53 |
| | |
| | | public R<VipSetting> getVipSetting(Integer id) { |
| | | return R.fail("查询会员配置失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<List<VipSetting>> info() { |
| | | return R.fail("获取会员配置失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.factory.VipSettingClientFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | */ |
| | | @PostMapping("/vip-setting/getVipSetting") |
| | | R<VipSetting> getVipSetting(@RequestParam("id") Integer id); |
| | | |
| | | @GetMapping("/vip-setting/info") |
| | | R<List<VipSetting>> info(); |
| | | } |
| | |
| | | package com.ruoyi.other.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.service.CouponInfoService; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | @PostMapping("/list") |
| | | @ApiOperation(value = "优惠劵管理-列表", tags = {"管理后台-活动管理"}) |
| | | public R<IPage<CouponInfo>> list(@RequestParam("pageNum") Integer pageNum, |
| | | @RequestParam("pageSize") Integer pageSize, |
| | | CouponInfo couponInfo) { |
| | | return R.ok(couponInfoService.queryCouponInfoPage(Page.of(pageNum, pageSize), couponInfo)); |
| | | } |
| | | |
| | | |
| | | //查看详情 |
| | | @PostMapping("/detail") |
| | | @ApiOperation(value = "活动管理-优惠劵管理-详情", tags = {"管理后台"}) |
| | | @ApiOperation(value = "优惠劵管理-详情", tags = {"管理后台-活动管理"}) |
| | | public R<CouponInfo> detail(@RequestParam("id") Integer id){ |
| | | CouponInfo byId = couponInfoService.getById(id); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | // 删除优惠劵 |
| | | @PostMapping("/delete") |
| | | @ApiOperation(value = "优惠劵管理-删除", tags = {"管理后台-活动管理"}) |
| | | public R<Void> delete(@RequestParam("id") Integer id) { |
| | | couponInfoService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 编辑优惠劵 |
| | | @PostMapping("/edit") |
| | | @ApiOperation(value = "优惠劵管理-编辑", tags = {"管理后台-活动管理"}) |
| | | public R<Void> edit(@RequestBody CouponInfo couponInfo) { |
| | | couponInfoService.updateById(couponInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | // 修改上/下架状态 |
| | | @PostMapping("/editStatus") |
| | | @ApiOperation(value = "优惠劵管理-修改上/下架状态", tags = {"管理后台-活动管理"}) |
| | | public R<Void> editStatus(@RequestParam("id") Integer id, |
| | | @RequestParam("shelfStatus") Integer shelfStatus) { |
| | | CouponInfo couponInfo = new CouponInfo(); |
| | | couponInfo.setId(id); |
| | | couponInfo.setShelfStatus(shelfStatus); |
| | | couponInfoService.updateById(couponInfo); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @GetMapping("/gift/list") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取优惠券数据 |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | |
| | | /** |
| | | * 根据商品id和会员等级获取门店特价 |
| | | * |
| | | * @param goodsBargainPrice |
| | | * @return |
| | | */ |
| | | @PostMapping("/getGoodsBargainPrice") |
| | | public R<GoodsBargainPriceDetail> getGoodsBargainPrice(@RequestBody GetGoodsBargainPrice goodsBargainPrice) { |
| | |
| | | .eq(!CollectionUtils.isEmpty(goodsIds), GoodsBargainPrice::getGoodsId, goodsId) |
| | | .eq(auditStatus != null, GoodsBargainPrice::getAuditStatus, auditStatus)); |
| | | |
| | | page.getRecords().forEach(goodsBargainPrice -> { |
| | | goodsList.stream() |
| | | page.getRecords().forEach(goodsBargainPrice -> goodsList.stream() |
| | | .filter(goods -> goods.getId().equals(goodsBargainPrice.getGoodsId())) |
| | | .findFirst().ifPresent(g -> { |
| | | GoodsCategory goodsCategory = goodsCategoryService.getById(g.getGoodsCategoryId()); |
| | |
| | | goodsBargainPrice.setShopName(shop.getName()); |
| | | goodsBargainPrice.setGoodsName(g.getName()); |
| | | goodsBargainPrice.setCategoryName(goodsCategory.getName()); |
| | | }); |
| | | }); |
| | | })); |
| | | |
| | | return R.ok(page); |
| | | } |
| | |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.VipSetting; |
| | | import com.ruoyi.other.api.feignClient.VipSettingClient; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import com.ruoyi.other.vo.GoodsVO; |
| | | import io.swagger.annotations.Api; |
| | |
| | | public class GoodsController extends BaseController { |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | @Resource |
| | | private VipSettingClient settingClient; |
| | | |
| | | /** |
| | | * 添加商品 |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取会员等级信息 |
| | | */ |
| | | @GetMapping("/getVipSetting") |
| | | @ApiOperation(value = "会员等级信息", tags = {"小程序-个人中心-优惠劵"}) |
| | | public R<List<VipSetting>> getVipSetting(){ |
| | | return settingClient.info(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | * 删除活动 |
| | | */ |
| | | @PostMapping("/delete") |
| | | @ApiOperation(value = "删除活动", tags = {"管理后台-活动管理-订单优惠活动-"}) |
| | | @ApiOperation(value = "删除活动", tags = {"管理后台-活动管理-订单优惠活动"}) |
| | | public R<Void> deleteActivityConfig(@RequestParam("id") Long id){ |
| | | orderActivityInfoService.removeById(id); |
| | | return R.ok(); |
| | |
| | | * 修改活动 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperation(value = "修改活动", tags = {"管理后台-活动管理-订单优惠活动-"}) |
| | | @ApiOperation(value = "修改活动", tags = {"管理后台-活动管理-订单优惠活动"}) |
| | | public R<Void> updateActivityConfig(@RequestBody OrderActivityInfo orderActivityInfo){ |
| | | orderActivityInfoService.updateById(orderActivityInfo); |
| | | return R.ok(); |
| | |
| | | package com.ruoyi.other.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | |
| | | /** |
| | |
| | | * @since 2024-11-20 |
| | | */ |
| | | public interface CouponInfoMapper extends BaseMapper<CouponInfo> { |
| | | |
| | | IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo); |
| | | } |
| | |
| | | package com.ruoyi.other.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | |
| | |
| | | */ |
| | | public interface CouponInfoService extends IService<CouponInfo> { |
| | | |
| | | IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo); |
| | | |
| | | } |
| | |
| | | package com.ruoyi.other.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.mapper.CouponInfoMapper; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | |
| | | @Service |
| | | public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponInfo> implements CouponInfoService { |
| | | |
| | | @Override |
| | | public IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo) { |
| | | return this.baseMapper.queryCouponInfoPage(page, couponInfo); |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.other.mapper.CouponInfoMapper"> |
| | | |
| | | <select id="queryCouponInfoPage" resultType="com.ruoyi.other.api.domain.CouponInfo"> |
| | | SELECT |
| | | tci.id, |
| | | tci.create_time, |
| | | tci.coupon_name, |
| | | tci.coupon_type, |
| | | tci.condition_amount, |
| | | tci.discount_amount, |
| | | tci.money_amount, |
| | | tci.discount, |
| | | tci.for_good_ids, |
| | | tci.send_num, |
| | | tci.max_num, |
| | | tci.period_type, |
| | | tci.period_start_time, |
| | | tci.period_end_time, |
| | | tci.period_days, |
| | | tci.send_start_time, |
| | | tci.send_end_time, |
| | | tci.send_type, |
| | | tci.need_point, |
| | | tci.person_type, |
| | | tci.person_ids |
| | | FROM |
| | | t_coupon_info tci |
| | | <where> |
| | | tci.del_flag = 0 |
| | | <if test="couponInfo.couponName != null and couponInfo.couponName != ''"> |
| | | AND tci.coupon_name LIKE concat('%', #{couponInfo.couponName}, '%') |
| | | </if> |
| | | <if test="couponInfo.couponType != null"> |
| | | AND tci.coupon_type = #{couponInfo.couponType} |
| | | </if> |
| | | <if test="couponInfo.send_type != null"> |
| | | AND tci.send_type = #{couponInfo.send_type} |
| | | </if> |
| | | <if test="couponInfo.personType != null"> |
| | | AND tci.person_type = #{couponInfo.personType} |
| | | </if> |
| | | <if test="couponInfo.shelfStatus != null"> |
| | | AND tci.shelf_status = #{couponInfo.shelfStatus} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |