|
|
|
@ -493,6 +493,13 @@ public class UserServiceImpl implements UserService { |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
// 2. 检查负责人的分配状态
|
|
|
|
if (selectedManager.getAllocationstatus() == null || selectedManager.getAllocationstatus() != 1) { |
|
|
|
result.put("success", false); |
|
|
|
result.put("message", "该负责人不允许分配客户"); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
// 2. 遍历客户ID列表,为每个客户分配负责人
|
|
|
|
for (String userId : userIds) { |
|
|
|
// 3. 检查客户是否已经在usersmanagements表中有记录
|
|
|
|
@ -589,4 +596,47 @@ public class UserServiceImpl implements UserService { |
|
|
|
tra.setOperationEvent("跟进系统-" + operationEvent); |
|
|
|
return tra; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Map<String, Object> updateAllocationStatus(List<Map<String, Object>> params) { |
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
|
|
|
try { |
|
|
|
if (params == null || params.isEmpty()) { |
|
|
|
result.put("success", false); |
|
|
|
result.put("message", "缺少必要参数"); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
// 遍历权限设置列表,更新每个负责人的分配状态
|
|
|
|
for (Map<String, Object> param : params) { |
|
|
|
String managerId = (String) param.get("managerId"); |
|
|
|
Integer allocationstatus = (Integer) param.get("allocationstatus"); |
|
|
|
|
|
|
|
if (managerId == null || allocationstatus == null) { |
|
|
|
result.put("success", false); |
|
|
|
result.put("message", "参数格式错误"); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
// 构建参数Map
|
|
|
|
Map<String, Object> updateParam = new HashMap<>(); |
|
|
|
updateParam.put("managerId", managerId); |
|
|
|
updateParam.put("allocationstatus", allocationstatus); |
|
|
|
|
|
|
|
// 执行更新操作
|
|
|
|
managersMapper.updateAllocationStatus(updateParam); |
|
|
|
} |
|
|
|
|
|
|
|
result.put("success", true); |
|
|
|
result.put("message", "权限设置更新成功"); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
result.put("success", false); |
|
|
|
result.put("message", "权限设置更新失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|