ludc
2023-10-09 34325189f01b0560ebea5ca719877a3d380bbb8c
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
@@ -95,6 +95,7 @@
//         SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo();
         List<CodeAllCode> allCodeDOList = new ArrayList<>();
         Map<String/**流水依据**/, Map<String/**码段的主键**/,Double/**最大流水号**/>> maxSerialMap = new HashMap<>();
         // TODO 多线程流引发的问题已修改
         dataCBOList.parallelStream().forEach(cbo->{
//            VciBaseUtil.setCurrentUserSessionInfo(sessionInfo);
            String code = cbo.getId();
@@ -518,7 +519,7 @@
                  secValue = classifyFullInfoBO.getCurrentClassifyVO().getId();
               } else {
                  //我们需要从顶层开始找到当前分类为止
                  secValue = classifyFullInfoBO.getParentClassifyVOs().stream().sorted(((o1, o2) -> o1.getDataLevel().compareTo(o2.getDataLevel()))).map(CodeClassifyVO::getId).collect(Collectors.joining()) + classifyFullInfoBO.getCurrentClassifyVO().getId();
                  secValue = classifyFullInfoBO.getParentClassifyVOs().stream().sorted(((o1, o2) -> -o1.getDataLevel().compareTo(o2.getDataLevel()))).map(CodeClassifyVO::getId).collect(Collectors.joining()) + classifyFullInfoBO.getCurrentClassifyVO().getId();
               }
            } else {
               //指定层,我们需要通过上级的来获取
@@ -527,7 +528,7 @@
                  secValue = classifyFullInfoBO.getCurrentClassifyVO().getId();
               } else {
                  //这个我们需要看看,层级是不是大于了最大层级的数
                  List<CodeClassifyVO> parentClassifyVOList = classifyFullInfoBO.getParentClassifyVOs().stream().sorted(((o1, o2) -> o1.getDataLevel().compareTo(o2.getDataLevel()))).collect(Collectors.toList());
                  List<CodeClassifyVO> parentClassifyVOList = classifyFullInfoBO.getParentClassifyVOs().stream().sorted(((o1, o2) -> -o1.getDataLevel().compareTo(o2.getDataLevel()))).collect(Collectors.toList());
                  if (secVO.getCodeLevelValue() > (parentClassifyVOList.size() + 1)) {
                     //指定的层级比当前的层级还大了,所以只能获取当前层级了
                     if (CodeGetValueTypeEnum.CURRENT.getValue().equalsIgnoreCase(secVO.getCodeGetValueType())) {
@@ -544,7 +545,7 @@
                        }
                     } else {
                        //小于等于的全部拿出来
                        secValue = parentClassifyVOList.stream().filter(s -> s.getDataLevel().intValue() <= secVO.getCodeLevelValue().intValue()).sorted(((o1, o2) -> o1.getDataLevel().compareTo(o2.getDataLevel()))).map(CodeClassifyVO::getId).collect(Collectors.joining());
                        secValue = parentClassifyVOList.stream().filter(s -> s.getDataLevel().intValue() <= secVO.getCodeLevelValue().intValue()).sorted(((o1, o2) -> -o1.getDataLevel().compareTo(o2.getDataLevel()))).map(CodeClassifyVO::getId).collect(Collectors.joining());
                     }
                  }
               }