| | |
| | | if (CollectionUtils.isEmpty(ruleOidMap.values())) { |
| | | throw new VciBaseException("导入的数据所选择的分类都没有设置编码规则"); |
| | | } |
| | | // TODO: 改用oid查询规则的,别用id |
| | | // TODO: 该用oid查询规则的,别用id |
| | | Map<String, CodeRuleVO> ruleVOMap = ruleService.listCodeRuleByOids(ruleOidMap.values()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); |
| | | //校验编码规则和码段是否正确 |
| | | Map<String, List<String>> ruleRowIndexMap = new ConcurrentHashMap<>(); |
| | |
| | | total += commonsMapper.queryCountBySql(countSql); |
| | | } |
| | | }else{ |
| | | |
| | | total = commonsMapper.queryCountBySql(countSql); |
| | | } |
| | | List<String> selectFieldList = new ArrayList<>(); |
| | |
| | | |
| | | //都转换完了。需要批量检查 |
| | | //如果出错了,我们依然执行有效的数据,无效的数据写回到excel中 |
| | | |
| | | |
| | | Map<String,String> errorKeyMap=new HashMap<>(); |
| | | //1.分类注入 |
| | |
| | | }); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * excel转换为cbo的对象 |
| | | * @param classifyFullInfo 分类的全部信息 |
| | |
| | | ClientBusinessObject cbo=new ClientBusinessObject(); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(cbo, classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | rowData.getData().forEach((index,value)->{ |
| | | String field = fieldIndexMap.get(index); |
| | | String field = fieldIndexMap.get(index); |
| | | if (StringUtils.isBlank(field)) { |
| | | throw new VciBaseException("第" + (index + 1) + "列的标题在系统中不存在"); |
| | | } |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /*** |
| | | * 校验分类对应的模板信息 |
| | | * @param titleRowData |
| | |
| | | } |
| | | return codeClassifyTemplateVOList ; |
| | | } |
| | | |
| | | /** |
| | | * 从属性上获取参照的内容 |
| | | * @param attrVO 属性的信息 |
| | |
| | | if(StringUtils.isBlank(classifyPath)){ |
| | | classifyPath = "#current#"; |
| | | } |
| | | if ( !pathMap.containsKey(classifyPath)) { |
| | | if (!pathMap.containsKey(classifyPath)) { |
| | | String row_index = cbo.getAttributeValue(IMPORT_ROW_INDEX); |
| | | errorMap.put(row_index,errorMap.getOrDefault(row_index,"") + ";分类路径不存在"); |
| | | } else { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private List<ClientBusinessObject> ChangeMapTOClientBusinessObjects(List<Map<String,String>> oldDataMap){ |
| | | List<ClientBusinessObject> clientBusinessObjectList=new ArrayList<>(); |
| | | oldDataMap.stream().forEach(dataMap->{ |