群聊优惠券
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.dto.BkOrderDTO;
|
||||
import com.czg.account.dto.calltable.CallTablePage;
|
||||
import com.czg.account.entity.BkContactList;
|
||||
import com.czg.account.entity.BkOrder;
|
||||
import com.czg.account.entity.BkOrderTable;
|
||||
@@ -41,7 +40,7 @@ public class BkContactListController {
|
||||
/**
|
||||
* 通讯录 获取联系人订单数等
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "bk:bkContactList:list", name = "预约端-联系人列表")
|
||||
@SaAdminCheckPermission(value = "bk:bkContactList:list", name = "预约端-联系人列表")
|
||||
@PostMapping("/contactList")
|
||||
public CzgResult<List<BkContactList>> getUserList(@RequestBody Set<String> phones) {
|
||||
return CzgResult.success(contactListService.getUserList(StpKit.USER.getShopId(), phones));
|
||||
@@ -50,7 +49,7 @@ public class BkContactListController {
|
||||
/**
|
||||
* 预约端-台桌:查询台桌列表
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "bk:bkOrder:table", name = "预约端-台桌:查询台桌列表")
|
||||
@SaAdminCheckPermission(value = "bk:bkOrder:table", name = "预约端-台桌:查询台桌列表")
|
||||
@GetMapping("/bkOrder/table")
|
||||
public CzgResult<List<BkTableVO>> table(@RequestParam(value = "areaId", required = false) Long areaId,
|
||||
@RequestParam LocalDate day,
|
||||
@@ -62,7 +61,7 @@ public class BkContactListController {
|
||||
/**
|
||||
* 预约端-预定单:预约单统计
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "bk:bkOrder:bookings:statistics", name = "预约端-预约单:预约单统计")
|
||||
@SaAdminCheckPermission(value = "bk:bookings:statistics", name = "预约端-预约单:预约单统计")
|
||||
@GetMapping("/bkOrder/booking/statistics")
|
||||
public CzgResult<BookingOrderStatisticsVO> bookingOrderStatistics(@RequestParam(required = false) String search,
|
||||
@RequestParam(required = false) LocalDate start,
|
||||
@@ -75,7 +74,7 @@ public class BkContactListController {
|
||||
/**
|
||||
* 预约端-预定单:查询预约单列表
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "bk:bkOrder:bookings", name = "预约端-预约单:列表")
|
||||
@SaAdminCheckPermission(value = "bk:bkOrder:bookings", name = "预约端-预约单:列表")
|
||||
@GetMapping("/bkOrder/bookings")
|
||||
public CzgResult<List<BkOrder>> bookings(@RequestParam(required = false) String search,
|
||||
@RequestParam(required = false) LocalDate start,
|
||||
@@ -88,7 +87,7 @@ public class BkContactListController {
|
||||
/**
|
||||
* 预约端-预定单:查询预约单选中台桌
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "bk:bkOrder:bookings/tables", name = "预约端-预约单:查询预约单选中的台桌")
|
||||
@SaAdminCheckPermission(value = "bk:bkOrder:tables", name = "预约端-预约单:查询预约单选中的台桌")
|
||||
@GetMapping("/bkOrder/bookings/tables")
|
||||
public CzgResult<List<BkOrderTable>> bookingTables(Long id) {
|
||||
List<BkOrderTable> tables = bkOrderService.bookingTables(StpKit.USER.getShopId(), id);
|
||||
@@ -99,7 +98,7 @@ public class BkContactListController {
|
||||
/**
|
||||
* 预约端-预约单:预约/修改预约
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "bk:bkOrder:booking", name = "预约端-预约单:预约")
|
||||
@SaAdminCheckPermission(value = "bk:bkOrder:booking", name = "预约端-预约单:预约/修改")
|
||||
@PostMapping("/bkOrder/booking")
|
||||
public CzgResult<Void> booking(@RequestBody BkOrderDTO bkOrder) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
@@ -113,7 +112,7 @@ public class BkContactListController {
|
||||
/**
|
||||
* 预约端-预约单:取消预约
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "bk:bkOrder:booking", name = "预约端-预约单:取消预约")
|
||||
@SaAdminCheckPermission(value = "bk:bkOrder:cancel", name = "预约端-预约单:取消预约")
|
||||
@PostMapping("/bkOrder/cancel")
|
||||
public CzgResult<Void> cancel(@RequestBody BkOrderDTO bkOrder) {
|
||||
AssertUtil.isNull(bkOrder.getId(), "需要撤销的预约单id不能为空");
|
||||
@@ -125,7 +124,7 @@ public class BkContactListController {
|
||||
/**
|
||||
* 预约端-预约单:已到店
|
||||
*/
|
||||
// @SaAdminCheckPermission(value = "bk:bkOrder:storeArrival", name = "预约端-预约单:已到店")
|
||||
@SaAdminCheckPermission(value = "bk:bkOrder:storeArrival", name = "预约端-预约单:已到店")
|
||||
@PostMapping("/bkOrder/storeArrival")
|
||||
public CzgResult<Void> storeArrival(@RequestBody BkOrderDTO bkOrder) {
|
||||
AssertUtil.isNull(bkOrder.getId(), "已到店的预约单id不能为空");
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.market.dto.ChatCouponDTO;
|
||||
import com.czg.market.dto.ChatCouponGrantDTO;
|
||||
import com.czg.market.entity.MkShopCouponRecord;
|
||||
import com.czg.market.service.ChatCouponService;
|
||||
import com.czg.market.vo.ChatCouponVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 群聊优惠券活动
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/admin/chat/coupon")
|
||||
public class AChatCouponController {
|
||||
@Resource
|
||||
private ChatCouponService chatCouponService;
|
||||
|
||||
/**
|
||||
* 群聊优惠券活动-创建
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
@SaAdminCheckPermission(value = "chat:coupon:create", name = "群聊优惠券活动-创建")
|
||||
public CzgResult<Void> createChatCoupon(@RequestBody @Validated ChatCouponDTO chatCoupon) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
chatCouponService.createChatCoupon(shopId, chatCoupon);
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 群聊优惠券活动-分页查询
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@SaAdminCheckPermission(value = "chat:coupon:page", name = "群聊优惠券活动-分页查询")
|
||||
public Page<ChatCouponVO> pageChatCoupon(@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size,
|
||||
@RequestParam(required = false) Integer status) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
return chatCouponService.pageChatCoupon(shopId, page, size, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 群聊优惠券活动-失效
|
||||
*/
|
||||
@DeleteMapping("/expired/{id}")
|
||||
@SaAdminCheckPermission(value = "chat:coupon:expired", name = "群聊优惠券活动-失效")
|
||||
public CzgResult<Void> expiredChatCoupon(@PathVariable Long id) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
chatCouponService.expiredChatCoupon(shopId, id);
|
||||
return CzgResult.success();
|
||||
}
|
||||
/**
|
||||
* 群聊优惠券活动-发放优惠券
|
||||
*/
|
||||
@PostMapping("/grant")
|
||||
@SaAdminCheckPermission(value = "chat:coupon:grant", name = "群聊优惠券活动-发放优惠券")
|
||||
public CzgResult<Void> grantChatCoupon(@RequestBody ChatCouponGrantDTO chatCouponGrant) {
|
||||
chatCouponService.grantChatCoupon(chatCouponGrant.getId(), chatCouponGrant.getShopUserId(), chatCouponGrant.getUserId());
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 群聊优惠券活动-发放记录
|
||||
*/
|
||||
@GetMapping("/record")
|
||||
@SaAdminCheckPermission(value = "chat:coupon:record", name = "群聊优惠券活动-发放记录")
|
||||
public Page<MkShopCouponRecord> grantChatCouponRecord(@RequestParam Long id,
|
||||
@RequestParam(required = false) Integer status,
|
||||
@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size) {
|
||||
return chatCouponService.grantChatCouponRecord(id, status, page, size);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -215,4 +215,17 @@ public class ACouponController {
|
||||
public CzgResult<List<UserCouponVo>> findCoupon(@RequestParam Long shopUserId, @RequestParam(required = false) Integer type, @RequestParam(required = false) Integer isFood) {
|
||||
return CzgResult.success(shopCouponService.findCoupon(StpKit.USER.getShopId(), shopUserId, type, isFood));
|
||||
}
|
||||
|
||||
/**
|
||||
* 群聊可发放优惠券列表
|
||||
*
|
||||
* @param search 优惠券名称模糊搜索
|
||||
*/
|
||||
@GetMapping("/chatCoupon")
|
||||
public CzgResult<Page<ShopCouponDTO>> chatCoupon(@RequestParam(required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(required = false, defaultValue = "10") Integer size,
|
||||
@RequestParam(required = false) String search) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
return CzgResult.success(shopCouponService.chatCoupon(shopId, search));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.service.order.mapper.KitchenDetailMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -35,7 +33,7 @@ public class TableController {
|
||||
* 按台桌查看
|
||||
*/
|
||||
@GetMapping("getKitchenTable")
|
||||
// @SaAdminCheckPermission(value = "kitchen:table", name = "后厨-按台桌查看")
|
||||
@SaAdminCheckPermission(value = "kitchen:table", name = "后厨-按台桌查看")
|
||||
public CzgResult<List<KitchenTableVO>> getKitchenTable(@RequestParam(required = false) String tableName, @RequestParam(required = false) Long areaId) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
List<KitchenTableVO> kitchenTables = kitchenDetailMapper.getKitchenTable(shopId, tableName, areaId);
|
||||
@@ -46,7 +44,7 @@ public class TableController {
|
||||
* 按台桌查看 商品内容
|
||||
*/
|
||||
@GetMapping("getKitchenTableFoods")
|
||||
// @SaAdminCheckPermission(value = "kitchen:tableFood", name = "后厨-按台桌查看商品内容")
|
||||
@SaAdminCheckPermission(value = "kitchen:tableFood", name = "后厨-按台桌查看商品内容")
|
||||
public CzgResult<List<KitchenTableFoodVO>> getKitchenTableFoods(@RequestParam(required = false) Long orderId,
|
||||
@RequestParam(required = false) String tableCode,
|
||||
@RequestParam(required = false) Long isNoTable) {
|
||||
@@ -63,7 +61,7 @@ public class TableController {
|
||||
* 按商品查看
|
||||
*/
|
||||
@GetMapping("getKitchenFood")
|
||||
// @SaAdminCheckPermission(value = "kitchen:table", name = "后厨-按台桌查看")
|
||||
@SaAdminCheckPermission(value = "kitchen:table", name = "后厨-按台桌查看")
|
||||
public CzgResult<List<KitchenFoodVO>> getKitchenFood(@RequestParam(required = false) String productName, @RequestParam(required = false) Long categoryId) {
|
||||
Long shopId = StpKit.USER.getShopId();
|
||||
List<KitchenFoodVO> kitchenFood = kitchenDetailMapper.getKitchenFood(shopId, productName, categoryId);
|
||||
|
||||
Reference in New Issue
Block a user