yuxc
2023-10-13 98c7aaad8864ff0720bc40db850c8b3dec9ffcf5
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
@@ -151,13 +151,14 @@
                        OsCodeFillTypeEnum.LEFT.getValue().equalsIgnoreCase(secVO.getCodeFillType()))));
                  }
                  Map<String, Double> thisUnitMaxMap = maxSerialMap.getOrDefault(serialUnitString, new HashMap<>());
                  Double maxValue=serialDb;
                  if(thisUnitMaxMap.containsKey(secOid)){
                     Double maxValue=  thisUnitMaxMap.getOrDefault(secOid,new Double(-1));
                     if(maxValue>serialDb){
                        serialDb=maxValue;
                     maxValue=  thisUnitMaxMap.getOrDefault(secOid,new Double(-1));
                     if(maxValue<serialDb){
                        maxValue=serialDb;
                     }
                  }
                  thisUnitMaxMap.put(secOid,serialDb);
                  thisUnitMaxMap.put(secOid,maxValue);
                  maxSerialMap.put(serialUnitString,thisUnitMaxMap);
                  serialUnFileStringList.add(String.valueOf(serialDb));
               });
@@ -171,7 +172,8 @@
            allCodeDO.setCreateCodeBtm(cbo.getBtmname());
            allCodeDO.setCreateCodeOid(cbo.getOid());
            allCodeDO.setSerialUnit(serialUnitString);
            allCodeDO.setUnFillSerial(serialUnFileStringList.stream().collect(Collectors.joining(SERIAL_VALUE_SPACE)));
            String unFillSerial =serialUnFileStringList.size()==1?serialUnFileStringList.get(0)+ SERIAL_VALUE_SPACE:serialUnFileStringList.stream().collect(Collectors.joining(SERIAL_VALUE_SPACE));
            allCodeDO.setUnFillSerial(unFillSerial);
            allCodeDO.setLcStatus(cbo.getLcStatus());
            allCodeDOList.add(allCodeDO);
         });
@@ -277,7 +279,7 @@
               wrapper.eq("CREATECODEBTM",addCodeDOs.get(0).getCreateCodeBtm());
               wrapper.in("ID",addCodeDOs.stream().map(CodeAllCode::getId).collect(Collectors.toList()));
               if(codeAllCodeService.count(wrapper)>0){
                  throw new ServiceException("生成编码数据ID已有历史记录请确认!!");
                  throw new ServiceException("生成编码数据ID已有历史记录,请确认如下生成的ID数据:"+ addCodeDOs.stream().map(CodeAllCode::getId).collect(Collectors.toList()));
               }
               codeAllCodeService.saveBatch(addCodeDOs);
            }
@@ -364,7 +366,7 @@
         wrapper.eq("CREATECODEBTM",allCodeDOList.get(0).getCreateCodeBtm());
         wrapper.in("ID",allCodeDOList.stream().map(CodeAllCode::getId).collect(Collectors.toList()));
         if(codeAllCodeService.count(wrapper)>0){
            throw new ServiceException("生成编码数据ID已有历史记录请确认!!");
            throw new ServiceException("生成编码数据ID已有历史记录,请确认如下生成的ID数据:"+ allCodeDOList.stream().map(CodeAllCode::getId).collect(Collectors.toList()));
         }
         codeAllCodeService.saveBatch(allCodeDOList);
//         iCodeWupinService.saveBatch(dataCBOList);