记得上下班打卡 | git大法好,push需谨慎

Commit 4dd62c01 authored by 胡佳晨's avatar 胡佳晨

商铺券

parent c77893a9
...@@ -340,4 +340,49 @@ public class CandyCouponController { ...@@ -340,4 +340,49 @@ public class CandyCouponController {
// return ResponseDto.failure(); // return ResponseDto.failure();
// } // }
} }
//要使用券列表 - 商品
@PostMapping("preUse/goods/store")
@ApiOperation("要使用券列表 - 商品[商铺]")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "BigDecimal", name = "priceTotal", value = "待支付总金额", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "skuIds", value = "商品id(逗号隔开的字符串)", required = true),
@ApiImplicitParam(type = "form", dataType = "Integer", name = "type", value = "类型 1可用 2过期/已使用 ", required = true),
})
public ResponseDto<List<CandyCouponVo>> preUseGoodStore(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal,
@RequestParam("skuIds") @NotNull @NotBlank String skuIds,
@RequestParam("type") @NotNull Integer type,
@RequestParam(required = false, name = "page") Integer page) {
CandyMyCouponListVo vo = candyCouponService.preUseGoodCoupon(priceTotal, skuIds, type);
List<CandyCouponVo> list = vo.getMyCoupon();
List<CandyCouponVo> listVo = ObjectUtil.getCandyCouponVoArrayList();
if (page == null || page == 0) {
page = 1;
}
int size = 10;
int initSize = (page - 1) * size;
int forSize = page * size;
if (forSize >= list.size()) {
forSize = list.size();
}
for (int i = initSize; i < forSize; i++) {
listVo.add(list.get(i));
}
return ResponseDto.success(listVo);
}
//是否可用券 - 商品
@PostMapping("preCanUse/goods/store")
@ApiOperation("是否可用券 - 商品[商铺]")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", dataType = "BigDecimal", name = "priceTotal", value = "待支付总金额", required = true),
@ApiImplicitParam(type = "form", dataType = "String", name = "goodId", value = "商品id(逗号隔开的字符串)", required = true)
})
public ResponseDto<HashMap<String, Integer>> preCanUseGoodStore(@RequestParam("priceTotal") @NotNull BigDecimal priceTotal,
@RequestParam("skuIds") @NotNull @NotBlank String skuIds) {
HashMap<String, Integer> hashMap = CollectionUtil.mapStringInteger();
hashMap.put("canUse", candyCouponService.preCanUseGoodCoupon(priceTotal, skuIds));
return ResponseDto.success(hashMap);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment