From 82dafa095dcfa9a94ed5b6fa45552e038eae3a12 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期一, 08 一月 2024 15:40:45 +0800 Subject: [PATCH] 代码提交 --- Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/IGroupMapAttrXMLService.java | 18 +++ Source/UBCS-WEB/src/views/system/deploy.vue | 152 +++++++++++++++++++++++++ Source/UBCS-WEB/src/api/integration/groupMapAttrXML.js | 9 + Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/GroupMapAttrXMLServiceImpl.java | 47 +++++++ Source/UBCS-WEB/src/api/system/deploy.js | 11 + Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue | 42 +++++++ Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/GroupMapAttrXMLController.java | 37 ++++++ Source/UBCS/ubcs-service/ubcs-deploy/src/main/resources/application-prod.yml | 19 +++ 8 files changed, 335 insertions(+), 0 deletions(-) diff --git a/Source/UBCS-WEB/src/api/integration/groupMapAttrXML.js b/Source/UBCS-WEB/src/api/integration/groupMapAttrXML.js new file mode 100644 index 0000000..5fcdce3 --- /dev/null +++ b/Source/UBCS-WEB/src/api/integration/groupMapAttrXML.js @@ -0,0 +1,9 @@ +import request from '@/router/axios'; + +export const getGroupMapXML = (params) => { + return request({ + url: '/api/ubcs-code/groupMapAttrXML/getGroupMapXML', + method: 'get', + params: params + }) +} \ No newline at end of file diff --git a/Source/UBCS-WEB/src/api/system/deploy.js b/Source/UBCS-WEB/src/api/system/deploy.js new file mode 100644 index 0000000..3c7ca90 --- /dev/null +++ b/Source/UBCS-WEB/src/api/system/deploy.js @@ -0,0 +1,11 @@ +import request from '@/router/axios'; + +export const getApplications = () => { + return request({ + // headers: {'Accept': 'application/json'}, + // url: '/api/ubcs-admin/applications', + url: '/api/ubcs-deploy/deploy/applications', + method: 'get', + }) +} + diff --git a/Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue b/Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue new file mode 100644 index 0000000..94ac602 --- /dev/null +++ b/Source/UBCS-WEB/src/views/integration/groupMapAttrXML.vue @@ -0,0 +1,42 @@ +<template> + <el-container> + <div class="editor-total"> + <div id="editor" v-html="xmlContent"></div> + <button @click="saveXml">淇� 瀛�</button> + </div> + </el-container> +</template> + +<script> +import { getGroupMapXML } from "@/api/integration/groupMapAttrXML.js"; + +export default { + data() { + return { + xmlContent: "", // 浠庡悗绔幏鍙栫殑XML鍐呭 + }; + }, + mounted() { + + }, + created() { + this.onLoad(); + }, + methods: { + onLoad() { + let xmlName = "PDM"; + getGroupMapXML({ xmlName: xmlName }).then((res) => { + this.xmlContent = res.data.data; + console.log(res.data.data); + }); + }, + + }, +}; +</script> +<style> +.editor-total { + width: 100%; + height: 100%; +} +</style> diff --git a/Source/UBCS-WEB/src/views/system/deploy.vue b/Source/UBCS-WEB/src/views/system/deploy.vue new file mode 100644 index 0000000..2271e3b --- /dev/null +++ b/Source/UBCS-WEB/src/views/system/deploy.vue @@ -0,0 +1,152 @@ +<template> + <basic-container> + <avue-crud :option="option" + :table-loading="loading" + :data="data" + :page.sync="page" + :permission="permissionList" + :before-open="beforeOpen" + v-model="form" + ref="crud" + :cell-style="cellStyle" + :row-style="rowStyle" + @on-load="onLoad"> + <template slot-scope="scope" slot="menu"> + <el-button type="text" + icon="el-icon-upload" + size="small" + v-if="permissionList.upload" + @click="handleDownload(scope.row)">涓� 浼� + </el-button> + <el-button type="text" + icon="el-icon-refresh" + size="small" + v-if="permissionList.restart" + @click="test">閲� 鍚� + </el-button> + </template> + <template slot-scope="{row}" + slot="port"> + <el-tag>{{`${row.port}`}}</el-tag> + </template> + <template slot-scope="{row}" + slot="serviceNum"> + <el-tag>{{`${row.serviceNum}`}}</el-tag> + </template> + </avue-crud> + </basic-container> +</template> + +<script> +import { getApplications } from "@/api/system/deploy"; +import moment from 'moment'; +export default { + data() { + return { + option: { + columnBtn:false, + height: 'auto', + calcHeight: 30, + tip: false, + searchShow: false, + border: true, + index: true, + viewBtn: false, + addBtn: false, + editBtn: false, + delBtn: false, + selection: true, + refreshBtn: false, + dialogClickModal: false, + column: [ + { + label: "瀹炰緥鍚嶇О", + prop: "name", + sortable: true, + }, + { + label: "杩愯鐘舵��", + prop: "status", + }, + { + label: "鍚姩鏃堕棿", + prop: "statusTimestamp", + }, + { + label: "绔彛鍙�", + prop: "port", + }, + { + label: "瀹炰緥鏁伴噺", + prop: "serviceNum", + width: 120, + }, + ] + }, + data: [], + } + }, + created() { + + }, + computed: { + permissionList() { + return { + upload: true, + restart: true, + // viewBtn: this.vaildData(this.permission, true), + }; + }, + }, + methods: { + + onLoad(){ + getApplications().then(res=>{ + let serviceData = res.data.data; + if(serviceData.length>0){ + serviceData.forEach(element => { + //console.log("element",element); + // 灏嗘椂闂磋浆鎹负鏈湴鏃堕棿 + let localTime = moment.utc(element.statusTimestamp).local(); + // 鏍煎紡鍖栨椂闂翠负鎮ㄦ兂瑕佺殑鏍煎紡 + let formattedTime = localTime.format('YYYY-MM-DD HH:mm:ss'); + element.statusTimestamp = formattedTime; + this.data.push(element) + }); + } + //console.log(res.data.data); + }); + }, + rowStyle({row,column,rowIndex}){ + if(rowIndex%2===0){ + return { + backgroundColor:'#eee', + color:'#black', + } + } + }, + cellStyle({row,column,rowIndex,columnIndex}){ + if(columnIndex==3){ + if(row.status==="UP"){ + return { + color:'green', + fontWeight:'bold', + fontSize:'20' + } + }else{ + return { + color:'red', + fontWeight:'bold', + fontSize:'20' + } + } + } + }, + + } +} +</script> + +<style scoped> + +</style> \ No newline at end of file diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/GroupMapAttrXMLController.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/GroupMapAttrXMLController.java new file mode 100644 index 0000000..40105b9 --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/controller/GroupMapAttrXMLController.java @@ -0,0 +1,37 @@ +package com.vci.ubcs.code.controller; + +import com.vci.ubcs.code.service.IGroupMapAttrXMLService; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.xml.sax.SAXException; + +import javax.annotation.Resource; +import javax.xml.parsers.ParserConfigurationException; +import java.io.IOException; + +/** + * 闆嗗洟灞炴�ф槧灏剎ml閰嶇疆绠$悊 + * @author ludc + * @date 2024/1/8 9:41 + */ +@RestController +@AllArgsConstructor +@RequestMapping("/groupMapAttrXML") +@Api(value = "闆嗗洟灞炴�ф槧灏剎ml閰嶇疆绠$悊", tags = "闆嗗洟灞炴�ф槧灏剎ml閰嶇疆绠$悊鎺ュ彛") +public class GroupMapAttrXMLController { + + private final IGroupMapAttrXMLService groupMapAttrXMLService; + + @GetMapping("/getGroupMapXML") + public R<String> getGroupMapXMLInfo(@RequestParam("xmlName") String xmlName) throws ParserConfigurationException, IOException, SAXException { + return R.data(groupMapAttrXMLService.getGroupMapXMLInfo(xmlName)); + } + + + +} diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/IGroupMapAttrXMLService.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/IGroupMapAttrXMLService.java new file mode 100644 index 0000000..873e6a5 --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/IGroupMapAttrXMLService.java @@ -0,0 +1,18 @@ +package com.vci.ubcs.code.service; + +import org.springframework.stereotype.Service; +import org.xml.sax.SAXException; + +import javax.xml.parsers.ParserConfigurationException; +import java.io.IOException; + +/** + * 闆嗗洟灞炴�ф槧灏剎ml閰嶇疆绠$悊 + * @author ludc + * @date 2024/1/8 9:39 + */ +public interface IGroupMapAttrXMLService { + + String getGroupMapXMLInfo(String xmlName) throws ParserConfigurationException, IOException, SAXException; + +} diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/GroupMapAttrXMLServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/GroupMapAttrXMLServiceImpl.java new file mode 100644 index 0000000..1c5b5ce --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/GroupMapAttrXMLServiceImpl.java @@ -0,0 +1,47 @@ +package com.vci.ubcs.code.service.impl; + +import com.vci.ubcs.code.service.IGroupMapAttrXMLService; +import com.vci.ubcs.code.util.gennerAttrMapUtil; +import com.vci.ubcs.code.vo.webserviceModel.attrmap.ClsfAttrMappingDO; +import com.vci.ubcs.code.vo.webserviceModel.attrmap.LibraryClsfDO; +import com.vci.ubcs.code.vo.webserviceModel.attrmap.LibraryDO; +import com.vci.ubcs.code.webService.config.AttributeMapConfig; +import lombok.extern.slf4j.Slf4j; +import org.springblade.core.log.exception.ServiceException; +import org.springblade.core.tool.utils.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.xml.sax.SAXException; +import javax.xml.parsers.ParserConfigurationException; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.rmi.ServerException; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 闆嗗洟灞炴�ф槧灏剎ml閰嶇疆绠$悊 + * @author ludc + * @date 2024/1/8 9:40 + */ +@Service +@Slf4j +public class GroupMapAttrXMLServiceImpl implements IGroupMapAttrXMLService { + + private static final String XML_FILE_PATH = "C:\\data1\\ubcs\\ubcs-server\\xml\\PDM.xml"; + + @Override + public String getGroupMapXMLInfo(String xmlName) throws IOException { + try { + File file = new File(XML_FILE_PATH); + byte[] bytes = Files.readAllBytes(Paths.get(file.toURI())); + return new String(bytes); + } catch (Exception e) { + throw new ServerException(StringUtil.format("璇诲彇%s鏂囦欢澶辫触锛屽師鍥狅細%s",xmlName,e.getMessage())); + } + } + +} diff --git a/Source/UBCS/ubcs-service/ubcs-deploy/src/main/resources/application-prod.yml b/Source/UBCS/ubcs-service/ubcs-deploy/src/main/resources/application-prod.yml new file mode 100644 index 0000000..460ac5c --- /dev/null +++ b/Source/UBCS/ubcs-service/ubcs-deploy/src/main/resources/application-prod.yml @@ -0,0 +1,19 @@ +#鏈嶅姟鍣ㄧ鍙� +server: + port: 8118 + tomcat: + uri-encoding: UTF-8 + servlet: + encoding: + enabled: true + charset: UTF-8 + force: true +#鏁版嵁婧愰厤缃� +spring: + datasource: + url: ${blade.datasource.prod.url} + username: ${blade.datasource.prod.username} + password: ${blade.datasource.prod.password} + messages: + encoding: utf-8 + basename: i18n/messages -- Gitblit v1.9.3