|
|
@ -488,9 +488,9 @@ public class SysUserInfoController extends CoreBaseController {
|
|
|
|
ExcelTool excelTool = new ExcelTool(entityManager, redisRes);
|
|
|
|
ExcelTool excelTool = new ExcelTool(entityManager, redisRes);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String filename = "userImportTemplate.xls";
|
|
|
|
String filename = "userImportTemplate.xls";
|
|
|
|
SysPosition positionBean = new SysPosition();
|
|
|
|
// SysPosition positionBean = new SysPosition();
|
|
|
|
positionBean.setOrganizeCode(AuthUtil.getOrganizeCode());
|
|
|
|
// positionBean.setOrganizeCode(AuthUtil.getOrganizeCode());
|
|
|
|
List<SysPosition> positionList = positionService.findAllByBaseBean(positionBean);
|
|
|
|
List<SysPosition> positionList = positionService.findAllByBaseBean();
|
|
|
|
Map<String, String> positionMap = positionList.stream().collect(Collectors.toMap(position -> position.getPositionCode(), position -> position.getName(), (oldKey, newkey) -> oldKey));
|
|
|
|
Map<String, String> positionMap = positionList.stream().collect(Collectors.toMap(position -> position.getPositionCode(), position -> position.getName(), (oldKey, newkey) -> oldKey));
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Map<String, String>> relatefildMap = new HashMap<>();
|
|
|
|
Map<String, Map<String, String>> relatefildMap = new HashMap<>();
|
|
|
@ -538,16 +538,17 @@ public class SysUserInfoController extends CoreBaseController {
|
|
|
|
List<UserInfoImportModel> userInfoList = validateAndDistinc(importModelList, faildList);
|
|
|
|
List<UserInfoImportModel> userInfoList = validateAndDistinc(importModelList, faildList);
|
|
|
|
|
|
|
|
|
|
|
|
//3.某些数据字段转换
|
|
|
|
//3.某些数据字段转换
|
|
|
|
SysPosition positionBean = new SysPosition();
|
|
|
|
// SysPosition positionBean = new SysPosition();
|
|
|
|
String organizationCode = AuthUtil.getOrganizeCode();
|
|
|
|
// String organizationCode = AuthUtil.getOrganizeCode();
|
|
|
|
positionBean.setOrganizeCode(organizationCode);
|
|
|
|
// positionBean.setOrganizeCode(organizationCode);
|
|
|
|
List<SysPosition> positionList = positionService.findAllByBaseBean(positionBean);
|
|
|
|
List<SysPosition> positionList = positionService.findAllByBaseBean();
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, String> positionMap = positionList.stream().collect(Collectors.toMap(position -> position.getPositionCode(), position -> String.valueOf(position.getId()), (oldKey, newkey) -> oldKey));
|
|
|
|
Map<String, String> positionMap = positionList.stream().collect(Collectors.toMap(position -> position.getPositionCode(), position -> String.valueOf(position.getId()), (oldKey, newkey) -> oldKey));
|
|
|
|
|
|
|
|
|
|
|
|
SysDepartment departmentBean = new SysDepartment();
|
|
|
|
// SysDepartment departmentBean = new SysDepartment();
|
|
|
|
departmentBean.setOrganizeCode(organizationCode);
|
|
|
|
// departmentBean.setOrganizeCode(organizationCode);
|
|
|
|
List<SysDepartment> departmentList = departmentService.findAllByBaseBean(departmentBean);
|
|
|
|
// List<SysDepartment> departmentList = departmentService.findAllByBaseBean(departmentBean);
|
|
|
|
|
|
|
|
List<SysDepartment> departmentList = departmentService.findAllByBaseBean();
|
|
|
|
//部门树
|
|
|
|
//部门树
|
|
|
|
List<SysDepartment> departmentTree = new ArrayList<>();
|
|
|
|
List<SysDepartment> departmentTree = new ArrayList<>();
|
|
|
|
//部门id的映射
|
|
|
|
//部门id的映射
|
|
|
@ -608,8 +609,8 @@ public class SysUserInfoController extends CoreBaseController {
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
LOGGER.error("导入人员数据出错", e);
|
|
|
|
LOGGER.error("导入人员数据出错", e);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
}finally{
|
|
|
|
} finally {
|
|
|
|
if(rLock.isHeldByCurrentThread()){
|
|
|
|
if (rLock.isHeldByCurrentThread()) {
|
|
|
|
rLock.unlock();
|
|
|
|
rLock.unlock();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|