Browse Source

Add user operation record functionality and fix filter refresh issue

pull/1/head
Trae AI 2 months ago
parent
commit
1216c10082
  1. 150
      web/src/main/java/com/example/web/entity/InformationTra.java
  2. 44
      web/src/main/java/com/example/web/mapper/InformationTraMapper.java
  3. 3
      web/src/main/java/com/example/web/mapper/UsersMapper.java
  4. 37
      web/src/main/java/com/example/web/service/InformationTraService.java
  5. 97
      web/src/main/java/com/example/web/service/impl/InformationTraServiceImpl.java
  6. 141
      web/src/main/java/com/example/web/service/impl/UserServiceImpl.java
  7. 75
      web/src/main/resources/mapper/InformationTraMapper.xml
  8. 4
      web/src/main/resources/mapper/UsersMapper.xml
  9. 41
      web/src/main/resources/static/index.html

150
web/src/main/java/com/example/web/entity/InformationTra.java

@ -0,0 +1,150 @@
package com.example.web.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
/**
* 信息跟踪表实体类
*/
@Data
@NoArgsConstructor
public class InformationTra {
private Integer id; // 主键ID
private String tracompany; // 修改者公司
private String tradepartment; // 修改者部门
private String traorganization; // 修改者组织
private String trarole; // 修改者角色
private String trauserName; // 修改者名字
private String traassistant; // 修改协助人
private String userId; // 客户ID
private String operationEvent; // 操作事件
private LocalDateTime operationTime; // 操作时间
private LocalDateTime created_at; // 创建时间
private LocalDateTime updated_at; // 更新时间
private String originalData; // 原始数据JSON
private String modifiedData; // 修改后数据JSON
private String changedFields; // 变更字段列表JSON
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTracompany() {
return tracompany;
}
public void setTracompany(String tracompany) {
this.tracompany = tracompany;
}
public String getTradepartment() {
return tradepartment;
}
public void setTradepartment(String tradepartment) {
this.tradepartment = tradepartment;
}
public String getTraorganization() {
return traorganization;
}
public void setTraorganization(String traorganization) {
this.traorganization = traorganization;
}
public String getTrarole() {
return trarole;
}
public void setTrarole(String trarole) {
this.trarole = trarole;
}
public String getTrauserName() {
return trauserName;
}
public void setTrauserName(String trauserName) {
this.trauserName = trauserName;
}
public String getTraassistant() {
return traassistant;
}
public void setTraassistant(String traassistant) {
this.traassistant = traassistant;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getOperationEvent() {
return operationEvent;
}
public void setOperationEvent(String operationEvent) {
this.operationEvent = operationEvent;
}
public LocalDateTime getOperationTime() {
return operationTime;
}
public void setOperationTime(LocalDateTime operationTime) {
this.operationTime = operationTime;
}
public LocalDateTime getCreated_at() {
return created_at;
}
public void setCreated_at(LocalDateTime created_at) {
this.created_at = created_at;
}
public LocalDateTime getUpdated_at() {
return updated_at;
}
public void setUpdated_at(LocalDateTime updated_at) {
this.updated_at = updated_at;
}
public String getOriginalData() {
return originalData;
}
public void setOriginalData(String originalData) {
this.originalData = originalData;
}
public String getModifiedData() {
return modifiedData;
}
public void setModifiedData(String modifiedData) {
this.modifiedData = modifiedData;
}
public String getChangedFields() {
return changedFields;
}
public void setChangedFields(String changedFields) {
this.changedFields = changedFields;
}
}

44
web/src/main/java/com/example/web/mapper/InformationTraMapper.java

@ -0,0 +1,44 @@
package com.example.web.mapper;
import com.example.web.annotation.DataSource;
import com.example.web.entity.InformationTra;
import org.apache.ibatis.annotations.Mapper;
/**
* 信息跟踪表Mapper
*/
@Mapper
public interface InformationTraMapper {
/**
* 插入信息跟踪记录
* @param informationTra 信息跟踪实体
* @return 影响行数
*/
@DataSource("wechat")
int insert(InformationTra informationTra);
/**
* 根据用户ID查询最新的跟踪记录
* @param userId 用户ID
* @return 信息跟踪实体
*/
@DataSource("wechat")
InformationTra selectLatestByUserId(String userId);
/**
* 根据ID查询跟踪记录
* @param id 主键ID
* @return 信息跟踪实体
*/
@DataSource("wechat")
InformationTra selectById(Integer id);
/**
* 更新跟踪记录
* @param informationTra 信息跟踪实体
* @return 影响行数
*/
@DataSource("wechat")
int update(InformationTra informationTra);
}

3
web/src/main/java/com/example/web/mapper/UsersMapper.java

@ -60,4 +60,7 @@ public interface UsersMapper {
@DataSource("wechat") @DataSource("wechat")
int clearUsersManagements(Map<String, Object> params); int clearUsersManagements(Map<String, Object> params);
@DataSource("wechat")
Users findByUserId(String userId);
} }

37
web/src/main/java/com/example/web/service/InformationTraService.java

@ -0,0 +1,37 @@
package com.example.web.service;
import com.example.web.entity.InformationTra;
/**
* 信息跟踪服务接口
*/
public interface InformationTraService {
/**
* 记录用户操作
* @param informationTra 信息跟踪实体
* @return 是否成功
*/
boolean recordUserOperation(InformationTra informationTra);
/**
* 根据用户ID查询最新的操作记录
* @param userId 用户ID
* @return 信息跟踪实体
*/
InformationTra getLatestOperationByUserId(String userId);
/**
* 根据ID查询操作记录
* @param id 主键ID
* @return 信息跟踪实体
*/
InformationTra getOperationById(Integer id);
/**
* 更新操作记录
* @param informationTra 信息跟踪实体
* @return 是否成功
*/
boolean updateOperation(InformationTra informationTra);
}

97
web/src/main/java/com/example/web/service/impl/InformationTraServiceImpl.java

@ -0,0 +1,97 @@
package com.example.web.service.impl;
import com.example.web.entity.InformationTra;
import com.example.web.mapper.InformationTraMapper;
import com.example.web.service.InformationTraService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
/**
* 信息跟踪服务实现类
*/
@Service
public class InformationTraServiceImpl implements InformationTraService {
@Autowired
private InformationTraMapper informationTraMapper;
/**
* 记录用户操作
* @param informationTra 信息跟踪实体
* @return 是否成功
*/
@Override
public boolean recordUserOperation(InformationTra informationTra) {
try {
// 设置操作时间和创建时间
if (informationTra.getOperationTime() == null) {
informationTra.setOperationTime(LocalDateTime.now());
}
if (informationTra.getCreated_at() == null) {
informationTra.setCreated_at(LocalDateTime.now());
}
if (informationTra.getUpdated_at() == null) {
informationTra.setUpdated_at(LocalDateTime.now());
}
// 插入记录
int result = informationTraMapper.insert(informationTra);
return result > 0;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
/**
* 根据用户ID查询最新的操作记录
* @param userId 用户ID
* @return 信息跟踪实体
*/
@Override
public InformationTra getLatestOperationByUserId(String userId) {
try {
return informationTraMapper.selectLatestByUserId(userId);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 根据ID查询操作记录
* @param id 主键ID
* @return 信息跟踪实体
*/
@Override
public InformationTra getOperationById(Integer id) {
try {
return informationTraMapper.selectById(id);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 更新操作记录
* @param informationTra 信息跟踪实体
* @return 是否成功
*/
@Override
public boolean updateOperation(InformationTra informationTra) {
try {
// 设置更新时间
if (informationTra.getUpdated_at() == null) {
informationTra.setUpdated_at(LocalDateTime.now());
}
// 更新记录
int result = informationTraMapper.update(informationTra);
return result > 0;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
}

141
web/src/main/java/com/example/web/service/impl/UserServiceImpl.java

@ -1,11 +1,13 @@
package com.example.web.service.impl; package com.example.web.service.impl;
import com.example.web.entity.InformationTra;
import com.example.web.entity.Managers; import com.example.web.entity.Managers;
import com.example.web.entity.Users; import com.example.web.entity.Users;
import com.example.web.entity.UsersManagements; import com.example.web.entity.UsersManagements;
import com.example.web.mapper.ManagersMapper;
import com.example.web.mapper.UsersMapper; import com.example.web.mapper.UsersMapper;
import com.example.web.mapper.ManagersMapper;
import com.example.web.mapper.UsersManagementsMapper; import com.example.web.mapper.UsersManagementsMapper;
import com.example.web.service.InformationTraService;
import com.example.web.service.UserService; import com.example.web.service.UserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -26,6 +28,9 @@ public class UserServiceImpl implements UserService {
@Autowired @Autowired
private UsersManagementsMapper usersManagementsMapper; private UsersManagementsMapper usersManagementsMapper;
@Autowired
private InformationTraService informationTraService;
@Override @Override
public Map<String, Object> getUserList(Map<String, Object> requestParams) { public Map<String, Object> getUserList(Map<String, Object> requestParams) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -159,6 +164,12 @@ public class UserServiceImpl implements UserService {
try { try {
String userId = (String) params.get("userId"); String userId = (String) params.get("userId");
String followup = (String) params.get("followup"); String followup = (String) params.get("followup");
String userName = (String) params.get("userName");
String managercompany = (String) params.get("managercompany");
String managerdepartment = (String) params.get("managerdepartment");
String organization = (String) params.get("organization");
String role = (String) params.get("role");
String assistant = (String) params.get("assistant");
if (userId == null || followup == null) { if (userId == null || followup == null) {
result.put("success", false); result.put("success", false);
@ -169,6 +180,19 @@ public class UserServiceImpl implements UserService {
// 更新跟进信息 // 更新跟进信息
usersMapper.updateFollowup(params); usersMapper.updateFollowup(params);
// 记录跟进操作
InformationTra tra = createInformationTra(
managercompany,
managerdepartment,
organization,
role,
userName,
assistant,
userId,
"跟进客户: " + followup
);
informationTraService.recordUserOperation(tra);
result.put("success", true); result.put("success", true);
result.put("message", "跟进成功"); result.put("message", "跟进成功");
} catch (Exception e) { } catch (Exception e) {
@ -186,6 +210,11 @@ public class UserServiceImpl implements UserService {
try { try {
String userId = (String) params.get("userId"); String userId = (String) params.get("userId");
String userName = (String) params.get("userName"); String userName = (String) params.get("userName");
String managercompany = (String) params.get("managercompany");
String managerdepartment = (String) params.get("managerdepartment");
String organization = (String) params.get("organization");
String role = (String) params.get("role");
String assistant = (String) params.get("assistant");
if (userId == null || userName == null) { if (userId == null || userName == null) {
result.put("success", false); result.put("success", false);
@ -196,15 +225,22 @@ public class UserServiceImpl implements UserService {
// 1. 更新 usermanagements 表,为客户添加认领人信息 // 1. 更新 usermanagements 表,为客户添加认领人信息
usersMapper.updateUsersManagements(params); usersMapper.updateUsersManagements(params);
// 2. 更新 users 表,设置 followup 字段为认领人 // 2. 更新 users 表,设置 sync_status 为 0
Map<String, Object> followupParams = new HashMap<>();
followupParams.put("userId", userId);
followupParams.put("followup", userName);
usersMapper.updateFollowup(followupParams);
// 3. 更新 users 表,设置 sync_status 为 0
usersMapper.updateSyncStatus(params); usersMapper.updateSyncStatus(params);
// 记录认领操作
InformationTra tra = createInformationTra(
managercompany,
managerdepartment,
organization,
role,
userName,
assistant,
userId,
"认领客户"
);
informationTraService.recordUserOperation(tra);
result.put("success", true); result.put("success", true);
result.put("message", "认领成功"); result.put("message", "认领成功");
} catch (Exception e) { } catch (Exception e) {
@ -222,6 +258,12 @@ public class UserServiceImpl implements UserService {
try { try {
String userId = (String) params.get("userId"); String userId = (String) params.get("userId");
String type = (String) params.get("type"); String type = (String) params.get("type");
String userName = (String) params.get("userName");
String managercompany = (String) params.get("managercompany");
String managerdepartment = (String) params.get("managerdepartment");
String organization = (String) params.get("organization");
String role = (String) params.get("role");
String assistant = (String) params.get("assistant");
if (userId == null || type == null) { if (userId == null || type == null) {
result.put("success", false); result.put("success", false);
@ -235,6 +277,19 @@ public class UserServiceImpl implements UserService {
// 2. 清除 usermanagements 表中的记录 // 2. 清除 usermanagements 表中的记录
usersMapper.clearUsersManagements(params); usersMapper.clearUsersManagements(params);
// 记录归还操作
InformationTra tra = createInformationTra(
managercompany,
managerdepartment,
organization,
role,
userName,
assistant,
userId,
"归还客户到" + type
);
informationTraService.recordUserOperation(tra);
result.put("success", true); result.put("success", true);
result.put("message", "归还成功"); result.put("message", "归还成功");
} catch (Exception e) { } catch (Exception e) {
@ -251,6 +306,12 @@ public class UserServiceImpl implements UserService {
try { try {
String userId = (String) params.get("userId"); String userId = (String) params.get("userId");
String userName = (String) params.get("userName");
String managercompany = (String) params.get("managercompany");
String managerdepartment = (String) params.get("managerdepartment");
String organization = (String) params.get("organization");
String role = (String) params.get("role");
String assistant = (String) params.get("assistant");
if (userId == null) { if (userId == null) {
result.put("success", false); result.put("success", false);
@ -261,6 +322,19 @@ public class UserServiceImpl implements UserService {
// 更新 users 表,设置 sync_statuss 字段值为 0 // 更新 users 表,设置 sync_statuss 字段值为 0
usersMapper.updateSyncStatusToZero(params); usersMapper.updateSyncStatusToZero(params);
// 记录操作
InformationTra tra = createInformationTra(
managercompany,
managerdepartment,
organization,
role,
userName,
assistant,
userId,
"简道云操作"
);
informationTraService.recordUserOperation(tra);
result.put("success", true); result.put("success", true);
result.put("message", "操作成功"); result.put("message", "操作成功");
} catch (Exception e) { } catch (Exception e) {
@ -284,6 +358,11 @@ public class UserServiceImpl implements UserService {
List<String> userIds = (List<String>) params.get("userIds"); List<String> userIds = (List<String>) params.get("userIds");
String managerId = (String) params.get("managerId"); String managerId = (String) params.get("managerId");
String userName = (String) params.get("userName"); String userName = (String) params.get("userName");
String operatorUserName = (String) params.get("operatorUserName");
String managercompany = (String) params.get("managercompany");
String managerdepartment = (String) params.get("managerdepartment");
String organization = (String) params.get("organization");
String role = (String) params.get("role");
if (userIds == null || userIds.isEmpty() || managerId == null || userName == null) { if (userIds == null || userIds.isEmpty() || managerId == null || userName == null) {
result.put("success", false); result.put("success", false);
@ -339,6 +418,19 @@ public class UserServiceImpl implements UserService {
// 不更新users表的sync_status,保持原始值 // 不更新users表的sync_status,保持原始值
// usersMapper.updateSyncStatus(updateParams); // usersMapper.updateSyncStatus(updateParams);
// 记录分配操作
InformationTra tra = createInformationTra(
managercompany,
managerdepartment,
organization,
role,
operatorUserName,
"",
userId,
"分配负责人: " + selectedManager.getUserName()
);
informationTraService.recordUserOperation(tra);
} }
result.put("success", true); result.put("success", true);
@ -350,4 +442,37 @@ public class UserServiceImpl implements UserService {
return result; return result;
} }
/**
* 创建信息跟踪记录
* @param tracompany 修改者公司
* @param tradepartment 修改者部门
* @param traorganization 修改者组织
* @param trarole 修改者角色
* @param trauserName 修改者名字
* @param traassistant 修改协助人
* @param userId 客户ID
* @param operationEvent 操作事件
* @return 信息跟踪实体
*/
private InformationTra createInformationTra(
String tracompany,
String tradepartment,
String traorganization,
String trarole,
String trauserName,
String traassistant,
String userId,
String operationEvent) {
InformationTra tra = new InformationTra();
tra.setTracompany(tracompany);
tra.setTradepartment(tradepartment);
tra.setTraorganization(traorganization);
tra.setTrarole(trarole);
tra.setTrauserName(trauserName);
tra.setTraassistant(traassistant);
tra.setUserId(userId);
tra.setOperationEvent("跟进系统-" + operationEvent);
return tra;
}
} }

75
web/src/main/resources/mapper/InformationTraMapper.xml

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.web.mapper.InformationTraMapper">
<!-- 插入信息跟踪记录 -->
<insert id="insert" parameterType="com.example.web.entity.InformationTra">
INSERT INTO informationtra (
tracompany,
tradepartment,
traorganization,
trarole,
trauserName,
traassistant,
userId,
operationEvent,
operationTime,
created_at,
updated_at,
originalData,
modifiedData,
changedFields
) VALUES (
#{tracompany},
#{tradepartment},
#{traorganization},
#{trarole},
#{trauserName},
#{traassistant},
#{userId},
#{operationEvent},
#{operationTime},
#{created_at},
#{updated_at},
#{originalData},
#{modifiedData},
#{changedFields}
)
</insert>
<!-- 根据用户ID查询最新的跟踪记录 -->
<select id="selectLatestByUserId" parameterType="String" resultType="com.example.web.entity.InformationTra">
SELECT * FROM informationtra
WHERE userId = #{userId}
ORDER BY operationTime DESC
LIMIT 1
</select>
<!-- 根据ID查询跟踪记录 -->
<select id="selectById" parameterType="Integer" resultType="com.example.web.entity.InformationTra">
SELECT * FROM informationtra
WHERE id = #{id}
</select>
<!-- 更新跟踪记录 -->
<update id="update" parameterType="com.example.web.entity.InformationTra">
UPDATE informationtra SET
tracompany = #{tracompany},
tradepartment = #{tradepartment},
traorganization = #{traorganization},
trarole = #{trarole},
trauserName = #{trauserName},
traassistant = #{traassistant},
userId = #{userId},
operationEvent = #{operationEvent},
operationTime = #{operationTime},
updated_at = #{updated_at},
originalData = #{originalData},
modifiedData = #{modifiedData},
changedFields = #{changedFields}
WHERE id = #{id}
</update>
</mapper>

4
web/src/main/resources/mapper/UsersMapper.xml

@ -224,4 +224,8 @@
userName = '' userName = ''
WHERE userId = #{userId} WHERE userId = #{userId}
</update> </update>
<select id="findByUserId" parameterType="String" resultType="com.example.web.entity.Users">
SELECT * FROM users WHERE userId = #{userId}
</select>
</mapper> </mapper>

41
web/src/main/resources/static/index.html

@ -469,7 +469,8 @@
<button onclick="filterPersonalData('followed')" style="background-color: #faad14;">已跟进</button> <button onclick="filterPersonalData('followed')" style="background-color: #faad14;">已跟进</button>
<button onclick="filterPersonalData('unfollowed')" style="background-color: #ff4d4f;">未跟进</button> <button onclick="filterPersonalData('unfollowed')" style="background-color: #ff4d4f;">未跟进</button>
<button id="assignButton" onclick="openAssignModal()" style="background-color: #722ed1;">分配</button> <button id="assignButton" onclick="openAssignModal()" style="background-color: #722ed1;">分配</button>
<select id="personalPageSize" onchange="changePersonalPageSize()"> <span style="margin-left: 20px; font-size: 14px; color: #666;">总数: <span id="personalTotalCount">0</span></span>
<select id="personalPageSize" onchange="changePersonalPageSize()" style="margin-left: auto;">
<option value="10">10条/页</option> <option value="10">10条/页</option>
<option value="50">50条/页</option> <option value="50">50条/页</option>
<option value="100">100条/页</option> <option value="100">100条/页</option>
@ -637,6 +638,12 @@
var userName = userInfo.loginInfo.userName; var userName = userInfo.loginInfo.userName;
var usersManagements = userInfo.usersManagements; var usersManagements = userInfo.usersManagements;
// 如果当前是已跟进或未跟进筛选,重新加载所有数据后在前端筛选
if (personalFilter === 'followed' || personalFilter === 'unfollowed') {
loadAllPersonalData();
return;
}
// 构建查询参数 // 构建查询参数
var params = { var params = {
page: personalPage, page: personalPage,
@ -713,6 +720,7 @@
var managerHeader = document.getElementById('managerHeader'); var managerHeader = document.getElementById('managerHeader');
var personalPagination = document.getElementById('personalPagination'); var personalPagination = document.getElementById('personalPagination');
var selectAllPersonal = document.getElementById('selectAllPersonal'); var selectAllPersonal = document.getElementById('selectAllPersonal');
var personalTotalCount = document.getElementById('personalTotalCount');
personalBody.innerHTML = ''; personalBody.innerHTML = '';
// 检查用户角色,只对管理员显示负责人列和复选框列 // 检查用户角色,只对管理员显示负责人列和复选框列
@ -748,6 +756,9 @@
return true; return true;
}); });
// 更新统计信息
personalTotalCount.textContent = filteredUsers.length;
console.log('过滤后的数据量:', filteredUsers.length); console.log('过滤后的数据量:', filteredUsers.length);
if (filteredUsers.length > 0) { if (filteredUsers.length > 0) {
@ -1028,6 +1039,7 @@
var managerHeader = document.getElementById('managerHeader'); var managerHeader = document.getElementById('managerHeader');
var personalPagination = document.getElementById('personalPagination'); var personalPagination = document.getElementById('personalPagination');
var selectAllPersonal = document.getElementById('selectAllPersonal'); var selectAllPersonal = document.getElementById('selectAllPersonal');
var personalTotalCount = document.getElementById('personalTotalCount');
personalBody.innerHTML = ''; personalBody.innerHTML = '';
// 检查用户角色,只对管理员显示负责人列和复选框列 // 检查用户角色,只对管理员显示负责人列和复选框列
@ -1075,6 +1087,9 @@
return true; return true;
}); });
// 更新统计信息
personalTotalCount.textContent = data.total;
console.log('过滤后的数据量:', filteredUsers.length); console.log('过滤后的数据量:', filteredUsers.length);
if (filteredUsers.length > 0) { if (filteredUsers.length > 0) {
@ -1346,9 +1361,15 @@
function saveJianDaoYun() { function saveJianDaoYun() {
var userId = document.getElementById('jianDaoYunUserId').value; var userId = document.getElementById('jianDaoYunUserId').value;
var usersManagements = userInfo.usersManagements;
var params = { var params = {
userId: userId userId: userId,
userName: usersManagements.userName || '',
managercompany: usersManagements.managercompany || '',
managerdepartment: usersManagements.managerdepartment || '',
organization: usersManagements.organization || '',
role: usersManagements.role || ''
}; };
var url = 'http://8.137.125.67:8083/KH/api/users/jianDaoYun'; var url = 'http://8.137.125.67:8083/KH/api/users/jianDaoYun';
@ -1375,10 +1396,16 @@
function saveReturn() { function saveReturn() {
var userId = document.getElementById('returnUserId').value; var userId = document.getElementById('returnUserId').value;
var type = document.getElementById('returnType').value; var type = document.getElementById('returnType').value;
var usersManagements = userInfo.usersManagements;
var params = { var params = {
userId: userId, userId: userId,
type: type type: type,
userName: usersManagements.userName || '',
managercompany: usersManagements.managercompany || '',
managerdepartment: usersManagements.managerdepartment || '',
organization: usersManagements.organization || '',
role: usersManagements.role || ''
}; };
var url = 'http://8.137.125.67:8083/KH/api/users/return'; var url = 'http://8.137.125.67:8083/KH/api/users/return';
@ -1577,6 +1604,7 @@
function saveAssign() { function saveAssign() {
var checkboxes = document.querySelectorAll('.userCheckbox:checked'); var checkboxes = document.querySelectorAll('.userCheckbox:checked');
var selectedUserIds = []; var selectedUserIds = [];
var usersManagements = userInfo.usersManagements;
checkboxes.forEach(function(checkbox) { checkboxes.forEach(function(checkbox) {
selectedUserIds.push(checkbox.getAttribute('data-userid')); selectedUserIds.push(checkbox.getAttribute('data-userid'));
@ -1593,7 +1621,12 @@
var params = { var params = {
userIds: selectedUserIds, userIds: selectedUserIds,
managerId: selectedOption.value, managerId: selectedOption.value,
userName: selectedOption.textContent userName: selectedOption.textContent,
operatorUserName: usersManagements.userName || '',
managercompany: usersManagements.managercompany || '',
managerdepartment: usersManagements.managerdepartment || '',
organization: usersManagements.organization || '',
role: usersManagements.role || ''
}; };
var url = '/KH/api/users/assign'; var url = '/KH/api/users/assign';

Loading…
Cancel
Save