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

Commit 7e9644eb authored by 胡佳晨's avatar 胡佳晨

增加 字段 routeType

parent 0f02fdbe
......@@ -36,7 +36,7 @@ public class GoblinGagoController extends BaseController {
RedisDataSourceUtil redisDataSourceUtil;
@Autowired
GoblinRedisUtils goblinRedisUtils;
@Value("${liquidnet.service.order.url}")
@Value("${liquidnet.service.order.url}")
private String orderUrl;
// private String orderUrl = "http://127.0.0.1:9004/order";
......@@ -75,6 +75,7 @@ public class GoblinGagoController extends BaseController {
public AjaxResult listByStatus(@RequestParam(value = "skuId") String skuId, @RequestParam(value = "nftNum") int nftNum, @RequestParam(value = "uid") String uid) {
//当前 nft序号
GoblinGoodsSkuInfoVo skuInfoVo = goblinRedisUtils.getGoodsSkuInfoVo(skuId);
String routeType = skuInfoVo.getRouteType();
int cNufCount = goblinRedisUtils.getNftCountBySku(skuInfoVo.getRouteType(), skuId);
if (cNufCount >= nftNum) {
return AjaxResult.error("该序号已售卖");
......@@ -90,9 +91,9 @@ public class GoblinGagoController extends BaseController {
return AjaxResult.error("该序号已被占用");
}
//
int count = goblinRedisUtils.decrSkuStock(null,skuId,1);
if(count<0){
goblinRedisUtils.incrSkuStock(null,skuId,1);
int count = goblinRedisUtils.decrSkuStock(null, skuId, 1);
if (count < 0) {
goblinRedisUtils.incrSkuStock(null, skuId, 1);
goblinRedisUtils.removeNftList(skuId, nftNum + "");
return AjaxResult.error("已售罄");
}
......@@ -113,6 +114,7 @@ public class GoblinGagoController extends BaseController {
dto.setNftOrderPayId(innerReturnVo.getData());
dto.setSkuId(skuId);
dto.setUserId(uid);
dto.setRouterType(routeType);
goblinRedisUtils.setNftNumDetails(nftNum + "", skuId, dto);
return AjaxResult.success();
} else {
......
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