Authored by caoyan

UFO比价

... ... @@ -44,7 +44,7 @@
from storage
</select>
<select id="selectByGoodsId" resultMap="BaseResultMap">
select id, product_id, goods_id, size_id, storage_num, update_time, create_time
select id, product_id, goods_id, size_id, storage_num, update_time, create_time, suggest_low_price, suggest_high_price
from storage where goods_id = #{goodsId,jdbcType=INTEGER}
</select>
<select id="selectByGoodsIdList" resultMap="BaseResultMap">
... ...
... ... @@ -18,6 +18,7 @@ import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohobuy.ufo.model.request.product.ProductRequestBatchBo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
... ... @@ -287,6 +288,17 @@ public class ProductServiceImpl implements IProductService, ApplicationContextAw
if (CollectionUtils.isNotEmpty(storages)) {
bo.setStorageIdList(CollectionUtil.map(storages, Storage::getId));
bo.setSizeIdList(CollectionUtil.map(storages, Storage::getSizeId));
List<BigDecimal> suggestLowPriceList = CollectionUtil.map(storages, Storage::getSuggestLowPrice);
List<BigDecimal> suggestHighPriceList = CollectionUtil.map(storages, Storage::getSuggestHighPrice);
List<String> suggestPriceList = Lists.newArrayList();
for(int i=0; i<bo.getStorageIdList().size(); i++) {
String suggestPrice = "-";
if(null != suggestLowPriceList.get(i) && null != suggestHighPriceList.get(i)) {
suggestPrice = String.format("%d", suggestLowPriceList.get(i).intValue()) + " ~ " + String.format("%d", suggestHighPriceList.get(i).intValue());
}
suggestPriceList.add(suggestPrice);
}
bo.setSuggestPriceList(suggestPriceList);
}
return new ApiResponse<ProductEditResponceBo>(bo);
}
... ...
... ... @@ -369,6 +369,11 @@
field: "sku",
width: 80,
align: "center"
},{
title: "平台建议售价",
field: "suggestPrice",
width: 80,
align: "center"
}]],
cache: false,
pagination: false,
... ... @@ -489,7 +494,8 @@
colorName: colorName,
goodsName: colorName,
size: '',
sku: '-'
sku: '-',
suggestPrice: '-'
});
}
... ... @@ -526,7 +532,8 @@
colorName: colorName,
goodsName: goodsName,
size: $(item).parent().text(),
sku: '-'
sku: '-',
suggestPrice: '-'
});
});
... ... @@ -535,7 +542,8 @@
colorName: colorName,
goodsName: goodsName,
size: '',
sku: '-'
sku: '-',
suggestPrice:'-'
});
}
that.mergeCells();
... ... @@ -761,7 +769,8 @@
colorName: $('.group-color li[data-id='+that.detailData.colorId+']').text(),
goodsName: that.detailData.goodsName,
size: $('.group-size label[data-id=' + item + ']').text(),
sku: that.detailData.storageIdList[i]
sku: that.detailData.storageIdList[i],
suggestPrice: that.detailData.suggestPriceList[i]
});
}
}
... ...