|
@@ -49,8 +49,6 @@ public class LoginServiceImpl implements LoginService {
|
|
private RegisterMapper registerMapper;
|
|
private RegisterMapper registerMapper;
|
|
@Resource
|
|
@Resource
|
|
private OperationMapper operationMapper;
|
|
private OperationMapper operationMapper;
|
|
- @Resource
|
|
|
|
- private BaseMapper baseMapper;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* 小程序邀请码过期天数
|
|
* 小程序邀请码过期天数
|
|
@@ -413,7 +411,7 @@ public class LoginServiceImpl implements LoginService {
|
|
String md5Password = Md5Util.md5(password);
|
|
String md5Password = Md5Util.md5(password);
|
|
if (null != user && md5Password.equals(user.getPassword())) {
|
|
if (null != user && md5Password.equals(user.getPassword())) {
|
|
// 查询使用该手机号的运营人员或用户
|
|
// 查询使用该手机号的运营人员或用户
|
|
- String checkRust = operationBindCheck(mobile, smsCode);
|
|
|
|
|
|
+ String checkRust = commonService.operationBindCheck(mobile, smsCode);
|
|
if (checkRust != null) {
|
|
if (checkRust != null) {
|
|
return ResponseJson.error(checkRust, null);
|
|
return ResponseJson.error(checkRust, null);
|
|
}
|
|
}
|
|
@@ -580,7 +578,7 @@ public class LoginServiceImpl implements LoginService {
|
|
return ResponseJson.error("参数异常:unionId不能为空!", null);
|
|
return ResponseJson.error("参数异常:unionId不能为空!", null);
|
|
}
|
|
}
|
|
// 查询使用该手机号的运营人员或用户
|
|
// 查询使用该手机号的运营人员或用户
|
|
- String checkRust = operationBindCheck(mobile, smsCode);
|
|
|
|
|
|
+ String checkRust = commonService.operationBindCheck(mobile, smsCode);
|
|
if (checkRust != null) {
|
|
if (checkRust != null) {
|
|
return ResponseJson.error(checkRust, null);
|
|
return ResponseJson.error(checkRust, null);
|
|
}
|
|
}
|
|
@@ -637,59 +635,4 @@ public class LoginServiceImpl implements LoginService {
|
|
return ResponseJson.success("绑定微信成功", user);
|
|
return ResponseJson.success("绑定微信成功", user);
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 查询使用该手机号的运营人员或用户
|
|
|
|
- */
|
|
|
|
- private String operationBindCheck(String mobile, String smsCode) {
|
|
|
|
- // 手机号验证
|
|
|
|
- String result = commonService.mobileAndCodeValidate(mobile, smsCode);
|
|
|
|
- if (result != null) {
|
|
|
|
- // 查询使用该手机号的运营人员或用户
|
|
|
|
- UserLoginVo dbUser = loginMapper.getLoginUserByMobile(mobile);
|
|
|
|
- boolean offlineClub = false;
|
|
|
|
- boolean offlineShop = false;
|
|
|
|
- if (null != dbUser) {
|
|
|
|
- if (mobile.equals(dbUser.getBindMobile())) {
|
|
|
|
- // 判断运营人员手机号的唯一性
|
|
|
|
- Integer dbOperationId = baseMapper.getOperationIdByMobile(mobile);
|
|
|
|
- if (dbOperationId != null && dbOperationId > 0) {
|
|
|
|
- return "该手机号已注册并绑定微信,不能再次绑定!";
|
|
|
|
- }
|
|
|
|
- // 联系人作为运营人员,放行
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- // 已下线机构
|
|
|
|
- offlineClub = null != dbUser.getClubStatus() && 91 == dbUser.getClubStatus();
|
|
|
|
- // 已下线供应商
|
|
|
|
- offlineShop = null != dbUser.getShopStatus() && 91 == dbUser.getShopStatus();
|
|
|
|
- }
|
|
|
|
- if (offlineClub || offlineShop) {
|
|
|
|
- // 解绑已下线的运营人员
|
|
|
|
- unbindOperation(dbUser.getOperationId());
|
|
|
|
- return null;
|
|
|
|
- } else {
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 解绑运营人员
|
|
|
|
- *
|
|
|
|
- * @param operationId 运营人员Id
|
|
|
|
- */
|
|
|
|
- private void unbindOperation(Integer operationId) {
|
|
|
|
- OperationPo operation = new OperationPo();
|
|
|
|
- operation.setId(operationId);
|
|
|
|
- operation.setUnionId("");
|
|
|
|
- operation.setOpenId("");
|
|
|
|
- operation.setNickName("");
|
|
|
|
- operation.setBindTime(null);
|
|
|
|
- operation.setUpdateTime(new Date());
|
|
|
|
- operation.setStatus(1);
|
|
|
|
- operation.setDelFlag(1);
|
|
|
|
- // 解绑运营人员
|
|
|
|
- operationMapper.updateOperationByUnbind(operation);
|
|
|
|
- }
|
|
|
|
}
|
|
}
|