Authored by chenchao

Merge branch 'test6.9.10' of http://git.yoho.cn/ufo/yohoufo-fore into test6.9.10

... ... @@ -870,4 +870,15 @@ public class ProductController {
LOG.info("in ufo.product.createSeek2BuyStorage req {}", seekToBuyStorageBo);
return seekToBuyStorageService.createSeek2BuyStorage(seekToBuyStorageBo);
}
@ApiOperation(name = "ufo.product.info.data", desc = "skn信息")
@RequestMapping(params = "method=ufo.product.info.data")
public ProductInfo queryProductInfo(@RequestParam(value = "product_id") Integer productId) {
if (productId == null) {
LOG.info("in method=ufo.product.info.data productId Is Null");
return null;
}
LOG.info("in method=ufo.product.info.data productId = {}", productId);
return productService.queryProductInfo(productId);
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,7 @@ import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.dal.datasource.annotation.Database;
import com.yohobuy.ufo.model.ProductInfo;
import com.yohobuy.ufo.model.request.StoragePriceBo;
import com.yohobuy.ufo.model.response.ProductDetailResp;
import com.yohobuy.ufo.model.response.StorageInfoResp;
... ... @@ -115,4 +116,11 @@ public interface ProductService {
ModelAndView queryProductIntro(Integer productId);
List<JSONObject> queryOtherSizeList(Integer productId, Integer goodsId);
/**
* 根据编码查询货号 名称 和图片
* @param productId
* @return
*/
ProductInfo queryProductInfo(Integer productId);
}
... ...
... ... @@ -1897,4 +1897,28 @@ public class ProductServiceImpl implements ProductService {
ProductProfit productProfit = productProfitMapper.selectByProductId(productId);
return null == productProfit ? null : productProfit.getProfitRate();
}
/**
* 根据编码查询货号 名称 和图片
* @param productId
* @return
*/
public ProductInfo queryProductInfo(Integer productId) {
ProductInfo resp = new ProductInfo();
Product product = productMapper.selectByPrimaryKey(productId);
if (product != null) {
resp.setProductId(product.getId());
resp.setProductName(product.getProductName());
resp.setProductCode(product.getProductCode());
}
List<Goods> goods = goodsMapper.selectByProductIds(Lists.newArrayList(productId));
if (org.apache.commons.collections.CollectionUtils.isNotEmpty(goods)) {
resp.setColorImage(goods.get(0).getColorImage());
}
return resp;
}
}
... ...