yujian
2019-09-03 2ddf5b8a1290123e2d1c05bcc851ec35cd217afc
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
package com.yeshi.fanli.service.inter.lable;
 
 
import java.io.InputStream;
import java.util.List;
import java.util.Map;
 
import org.springframework.web.multipart.MultipartFile;
 
import com.yeshi.fanli.entity.bus.lable.Label;
import com.yeshi.fanli.entity.bus.lable.LabelGoods;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.exception.goods.quality.LabelException;
 
public interface LabelService {
    
    /**
     * 插入对象
     * @param record
     * @return
     * @throws LabelException
     */
    public int insertSelective(Label record) throws LabelException;
    
    /**
     * 更新当前对象所有数据
     * @param record
     * @return
     * @throws LabelException
     */
    public int updateByPrimaryKey(Label record) throws LabelException;
    
    /**
     * 选择性更新内容——不为空则更新该字段
     * @param record
     * @return
     * @throws LabelException
     */
    public int updateByPrimaryKeySelective(Label record) throws LabelException;
    
 
    
    /**
     * 根据id查找当前对象
     * @param id
     * @return
     * @throws LabelException
     */
    public Label selectByPrimaryKey(Long id) throws LabelException;
    
    
 
    /**
     * 根据id批量删除
     * @param ids
     */
    public int deleteBatchById(long[] ids) throws LabelException;
 
    /**
     * 查询标签
     * @param pageIndex 页码
     * @param pageSize  页面条数
     * @param key        搜索条件
     * @param startTime 起始时间
     * @param endTime   结束时间
     * @return
     */
    public List<Label> query(int pageIndex, int pageSize, String key,String startTime,
            String endTime, String orderMode) throws LabelException;
    
    public int getQueryCount(String key, String startTime, String endTime) throws LabelException;
 
    
    /**
     * excel上传
     * @param in
     * @param admin
     * @throws Exception
     */
    public void analysisExcel(InputStream in, AdminUser admin) throws Exception;
 
    /**
     * 批量插入数据
     * @param records
     * @param admin
     * @throws LabelException
     */
    public void insertList(List<Label> records, AdminUser admin) throws LabelException;
 
    /**
     * 上传标签图片
     * @param file
     * @param admin
     * @return
     * @throws LabelException
     */
    public int uploadPicture(MultipartFile file,Label label ) throws Exception;
 
 
    /**
     * 统计今日录入总数
     * @return
     */
    public long getCountToday() throws LabelException;
 
 
 
    
    public List<Label> selectByTitle(String title) throws LabelException;
 
    
    
    
    public void deleteBatchByPrimaryKey(List<Long> ids) throws LabelException;
 
 
    
    public void updateList(List<Label> records) throws LabelException;
 
    
    public void insertSingle(Label label, AdminUser admin, MultipartFile file)
            throws Exception;
 
    
    /**
     * 删除图片
     * @param label
     * @return
     * @throws Exception
     */
    public int deleteImg(Label label) throws LabelException;
 
    
    /**
     * 统计所有
     * @return
     */
    public long getCount();
 
 
    /**
     * 查询一级分类 标签候选项- 分页
     * @param classId
     * @return
     */
    public List<Label> queryClassCandidate(int start, int count, String key, Long classId) throws LabelException;
    
    public int getCountQueryClassCandidate(String key, Long classId) throws LabelException;
 
    
    /**
     * 查询子级分类 标签候选项- 分页
     * @param subClassId
     * @return
     */
    public List<Label> querySubClassCandidate(int start, int count, String key, Long subClassId) throws LabelException;
 
    public int getCountQuerySubClassCandidate(String key, Long subClassId) throws LabelException;
 
    /**
     * 商品标签添加候选项(已排除存在标签)
     * @param goodsId
     * @return
     * @throws LabelException
     */
    public List<Label> queryGoodsCandidate(int start, int count, String key, Long classId) throws LabelException;
 
    public int getCountQueryGoodsCandidate(String key, Long classId) throws LabelException;
 
    /**
     * 根据录入方式统计
     * @return
     * @throws LabelException
     */
    public Map<String, Object> getCountByEntryMode() throws LabelException;
 
    /**
     * 查询商品对应标签
     * @param goodsId
     * @return
     */
    public List<LabelGoods> getByGoodsId(Long goodsId);
 
    
    public Label getByTitleCache(String labKey, String title) throws LabelException;
 
    /**
     * 新建标签
     * @param lableNames 空格隔开
     * @param admin
     * @return
     */
    public List<Label> addBatchByNames(String lableNames, AdminUser admin)  throws LabelException;
 
    /**
     * 多个标签查询
     * @param list
     * @return
     */
    public List<Label> listByTitlesCache(List<String> list);
    
}