快捷修改接口 价格问题
This commit is contained in:
parent
551104543d
commit
8208f97c67
|
|
@ -205,4 +205,8 @@ public interface TbProductSkuRepository extends JpaRepository<TbProductSku, Inte
|
||||||
@Modifying
|
@Modifying
|
||||||
@Query("update TbProductSku set isGrounding=:isGrounding where id=:skuId")
|
@Query("update TbProductSku set isGrounding=:isGrounding where id=:skuId")
|
||||||
void updateGrounding(Integer skuId,int isGrounding);
|
void updateGrounding(Integer skuId,int isGrounding);
|
||||||
|
|
||||||
|
@Modifying
|
||||||
|
@Query("update TbProductSku set salePrice = :salePrice where productId=:productId")
|
||||||
|
void upSalePrice(@Param("productId") Integer productId, @Param("lowPrice") BigDecimal salePrice);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -379,6 +379,12 @@ public class StockServiceImpl implements StockService {
|
||||||
description.append(" 库存数量修改为:"+updateValueVO.getValue()+" 原库存:"+product.getStockNumber());
|
description.append(" 库存数量修改为:"+updateValueVO.getValue()+" 原库存:"+product.getStockNumber());
|
||||||
sqlQuery.append(" set stock_number = ").append(updateValueVO.getValue());
|
sqlQuery.append(" set stock_number = ").append(updateValueVO.getValue());
|
||||||
break;
|
break;
|
||||||
|
case "salePrice"://价格
|
||||||
|
description.append("修改价格为" + updateValueVO.getValue());
|
||||||
|
sqlQuery.append(" set low_price = ").append(updateValueVO.getValue());
|
||||||
|
tbProductRepository.upLowPrice(product.getId(),new BigDecimal(updateValueVO.getValue()));
|
||||||
|
tbProductSkuRepository.upSalePrice(product.getId(),new BigDecimal(updateValueVO.getValue()));
|
||||||
|
break;
|
||||||
// case "stock"://库存开关
|
// case "stock"://库存开关
|
||||||
// if (!"0".equals(updateValueVO.getValue()) && !"1".equals(updateValueVO.getValue())) {
|
// if (!"0".equals(updateValueVO.getValue()) && !"1".equals(updateValueVO.getValue())) {
|
||||||
// throw new BadRequestException("无效值");
|
// throw new BadRequestException("无效值");
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ public class StockUpdateValueVO {
|
||||||
private String shopId;
|
private String shopId;
|
||||||
@NotNull
|
@NotNull
|
||||||
private boolean isSku;
|
private boolean isSku;
|
||||||
@NotNull(message = "主键不可为空")
|
// @NotNull(message = "主键不可为空")
|
||||||
private String id;
|
private String id;
|
||||||
@NotNull(message = "key不可为空")
|
@NotNull(message = "key不可为空")
|
||||||
private String key;
|
private String key;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue