@Test public void testToJson() throws Exception { }
public JSONArray toJson(HashMap<String, List<HashMap>> hashMap){ JSONArray returnArray = new JSONArray(); for (Map.Entry<String, List<HashMap>> entry : hashMap.entrySet()) { JSONObject jsonObject = new JSONObject(); jsonObject.put("name", entry.getKey()); jsonObject.put("newName", ""); jsonObject.put("medicines", entry.getValue()); returnArray.add(jsonObject); } return returnArray; }
RecipeTemplateManagementServiceImpl implements RecipeTemplateManagementService { public JSONArray toJson(HashMap<String, List<HashMap>> hashMap){ JSONArray returnArray = new JSONArray(); for (Map.Entry<String, List<HashMap>> entry : hashMap.entrySet()) { JSONObject jsonObject = new JSONObject(); jsonObject.put("name", entry.getKey()); jsonObject.put("newName", ""); jsonObject.put("medicines", entry.getValue()); returnArray.add(jsonObject); } return returnArray; } }
RecipeTemplateManagementServiceImpl implements RecipeTemplateManagementService { public JSONArray toJson(HashMap<String, List<HashMap>> hashMap){ JSONArray returnArray = new JSONArray(); for (Map.Entry<String, List<HashMap>> entry : hashMap.entrySet()) { JSONObject jsonObject = new JSONObject(); jsonObject.put("name", entry.getKey()); jsonObject.put("newName", ""); jsonObject.put("medicines", entry.getValue()); returnArray.add(jsonObject); } return returnArray; }  }
RecipeTemplateManagementServiceImpl implements RecipeTemplateManagementService { public JSONArray toJson(HashMap<String, List<HashMap>> hashMap){ JSONArray returnArray = new JSONArray(); for (Map.Entry<String, List<HashMap>> entry : hashMap.entrySet()) { JSONObject jsonObject = new JSONObject(); jsonObject.put("name", entry.getKey()); jsonObject.put("newName", ""); jsonObject.put("medicines", entry.getValue()); returnArray.add(jsonObject); } return returnArray; }  @Override CommonResult insertRecipeTemplate(RecipeTemplateParam recipeTemplateParam); @Override CommonResult deleteRecipeTemplate(Integer roleId, String recipeName); @Override CommonResult listRecipeTemplate(Integer roleId, Integer type); CommonResult modifyRecipeTemplate(RecipeTemplateParam recipeTemplateParam); JSONArray toJson(HashMap<String, List<HashMap>> hashMap); }
RecipeTemplateManagementServiceImpl implements RecipeTemplateManagementService { public JSONArray toJson(HashMap<String, List<HashMap>> hashMap){ JSONArray returnArray = new JSONArray(); for (Map.Entry<String, List<HashMap>> entry : hashMap.entrySet()) { JSONObject jsonObject = new JSONObject(); jsonObject.put("name", entry.getKey()); jsonObject.put("newName", ""); jsonObject.put("medicines", entry.getValue()); returnArray.add(jsonObject); } return returnArray; }  @Override CommonResult insertRecipeTemplate(RecipeTemplateParam recipeTemplateParam); @Override CommonResult deleteRecipeTemplate(Integer roleId, String recipeName); @Override CommonResult listRecipeTemplate(Integer roleId, Integer type); CommonResult modifyRecipeTemplate(RecipeTemplateParam recipeTemplateParam); JSONArray toJson(HashMap<String, List<HashMap>> hashMap);  }