final ProductMarketing product = productService.getProductMarketingByCode(productCode);
final Customer customer = requestData.getCustomer();
if (qualityOfService != 0) {
ProductMarketingCustomerRate productCustomerRate = new ProductMarketingCustomerRate();
productCustomerRate.setRate(qualityOfService);
productCustomerRate.setProductMarketingId(product.getId());
productCustomerRate.setCustomerId(customer.getId());
productCustomerRate.setType(Constants.PRODUCT_QUALITY_RATING_TYPE);
productService.saveOrUpdateProductMarketingCustomerRate(productCustomerRate);
}
if (ratioQualityPrice != 0) {
ProductMarketingCustomerRate productCustomerRate = new ProductMarketingCustomerRate();
productCustomerRate.setRate(ratioQualityPrice);
productCustomerRate.setProductMarketingId(product.getId());
productCustomerRate.setCustomerId(customer.getId());
productCustomerRate.setType(Constants.PRODUCT_PRICE_RATING_TYPE);
productService.saveOrUpdateProductMarketingCustomerRate(productCustomerRate);
}
if (priceScore != 0) {
ProductMarketingCustomerRate productCustomerRate = new ProductMarketingCustomerRate();
productCustomerRate.setRate(priceScore);
productCustomerRate.setProductMarketingId(product.getId());
productCustomerRate.setCustomerId(customer.getId());
productCustomerRate.setType(Constants.PRODUCT_VALUE_RATING_TYPE);
productService.saveOrUpdateProductMarketingCustomerRate(productCustomerRate);
}
if (StringUtils.isNotEmpty(productCommentForm.getComment())) {
ProductMarketingCustomerComment productCustomerComment = new ProductMarketingCustomerComment();