import
parent
473d237735
commit
8fe973c736
|
|
@ -1,9 +1,11 @@
|
|||
package org.qinan.safetyeval.infrastructure.remote;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.system.client.user.facade.UserFacade;
|
||||
import com.jjb.saas.system.client.user.request.UserAddCmd;
|
||||
import com.jjb.saas.system.client.user.request.UserPageQry;
|
||||
import com.jjb.saas.system.client.user.request.UserRoleUpdateCmd;
|
||||
import com.jjb.saas.system.client.user.response.UserCO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -44,14 +46,20 @@ public class SystemRemote {
|
|||
* @return userId
|
||||
*/
|
||||
public Long addUserIfAbsent(UserAddCmd userAddCmd) {
|
||||
SingleResponse<UserCO> userResponse = userFacade
|
||||
.getUserSignUrlByMobileAndTenantId(userAddCmd.getMobile(), userAddCmd.getTenantId());
|
||||
UserPageQry qry = new UserPageQry();
|
||||
qry.setAccount(userAddCmd.getAccount());
|
||||
qry.setTenantId(userAddCmd.getTenantId());
|
||||
PageResponse<UserCO> userResponse = userFacade.pageUser(qry);
|
||||
if (!userResponse.isSuccess()) {
|
||||
log.error("addUserIfAbsent find fail:{}", userResponse.getErrMessage());
|
||||
throw new com.alibaba.cola.exception.BizException(userResponse.getErrMessage());
|
||||
throw new BizException(userResponse.getErrCode(), userResponse.getErrMessage());
|
||||
}
|
||||
if (userResponse.getData() != null && userResponse.getData().getId() != null) {
|
||||
return userResponse.getData().getId();
|
||||
if (userResponse.getTotalCount() >= 1) {
|
||||
if (userResponse.getTotalCount() == 1) {
|
||||
return userResponse.getData().get(0).getId();
|
||||
}
|
||||
log.error("addUserIfAbsent find fail count:{}", userResponse.getErrMessage());
|
||||
throw new com.alibaba.cola.exception.BizException("账号查询到多条记录");
|
||||
}
|
||||
|
||||
// 新增用户
|
||||
|
|
|
|||
Loading…
Reference in New Issue