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);
});*/json

相關文章
相關標籤/搜索