From c345857ce72518172c5d44bb6b8af7589a023dca Mon Sep 17 00:00:00 2001 From: haha Date: Wed, 23 Apr 2025 23:43:26 +0800 Subject: [PATCH] =?UTF-8?q?BIM=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yanzhu/bim/domain/BimModelInfo.java | 28 ++++ .../mapper/bim/BimModelInfoMapper.xml | 43 +++-- yanzhu-modules/yanzhu-manage/pom.xml | 6 +- .../controller/bim/BimModelController.java | 45 ++++++ yanzhu-ui-vue3/public/config.js | 10 +- yanzhu-ui-vue3/src/api/bim/bimModel.js | 7 + .../views/bim/bimSetting/ModelFloorTree.vue | 147 ++++++++++++++++-- .../src/views/bim/bimSetting/index.vue | 35 +++++ 8 files changed, 287 insertions(+), 34 deletions(-) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/bim/domain/BimModelInfo.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/bim/domain/BimModelInfo.java index 24943437..6d05d8b0 100755 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/bim/domain/BimModelInfo.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/bim/domain/BimModelInfo.java @@ -61,6 +61,34 @@ public class BimModelInfo extends BaseEntity @Excel(name = "是否有效") private Long isDel; + private String comName; + private String projectName; + private String deptName; + + public String getComName() { + return comName; + } + + public void setComName(String comName) { + this.comName = comName; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } + + public String getDeptName() { + return deptName; + } + + public void setDeptName(String deptName) { + this.deptName = deptName; + } + public Long getIsDel() { return isDel; } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/bim/BimModelInfoMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/bim/BimModelInfoMapper.xml index a6c0c1eb..7fc9cf3c 100755 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/bim/BimModelInfoMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/bim/BimModelInfoMapper.xml @@ -8,6 +8,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -27,33 +30,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select model_id, com_id, project_id, dept_id, model_name, lightweightName, gis_json, model_status, model_type, - file_type, file_size, show_sand, status, remark, create_by, create_time, update_by, update_time,is_del - from bim_model_info + select bmi.model_id, bmi.com_id, bmi.project_id, + sp.dept_name projectName, + sd.dept_name com_name,pd.sub_dept_name dept_name, + bmi.dept_id, bmi.model_name, bmi.lightweightName, bmi.gis_json, bmi.model_status, bmi.model_type, + bmi.file_type, bmi.file_size, bmi.show_sand, bmi.status, bmi.remark, bmi.create_by, bmi.create_time, bmi.update_by, bmi.update_time,bmi.is_del + from bim_model_info bmi + left join sys_dept sp on sp.dept_id = bmi.project_id + left join sys_dept sd on sd.dept_id = bmi.com_id + left join pro_project_info_subdepts pd on pd.id=bmi.dept_id diff --git a/yanzhu-modules/yanzhu-manage/pom.xml b/yanzhu-modules/yanzhu-manage/pom.xml index 32970d90..d65b984c 100644 --- a/yanzhu-modules/yanzhu-manage/pom.xml +++ b/yanzhu-modules/yanzhu-manage/pom.xml @@ -174,7 +174,11 @@ mpxj 13.5.1 - + + org.xerial + sqlite-jdbc + 3.41.2.2 + diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bim/BimModelController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bim/BimModelController.java index ed05323f..2404e81f 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bim/BimModelController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bim/BimModelController.java @@ -79,6 +79,51 @@ public class BimModelController { } } + + /** + * 叶子节点的model_tree查询 + * @param name + * @param pid + * @return + */ + @GetMapping("/modelTreeAllLeafChild/{name}") + public AjaxResult getModelTreeAllLeafChildren(@PathVariable("name") String name,String pid) { + if(StringUtils.isEmpty(name)){ + return AjaxResult.error("name is null"); + } + String sql=""; + if(StringUtils.isEmpty(pid)){ + sql="select * from model_tree "; + }else{ + sql="with recursive\n" + + " cao as (\n" + + " select * from model_tree where glid = ? \n" + + " union all\n" + + " select model_tree.* from cao join model_tree on cao.glid = model_tree.pGlid\n" + + " )\n" + + "select glid from cao where externalid<>0"; + } + String path=bimDataSource.getDbPath(name); + if(!new File(path).exists()){ + return AjaxResult.error("file not found!"); + } + try { + DataSource ds = bimDataSource.getDataSource(name); + PreparedStatement pss= ds.getConnection().prepareStatement(sql); + if(StringUtils.isNotEmpty(pid)) { + pss.setString(1,pid); + } + ResultSet rs = pss.executeQuery(); + List list = new ArrayList<>(); + while (rs.next()) { + list.add(rs.getString("glid")); + } + return AjaxResult.success(list); + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + /** * 不带子节点的Model_Tree查询 * @param name diff --git a/yanzhu-ui-vue3/public/config.js b/yanzhu-ui-vue3/public/config.js index 6f05f8bf..36bf443b 100644 --- a/yanzhu-ui-vue3/public/config.js +++ b/yanzhu-ui-vue3/public/config.js @@ -5,8 +5,14 @@ window.config = { modelFile: "https://model.jhncidg.com:18086", secretKey: "cbe8c300dfb0280d71bf6546087c6d2fa49260085f53fca86c69755ac3a39199e08cb605efce617acfa509d5f3ee4d7f67a84d7c36cc175589405fde5d995a24258c47f45b34485a2edb350010e2f42cd5b388af45c6b070850288d284cbbbcd51e36f41b756a25f38d27dbe2e47e96b9eb56a96b59d61e02a467e881f70b21989b1a50685b6fc0265f528fc20b876d425a89c4bf6b33f829177fda27027e65b8a94867b381ae88ecd6668e8ca6b6d286dce7e5d799b0a1791905fc1eba1be4bd6b2a0d0983e9fd1184d8dbba49a8569257e195e636a849299be5a52d738b8218ae3e55ca95ec2999742c749dda98108ecfe0622c0e7fe1d76ad60b6c191c99adca5f9cf5e5f096c599f1874ee756fe16dce7e5d799b0a175d5afe5554a4332203e774bed8a045353e9bf5abfe83ffe0cca50ef6c618828a9d63dac2d06e44c19cc1e4d0220e60c6fb1ba2643538d1973ae24d1650ef196ed32b1cdbecb9bf3ae2651ff226b8a2383977aeaabb9225d76f8b62bd8891c29bfb1ba2643538d1973ae24d1650ef196ed32b1cdbecb9bf3aded264d2944b7de536ca05b5a67eccf9e531630520dbe4663b2d265fe6a4c8877fcba7ce8189fbc216cdeb3ecbc1d365395fd220141d4e6d9fd317e3dac7bb223013404ec41c18c9cc748e652ce16fe7061c32d550edfda330c1555e0c08e51f698f96b91615d8229cf32d2e110ec91f1211e23c769b5bbe1aa9a9191a2d3da09800e6efdee12ee04fdc9df330134f94052efc320a8c1a143e939c0e3b1ad476cf3630a2823a9a2dc2a17ec077fd21bfa7550ed054853e32510f8a6ea5c1dff9c3d61f7cf5f649cb25f0dbad9f7f66e3b446946685cead0cfac91bea061f4ff49a2f853c245297edc3d61f7cf5f649cb0f9b84173857a7b67c27928b58b4a6a65f517a43f106335ecc43571d292f54baa4596f82cf86665b367e01045009c18a2b543696b93a5bd44ca8168b525235150ffadf3f628aa7e8a20b9e74d76bd3a1e26b026e5297005a780f011db11ddb55fbabdc0f876c1cdfa5ef7db74bbc52e19c6396ffcf10044da26ecd334722494fc515b205e9624a4468762f63f0143583d1eeaaa85ff95ee50d8f953f44140ab40f29957f914b2241fd1309b7be0d5f9e55207069d393244a5be14de83e99956e957e025b859c7dd3cebcdd4589bf15942a17f162a5b95af68b416632dbf24db069995334a82a49d6060f7a5b770b6e18ecf8cb01c0e21b608156b326e2f4461369f266ad62ac2edf64d1767ac6ea3d83c9ba33a4517541406791c384c597539cc1ffcdbe8f3563a125da5d3905c7f92abef0fe8b967e5bc2832940bf4230fe93bdd44267922427c4db140fd5cb164da87f17f480c39e9c1c17bd48d031e3ce8ab3a49456b48f3b49549c2da3f62d2a8da7d5f36e39ce04af5e3f8253971ef20b10b7b200fbc7c3d3f71e19f74e660313cf3630a2823a9a2d0acd9cb22f32e975d8b70082aab5ddbcb644d89a77efad286dee59796b124081510f8a6ea5c1dff9cb0f31d9a93422d1de95a0001376b8d685af667dd7ebaf4bdfc4840ac1126277417910a2ed0df6e3ca2026459a491059689206d702832f51afafd0506174e868c12cc462769b2e685be04514c976edd04ca2ef020dc56bee8321afe91a1dcbb1afafd0506174e8680f18f43fcd13957eef440c21db889c81888bce192514399191b48af868eda487753151533a27704469e5635404d6fdfb753151533a277044afdd825f7197f289753151533a27704484b9cf9eccaf749638930dbe9049f2ae36689b286e75a81e016aa63061505f57a8c1113b833628e3a18dff8ae8ac8eaae0e7c3406ae4dd4e10880b34c16e1b7405884ca1d5603015a7b0730878fafb08", - serverIP: "model.jhncidg.com", - port: "8000", + serverIP: "model.jhncidg.com", //服务ip地址 + port: "8000", //HTTP端口 + useHttps: true, //使用Https + openEarth: false, //[可选]开启Gis场景 + bgColor: "rgba(135 ,206 ,250,1)", //[可选]bim场景背景色, 传值即为纯色天空盒 + tintColor: "rgba(255,255,0,1)", //[可选]osgb单体化颜色 + sceneTime: ["13:00", "6:00", "18:00"], //[可选]分别为当前时间、日出时间、日落时间 + cadMode: false, // 是否是Cad图纸预览模式 modelInput: { ConfigJson: { style: 1, diff --git a/yanzhu-ui-vue3/src/api/bim/bimModel.js b/yanzhu-ui-vue3/src/api/bim/bimModel.js index 3a3f85d0..87324390 100755 --- a/yanzhu-ui-vue3/src/api/bim/bimModel.js +++ b/yanzhu-ui-vue3/src/api/bim/bimModel.js @@ -57,3 +57,10 @@ export function getModelTree(name, pid) { method: "get", }); } + +export function getTreeAllLeafChild(name, pid) { + return request({ + url: "/manage//bim/modelInfo/modelTreeAllLeafChild/" + name + "?pid=" + pid, + method: "get", + }); +} diff --git a/yanzhu-ui-vue3/src/views/bim/bimSetting/ModelFloorTree.vue b/yanzhu-ui-vue3/src/views/bim/bimSetting/ModelFloorTree.vue index b1c26eb8..771087f5 100644 --- a/yanzhu-ui-vue3/src/views/bim/bimSetting/ModelFloorTree.vue +++ b/yanzhu-ui-vue3/src/views/bim/bimSetting/ModelFloorTree.vue @@ -29,14 +29,13 @@ -->
- +
diff --git a/yanzhu-ui-vue3/src/views/bim/bimSetting/index.vue b/yanzhu-ui-vue3/src/views/bim/bimSetting/index.vue index 76972385..88d42775 100644 --- a/yanzhu-ui-vue3/src/views/bim/bimSetting/index.vue +++ b/yanzhu-ui-vue3/src/views/bim/bimSetting/index.vue @@ -23,16 +23,42 @@ export default { subDepts: [], models: [], showTree: false, + initSuccess: false, } }, + beforeUnmount() { + document.body.classList.remove('is-sapi') + }, mounted() { + document.body.classList.add('is-sapi') this.userStore = useUserStore() this.isAdmin = this.userStore.isAdmin this.currentPrjId = this.userStore.currentPrjId this.currentComId = this.userStore.currentComId this.initLoadModel() + this.initEngine() }, methods: { + initEngine() { + window.api = new SAPI( + { + serverIP: window.config.serverIP, //服务ip地址 + port: window.config.port, //HTTP端口 + useHttps: window.config.useHttps, //使用Https + container: 'bimSettingContainer', //[必须]容器id + secretKey: window.config.secretKey, + openEarth: window.config.openEarth, //[可选]开启Gis场景 + bgColor: window.config.bgColor, //[可选]bim场景背景色, 传值即为纯色天空盒 + tintColor: window.config.tintColor, //[可选]osgb单体化颜色 + sceneTime: window.config.sceneTime, //[可选]分别为当前时间、日出时间、日落时间 + cadMode: window.config.cadMode, // 是否是Cad图纸预览模式 + }, + () => { + this.initSuccess = true + console.log('初始化成功') + } + ) + }, initLoadModel() { listBimModel({ pageNum: 1, @@ -55,5 +81,14 @@ export default { \ No newline at end of file