链接类型接口修正、页面修改。业务类型Feign接口修改。
已修改16个文件
已重命名1个文件
已添加3个文件
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const initTree = () => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/link-type/tree-domain', |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | export const refOnLoad = (domain) => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/link-type/get-from-table', |
| | | method: 'get', |
| | | params: { |
| | | domain: domain |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const getDomain = () => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/link-type/domain', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export const saveFromTable = (list,domain) => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/link-type/save-from-table/' + domain, |
| | | method: 'post', |
| | | data: list |
| | | }) |
| | | } |
| | | |
| | | export const getDetail = (oid) => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/link-type/detail', |
| | | method: 'get', |
| | | params: { |
| | | oid: oid |
| | | } |
| | | }) |
| | | } |
| | | |
| | | export const add = (linkType,auto) => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/link-type/submit/' + auto, |
| | | method: 'post', |
| | | data: linkType |
| | | }) |
| | | } |
| | | |
| | | export const update = (linkType) => { |
| | | return request({ |
| | | url: '/api/ubcs-omd/link-type/submit/' + auto, |
| | | method: 'post', |
| | | data: linkType |
| | | }) |
| | | } |
| | | |
| | | export const btmPage = (current,size,params) => { |
| | | return request ({ |
| | | url: '/api/ubcs-omd/link-type/page', |
| | | method: 'get', |
| | | params: { |
| | | current, |
| | | size, |
| | | ...params |
| | | } |
| | | }) |
| | | } |
| | |
| | | <template> |
| | | <el-container> |
| | | <el-header class="businessHeader" style="height: 40px;"> |
| | | <el-button type="primary" @click="businessAdd" size="small">æ°å¢</el-button> |
| | | <el-button type="primary" @click="businessEdit" size="small">ä¿®æ¹</el-button> |
| | | <el-button type="primary" @click="selectFromTable" size="small">ä»å·²æä¸è·å</el-button> |
| | | <el-button-group> |
| | | <el-button type="primary" @click="businessAdd" size="small"> <i class="el-icon-plus"></i> æ°å¢</el-button> |
| | | <el-button type="primary" @click="businessEdit" size="small"><i class="el-icon-edit"></i> ä¿®æ¹</el-button> |
| | | <el-button type="primary" @click="selectFromTable" size="small"><i class="el-icon-thumb"></i> ä»å·²æä¸è·å</el-button> |
| | | </el-button-group> |
| | | </el-header> |
| | | <el-container> |
| | | <el-aside width="240px"> |
| | | <basic-container class="businessTreeContainer"> |
| | | <p style="margin-top: 10px;font-weight: 570;font-size: 19px">{{ treeOption.title }}</p> |
| | | <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick" class="businessTree"> |
| | | <span class="el-tree-node__label" slot-scope="{ node, data }"> |
| | | <span> |
| | |
| | | treeOption: { |
| | | defaultExpandAll: true, |
| | | title: 'ä¸å¡ç±»åæ ', |
| | | addBtn: false, |
| | | props: { |
| | | labelText: '', |
| | | label: 'name', |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-container> |
| | | <!-- 顶端æé® --> |
| | | <el-header class="businessHeader" style="height: 40px;"> |
| | | <el-button-group> |
| | | <el-button type="primary" @click="linkTypeAdd" size="small"> |
| | | <i class="el-icon-plus"></i> |
| | | æ°å¢ |
| | | </el-button> |
| | | <el-button type="primary" @click="linkTypeEdit" size="small"> |
| | | <i class="el-icon-edit"></i> |
| | | ä¿®æ¹ |
| | | </el-button> |
| | | <el-button type="primary" @click="selectFromTable" size="small"> |
| | | <i class="el-icon-thumb"></i> |
| | | ä»å·²æä¸è·å |
| | | </el-button> |
| | | </el-button-group> |
| | | </el-header> |
| | | <!-- ä¾§è¾¹æ æ --> |
| | | <el-container> |
| | | <el-aside width="240px"> |
| | | <basic-container class="businessTreeContainer"> |
| | | <p style="margin-top: 10px;font-weight: 570;font-size: 19px">{{ treeOption.title }}</p> |
| | | <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick" |
| | | class="businessTree"> |
| | | <span class="el-tree-node__label" slot-scope="{ node, data }"> |
| | | <span> |
| | | <i class="el-icon-star-on"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | | </span> |
| | | </avue-tree> |
| | | </basic-container> |
| | | </el-aside> |
| | | <el-container> |
| | | <el-main> |
| | | <basic-container> |
| | | <p style="margin-top: 10px;font-weight: 570;font-size: 19px">åºæ¬ä¿¡æ¯</p> |
| | | <el-descriptions class="margin-top" :column="2" size="medium" border> |
| | | <el-descriptions-item labelStyle="text-align:center;width:120px" |
| | | contentStyle="width:240px;text-align:center;word-break;break-all;"> |
| | | <template slot="label"> |
| | | <i class="el-icon-finished"></i> |
| | | è±æåç§° |
| | | </template> |
| | | {{ obj.id }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item labelStyle="text-align:center;width:120px" |
| | | contentStyle="width:240px;text-align:center;word-break;break-all;"> |
| | | <template slot="label"> |
| | | <i class="el-icon-info"></i> |
| | | 䏿åç§° |
| | | </template> |
| | | {{ obj.name }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item labelStyle="text-align:center;width:120px" |
| | | contentStyle="width:240px;text-align:center;word-break;break-all;"> |
| | | <template slot="label"> |
| | | <i class="el-icon-date"></i> |
| | | æ°æ®åºè¡¨å |
| | | </template> |
| | | {{ obj.tableName }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item labelStyle="text-align:center;width:120px" |
| | | contentStyle="width:240px;text-align:center;word-break;break-all;"> |
| | | <template slot="label"> |
| | | <i class="el-icon-folder-opened"></i> |
| | | æå±é¢å |
| | | </template> |
| | | <el-tag size="small"> |
| | | {{ obj.domainText }} |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | <el-descriptions class="margin-top" direction="vertical" :column="2" border> |
| | | <el-descriptions-item labelStyle="text-align:center;width:120px" |
| | | contentStyle="width:240px;text-align:center;word-break;break-all;"> |
| | | <template slot="label"> |
| | | <i class="el-icon-sort-down"></i> |
| | | From端类å |
| | | </template> |
| | | <span v-for="item in obj.fromBtmTypes" style="margin-left:2px;"> |
| | | <el-tag size="small" effect="plain" style="width:130px;margin-top: 2px;"> |
| | | {{ item.id + 'ï¼' + item.name + 'ï¼' }} |
| | | </el-tag> |
| | | </span> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item labelStyle="text-align:center;width:120px" |
| | | contentStyle="width:240px;text-align:center;word-break;break-all;"> |
| | | <template slot="label"> |
| | | <i class="el-icon-sort-up"></i> |
| | | To段类å |
| | | </template> |
| | | <span v-for="item in obj.toBtmTypes" style="height:26px;width:140px;margin-left:2px"> |
| | | <el-tag size="small" effect="plain" style="width:130px;margin-top: 2px;"> |
| | | {{ item.id + 'ï¼' + item.name + 'ï¼' }} |
| | | </el-tag> |
| | | </span> |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | |
| | | <el-descriptions class="margin-top" :column="2" size="medium" border> |
| | | <el-descriptions-item labelStyle="text-align:center;width:120px" |
| | | contentStyle="width:240px;text-align:center;word-break;break-all;"> |
| | | <template slot="label"> |
| | | <i class="el-icon-info"></i> |
| | | 主类å |
| | | </template> |
| | | {{ obj.fromBtmTypeName }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item labelStyle="text-align:center;width:120px" |
| | | contentStyle="width:240px;text-align:center;word-break;break-all;"> |
| | | <template slot="label"> |
| | | <i class="el-icon-info"></i> |
| | | 主类å |
| | | </template> |
| | | {{ obj.toBtmTypeName }} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item span='2' labelStyle="text-align:center;width:120px"> |
| | | <template slot="label"> |
| | | <i class="el-icon-chat-line-square"></i> |
| | | æè¿° |
| | | </template> |
| | | {{ obj.description }} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </basic-container> |
| | | <!-- 屿§å表--> |
| | | <basic-container> |
| | | <p style="margin-top: 10px;font-weight: 570;font-size: 19px">屿§å表</p> |
| | | <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption"> |
| | | <template slot="attrDataType" slot-scope="{row}"> |
| | | <el-tag>{{ row.attrDataType }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | </basic-container> |
| | | </el-main> |
| | | </el-container> |
| | | </el-container> |
| | | |
| | | |
| | | </el-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | initTree, |
| | | refOnLoad, |
| | | getDomain, |
| | | saveFromTable, |
| | | getDetail |
| | | } from "@/api/omd/linkType" |
| | | export default { |
| | | name: "LinkType", |
| | | data() { |
| | | return { |
| | | treeData: [ |
| | | { id: "1", name: "2", label: "label" }, |
| | | { id: "a", name: "b", label: "c" } |
| | | ], |
| | | loadOption: { |
| | | border: true, |
| | | height: 360, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | menu: false, |
| | | highlightCurrentRow: true, |
| | | refreshBtn: false, |
| | | columnBtn: false, |
| | | column: [ |
| | | { |
| | | label: 'è±æåç§°', |
| | | prop: 'id', |
| | | align: 'center' |
| | | }, { |
| | | label: '䏿åç§°', |
| | | prop: 'name', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: 'ç±»å', |
| | | prop: 'attrDataType', |
| | | align: 'center', |
| | | slot: true |
| | | }, |
| | | { |
| | | label: 'é»è®¤å¼', |
| | | prop: 'defaultValue', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | label: '说æ', |
| | | prop: 'description', |
| | | align: 'center' |
| | | } |
| | | ] |
| | | }, |
| | | obj: { |
| | | id: 'linkType', |
| | | name: '龿¥ç±»å', |
| | | tableName: 'PLLT_OMD_LINKTYPE', |
| | | domain: 'ubcs-omd', |
| | | domainText: '对象建模', |
| | | fromBtmTypes: [ |
| | | { id: 'btm', name: 'ä¸å¡ç±»å' }, |
| | | { id: 'btm2', name: 'ä¸å¡ç±»å2' } |
| | | ], |
| | | toBtmTypes: [{ id: 'btm', name: 'ä¸å¡ç±»å' }, { id: 'btm2', name: 'ä¸å¡ç±»å2' }], |
| | | fromBtmTypeName: '', |
| | | toBtmTypeName: '', |
| | | }, |
| | | treeOption: { |
| | | defaultExpandAll: true, |
| | | title: '龿¥ç±»åæ ', |
| | | addBtn: false, |
| | | props: { |
| | | labelText: '', |
| | | label: 'name', |
| | | value: 'oid', |
| | | children: 'childList', |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | this.initTreeOnLoad(); |
| | | // this.initDomainOption(); |
| | | }, |
| | | |
| | | methods: { |
| | | // æ ç¹å» |
| | | nodeClick(data) { |
| | | console.log(data); |
| | | }, |
| | | // æ·»å æé®ç¹å»äºä»¶ |
| | | linkTypeAdd() { |
| | | |
| | | }, |
| | | // ç¼è¾æé®ç¹å»äºä»¶ |
| | | linkTypeEdit() { |
| | | |
| | | }, |
| | | // ä»å·²æä¸è·åæé®ç¹å»äºä»¶ |
| | | selectFromTable() { |
| | | |
| | | }, |
| | | initTreeOnLoad() { |
| | | initTree().then(res => { |
| | | this.treeData = res.data.data; |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .attributeCrud>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu { |
| | | display: none !important; |
| | | } |
| | | </style> |
| | | |
| | |
| | | */ |
| | | private String implClass; |
| | | |
| | | /** |
| | | * æ°æ®è¡¨å |
| | | */ |
| | | private String tableName; |
| | | |
| | | /** |
| | | * from端ä¸å¡ç±»å |
| | | */ |
| | |
| | | */ |
| | | private String implClass; |
| | | |
| | | /** |
| | | * æ°æ®è¡¨å |
| | | */ |
| | | private String tableName; |
| | | |
| | | /** |
| | | * from端ä¸å¡ç±»å |
| | | */ |
| | |
| | | package com.vci.ubcs.omd.feign; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import org.springblade.core.launch.constant.AppConstant; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Description: ä¸å¡ç±»åFeignæ¥å£ç±» |
| | |
| | | */ |
| | | String GET_BY_OIDS = API_PREFIX + "/btm-type/get-by-oids"; |
| | | |
| | | String GET_DEFAULT_ATTR_BY_BTM_ID = API_PREFIX + "/btm-attribute/get-default-attr-by-btm-id"; |
| | | |
| | | String GET_ALL_ATTR_BY_BTM_ID = API_PREFIX + "/btm-attribute/get-all-attr-by-btm-id"; |
| | | |
| | | String GET_ALL_ATTR_BY_BTM_OID = API_PREFIX + "/btm-attribute/get-all-attr-by-btm-oid"; |
| | | |
| | | /** |
| | | * è·åä¸å¡ç±»å详æ
ä¿¡æ¯ |
| | | * |
| | |
| | | |
| | | /** |
| | | * åç
§å表æ¥è¯¢ |
| | | * |
| | | * @param baseQueryObject æ¥è¯¢æ¡ä»¶å¯¹è±¡ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @GetMapping(GET_REF_PAGE) |
| | | R<IPage<BtmTypeVO>> getRefPage(@RequestBody BaseQueryObject baseQueryObject); |
| | | @PostMapping(GET_REF_PAGE) |
| | | R<Page<BtmTypeVO>> getRefPage(@RequestBody BaseQueryObject baseQueryObject); |
| | | |
| | | /** |
| | | * åç
§å表æ¥è¯¢ |
| | |
| | | */ |
| | | @PostMapping(GET_BY_OIDS) |
| | | R<List<BtmTypeVO>> listBtmTypeByOidCollection(@RequestBody List<String> pkBtmTypeCollection); |
| | | |
| | | /** |
| | | * è·åä¸å¡ç±»åï¼åªæé»è®¤å段 |
| | | * |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return é»è®¤åæ®µå±æ§ |
| | | */ |
| | | @GetMapping(GET_DEFAULT_ATTR_BY_BTM_ID) |
| | | R<BtmTypeVO> getDefaultAttrByBtmId(@RequestParam("btmTypeId") String btmTypeId); |
| | | |
| | | /** |
| | | * è·åä¸å¡ç±»åï¼æææçåæ®µ |
| | | * |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return ææå段 |
| | | */ |
| | | @GetMapping(GET_ALL_ATTR_BY_BTM_ID) |
| | | R<BtmTypeVO> getAllAttributeByBtmId(@RequestParam("btmTypeId") String btmTypeId); |
| | | |
| | | /** |
| | | * è·åä¸å¡ç±»åï¼æææçåæ®µ |
| | | * |
| | | * @param btmTypeOid ä¸å¡ç±»åä¸»é® |
| | | * @return ææå段 |
| | | */ |
| | | @GetMapping(GET_ALL_ATTR_BY_BTM_OID) |
| | | R<BtmTypeVO> getAllAttributeByBtmOid(@RequestParam("btmTypeOid") String btmTypeOid); |
| | | } |
| | |
| | | */ |
| | | package com.vci.ubcs.omd.feign; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.omd.entity.Attribute; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Feign失败é
ç½® |
| | |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public R<IPage<BtmTypeVO>> getRefPage(BaseQueryObject baseQueryObject) { |
| | | public R<Page<BtmTypeVO>> getRefPage(BaseQueryObject baseQueryObject) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | |
| | | public R<List<BtmTypeVO>> selectByIdCollection(List<String> ids) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * æç
§ä¸å¡ç±»åè·åé»è®¤å段 |
| | | * |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return é»è®¤åæ®µå±æ§ |
| | | */ |
| | | @Override |
| | | public R<BtmTypeVO> getDefaultAttrByBtmId(String btmTypeId) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * æä¸å¡ç±»åidè·åææçåæ®µ |
| | | * |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return ææå段 |
| | | */ |
| | | @Override |
| | | public R<BtmTypeVO> getAllAttributeByBtmId(String btmTypeId) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | |
| | | /** |
| | | * æä¸å¡ç±»å主é®è·åææçåæ®µ |
| | | * |
| | | * @param btmTypeOid ä¸å¡ç±»åä¸»é® |
| | | * @return ææå段 |
| | | */ |
| | | @Override |
| | | public R<BtmTypeVO> getAllAttributeByBtmOid(String btmTypeOid) { |
| | | return R.fail("è·åæ°æ®å¤±è´¥"); |
| | | } |
| | | } |
ÎļþÃû´Ó Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeTreeVO.java ÐÞ¸Ä |
| | |
| | | * @date 2023/5/5 |
| | | */ |
| | | @Data |
| | | public class BtmTypeTreeVO implements Serializable{ |
| | | public class BtmTreeVO implements Serializable{ |
| | | /** |
| | | * åºåå |
| | | */ |
| | |
| | | |
| | | private String oid; |
| | | |
| | | private List<BtmTypeTreeVO> childList; |
| | | private String type; |
| | | |
| | | private List<BtmTreeVO> childList; |
| | | } |
| | |
| | | */ |
| | | private Date ts; |
| | | |
| | | /** |
| | | * é¢åå¼ |
| | | */ |
| | | private String domain; |
| | | |
| | | /** |
| | | * å
å«å±æ§ |
| | | */ |
| | |
| | | import com.vci.ubcs.omd.entity.BtmType; |
| | | import com.vci.ubcs.omd.repeater.DomainRepeater; |
| | | import com.vci.ubcs.omd.service.IBtmTypeService; |
| | | import com.vci.ubcs.omd.vo.BtmTypeTreeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTreeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.DomainVO; |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; |
| | |
| | | @GetMapping("/tree-domain") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "ä¸å¡ç±»åæ å½¢ç»æ", notes = "ä¸å¡ç±»åæ å½¢ç»æ") |
| | | public R<List<BtmTypeTreeVO>> treeDomain(){ |
| | | public R<List<BtmTreeVO>> treeDomain(){ |
| | | return R.data(btmTypeService.treeDomain()); |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.vci.ubcs.omd.controller; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.alibaba.nacos.api.exception.NacosException; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import com.vci.ubcs.omd.constant.OmdCacheConstant; |
| | | import com.vci.ubcs.omd.dto.LinkTypeDTO; |
| | | import com.vci.ubcs.omd.entity.LinkType; |
| | | import com.vci.ubcs.omd.repeater.DomainRepeater; |
| | | import com.vci.ubcs.omd.service.ILinkTypeService; |
| | | import com.vci.ubcs.omd.vo.BtmTreeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeVO; |
| | | import com.vci.ubcs.omd.vo.DomainVO; |
| | | import com.vci.ubcs.omd.wrapper.LinkTypeWrapper; |
| | | import io.swagger.annotations.*; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringPool; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * Description:龿¥ç±»åæ§å¶å¨ |
| | | * |
| | | * @author LiHang |
| | | * @date 2023/5/29 |
| | | */ |
| | | @NonDS |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/link-type") |
| | | @Api(value = "龿¥ç±»åæ§å¶å¨", tags = "龿¥ç±»åæ§å¶å¨") |
| | | public class LinkTypeController extends BladeController { |
| | | /** |
| | | * 龿¥ç±»åæå¡ |
| | | */ |
| | | private final ILinkTypeService linkTypeService; |
| | | |
| | | /** |
| | | * æ¥ç详æ
|
| | | * |
| | | * @param oid ä¸»é® |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "æ¥ç详æ
", notes = "ä¼ å
¥ä¸»é®") |
| | | public R<LinkTypeVO> detail(String oid) { |
| | | return R.data(linkTypeService.getLinkTypeByOid(oid)); |
| | | } |
| | | |
| | | /** |
| | | * å表 |
| | | * |
| | | * @param condition æ¥è¯¢æ¡ä»¶ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "oid", value = "主é®", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "id", value = "龿¥ç±»åè±æåç§°", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "name", value = "龿¥ç±»å䏿åç§°", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "tableName", value = "龿¥ç±»åæ°æ®åºè¡¨å", paramType = "query", dataType = "string"), |
| | | }) |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "æ¥è¯¢å表", notes = "ä¼ å
¥æ¥è¯¢") |
| | | public R<List<LinkTypeVO>> list(@ApiIgnore @RequestParam Map<String, Object> condition) { |
| | | return R.data(LinkTypeWrapper.build().listEntityVO(linkTypeService.list(Condition.getQueryWrapper(condition, LinkType.class).lambda().orderByAsc(LinkType::getId)))); |
| | | } |
| | | |
| | | /** |
| | | * å页å表 |
| | | * |
| | | * @param condition æ¥è¯¢æ¡ä»¶ |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "oid", value = "主é®", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "id", value = "龿¥ç±»åè±æåç§°", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "name", value = "龿¥ç±»å䏿åç§°", paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(name = "tableName", value = "龿¥ç±»åæ°æ®åºè¡¨å", paramType = "query", dataType = "string"), |
| | | }) |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "æ¥è¯¢å表", notes = "ä¼ å
¥æ¥è¯¢") |
| | | public R<IPage<LinkTypeVO>> parentList(@ApiIgnore @RequestParam Map<String, Object> condition, Query query) { |
| | | IPage<LinkTypeVO> pageVO = new Page<>(); |
| | | IPage<LinkType> page = linkTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(condition, LinkType.class).lambda().orderByAsc(LinkType::getId)); |
| | | BeanUtil.copy(page, pageVO); |
| | | pageVO.setRecords(LinkTypeWrapper.build().listEntityVO(page.getRecords())); |
| | | return R.data(pageVO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ°å¢æä¿®æ¹ |
| | | * |
| | | * @param dto å
æ°æ®é¡µé¢ä¼ è¾å¯¹è±¡ |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @PostMapping("/submit/{auto}") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "æ°å¢æä¿®æ¹", notes = "ä¼ å
¥é¾æ¥ç±»å对象") |
| | | public R submit(@Valid @RequestBody LinkTypeVO dto, @PathVariable(value = "auto") boolean auto) { |
| | | CacheUtil.clear(OmdCacheConstant.LINK_CACHE); |
| | | if (StringUtils.isNotBlank(dto.getOid())){ |
| | | return R.data(linkTypeService.editSave(dto)); |
| | | }else { |
| | | return R.data(linkTypeService.addSave(dto)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param ids 主é®éå |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "å é¤", notes = "主é®éå") |
| | | public R remove(@ApiParam(value = "主é®éå", required = true) @RequestParam String ids) { |
| | | CacheUtil.clear(OmdCacheConstant.LINK_CACHE); |
| | | List<String> oidList = new ArrayList<>(); |
| | | if (ids.contains(",")) { |
| | | oidList.addAll(Func.toStrList(",", ids)); |
| | | } else { |
| | | oidList.add(ids); |
| | | } |
| | | return R.status(linkTypeService.removeBatchByIds(oidList)); |
| | | } |
| | | |
| | | /** |
| | | * è·åé¢åå¼ |
| | | */ |
| | | @GetMapping("/domain") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "è·åé¢åå¼") |
| | | public R<List<DomainVO>> getDomain(){ |
| | | try { |
| | | return R.data(DomainRepeater.getDomain()); |
| | | } catch (NacosException e) { |
| | | return R.fail(e.getErrMsg()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * ædomainåç»ï¼æ¥è¯¢é¾æ¥ç±»åçæ å½¢ç»æ |
| | | */ |
| | | @GetMapping("/tree-domain") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "龿¥ç±»åæ å½¢ç»æ", notes = "龿¥ç±»åæ å½¢ç»æ") |
| | | public R<List<BtmTreeVO>> treeDomain(){ |
| | | return R.data(linkTypeService.treeDomain()); |
| | | } |
| | | } |
| | |
| | | @Override |
| | | @GetMapping(GET_DETAIL) |
| | | public R<BtmTypeVO> getDetail(String oid) { |
| | | return R.data(btmTypeService.getBtmTypeByOid(oid)); |
| | | return R.data(btmTypeService.getAllAttributeByBtmOid(oid)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | @PostMapping(GET_REF_PAGE) |
| | | public R<IPage<BtmTypeVO>> getRefPage(BaseQueryObject baseQueryObject) { |
| | | public R<Page<BtmTypeVO>> getRefPage(BaseQueryObject baseQueryObject) { |
| | | Map<String, String> conditionMap = baseQueryObject.getConditionMap(); |
| | | if (conditionMap == null){ |
| | | conditionMap = new HashMap<>(16); |
| | |
| | | query.setSize(pageHelper.getLimit()); |
| | | query.setCurrent(pageHelper.getPage()); |
| | | IPage<BtmType> page = btmTypeService.page(Condition.getPage(query), Condition.getQueryWrapper(queryObj).lambda().eq(BtmType::getDomain, domainValue).orderByAsc(BtmType::getId)); |
| | | IPage<BtmTypeVO> pageVO = new Page<>(); |
| | | Page<BtmTypeVO> pageVO = new Page<>(); |
| | | BeanUtil.copy(page,pageVO); |
| | | pageVO.setRecords(BtmTypeWrapper.build().listEntityVO(page.getRecords())); |
| | | R<IPage<BtmTypeVO>> r = R.data(pageVO); |
| | | R<Page<BtmTypeVO>> r = R.data(pageVO); |
| | | r.setSuccess(true); |
| | | return r; |
| | | } |
| | |
| | | ); |
| | | return R.data(voList); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡ç±»åï¼åªæé»è®¤å段 |
| | | * |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return é»è®¤åæ®µå±æ§ |
| | | */ |
| | | @Override |
| | | public R<BtmTypeVO> getDefaultAttrByBtmId(String btmTypeId) { |
| | | return R.data(Optional.ofNullable(btmTypeService.getDefaultAttrByBtmId(btmTypeId)).orElseGet(BtmTypeVO::new)); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡ç±»åï¼æææçåæ®µ |
| | | * |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return ææå段 |
| | | */ |
| | | @Override |
| | | public R<BtmTypeVO> getAllAttributeByBtmId(String btmTypeId) { |
| | | return R.data(Optional.ofNullable(btmTypeService.getAllAttributeByBtmId(btmTypeId)).orElseGet(BtmTypeVO::new)); |
| | | } |
| | | |
| | | /** |
| | | * è·åä¸å¡ç±»åï¼æææçåæ®µ |
| | | * |
| | | * @param btmTypeOid ä¸å¡ç±»åä¸»é® |
| | | * @return ææå段 |
| | | */ |
| | | @Override |
| | | public R<BtmTypeVO> getAllAttributeByBtmOid(String btmTypeOid) { |
| | | return R.data(Optional.ofNullable(btmTypeService.getAllAttributeByBtmOid(btmTypeOid)).orElseGet(BtmTypeVO::new)); |
| | | } |
| | | } |
| | |
| | | package com.vci.ubcs.omd.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.vci.ubcs.omd.entity.BtmType; |
| | | import com.vci.ubcs.omd.entity.LinkType; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Description: |
| | | * Description: 龿¥ç±»åæ°æ®å± |
| | | * |
| | | * @author LiHang |
| | | * @date 2023/5/24 |
| | | */ |
| | | public interface LinkTypeMapper extends BaseMapper<LinkType> { |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¨é¨ç龿¥ |
| | | * @return 龿¥ç±»åæ°æ®å¯¹è±¡å表 |
| | | */ |
| | | List<LinkType> selectAll(); |
| | | } |
| | |
| | | import com.vci.ubcs.omd.dto.BtmTypeLinkAttributesDTO; |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | |
| | |
| | | * @return å
å«ç屿§ |
| | | */ |
| | | List<BtmTypeAttribute> selectByBtmTypeIds(List<String> idList); |
| | | |
| | | /** |
| | | * è·åé»è®¤å段 |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | List<BtmTypeAttributeVO> getDefaultAttribute(BtmTypeVO btmType); |
| | | |
| | | /** |
| | | * è·åææå段 |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | List<BtmTypeAttributeVO> getAllAttribute(BtmTypeVO btmType); |
| | | } |
| | |
| | | package com.vci.ubcs.omd.service; |
| | | |
| | | import com.vci.ubcs.omd.dto.BtmTypeDTO; |
| | | import com.vci.ubcs.omd.dto.BtmTypeLinkAttributesDTO; |
| | | import com.vci.ubcs.omd.entity.BtmType; |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | | import com.vci.ubcs.omd.entity.ModifyAttributeInfo; |
| | | import com.vci.ubcs.omd.vo.BtmTypeTreeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTreeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeVO; |
| | |
| | | import org.springblade.core.tool.api.R; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | * ædomainåç»ï¼æ¥è¯¢ä¸å¡ç±»å屿§ç»æ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | List<BtmTypeTreeVO> treeDomain(); |
| | | List<BtmTreeVO> treeDomain(); |
| | | |
| | | /** |
| | | * 仿°æ®åºè¡¨ä¸è·å |
| | |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | List<BtmTypeVO> saveFromTable(List<BtmTypeDTO> btmTypeDTOList,String domain); |
| | | |
| | | /** |
| | | * æç
§ä¸å¡ç±»åidè·åé»è®¤å±æ§ |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return ä¸å¡ç±»å |
| | | */ |
| | | BtmTypeVO getDefaultAttrByBtmId(String btmTypeId); |
| | | |
| | | /** |
| | | * æç
§ä¸å¡ç±»åidè·åææç屿§ |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return ä¸å¡ç±»å |
| | | */ |
| | | BtmTypeVO getAllAttributeByBtmId(String btmTypeId); |
| | | |
| | | /** |
| | | * æç
§ä¸å¡ç±»å主é®è·åææç屿§ |
| | | * @param btmTypeOid ä¸å¡ç±»åä¸»é® |
| | | * @return ä¸å¡ç±»å |
| | | */ |
| | | BtmTypeVO getAllAttributeByBtmOid(String btmTypeOid); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.vci.ubcs.omd.entity.LinkType; |
| | | import com.vci.ubcs.omd.vo.BtmTreeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeVO; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | |
| | | * @return è±æåç§°è±æå°å |
| | | */ |
| | | Set<String> listUsedBtmType(); |
| | | /** |
| | | * ædomainåç»ï¼æ¥è¯¢ä¸å¡ç±»å屿§ç»æ |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | List<BtmTreeVO> treeDomain(); |
| | | } |
| | |
| | | package com.vci.ubcs.omd.service.impl; |
| | | |
| | | import com.alibaba.cloud.commons.lang.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.vci.ubcs.omd.constant.BtmTypeConstant; |
| | | import com.vci.ubcs.omd.constant.BtmTypeFieldConstant; |
| | | import com.vci.ubcs.omd.dto.BtmTypeLinkAttributesDTO; |
| | | import com.vci.ubcs.omd.entity.BtmTypeAttribute; |
| | | import com.vci.ubcs.omd.mapper.BtmTypeAttributeMapper; |
| | | import com.vci.ubcs.omd.service.IAttributeService; |
| | | import com.vci.ubcs.omd.service.IBtmTypeAttributeService; |
| | | import com.vci.ubcs.omd.vo.BtmTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.BtmTypeVO; |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeAttributeWrapper; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | | import com.vci.ubcs.starter.web.enumpck.VciFieldTypeEnum; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | public List<BtmTypeAttribute> selectByBtmTypeIds(List<String> idList) { |
| | | return baseMapper.selectByBtmTypeIds(idList); |
| | | } |
| | | |
| | | /** |
| | | * è·åé»è®¤å段 |
| | | * |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public List<BtmTypeAttributeVO> getDefaultAttribute(BtmTypeVO btmType) { |
| | | List<BtmTypeAttributeVO> list = new ArrayList<>(); |
| | | // ä¸å¡ç±»åçåºæ¬å段 |
| | | BtmTypeFieldConstant.BASIC_FIELD_MAP.forEach((id,name) -> { |
| | | BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); |
| | | vo.setId(id); |
| | | vo.setName(name); |
| | | vo.setPkBtmType(btmType.getOid()); |
| | | if (StringUtils.equals(id,"oid")){ |
| | | vo.setNullableFlag(false); |
| | | }else { |
| | | vo.setNullableFlag(true); |
| | | } |
| | | if (Arrays.asList("createtime","lastmodifytime","owner").contains(id)){ |
| | | vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name()); |
| | | vo.setAttributeLength(6); |
| | | }else { |
| | | vo.setAttrDataType(VciFieldTypeEnum.VTString.name()); |
| | | vo.setAttributeLength(150); |
| | | } |
| | | list.add(vo); |
| | | }); |
| | | |
| | | // çæ¬è§ååæ®µ |
| | | if (StringUtils.isNotBlank(btmType.getRevisionRuleId())){ |
| | | BtmTypeFieldConstant.REVISION_MANAGE_FIELD_MAP.forEach((id,name) -> { |
| | | BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); |
| | | vo.setId(id); |
| | | vo.setName(name); |
| | | vo.setPkBtmType(btmType.getOid()); |
| | | if (Arrays.asList("lastr","firstr","lastv","firstv","revisionseq","versionseq","revisionvalue","versionvalue").contains(id)){ |
| | | vo.setAttributeLength(5); |
| | | vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name()); |
| | | } |
| | | if (Arrays.asList("checkintime","checkouttime").contains(id)){ |
| | | vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name()); |
| | | vo.setAttributeLength(6); |
| | | } |
| | | list.add(vo); |
| | | }); |
| | | } |
| | | |
| | | // çå½å¨æå段 |
| | | if (StringUtils.isNotBlank(btmType.getLifeCycleId())){ |
| | | BtmTypeFieldConstant.LIFECYCLE_MANAGE_FIELD_MAP.forEach((id,name) -> { |
| | | BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); |
| | | vo.setId(id); |
| | | vo.setName(name); |
| | | vo.setPkBtmType(btmType.getOid()); |
| | | vo.setAttributeLength(50); |
| | | vo.setAttrDataType(VciFieldTypeEnum.VTString.name()); |
| | | list.add(vo); |
| | | }); |
| | | } |
| | | |
| | | // å¯çº§å段 |
| | | if (btmType.isSecretFlag()){ |
| | | BtmTypeFieldConstant.SECRET_MANAGE_FIELD_MAP.forEach((id,name) -> { |
| | | BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); |
| | | vo.setId(id); |
| | | vo.setName(name); |
| | | vo.setPkBtmType(btmType.getOid()); |
| | | vo.setAttributeLength(5); |
| | | vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name()); |
| | | list.add(vo); |
| | | }); |
| | | } |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * è·åææå段 |
| | | * |
| | | * @param btmType ä¸å¡ç±»å |
| | | * @return æ§è¡ç»æ |
| | | */ |
| | | @Override |
| | | public List<BtmTypeAttributeVO> getAllAttribute(BtmTypeVO btmType) { |
| | | List<BtmTypeAttributeVO> list = getAttributeByBtmTypeOid(btmType.getOid()); |
| | | list.addAll(getDefaultAttribute(btmType)); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 表ååç¼ |
| | | */ |
| | | public static final String PL = "PL"; |
| | | public static final String PL = "PLBT"; |
| | | |
| | | /** |
| | | * è®¾ç½®å¹³å°æ¬èº«çä¸å¡ç±»å |
| | |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public List<BtmTypeTreeVO> treeDomain() { |
| | | public List<BtmTreeVO> treeDomain() { |
| | | try { |
| | | Map<String, String> domain = Optional.ofNullable(DomainRepeater.getDomain()).orElseGet(ArrayList::new).stream().collect(Collectors.toMap(s -> s.getValue(), t -> t.getLabel())); |
| | | List<BtmTypeVO> vos = BtmTypeWrapper.build().listEntityVO(baseMapper.selectAll()); |
| | | Map<String, List<BtmTypeVO>> domainMap = vos.stream().collect(Collectors.groupingBy(BtmTypeVO::getDomain)); |
| | | List<BtmTypeTreeVO> treeList = new ArrayList<>(); |
| | | List<BtmTreeVO> treeList = new ArrayList<>(); |
| | | domainMap.forEach((k,v)-> { |
| | | if (domain.containsKey(k)){ |
| | | String label = domain.get(k); |
| | | BtmTypeTreeVO parent = new BtmTypeTreeVO(); |
| | | BtmTreeVO parent = new BtmTreeVO(); |
| | | parent.setName(label); |
| | | parent.setId(k); |
| | | parent.setChildList(v.stream().map(s -> { |
| | | BtmTypeTreeVO child = new BtmTypeTreeVO(); |
| | | BtmTreeVO child = new BtmTreeVO(); |
| | | child.setOid(s.getOid()); |
| | | child.setName(s.getId() + " " + (s.getName() == null ? "" : s.getName())); |
| | | child.setId(s.getId()); |
| | |
| | | } |
| | | return BtmTypeWrapper.build().listEntityVO(btmList); |
| | | } |
| | | |
| | | /** |
| | | * æç
§ä¸å¡ç±»åidè·åé»è®¤å±æ§ |
| | | * |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return ä¸å¡ç±»å |
| | | */ |
| | | @Override |
| | | public BtmTypeVO getDefaultAttrByBtmId(String btmTypeId) { |
| | | BtmTypeVO btmType = getBtmTypeById(btmTypeId); |
| | | if (btmType == null){ |
| | | return null; |
| | | } |
| | | btmType.setAttributes(btmTypeAttributeService.getDefaultAttribute(btmType)); |
| | | return btmType; |
| | | } |
| | | |
| | | /** |
| | | * æç
§ä¸å¡ç±»åidè·åææç屿§ |
| | | * |
| | | * @param btmTypeId ä¸å¡ç±»åid |
| | | * @return ä¸å¡ç±»å |
| | | */ |
| | | @Override |
| | | public BtmTypeVO getAllAttributeByBtmId(String btmTypeId) { |
| | | BtmTypeVO btmType = getBtmTypeById(btmTypeId); |
| | | if (btmType == null){ |
| | | return null; |
| | | } |
| | | btmType.setAttributes(btmTypeAttributeService.getAllAttribute(btmType)); |
| | | return btmType; |
| | | } |
| | | |
| | | /** |
| | | * æç
§ä¸å¡ç±»å主é®è·åææç屿§ |
| | | * |
| | | * @param btmTypeOid ä¸å¡ç±»åä¸»é® |
| | | * @return ä¸å¡ç±»å |
| | | */ |
| | | @Override |
| | | public BtmTypeVO getAllAttributeByBtmOid(String btmTypeOid) { |
| | | BtmTypeVO btmType = getBtmTypeByOid(btmTypeOid); |
| | | if (btmType == null){ |
| | | return null; |
| | | } |
| | | btmType.setAttributes(btmTypeAttributeService.getAllAttribute(btmType)); |
| | | return btmType; |
| | | } |
| | | } |
| | |
| | | import com.vci.ubcs.omd.mapper.LinkTypeMapper; |
| | | import com.vci.ubcs.omd.repeater.DomainRepeater; |
| | | import com.vci.ubcs.omd.service.*; |
| | | import com.vci.ubcs.omd.vo.LinkTypeAttributeVO; |
| | | import com.vci.ubcs.omd.vo.LinkTypeVO; |
| | | import com.vci.ubcs.omd.vo.*; |
| | | import com.vci.ubcs.omd.wrapper.BtmTypeWrapper; |
| | | import com.vci.ubcs.omd.wrapper.LinkTypeAttributeWrapper; |
| | | import com.vci.ubcs.omd.wrapper.LinkTypeWrapper; |
| | | import com.vci.ubcs.starter.exception.VciBaseException; |
| | |
| | | @Autowired |
| | | private IModifyAttributeService modifyAttributeService; |
| | | |
| | | public final String BTM_NAME = "linkType"; |
| | | |
| | | /** |
| | | * 表ååç¼ |
| | | */ |
| | | public static final String PL = "PL"; |
| | | public static final String PL = "PLLT"; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | return btmTypeSet; |
| | | } |
| | | |
| | | /** |
| | | * ædomainåç»ï¼æ¥è¯¢é¾æ¥ç±»å屿§ç»æ |
| | | * |
| | | * @return æ¥è¯¢ç»æ |
| | | */ |
| | | @Override |
| | | public List<BtmTreeVO> treeDomain() { |
| | | 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()); |
| | | Map<String, List<LinkTypeVO>> domainMap = vos.stream().collect(Collectors.groupingBy(LinkTypeVO::getDomain)); |
| | | List<BtmTreeVO> treeList = new ArrayList<>(); |
| | | domainMap.forEach((k,v)-> { |
| | | if (domain.containsKey(k)){ |
| | | String label = domain.get(k); |
| | | BtmTreeVO parent = new BtmTreeVO(); |
| | | parent.setName(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.setId(s.getId()); |
| | | return child; |
| | | }).collect(Collectors.toList())); |
| | | treeList.add(parent); |
| | | } |
| | | }); |
| | | return treeList; |
| | | } catch (NacosException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | } |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="base_query_column"> |
| | | oid, id, name, descrption, shape, impl_class, from_btm_type, from_btm_type_name, |
| | | 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 |
| | | </sql> |
| | |
| | | <sql id="tableName"> |
| | | pl_omd_link_type |
| | | </sql> |
| | | |
| | | <select id="selectAll" resultMap="BaseResultMap"> |
| | | select <include refid="base_query_column"/> |
| | | from <include refid="tableName" /> |
| | | </select> |
| | | |
| | | </mapper> |