| | |
| | | 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)) { |
| | |
| | | private void getCodeOrderDTOs(CodeClassifyVO codeClassifyVO, CodeClassifyTemplateVO templateVO, Map<String, RowDatas> codeDataMap, Map<String, ClientBusinessObject> codeSystemObjectMap, List<CodeOrderDTO> codeOrderDTOList, Map<String, String> errorMap, boolean isCodeOrGroupCode) { |
| | | codeSystemObjectMap.keySet().forEach(code -> { |
| | | ClientBusinessObject sysDataObject = codeSystemObjectMap.get(code); |
| | | if (isCodeOrGroupCode) { |
| | | code = sysDataObject.getAttributeValue("GROUPCODE"); |
| | | /*if (isCodeOrGroupCode) { |
| | | // code = sysDataObject.getAttributeValue("GROUPCODE"); |
| | | if (StringUtils.isBlank(code)) { |
| | | code = sysDataObject.getId(); |
| | | } |
| | | }*/ |
| | | if(isCodeOrGroupCode){ |
| | | String groupCode=sysDataObject.getAttributeValue("GROUPCODE"); |
| | | if(codeDataMap.containsKey(groupCode)){ |
| | | code=groupCode; |
| | | } |
| | | } |
| | | CodeOrderDTO orderDTO = new CodeOrderDTO(); |
| | |
| | | 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(")"); |
| | |
| | | } |
| | | } |
| | | |
| | | /****** |
| | | /** |
| | | * 根据编码规则缓存数据 |
| | | * @param uuid |
| | | * @param codeImprotDataVOs |
| | |
| | | }); |
| | | } |
| | | |
| | | /**** |
| | | /** |
| | | * 数据相似项数据校验redis缓存 |
| | | * @param codeClassifyOid |
| | | * @param templateVO |