|
|
@@ -4,6 +4,7 @@ import cn.com.taiji.common.manager.net.http.ServiceHandleException; |
|
|
|
import cn.com.taiji.core.entity.dict.basic.SourceType; |
|
|
|
import cn.com.taiji.core.entity.log.IasInterfaceLog; |
|
|
|
import cn.com.taiji.core.entity.user.AccountInfo; |
|
|
|
import cn.com.taiji.core.entity.user.Staff; |
|
|
|
import cn.com.taiji.core.manager.cache.RedisKeyGenerator; |
|
|
|
import cn.com.taiji.core.manager.comm.LogManager; |
|
|
|
import cn.com.taiji.core.model.comm.protocol.ias.portal.ChangeMobileByCodeRequest; |
|
|
@@ -11,6 +12,7 @@ import cn.com.taiji.core.model.comm.protocol.ias.portal.ChangeMobileByCodeRespon |
|
|
|
import cn.com.taiji.core.model.comm.protocol.valid.GlyServiceError; |
|
|
|
import cn.com.taiji.core.repo.jpa.log.IasInterfaceLogRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.user.AccountInfoRepo; |
|
|
|
import cn.com.taiji.core.repo.jpa.user.StaffRepo; |
|
|
|
import com.google.common.collect.Lists; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@@ -27,6 +29,8 @@ public class ChangeMobileByCodeManager extends AbstractLoginManager implements L |
|
|
|
private AccountInfoRepo accountInfoRepo; |
|
|
|
@Autowired |
|
|
|
private IasInterfaceLogRepo logRepo; |
|
|
|
@Autowired |
|
|
|
private StaffRepo staffRepo; |
|
|
|
|
|
|
|
public ChangeMobileByCodeResponse serviceHandle(ChangeMobileByCodeRequest request) throws ServiceHandleException { |
|
|
|
try { |
|
|
@@ -50,6 +54,12 @@ public class ChangeMobileByCodeManager extends AbstractLoginManager implements L |
|
|
|
accountInfo.setMobile(request.getNewMobile()); |
|
|
|
accountInfo.setUpdateTime(LocalDateTime.now()); |
|
|
|
accountInfoRepo.save(accountInfo); |
|
|
|
Staff staff = staffRepo.findByOpenId(accountInfo.getOpenId()); |
|
|
|
if (staff!=null){ |
|
|
|
staff.setStaffId(request.getNewMobile()); |
|
|
|
staff.setMobile(request.getNewMobile()); |
|
|
|
staffRepo.merge(staff); |
|
|
|
} |
|
|
|
redisManager.delete(RedisKeyGenerator.getSmsCodeKey(request.getNewMobile(), request.getLoginSource().name(), 3)); |
|
|
|
deleteTokenCache(request.getAccessToken()); |
|
|
|
return onSuccess(request, new ChangeMobileByCodeResponse(), IasInterfaceLog.class, System.currentTimeMillis() - begin); |