更新商品信息时,删除分享图
This commit is contained in:
@ -143,4 +143,9 @@ public interface YxStoreProductService extends BaseService<YxStoreProduct>{
|
|||||||
*/
|
*/
|
||||||
void insertAndEditYxStoreProduct(StoreProductDto storeProductDto);
|
void insertAndEditYxStoreProduct(StoreProductDto storeProductDto);
|
||||||
|
|
||||||
|
/**+
|
||||||
|
* 删除商品转发海报
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void deleteForwardImg(Long id);
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,6 @@ import java.util.*;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author hupeng
|
* @author hupeng
|
||||||
* @date 2020-05-12
|
* @date 2020-05-12
|
||||||
@ -107,9 +106,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
private YxShippingTemplatesService shippingTemplatesService;
|
private YxShippingTemplatesService shippingTemplatesService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加库存 减少销量
|
* 增加库存 减少销量
|
||||||
|
*
|
||||||
* @param num 数量
|
* @param num 数量
|
||||||
* @param productId 商品id
|
* @param productId 商品id
|
||||||
* @param unique sku唯一值
|
* @param unique sku唯一值
|
||||||
@ -133,6 +132,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 减少库存与增加销量
|
* 减少库存与增加销量
|
||||||
|
*
|
||||||
* @param num 数量
|
* @param num 数量
|
||||||
* @param productId 商品id
|
* @param productId 商品id
|
||||||
* @param unique sku
|
* @param unique sku
|
||||||
@ -165,7 +165,6 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public YxStoreProduct getProductInfo(int id) {
|
public YxStoreProduct getProductInfo(int id) {
|
||||||
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
|
QueryWrapper<YxStoreProduct> wrapper = new QueryWrapper<>();
|
||||||
@ -181,6 +180,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取单个商品
|
* 获取单个商品
|
||||||
|
*
|
||||||
* @param id 商品id
|
* @param id 商品id
|
||||||
* @return YxStoreProductQueryVo
|
* @return YxStoreProductQueryVo
|
||||||
*/
|
*/
|
||||||
@ -192,6 +192,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回普通商品库存
|
* 返回普通商品库存
|
||||||
|
*
|
||||||
* @param productId 商品id
|
* @param productId 商品id
|
||||||
* @param unique sku唯一值
|
* @param unique sku唯一值
|
||||||
* @return int
|
* @return int
|
||||||
@ -218,6 +219,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品列表
|
* 商品列表
|
||||||
|
*
|
||||||
* @param productQueryParam YxStoreProductQueryParam
|
* @param productQueryParam YxStoreProductQueryParam
|
||||||
* @return list
|
* @return list
|
||||||
*/
|
*/
|
||||||
@ -271,6 +273,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品详情
|
* 商品详情
|
||||||
|
*
|
||||||
* @param id 商品id
|
* @param id 商品id
|
||||||
* @param uid 用户id
|
* @param uid 用户id
|
||||||
* @param latitude 纬度
|
* @param latitude 纬度
|
||||||
@ -376,6 +379,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品列表
|
* 商品列表
|
||||||
|
*
|
||||||
* @param page 页码
|
* @param page 页码
|
||||||
* @param limit 条数
|
* @param limit 条数
|
||||||
* @param order ProductEnum
|
* @param order ProductEnum
|
||||||
@ -416,10 +420,6 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//============ 分割线================//
|
//============ 分割线================//
|
||||||
|
|
||||||
|
|
||||||
@ -490,10 +490,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品上架下架
|
* 商品上架下架
|
||||||
|
*
|
||||||
* @param id 商品id
|
* @param id 商品id
|
||||||
* @param status ShopCommonEnum
|
* @param status ShopCommonEnum
|
||||||
*/
|
*/
|
||||||
@ -508,14 +507,13 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增/保存商品
|
* 新增/保存商品
|
||||||
|
*
|
||||||
* @param storeProductDto 商品
|
* @param storeProductDto 商品
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void insertAndEditYxStoreProduct(StoreProductDto storeProductDto)
|
public void insertAndEditYxStoreProduct(StoreProductDto storeProductDto) {
|
||||||
{
|
|
||||||
|
|
||||||
ProductResultDto resultDTO = this.computedProduct(storeProductDto.getAttrs());
|
ProductResultDto resultDTO = this.computedProduct(storeProductDto.getAttrs());
|
||||||
|
|
||||||
@ -532,7 +530,10 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
yxStoreProduct.setStock(resultDTO.getStock());
|
yxStoreProduct.setStock(resultDTO.getStock());
|
||||||
yxStoreProduct.setSliderImage(String.join(",", storeProductDto.getSliderImage()));
|
yxStoreProduct.setSliderImage(String.join(",", storeProductDto.getSliderImage()));
|
||||||
|
|
||||||
|
if (storeProductDto.getId() != null) {
|
||||||
|
//清空商品转发图
|
||||||
|
deleteForwardImg(storeProductDto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
this.saveOrUpdate(yxStoreProduct);
|
this.saveOrUpdate(yxStoreProduct);
|
||||||
|
|
||||||
@ -559,15 +560,12 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取生成的属性
|
* 获取生成的属性
|
||||||
|
*
|
||||||
* @param id 商品id
|
* @param id 商品id
|
||||||
* @param jsonStr jsonStr
|
* @param jsonStr jsonStr
|
||||||
* @return map
|
* @return map
|
||||||
@ -585,7 +583,6 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<FromatDetailDto> fromatDetailDTOList = JSON.parseArray(jsonObject.get("attrs").toString(),
|
List<FromatDetailDto> fromatDetailDTOList = JSON.parseArray(jsonObject.get("attrs").toString(),
|
||||||
FromatDetailDto.class);
|
FromatDetailDto.class);
|
||||||
|
|
||||||
@ -690,12 +687,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算产品数据
|
* 计算产品数据
|
||||||
|
*
|
||||||
* @param attrs attrs
|
* @param attrs attrs
|
||||||
* @return ProductResultDto
|
* @return ProductResultDto
|
||||||
*/
|
*/
|
||||||
@ -739,6 +733,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* mapTobean
|
* mapTobean
|
||||||
|
*
|
||||||
* @param listMap listMap
|
* @param listMap listMap
|
||||||
* @return list
|
* @return list
|
||||||
*/
|
*/
|
||||||
@ -753,6 +748,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加表头
|
* 增加表头
|
||||||
|
*
|
||||||
* @param headerMap headerMap
|
* @param headerMap headerMap
|
||||||
* @param headerMapList headerMapList
|
* @param headerMapList headerMapList
|
||||||
* @param align align
|
* @param align align
|
||||||
@ -840,6 +836,7 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 组合规则属性算法
|
* 组合规则属性算法
|
||||||
|
*
|
||||||
* @param fromatDetailDTOList
|
* @param fromatDetailDTOList
|
||||||
* @return DetailDto
|
* @return DetailDto
|
||||||
*/
|
*/
|
||||||
@ -925,4 +922,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
|
|||||||
return detailDto;
|
return detailDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteForwardImg(Long id) {
|
||||||
|
baseMapper.deleteForwardImg(id, "_product_detail_wap");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ package co.yixiang.modules.product.service.mapper;
|
|||||||
|
|
||||||
import co.yixiang.common.mapper.CoreMapper;
|
import co.yixiang.common.mapper.CoreMapper;
|
||||||
import co.yixiang.modules.product.domain.YxStoreProduct;
|
import co.yixiang.modules.product.domain.YxStoreProduct;
|
||||||
|
import org.apache.ibatis.annotations.Delete;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Update;
|
import org.apache.ibatis.annotations.Update;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@ -96,4 +97,7 @@ public interface StoreProductMapper extends CoreMapper<YxStoreProduct> {
|
|||||||
@Update("update yx_store_product set browse=browse+1 " +
|
@Update("update yx_store_product set browse=browse+1 " +
|
||||||
"where id=#{productId}")
|
"where id=#{productId}")
|
||||||
int incBrowseNum(@Param("productId") Long productId);
|
int incBrowseNum(@Param("productId") Long productId);
|
||||||
|
|
||||||
|
@Delete("DELETE from yx_system_attachment where name like CONCAT(#{id},'_%',#{name}, '%')")
|
||||||
|
void deleteForwardImg(@Param("id") Long id,@Param("name") String name);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user