超级会员相关
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.market.dto.MkConsumeDiscountDTO;
|
||||
import com.czg.market.service.MkConsumeDiscountService;
|
||||
import com.czg.market.vo.MkConsumeDiscountVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* 新客立减
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/consumeDiscount")
|
||||
public class ConsumeDiscountController {
|
||||
@Resource
|
||||
private MkConsumeDiscountService consumeDiscountService;
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:detail", name = "会员配置列表")
|
||||
@GetMapping
|
||||
public CzgResult<MkConsumeDiscountVO> detail() {
|
||||
return CzgResult.success(consumeDiscountService.detail(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MkConsumeDiscountDTO consumeDiscountDTO) {
|
||||
return CzgResult.success(consumeDiscountService.edit(StpKit.USER.getShopId(), consumeDiscountDTO));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.market.dto.MkShopRechargeDTO;
|
||||
import com.czg.market.service.MkShopRechargeService;
|
||||
import com.czg.market.vo.MkShopRechargeVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 智慧充值
|
||||
* @author Administrator
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopRecharge")
|
||||
public class ShopRechargeController {
|
||||
@Resource
|
||||
private MkShopRechargeService shopRechargeService;
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
* 权限标识: activate:list
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:detail", name = "会员配置列表")
|
||||
@GetMapping
|
||||
public CzgResult<MkShopRechargeVO> detail() {
|
||||
if (!StpKit.USER.isManager()) {
|
||||
return CzgResult.failure("无权限操作");
|
||||
}
|
||||
return CzgResult.success(shopRechargeService.detail(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息修改
|
||||
* @return 是否成功
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "member:edit", name = "会员配置列表")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> edit(@Validated @RequestBody MkShopRechargeDTO shopRechargeDTO) {
|
||||
if (!StpKit.USER.isManager()) {
|
||||
return CzgResult.failure("无权限操作");
|
||||
}
|
||||
return CzgResult.success(shopRechargeService.edit(StpKit.USER.getShopId(), shopRechargeDTO));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.czg.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czg.account.entity.ShopUser;
|
||||
import com.czg.account.service.ShopUserService;
|
||||
import com.czg.constant.TableValueConstant;
|
||||
import com.czg.market.service.TbMemberConfigService;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 订单定时任务
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MemberDeliverTask {
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
@DubboReference
|
||||
private ShopUserService shopUserService;
|
||||
|
||||
@Resource
|
||||
private TbMemberConfigService memberConfigService;
|
||||
|
||||
/**
|
||||
* order 过期
|
||||
*/
|
||||
// @Scheduled(cron = "0 0 1 * * ? ")
|
||||
public void run() {
|
||||
shopUserService.list(new QueryWrapper().eq(ShopUser::getIsVip, 1).lt(ShopUser::getNextDeliverTime, DateUtil.date().toLocalDateTime())).forEach(item -> {
|
||||
memberConfigService.deliver(item.getShopId(), item.getUserId(), TableValueConstant.MemberExpFlow.Type.MEMBER_TASK, null, null, null);
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user