商品 规格 编辑
This commit is contained in:
@@ -121,12 +121,18 @@ public class TbProductSku implements Serializable {
|
|||||||
private Long updatedAt;
|
private Long updatedAt;
|
||||||
|
|
||||||
@Column(name = "`is_del`")
|
@Column(name = "`is_del`")
|
||||||
private Integer isDel;
|
private Integer isDel = 0;
|
||||||
|
|
||||||
@Column(name = "`is_pause_sale`")
|
@Column(name = "`is_pause_sale`")
|
||||||
@ApiModelProperty(value = "是否暂停销售")
|
@ApiModelProperty(value = "是否暂停销售")
|
||||||
private Integer isPauseSale = 0;
|
private Integer isPauseSale = 0;
|
||||||
|
|
||||||
|
public void setIsDel(Integer isDel) {
|
||||||
|
if(isDel!=null){
|
||||||
|
this.isDel = isDel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void copy(TbProductSku source){
|
public void copy(TbProductSku source){
|
||||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public interface TbProductSkuRepository extends JpaRepository<TbProductSku, Inte
|
|||||||
@Transactional
|
@Transactional
|
||||||
@Modifying
|
@Modifying
|
||||||
@Query("update FROM TbProductSku sku set sku.isDel=1 WHERE sku.id = :skuId")
|
@Query("update FROM TbProductSku sku set sku.isDel=1 WHERE sku.id = :skuId")
|
||||||
Integer deleteBySkuId(@Param("skuId") String skuId);
|
Integer deleteBySkuId(@Param("skuId") Integer skuId);
|
||||||
|
|
||||||
@Query("SELECT sku FROM TbProductSku sku WHERE sku.barCode = :barCode and sku.isDel=0")
|
@Query("SELECT sku FROM TbProductSku sku WHERE sku.barCode = :barCode and sku.isDel=0")
|
||||||
TbProductSku searchBarCode(@Param("barCode")String barCode);
|
TbProductSku searchBarCode(@Param("barCode")String barCode);
|
||||||
|
|||||||
@@ -480,7 +480,7 @@ public class TbProductServiceImpl implements TbProductService {
|
|||||||
List<TbProductSku> tbProductSkus = tbProductSkuRepository.searchSku(resources.getId().toString());
|
List<TbProductSku> tbProductSkus = tbProductSkuRepository.searchSku(resources.getId().toString());
|
||||||
for (TbProductSku productSkus : tbProductSkus) {
|
for (TbProductSku productSkus : tbProductSkus) {
|
||||||
if (!collect.contains(productSkus.getId())) {
|
if (!collect.contains(productSkus.getId())) {
|
||||||
tbProductSkuRepository.deleteBySkuId(productSkus.getId().toString());
|
tbProductSkuRepository.deleteBySkuId(productSkus.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user