|
|
@@ -1,5 +1,6 @@
|
|
|
package com.cyksj.web.controller.manage.goods;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
@@ -104,4 +105,15 @@ public class GiftCardController {
|
|
|
giftCardGoodsSkuService.setGiftCardGoodsStat(goodsDonMapper.selectById(byId.getGoodsId()));
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 礼品卡类型设置数量
|
|
|
+ */
|
|
|
+ @GetMapping("/get/num")
|
|
|
+ public Result<Integer> getGiftCardNum(@RequestParam(defaultValue = "1") Integer gcType) {
|
|
|
+ int count = giftCardGoodsSkuService.count(Wrappers.lambdaQuery(GiftCardGoodsSku.class)
|
|
|
+ .eq(GiftCardGoodsSku::getGcType, gcType)
|
|
|
+ .eq(GiftCardGoodsSku::getDeleted, true));
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(count);
|
|
|
+ }
|
|
|
}
|