|
|
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import io.swagger.annotations.*;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.context.ApplicationContext;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import shop.alien.entity.result.R;
|
|
|
@@ -57,7 +58,7 @@ public class LifeCouponController {
|
|
|
@ApiOperation("代金劵列表")
|
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "页数", dataType = "Integer", paramType = "query", required = true), @ApiImplicitParam(name = "size", value = "页容", dataType = "Integer", paramType = "query", required = true), @ApiImplicitParam(name = "storeId", value = "门店id", dataType = "Integer", paramType = "query", required = true), @ApiImplicitParam(name = "status", value = "状态", dataType = "Integer", paramType = "query", required = false), @ApiImplicitParam(name = "name", value = "名称", dataType = "Integer", paramType = "query"), @ApiImplicitParam(name = "dataType", value = "数据类型: 0:正式数据, 1:草稿数据", dataType = "Integer", paramType = "query", defaultValue = "0")})
|
|
|
@GetMapping("/getCouponList")
|
|
|
- private R<IPage<LifeCoupon>> getCouponList(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "size", defaultValue = "10") int size, @RequestParam("storeId") String storeId, @RequestParam("status") String status, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "dataType", defaultValue = "0") Integer dataType) {
|
|
|
+ public R<IPage<LifeCoupon>> getCouponList(@RequestParam(value = "page", defaultValue = "1") int page, @RequestParam(value = "size", defaultValue = "10") int size, @RequestParam("storeId") String storeId, @RequestParam("status") String status, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "dataType", defaultValue = "0") Integer dataType) {
|
|
|
log.info("LifeCouponController.getCouponList?page={},size={},storeId={},status={},name={},dataType={}", page, size, storeId, status, name, dataType);
|
|
|
return R.data(lifeCouponService.getCouponList(page, size, storeId, status, name, dataType));
|
|
|
}
|
|
|
@@ -83,7 +84,7 @@ public class LifeCouponController {
|
|
|
|
|
|
@ApiOperation("代金劵详情")
|
|
|
@GetMapping("/getNewCouponDetail")
|
|
|
- private R<LifeCouponVo> getNewCouponDetail(@RequestParam("id") String id) {
|
|
|
+ public R<LifeCouponVo> getNewCouponDetail(@RequestParam("id") String id) {
|
|
|
log.info("LifeCouponController.getNewCouponDetail?id={}", id);
|
|
|
try {
|
|
|
LifeCouponVo lifeCouponVo = lifeCouponService.getNewCouponDetail(id);
|
|
|
@@ -97,12 +98,12 @@ public class LifeCouponController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @TrackEvent(
|
|
|
- eventType = "COUPON_USE",
|
|
|
- eventCategory = "COUPON",
|
|
|
- storeId = "#{#storeId}",
|
|
|
- targetType = "COUPON"
|
|
|
- )
|
|
|
+// @TrackEvent(
|
|
|
+// eventType = "COUPON_USE",
|
|
|
+// eventCategory = "COUPON",
|
|
|
+// storeId = "#{#storeId}",
|
|
|
+// targetType = "COUPON"
|
|
|
+// )
|
|
|
@ApiOperation("旧 核销订单")
|
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "storeId", value = "门店id", dataType = "Integer", paramType = "query", required = true), @ApiImplicitParam(name = "quanCode", value = "券码", dataType = "Integer", paramType = "query", required = true)})
|
|
|
@GetMapping("/verify")
|
|
|
@@ -197,4 +198,22 @@ public class LifeCouponController {
|
|
|
log.info("LifeCouponController.importHoliday fileName={}", file.getOriginalFilename());
|
|
|
return lifeCouponService.importHolidayFromExcel(file);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 删除代金券
|
|
|
+ * 根据优惠券ID删除代金券信息
|
|
|
+ *
|
|
|
+ * @param id 优惠券ID
|
|
|
+ * @return R<Boolean> 操作结果
|
|
|
+ * @author alien-cloud
|
|
|
+ * @date 2025-11-18
|
|
|
+ */
|
|
|
+ @ApiOperation("删除代金券")
|
|
|
+ @GetMapping("/deleteCoupon")
|
|
|
+ public R<Boolean> deleteCoupon(@RequestParam("id") Integer id) {
|
|
|
+ log.info("LifeCouponController.updateCouponSingleQty?id={}", id);
|
|
|
+ if (lifeCouponService.deleteCoupon(id)) {
|
|
|
+ return R.success("成功");
|
|
|
+ }
|
|
|
+ return R.fail("失败");
|
|
|
+ }
|
|
|
}
|