/**
  * 存储单个对象YandeCG
  *
  * @author felixerio *
  */
 @Override
 public void saveYandeCG(YandeCG yandeCG) {
   System.out.println("查询ID:" + yandeCG.getId());
   DBObject dBObject = collection.findOne(new BasicDBObject("id", yandeCG.getId()));
   if (null == dBObject) {
     DBObject mongoYandeCG = new BasicDBObject();
     mongoYandeCG.put("_id", yandeCG.getMd5());
     mongoYandeCG.put("id", yandeCG.getId());
     mongoYandeCG.put("md5", yandeCG.getMd5());
     mongoYandeCG.put("downComplete", Boolean.FALSE);
     mongoYandeCG.put("tags", yandeCG.getTags());
     mongoYandeCG.put("source", yandeCG.getSource());
     mongoYandeCG.put("file_url", yandeCG.getFile_url());
     mongoYandeCG.put("file_size", yandeCG.getFile_size());
     mongoYandeCG.put("local_url", yandeCG.getLocal_url());
     collection.save(mongoYandeCG);
   } else {
     System.out.println("数据已经存在 将略过此次存储 ID:" + yandeCG.getId());
   }
 }
 /**
  * 存储YandeCG List文件
  *
  * @author felixerio *
  */
 @Override
 public void saveListYandeCG(List<YandeCG> yandeCGList) {
   int num = yandeCGList.size();
   for (int i = 0; i < num; i++) {
     logger.info("批量保存任务 正在处理第 " + i + " 个任务");
     YandeCG yandeCG = new YandeCG();
     yandeCG = yandeCGList.get(i);
     DBObject mongoYandeCG = new BasicDBObject();
     mongoYandeCG.put("_id", yandeCG.getMd5());
     mongoYandeCG.put("id", yandeCG.getId());
     mongoYandeCG.put("md5", yandeCG.getMd5());
     mongoYandeCG.put("downComplete", yandeCG.isDownComplete());
     mongoYandeCG.put("tags", yandeCG.getTags());
     mongoYandeCG.put("source", yandeCG.getSource());
     mongoYandeCG.put("file_url", yandeCG.getFile_url());
     mongoYandeCG.put("file_size", yandeCG.getFile_size());
     mongoYandeCG.put("local_url", yandeCG.getLocal_url());
     logger.info("批量保存任务 完成处理第 " + i + " 个任务");
     logger.info(collection.save(mongoYandeCG).getN());
   }
   mg.close();
 }