|
@@ -112,6 +112,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
@Resource
|
|
@Resource
|
|
SysRoleGroupMemberService sysRoleGroupMemberService;
|
|
SysRoleGroupMemberService sysRoleGroupMemberService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ CloudUserPushService cloudUserPushService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public IPage<UserDto> list(String loginName, String roleId, Boolean enable, String realName, Integer pageNumber, Integer pageSize) {
|
|
public IPage<UserDto> list(String loginName, String roleId, Boolean enable, String realName, Integer pageNumber, Integer pageSize) {
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
@@ -134,27 +137,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
- public boolean saveUser(UserSaveParams userSaveParams) throws IllegalAccessException {
|
|
|
|
- SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
|
|
|
|
- Long oldId = userSaveParams.getId();
|
|
|
|
- Set<Long> dbRoleIdSet = new HashSet<>();
|
|
|
|
- Set<Long> currentRoleIdSet = new HashSet<>(Arrays.asList(userSaveParams.getRoleIds()));
|
|
|
|
- if (SystemConstant.longNotNull(oldId)) {
|
|
|
|
- // 编辑
|
|
|
|
- dbRoleIdSet = new HashSet<>(sysRoleService.getUserRoles(oldId));
|
|
|
|
- }
|
|
|
|
- boolean result = false;
|
|
|
|
- Long upUserId = saveUserCommon(userSaveParams, null);
|
|
|
|
- if (SystemConstant.longNotNull(upUserId)) {
|
|
|
|
- result = true;
|
|
|
|
- //todo 云阅卷推送暂时去掉
|
|
|
|
-// List<PushUserTrack> pushUserTrackList = pushUserTrackService.createPushTrackUser(dbRoleIdSet, currentRoleIdSet, upUserId, this.getById(upUserId).getEnable(), requestUser.getId());
|
|
|
|
-// List<UserPushParam> userPushParamList = pushUserTrackService.analyzeUserPushSpecialPrivilege(pushUserTrackList);
|
|
|
|
-// if (userPushParamList != null && userPushParamList.size() > 0) {
|
|
|
|
-// this.userPushService(userPushParamList, requestUser.getId());
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
- return result;
|
|
|
|
|
|
+ public Long saveUser(UserSaveParams userSaveParams) {
|
|
|
|
+ return saveUserCommon(userSaveParams, null);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -705,7 +689,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
public Map<String, Object> executeSysUserImportLogic(List<LinkedMultiValueMap<Integer, Object>> finalList, Map<String, Object> map) {
|
|
public Map<String, Object> executeSysUserImportLogic(List<LinkedMultiValueMap<Integer, Object>> finalList, Map<String, Object> map) {
|
|
SysUser requestUser = (SysUser) map.get(SystemConstant.SYS_USER);
|
|
SysUser requestUser = (SysUser) map.get(SystemConstant.SYS_USER);
|
|
Long schoolId = requestUser.getSchoolId();
|
|
Long schoolId = requestUser.getSchoolId();
|
|
- List<UserPushParam> userPushParamList = new ArrayList<>();
|
|
|
|
|
|
+ List<Long> userIdList = new ArrayList<>();
|
|
for (int i = 0; i < finalList.size(); i++) {
|
|
for (int i = 0; i < finalList.size(); i++) {
|
|
LinkedMultiValueMap<Integer, Object> excelMap = finalList.get(i);
|
|
LinkedMultiValueMap<Integer, Object> excelMap = finalList.get(i);
|
|
List<Object> sysUserImportDtoList = excelMap.get(i);
|
|
List<Object> sysUserImportDtoList = excelMap.get(i);
|
|
@@ -730,7 +714,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
String code = sysUserImportDto.getCode();
|
|
String code = sysUserImportDto.getCode();
|
|
String phoneNumber = sysUserImportDto.getPhoneNumber();
|
|
String phoneNumber = sysUserImportDto.getPhoneNumber();
|
|
String orgName = sysUserImportDto.getOrgName();
|
|
String orgName = sysUserImportDto.getOrgName();
|
|
- if (!orgInfoMap.containsKey(orgName)){
|
|
|
|
|
|
+ if (!orgInfoMap.containsKey(orgName)) {
|
|
throw ExceptionResultEnum.ERROR.exception("在解析的机构map集合中,没有找到excel数据中的用户机构名称【" + orgName + "】");
|
|
throw ExceptionResultEnum.ERROR.exception("在解析的机构map集合中,没有找到excel数据中的用户机构名称【" + orgName + "】");
|
|
}
|
|
}
|
|
// 直接解析机构id
|
|
// 直接解析机构id
|
|
@@ -764,19 +748,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
userSaveParams.setCode(code);
|
|
userSaveParams.setCode(code);
|
|
userSaveParams.setSchoolId(schoolId);
|
|
userSaveParams.setSchoolId(schoolId);
|
|
Long upUserId = this.saveUserCommon(userSaveParams, requestUser.getId());
|
|
Long upUserId = this.saveUserCommon(userSaveParams, requestUser.getId());
|
|
- if (SystemConstant.longNotNull(upUserId)) {
|
|
|
|
-
|
|
|
|
- Set<Long> currentRoleIdSet = new HashSet<>(Arrays.asList(userSaveParams.getRoleIds()));
|
|
|
|
- List<PushUserTrack> pushUserTrackList = pushUserTrackService.createPushTrackUser(oldRoleIdSet, currentRoleIdSet, upUserId, true, requestUser.getId());
|
|
|
|
- List<UserPushParam> userPushParamCell = pushUserTrackService.analyzeUserPushSpecialPrivilege(pushUserTrackList);
|
|
|
|
- if (userPushParamCell != null && userPushParamCell.size() > 0) {
|
|
|
|
- userPushParamList.addAll(userPushParamCell);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ userIdList.add(upUserId);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- map.put("userPushParamList", userPushParamList);
|
|
|
|
|
|
+ map.put("userIdList", userIdList);
|
|
return map;
|
|
return map;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -854,6 +830,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
@Override
|
|
@Override
|
|
|
|
+ @Deprecated
|
|
public boolean userPushService(List<UserPushParam> userPushParamList, Long requestUserId) throws IllegalAccessException {
|
|
public boolean userPushService(List<UserPushParam> userPushParamList, Long requestUserId) throws IllegalAccessException {
|
|
SysUser requestUser = this.getById(requestUserId);
|
|
SysUser requestUser = this.getById(requestUserId);
|
|
if (Objects.isNull(requestUser)) {
|
|
if (Objects.isNull(requestUser)) {
|
|
@@ -862,7 +839,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
}
|
|
}
|
|
boolean result = true;
|
|
boolean result = true;
|
|
for (UserPushParam userPushParam : userPushParamList) {
|
|
for (UserPushParam userPushParam : userPushParamList) {
|
|
- boolean syncResult = stmmsUtils.syncUser(userPushParam);
|
|
|
|
|
|
+ boolean syncResult = stmmsUtils.syncUser(userPushParam).getSuccess();
|
|
if (!syncResult) {
|
|
if (!syncResult) {
|
|
log.warn("-----------------------------用户同步推送失败----------------------------");
|
|
log.warn("-----------------------------用户同步推送失败----------------------------");
|
|
result = false;
|
|
result = false;
|
|
@@ -1158,7 +1135,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
userBatchDisposeResult.setUserList(userList);
|
|
userBatchDisposeResult.setUserList(userList);
|
|
userBatchDisposeResult.setUserRoleList(sysUserRoleList);
|
|
userBatchDisposeResult.setUserRoleList(sysUserRoleList);
|
|
userBatchDisposeResult.setRemoveIdSet(willRemoveUserPri);
|
|
userBatchDisposeResult.setRemoveIdSet(willRemoveUserPri);
|
|
-
|
|
|
|
userBatchDisposeResult.setUpdateIdSet(willUpdateUserPri);
|
|
userBatchDisposeResult.setUpdateIdSet(willUpdateUserPri);
|
|
|
|
|
|
return userBatchDisposeResult;
|
|
return userBatchDisposeResult;
|
|
@@ -1190,10 +1166,14 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
LinkedHashSet<Long> roleIdList = new LinkedHashSet<>();
|
|
LinkedHashSet<Long> roleIdList = new LinkedHashSet<>();
|
|
String[] arr = roleName.split(SystemConstant.COMMA);
|
|
String[] arr = roleName.split(SystemConstant.COMMA);
|
|
for (String cell : arr) {
|
|
for (String cell : arr) {
|
|
- SysRole sysRole = sysRoleService.getOne(new QueryWrapper<SysRole>().lambda()
|
|
|
|
- .eq(SysRole::getEnable, true)
|
|
|
|
- .eq(SysRole::getName, cell)
|
|
|
|
- .eq(SysRole::getSchoolId, schoolId));
|
|
|
|
|
|
+ QueryWrapper<SysRole> sysRoleQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ sysRoleQueryWrapper.lambda().eq(SysRole::getEnable, true)
|
|
|
|
+ .eq(SysRole::getName, cell);
|
|
|
|
+ if (Objects.isNull(RoleTypeEnum.convertDescToEnum(cell))) {
|
|
|
|
+ // 自定义角色带学校id查
|
|
|
|
+ sysRoleQueryWrapper.lambda().eq(SysRole::getSchoolId, schoolId);
|
|
|
|
+ }
|
|
|
|
+ SysRole sysRole = sysRoleService.getOne(sysRoleQueryWrapper);
|
|
if (Objects.isNull(sysRole)) {
|
|
if (Objects.isNull(sysRole)) {
|
|
throw ExceptionResultEnum.ERROR.exception("系统中不存在excel导入的角色【" + cell + "】");
|
|
throw ExceptionResultEnum.ERROR.exception("系统中不存在excel导入的角色【" + cell + "】");
|
|
}
|
|
}
|
|
@@ -1209,6 +1189,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
* @param enable 启用/禁用
|
|
* @param enable 启用/禁用
|
|
* @param requestUserId 请求人id
|
|
* @param requestUserId 请求人id
|
|
*/
|
|
*/
|
|
|
|
+ @Deprecated
|
|
private void analyzeUserEnableSpecialPrivilege(Long userId, boolean enable, Long requestUserId) throws IllegalAccessException {
|
|
private void analyzeUserEnableSpecialPrivilege(Long userId, boolean enable, Long requestUserId) throws IllegalAccessException {
|
|
SysUser dbUser = sysUserService.getById(userId);
|
|
SysUser dbUser = sysUserService.getById(userId);
|
|
if (Objects.isNull(dbUser)) {
|
|
if (Objects.isNull(dbUser)) {
|