|
|
@ -8,10 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.huoran.common.constant.DelConstant; |
|
|
|
import com.huoran.common.constant.DelConstant; |
|
|
|
import com.huoran.common.constant.PlatformConstant; |
|
|
|
import com.huoran.common.constant.PlatformConstant; |
|
|
|
import com.huoran.common.constant.SMSTemplate; |
|
|
|
import com.huoran.common.constant.SMSTemplate; |
|
|
|
import com.huoran.common.entity.FilesResult; |
|
|
|
import com.huoran.common.entity.*; |
|
|
|
import com.huoran.common.entity.Student; |
|
|
|
import com.huoran.common.entity.Student; |
|
|
|
import com.huoran.common.entity.UserAccount; |
|
|
|
|
|
|
|
import com.huoran.common.entity.UserInfo; |
|
|
|
|
|
|
|
import com.huoran.common.entity.resp.PhoneBindingrResp; |
|
|
|
import com.huoran.common.entity.resp.PhoneBindingrResp; |
|
|
|
import com.huoran.common.exception.CustomException; |
|
|
|
import com.huoran.common.exception.CustomException; |
|
|
|
import com.huoran.common.exception.ExceptionEnum; |
|
|
|
import com.huoran.common.exception.ExceptionEnum; |
|
|
@ -20,6 +18,8 @@ import com.huoran.common.utils.AliyunOssUtil; |
|
|
|
import com.huoran.common.utils.DateUtil; |
|
|
|
import com.huoran.common.utils.DateUtil; |
|
|
|
import com.huoran.common.utils.MD5; |
|
|
|
import com.huoran.common.utils.MD5; |
|
|
|
import com.huoran.users.entity.*; |
|
|
|
import com.huoran.users.entity.*; |
|
|
|
|
|
|
|
import com.huoran.users.entity.EnterpriseCertification; |
|
|
|
|
|
|
|
import com.huoran.users.entity.UserAuthenticationInformation; |
|
|
|
import com.huoran.users.entity.req.*; |
|
|
|
import com.huoran.users.entity.req.*; |
|
|
|
import com.huoran.users.entity.res.*; |
|
|
|
import com.huoran.users.entity.res.*; |
|
|
|
import com.huoran.users.entity.vo.CheckVo; |
|
|
|
import com.huoran.users.entity.vo.CheckVo; |
|
|
@ -35,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
@ -142,6 +143,25 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
queryWrapper1.eq("open_id", openId); |
|
|
|
queryWrapper1.eq("open_id", openId); |
|
|
|
enterpriseCertificationService.remove(queryWrapper1); |
|
|
|
enterpriseCertificationService.remove(queryWrapper1); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
//删除组织信息,及组织下的用户信息
|
|
|
|
|
|
|
|
for (HrUserAccount hrUserAccount : accountList) { |
|
|
|
|
|
|
|
List<OrganizationInfo> organizationInfoList = baseMapper.selectOrganizationInfo(hrUserAccount.getAppOpenId()); |
|
|
|
|
|
|
|
if (organizationInfoList != null && organizationInfoList.size() > 0) { |
|
|
|
|
|
|
|
for (OrganizationInfo organizationInfo : organizationInfoList) { |
|
|
|
|
|
|
|
//如果是团队负责人,则删除自身团队及成员团队信息
|
|
|
|
|
|
|
|
if (organizationInfo.getIsTeam() == 1) { |
|
|
|
|
|
|
|
ArrayList<Integer> getTeamIds = baseMapper.selectTeamId(organizationInfo.getTeamId()); |
|
|
|
|
|
|
|
for (Integer teamId : getTeamIds) { |
|
|
|
|
|
|
|
baseMapper.deleteTeam(teamId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
//删除团队信息
|
|
|
|
|
|
|
|
baseMapper.deleteOrganization(organizationInfo.getAccountId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return delete > 0 ? R.ok("删除成功!") : R.error(); |
|
|
|
return delete > 0 ? R.ok("删除成功!") : R.error(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -355,11 +375,11 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
public String getAccountId(CheckVo checkVo) { |
|
|
|
public String getAccountId(CheckVo checkVo) { |
|
|
|
HrUserAccount hrUserAccount = hrUserAccountMapper. |
|
|
|
HrUserAccount hrUserAccount = hrUserAccountMapper. |
|
|
|
selectOne(new QueryWrapper<HrUserAccount>(). |
|
|
|
selectOne(new QueryWrapper<HrUserAccount>(). |
|
|
|
eq("school_id",checkVo.getSchoolId()). |
|
|
|
eq("school_id", checkVo.getSchoolId()). |
|
|
|
eq("work_number", checkVo.getAccount()). |
|
|
|
eq("work_number", checkVo.getAccount()). |
|
|
|
eq("type", checkVo.getMark()). |
|
|
|
eq("type", checkVo.getMark()). |
|
|
|
last(" and FIND_IN_SET( " + checkVo.getPlatform() + ", platform_id )"). |
|
|
|
last(" and FIND_IN_SET( " + checkVo.getPlatform() + ", platform_id )"). |
|
|
|
select("id")); |
|
|
|
select("id")); |
|
|
|
return hrUserAccount.getId().toString(); |
|
|
|
return hrUserAccount.getId().toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -417,7 +437,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
//查询账号详情List
|
|
|
|
//查询账号详情List
|
|
|
|
List<HrUserAccount> userAccountList = hrUserAccountMapper.selectList(new QueryWrapper<HrUserAccount>() |
|
|
|
List<HrUserAccount> userAccountList = hrUserAccountMapper.selectList(new QueryWrapper<HrUserAccount>() |
|
|
|
.eq("app_open_id", openId).orderByDesc("platform_id")); |
|
|
|
.eq("app_open_id", openId).orderByDesc("platform_id")); |
|
|
|
if (userAccountList.size() == 0){ |
|
|
|
if (userAccountList.size() == 0) { |
|
|
|
res.setStatus(true); |
|
|
|
res.setStatus(true); |
|
|
|
res.setMessage("用户不存在,请先重新登录注册!"); |
|
|
|
res.setMessage("用户不存在,请先重新登录注册!"); |
|
|
|
return res; |
|
|
|
return res; |
|
|
@ -427,7 +447,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
Integer userId = null; |
|
|
|
Integer userId = null; |
|
|
|
String phone = null; |
|
|
|
String phone = null; |
|
|
|
for (HrUserAccount hrUserAccount : userAccountList) { |
|
|
|
for (HrUserAccount hrUserAccount : userAccountList) { |
|
|
|
if (hrUserAccount.getPlatformId().equals("7")){ |
|
|
|
if (hrUserAccount.getPlatformId().equals("7")) { |
|
|
|
userId = hrUserAccount.getUserId(); |
|
|
|
userId = hrUserAccount.getUserId(); |
|
|
|
phone = hrUserAccount.getPhone(); |
|
|
|
phone = hrUserAccount.getPhone(); |
|
|
|
} |
|
|
|
} |
|
|
@ -438,7 +458,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
|
|
|
|
|
|
|
|
UserAuthenticationInformation authenticationInformation = userAuthenticationInformationMapper.selectOne( |
|
|
|
UserAuthenticationInformation authenticationInformation = userAuthenticationInformationMapper.selectOne( |
|
|
|
new QueryWrapper<UserAuthenticationInformation>().eq("open_id", openId)); |
|
|
|
new QueryWrapper<UserAuthenticationInformation>().eq("open_id", openId)); |
|
|
|
if (authenticationInformation!= null){ |
|
|
|
if (authenticationInformation != null) { |
|
|
|
hrUserInfo.setUserName(authenticationInformation.getRealName()); |
|
|
|
hrUserInfo.setUserName(authenticationInformation.getRealName()); |
|
|
|
hrUserInfo.setAuthentication("已认证"); |
|
|
|
hrUserInfo.setAuthentication("已认证"); |
|
|
|
hrUserInfo.setIdNumber(authenticationInformation.getIdCardNo()); |
|
|
|
hrUserInfo.setIdNumber(authenticationInformation.getIdCardNo()); |
|
|
@ -453,23 +473,23 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R updateAvatars(String openId, String url, String userName,String platformId) { |
|
|
|
public R updateAvatars(String openId, String url, String userName, String platformId) { |
|
|
|
//查询账号详情
|
|
|
|
//查询账号详情
|
|
|
|
HrUserAccount hrUserAccount = hrUserAccountMapper.selectOne(new QueryWrapper<HrUserAccount>() |
|
|
|
HrUserAccount hrUserAccount = hrUserAccountMapper.selectOne(new QueryWrapper<HrUserAccount>() |
|
|
|
.eq("app_open_id", openId).eq("platform_id", platformId)); |
|
|
|
.eq("app_open_id", openId).eq("platform_id", platformId)); |
|
|
|
|
|
|
|
|
|
|
|
//查询用户信息
|
|
|
|
//查询用户信息
|
|
|
|
HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(hrUserAccount.getUserId()); |
|
|
|
HrUserInfo hrUserInfo = hrUserInfoMapper.selectByUserId(hrUserAccount.getUserId()); |
|
|
|
if (StringUtils.isNotBlank(url)){ |
|
|
|
if (StringUtils.isNotBlank(url)) { |
|
|
|
hrUserInfo.setUserAvatars(url); |
|
|
|
hrUserInfo.setUserAvatars(url); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(userName)){ |
|
|
|
if (StringUtils.isNotBlank(userName)) { |
|
|
|
hrUserInfo.setUserName(userName); |
|
|
|
hrUserInfo.setUserName(userName); |
|
|
|
hrUserAccount.setAccount(userName); |
|
|
|
hrUserAccount.setAccount(userName); |
|
|
|
hrUserAccountMapper.updateById(hrUserAccount); |
|
|
|
hrUserAccountMapper.updateById(hrUserAccount); |
|
|
|
} |
|
|
|
} |
|
|
|
int update = hrUserInfoMapper.updateById(hrUserInfo); |
|
|
|
int update = hrUserInfoMapper.updateById(hrUserInfo); |
|
|
|
return update>0 ? R.ok():R.error(); |
|
|
|
return update > 0 ? R.ok() : R.error(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -551,14 +571,14 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
account.setId(accountId); |
|
|
|
account.setId(accountId); |
|
|
|
int updateCode = baseMapper.updateById(account); |
|
|
|
int updateCode = baseMapper.updateById(account); |
|
|
|
|
|
|
|
|
|
|
|
return updateCode>0?R.ok():R.error(); |
|
|
|
return updateCode > 0 ? R.ok() : R.error(); |
|
|
|
} |
|
|
|
} |
|
|
|
return R.error("更改失败!"); |
|
|
|
return R.error("更改失败!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Integer querySchoolIdByAccountId(String accountId) { |
|
|
|
public Integer querySchoolIdByAccountId(String accountId) { |
|
|
|
if (StringUtils.isEmpty(accountId)){ |
|
|
|
if (StringUtils.isEmpty(accountId)) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
HrUserAccount hrUserAccount = baseMapper.selectById(accountId); |
|
|
|
HrUserAccount hrUserAccount = baseMapper.selectById(accountId); |
|
|
@ -568,7 +588,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R studentAccountApplication(RegisterReq registerReq) { |
|
|
|
public R studentAccountApplication(RegisterReq registerReq) { |
|
|
|
|
|
|
|
|
|
|
|
if (registerReq.getIdentification() ==null || registerReq.getIdentification() != 1) { |
|
|
|
if (registerReq.getIdentification() == null || registerReq.getIdentification() != 1) { |
|
|
|
// 手机验证码验证
|
|
|
|
// 手机验证码验证
|
|
|
|
String key = StringUtils.join(registerReq.getPhone(), SMSTemplate.AUTHENTICATION_CODE); |
|
|
|
String key = StringUtils.join(registerReq.getPhone(), SMSTemplate.AUTHENTICATION_CODE); |
|
|
|
String value = stringRedisTemplate.opsForValue().get(key); |
|
|
|
String value = stringRedisTemplate.opsForValue().get(key); |
|
|
@ -631,7 +651,7 @@ public class HrUserAccountServiceImpl extends ServiceImpl<HrUserAccountMapper, H |
|
|
|
data.setToken((String) hashMap.get("token")); |
|
|
|
data.setToken((String) hashMap.get("token")); |
|
|
|
data.setCustomer(false); |
|
|
|
data.setCustomer(false); |
|
|
|
return R.ok("认证成功,欢迎 "+registerReq.getUserName()+" 回来!").put("data", data);*/ |
|
|
|
return R.ok("认证成功,欢迎 "+registerReq.getUserName()+" 回来!").put("data", data);*/ |
|
|
|
return save ? R.ok("账号申请已提交,需管理员审核,请10分钟后再登录").put("account",account.getId()) : R.error(); |
|
|
|
return save ? R.ok("账号申请已提交,需管理员审核,请10分钟后再登录").put("account", account.getId()) : R.error(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|