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

Commit 54122969 authored by 胡佳晨's avatar 胡佳晨

修改 下单

parent 9054ce5d
...@@ -22,7 +22,11 @@ public class CollectionUtil { ...@@ -22,7 +22,11 @@ public class CollectionUtil {
private static final ArrayList<Object> OBJECT_ARRAY_LIST = new ArrayList<>(); private static final ArrayList<Object> OBJECT_ARRAY_LIST = new ArrayList<>();
private static final ArrayList<BigDecimal> BIG_DECIMALS_ARRAY_LIST = new ArrayList<>(); private static final ArrayList<BigDecimal> BIG_DECIMALS_ARRAY_LIST = new ArrayList<>();
private static final ArrayList<BigDecimal> BIGDECIMAL_ARRAY_LIST = new ArrayList<>(); private static final ArrayList<BigDecimal> BIGDECIMAL_ARRAY_LIST = new ArrayList<>();
private static final String[] STRING_ARRAY = new String[]{};
public static String[] stringArray() {
return STRING_ARRAY.clone();
}
public static HashMap<String, String> mapStringString() { public static HashMap<String, String> mapStringString() {
return (HashMap<String, String>) STRING_STRING_HASH_MAP.clone(); return (HashMap<String, String>) STRING_STRING_HASH_MAP.clone();
} }
......
...@@ -200,7 +200,7 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -200,7 +200,7 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
String listId = (null == goblinListCollectVo) ? null : goblinListCollectVo.getListId(); String listId = (null == goblinListCollectVo) ? null : goblinListCollectVo.getListId();
log.debug("listId : {}", listId); log.debug("listId : {}", listId);
String mixId = nftOrder.getMixId(); String mixId = nftOrder.getMixId();
if(mixId!=null && !mixId.equals("")){ if (mixId != null && !mixId.equals("")) {
listId = mixId; listId = mixId;
log.debug("mixId : {}", listId); log.debug("mixId : {}", listId);
} }
...@@ -241,6 +241,9 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -241,6 +241,9 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
String[] goblin = map.get("goblin"); String[] goblin = map.get("goblin");
for (String orderId : goblin) { for (String orderId : goblin) {
if("".equals(orderId)){
break;
}
GoblinStoreOrderVo orderVo = getGoblinOrder(orderId); GoblinStoreOrderVo orderVo = getGoblinOrder(orderId);
if (orderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_0.getValue())) {//订单回滚 if (orderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_0.getValue())) {//订单回滚
LinkedList<String> sqls = CollectionUtil.linkedListString(); LinkedList<String> sqls = CollectionUtil.linkedListString();
...@@ -288,6 +291,9 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -288,6 +291,9 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
} }
for (String orderId : nft) { for (String orderId : nft) {
if("".equals(orderId)){
break;
}
checkNftOrderTime(orderId); checkNftOrderTime(orderId);
} }
...@@ -403,8 +409,14 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin ...@@ -403,8 +409,14 @@ public abstract class AbstractOrderCloseReceiver implements StreamListener<Strin
return null; return null;
} else { } else {
String[] a = ((String) obj).split("&&"); String[] a = ((String) obj).split("&&");
String[] nftA = a[0].split(","); String[] nftA = CollectionUtil.stringArray();
String[] goblinA = a[1].split(","); String[] goblinA = CollectionUtil.stringArray();
if (a.length > 0) {
nftA = a[0].split(",");
}
if (a.length > 1) {
goblinA = a[1].split(",");
}
HashMap<String, String[]> map = mixIdMap(); HashMap<String, String[]> map = mixIdMap();
map.put("nft", nftA); map.put("nft", nftA);
map.put("goblin", goblinA); map.put("goblin", goblinA);
......
...@@ -139,6 +139,9 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService { ...@@ -139,6 +139,9 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
List<GoblinNftOrderDetailsVo> nftOrderListVos = ObjectUtil.goblinNftOrderDetailsVoArrayList(); List<GoblinNftOrderDetailsVo> nftOrderListVos = ObjectUtil.goblinNftOrderDetailsVoArrayList();
for (String orderId : nft) { for (String orderId : nft) {
if("".equals(orderId)){
break;
}
// 订单信息 // 订单信息
GoblinNftOrderVo orderVo = redisUtils.getGoblinNftOrder(orderId); GoblinNftOrderVo orderVo = redisUtils.getGoblinNftOrder(orderId);
GoblinNftOrderDetailsVo orderDetails = GoblinNftOrderDetailsVo.getNew().copy(orderVo); GoblinNftOrderDetailsVo orderDetails = GoblinNftOrderDetailsVo.getNew().copy(orderVo);
...@@ -149,6 +152,9 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService { ...@@ -149,6 +152,9 @@ public class GoblinMixAppServiceImpl implements IGoblinMixAppService {
nftOrderListVos.add(orderDetails); nftOrderListVos.add(orderDetails);
} }
for (String orderId : goblin) { for (String orderId : goblin) {
if("".equals(orderId)){
break;
}
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId); GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId);
GoblinAppOrderListVo vos = GoblinAppOrderListVo.getNew(); GoblinAppOrderListVo vos = GoblinAppOrderListVo.getNew();
BeanUtils.copyProperties(orderVo, vos); BeanUtils.copyProperties(orderVo, vos);
......
...@@ -1614,8 +1614,14 @@ public class GoblinRedisUtils { ...@@ -1614,8 +1614,14 @@ public class GoblinRedisUtils {
return null; return null;
} else { } else {
String[] a = ((String) obj).split("&&"); String[] a = ((String) obj).split("&&");
String[] nftA = a[0].split(","); String[] nftA = CollectionUtil.stringArray();
String[] goblinA = a[1].split(","); String[] goblinA = CollectionUtil.stringArray();
if (a.length > 0) {
nftA = a[0].split(",");
}
if (a.length > 1) {
goblinA = a[1].split(",");
}
HashMap<String, String[]> map = ObjectUtil.mixIdMap(); HashMap<String, String[]> map = ObjectUtil.mixIdMap();
map.put("nft", nftA); map.put("nft", nftA);
map.put("goblin", goblinA); map.put("goblin", goblinA);
......
...@@ -554,6 +554,7 @@ public class GoblinNftOrderUtils { ...@@ -554,6 +554,7 @@ public class GoblinNftOrderUtils {
// String endListId = newListIds.get(index); // String endListId = newListIds.get(index);
// 判断库存 // 判断库存
int surplusGeneral = goblinRedisUtils.decrSkuStock(listId, goodsSkuInfoVo.getSkuId(), number); int surplusGeneral = goblinRedisUtils.decrSkuStock(listId, goodsSkuInfoVo.getSkuId(), number);
log.error("剩余 skuId = "+surplusGeneral);
if (surplusGeneral < 0) { if (surplusGeneral < 0) {
goblinRedisUtils.incrSkuStock(listId, goodsSkuInfoVo.getSkuId(), number); goblinRedisUtils.incrSkuStock(listId, goodsSkuInfoVo.getSkuId(), number);
return lotteryDraw(skuIdList, number, nowTime, listId); return lotteryDraw(skuIdList, number, nowTime, listId);
......
...@@ -468,8 +468,14 @@ public class GoblinRedisUtils { ...@@ -468,8 +468,14 @@ public class GoblinRedisUtils {
return null; return null;
} else { } else {
String[] a = ((String) obj).split("&&"); String[] a = ((String) obj).split("&&");
String[] nftA = a[0].split(","); String[] nftA = CollectionUtil.stringArray();
String[] goblinA = a[1].split(","); String[] goblinA = CollectionUtil.stringArray();
if (a.length > 0) {
nftA = a[0].split(",");
}
if (a.length > 1) {
goblinA = a[1].split(",");
}
HashMap<String, String[]> map = ObjectUtil.mixIdMap(); HashMap<String, String[]> map = ObjectUtil.mixIdMap();
map.put("nft", nftA); map.put("nft", nftA);
map.put("goblin", goblinA); map.put("goblin", goblinA);
......
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