|
@@ -154,19 +154,17 @@ public class TAdminController {
|
|
|
param.setAdminId(null);
|
|
|
LambdaQueryWrapper<TAdmin> query = Wrappers.lambdaQuery();
|
|
|
query.eq(TAdmin::getUsername, param.getUsername());
|
|
|
-// List<TAdmin> list = tAdminService.list(query);
|
|
|
TAdmin admin = tAdminService.getOne(query);
|
|
|
if (admin != null) {
|
|
|
return R.fail(ResponseCodesEnum.A0201);
|
|
|
}
|
|
|
TAdmin entity = BeanUtil.copyProperties(param, TAdmin.class);
|
|
|
entity.setParentId(parentId);
|
|
|
- if (parentId.toString().equals("1")) {
|
|
|
- entity.setType(1);
|
|
|
+ if (param.getType() != null) {
|
|
|
+ entity.setType(param.getType());
|
|
|
} else {
|
|
|
entity.setType(3);
|
|
|
}
|
|
|
-// entity.setParentId(34l);
|
|
|
entity.setIsAdmined(false);
|
|
|
entity.setCreateDate(now);
|
|
|
entity.setModifyDate(now);
|
|
@@ -175,13 +173,13 @@ public class TAdminController {
|
|
|
entity.setLoginFailureCount(0);
|
|
|
entity.setEmail(param.getEmail());
|
|
|
entity.setPhone(param.getPhone());
|
|
|
- entity.setCompanyType(param.getCompanyType()); // 公司平台
|
|
|
+ entity.setCompanyType(param.getCompanyType());
|
|
|
//获取父账号信息
|
|
|
TAdmin parentAdmin = tAdminService.getById(parentId);
|
|
|
entity.setIfForeign(parentAdmin.getIfForeign());
|
|
|
tAdminService.save(entity);
|
|
|
String ifForeign = parentAdmin.getIfForeign();
|
|
|
- if ("1".equals(ifForeign)) { // 海外子账户,新建一个 Airwallex 钱包账户
|
|
|
+ if ("1".equals(ifForeign)) {
|
|
|
TAirwallexWallet wallet = new TAirwallexWallet();
|
|
|
wallet.setAdminId(entity.getId());
|
|
|
payFeign.saveAirwallexWallet(wallet);
|
|
@@ -359,7 +357,7 @@ public class TAdminController {
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(adminId)) {
|
|
|
if (adminId.equals("18")) {
|
|
|
- query.eq(TAdmin::getType, "1");
|
|
|
+ query.eq(TAdmin::getType, "1").or().eq(TAdmin::getType, "4");
|
|
|
} else {
|
|
|
query.eq(TAdmin::getType, "3");
|
|
|
}
|
|
@@ -411,9 +409,6 @@ public class TAdminController {
|
|
|
} else {
|
|
|
roleName.append(sysRole.getRoleName());
|
|
|
}
|
|
|
-// addLoginUserParam.setRoleName(roleName);
|
|
|
-// List<String> list2 = Arrays.asList(sysRole.getMenuCodesJson().split(","));
|
|
|
-// addLoginUserParam.setRoleList(list2);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -451,7 +446,7 @@ public class TAdminController {
|
|
|
if (admin == null) {
|
|
|
return R.fail(ResponseCodesEnum.A0100, "邀请码不存在!");
|
|
|
}
|
|
|
- if (admin.getType() != 1) {
|
|
|
+ if (admin.getType() != 4) {
|
|
|
return R.fail(ResponseCodesEnum.A0100, "邀请码不存在!");
|
|
|
}
|
|
|
}
|