From 4df088ddf824625232e38c9924f7dcd45d3a4fc6 Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期三, 25 十二月 2024 13:36:08 +0800
Subject: [PATCH] 验光师

---
 manage/src/main/java/com/jilongda/manage/controller/TCouponController.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/manage/src/main/java/com/jilongda/manage/controller/TCouponController.java b/manage/src/main/java/com/jilongda/manage/controller/TCouponController.java
index 920f049..ae1bbe9 100644
--- a/manage/src/main/java/com/jilongda/manage/controller/TCouponController.java
+++ b/manage/src/main/java/com/jilongda/manage/controller/TCouponController.java
@@ -72,6 +72,7 @@
     @ApiOperation(value = "添加优惠券")
     @PostMapping(value = "/add")
     public ApiResult<String> add( @RequestBody TCoupon dto) throws Exception {
+        if (dto.getType()==1||dto.getType()==4)dto.setGrantStatus(1);
         couponService.save(dto);
         switch (dto.getType()){
             case 2:
@@ -124,6 +125,14 @@
         }
         return ApiResult.success();
     }
+    @ApiOperation(value = "暂停发放 只有type为1和4的时候")
+    @PostMapping(value = "/stop")
+    public ApiResult stop(Integer id) throws Exception {
+        TCoupon byId = couponService.getById(id);
+        byId.setGrantStatus(2);
+        couponService.updateById(byId);
+        return ApiResult.success();
+    }
     @ApiOperation(value = "修改优惠券")
     @PostMapping(value = "/update")
     public ApiResult<String> update( @RequestBody TCoupon dto) throws Exception {

--
Gitblit v1.7.1