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

Commit 7893e34b authored by jiangxiulong's avatar jiangxiulong

分批购权限判断

parent f0623d4d
......@@ -30,12 +30,15 @@ public class GoblinPayOrderDetailsVo implements Serializable, Cloneable {
@ApiModelProperty(position = 22, value = "IOS商品价格[20,2]")
private BigDecimal priceV;
@ApiModelProperty(value = "商铺名称")
@ApiModelProperty(position = 23, value = "商铺名称")
private String storeName;
@ApiModelProperty(position = 23, value = "数量")
@ApiModelProperty(position = 24, value = "数量")
private Integer num;
@ApiModelProperty(position = 25, value = "分批、提前购 是否有购买权限")
private Boolean listCanBuy;
private static final GoblinPayOrderDetailsVo obj = new GoblinPayOrderDetailsVo();
public static GoblinPayOrderDetailsVo getNew() {
......
......@@ -11,5 +11,5 @@ public interface IGoblinNftOrderAppService {
ResponseDto<GoblinNftOrderDetailsVo> orderDetails(String orderId);
GoblinPayOrderDetailsVo payOrderDetails(String skuId);
ResponseDto<GoblinPayOrderDetailsVo> payOrderDetails(String skuId);
}
......@@ -54,11 +54,7 @@ public class GoblinNftOrderAppController {
public ResponseDto<GoblinPayOrderDetailsVo> payOrderDetails(
@RequestParam("skuId") @NotBlank(message = "skuId不能为空") String skuId
) {
GoblinPayOrderDetailsVo vo = goblinNftOrderAppService.payOrderDetails(skuId);
if (vo == null) {
return ResponseDto.failure("商品不存在或无权购买");
}
return ResponseDto.success(vo);
return goblinNftOrderAppService.payOrderDetails(skuId);
}
}
......@@ -85,7 +85,7 @@ public class GoblinNftOrderAppServiceImpl implements IGoblinNftOrderAppService {
}
@Override
public GoblinPayOrderDetailsVo payOrderDetails(String skuId) {
public ResponseDto<GoblinPayOrderDetailsVo> payOrderDetails(String skuId) {
String uid = CurrentUtil.getCurrentUid();
String mobile = StringUtils.defaultString(((String) CurrentUtil.getTokenClaims().get(CurrentUtil.TOKEN_MOBILE)), "");
LocalDateTime nowTime = LocalDateTime.now();
......@@ -95,23 +95,23 @@ public class GoblinNftOrderAppServiceImpl implements IGoblinNftOrderAppService {
String listId = (String) map.get("listId");
Integer whiteType = (Integer) map.get("whiteType");
// 分批、提前购黑、白名单
if (null != tagType) {
Boolean listCanBuy = goblinRedisUtils.getListCanBuy(listId, skuId, mobile, uid, whiteType);
if (!listCanBuy) {
return null;
}
}
if (goblinRedisUtils.getSkuAllStatusShow(goodsSkuInfoVo)) {
GoblinPayOrderDetailsVo payOrderDetailsVo = GoblinPayOrderDetailsVo.getNew().copy(goodsSkuInfoVo);
payOrderDetailsVo.setNum(1);
GoblinStoreInfoVo storeInfoVo = goblinRedisUtils.getStoreInfoVo(goodsSkuInfoVo.getStoreId());
payOrderDetailsVo.setStoreName(storeInfoVo.getStoreName());
return payOrderDetailsVo;
// 分批、提前购黑、白名单
Boolean listCanBuy = true;
if (null != tagType) {
listCanBuy = goblinRedisUtils.getListCanBuy(listId, skuId, mobile, uid, whiteType);
}
payOrderDetailsVo.setListCanBuy(listCanBuy);
return ResponseDto.success(payOrderDetailsVo);
} else {
return null;
return ResponseDto.failure("藏品不存在");
}
}
......
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