| | |
| | | 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; |
| | |
| | | //我们需要先查询一下,内容是否已经存在 |
| | | 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)) { |
| | |
| | | } |
| | | } |
| | | |
| | | /****** |
| | | /** |
| | | * 根据编码规则缓存数据 |
| | | * @param uuid |
| | | * @param codeImprotDataVOs |
| | |
| | | }); |
| | | } |
| | | |
| | | /**** |
| | | /** |
| | | * 数据相似项数据校验redis缓存 |
| | | * @param codeClassifyOid |
| | | * @param templateVO |