¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/router/axios'; |
| | | |
| | | export const getGroupMapXML = (params) => { |
| | | return request({ |
| | | url: '/api/ubcs-code/groupMapAttrXML/getGroupMapXML', |
| | | method: 'get', |
| | | params: params |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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', |
| | | }) |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * éå¢å±æ§æ å°xmlé
置管ç |
| | | * @author ludc |
| | | * @date 2024/1/8 9:41 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("/groupMapAttrXML") |
| | | @Api(value = "éå¢å±æ§æ å°xmlé
置管ç", tags = "éå¢å±æ§æ å°xmlé
ç½®ç®¡çæ¥å£") |
| | | 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)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * éå¢å±æ§æ å°xmlé
置管ç |
| | | * @author ludc |
| | | * @date 2024/1/8 9:39 |
| | | */ |
| | | public interface IGroupMapAttrXMLService { |
| | | |
| | | String getGroupMapXMLInfo(String xmlName) throws ParserConfigurationException, IOException, SAXException; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * éå¢å±æ§æ å°xmlé
置管ç |
| | | * @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())); |
| | | } |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | #æå¡å¨ç«¯å£ |
| | | 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 |