| | |
| | | import com.vci.ubcs.omd.dto.BtmAndLinkTypeDdlDTO; |
| | | import com.vci.ubcs.omd.entity.Attribute; |
| | | import com.vci.ubcs.omd.repeater.DomainRepeater; |
| | | import com.vci.ubcs.omd.service.IAttributeService; |
| | | import com.vci.ubcs.omd.service.IBtmTypeAttributeService; |
| | | import com.vci.ubcs.omd.service.IModifyAttributeService; |
| | | import com.vci.ubcs.omd.service.*; |
| | | import com.vci.ubcs.omd.vo.*; |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; |
| | | import com.vci.ubcs.omd.wrapper.ModifyAttributeWrapper; |
| | |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | | import com.vci.ubcs.omd.entity.ModifyAttributeInfo; |
| | | import com.vci.ubcs.omd.mapper.BtmTypeMapper; |
| | | import com.vci.ubcs.omd.service.IBtmTypeService; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.enumpck.BooleanEnum; |
| | | import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; |
| | |
| | | */ |
| | | @Autowired |
| | | private IModifyAttributeService modifyAttributeService; |
| | | |
| | | /** |
| | | * 版本规则的服务 |
| | | */ |
| | | @Autowired |
| | | private IRevisionRuleService revisionRuleService; |
| | | |
| | | /** |
| | | * 属性的服务 |
| | |
| | | if (btmTypeDTO.isRevisionFlag()){ |
| | | // 需要控制版本 |
| | | // 检查使用的版本规则是否存在 |
| | | // if (StringUtils.isNotBlank(btmTypeDTO.getRevisionRuleId())) { |
| | | // if (revisionRuleServiceI.checkRevisionRuleExist(btmTypeDTO.getRevisionRuleId())) { |
| | | // throw new VciBaseException("版本规则{0}[{1}]在系统中不存在,请先查证", |
| | | // new Object[]{btmTypeDTO.getRevisionRuleId(), btmTypeDTO.getRevisionRuleName()}); |
| | | // } |
| | | // } |
| | | if (StringUtils.isNotBlank(btmTypeDTO.getRevisionRuleId())) { |
| | | if (revisionRuleService.checkRevisionRuleExist(btmTypeDTO.getRevisionRuleId())) { |
| | | throw new VciBaseException("版本规则{0}[{1}]在系统中不存在,请先查证", |
| | | new Object[]{btmTypeDTO.getRevisionRuleId(), btmTypeDTO.getRevisionRuleName()}); |
| | | } |
| | | } |
| | | btmTypeDTO.setAttributes(addAttributeByFieldMap(btmTypeDTO.getAttributes(),BtmTypeFieldConstant.REVISION_MANAGE_FIELD_MAP)); |
| | | } |
| | | if (btmTypeDTO.isLifeCycleFlag()){ |
| | |
| | | attributeService.saveBatch(idAttrMap.values()); |
| | | }else { |
| | | List<Attribute> addList = idAttrMap.values().stream().filter(a -> existAttr.stream().noneMatch(b -> StringUtils.equals(a.getKey(), b.getKey()))).collect(Collectors.toList()); |
| | | if (CollectionUtils.isEmpty(addList)) { |
| | | if (!CollectionUtils.isEmpty(addList)) { |
| | | attributeService.saveBatch(addList); |
| | | } |
| | | } |