| | |
| | | } |
| | | //当前excel中是否重复用的判重Map:(key:判重属性,value:行号) |
| | | Map<String, String> excelReapeat = new HashMap<>(); |
| | | //判断必填属性是否为空,用户是否已存在,以及部门是否填错等校验逻辑 |
| | | //判断必填属性是否为空等等 |
| | | List<String> finalRepeatEnumId = repeatEnumId; |
| | | newPOList.stream().forEach(osEnumPO -> { |
| | | if(Func.isBlank(osEnumPO.getId())){//枚举名 |
| | |
| | | throw new VciBaseException("第【"+osEnumPO.getRowIndex()+"】行数据,枚举名称只能为英文字母"); |
| | | }else if(excelReapeat.containsKey(osEnumPO.getId())){//枚举名表格中判重 |
| | | throw new VciBaseException("第【"+excelReapeat.get(osEnumPO.getId())+"】行和第【"+osEnumPO.getRowIndex()+"】行数据,枚举名重复"); |
| | | }else if (Func.isNotEmpty(osEnumVOList) && finalRepeatEnumId.contains(osEnumPO.getId())){//2、判断枚举名是否与系统中重复 |
| | | }else if (Func.isNotEmpty(finalRepeatEnumId) && finalRepeatEnumId.contains(osEnumPO.getId())){//2、判断枚举名是否与系统中重复 |
| | | throw new VciBaseException("第【"+osEnumPO.getRowIndex()+"】行,枚举名在系统中已经存在,请修改!"); |
| | | } |
| | | //先对枚举名excel中需要判重处理 |
| | |
| | | */ |
| | | private EnumType osEnumDTO2EnumType(OsEnumDTO osEnumDTO){ |
| | | EnumType enumType = new EnumType(); |
| | | enumType.oid = osEnumDTO.getOid(); |
| | | //enumType.oid = osEnumDTO.getOid(); |
| | | //枚举名统一转成小写,避免后期出现其他问题 |
| | | enumType.name = osEnumDTO.getId().toLowerCase(Locale.ROOT); |
| | | enumType.label = osEnumDTO.getName(); |