admin
2019-05-22 9b4bf99c1a30f3a7c2bdd6faba7589ff4f7e48e5
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
package com.yeshi.fanli.service.inter.user;
 
import java.util.List;
import java.util.Set;
 
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
 
import org.apache.ibatis.annotations.Param;
 
import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
import com.yeshi.fanli.exception.user.UserGoodsStorageException;
 
public interface UserGoodsStorageService {
 
    public int deleteByPrimaryKey(Long id);
 
    public int insert(UserGoodsStorage record);
 
    public int insertSelective(UserGoodsStorage record);
 
    public UserGoodsStorage selectByPrimaryKey(Long id);
 
    public int updateByPrimaryKeySelective(UserGoodsStorage record);
 
    public int updateByPrimaryKey(UserGoodsStorage record);
    
    /**
     * 查询用户对应的选品库
     * @param start
     * @param count
     * @param uid
     * @return
     */
    public List<UserGoodsStorage> listQueryByUid(@Param("start") long start, @Param("count") int count, 
            @Param("uid") Long uid);
    
    public long countQueryByUid(@Param("uid") Long uid);
 
    /**
     *  新增或初始化用户选品库
     * @param uid 用户id
     * @param auctionIds 商品id集合
     * @return
     * @throws UserGoodsStorageException
     */
    public void save(Long uid, Set<Long> auctionIds) throws UserGoodsStorageException;
 
    /**
     * 批量删除
     * @param list
     * @return
     */
    public int deleteBatchByPrimaryKey(List<Long> list);
 
    /**
     * 查询备选库
     * @param page
     * @param pageSize
     * @param uid
     * @return
     * @throws UserGoodsStorageException
     */
    public JSONArray getMyStorage(int page, int pageSize, Long uid) throws UserGoodsStorageException;
 
    /**
     * 根据主键 、uid 批量删除
     * @param list
     * @return
     */
    public int deleteBatchByUidAndPrimaryKey(Long uid, List<Long> list);
 
    /**
     * 根据用户id、淘宝商品 id
     * @param uid 用户id
     * @param auctionId 淘宝商品 id
     * @return
     */
    public UserGoodsStorage getByUidAndAuctionId(Long uid, Long auctionId);
 
    /**
     *  判断是否属于选品库
     * @param uid 用户id
     * @param auctionId 商品id
     * @return 
     */
    public boolean isExistStorage(Long uid, Long auctionId);
 
    /**
     * 选品库分享商品
     * @param uid
     * @param listStorageID
     * @throws UserGoodsStorageException
     * @throws UserShareGoodsRecordException
     */
    public JSONObject shareGoods(Long uid, List<Long> listStorageID) throws UserGoodsStorageException, UserShareGoodsRecordException;
 
    /**
     * 更新商品状态为已分享
     * @param shareId 分享
     */
    public void updateShareStateByCommonGoodsId(Long shareId);
 
}