🐛 空组织司机保存时不再发起组织反查
This commit is contained in:
+8
-5
@@ -474,12 +474,15 @@ public class DriverServiceImpl extends BaseServiceImpl<DriverMapper, Driver> imp
|
||||
|
||||
// 按「组织名称」反查组织树 id:组织改名后这里必然落空——不报错、不掉数据,
|
||||
// 只是该司机账号的权限不再随组织变化(新建账号落空时数据权限为空集,管理端看不到)。
|
||||
// 组织为空同样落空,此时 deptId 传 null 而不是空串:updateUser 的 updateById 忽略 null,
|
||||
// 账号原有的组织与数据权限得以保留;写成空串会把它们覆盖掉。
|
||||
// 组织为空时不做反查:DeptServiceImpl 会把空名称拆成空集合,MyBatis-Plus 的 inExpression
|
||||
// 对空集合拼出 dept_name IN () 非法子句。此时 deptId 保持 null 而不是空串:updateUser 的
|
||||
// updateById 忽略 null,账号原有的组织与数据权限得以保留;写成空串会把它们覆盖掉。
|
||||
String deptId = null;
|
||||
R<String> deptResult = sysClient.getDeptIds(tenantId, driver.getOrganizationName());
|
||||
if (deptResult != null && R.isSuccess(deptResult) && Func.isNotEmpty(deptResult.getData())) {
|
||||
deptId = deptResult.getData();
|
||||
if (Func.isNotEmpty(driver.getOrganizationName())) {
|
||||
R<String> deptResult = sysClient.getDeptIds(tenantId, driver.getOrganizationName());
|
||||
if (deptResult != null && R.isSuccess(deptResult) && Func.isNotEmpty(deptResult.getData())) {
|
||||
deptId = deptResult.getData();
|
||||
}
|
||||
}
|
||||
|
||||
MpUser existing = findExistingMpUser(driver, tenantId, mobile);
|
||||
|
||||
Reference in New Issue
Block a user