Пример #1
0
  private double calculateOptionsProgress() {
    Text text = new Text();
    text.setId(propertyId + "_property");
    text.setName("property");

    Text result = sqlSession.getMapper(TextMapper.class).read("Product" + propertyId + "Contents");

    String options = result.getNotes();

    double progress = options.length() < 30 ? options.length() * 100.0 / 30.0 : 100.0;

    return progress * optionsWeightage;
  }