|
@@ -10,7 +10,6 @@ import com.google.gson.Gson;
|
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
import com.qmth.teachcloud.common.bean.auth.AuthBean;
|
|
|
import com.qmth.teachcloud.common.bean.dto.*;
|
|
|
-import com.qmth.teachcloud.common.bean.dto.excel.DescribeImportDto;
|
|
|
import com.qmth.teachcloud.common.bean.dto.excel.SysUserImportDto;
|
|
|
import com.qmth.teachcloud.common.bean.dto.excel.export.SysUserErrorExportDto;
|
|
|
import com.qmth.teachcloud.common.bean.params.ApproveUserResult;
|
|
@@ -22,7 +21,6 @@ import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
|
import com.qmth.teachcloud.common.entity.*;
|
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
|
import com.qmth.teachcloud.common.enums.userPush.SpecialPrivilegeEnum;
|
|
|
-import com.qmth.teachcloud.common.enums.userPush.UserPushResultEnum;
|
|
|
import com.qmth.teachcloud.common.mapper.SysUserMapper;
|
|
|
import com.qmth.teachcloud.common.service.*;
|
|
|
import com.qmth.teachcloud.common.util.*;
|
|
@@ -527,7 +525,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
SysUser checkCode = this.getOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getSchoolId, schoolId).eq(SysUser::getEnable, true).eq(SysUser::getCode, code));
|
|
|
if (Objects.nonNull(checkCode)) {
|
|
|
if (!checkCode.getId().equals(userSaveParams.getId())) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("用户工号[" + code + "]重复");
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("用户工号[" + code + "]在系统中已使用");
|
|
|
}
|
|
|
}
|
|
|
// 手机号检验
|
|
@@ -535,7 +533,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
SysUser checkMobileNumber = this.getOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getSchoolId, schoolId).eq(SysUser::getEnable, true).eq(SysUser::getMobileNumber, mobileNumber));
|
|
|
if (Objects.nonNull(checkMobileNumber)) {
|
|
|
if (!checkMobileNumber.getId().equals(userSaveParams.getId())) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("用户手机号[" + mobileNumber + "]重复");
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("用户手机号[" + mobileNumber + "]在系统中已使用");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -732,11 +730,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
@Transactional
|
|
|
@Override
|
|
|
public Map<String, Object> executeSysUserImportLogic(List<LinkedMultiValueMap<Integer, Object>> finalList, Map<String, Object> map) {
|
|
|
- List<SysUserErrorExportDto> errorDataList = JSON.parseArray(JSON.toJSONString(map.get(SystemConstant.ERROR_DATA_LIST)), SysUserErrorExportDto.class);
|
|
|
- if (Objects.isNull(errorDataList)) {
|
|
|
- errorDataList = new ArrayList<>();
|
|
|
- map.put(SystemConstant.ERROR_DATA_LIST, errorDataList);
|
|
|
- }
|
|
|
|
|
|
SysUser requestUser = (SysUser) map.get(SystemConstant.SYS_USER);
|
|
|
Long schoolId = requestUser.getSchoolId();
|
|
@@ -798,10 +791,19 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|
|
userIdList.add(upUserId);
|
|
|
} catch (Exception e) {
|
|
|
String error = e.getMessage();
|
|
|
+ List<SysUserErrorExportDto> errorDataList = JSON.parseArray(JSON.toJSONString(map.get(SystemConstant.ERROR_DATA_LIST)), SysUserErrorExportDto.class);
|
|
|
+ if (Objects.isNull(errorDataList)) {
|
|
|
+ errorDataList = new ArrayList<>();
|
|
|
+ }
|
|
|
SysUserErrorExportDto sysUserErrorExportDto = new SysUserErrorExportDto();
|
|
|
BeanUtils.copyProperties(sysUserImportDto, sysUserErrorExportDto);
|
|
|
sysUserErrorExportDto.setErrorMsg(error);
|
|
|
errorDataList.add(sysUserErrorExportDto);
|
|
|
+ map.put(SystemConstant.ERROR_DATA_LIST, errorDataList);
|
|
|
+
|
|
|
+ int dataCount = (int) map.get(SystemConstant.DATA_COUNT);
|
|
|
+ map.put(SystemConstant.SUCCESS_DATA_COUNT, dataCount - errorDataList.size());
|
|
|
+ map.put(SystemConstant.ERROR_DATA_COUNT, errorDataList.size());
|
|
|
}
|
|
|
}
|
|
|
}
|