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

Commit 93a14b86 authored by 张国柄's avatar 张国柄

~param:valid;

parent d1ec0799
...@@ -63,25 +63,26 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -63,25 +63,26 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
@Min(value = 0, message = "线上库存必须大于0") @Min(value = 0, message = "线上库存必须大于0")
private Integer stock; private Integer stock;
@ApiModelProperty(position = 22, required = false, value = "概率[0.01~100%],`unbox=1`时有效", example = "0") @ApiModelProperty(position = 22, required = false, value = "概率[0.01~100%],`unbox=1`时有效", example = "0")
@DecimalMin(value = "0", message = "概率超出可填范围0~100") @DecimalMin(value = "0", message = "概率超出可填范围0.01~100")
@DecimalMax(value = "100", message = "概率超出可填范围0.01~100")
private BigDecimal hitRatio; private BigDecimal hitRatio;
@ApiModelProperty(position = 23, required = true, value = "藏品价格[20,2]", example = "0.01") @ApiModelProperty(position = 23, required = true, value = "藏品价格[20,2]", example = "0.01")
@NotNull(message = "藏品价格不能为空") @NotNull(message = "藏品价格不能为空")
@DecimalMin(value = "0.01", message = "藏品价格必须大于0") @DecimalMin(value = "0.01", message = "藏品价格必须大于0")
private BigDecimal price; private BigDecimal price;
@ApiModelProperty(position = 23, required = true, value = "IOS价格ID[20]", example = "NGoods1") @ApiModelProperty(position = 23, required = true, value = "IOS价格ID[20]", example = "NGoods1")
// @NotNull(message = "IOS价格ID不能为空")// TODO: 2022/4/8 ==zhanggb @NotNull(message = "IOS价格ID不能为空")
private String productId; private String productId;
// @ApiModelProperty(position = 24, required = false, value = "藏品会员价格[20,2]", example = "0") // @ApiModelProperty(position = 24, required = false, value = "藏品会员价格[20,2]", example = "0")
// @DecimalMin(value = "0.01", message = "藏品会员价格必须大于0") // @DecimalMin(value = "0.01", message = "藏品会员价格必须大于0")
// private BigDecimal priceMember; // private BigDecimal priceMember;
@ApiModelProperty(position = 25, required = false, value = "限购[0-无限制|X:限购数量],`unbox=0`时必传", example = "1") @ApiModelProperty(position = 25, required = false, value = "限购[0-无限制|X:限购数量],`unbox=0`时必传", example = "1")
// @NotNull(message = "限购数量不能为空")// TODO: 2022/4/11 ==zhanggb.open @NotNull(message = "限购数量不能为空")
@Min(value = 1, message = "限购数量必须大于0") @Min(value = 1, message = "限购数量必须大于0")
private Integer buyLimit; private Integer buyLimit;
@ApiModelProperty(position = 26, required = false, value = "购买限制[0-全部用户|1-仅会员],`unbox=0`时必传", example = "0") @ApiModelProperty(position = 26, required = false, value = "购买限制[0-全部用户|1-仅会员],`unbox=0`时必传", example = "0")
// @NotBlank(message = "购买条件不能为空")// TODO: 2022/4/11 ==zhanggb.open @NotBlank(message = "购买条件不能为空")
@Pattern(regexp = "\\b(0|1)\\b", message = "购买条件参数无效") @Pattern(regexp = "\\b(0|1)\\b", message = "购买条件参数无效")
private String buyFactor; private String buyFactor;
@ApiModelProperty(position = 27, required = false, value = "是否隐藏[0-默认展示|1-隐藏],`unbox=0`时必传", example = "0") @ApiModelProperty(position = 27, required = false, value = "是否隐藏[0-默认展示|1-隐藏],`unbox=0`时必传", example = "0")
...@@ -167,6 +168,9 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -167,6 +168,9 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
initVo.setSoldoutStatus("0"); initVo.setSoldoutStatus("0");
initVo.setDelFlg("0"); initVo.setDelFlg("0");
initVo.setBuyLimit(this.getBuyLimit());//
initVo.setBuyFactor(this.getBuyFactor());//
initVo.setUnbox(notUnboxFlg ? "0" : "1"); initVo.setUnbox(notUnboxFlg ? "0" : "1");
if (notUnboxFlg) { if (notUnboxFlg) {
initVo.setSubtitle(this.getSubtitle());//0 initVo.setSubtitle(this.getSubtitle());//0
...@@ -176,15 +180,15 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -176,15 +180,15 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
initVo.setSkuStock(this.getStock());//0 initVo.setSkuStock(this.getStock());//0
// initVo.setGiftStock(this.getGiftStock());//0 // initVo.setGiftStock(this.getGiftStock());//0
initVo.setHitRatio(this.getHitRatio());//0 initVo.setHitRatio(this.getHitRatio());//0
initVo.setBuyLimit(this.getBuyLimit());//0 // initVo.setBuyLimit(this.getBuyLimit());//0
initVo.setBuyFactor(this.getBuyFactor());//0 // initVo.setBuyFactor(this.getBuyFactor());//0
initVo.setSkuAppear(this.getSkuAppear());//0 initVo.setSkuAppear(this.getSkuAppear());//0
initVo.setSkuCanbuy(this.getSkuCanbuy());//0 initVo.setSkuCanbuy(this.getSkuCanbuy());//0
} else { } else {
initVo.setStock(0); initVo.setStock(0);
initVo.setSkuStock(0); initVo.setSkuStock(0);
initVo.setBuyLimit(this.getBuyLimit());// // initVo.setBuyLimit(this.getBuyLimit());//
initVo.setBuyFactor(this.getBuyFactor());// // initVo.setBuyFactor(this.getBuyFactor());//
initVo.setSkuAppear("0"); initVo.setSkuAppear("0");
initVo.setSkuCanbuy("1"); initVo.setSkuCanbuy("1");
initVo.setOpeningTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getOpeningTime()));//1 initVo.setOpeningTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getOpeningTime()));//1
...@@ -203,17 +207,20 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable { ...@@ -203,17 +207,20 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
updateVo.setShelvesTime(this.getShelvesTime()); updateVo.setShelvesTime(this.getShelvesTime());
updateVo.setSaleStartTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getSaleStartTime())); updateVo.setSaleStartTime(DateUtil.Formatter.yyyyMMddHHmmss.parse(this.getSaleStartTime()));
updateVo.setBuyLimit(this.getBuyLimit());//
updateVo.setBuyFactor(this.getBuyFactor());//
switch (this.getUnbox()) { switch (this.getUnbox()) {
case "0": case "0":
updateVo.setHitRatio(this.getHitRatio());//0 updateVo.setHitRatio(this.getHitRatio());//0
updateVo.setBuyLimit(this.getBuyLimit());//0 // updateVo.setBuyLimit(this.getBuyLimit());//0
updateVo.setBuyFactor(this.getBuyFactor());//0 // updateVo.setBuyFactor(this.getBuyFactor());//0
updateVo.setSkuAppear(this.getSkuAppear());//0 updateVo.setSkuAppear(this.getSkuAppear());//0
updateVo.setSkuCanbuy(this.getSkuCanbuy());//0 updateVo.setSkuCanbuy(this.getSkuCanbuy());//0
break; break;
case "1": case "1":
updateVo.setBuyLimit(this.getBuyLimit());// // updateVo.setBuyLimit(this.getBuyLimit());//
updateVo.setBuyFactor(this.getBuyFactor());// // updateVo.setBuyFactor(this.getBuyFactor());//
updateVo.setSkuAppear("0");// updateVo.setSkuAppear("0");//
updateVo.setSkuCanbuy("1");// updateVo.setSkuCanbuy("1");//
updateVo.setName(this.getName());//1 updateVo.setName(this.getName());//1
......
...@@ -890,6 +890,10 @@ public class GoblinStoreMgtGoodsController { ...@@ -890,6 +890,10 @@ public class GoblinStoreMgtGoodsController {
if (mgtGoodsInfoVo.getSpuType() == 0) { if (mgtGoodsInfoVo.getSpuType() == 0) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非数字藏品"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非数字藏品");
} }
BigDecimal hitRatio = mgtDigitalGoodsEditSkuParam.getHitRatio();
if (null != hitRatio && hitRatio.scale() > 2) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "概率值只支持小数点后两位");
}
if ("3".equals(mgtDigitalGoodsEditSkuParam.getShelvesHandle()) && StringUtils.isEmpty(mgtDigitalGoodsEditSkuParam.getShelvesTime())) { if ("3".equals(mgtDigitalGoodsEditSkuParam.getShelvesHandle()) && StringUtils.isEmpty(mgtDigitalGoodsEditSkuParam.getShelvesTime())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "请指定预约上架时间"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "请指定预约上架时间");
} }
...@@ -1057,12 +1061,13 @@ public class GoblinStoreMgtGoodsController { ...@@ -1057,12 +1061,13 @@ public class GoblinStoreMgtGoodsController {
if (goodsInfoVo.getSpuType() == 0) { if (goodsInfoVo.getSpuType() == 0) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非数字藏品"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效操作,该商品非数字藏品");
} }
BigDecimal hitRatio = mgtDigitalGoodsAddSkuParam.getHitRatio();
if (null != hitRatio && hitRatio.scale() > 2) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "概率值只支持小数点后两位");
}
if (goblinMongoUtils.countMgtGoodsSkuInfoVo(mgtDigitalGoodsAddSkuParam.getName(), 1) > 0) { if (goblinMongoUtils.countMgtGoodsSkuInfoVo(mgtDigitalGoodsAddSkuParam.getName(), 1) > 0) {
return ResponseDto.failure(ErrorMapping.get("149018")); return ResponseDto.failure(ErrorMapping.get("149018"));
} }
if (StringUtils.isBlank(mgtDigitalGoodsAddSkuParam.getProductId())) {// TODO: 2022/4/8 ==zhanggb.del
mgtDigitalGoodsAddSkuParam.setProductId("NGoods1");
}
JsonNode priceVNode = goblinRedisUtils.getIosProducts().get(mgtDigitalGoodsAddSkuParam.getProductId()); JsonNode priceVNode = goblinRedisUtils.getIosProducts().get(mgtDigitalGoodsAddSkuParam.getProductId());
if (null == priceVNode) { if (null == priceVNode) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效的IOS商品ID"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "无效的IOS商品ID");
...@@ -1076,13 +1081,13 @@ public class GoblinStoreMgtGoodsController { ...@@ -1076,13 +1081,13 @@ public class GoblinStoreMgtGoodsController {
if (StringUtils.isEmpty(mgtDigitalGoodsAddSkuParam.getMaterialType()) || StringUtils.isBlank(mgtDigitalGoodsAddSkuParam.getMaterialUrl())) { if (StringUtils.isEmpty(mgtDigitalGoodsAddSkuParam.getMaterialType()) || StringUtils.isBlank(mgtDigitalGoodsAddSkuParam.getMaterialUrl())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "我的藏品展示类型或文件不能为空"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "我的藏品展示类型或文件不能为空");
} }
if (null == mgtDigitalGoodsAddSkuParam.getBuyLimit()) { // if (null == mgtDigitalGoodsAddSkuParam.getBuyLimit()) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "限购数量不能为空"); // return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "限购数量不能为空");
} // }
String buyFactor = mgtDigitalGoodsAddSkuParam.getBuyFactor(); // String buyFactor = mgtDigitalGoodsAddSkuParam.getBuyFactor();
if (StringUtils.isEmpty(buyFactor)) { // if (StringUtils.isEmpty(buyFactor)) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "请指定藏品购买条件"); // return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "请指定藏品购买条件");
} // }
// if (buyFactor.equals("2")) {// 购买条件:指定用户时 // if (buyFactor.equals("2")) {// 购买条件:指定用户时
// if (StringUtils.isEmpty(mgtDigitalGoodsAddSkuParam.getBuyRosterType())) { // if (StringUtils.isEmpty(mgtDigitalGoodsAddSkuParam.getBuyRosterType())) {
// return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "请指定购买限制人员名单操作类型"); // return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "请指定购买限制人员名单操作类型");
...@@ -1092,12 +1097,6 @@ public class GoblinStoreMgtGoodsController { ...@@ -1092,12 +1097,6 @@ public class GoblinStoreMgtGoodsController {
// } // }
// } // }
} else {// 盲盒校验 } else {// 盲盒校验
if (null == mgtDigitalGoodsAddSkuParam.getBuyLimit()) {// TODO: 2022/4/11 ==zhanggb.del
mgtDigitalGoodsAddSkuParam.setBuyLimit(1);
}
if (StringUtils.isEmpty(mgtDigitalGoodsAddSkuParam.getBuyFactor())) {// TODO: 2022/4/11 ==zhanggb.del
mgtDigitalGoodsAddSkuParam.setBuyFactor("0");
}
if (StringUtils.isEmpty(mgtDigitalGoodsAddSkuParam.getOpeningTime())) { if (StringUtils.isEmpty(mgtDigitalGoodsAddSkuParam.getOpeningTime())) {
return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "盲盒开启时间不能为空"); return ResponseDto.failure(ErrorCode.HTTP_PARAM_ERROR.getCode(), "盲盒开启时间不能为空");
} }
......
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