admin
2024-01-23 81da61b828e29b7745e1382dfbbaeb685dc083ef
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserGoodsStorageService.java
@@ -1,105 +1,117 @@
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 updateShareState(Long shareId);
}
package com.yeshi.fanli.service.inter.user;
import java.util.List;
import java.util.Set;
import com.yeshi.fanli.entity.SystemEnum;
import com.yeshi.fanli.entity.bus.user.UserGoodsStorage;
import com.yeshi.fanli.exception.share.UserShareGoodsRecordException;
import com.yeshi.fanli.exception.user.UserGoodsStorageException;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
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(long start, int count, Long uid, Integer source);
   public long countQueryByUid(Long uid, Integer source);
   /**
    *  新增或初始化用户选品库
    * @param uid 用户id
    * @param auctionIds 商品id集合
    * @return
    * @throws UserGoodsStorageException
    */
   public void save(Long uid, Set<String> auctionIds, Integer goodsType) 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, Integer source) 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, String auctionId, Integer goodsType);
   /**
    *  判断是否属于选品库
    * @param uid 用户id
    * @param auctionId 商品id
    * @return
    */
   public boolean isExistStorage(Long uid, String auctionId, Integer goodType);
   /**
    * 选品库分享商品
    * @param uid
    * @param listStorageID
    * @throws UserGoodsStorageException
    * @throws UserShareGoodsRecordException
    */
   public JSONObject shareGoods(Long uid, List<Long> listStorageID) throws UserGoodsStorageException, UserShareGoodsRecordException;
   /**
    * 添加简版商品到选品库
    * @param uid
    * @param ids
    * @throws UserGoodsStorageException
    */
   public void addCommonGoods(Long uid, Set<Long> ids) throws UserGoodsStorageException;
   /**
    * 创建分享
    * @param uid
    * @param listStorageID
    * @param needDrawPicture是否需要绘图
    * @return
    * @throws UserGoodsStorageException
    * @throws UserShareGoodsRecordException
    */
   public JSONObject createShareV2(Long uid, List<Long> listStorageID,boolean needDrawPicture)
         throws UserGoodsStorageException, UserShareGoodsRecordException;
}