• Gson杂记录


    //Integer userId = getUserId();
    //System.out.println("userId:"+userId);

    /*for(int i=0;i<productSku.size();i++) {
    HashMap<String, Object> map =GsonDoubleInteger.getGson().fromJson(productSku.getString(i), HashMap.class);
    ProductSku sku = new ProductSku();
    sku.setCreateTime(new Date());
    sku.setUpdateId(1);
    sku.setUpdateTime(new Date());
    sku.setDelFlag(0);
    sku.setShopCount(Integer.valueOf(map.get("shopCount").toString()));
    sku.setProductId(Integer.valueOf(map.get("productId").toString()));
    String shopPrice = map.get("shopPrice").toString();
    System.out.println("===="+shopPrice+"====");
    sku.setShopPrice(Double.valueOf(shopPrice));
    sku.setSpecs(map.get("specs").toString());
    //json数组
    JSONArray json = JSONArray.parseArray(map.get("specs").toString());
    for(int j=0;j<json.size();j++) {//记录规格
    recordSpecsInfo(json.getString(j).toString(),Integer.valueOf(map.get("productId").toString()));
    }
    //记录日志
    Product product = productService.selectById(Integer.valueOf(map.get("productId").toString()));
    recordLogInfo(product,sku);
    list.add(sku);
    }*/

    /*productSku.forEach(item->{
    HashMap<String, Object> map =GsonDoubleInteger.getGson().fromJson(item.toString(), HashMap.class);
    ProductSku sku = new ProductSku();
    sku.setCreateTime(new Date());
    sku.setUpdateId(1);
    sku.setUpdateTime(new Date());
    sku.setDelFlag(0);
    sku.setShopCount(Integer.valueOf(map.get("shopCount").toString()));
    sku.setProductId(Integer.valueOf(map.get("productId").toString()));
    String shopPrice = map.get("shopPrice").toString();
    System.out.println("===="+shopPrice+"====");
    sku.setShopPrice(Double.valueOf(shopPrice));
    sku.setSpecs(map.get("specs").toString());
    //json数组
    JSONArray json = JSONArray.parseArray(map.get("specs").toString());
    for(int i=0;i<json.size();i++) {//记录规格
    recordSpecsInfo(json.getString(i).toString(),Integer.valueOf(map.get("productId").toString()));
    }
    //记录日志
    Product product = productService.selectById(Integer.valueOf(map.get("productId").toString()));
    recordLogInfo(product,sku);
    list.add(sku);
    });*/

  • 相关阅读:
    投票系统完善
    投票系统设计与实现
    一天天进步
    洛谷P4168 [Violet]蒲公英 题解 数列分块
    LOJ6285. 数列分块入门 9 题解
    洛谷P5340 大中锋的游乐场 题解 分层图最短路
    P1073 [NOIP2009 提高组] 最优贸易 题解 分层图最短路
    洛谷P7297 [USACO21JAN] Telephone G 题解 分层图最短路
    洛谷P1119 灾后重建 题解 Floyd算法
    安装redis 后本地系统空间越来越小
  • 原文地址:https://www.cnblogs.com/huangwentian/p/10526965.html
Copyright © 2020-2023  润新知