bug修改:148(历史数据导入报错,当前分类没有设置编码规则,未找父级的编码规则的bug);150(主数据新增时未先找当前层级的编码规则,再向上查找的bug)
| | |
| | | public Collection<CodeRuleVO> listCodeRuleByOids(Collection<String> oidCollections) throws VciBaseException { |
| | | VciBaseUtil.alertNotNull(oidCollections, "数据对象主键集合"); |
| | | List<CodeRule> codeRuleDOList = listCodeRuleDOByOidCollections(oidCollections); |
| | | return CodeRuleWrapper.build().listVO(codeRuleDOList); |
| | | return codeRuleDO2VOs(codeRuleDOList,true); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | List<CodeClassifyVO> parentClassifyVOList = fullInfoBO.getParentClassifyVOs().stream().sorted((o1, o2) -> o1.getDataLevel().compareTo(o2.getDataLevel())).collect(Collectors.toList()); |
| | | //从最高的level开始获取 |
| | | for (int i = 0; i < parentClassifyVOList.size(); i++) { |
| | | for (int i = parentClassifyVOList.size()-1; i >= 0; i--) { |
| | | CodeClassifyVO record = parentClassifyVOList.get(i); |
| | | if (StringUtils.isNotBlank(record.getCodeRuleOid())) { |
| | | codeRuleOid = record.getCodeRuleOid(); |
| | |
| | | if (CollectionUtils.isEmpty(ruleOidMap.values())) { |
| | | throw new VciBaseException("导入的数据所选择的分类都没有设置编码规则"); |
| | | } |
| | | Map<String, CodeRuleVO> ruleVOMap = ruleService.listCodeRuleByIds(ruleOidMap.values(), true).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); |
| | | // 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<>(); |
| | | checkSecLengthInHistory(cboList, classifyVOMap, ruleVOMap, ruleOidMap, errorMap, ruleRowIndexMap); |
| | |
| | | Map<String/**分类主键**/, String/**规则主键**/> ruleOidMap = new ConcurrentHashMap<String, String>(); |
| | | List<String> unExistRuleClassifyOidList = new CopyOnWriteArrayList<>(); |
| | | checkRuleOidInHistory(classifyVOMap, ruleOidMap, unExistRuleClassifyOidList); |
| | | ruleVOMap = ruleService.listCodeRuleByIds(ruleOidMap.values(), true).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); |
| | | // TODO 改用oid查询的,这儿不该用id |
| | | ruleVOMap = ruleService.listCodeRuleByOids(ruleOidMap.values()).stream().collect(Collectors.toMap(s -> s.getOid(), t -> t)); |
| | | |
| | | checkSecLengthInHistory(cboList, classifyVOMap, ruleVOMap, ruleOidMap, errorMap, ruleRowIndexMap); |
| | | } |