xiangpei
2025-05-09 641b4a3b1572f3a75ce0bd7d645e34252237cf9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
package cn.lili.modules.goods.service;
 
import cn.lili.modules.goods.entity.dos.Goods;
import cn.lili.modules.goods.entity.dto.GoodsOperationDTO;
import cn.lili.modules.goods.entity.dto.GoodsSearchParams;
import cn.lili.modules.goods.entity.enums.GoodsAuthEnum;
import cn.lili.modules.goods.entity.enums.GoodsStatusEnum;
import cn.lili.modules.goods.entity.vos.GoodsVO;
import cn.lili.modules.store.entity.dos.Store;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
 
import java.util.List;
 
/**
 * 商品业务层
 *
 * @author pikachu
 * @since 2020-02-23 16:18:56
 */
public interface GoodsService extends IService<Goods> {
 
 
    /**
     * 根据品牌获取商品
     *
     * @param brandIds 品牌ids
     */
    List<Goods> getByBrandIds(List<String> brandIds);
 
    /**
     * 下架所有商家商品
     *
     * @param storeId 店铺ID
     */
    void underStoreGoods(String storeId);
 
    /**
     * 更新商品参数
     *
     * @param goodsId 商品id
     * @param params 商品参数
     */
    void updateGoodsParams(String goodsId, String params);
 
    /**
     * 获取某分类下的商品数量
     *
     * @param categoryId 分类ID
     * @return 商品数量
     */
    long getGoodsCountByCategory(String categoryId);
 
    /**
     * 添加商品
     *
     * @param goodsOperationDTO 商品查询条件
     */
    void addGoods(GoodsOperationDTO goodsOperationDTO);
 
    /**
     * 修改商品
     *
     * @param goodsOperationDTO 商品查询条件
     * @param goodsId           商品ID
     */
    void editGoods(GoodsOperationDTO goodsOperationDTO, String goodsId);
 
    /**
     * 查询商品VO
     *
     * @param goodsId 商品id
     * @return 商品VO
     */
    GoodsVO getGoodsVO(String goodsId);
 
 
    /**
     * 商品查询
     *
     * @param goodsSearchParams 查询参数
     * @return 商品分页
     */
    IPage<Goods> queryByParams(GoodsSearchParams goodsSearchParams);
 
 
    /**
     * 商品查询
     *
     * @param goodsSearchParams 查询参数
     * @return 商品信息
     */
    List<Goods> queryListByParams(GoodsSearchParams goodsSearchParams);
 
    /**
     * 批量审核商品
     *
     * @param goodsIds      商品id列表
     * @param goodsAuthEnum 审核操作
     * @return 审核结果
     */
    boolean auditGoods(List<String> goodsIds, GoodsAuthEnum goodsAuthEnum);
 
 
    /**
     * 更新商品上架状态状态
     *
     * @param goodsIds        商品ID集合
     * @param goodsStatusEnum 更新的商品状态
     * @param underReason     下架原因
     * @return 更新结果
     */
    Boolean updateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason);
 
 
    /**
     * 更新商品上架状态状态
     *
     * @param storeId        店铺ID
     * @param goodsStatusEnum 更新的商品状态
     * @param underReason     下架原因
     * @return 更新结果
     */
    Boolean updateGoodsMarketAbleByStoreId(String storeId, GoodsStatusEnum goodsStatusEnum, String underReason);
 
    /**
     * 更新商品上架状态状态
     *
     * @param goodsIds        商品ID集合
     * @param goodsStatusEnum 更新的商品状态
     * @param underReason     下架原因
     * @return 更新结果
     */
    Boolean managerUpdateGoodsMarketAble(List<String> goodsIds, GoodsStatusEnum goodsStatusEnum, String underReason);
    /**
     * 删除商品
     *
     * @param goodsIds 商品ID
     * @return 操作结果
     */
    Boolean deleteGoods(List<String> goodsIds);
 
    /**
     * 设置商品运费模板
     *
     * @param goodsIds   商品列表
     * @param templateId 运费模板ID
     * @return 操作结果
     */
    Boolean freight(List<String> goodsIds, String templateId);
 
    /**
     * 修改商品库存数量
     *
     * @param goodsId  商品ID
     */
    void updateStock(String goodsId);
 
    /**
     * 更新商品评价数量
     *
     * @param goodsId 商品ID
     * @param skuId skuID
     */
    void updateGoodsCommentNum(String goodsId, String skuId);
 
    /**
     * 更新商品的购买数量
     *
     * @param goodsId  商品ID
     * @param buyCount 购买数量
     */
    void updateGoodsBuyCount(String goodsId, int buyCount);
 
    /**
     * 批量更新商品的店铺信息
     * @param store
     */
    void updateStoreDetail(Store store);
    /**
     * 统计店铺的商品数量
     * @param storeId 店铺id
     * @return
     */
    long countStoreGoodsNum(String storeId);
 
    /**
     * 同步商品分类名称
     *
     * @param categoryId 分类ID
     */
    void categoryGoodsName(String categoryId);
 
 
    void addGoodsCommentNum(Integer commentNum, String goodsId);
}