lid = Long.parseLong(id);
} catch (Exception e1) {
lid = -1;
}
Product product = gatewayService.findProductById(lid);
if(product!=null) {
root.put("product", product);
root.put("Product_List_Url", Constants.PRODUCT_LIST_URL);
List<Brand> brands = gatewayService.findBrand();
if(brands!=null&&brands.size()>0) {
root.put("brands", brands);
}
List<ProductProperty> colorSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYCOLOR);
if(colorSelect!=null&&colorSelect.size()>0) {
root.put("colorSelect", colorSelect);
}
List<ProductProperty> coltheSizeSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYCLOTHESIZE);
if(coltheSizeSelect!=null&&coltheSizeSelect.size()>0) {
root.put("coltheSizeSelect", coltheSizeSelect);
}
List<ProductProperty> shoeSizeSelect = gatewayService.findProductPropertyByCategoryId(Constants.PROPERTYSHOESIZE);
if(shoeSizeSelect!=null&&shoeSizeSelect.size()>0) {
root.put("shoeSizeSelect", shoeSizeSelect);
}
List<FareWay> farewaySelect = gatewayService.findFare();
if(farewaySelect!=null&&farewaySelect.size()>0) {
root.put("farewaySelect", farewaySelect);
}
List<IPObject> iPObjects = gatewayService.findAllIPObject();
root.put("iPObjects", iPObjects);
String color = product.getColor();
String[] colors = color.split(";");
Map<String, String> colorMap = new HashMap<String, String>();
for(int i=0;i<colors.length;i++) {
colorMap.put(colors[i], colors[i]);
}
root.put("colorMap", colorMap);
String clothesize = product.getClothessize();
String[] clothesizes = clothesize.split(";");
Map<String, String> clothesizeMap = new HashMap<String, String>();
for(int i=0;i<clothesizes.length;i++) {
clothesizeMap.put(clothesizes[i], clothesizes[i]);
}
root.put("clothesizeMap", clothesizeMap);
String shoesize = product.getShoesize();
String[] shoesizes = shoesize.split(";");
Map<String, String> shoesizeMap = new HashMap<String, String>();
for(int i=0;i<shoesizes.length;i++) {
shoesizeMap.put(shoesizes[i], shoesizes[i]);
}
root.put("shoesizeMap", shoesizeMap);
String fareway = product.getFareway();
String[] fareways = fareway.split(";");
Map<String, String> farewayMap = new HashMap<String, String>();
for(int i=0;i<fareways.length;i++) {
farewayMap.put(fareways[i], fareways[i]);
}