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

Commit 40dc8e4d authored by 胡佳晨's avatar 胡佳晨

增加 参数校验

parent 14dda551
...@@ -67,6 +67,8 @@ public class GoblinBackOrderDetailsVo implements Serializable, Cloneable { ...@@ -67,6 +67,8 @@ public class GoblinBackOrderDetailsVo implements Serializable, Cloneable {
private String createdAt; private String createdAt;
@ApiModelProperty(value = "过期时间") @ApiModelProperty(value = "过期时间")
private String expireAt; private String expireAt;
@ApiModelProperty(value = "拒绝时间")
private String RefuseAt;
@ApiModelProperty(value = "支付时间") @ApiModelProperty(value = "支付时间")
private String payTime; private String payTime;
......
...@@ -195,7 +195,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -195,7 +195,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
return ResponseDto.failure(e.getMessage()); return ResponseDto.failure(e.getMessage());
} else if (e.getMessage().equals("平台券店铺券不可一起使用")) { } else if (e.getMessage().equals("平台券店铺券不可一起使用")) {
return ResponseDto.failure(e.getMessage()); return ResponseDto.failure(e.getMessage());
}else if (e.getMessage().equals("平台券店铺券不可一起使用")) { } else if (e.getMessage().equals("平台券店铺券不可一起使用")) {
return ResponseDto.failure(e.getMessage()); return ResponseDto.failure(e.getMessage());
} else if (e.getMessage().equals("跨店铺购物平台券不可用")) { } else if (e.getMessage().equals("跨店铺购物平台券不可用")) {
return ResponseDto.failure(e.getMessage()); return ResponseDto.failure(e.getMessage());
...@@ -293,7 +293,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -293,7 +293,7 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
throw new Exception("平台券店铺券不可一起使用"); throw new Exception("平台券店铺券不可一起使用");
} }
if(param.getGoblinOrderStoreParamList().size()>1 && (platVoucherCode != null && !platVoucherCode.equals(""))){ if (param.getGoblinOrderStoreParamList().size() > 1 && (platVoucherCode != null && !platVoucherCode.equals(""))) {
throw new Exception("跨店铺购物平台券不可用"); throw new Exception("跨店铺购物平台券不可用");
} }
...@@ -940,6 +940,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -940,6 +940,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
}); });
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(), queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_STORE_ORDER_OPERA.getKey(),
SqlMapping.gets(sqls, sqlsOrder, sqlsOrderSku, sqlsBackOrder)); SqlMapping.gets(sqls, sqlsOrder, sqlsOrderSku, sqlsBackOrder));
//减积分
orderUtils.desTask(orderVo.getUserId(), backOrderVo.getRealBackPrice());
} else if (0 == status) { } else if (0 == status) {
} }
......
...@@ -144,7 +144,15 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -144,7 +144,15 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
return ResponseDto.failure("该商品已经配置"); return ResponseDto.failure("该商品已经配置");
} }
} }
GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(params.getSpuId());
List<String> skuSize = params.getGoblinStoreZhengzaiItemParams().stream().distinct().map(GoblinStoreZhengzaiItemParam::getSkuId).collect(Collectors.toList());
if (spuVo.getSkuIdList().size() != skuSize.size()) {
return ResponseDto.failure("参数异常");
}
for (GoblinStoreZhengzaiItemParam item : params.getGoblinStoreZhengzaiItemParams()) { for (GoblinStoreZhengzaiItemParam item : params.getGoblinStoreZhengzaiItemParams()) {
if (!spuVo.getSkuIdList().contains(item.getSkuId())) {
return ResponseDto.failure("参数异常");
}
String zhengzaiId = IDGenerator.nextMilliId2(); String zhengzaiId = IDGenerator.nextMilliId2();
GoblinMarketingZhengzai bean = GoblinMarketingZhengzai.getNew(); GoblinMarketingZhengzai bean = GoblinMarketingZhengzai.getNew();
bean.setStoreId(params.getStoreId()); bean.setStoreId(params.getStoreId());
...@@ -182,6 +190,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -182,6 +190,7 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
skuVo.setBuyRoster(bean.getBuyRoster()); skuVo.setBuyRoster(bean.getBuyRoster());
skuVo.setBuyFactor(bean.getBuyFactor().toString()); skuVo.setBuyFactor(bean.getBuyFactor().toString());
skuVo.setMarketId(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue().concat(params.getSelfMarketId())); skuVo.setMarketId(GoblinStatusConst.MarketPreStatus.MARKET_PRE_ZHENGZAI.getValue().concat(params.getSelfMarketId()));
skuVo.setCreatedAt(LocalDateTime.now());
mongoUtils.upsertGoodsSkuInfoVo(skuVo); mongoUtils.upsertGoodsSkuInfoVo(skuVo);
//redis //redis
redisUtils.setGoodsSkuInfoVo(skuVo); redisUtils.setGoodsSkuInfoVo(skuVo);
...@@ -199,7 +208,6 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -199,7 +208,6 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
return ResponseDto.failure("148001", JsonUtils.toJson(errorNameList)); return ResponseDto.failure("148001", JsonUtils.toJson(errorNameList));
} }
//mongo //mongo
GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(params.getSpuId());
spuVo.setSpuId(marketSpuId); spuVo.setSpuId(marketSpuId);
spuVo.setSkuIdList(marketSkuList); spuVo.setSkuIdList(marketSkuList);
//排序 //排序
...@@ -236,7 +244,12 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -236,7 +244,12 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
LinkedList<String> sqls = CollectionUtil.linkedListString(); LinkedList<String> sqls = CollectionUtil.linkedListString();
sqls.add(SqlMapping.get("goblin.self.market.updateRelation")); sqls.add(SqlMapping.get("goblin.self.market.updateRelation"));
LinkedList<Object[]> sqlsData = CollectionUtil.linkedListObjectArr(); LinkedList<Object[]> sqlsData = CollectionUtil.linkedListObjectArr();
GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(params.getSpuId());
for (GoblinStoreZhengzaiItemParam item : params.getGoblinStoreZhengzaiItemParams()) { for (GoblinStoreZhengzaiItemParam item : params.getGoblinStoreZhengzaiItemParams()) {
if (!spuVo.getSkuIdList().contains(item.getSkuId())) {
return ResponseDto.failure("参数异常");
}
GoblinMarketingZhengzai bean = GoblinMarketingZhengzai.getNew(); GoblinMarketingZhengzai bean = GoblinMarketingZhengzai.getNew();
bean.setPriceMarketing(item.getPriceMarketing()); bean.setPriceMarketing(item.getPriceMarketing());
bean.setStockMarketing(item.getStockMarketing()); bean.setStockMarketing(item.getStockMarketing());
...@@ -286,7 +299,6 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService { ...@@ -286,7 +299,6 @@ public class GoblinZhengzaiServiceImpl implements IGoblinZhengzaiService {
return ResponseDto.failure("148001", JsonUtils.toJson(errorNameList)); return ResponseDto.failure("148001", JsonUtils.toJson(errorNameList));
} }
//mongo //mongo
GoblinGoodsInfoVo spuVo = redisUtils.getGoodsInfoVo(params.getSpuId());
spuVo.setSpuId(marketSpuId); spuVo.setSpuId(marketSpuId);
//排序 //排序
priceList = priceList.stream().sorted().collect(Collectors.toList()); priceList = priceList.stream().sorted().collect(Collectors.toList());
......
...@@ -201,4 +201,19 @@ public class GoblinOrderUtils { ...@@ -201,4 +201,19 @@ public class GoblinOrderUtils {
e.printStackTrace(); e.printStackTrace();
} }
} }
public void desTask(String uid, BigDecimal price) {
try {
MultiValueMap<String, String> header = CollectionUtil.linkedMultiValueMapStringString();
header.add("Accept", "application/json;charset=UTF-8");
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("score", price.intValue() + "");
params.add("content", "购买商品:");
params.add("uid", uid);
String resultData = HttpUtil.post(stoneUrl + "/user/logs/de2111", params, header);
} catch (Exception e) {
log.error("添加积分失败,e:{}", e);
e.printStackTrace();
}
}
} }
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