...
|
...
|
@@ -751,7 +751,7 @@ public class ProductServiceImpl implements ProductService { |
|
|
|
|
|
|
|
|
// 查询商品的基本信息
|
|
|
public ProductDetailResp queryProductBaseInfo(Integer productId) {
|
|
|
public ProductDetailResp queryProductBaseInfo(Integer productId, Integer uid) {
|
|
|
Product product = productMapper.selectByPrimaryKey(productId);
|
|
|
if (null == product) {
|
|
|
return new ProductDetailResp();
|
...
|
...
|
@@ -763,6 +763,18 @@ public class ProductServiceImpl implements ProductService { |
|
|
productInfo.setSaleTime((product.getSaleTime() == null || product.getSaleTime().equals(0)) ? "0" : DateUtil.getDateString(product.getSaleTime(), DateUtil.YYYY_MM_DD_DOT));
|
|
|
productInfo.setMinPrice(product.getMinPrice());
|
|
|
productInfo.setMaxPrice(product.getMaxPrice());
|
|
|
if (uid != null && uid > 0) {
|
|
|
boolean isLimit = !CollectionUtils.isEmpty(productLimitSaleMapper.selectByProductIdAndUid(productId, null));
|
|
|
if (isLimit) {
|
|
|
ProductLimitSale limitSale = productLimitSaleMapper.selectOneByProductIdAndUid(productId, uid);
|
|
|
if (limitSale != null) {
|
|
|
productInfo.setSellerServiceFeeRate(limitSale.getProfitRate());
|
|
|
} else {
|
|
|
LOGGER.error("该用户" + uid + ",没有商品" + productId + "的发布权限");
|
|
|
productInfo.setSellerCanPublish(false);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
ProductDetailResp productDetailResp = new ProductDetailResp();
|
|
|
productDetailResp.setProduct_info(productInfo);
|
...
|
...
|
|