1.库存查询接口,sku上下架字段返回

This commit is contained in:
SongZhang 2024-07-23 09:17:14 +08:00
parent f6c8a0c067
commit 89733cdd95
2 changed files with 5 additions and 2 deletions

View File

@ -106,7 +106,8 @@ public interface TbProductSkuRepository extends JpaRepository<TbProductSku, Inte
@Query("SELECT new cn.ysk.cashier.vo.StockV2Vo(" +
"sku.id,pro.id,pro.coverImg,pro.name,unit.name,pro.typeEnum,sku.specSnap,pro.isStock,sku.stockNumber, 1, sku.isPauseSale, false, 0, sku.salePrice" +
"sku.id,pro.id,pro.coverImg,pro.name," +
"unit.name,pro.typeEnum,sku.specSnap,pro.isStock,sku.stockNumber, 1, sku.isPauseSale, false, 0, sku.salePrice, CASE WHEN sku.isGrounding=1 THEN true ELSE false END" +
") " +
"from " +
"TbProductSku sku " +

View File

@ -104,15 +104,17 @@ public class StockV2Vo {
this.salePrice = sellPrice;
}
public StockV2Vo(Integer id, Integer proId,String img,String name,String unitName, String type, String specSnap,
Object isStock, Object number, Integer isDistribute, Integer isPauseSale, boolean isPro, Integer warnLine, BigDecimal sellPrice, boolean isGrounding) {
this.skuId = id;
this.id = id.toString() + "-" + proId.toString();
if (isPro) {
this.id += proId;
} else {
this.id += id;
}
this.skuId = id;
this.proId = proId;
this.img = img;
this.name = name;