|
|
@@ -11,9 +11,16 @@ import shop.alien.entity.result.R;
|
|
|
import shop.alien.entity.store.EssentialHolidayComparison;
|
|
|
import shop.alien.entity.store.LifeCoupon;
|
|
|
import shop.alien.entity.store.StoreGroupInfo;
|
|
|
+import shop.alien.entity.store.UserLoginInfo;
|
|
|
import shop.alien.entity.store.vo.LifeCouponStatusVo;
|
|
|
+import shop.alien.entity.store.vo.LifeDiscountCouponVo;
|
|
|
import shop.alien.entity.storePlatform.vo.LifeCouponPlatformDto;
|
|
|
+import shop.alien.entity.storePlatform.vo.LifeCouponPlatformVo;
|
|
|
+import shop.alien.entity.storePlatform.vo.LifeDiscountCouponPlatformVo;
|
|
|
import shop.alien.storeplatform.service.LifeCouponPlatformService;
|
|
|
+import shop.alien.storeplatform.service.LifeDiscountCouponPlatformService;
|
|
|
+import shop.alien.util.common.TokenInfo;
|
|
|
+import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -35,6 +42,8 @@ public class LifeCouponPlatformController {
|
|
|
|
|
|
private final LifeCouponPlatformService lifeCouponService;
|
|
|
|
|
|
+ private final LifeDiscountCouponPlatformService lifeDiscountCouponPlatformService;
|
|
|
+
|
|
|
/**
|
|
|
* 新建或更新代金券
|
|
|
* 根据代金券是否存在ID判断是新增还是更新操作
|
|
|
@@ -91,38 +100,6 @@ public class LifeCouponPlatformController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 分页查询代金券列表
|
|
|
- * 支持按门店、状态、名称、数据类型、审核状态等条件筛选
|
|
|
- *
|
|
|
- * @param pageNum 页码
|
|
|
- * @param pageSize 每页数量
|
|
|
- * @param storeId 门店ID
|
|
|
- * @param status 状态
|
|
|
- * @param name 优惠券名称
|
|
|
- * @param reviewType 审核状态
|
|
|
- * @param dataType 数据类型(0:正式数据, 1:草稿数据)
|
|
|
- * @return R<IPage<LifeCouponPlatformDto>> 分页代金券列表
|
|
|
- * @author alien-cloud
|
|
|
- * @date 2025-11-18
|
|
|
- */
|
|
|
- @ApiOperation("代金劵列表")
|
|
|
- @ApiImplicitParams({@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "Integer", paramType = "query", required = true), @ApiImplicitParam(name = "pageSize", 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<LifeCouponPlatformDto>> getCouponList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
|
|
|
- @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
|
|
|
- @RequestParam("storeId") String storeId,
|
|
|
- @RequestParam("status") String status,
|
|
|
- @RequestParam(value = "name", required = false) String name,
|
|
|
- @RequestParam(value = "reviewType", required = false) String reviewType,
|
|
|
- @RequestParam(value = "dataType", defaultValue = "0") Integer dataType) {
|
|
|
- log.info("LifeCouponController.getCouponList?page={},size={},storeId={},status={},name={},dataType={}", pageNum, pageSize, storeId, status, name, dataType);
|
|
|
- if (StringUtils.isBlank(storeId)) {
|
|
|
- return R.data(null, "当前用户未入住!!!");
|
|
|
- }
|
|
|
- return R.data(lifeCouponService.getCouponList(pageNum, pageSize, storeId, status, name, dataType, reviewType));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
* 暂停或恢复优惠券
|
|
|
* 修改优惠券的状态,实现上架、下架等操作
|
|
|
*
|
|
|
@@ -257,5 +234,26 @@ public class LifeCouponPlatformController {
|
|
|
}
|
|
|
return R.fail("失败");
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation("代金劵/优惠券列表")
|
|
|
+ @PostMapping("/getCouponList")
|
|
|
+ private R<LifeDiscountCouponPlatformVo> getCouponList(@ApiIgnore @TokenInfo UserLoginInfo userLoginInfo,
|
|
|
+ @RequestBody LifeCouponPlatformVo lifeCouponPlatformVo) {
|
|
|
+ log.info("LifeCouponController.getCouponList?lifeCouponPlatformVo={}", lifeCouponPlatformVo);
|
|
|
+ if (StringUtils.isBlank(lifeCouponPlatformVo.getStoreId())) {
|
|
|
+ return R.data(null, "当前用户未入住!!!");
|
|
|
+ }
|
|
|
+ LifeDiscountCouponPlatformVo vo = new LifeDiscountCouponPlatformVo();
|
|
|
+ if (lifeCouponPlatformVo.getCouponType() == 1) {
|
|
|
+ vo.setCouponList(lifeCouponService.getCouponList(lifeCouponPlatformVo.getPageNum(), lifeCouponPlatformVo.getPageSize(), lifeCouponPlatformVo.getStoreId(),
|
|
|
+ lifeCouponPlatformVo.getStatus(), lifeCouponPlatformVo.getName()));
|
|
|
+ } else {
|
|
|
+ vo.setDiscountList(lifeDiscountCouponPlatformService.getStoreAllCouponList(lifeCouponPlatformVo.getStoreId(), userLoginInfo,
|
|
|
+ lifeCouponPlatformVo.getPageNum(), lifeCouponPlatformVo.getPageSize(), lifeCouponPlatformVo.getName(), lifeCouponPlatformVo.getCouponsFromType(), lifeCouponPlatformVo.getCouponStatus()));
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.data(vo);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|