| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.nacos.common.utils.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.google.protobuf.ServiceException; |
| | | import com.vci.ubcs.code.applyjtcodeservice.feign.IMdmInterJtClient; |
| | |
| | | throw new VciBaseException("模板没有配置属性"); |
| | | } |
| | | } |
| | | //剔除掉默认的属性,以及表单不显示的属性 |
| | | List<CodeClassifyTemplateAttrVO> templateAttrVOS = codeClassifyTemplateAttrVOList.stream().filter(s -> |
| | | !DEFAULT_ATTR_LIST.contains(s.getId()) |
| | | && StringUtils.isBlank(s.getComponentRule()) |
| | |
| | | //我们需要先查询一下,内容是否已经存在 |
| | | if (!CollectionUtils.isEmpty(thisCbos)) { |
| | | List<String> existIds = new ArrayList<>(); |
| | | // TODO: 2024/12/3 Ludc 这儿查询做了修改改成组成一句sql查询,而不是分批次查询 |
| | | LambdaQueryWrapper<CodeAllCode> wrapper = Wrappers.<CodeAllCode>query().lambda() |
| | | .eq(CodeAllCode::getCodeRuleOid, ruleOid); |
| | | VciBaseUtil.switchCollectionForOracleIn(thisCbos).stream().forEach(cbos -> { |
| | | List<CodeAllCode> codeAllCodeList = codeAllCodeService.selectByWrapper(Wrappers.<CodeAllCode>query().lambda().eq(CodeAllCode::getCodeRuleOid, ruleOid) |
| | | .notIn(CodeAllCode::getId, cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])) |
| | | .notIn(CodeAllCode::getLcStatus, CodeAllCodeLC.TASK_BACK.getValue() + "','" + CodeAllCodeLC.OBSOLETED.getValue()) |
| | | ); |
| | | existIds.addAll(Optional.ofNullable(codeAllCodeList).orElseGet(() -> new ArrayList<>()).stream().map(s -> { |
| | | String id = s.getId(); |
| | | if (StringUtils.isBlank(id)) { |
| | | id = s.getId(); |
| | | } |
| | | return id; |
| | | }).collect(Collectors.toList())); |
| | | wrapper.notIn(CodeAllCode::getId, cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])); |
| | | }); |
| | | wrapper.notIn(CodeAllCode::getLcStatus, CodeAllCodeLC.TASK_BACK.getValue() + "','" + CodeAllCodeLC.OBSOLETED.getValue()); |
| | | List<CodeAllCode> codeAllCodeList = codeAllCodeService.selectByWrapper(wrapper); |
| | | existIds.addAll(Optional.ofNullable(codeAllCodeList).orElseGet(() -> new ArrayList<>()).stream().map(s -> { |
| | | String id = s.getId(); |
| | | if (StringUtils.isBlank(id)) { |
| | | id = s.getId(); |
| | | } |
| | | return id; |
| | | }).collect(Collectors.toList())); |
| | | List<String> existIdCbos = thisCbos.stream().filter(s -> { |
| | | String id = s.getId(); |
| | | if (StringUtils.isBlank(id)) { |
| | |
| | | StringBuffer sb = new StringBuffer(); |
| | | sb.append(" select id from "); |
| | | sb.append(finalTableName); |
| | | sb.append(" where 1=1 "); |
| | | //sb.append(" where 1 = 1"); |
| | | sb.append(" where lastr = 1 and lastv = 1"); //TODO:涉及到已升版的数据也应该排除掉,否则会报重 |
| | | sb.append(" and id in ("); |
| | | sb.append(VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0]))); |
| | | sb.append(")"); |
| | |
| | | if (Func.isNotEmpty(codeSynonymMaps)) { |
| | | codeSynonymMaps.keySet().stream().forEach(item -> { |
| | | synonymResString.append(item); |
| | | synonymResString.append(","); |
| | | synonymResString.append(","); |
| | | }); |
| | | } |
| | | resultVO.setSynonymRuleInfo(Func.isEmpty(codeSynonymMaps) ? "" : String.format("以下[%s]被设置了近义词查询规则的关键属性,中出现了重复:", synonymResString)); |
| | |
| | | // ,所以暂时将parallelStream改成了stream,改成了stream之后发现巨慢 |
| | | // customForkJoinPool控制并发度 |
| | | final List<ClientBusinessObject> finalCboList = cboList; |
| | | Map<String, List<CodeSynonym>> finalCodeSynonymMaps = codeSynonymMaps; |
| | | final Map<String, List<CodeSynonym>> finalCodeSynonymMaps = codeSynonymMaps; |
| | | List<ClientBusinessObject> repeatDataMap = (List<ClientBusinessObject>) customForkJoinPool.submit(() -> { |
| | | finalCboList.parallelStream().filter(cbo -> { |
| | | //每行都得查询.如果其中出现了错误,我们就直接抛出异常,其余的显示 |
| | |
| | | } |
| | | } |
| | | |
| | | /****** |
| | | /** |
| | | * 根据编码规则缓存数据 |
| | | * @param uuid |
| | | * @param codeImprotDataVOs |
| | |
| | | }); |
| | | } |
| | | |
| | | /**** |
| | | /** |
| | | * 数据相似项数据校验redis缓存 |
| | | * @param codeClassifyOid |
| | | * @param templateVO |