| | |
| | | List<MgtActivityListVo> activityListVoList = activityService.listMgtActivity(mgtActivityListDto); |
| | | return R.ok(activityListVoList); |
| | | } |
| | | |
| | | @RequestMapping(value = "/endImmediately", method = RequestMethod.POST) |
| | | @Log(title = "活动管理", businessType = BusinessType.UPDATE,operContent = "立即结束") |
| | | @ApiOperation(value = "立即结束【2.0】") |
| | | public R endImmediately(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtBaseGetDto.setUserId(userId); |
| | | return activityService.endImmediately(mgtBaseGetDto); |
| | | |
| | | } |
| | | } |
| | |
| | | @RequestMapping(value = "/pageMgtLotteryEvent", method = RequestMethod.POST) |
| | | @ApiOperation(value = "分页获取抽奖列表【2.0】") |
| | | public R<Page<MgtLotteryEventPageVo>> pageMgtLotteryEvent(@RequestBody MgtLotteryEventPageDto dto) { |
| | | Page<MgtLotteryEventPageVo> page = new Page<>(); |
| | | page.setSize(dto.getPageSize()); |
| | | page.setCurrent(dto.getPageNum()); |
| | | page.setOptimizeCountSql(false); |
| | | List<MgtLotteryEventPageVo> mgtGoodsPageVoList = lotteryEventService.pageMgtLotteryEvent(page,dto); |
| | | return R.ok(page.setRecords(mgtGoodsPageVoList)); |
| | | |
| | | |
| | | return R.ok(lotteryEventService.pageMgtLotteryEvent(dto)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/getLotteryEventDetailById/{id}", method = RequestMethod.POST) |
| | |
| | | */ |
| | | List<ShopLotteryDrawListVo> getShopLotteryDrawList(Page<ShopLotteryDrawListVo> page, @Param("shopId") Long shopId); |
| | | |
| | | List<MgtLotteryEventPageVo> pageMgtLotteryEvent(Page<MgtLotteryEventPageVo> page, @Param("dto") MgtLotteryEventPageDto dto); |
| | | List<MgtLotteryEventPageVo> pageMgtLotteryEvent( @Param("dto") MgtLotteryEventPageDto dto); |
| | | |
| | | Long pageMgtLotteryEventCount(@Param("dto") MgtLotteryEventPageDto dto); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.goods.domain.dto.*; |
| | | import com.ruoyi.system.api.domain.poji.activity.Activity; |
| | | import com.ruoyi.goods.domain.vo.*; |
| | |
| | | * @return Boolean |
| | | */ |
| | | Boolean judgeActivityShop(MerActivityShopDto merActivityShopDto); |
| | | |
| | | R endImmediately(MgtBaseGetDto mgtBaseGetDto); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.function.Function; |
| | |
| | | } |
| | | return judge; |
| | | } |
| | | |
| | | /** |
| | | * 立即结束活动 |
| | | * @param mgtBaseGetDto |
| | | */ |
| | | @Override |
| | | public R endImmediately(MgtBaseGetDto mgtBaseGetDto) { |
| | | Activity activity = this.getById(mgtBaseGetDto.getId()); |
| | | if(null == activity){ |
| | | return R.fail("活动不存在"); |
| | | } |
| | | //判断是否在活动中 |
| | | Date now = new Date(); |
| | | if (now.before(activity.getActivityStartTime())||now.after(activity.getActivityEndTime())){ |
| | | return R.fail("未在活动时间范围内,不能执行立即结束操作"); |
| | | } |
| | | activity.setActivityEndTime(now); |
| | | activity.setUpdateTime(now); |
| | | activity.setUpdateUserId(mgtBaseGetDto.getUserId()); |
| | | this.updateById(activity); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MgtLotteryEventPageVo> pageMgtLotteryEvent(Page<MgtLotteryEventPageVo> page, MgtLotteryEventPageDto dto) { |
| | | public Page<MgtLotteryEventPageVo> pageMgtLotteryEvent( MgtLotteryEventPageDto dto) { |
| | | Map<Long,Shop> map; |
| | | List<Shop> shopList; |
| | | Page<MgtLotteryEventPageVo> page = new Page<>(); |
| | | page.setSize(dto.getPageSize()); |
| | | page.setCurrent(dto.getPageNum()); |
| | | page.setOptimizeCountSql(false); |
| | | |
| | | if (dto.getCreateObject()!=null){ |
| | | //根据 条件-创建对象 模糊查找门店集合 |
| | | shopList=remoteShopService.getShopListByShopName(dto.getCreateObject()); |
| | |
| | | } else { |
| | | map = new HashMap<>(); |
| | | } |
| | | |
| | | //获取分页数据 |
| | | Long total=this.baseMapper.pageMgtLotteryEventCount( dto); |
| | | page.setTotal(total); |
| | | page.setCurrent(dto.getPageNum()); |
| | | page.setPages(total/dto.getPageSize()); |
| | | //获取分页信息 |
| | | List<MgtLotteryEventPageVo> voList = this.baseMapper.pageMgtLotteryEvent(page, dto); |
| | | List<MgtLotteryEventPageVo> voList = this.baseMapper.pageMgtLotteryEvent(dto); |
| | | //填充创建对象 |
| | | voList.forEach(x->{ |
| | | if (x.getActivityType()!=6){ |
| | |
| | | } |
| | | |
| | | }); |
| | | return voList; |
| | | page.setRecords(voList); |
| | | return page; |
| | | } |
| | | |
| | | @Override |
| | |
| | | * @param dto |
| | | * @return |
| | | */ |
| | | List<MgtLotteryEventPageVo> pageMgtLotteryEvent(Page<MgtLotteryEventPageVo> page, MgtLotteryEventPageDto dto); |
| | | Page<MgtLotteryEventPageVo> pageMgtLotteryEvent( MgtLotteryEventPageDto dto); |
| | | |
| | | /** |
| | | * 查看抽奖活动详情 |
| | |
| | | # 服务注册地址 |
| | | # server-addr: 47.109.78.184:5000 |
| | | server-addr: 192.168.110.80:8848 |
| | | ip: 192.168.110.85 |
| | | ip: 192.168.110.21 |
| | | #pro |
| | | # namespace: 9591ef9f-a49a-4900-be35-d77258bdd639 |
| | | #test |
| | |
| | | </when> |
| | | </choose> |
| | | <if test="null != dto.name and ''!= dto.name "> |
| | | `name` like concat('%',#{dto.name},'%') |
| | | and `name` like concat('%',#{dto.name},'%') |
| | | </if> |
| | | <if test="null != dto.activityType and dto.activityType!=0 "> |
| | | activity_type = #{dto.activityType} |
| | | and activity_type = #{dto.activityType} |
| | | </if> |
| | | <if test="dto.shopIds != null and dto.shopIds.size() > 0"> |
| | | <choose> |
| | | <when test="dto.flag != null and dto.flag == 1"> |
| | | AND (shop_id IN |
| | | <foreach collection="dto.shopIds" item="shopId" open="(" separator="," close=")"> |
| | | #{shopId} |
| | | </foreach> |
| | | OR shop_id IS NULL) |
| | | </when> |
| | | <otherwise> |
| | | AND shop_id IN |
| | | <foreach collection="dto.shopIds" item="shopId" open="(" separator="," close=")"> |
| | | #{shopId} |
| | | </foreach> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | limit #{dto.pageNum},#{dto.pageSize} |
| | | </select> |
| | | <select id="pageMgtLotteryEventCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | count(*) |
| | | FROM |
| | | t_lottery_event |
| | | where |
| | | del_flag =0 |
| | | <choose> |
| | | <when test="dto.status != null and dto.status == 0"> |
| | | -- 0-全部状态,不添加额外条件 |
| | | </when> |
| | | <when test="dto.status != null and dto.status == 1"> |
| | | AND start_time > NOW() -- 1-未开始 |
| | | </when> |
| | | <when test="dto.status != null and dto.status == 2"> |
| | | AND start_time <= NOW() AND end_time >= NOW() -- 2-进行中 |
| | | </when> |
| | | <when test="dto.status != null and dto.status == 3"> |
| | | AND end_time < NOW() -- 3-已结束 |
| | | </when> |
| | | </choose> |
| | | <if test="null != dto.name and ''!= dto.name "> |
| | | and `name` like concat('%',#{dto.name},'%') |
| | | </if> |
| | | <if test="null != dto.activityType and dto.activityType!=0 "> |
| | | and activity_type = #{dto.activityType} |
| | | </if> |
| | | <if test="dto.shopIds != null and dto.shopIds.size() > 0"> |
| | | <choose> |
| | |
| | | |
| | | |
| | | @RequestMapping(value = "/pageMgtCoupon", method = RequestMethod.POST) |
| | | @ApiOperation(value = "平台分页获取优惠券列表") |
| | | @ApiOperation(value = "平台分页获取优惠券列表【2.0】") |
| | | public R<Page<MgtCouponPageVo>> pageMgtCoupon(@RequestBody MgtCouponPageDto mgtCouponPageDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtCouponPageDto.setUserId(userId); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/getMgtCouponVo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "平台获取优惠券编辑信息") |
| | | @ApiOperation(value = "平台获取优惠券编辑信息【2.0】") |
| | | public R<MgtCouponGetVo> getMgtCouponVo(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtBaseGetDto.setUserId(userId); |
| | |
| | | |
| | | @RequestMapping(value = "/editMgtCoupon", method = RequestMethod.POST) |
| | | @Log(title = "优惠券管理", businessType = BusinessType.UPDATE,operContent = "编辑优惠券") |
| | | @ApiOperation(value = "平台编辑优惠券") |
| | | @ApiOperation(value = "平台编辑优惠券【2.0】") |
| | | public R editMgtCoupon(@Validated @RequestBody MgtCouponEditDto mgtCouponEditDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtCouponEditDto.setUserId(userId); |
| | |
| | | couponService.auditMgtCoupon(mgtCouponAuditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | //todo 立即结束 |
| | | @RequestMapping(value = "/endImmediately", method = RequestMethod.POST) |
| | | @Log(title = "优惠券管理", businessType = BusinessType.UPDATE,operContent = "立即结束") |
| | | @ApiOperation(value = "立即结束【2.0】") |
| | | public R endImmediately(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtBaseGetDto.setUserId(userId); |
| | | couponService.endImmediately(mgtBaseGetDto); |
| | | return R.ok(); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.member.domain.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseDto; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty(value = "优惠券id 新增不传") |
| | | private String couponId; |
| | | |
| | | @ApiModelProperty(value="优惠券类型1.满减2.折扣3.代金4.商品") |
| | | @ApiModelProperty(value="优惠券类型1.满减2.折扣3.代金4.商品5.抽奖领取") |
| | | @NotNull(message = "优惠券类型不能为空") |
| | | private Integer couponType; |
| | | |
| | |
| | | |
| | | @ApiModelProperty(value = "领取限制数量 0为不限") |
| | | private Integer limitNumber; |
| | | |
| | | @ApiModelProperty("分享文案") |
| | | private String sharePassage; |
| | | |
| | | @ApiModelProperty("分享图片") |
| | | private String sharePic; |
| | | |
| | | } |
| | |
| | | */ |
| | | @TableField("send_limit_flag") |
| | | private Integer sendLimitFlag; |
| | | /** |
| | | * 分享文案 |
| | | */ |
| | | @TableField("share_passage") |
| | | private String sharePassage; |
| | | /** |
| | | * 分享图片 |
| | | */ |
| | | @TableField("share_pic") |
| | | private String sharePic; |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | @ApiModelProperty(value="审核状态1申请中2审核通过3审核拒绝") |
| | | private String auditStatus; |
| | | @ApiModelProperty(value = "优惠券类型(1.满减2.折扣3.代金4.商品)") |
| | | @ApiModelProperty(value = "优惠券类型(1.满减2.折扣3.代金4.商品5.抽奖领取)") |
| | | private String couponType; |
| | | @ApiModelProperty(value = "使用限制") |
| | | private String useLimit; |
| | |
| | | @ApiModelProperty(value = "优惠券id 新增不传") |
| | | private String couponId; |
| | | |
| | | @ApiModelProperty(value="优惠券类型1.满减2.折扣3.代金4.商品") |
| | | @ApiModelProperty(value="优惠券类型1.满减2.折扣3.代金4.商品5.抽奖领取") |
| | | private Integer couponType; |
| | | |
| | | @ApiModelProperty(value="优惠券名称") |
| | |
| | | |
| | | @ApiModelProperty(value = "领取限制数量 0为不限") |
| | | private Integer limitNumber; |
| | | |
| | | @ApiModelProperty("分享文案") |
| | | private String sharePassage; |
| | | |
| | | @ApiModelProperty("分享图片") |
| | | private String sharePic; |
| | | } |
| | |
| | | @ApiModelProperty(value="优惠券名称") |
| | | private String couponName; |
| | | |
| | | @ApiModelProperty(value="优惠券类型1.满减2.折扣3.代金4.商品") |
| | | @ApiModelProperty(value="优惠券类型1.满减2.折扣3.代金4.商品5.抽奖领取") |
| | | private String couponType; |
| | | |
| | | @ApiModelProperty(value = "使用限制") |
| | |
| | | * @return MetAuditCouponTotalVo |
| | | */ |
| | | MetAuditCouponTotalVo getMetAuditCouponTotal(Long shopId); |
| | | |
| | | void endImmediately(MgtBaseGetDto mgtBaseGetDto); |
| | | } |
| | |
| | | * @return void |
| | | */ |
| | | @Override |
| | | public void editMgtCoupon(MgtCouponEditDto mgtCouponEditDto){ |
| | | public void editMgtCoupon(MgtCouponEditDto mgtCouponEditDto){ |
| | | //编辑优惠券 |
| | | Coupon coupon; |
| | | CouponTotal couponTotal; |
| | |
| | | metAuditCouponTotalVo.setRefuseTotal(refuseTotal); |
| | | return metAuditCouponTotalVo; |
| | | } |
| | | |
| | | @Override |
| | | public void endImmediately(MgtBaseGetDto mgtBaseGetDto) { |
| | | |
| | | } |
| | | } |
| | |
| | | ExcelUtil<MgtShopAllOrderPageVo> util = new ExcelUtil<MgtShopAllOrderPageVo>(MgtShopAllOrderPageVo.class); |
| | | util.exportExcel(response, shopAllOrderPageVoList, "商户订单记录"); |
| | | } |
| | | |
| | | //todo 取消 |
| | | |
| | | //todo 退款 |
| | | //todo 分页获取三方订单 |
| | | //todo 导出 |
| | | } |
| | |
| | | package com.ruoyi.shop.controller.console; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | |
| | | R updateShopByOneClinkSyncing(@RequestBody OneClinkSyncing oneClinkSyncing){ |
| | | return shopService.updateShopByOneClinkSyncing(oneClinkSyncing); |
| | | } |
| | | |
| | | /** |
| | | * 根据shopName模糊查询门店集合 |
| | | */ |
| | | @PostMapping("/getShopListByShopName") |
| | | List<Shop> getShopListByShopName(@RequestBody String content){ |
| | | return shopService.getBaseMapper().selectList(new LambdaQueryWrapper<Shop>().like(Shop::getShopName, content)); |
| | | } |
| | | } |
| | |
| | | |
| | | @RequestMapping(value = "/createMgtShop", method = RequestMethod.POST) |
| | | @Log(title = "商户管理", businessType = BusinessType.UPDATE,operContent = "编辑商户") |
| | | @ApiOperation(value = "平台编辑商户") |
| | | @ApiOperation(value = "平台编辑商户【2.0】") |
| | | public R createMgtShop(@Validated @RequestBody MgtEditShopDto mgtEditShopDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtEditShopDto.setUserId(userId); |
| | |
| | | @ApiModelProperty(value="生日卡1开2关") |
| | | private Integer platformBirthdayFlag; |
| | | |
| | | @ApiModelProperty(value="抽奖1开2关") |
| | | private Integer lotteryDrawFlag; |
| | | |
| | | |
| | | @ApiModelProperty(value="推荐人") |
| | | private String recommendPerson; |
| | | |
| | |
| | | @ApiModelProperty(value="关联用户id 多个用,隔开") |
| | | private String relUserIds; |
| | | |
| | | @ApiModelProperty(value="默认登录账号-开启的用户id集合") |
| | | private String relUserOpenIds; |
| | | |
| | | |
| | | @ApiModelProperty(value="商户封面") |
| | | private String shopPicture; |
| | |
| | | @ApiModelProperty(value="生日卡1开2关") |
| | | private Integer platformBirthdayFlag; |
| | | |
| | | @ApiModelProperty(value="抽奖1开2关") |
| | | private Integer lotteryDrawFlag; |
| | | |
| | | @ApiModelProperty(value="推荐人") |
| | | private String recommendPerson; |
| | | |