Exemplo n.º 1
0
  @Override
  public Serializable addARedFormula(String name, String formulaValue, String desc) {

    RedFormula rFormula = new RedFormula();
    rFormula.setDesc(desc);
    rFormula.setName(name);
    rFormula.setValue(formulaValue);

    return getBaseDao().add(rFormula);
  }
Exemplo n.º 2
0
  @Override
  public void initAllRedFormula() throws IOException {

    // 从开奖记录文件中获取开奖记录集合
    List<String> strRecords = FileUtil.readLineFile(USERHOME + RED_FORMULA_FILE);

    List<BaseEntity> records = new ArrayList<BaseEntity>();

    int index = 1;
    for (String str : strRecords) {

      RedFormula rFormula = new RedFormula();
      rFormula.setDesc("");
      rFormula.setName("formula" + index);
      rFormula.setValue(str.trim());

      records.add(rFormula);
      index++;
    }

    // 保存所有开奖记录
    getBaseDao().batchAddBaseEntityes(records);
  }