Forráskód Böngészése

fix 礼品卡类型数量

zoujiajian 2 éve
szülő
commit
9eca1d63e5

+ 12 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/goods/GiftCardController.java

@@ -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);
+	}
 }