|
@@ -1,10 +1,10 @@
|
|
|
package com.fuint.module.merchantApi.controller;
|
|
|
|
|
|
import com.fuint.common.Constants;
|
|
|
-import com.fuint.common.dto.AccountInfo;
|
|
|
import com.fuint.common.dto.UserDto;
|
|
|
import com.fuint.common.dto.UserInfo;
|
|
|
import com.fuint.common.enums.StatusEnum;
|
|
|
+import com.fuint.common.param.MemberDetailParam;
|
|
|
import com.fuint.common.param.MemberListParam;
|
|
|
import com.fuint.common.service.*;
|
|
|
import com.fuint.common.util.DateUtil;
|
|
@@ -43,11 +43,6 @@ public class MerchantMemberController extends BaseController {
|
|
|
*/
|
|
|
private MemberService memberService;
|
|
|
|
|
|
- /**
|
|
|
- * 会员等级服务接口
|
|
|
- * */
|
|
|
- private UserGradeService userGradeService;
|
|
|
-
|
|
|
/**
|
|
|
* 店铺员工服务接口
|
|
|
* */
|
|
@@ -77,6 +72,7 @@ public class MerchantMemberController extends BaseController {
|
|
|
String dataType = memberListParam.getDataType();
|
|
|
Integer page = memberListParam.getPage() == null ? Constants.PAGE_NUMBER : memberListParam.getPage();
|
|
|
Integer pageSize = memberListParam.getPageSize() == null ? Constants.PAGE_SIZE : memberListParam.getPageSize();
|
|
|
+ String keyword = memberListParam.getKeyword() == null ? "" : memberListParam.getKeyword();
|
|
|
|
|
|
// 今日注册、今日活跃
|
|
|
if (dataType.equals("todayRegister")) {
|
|
@@ -143,6 +139,12 @@ public class MerchantMemberController extends BaseController {
|
|
|
if (StringUtil.isNotEmpty(memberTime)) {
|
|
|
params.put("memberTime", memberTime);
|
|
|
}
|
|
|
+
|
|
|
+ // 搜索关键字
|
|
|
+ if (StringUtil.isNotEmpty(keyword)) {
|
|
|
+ params.put("keyword", keyword);
|
|
|
+ }
|
|
|
+
|
|
|
paginationRequest.setSearchParams(params);
|
|
|
PaginationResponse<UserDto> paginationResponse = memberService.queryMemberListByPagination(paginationRequest);
|
|
|
|
|
@@ -165,31 +167,29 @@ public class MerchantMemberController extends BaseController {
|
|
|
* 会员详情
|
|
|
*
|
|
|
* @param request
|
|
|
- * @param id 会员ID
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "查询会员详情")
|
|
|
- @RequestMapping(value = "/info/{id}", method = RequestMethod.GET)
|
|
|
+ @RequestMapping(value = "/info", method = RequestMethod.POST)
|
|
|
@CrossOrigin
|
|
|
- public ResponseObject info(HttpServletRequest request, @PathVariable("id") Integer id) throws BusinessCheckException {
|
|
|
+ public ResponseObject info(HttpServletRequest request, @RequestBody MemberDetailParam memberParam) throws BusinessCheckException {
|
|
|
String token = request.getHeader("Access-Token");
|
|
|
- AccountInfo accountInfo = TokenUtil.getAccountInfoByToken(token);
|
|
|
- if (accountInfo == null) {
|
|
|
+ UserInfo userInfo = TokenUtil.getUserInfoByToken(token);
|
|
|
+ if (userInfo == null) {
|
|
|
return getFailureResult(1001, "请先登录");
|
|
|
}
|
|
|
|
|
|
- MtUser mtUserInfo = memberService.queryMemberById(id);
|
|
|
-
|
|
|
- Map<String, Object> param = new HashMap<>();
|
|
|
- if (accountInfo.getMerchantId() != null && accountInfo.getMerchantId() > 0) {
|
|
|
- param.put("MERCHANT_ID", accountInfo.getMerchantId());
|
|
|
+ MtStaff staffInfo = null;
|
|
|
+ MtUser mtUser = memberService.queryMemberById(userInfo.getId());
|
|
|
+ if (mtUser != null && mtUser.getMobile() != null) {
|
|
|
+ staffInfo = staffService.queryStaffByMobile(mtUser.getMobile());
|
|
|
}
|
|
|
- param.put("STATUS", StatusEnum.ENABLED.getKey());
|
|
|
- List<MtUserGrade> userGradeList = memberService.queryMemberGradeByParams(param);
|
|
|
-
|
|
|
+ if (staffInfo == null) {
|
|
|
+ return getFailureResult(201, "该账号不是商户");
|
|
|
+ }
|
|
|
+ MtUser memberInfo = memberService.queryMemberById(memberParam.getMemberId());
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
- result.put("userGradeList", userGradeList);
|
|
|
- result.put("memberInfo", mtUserInfo);
|
|
|
+ result.put("memberInfo", memberInfo);
|
|
|
|
|
|
return getSuccessResult(result);
|
|
|
}
|