dangsn
2023-08-02 54f35ae7866dac5c497372b68d03309c7eae9424
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmAttributeServiceImpl.java
@@ -60,7 +60,7 @@
         attributesDTOList.stream().forEachOrdered(s -> {
            attributeService.checkAttribute(s);
            btmTypeAttributeDOList.add(BtmTypeAttributeWrapper.build().copyBtmTypeAttributeDTO2Entity(s,btmTypeOid, creator, now));
            attributeIdList.add(s.getId().toLowerCase().trim());
            attributeIdList.add(s.getId().trim());
         });
         //检查属性是否都存在
         boolean exists = attributeService.checkAttributeExists(attributeIdList);
@@ -107,7 +107,7 @@
         attributesDTOList.stream().forEachOrdered(s -> {
            attributeService.checkAttribute(s);
            btmTypeAttributeDOList.add(BtmTypeAttributeWrapper.build().copyBtmTypeAttributeDTO2Entity(s,btmTypeOid, creator, now));
            attributeIdList.add(s.getId().toLowerCase().trim());
            attributeIdList.add(s.getId().trim());
         });
         //检查属性是否都存在
         boolean exists = attributeService.checkAttributeExists(attributeIdList);
@@ -177,7 +177,7 @@
   /**
    * 获取默认字段
    *
    * 默认字段均不可为空
    * @param btmType 业务类型
    * @return 执行结果
    */
@@ -186,16 +186,15 @@
      List<BtmTypeAttributeVO> list = new ArrayList<>();
      // 业务类型的基本字段
      BtmTypeFieldConstant.BASIC_FIELD_MAP.forEach((id,name) -> {
         id = id.toLowerCase(Locale.ROOT);
         BtmTypeAttributeVO vo = new BtmTypeAttributeVO();
         vo.setId(id);
         vo.setName(name);
         vo.setPkBtmType(btmType.getOid());
         if (StringUtils.equals(id,"oid")){
         if ("oid".equals(id)){
            vo.setNullableFlag(false);
         }else {
            vo.setNullableFlag(true);
         }
         if (Arrays.asList("createtime","lastmodifytime","owner").contains(id)){
         if (Arrays.asList("createtime","lastmodifytime","ts").contains(id)){
            vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name());
            vo.setAttributeLength(6);
         }else {
@@ -213,8 +212,10 @@
            vo.setName(name);
            vo.setPkBtmType(btmType.getOid());
            vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
            // 版本规则字段不能为空
//            vo.setNullableFlag(false);
            vo.setAttributeLength(150);
            if (Arrays.asList("lastr","firstr","lastv","firstv","revisionseq","versionseq","revisionvalue","versionvalue").contains(id)){
            if (Arrays.asList("lastr","firstr","lastv","firstv","revisionseq","versionseq").contains(id)){
               vo.setAttributeLength(5);
               vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name());
            }
@@ -233,6 +234,7 @@
            vo.setId(id);
            vo.setName(name);
            vo.setPkBtmType(btmType.getOid());
//            vo.setNullableFlag(false);
            vo.setAttributeLength(50);
            vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
            list.add(vo);
@@ -246,6 +248,7 @@
            vo.setId(id);
            vo.setName(name);
            vo.setPkBtmType(btmType.getOid());
//            vo.setNullableFlag(false);
            vo.setAttributeLength(5);
            vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name());
            list.add(vo);