1
0

MemberService.java 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. package com.fuint.common.service;
  2. import com.baomidou.mybatisplus.extension.service.IService;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.fuint.common.dto.GroupMemberDto;
  5. import com.fuint.common.dto.MemberTopDto;
  6. import com.fuint.common.dto.UserDto;
  7. import com.fuint.framework.exception.BusinessCheckException;
  8. import com.fuint.framework.pagination.PaginationRequest;
  9. import com.fuint.framework.pagination.PaginationResponse;
  10. import com.fuint.repository.model.MtUser;
  11. import com.fuint.repository.model.MtUserGrade;
  12. import javax.servlet.http.HttpServletRequest;
  13. import java.util.Date;
  14. import java.util.List;
  15. import java.util.Map;
  16. /**
  17. * 会员服务接口
  18. *
  19. * Created by FSQ
  20. * CopyRight https://www.fuint.cn
  21. */
  22. public interface MemberService extends IService<MtUser> {
  23. /**
  24. * 更新活跃时间
  25. *
  26. * @param userId 会员ID
  27. * @param ip IP地址
  28. * @return
  29. * */
  30. Boolean updateActiveTime(Integer userId, String ip) throws BusinessCheckException;
  31. /**
  32. * 获取当前操作会员信息
  33. *
  34. * @param userId 会员ID
  35. * @param accessToken
  36. * @return
  37. * */
  38. MtUser getCurrentUserInfo(HttpServletRequest request, Integer userId, String accessToken) throws BusinessCheckException;
  39. /**
  40. * 分页查询会员列表
  41. *
  42. * @param paginationRequest
  43. * @return
  44. */
  45. PaginationResponse<UserDto> queryMemberListByPagination(PaginationRequest paginationRequest) throws BusinessCheckException;
  46. /**
  47. * 添加会员
  48. *
  49. * @param memberInfo 会员信息
  50. * @param shareId 分享用户ID
  51. * @throws BusinessCheckException
  52. * @return
  53. */
  54. MtUser addMember(MtUser memberInfo, String shareId) throws BusinessCheckException;
  55. /**
  56. * 编辑会员
  57. *
  58. * @param reqUserDto 会员信息
  59. * @param modifyPassword 修改密码
  60. * @throws BusinessCheckException
  61. * @return
  62. */
  63. MtUser updateMember(MtUser reqUserDto, boolean modifyPassword) throws BusinessCheckException;
  64. /**
  65. * 通过手机号添加会员
  66. *
  67. * @param merchantId 商户ID
  68. * @param mobile 手机号
  69. * @param shareId 分享用户ID
  70. * @param ip IP地址
  71. * @throws BusinessCheckException
  72. * @return
  73. */
  74. MtUser addMemberByMobile(Integer merchantId, String mobile, String shareId, String ip) throws BusinessCheckException;
  75. /**
  76. * 根据会员ID获取会员信息
  77. *
  78. * @param id 会员ID
  79. * @throws BusinessCheckException
  80. * @return
  81. */
  82. MtUser queryMemberById(Integer id) throws BusinessCheckException;
  83. /**
  84. * 根据会员名称获取会员信息
  85. *
  86. * @param merchantId 商户ID
  87. * @param name 会员名称
  88. * @throws BusinessCheckException
  89. * @return
  90. */
  91. MtUser queryMemberByName(Integer merchantId, String name) throws BusinessCheckException;
  92. /**
  93. * 根据会员ID获取会员信息
  94. *
  95. * @param merchantId 商户ID
  96. * @param openId 微信openId
  97. * @throws BusinessCheckException
  98. * @return
  99. */
  100. MtUser queryMemberByOpenId(Integer merchantId, String openId, JSONObject userInfo) throws BusinessCheckException;
  101. /**
  102. * 根据会员组ID获取会员组信息
  103. *
  104. * @param id 会员组ID
  105. * @throws BusinessCheckException
  106. * @return
  107. */
  108. MtUserGrade queryMemberGradeByGradeId(Integer id) throws BusinessCheckException;
  109. /**
  110. * 根据会员手机获取会员信息
  111. *
  112. * @param merchantId 商户ID
  113. * @param mobile 会员手机
  114. * @throws BusinessCheckException
  115. * @return
  116. */
  117. MtUser queryMemberByMobile(Integer merchantId, String mobile) throws BusinessCheckException;
  118. /**
  119. * 根据会员号获取会员信息
  120. *
  121. * @param merchantId 商户ID
  122. * @param userNo 会员号
  123. * @throws BusinessCheckException
  124. * @return
  125. */
  126. MtUser queryMemberByUserNo(Integer merchantId, String userNo) throws BusinessCheckException;
  127. /**
  128. * 根据会员ID 删除店铺信息
  129. *
  130. * @param id 会员ID
  131. * @param operator 操作人
  132. * @throws BusinessCheckException
  133. * @return
  134. */
  135. Integer deleteMember(Integer id, String operator) throws BusinessCheckException;
  136. /**
  137. * 根据条件搜索会员分组
  138. *
  139. * @param params 查询参数
  140. * @throws BusinessCheckException
  141. * @return
  142. * */
  143. List<MtUserGrade> queryMemberGradeByParams(Map<String, Object> params) throws BusinessCheckException;
  144. /**
  145. * 获取会员数量
  146. *
  147. * @param merchantId 商户ID
  148. * @param storeId 店铺ID
  149. * @throws BusinessCheckException
  150. * @return
  151. * */
  152. Long getUserCount(Integer merchantId, Integer storeId) throws BusinessCheckException;
  153. /**
  154. * 获取会员数量
  155. *
  156. * @param merchantId 商户ID
  157. * @param storeId 店铺ID
  158. * @param beginTime 开始时间
  159. * @param endTime 结束时间
  160. * @throws BusinessCheckException
  161. * @return
  162. * */
  163. Long getUserCount(Integer merchantId, Integer storeId, Date beginTime, Date endTime) throws BusinessCheckException;
  164. /**
  165. * 获取活跃会员数量
  166. * @param merchantId 商户ID
  167. * @param storeId 店铺ID
  168. * @param beginTime 开始时间
  169. * @param endTime 结束时间
  170. * @throws BusinessCheckException
  171. * @return
  172. * */
  173. Long getActiveUserCount(Integer merchantId, Integer storeId, Date beginTime, Date endTime) throws BusinessCheckException;
  174. /**
  175. * 重置手机号
  176. *
  177. * @param mobile 手机号码
  178. * @param userId 会员ID
  179. * @throws BusinessCheckException
  180. * @return
  181. */
  182. void resetMobile(String mobile, Integer userId) throws BusinessCheckException;
  183. /**
  184. * 获取会员消费排行榜
  185. *
  186. * @param merchantId 商户ID
  187. * @param storeId 店铺ID
  188. * @param startTime 开始时间
  189. * @param endTime 结束时间
  190. * @return
  191. * */
  192. List<MemberTopDto> getMemberConsumeTopList(Integer merchantId, Integer storeId, Date startTime, Date endTime);
  193. /**
  194. * 查找会员列表
  195. *
  196. * @param merchantId 商户ID
  197. * @param keyword 关键字
  198. * @param groupIds 分组ID
  199. * @param page 当前页码
  200. * @param pageSize 每页数量
  201. * @return
  202. * */
  203. List<GroupMemberDto> searchMembers(Integer merchantId, String keyword, String groupIds, Integer page, Integer pageSize);
  204. /**
  205. * 查找会员列表
  206. *
  207. * @param merchantId 商户ID
  208. * @param keyword 关键字
  209. * @return
  210. * */
  211. List<MtUser> searchMembers(Integer merchantId, String keyword);
  212. /**
  213. * 设定安全的密码
  214. *
  215. * @param password 密码(明文)
  216. * @param salt 随机因子
  217. * @return
  218. */
  219. String enCodePassword(String password, String salt);
  220. /**
  221. * 获取加密密码
  222. *
  223. * @param password 密码(密文)
  224. * @param salt 随机因子
  225. * @return
  226. * */
  227. String deCodePassword(String password, String salt);
  228. /**
  229. * 获取会员ID列表
  230. *
  231. * @param merchantId 商户ID
  232. * @param storeId 店铺ID
  233. * @return
  234. * */
  235. List<Integer> getUserIdList(Integer merchantId, Integer storeId);
  236. }