Commit 77004fe0 authored by 秦兴亮's avatar 秦兴亮

最新代码

parent 63be8cac
......@@ -331,21 +331,21 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
int saleType = spuService.getNftSalesType(orderSkuVo.getSkuId());
if(saleType == 2){
String serialNo = skuService.getSerialNo(skuVo.getCommodityPassId());
JSONArray array = JSON.parseArray(serialNo);
List<Long> array = JSON.parseArray(serialNo, Long.class);
if(array.size()<orderSkuVo.getNum()){
throw new RuntimeException("库存不足!!!");
}
int index = 1;
List<String> list = new ArrayList<>();
for (Object o:array) {
List<Long> list = new ArrayList<>();
for (Long o:array) {
if(index<=orderSkuVo.getNum()){
list.add(o.toString());
list.add(o);
index ++;
}else{
break;
}
}
array.remove(list);
boolean remove = array.remove(list);
skuService.updateSerialNo(JSON.toJSONString(array),skuVo.getCommodityPassId());
orderDetail.setSerialNo(JSON.toJSONString(list));
}
......@@ -1349,11 +1349,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
return null;
}
public static void main(String[] args) {
String str = "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]";
JSONArray array = JSON.parseArray(str);
System.out.println(array.toJSONString());
}
/* private String tranCoinAndNft(String skuId,String from,String to,BigDecimal number,int goodsType,String coin) {
//商品通证(0.否 1.是,自动生成Token 2.是,使用外部既有Token)
......@@ -1396,4 +1391,5 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
}*/
}
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