...
|
...
|
@@ -253,8 +253,8 @@ public class ProductServiceImpl implements IProductService { |
|
|
ProductEditResponceBo bo = new ProductEditResponceBo();
|
|
|
BeanUtils.copyProperties(product, bo);
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
bo.setSaleTime(sdf.format((product.getSaleTime() == null || product.getSaleTime() == 0) ? ""
|
|
|
: sdf.format(product.getSaleTime() * 1000L)));
|
|
|
bo.setSaleTime((product.getSaleTime() == null || product.getSaleTime() == 0) ? ""
|
|
|
: sdf.format(product.getSaleTime() * 1000L));
|
|
|
bo.setGender(new Integer(product.getGender()));
|
|
|
bo.setMinPrice(product.getMinPrice().toString());
|
|
|
bo.setMaxPrice(product.getMaxPrice().toString());
|
...
|
...
|
@@ -385,12 +385,13 @@ public static void main(String[] args) { |
|
|
bo.getSkup(),
|
|
|
bo.getStart(),
|
|
|
bo.getRows());
|
|
|
List<Integer> productIdList = CollectionUtil.distinct(productList, Product::getId);
|
|
|
productList = productMapper.selectProductListByIds(productIdList);
|
|
|
productList.forEach(p -> {
|
|
|
ProductResponceBo b = new ProductResponceBo();
|
|
|
BeanUtils.copyProperties(p, b);
|
|
|
boList.add(b);
|
|
|
});
|
|
|
List<Integer> productIdList = CollectionUtil.distinct(productList, Product::getId);
|
|
|
List<Goods> goodsList = goodsMapper.selectByProductId(productIdList);
|
|
|
Map<Integer, Goods> goodsMap = CollectionUtil.extractMap(goodsList, Goods::getProductId);
|
|
|
List<Brand> brandList = brandMapper.selectBrandByIdList(CollectionUtil.distinct(productList, Product::getBrandId));
|
...
|
...
|
@@ -463,7 +464,7 @@ public static void main(String[] args) { |
|
|
bo.getStorageId(),
|
|
|
bo.getStart(),
|
|
|
bo.getRows());
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
storagePrice.forEach(sp -> {
|
|
|
ProductResponceBo b = new ProductResponceBo();
|
|
|
b.setSkup(sp.getSkup());
|
...
|
...
|
@@ -498,6 +499,9 @@ public static void main(String[] args) { |
|
|
|
|
|
@Override
|
|
|
public ApiResponse<Void> changeProductStatus(ProductRequestBo bo) {
|
|
|
if (bo.getStatus() == null || (bo.getStatus() != 1 && bo.getStatus() != 0)) {
|
|
|
return new ApiResponse<>(400, "上下架状态错误");
|
|
|
}
|
|
|
Product product = productMapper.selectByPrimaryKey(bo.getId());
|
|
|
if (product == null) {
|
|
|
return new ApiResponse<>(400, "商品不存在");
|
...
|
...
|
|