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

Commit d0dc3b80 authored by wanglele's avatar wanglele

修改生成兑换码 概率为空

parent 6d60dba7
......@@ -133,14 +133,13 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
continue;
}
// 不能购买的 没库存的 概率是0的 过滤
if (getSkuAllStatusShow(goblinGoodsSku) && goblinRedisUtils.getSkuAllStatusStock(goblinGoodsSku) > 0) {
log.debug("skuId:"+goblinGoodsSku.getSkuId()+"----hitRatio:"+goblinGoodsSku.getHitRatio());
if (goblinGoodsSku.getHitRatio() == null) {
isHit = true;
} else {
hitRatioCount.add(goblinGoodsSku.getHitRatio());
hitRatioCount = hitRatioCount.add(goblinGoodsSku.getHitRatio());
}
countStockNumber += goblinRedisUtils.getSkuStock(goblinGoodsSku.getSkuId());
map.put(goblinGoodsSku.getSkuId(), goblinGoodsSku.getHitRatio());
......@@ -307,50 +306,50 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
Map<String, Map<String, Object>> mapMap = new HashMap<>();
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("hitRatio", 30);
objectMap.put("stock", 900);
objectMap.put("hitRatio", 3.33);
objectMap.put("stock", 100);
mapMap.put("1", objectMap);
Map<String, Object> objectMap1 = new HashMap<>();
objectMap1.put("hitRatio", 0.3);
objectMap1.put("stock", 9);
objectMap1.put("hitRatio", 57.7);
objectMap1.put("stock", 20);
mapMap.put("2", objectMap1);
Map<String, Object> objectMap2 = new HashMap<>();
objectMap2.put("hitRatio", 23.3);
objectMap2.put("stock", 697);
objectMap2.put("hitRatio", 9);
objectMap2.put("stock", 30);
mapMap.put("3", objectMap2);
Map<String, Object> objectMap3 = new HashMap<>();
objectMap3.put("hitRatio", 2.2);
objectMap3.put("stock", 66);
objectMap3.put("hitRatio", 1);
objectMap3.put("stock", 50);
mapMap.put("4", objectMap3);
Map<String, Object> objectMap4 = new HashMap<>();
/* Map<String, Object> objectMap4 = new HashMap<>();
objectMap4.put("hitRatio", 26.7);
objectMap4.put("stock", 797);
objectMap4.put("stock", 165);
mapMap.put("5", objectMap4);
Map<String, Object> objectMap5 = new HashMap<>();
objectMap5.put("hitRatio", 2.2);
objectMap5.put("stock", 66);
objectMap5.put("stock", 12);
mapMap.put("6", objectMap5);
Map<String, Object> objectMap6 = new HashMap<>();
objectMap6.put("hitRatio", 15.3);
objectMap6.put("stock", 458);
mapMap.put("7", objectMap6);
objectMap6.put("hitRatio", 15.6);
objectMap6.put("stock", 90);
mapMap.put("7", objectMap6);*/
Map<String, Integer> stockMap = new HashMap<>();
ArrayList<String> eliminateSkuIdList = CollectionUtil.arrayListString();
// getStock(594, new BigDecimal(100), mapMap, stockMap, 2993, eliminateSkuIdList);
getStock(155, new BigDecimal(71.03), mapMap, stockMap, 179, eliminateSkuIdList);
for (String key : stockMap.keySet()) {
// System.out.println("skuId:" + key + "***********数量:" + stockMap.get(key));
System.out.println("skuId:" + key + "***********数量:" + stockMap.get(key));
}
// System.out.println("kkk");
System.out.println("kkk");
Map<String, BigDecimal> hmap = new HashMap<>();
/* Map<String, BigDecimal> hmap = new HashMap<>();
hmap.put("1", new BigDecimal(40));
hmap.put("2", new BigDecimal(49));
hmap.put("3", null);
......@@ -359,7 +358,7 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
arrangeHitRatioMap(hmap, new BigDecimal(89));
for (String key : hmap.keySet()) {
}
}*/
}
......
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