商品类型

This commit is contained in:
2025-12-10 14:28:59 +08:00
parent fe9b5ba57f
commit 1d896d30ef
5 changed files with 12 additions and 8 deletions

View File

@@ -39,8 +39,9 @@ public class UPointGoodsController {
@GetMapping("/page")
public CzgResult<Page<MkPointsGoods>> getPointsGoodsSettingPage(@RequestParam(defaultValue = "1", required = false) Integer page,
@RequestParam(defaultValue = "10", required = false) Integer size,
@RequestParam(required = false) String goodsCategory,
Long shopId) {
Page<MkPointsGoods> data = pointsGoodsService.getPointsGoodsPageByUser(page, size, shopId, StpKit.USER.getLoginIdAsLong());
Page<MkPointsGoods> data = pointsGoodsService.getPointsGoodsPageByUser(page, size, shopId, goodsCategory, StpKit.USER.getLoginIdAsLong());
return CzgResult.success(data);
}

View File

@@ -17,7 +17,7 @@ public interface MkPointsGoodsService extends IService<MkPointsGoods> {
Page<MkPointsGoods> getPointsGoodsPage(BaseQueryParam param, Long shopId);
Page<MkPointsGoods> getPointsGoodsPageByUser(Integer page, Integer size, Long shopId, Long userId);
Page<MkPointsGoods> getPointsGoodsPageByUser(Integer page, Integer size, Long shopId, String goodsCategory, Long userId);
Page<MkPointsGoodsRecord> getGoodsRecordPage(Integer page, Integer size, Long shopId, Long userId);
@@ -29,9 +29,9 @@ public interface MkPointsGoodsService extends IService<MkPointsGoods> {
/**
* 更新商品数量
*
* @param id 商品id
* @param quantity 库存数量 最终值
* @param totalExchangeCount 累计兑换数量 最终值
* @param id 商品id
* @param quantity 库存数量 最终值
* @param totalExchangeCount 累计兑换数量 最终值
*/
boolean upNumberById(Long id, Integer quantity, Integer totalExchangeCount);
}

View File

@@ -13,5 +13,5 @@ import java.util.List;
*/
public interface MkPointsGoodsMapper extends BaseMapper<MkPointsGoods> {
List<MkPointsGoods> getPointsGoodsPageByUser(Long shopId, Long userId);
List<MkPointsGoods> getPointsGoodsPageByUser(Long shopId, Long userId,String goodsCategory);
}

View File

@@ -57,9 +57,9 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
}
@Override
public Page<MkPointsGoods> getPointsGoodsPageByUser(Integer page, Integer size, Long shopId, Long userId) {
public Page<MkPointsGoods> getPointsGoodsPageByUser(Integer page, Integer size, Long shopId, String goodsCategory, Long userId) {
PageHelper.startPage(page, size);
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId);
List<MkPointsGoods> list = mapper.getPointsGoodsPageByUser(shopId, userId,goodsCategory);
return PageUtil.convert(new PageInfo<>(list));
}

View File

@@ -12,6 +12,9 @@
where goods.shop_id = #{shopId}
and goods.del_flag = 0
and goods.status = 1
<if test="goodsCategory != null and goodsCategory !=''">
and goods.goods_category = #{goodsCategory}
</if>
order by goods.sort desc, goods.id desc
</select>
</mapper>