|
|
|
@@ -3,6 +3,7 @@ package com.iformall.controller; |
|
|
|
|
|
|
|
import com.iformall.annotation.AuthIgnore; |
|
|
|
import com.iformall.annotation.RedisCache; |
|
|
|
import com.iformall.annotation.TenantIgnore; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
@@ -122,6 +123,7 @@ public class WxMerchantBUserController extends BaseController { |
|
|
|
* @param map |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@TenantIgnore |
|
|
|
@AuthIgnore |
|
|
|
@PostMapping("/login") |
|
|
|
@ApiOperation(value = "用户登录", notes = "{" + |
|
|
|
@@ -158,8 +160,8 @@ public class WxMerchantBUserController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
WxMerchantBUser userQ = new WxMerchantBUser(); |
|
|
|
userQ.updateTenantInfo(wxAppinfo); |
|
|
|
// userQ.setAppId(appId); |
|
|
|
// userQ.updateTenantInfo(wxAppinfo); |
|
|
|
userQ.setAppId(appId); |
|
|
|
userQ.setPhone(phone); |
|
|
|
userQ.setStatus(EnumMerchantBUserStatus.VALID.getCode()); |
|
|
|
List<WxMerchantBUser> orgList = wxMerchantBUserService.getBUserByAppId(userQ); |
|
|
|
@@ -174,12 +176,12 @@ public class WxMerchantBUserController extends BaseController { |
|
|
|
ResultData merchantStatus = checkMerchantStatus(orgUser); |
|
|
|
if (merchantStatus != null) return merchantStatus; |
|
|
|
|
|
|
|
try { |
|
|
|
wxMerchantBUserService.saveOrUpdate(orgUser); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("B端用户更新用户信息失败, e:" + e.getMessage()); |
|
|
|
return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage()); |
|
|
|
} |
|
|
|
// try { |
|
|
|
// wxMerchantBUserService.saveOrUpdate(orgUser); |
|
|
|
// } catch (Exception e) { |
|
|
|
// logger.error("B端用户更新用户信息失败, e:" + e.getMessage()); |
|
|
|
// return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage()); |
|
|
|
// } |
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
resultMap.put("bUserId", orgUser.getId()); |
|
|
|
resultMap.put("logined", true); |
|
|
|
@@ -202,9 +204,9 @@ public class WxMerchantBUserController extends BaseController { |
|
|
|
List<WxMerchantBuInfoVo> merchantListInfo = wxMerchantBUserService.getMerchantInfoByBUser(userQ); |
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
resultMap.put("merchantList", merchantListInfo); |
|
|
|
resultMap.put("logined", true); |
|
|
|
resultMap.put("bUserId", orgUser.getId()); |
|
|
|
request.setAttribute(Constant.LOGIN_B_USER_KEY, orgUser.getId()); |
|
|
|
resultMap.put("logined", false); |
|
|
|
// resultMap.put("bUserId", orgUser.getId()); |
|
|
|
// request.setAttribute(Constant.LOGIN_B_USER_KEY, orgUser.getId()); |
|
|
|
return new ResultData(resultMap); |
|
|
|
} else { |
|
|
|
logger.error(ErrorCode.PASSWORD_ERROR.getMessage()); |
|
|
|
@@ -220,6 +222,7 @@ public class WxMerchantBUserController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@TenantIgnore |
|
|
|
@AuthIgnore |
|
|
|
@PostMapping("/selectMerchant") |
|
|
|
@ApiOperation(value = "选择商户", notes = "{" + |
|
|
|
@@ -245,12 +248,12 @@ public class WxMerchantBUserController extends BaseController { |
|
|
|
if (orgUser != null) { |
|
|
|
ResultData merchantStatus = checkMerchantStatus(orgUser); |
|
|
|
if (merchantStatus != null) return merchantStatus; |
|
|
|
try { |
|
|
|
wxMerchantBUserService.saveOrUpdate(orgUser); |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("B端用户更新用户信息失败, e:" + e.getMessage()); |
|
|
|
return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage()); |
|
|
|
} |
|
|
|
// try { |
|
|
|
// wxMerchantBUserService.saveOrUpdate(orgUser); |
|
|
|
// } catch (Exception e) { |
|
|
|
// logger.error("B端用户更新用户信息失败, e:" + e.getMessage()); |
|
|
|
// return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage()); |
|
|
|
// } |
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
resultMap.put("bUserId", orgUser.getId()); |
|
|
|
resultMap.put("logined", true); |
|
|
|
@@ -285,6 +288,7 @@ public class WxMerchantBUserController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@TenantIgnore |
|
|
|
@AuthIgnore |
|
|
|
@ApiOperation(value = "修改密码,集团版会修改集团下同一手机号的密码", notes = "{\"appId\",\"string\", \"phone\",\"string\",\"code\",\"string\",\"pwd\",\"string\"}") |
|
|
|
@PostMapping("/updatepwd") |
|
|
|
@@ -306,7 +310,7 @@ public class WxMerchantBUserController extends BaseController { |
|
|
|
if (StringUtils.isBlank(pwd)) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "密码不能为空"); |
|
|
|
} |
|
|
|
return wxMerchantBUserService.updatePwd(getTenantInfo(), phone, code, pwd); |
|
|
|
return wxMerchantBUserService.updatePwd(appId, phone, code, pwd); |
|
|
|
} |
|
|
|
|
|
|
|
} |