lihang
2023-06-06 8ea4c69b64b5088d7821f7bc3dd8f724b78b314d
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java
@@ -360,6 +360,7 @@
         if (!existFieldMap.containsKey(k)){
            BtmTypeLinkAttributesDTO attr = new BtmTypeLinkAttributesDTO();
            attr.setId(k);
            attr.setName(v);
            attr.setAttrDataType(VciFieldTypeEnum.VTString.name());
            attr.setAttributeLength(50);
            attr.setNullableFlag(false);
@@ -507,10 +508,13 @@
         afterAttributes = updateAttributeForBtm(btmTypeByOid.getOid(),beforeAttributes, attributes);
      }
      BtmTypeVO btmTypeVO = BtmTypeWrapper.build().entityVO(btmTypeDO);
      //在创建表的时候还需要把默认的字段带上。
      List<BtmTypeAttributeVO> defaultAttribute = btmTypeAttributeService.getDefaultAttribute(btmTypeVO);
      afterAttributes.addAll(defaultAttribute);
      btmTypeVO.setAttributes(afterAttributes);
      try {
         if (autoCreateTable) {
            checkTableSame(btmTypeVO);
//            checkTableSame(btmTypeVO);
            R result = DomainRepeater.submitBtmType(btmTypeDTO.getDomain(), btmTypeVO);
            if (result.isSuccess()){
               List<ModifyAttributeInfo> infoList = new ArrayList<>();
@@ -598,7 +602,7 @@
                     new Object[]{btmTypeDTO.getRevisionRuleId(), btmTypeDTO.getRevisionRuleName()});
               }
            }
         btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.REVISION_MANAGE_FIELD_MAP));
//         btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.REVISION_MANAGE_FIELD_MAP));
      }
      if (btmTypeDTO.isLifeCycleFlag()){
         // 需要控制生命周期
@@ -616,11 +620,11 @@
//                     new Object[]{btmTypeDTO.getSubLifeCycleId(), btmTypeDTO.getSubLifeCycleName()});
//               }
//            }
         btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.LIFECYCLE_MANAGE_FIELD_MAP));
//         btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.LIFECYCLE_MANAGE_FIELD_MAP));
      }
      if (btmTypeDTO.isSecretFlag()){
         // 需要控制密级
         btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.SECRET_MANAGE_FIELD_MAP));
//         btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.SECRET_MANAGE_FIELD_MAP));
      }
   }
   @Override
@@ -650,12 +654,14 @@
               String label = domain.get(k);
               BtmTreeVO parent = new BtmTreeVO();
               parent.setName(label);
               parent.setLabel(label);
               parent.setId(k);
               parent.setChildList(v.stream().map(s -> {
                  BtmTreeVO child = new BtmTreeVO();
                  child.setOid(s.getOid());
                  child.setName(s.getId() + " " + (s.getName() == null ? "" : s.getName()));
                  child.setName(s.getName());
                  child.setId(s.getId());
                  child.setLabel(s.getId() +  (s.getName() == null ? "" : "(" + s.getName() + ")"));
                  return child;
               }).collect(Collectors.toList()));
               treeList.add(parent);