商品 规格 编辑

This commit is contained in:
wangw 2024-07-11 16:58:10 +08:00
parent 2ed9bb48ec
commit ed2440d2d5
3 changed files with 9 additions and 3 deletions

View File

@ -121,12 +121,18 @@ public class TbProductSku implements Serializable {
private Long updatedAt;
@Column(name = "`is_del`")
private Integer isDel;
private Integer isDel = 0;
@Column(name = "`is_pause_sale`")
@ApiModelProperty(value = "是否暂停销售")
private Integer isPauseSale = 0;
public void setIsDel(Integer isDel) {
if(isDel!=null){
this.isDel = isDel;
}
}
public void copy(TbProductSku source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}

View File

@ -37,7 +37,7 @@ public interface TbProductSkuRepository extends JpaRepository<TbProductSku, Inte
@Transactional
@Modifying
@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")
TbProductSku searchBarCode(@Param("barCode")String barCode);

View File

@ -480,7 +480,7 @@ public class TbProductServiceImpl implements TbProductService {
List<TbProductSku> tbProductSkus = tbProductSkuRepository.searchSku(resources.getId().toString());
for (TbProductSku productSkus : tbProductSkus) {
if (!collect.contains(productSkus.getId())) {
tbProductSkuRepository.deleteBySkuId(productSkus.getId().toString());
tbProductSkuRepository.deleteBySkuId(productSkus.getId());
}
}
}