yujian
2019-05-29 0588d6be74335f41c79a8d8e32dbd1c3d3e47fa3
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
package com.yeshi.fanli.service.inter.lable;
 
import java.util.List;
import java.util.Map;
 
import com.yeshi.fanli.entity.bus.lable.BoutiqueAutoRule;
import com.yeshi.fanli.entity.bus.lable.Label;
import com.yeshi.fanli.entity.bus.lable.QualityFactory;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.QualityFactoryException;
import com.yeshi.fanli.vo.quality.QualityFactoryVO;
 
public interface QualityFactoryService {
 
    /**
     * 选择性更新内容——不为空则更新该字段
     * 
     * @param record
     * @return
     * @throws QualityFactoryException
     */
    public int updateByPrimaryKeySelective(QualityFactory record) throws QualityFactoryException;
 
    /**
     * 根据id查找当前对象
     * 
     * @param id
     * @return
     * @throws QualityFactoryException
     */
    public QualityFactory selectByPrimaryKey(Long id) throws QualityFactoryException;
 
    /**
     * 统计商品数量
     * 
     * @return
     */
    public Map<String, Object> getCountAll();
 
    /**
     * 根据商品id 移除精品库
     * 
     * @param ids
     * @throws QualityFactoryException
     */
    public void deleteByGoodsId(List<String> ids) throws QualityFactoryException;
 
 
    /**
     * 根据淘宝id集合 批量删除精选库对应信息
     * 
     * @param listId
     * @throws QualityFactoryException
     */
    public void deleteBatchByTaoBaoGoodsId(List<Long> listId);
 
    /**
     * 根据淘宝id 删除
     * 
     * @param auctionId
     * @throws QualityFactoryException
     */
    public void deleteByTaoBaoGoodsId(Long auctionId);
 
    /**
     * 统计商品id 是存在精品库
     * 
     * @param goodsId
     * @return
     */
    public Long queryCountByGoodsId(Long goodsId);
 
 
    /**
     * 精选库商品筛选
     * 
     * @throws QualityFactoryException
     */
    public List<QualityFactory> query(QualityFactoryVO qualityFactoryVO) throws QualityFactoryException;
 
    public long queryCount(QualityFactoryVO qualityFactoryVO) throws QualityFactoryException;
 
    /**
     * 批量设置权重 + 随机权重
     * 
     * @param idList
     * @param admin
     * @param weight
     * @param weightSmall
     * @param weightLarge
     * @throws Exception
     */
    public void setWeightBatch(List<Long> idList, AdminUser admin, Integer weight, Integer weightSmall,
            Integer weightLarge) throws Exception;
 
    /**
     * 统计总行数
     * 
     * @return
     */
    public Long countTotalRows(Integer days);
 
    /**
     * 查询所有数据-无条件
     * 
     * @param start
     * @param count
     * @return
     */
    public List<QualityFactory> queryAll(long start, int count, Integer days);
 
    /**
     * 查询需要更新的精选库商品id
     * 
     * @param count
     * @param hour
     * @return
     */
    public List<Long> queryNeedUpdate(long start, int count, int hour);
 
    /**
     * 统计更新数据量
     * 
     * @return
     */
    public long queryNeedUpdateCount();
 
    /**
     * 查询精选商品数据应用前端
     * 
     * @param start
     * @param count
     * @param key
     * @param classId
     *            分类id
     * @param labId
     *            标签id
     * @return
     */
    public List<QualityFactory> listQuery(long start, int count, String key, Long classId, Long labId);
 
    /**
     * 对应查询精选商品数据应用前端统计
     */
    public long countQuery(String key, Integer goodsSource, Long classId, Long labId);
 
    /**
     * 更新精选库商品
     * 
     * @param goodsList
     * @param systemCid
     * @param labels
     */
    public void autoInsertOrUpadateStorage(BoutiqueAutoRule autoRule, List<TaoBaoGoodsBrief> goodsList, List<Label> listLabs) throws Exception;
 
    /**
     * AuctionId查收精选库
     * 
     * @param list
     * @return
     */
    public List<QualityFactory> listQueryByAuctionId(List<Long> list);
 
    /**
     * 根据时间 获取当前时间之前创建的商品信息
     * 
     * @param systemCid
     *            系统分类id
     * @param dateTime
     *            筛选时间
     * @param goodsSource
     *            商品来源
     * @return
     */
    public List<Long> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime);
 
    /**
     * 更新权重
     * 
     * @param weight
     * @param time
     * @return
     */
    public void updateWeight(Integer weight, Integer time);
 
    /**
     * 根据精选库商品id 更新商品信息
     * 
     * @param gid
     *            商品主键
     */
    public void updateQualityGoods(Long goodsId);
 
    /**
     * 根据最低销量查询精选库(按创建时间倒叙排列)
     * 
     * @param salesCount
     * @param page
     * @param pageSize
     * @return
     */
    public List<QualityFactory> listByMinSalesCountOrderByCreateTimeDesc(int salesCount, int page, int pageSize);
 
    /**
     * 批量添加商品至精选库 并贴上标签
     * @param listTaoBaoGoods
     * @param lableNames
     * @param admin
     * @throws Exception
     */
    public void addBatchTaoBaoGoods(List<TaoBaoGoodsBrief> listTaoBaoGoods, String lableNames, AdminUser admin)
            throws Exception;
 
    /**
     * 删除数据
     * @param systemCid
     * @param formatDate
     * @param source
     */
    public void deleteNotUpdateGoods(Long systemCid, String formatDate, int source);
 
}