商品列表角标
This commit is contained in:
@@ -77,11 +77,12 @@ public class ProductController {
|
|||||||
@RequestParam("categoryId") String categoryId,
|
@RequestParam("categoryId") String categoryId,
|
||||||
@RequestParam("commdityName") String commdityName,
|
@RequestParam("commdityName") String commdityName,
|
||||||
@RequestParam("masterId") String masterId,
|
@RequestParam("masterId") String masterId,
|
||||||
|
@RequestParam("tableId") String tableId,
|
||||||
@RequestParam("page") int page,
|
@RequestParam("page") int page,
|
||||||
@RequestParam("pageSize") int pageSize
|
@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")
|
@GetMapping(value = "queryCategory")
|
||||||
|
|||||||
@@ -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);
|
void updateStockById(@Param("productId")Integer productId, @Param("num")Integer num);
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class ProductService {
|
|||||||
String day = DateUtils.getDay();
|
String day = DateUtils.getDay();
|
||||||
if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){
|
if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){
|
||||||
tbProductWithBLOBs.parallelStream().forEach(it->{
|
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);
|
it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount);
|
||||||
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
|
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
|
||||||
if(ObjectUtil.isEmpty(tbProductSpec)){
|
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;
|
List<TbProductWithBLOBs> tbProductWithBLOBs=null;
|
||||||
PageHelperUtil.startPage(page,pageSize);
|
PageHelperUtil.startPage(page,pageSize);
|
||||||
if(ObjectUtil.isEmpty(categoryId)){
|
if(ObjectUtil.isEmpty(categoryId)){
|
||||||
@@ -126,7 +126,7 @@ public class ProductService {
|
|||||||
String day = DateUtils.getDay();
|
String day = DateUtils.getDay();
|
||||||
if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){
|
if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){
|
||||||
tbProductWithBLOBs.parallelStream().forEach(it->{
|
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);
|
it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount);
|
||||||
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
|
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
|
||||||
if(ObjectUtil.isEmpty(tbProductSpec)){
|
if(ObjectUtil.isEmpty(tbProductSpec)){
|
||||||
|
|||||||
@@ -962,6 +962,7 @@
|
|||||||
AND product_id = #{productId}
|
AND product_id = #{productId}
|
||||||
AND `status` = 'create'
|
AND `status` = 'create'
|
||||||
and master_id = #{masterId}
|
and master_id = #{masterId}
|
||||||
|
and table_id = #{tableId}
|
||||||
and trade_day = #{day}
|
and trade_day = #{day}
|
||||||
group by shop_id,product_id
|
group by shop_id,product_id
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user