商品列表角标

This commit is contained in:
yijiegong 2024-08-22 09:56:19 +08:00
parent 2ae71952de
commit 1a968775ff
4 changed files with 7 additions and 5 deletions

View File

@ -77,11 +77,12 @@ public class ProductController {
@RequestParam("categoryId") String categoryId,
@RequestParam("commdityName") String commdityName,
@RequestParam("masterId") String masterId,
@RequestParam("tableId") String tableId,
@RequestParam("page") int page,
@RequestParam("pageSize") int pageSize
){
return productService.queryNewCommodityInfo(shopId,categoryId,commdityName,page,pageSize,masterId);
return productService.queryNewCommodityInfo(shopId,categoryId,commdityName, tableId,page,pageSize,masterId);
}
@GetMapping(value = "queryCategory")

View File

@ -40,7 +40,7 @@ public interface TbProductMapper {
Integer countOrderByshopIdAndProductId(@Param("shopId") String shopId, @Param("productId") String productId, @Param("masterId") String masterId,@Param("day") String day);
Integer countOrderByshopIdAndProductId(@Param("shopId") String shopId, @Param("productId") String productId, @Param("masterId") String masterId,@Param("day") String day, @Param("tableId") String tableId);
void updateStockById(@Param("productId")Integer productId, @Param("num")Integer num);

View File

@ -81,7 +81,7 @@ public class ProductService {
String day = DateUtils.getDay();
if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){
tbProductWithBLOBs.parallelStream().forEach(it->{
Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day);
Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, "");
it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount);
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
if(ObjectUtil.isEmpty(tbProductSpec)){
@ -110,7 +110,7 @@ public class ProductService {
}
public Result queryNewCommodityInfo(String shopId, String categoryId, String commdityName, int page, int pageSize, String masterId) {
public Result queryNewCommodityInfo(String shopId, String categoryId, String commdityName, String tableId, int page, int pageSize, String masterId) {
List<TbProductWithBLOBs> tbProductWithBLOBs=null;
PageHelperUtil.startPage(page,pageSize);
if(ObjectUtil.isEmpty(categoryId)){
@ -126,7 +126,7 @@ public class ProductService {
String day = DateUtils.getDay();
if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){
tbProductWithBLOBs.parallelStream().forEach(it->{
Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day);
Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, tableId);
it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount);
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
if(ObjectUtil.isEmpty(tbProductSpec)){

View File

@ -962,6 +962,7 @@
AND product_id = #{productId}
AND `status` = 'create'
and master_id = #{masterId}
and table_id = #{tableId}
and trade_day = #{day}
group by shop_id,product_id
</select>