// 保存文件
String saveName = ServletActionContext.getServletContext()
.getRealPath(path) + File.separator + uuidName;
ImageUtil.thumbnails(logo[i], new File(saveName), 70);
// 更新餐厅LogoUrl
Restaurant restaurant = restaurantService.findById(id);
String oldLogoPath = ServletActionContext.getServletContext()
.getRealPath(restaurant.getLogoUrl());
File oldLogoFile = new File(oldLogoPath == null ? "" : oldLogoPath);
if (oldLogoFile.exists())
{
oldLogoFile.delete();
}
restaurant.setLogoUrl(path + "/" + uuidName);
restaurantService.update(restaurant);
}
}
else
{