fjl
fujunling
2023-07-18 2c6c24281d4c261b172d02a98df9524cffc0c276
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmProductCodeServiceImpl.java
@@ -104,6 +104,7 @@
            String[] secLengths = cbo.getData().get(CODE_SEC_LENGTH_FIELD).split("#");
            cbo.getData().remove(CODE_SEC_LENGTH_FIELD);//将此key除去
            cbo.getData().remove(IMPORT_ROW_INDEX);//将此key除去
            cbo.getData().remove("codeclassifyid");//将此key除去
            List<CodeBasicSecVO> secVOList = ruleVO.getSecVOList().stream().sorted(((o1, o2) -> o1.getOrderNum().compareTo(o2.getOrderNum()))).collect(Collectors.toList());
            Map<String/**码段的主键**/,String/**码段的值**/> serialValueMap = new HashMap<>();
            Map<String, CodeBasicSecVO> secVOMap = secVOList.stream().collect(Collectors.toMap(s -> s.getOid(), t -> t));
@@ -290,6 +291,9 @@
         for (int i = 0; i < dataCBOList.size(); i++) {
            BaseModel cbo = dataCBOList.get(i);
            cbo.getData().remove(CODE_SEC_LENGTH_FIELD);//将此key除去
            cbo.getData().remove(IMPORT_ROW_INDEX);//将此key除去
            cbo.getData().remove("codeclassifyid");//将此key除去
            List<String> thisSecValueList = new LinkedList<>();
            for (int j = 0; j < secValueList.size(); j++) {
               thisSecValueList.add(secValueList.get(j));
@@ -323,15 +327,17 @@
         }
         saveSerialValue( ruleVO, lastMaxSerialValueMap, maxSerialValueMap);
         allCodeDOList.stream().forEach(
            allCode -> {DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCode,"codeallcode");allCode.setLctid("codeAllCodeLC");}
         );
         Map<String, String> statusMap = allCodeDOList.stream().collect(Collectors.toMap(s -> s.getOid(), s -> s.getLcStatus()));
         allCodeDOList.stream().filter(s -> StringUtils.equalsIgnoreCase("codeallcode",s.getBtmname())).forEach(s -> {
            s.setLcStatus(statusMap.get(s.getOid()));
         });
         allCodeDOList.stream().forEach(
            allCode -> {DefaultAttrAssimtUtil.addDefaultAttrAssimt(allCode,"codeallcode");allCode.setLctid("codeAllCodeLC");}
         );
         codeAllCodeService.saveBatch(allCodeDOList);
//         iCodeWupinService.saveBatch(dataCBOList);
@@ -780,8 +786,13 @@
    * @param rule 规则的内容
    * @return 转换后的
    */
   private String getValueByFormulaForCBO(BaseModel cbo,String rule){
      Map<String, Object> dataMap = BeanUtils.beanToMap(cbo);
   private String getValueByFormulaForCBO(BaseModel cbo,String rule)  {
      Map<String, Object> dataMap = null;
      try{
         dataMap = VciBaseUtil.convertBean2Map(cbo);
      }catch(Exception e){
         throw new VciBaseException("mapToBeanError:"+e);
      }
      Map<String, String> map = new HashMap<String, String>();
      for (String i : dataMap.keySet()) {
         map.put(i, String.valueOf(dataMap.get(i)));