| | |
| | | import com.vci.pagemodel.OrgDepartmentVO; |
| | | import com.vci.pagemodel.SmPasswordStrategyVO; |
| | | import com.vci.pagemodel.SmRoleVO; |
| | | import com.vci.frameworkcore.properties.ConfigReader; |
| | | import com.vci.frameworkcore.properties.ConfigCorbaReader; |
| | | import com.vci.omd.utils.ObjectTool; |
| | | import com.vci.starter.poi.bo.ReadExcelOption; |
| | | import com.vci.starter.poi.bo.WriteExcelData; |
| | |
| | | // 设置表单列名 |
| | | List<String> columns = new ArrayList<>(Arrays.asList("账号", "密码", "姓名", "电子邮箱", "专业", "描述", "部门(上下级部门之间以反斜杠隔开(/))")); |
| | | //获取是否导出密级配置项 |
| | | String flag = ConfigReader.getConfigValue("exportSecretGrade"); |
| | | String flag = ConfigCorbaReader.getConfigValue("exportSecretGrade"); |
| | | if (flag != null && flag.equalsIgnoreCase("true")) { |
| | | columns = new ArrayList<>(Arrays.asList("账号", "密码", "姓名", "电子邮箱", "专业", "描述", "部门(上下级部门之间以反斜杠隔开(/))" ,"密级")); |
| | | } |
| | |
| | | String loginUserId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(); |
| | | UserEntityInfo userEntityInfo = new UserEntityInfo(loginUserId,null); |
| | | //是否导入密级配置 |
| | | boolean exportSecretGrade = Boolean.parseBoolean(ConfigReader.getConfigValue("exportSecretGrade")); |
| | | boolean exportSecretGrade = Boolean.parseBoolean(ConfigCorbaReader.getConfigValue("exportSecretGrade")); |
| | | List<SmUserPO> poList = ExcelUtil.readDataObjectFromExcel(file, SmUserPO.class,excelOption,(value, po, fieldName)->{ |
| | | Integer secretValue = UserSecretEnum.getSecretValueByText(po.getSecretGradeText()); |
| | | //是否必须导入密级 |
| | |
| | | //当前excel中是否重复用的判重Map:(key:账号,value:行号) |
| | | Map<String, String> excelReapeat = new HashMap<>(); |
| | | //先获取全部部门名称的父子对应关系:key为部门子父级名称路径,value为部门信息 |
| | | Map<String,OrgDepartmentVO> deptVOMap = orgDeptQueryService.getDeptAllTreeMap(); |
| | | List<OrgDepartmentVO> orgDepartmentVOList = orgDeptQueryService.getDeptAllFullName(); |
| | | Map<String, OrgDepartmentVO> deptVOMap = orgDepartmentVOList.stream().collect(Collectors.toMap(OrgDepartmentVO::getFullDeptNamePath, s->s)); |
| | | //Map<String,OrgDepartmentVO> deptVOMap = orgDeptQueryService.getDeptAllTreeMap(); |
| | | //判断必填属性是否为空,用户是否已存在,以及部门是否填错等校验逻辑 |
| | | List<String> finalRepeatUserId = repeatUserId; |
| | | poList.stream().forEach(smUserPO -> { |