🐛 管理端保存司机不再要求所属组织

This commit is contained in:
2026-10-25 19:30:50 +08:00
parent d3d2c9f116
commit 1d47015762
2 changed files with 57 additions and 5 deletions
@@ -383,9 +383,6 @@ public class DriverServiceImpl extends BaseServiceImpl<DriverMapper, Driver> imp
if (Func.isEmpty(driver.getMobile())) {
throw new ServiceException("手机号不能为空");
}
if (Func.isEmpty(driver.getOrganizationName())) {
throw new ServiceException("所属组织不能为空");
}
if (Func.isEmpty(driver.getEmergencyContactName())) {
throw new ServiceException("紧急联系人姓名不能为空");
}
@@ -475,7 +472,10 @@ public class DriverServiceImpl extends BaseServiceImpl<DriverMapper, Driver> imp
}
}
// 部门可选:匹配到则写入小程序用户,匹配不到不阻断同步
// 按「组织名称」反查组织树 id:组织改名后这里必然落空——不报错、不掉数据,
// 只是该司机账号的权限不再随组织变化(新建账号落空时数据权限为空集,管理端看不到)。
// 组织为空同样落空,此时 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())) {