GoodsService.java 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. package com.fuint.common.service;
  2. import com.fuint.common.dto.GoodsDto;
  3. import com.fuint.common.dto.GoodsSpecValueDto;
  4. import com.fuint.common.dto.GoodsTopDto;
  5. import com.fuint.framework.exception.BusinessCheckException;
  6. import com.fuint.framework.pagination.PaginationRequest;
  7. import com.fuint.framework.pagination.PaginationResponse;
  8. import com.fuint.repository.model.MtGoods;
  9. import com.fuint.repository.model.MtGoodsSku;
  10. import com.fuint.repository.model.MtGoodsSpec;
  11. import java.lang.reflect.InvocationTargetException;
  12. import java.util.Date;
  13. import java.util.List;
  14. import java.util.Map;
  15. /**
  16. * 商品业务接口
  17. *
  18. * Created by FSQ
  19. * CopyRight https://www.fuint.cn
  20. */
  21. public interface GoodsService {
  22. /**
  23. * 分页查询商品列表
  24. *
  25. * @param paginationRequest
  26. * @return
  27. */
  28. PaginationResponse<GoodsDto> queryGoodsListByPagination(PaginationRequest paginationRequest) throws BusinessCheckException;
  29. /**
  30. * 保存商品
  31. *
  32. * @param reqDto
  33. * @throws BusinessCheckException
  34. * @return
  35. */
  36. MtGoods saveGoods(MtGoods reqDto) throws BusinessCheckException;
  37. /**
  38. * 根据ID获取商品信息
  39. *
  40. * @param id 商品ID
  41. * @throws BusinessCheckException
  42. * @return
  43. */
  44. MtGoods queryGoodsById(Integer id) throws BusinessCheckException;
  45. /**
  46. * 根据编码获取商品信息
  47. *
  48. * @param merchantId 商户ID
  49. * @param goodsNo 商品编码
  50. * @throws BusinessCheckException
  51. * @return
  52. */
  53. MtGoods queryGoodsByGoodsNo(Integer merchantId, String goodsNo) throws BusinessCheckException;
  54. /**
  55. * 根据条码获取sku信息
  56. *
  57. * @param skuNo skuNo
  58. * @throws BusinessCheckException
  59. * @return
  60. * */
  61. MtGoodsSku getSkuInfoBySkuNo(String skuNo) throws BusinessCheckException;
  62. /**
  63. * 根据ID获取商品详情
  64. *
  65. * @param id 商品ID
  66. * @throws BusinessCheckException
  67. * @return
  68. */
  69. GoodsDto getGoodsDetail(Integer id, boolean getDeleteSpec) throws InvocationTargetException, IllegalAccessException;
  70. /**
  71. * 根据ID删除
  72. *
  73. * @param id 商品ID
  74. * @param operator 操作人
  75. * @throws BusinessCheckException
  76. * @return
  77. */
  78. void deleteGoods(Integer id, String operator) throws BusinessCheckException;
  79. /**
  80. * 获取店铺的商品列表
  81. *
  82. * @param storeId 店铺ID
  83. * @param keyword 关键字
  84. * @param cateId 分类ID
  85. * @param page 当前页码
  86. * @param pageSize 每页数量
  87. * @return
  88. * */
  89. Map<String, Object> getStoreGoodsList(Integer storeId, String keyword, Integer cateId, Integer page, Integer pageSize) throws BusinessCheckException;
  90. /**
  91. * 根据skuId获取规格列表
  92. *
  93. * @param skuId
  94. * @return
  95. * */
  96. List<GoodsSpecValueDto> getSpecListBySkuId(Integer skuId) throws BusinessCheckException;
  97. /**
  98. * 获取规格详情
  99. *
  100. * @param specId 规格ID
  101. * @return
  102. * */
  103. MtGoodsSpec getSpecDetail(Integer specId);
  104. /**
  105. * 更新已售数量
  106. *
  107. * @param goodsId 商品ID
  108. * @return
  109. * */
  110. Boolean updateInitSale(Integer goodsId);
  111. /**
  112. * 获取选择商品列表
  113. *
  114. * @param params 查询参数
  115. * @return
  116. */
  117. PaginationResponse<GoodsDto> selectGoodsList(Map<String, Object> params) throws BusinessCheckException;
  118. /**
  119. * 获取商品销售排行榜
  120. *
  121. * @param merchantId 商户ID
  122. * @param storeId 店铺ID
  123. * @param startTime 开始时间
  124. * @param endTime 结束时间
  125. * @return
  126. * */
  127. List<GoodsTopDto> getGoodsSaleTopList(Integer merchantId, Integer storeId, Date startTime, Date endTime);
  128. }