Ejemplo n.º 1
0
  private List<Map<String, Object>> registerToJSON(
      Map<ArrayList<RegisterKey>, Double> register, Long languageId, Long[] paramList) {

    List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
    for (Map.Entry<ArrayList<RegisterKey>, Double> entry : register.entrySet()) {
      Map<String, Object> map = new HashMap<String, Object>();

      for (RegisterKey key : entry.getKey()) {
        if (key.getParameterId() == -1) {
          map.put("olUOMId", key.getUomId());
          map.put(
              "olUOMName",
              unitOfMeasurementNameRepository.getShortName(key.getUomId(), languageId));
        } else {
          map.put("F" + key.getParameterId(), key.getParameterValue());
          map.put("FUOM" + key.getParameterId(), key.getUomId());
          map.put(
              "FVD" + key.getParameterId(),
              key.getParameterValue() + ((key.getUomId() != null) ? " " + key.getUomName() : ""));
        }
      }

      map.put("qnty", entry.getValue());
      result.add(map);
    }
    return result;
  }
Ejemplo n.º 2
0
 private void printRegister(Map<ArrayList<RegisterKey>, Double> register) {
   logger.debug("Register --------------");
   for (Map.Entry<ArrayList<RegisterKey>, Double> entry : register.entrySet()) {
     String str = "KEY:";
     for (RegisterKey par : entry.getKey()) {
       str += ":" + par.getParameterId() + "-" + par.getParameterValue() + " " + par.getUomName();
     }
     logger.debug(str + "->" + entry.getValue() + ":HASH:" + entry.hashCode());
   }
 }