| | |
| | | /** |
| | | * 业务类型所属领域 |
| | | */ |
| | | @TableField("\"DOMAIN\"") |
| | | private String domain; |
| | | // @TableField("\"DOMAIN\"") |
| | | private String bizDomain; |
| | | |
| | | /** |
| | | * 一致性标识 |
| | |
| | | /** |
| | | * 所属领域 |
| | | */ |
| | | private String domain; |
| | | private String bizDomain; |
| | | |
| | | } |
| | |
| | | package com.vci.ubcs.omd.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.vci.ubcs.starter.revision.model.BaseModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | |
| | | /** |
| | | * 所属领域 |
| | | */ |
| | | private String domain; |
| | | private String bizDomain; |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 领域值 |
| | | */ |
| | | private String domain; |
| | | private String bizDomain; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 业务类型所属领域 |
| | | */ |
| | | private String domain; |
| | | private String bizDomain; |
| | | |
| | | /** |
| | | * 领域显示字段 |
| | |
| | | /** |
| | | * 领域值 |
| | | */ |
| | | private String domain; |
| | | private String bizDomain; |
| | | |
| | | /** |
| | | * 领域显示值 |
| | |
| | | Query query = new Query(); |
| | | query.setSize(pageHelper.getLimit()); |
| | | query.setCurrent(pageHelper.getPage()); |
| | | IPage<BtmType> page = btmTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(condition,BtmType.class).lambda().eq(BtmType::getDomain, domainValue).orderByAsc(BtmType::getId)); |
| | | IPage<BtmType> page = btmTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(condition,BtmType.class).lambda().eq(BtmType::getBizDomain, domainValue).orderByAsc(BtmType::getId)); |
| | | if (CollectionUtils.isEmpty(page.getRecords())){ |
| | | return R.data(null); |
| | | } |
| | |
| | | conditionMap.remove(DOMAIN); |
| | | BtmType queryObj = new BtmType(); |
| | | BeanMap.create(queryObj).putAll(conditionMap); |
| | | List<BtmType> list = btmTypeService.list(Condition.getQueryWrapper(queryObj).lambda().eq(BtmType::getDomain, domainValue).orderByAsc(BtmType::getId)); |
| | | List<BtmType> list = btmTypeService.list(Condition.getQueryWrapper(queryObj).lambda().eq(BtmType::getBizDomain, domainValue).orderByAsc(BtmType::getId)); |
| | | if (CollectionUtils.isEmpty(list)){ |
| | | return R.data(null); |
| | | } |
| | |
| | | Query query = new Query(); |
| | | query.setSize(pageHelper.getLimit()); |
| | | query.setCurrent(pageHelper.getPage()); |
| | | IPage<LinkType> page = linkTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(queryObj).lambda().eq(LinkType::getDomain, domainValue).orderByAsc(LinkType::getId)); |
| | | IPage<LinkType> page = linkTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(queryObj).lambda().eq(LinkType::getBizDomain, domainValue).orderByAsc(LinkType::getId)); |
| | | Page<LinkTypeVO> pageVO = new Page<>(); |
| | | BeanUtil.copy(page,pageVO); |
| | | pageVO.setRecords(LinkTypeWrapper.build().listEntityVO(page.getRecords(),null)); |
| | |
| | | conditionMap.remove(DOMAIN); |
| | | LinkType queryObj = new LinkType(); |
| | | BeanMap.create(queryObj).putAll(conditionMap); |
| | | List<LinkType> doList = linkTypeService.list(Condition.getQueryWrapper(queryObj).lambda().eq(LinkType::getDomain, domainValue).orderByAsc(LinkType::getId)); |
| | | List<LinkType> doList = linkTypeService.list(Condition.getQueryWrapper(queryObj).lambda().eq(LinkType::getBizDomain, domainValue).orderByAsc(LinkType::getId)); |
| | | return R.data(LinkTypeWrapper.build().listEntityVO(doList,null)); |
| | | } |
| | | |
| | |
| | | ddlDTO.setBtmTypeList(btmTypeVOList); |
| | | try { |
| | | // 将以前的checkDifferent和reflexDifferent结合了 |
| | | R result = DomainRepeater.checkDifferent(ddlDTO,btmTypeVO.getDomain()); |
| | | R result = DomainRepeater.checkDifferent(ddlDTO,btmTypeVO.getBizDomain()); |
| | | if (result.isSuccess()){ |
| | | List<ModifyAttributeInfo> infoList = new ArrayList<>(); |
| | | Object data = result.getData(); |
| | |
| | | } |
| | | checkBtmTypeBeforeSave(btmTypeDTO); |
| | | BtmType btmTypeDO = Optional.ofNullable(BeanUtil.copy(btmTypeDTO, BtmType.class)).orElseGet(BtmType::new); |
| | | btmTypeDO.setBizDomain(btmTypeDTO.getDomain()); |
| | | List<BtmTypeLinkAttributesDTO> attributes = btmTypeDTO.getAttributes(); |
| | | List<BtmTypeAttributeVO> afterAttributes; |
| | | if (StringUtils.isBlank(btmTypeDO.getOid())){ |
| | | btmTypeDO = BtmTypeWrapper.build().entityBeforeInsert(btmTypeDO); |
| | | if (StringUtils.isBlank(btmTypeDO.getTableName())) { |
| | | btmTypeDO.setTableName(getTableName(btmTypeDO.getId(),btmTypeDO.getDomain())); |
| | | btmTypeDO.setTableName(getTableName(btmTypeDO.getId(),btmTypeDO.getBizDomain())); |
| | | } |
| | | // 添加属性 |
| | | btmTypeDTO.setOid(btmTypeDO.getOid()); |
| | |
| | | try { |
| | | Map<String, String> domain = Optional.ofNullable(DomainRepeater.getDomain()).orElseGet(ArrayList::new).stream().collect(Collectors.toMap(DomainVO::getValue, DomainVO::getLabel)); |
| | | List<BtmTypeVO> vos = BtmTypeWrapper.build().listEntityVO(baseMapper.selectAll()); |
| | | Map<String, List<BtmTypeVO>> domainMap = vos.stream().sorted(Comparator.comparing(BtmTypeVO::getId)).collect(Collectors.groupingBy(BtmTypeVO::getDomain)); |
| | | Map<String, List<BtmTypeVO>> domainMap = vos.stream().sorted(Comparator.comparing(BtmTypeVO::getId)).collect(Collectors.groupingBy(BtmTypeVO::getBizDomain)); |
| | | List<BtmTreeVO> treeList = new ArrayList<>(); |
| | | domainMap.forEach((k,v)-> { |
| | | if (domain.containsKey(k)){ |
| | |
| | | btmType.setCreator(user); |
| | | btmType.setBtmName(BtmTypeConstant.BTMTYPE); |
| | | btmType.setCreateTime(now); |
| | | btmType.setDomain(domain); |
| | | btmType.setBizDomain(domain); |
| | | btmType.setLastModifyTime(now); |
| | | btmType.setLastModifier(user); |
| | | btmType.setName(dto.getDescription()); |
| | |
| | | LinkType linkTypeDO = new LinkType(); |
| | | BeanUtil.copy(linkTypeVO, linkTypeDO); |
| | | if (StringUtils.isBlank(linkTypeDO.getTableName())){ |
| | | linkTypeDO.setTableName(getTableName(linkTypeDO.getId(),linkTypeDO.getDomain())); |
| | | linkTypeDO.setTableName(getTableName(linkTypeDO.getId(),linkTypeDO.getBizDomain())); |
| | | } |
| | | String creator = AuthUtil.getUserAccount(); |
| | | Date now = new Date(); |
| | |
| | | List<LinkTypeAttributeVO> attributes = typeVO.getAttributes(); |
| | | attributes.addAll(linkTypeAttributeService.getDefaultAttributes(typeVO)); |
| | | typeVO.setAttributes(attributes); |
| | | R r = DomainRepeater.submitLinkType(typeVO.getDomain(), typeVO); |
| | | R r = DomainRepeater.submitLinkType(typeVO.getBizDomain(), typeVO); |
| | | if (!r.isSuccess()){ |
| | | dataSourceTransactionManager.rollback(transaction); |
| | | }else { |
| | |
| | | attributes.addAll(defaultAttributes); |
| | | linkTypeVO.setAttributes(attributes); |
| | | BtmAndLinkTypeDdlDTO ddlDTO = new BtmAndLinkTypeDdlDTO(); |
| | | DomainRepeater.checkDifferent(ddlDTO,linkTypeVO.getDomain()); |
| | | DomainRepeater.checkDifferent(ddlDTO,linkTypeVO.getBizDomain()); |
| | | dataSourceTransactionManager.commit(transaction); |
| | | } |
| | | } catch (Throwable e){ |
| | |
| | | List<TableCheckDTO> checkList = linkTypeDOList.stream().map(linkType -> { |
| | | TableCheckDTO tableCheckDTO = new TableCheckDTO(); |
| | | tableCheckDTO.setBtmName(linkType.getId()); |
| | | tableCheckDTO.setTableName(getTableName(linkType.getId(),linkType.getDomain())); |
| | | tableCheckDTO.setTableName(getTableName(linkType.getId(),linkType.getBizDomain())); |
| | | tableCheckDTO.setCheckTableHasData(true); |
| | | tableCheckDTO.setNeedDelete(true); |
| | | tableCheckDTO.setDomain(linkType.getDomain()); |
| | | tableCheckDTO.setDomain(linkType.getBizDomain()); |
| | | return tableCheckDTO; |
| | | }).collect(Collectors.toList()); |
| | | R result = DomainRepeater.checkTableHasDataByTableNameThenDrop(checkList); |
| | |
| | | try { |
| | | Map<String, String> domain = Optional.ofNullable(DomainRepeater.getDomain()).orElseGet(ArrayList::new).stream().collect(Collectors.toMap(DomainVO::getValue, DomainVO::getLabel)); |
| | | List<LinkTypeVO> vos = LinkTypeWrapper.build().listEntityVO(baseMapper.selectAll(), null); |
| | | Map<String, List<LinkTypeVO>> domainMap = vos.stream().collect(Collectors.groupingBy(LinkTypeVO::getDomain)); |
| | | Map<String, List<LinkTypeVO>> domainMap = vos.stream().collect(Collectors.groupingBy(LinkTypeVO::getBizDomain)); |
| | | List<BtmTreeVO> treeList = new ArrayList<>(); |
| | | domainMap.forEach((k,v)-> { |
| | | if (domain.containsKey(k)){ |
| | |
| | | @Override |
| | | public BtmTypeVO entityVO(BtmType entity) { |
| | | BtmTypeVO vo = Objects.requireNonNull(BeanUtil.copy(entity, BtmTypeVO.class)); |
| | | vo.setDomainText(NewAppConstantEnum.getTextByName(vo.getDomain())); |
| | | vo.setDomainText(NewAppConstantEnum.getTextByName(vo.getBizDomain())); |
| | | vo.setTableName(vo.getTableName() == null? "" : vo.getTableName().toUpperCase(Locale.ROOT)); |
| | | // 在这里设置枚举显示值 |
| | | vo.setRevisionFlag(BooleanEnum.TRUE.getValue().equals(entity.getRevisionFlag())); |
| | |
| | | vo.setToBtmTypes(toBtm); |
| | | vo.setTableName(vo.getTableName().toUpperCase(Locale.ROOT)); |
| | | // 枚举处理 |
| | | vo.setDomainText(NewAppConstantEnum.getTextByName(vo.getDomain())); |
| | | vo.setDomainText(NewAppConstantEnum.getTextByName(vo.getBizDomain())); |
| | | return vo; |
| | | } |
| | | |
| | |
| | | <result column="last_modifier" jdbcType="VARCHAR" property="lastModifier" /> |
| | | <result column="last_modify_time" jdbcType="TIMESTAMP" property="lastModifyTime" /> |
| | | <result column="ts" jdbcType="TIMESTAMP" property="ts" /> |
| | | <result column="domain" jdbcType="VARCHAR" property="domain" /> |
| | | <result column="biz_domain" jdbcType="VARCHAR" property="bizDomain" /> |
| | | <result column="consistence" jdbcType="VARCHAR" property="consistence" /> |
| | | </resultMap> |
| | | |
| | |
| | | oid, id, name, description, table_name, revision_rule_id, revision_rule_name,revision_flag, |
| | | revision_sep, input_revision_flag, secret_flag, abstract_flag, impl_class, shape,life_cycle_flag, life_cycle_id,life_cycle_name, |
| | | version_rule,sub_life_cycle_id,sub_life_cycle_name, view_flag, view_create_sql,btm_name, owner, creator, create_time, last_modifier, |
| | | last_modify_time, ts,domain,consistence |
| | | last_modify_time, ts,biz_domain,consistence |
| | | </sql> |
| | | <sql id="tableName"> |
| | | pl_omd_btm_type |
| | |
| | | #{item.lastModifier,jdbcType=VARCHAR}, |
| | | #{item.lastModifyTime,jdbcType=TIMESTAMP}, |
| | | #{item.ts,jdbcType=TIMESTAMP}, |
| | | #{item.domain,jdbcType=VARCHAR}, |
| | | #{item.bizDomain,jdbcType=VARCHAR}, |
| | | #{item.consistence,jdbcType=VARCHAR} |
| | | from dual |
| | | ) |
| | |
| | | last_modifier = #{lastModifier,jdbcType=VARCHAR}, |
| | | last_modify_time = #{lastModifyTime,jdbcType=TIMESTAMP}, |
| | | ts = #{ts,jdbcType=TIMESTAMP}, |
| | | domain = #{domain,jdbcType=VARCHAR}, |
| | | biz-domain = #{bizDomain,jdbcType=VARCHAR}, |
| | | consistence = #{consistence,jdbcType=VARCHAR} |
| | | where OID = #{oid,jdbcType=VARCHAR} |
| | | </update> |
| | |
| | | <result column="last_modifier" jdbcType="VARCHAR" property="lastModifier" /> |
| | | <result column="last_modify_time" jdbcType="TIMESTAMP" property="lastModifyTime" /> |
| | | <result column="ts" jdbcType="TIMESTAMP" property="ts" /> |
| | | <result column="domain" jdbcType="VARCHAR" property="domain" /> |
| | | <result column="biz-domain" jdbcType="VARCHAR" property="bizDomain" /> |
| | | </resultMap> |
| | | |
| | | <sql id="base_query_column"> |
| | | oid, id, name, description, shape, impl_class, from_btm_type, from_btm_type_name, |
| | | to_btm_type, to_btm_type_name, btm_name, owner, creator, create_time, last_modifier, last_modify_time, |
| | | ts, domain |
| | | ts, biz-domain |
| | | </sql> |
| | | |
| | | <sql id="tableName"> |