Commit 769dee92 authored by 周亚武's avatar 周亚武

设置界面

parent a6680a34
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<profiles.data.path>/data</profiles.data.path> <profiles.data.path>/data</profiles.data.path>
<profiles.server.port>9000</profiles.server.port> <profiles.server.port>9000</profiles.server.port>
<profiles.siteconfig.configpath>F:\\config.prop</profiles.siteconfig.configpath> <profiles.siteconfig.configpath>F:\\config.prop</profiles.siteconfig.configpath>
<profiles.siteconfig.url>http://192.168.0.98:11091</profiles.siteconfig.url> <profiles.siteconfig.url>192.168.0.98:11091</profiles.siteconfig.url>
<profiles.javacpp.platform>windows-x86_64</profiles.javacpp.platform> <profiles.javacpp.platform>windows-x86_64</profiles.javacpp.platform>
</properties> </properties>
</profile> </profile>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
<profiles.log.path>/root/logs</profiles.log.path> <profiles.log.path>/root/logs</profiles.log.path>
<profiles.server.port>9000</profiles.server.port> <profiles.server.port>9000</profiles.server.port>
<profiles.siteconfig.configpath>/root/config.prop</profiles.siteconfig.configpath> <profiles.siteconfig.configpath>/root/config.prop</profiles.siteconfig.configpath>
<profiles.siteconfig.url>http://192.168.0.98:11091</profiles.siteconfig.url> <profiles.siteconfig.url>192.168.0.98:11091</profiles.siteconfig.url>
<profiles.javacpp.platform>linux-x86_64</profiles.javacpp.platform> <profiles.javacpp.platform>linux-x86_64</profiles.javacpp.platform>
<!-- <profiles.javacpp.platform>linux-arm64</profiles.javacpp.platform>--> <!-- <profiles.javacpp.platform>linux-arm64</profiles.javacpp.platform>-->
</properties> </properties>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<profiles.log.path>/mortals/app/logs</profiles.log.path> <profiles.log.path>/mortals/app/logs</profiles.log.path>
<profiles.server.port>9000</profiles.server.port> <profiles.server.port>9000</profiles.server.port>
<profiles.siteconfig.configpath>/root/config.prop</profiles.siteconfig.configpath> <profiles.siteconfig.configpath>/root/config.prop</profiles.siteconfig.configpath>
<profiles.siteconfig.url>http://10.207.153.67:11091</profiles.siteconfig.url> <profiles.siteconfig.url>10.207.153.67:11091</profiles.siteconfig.url>
<profiles.javacpp.platform>linux-arm64</profiles.javacpp.platform> <profiles.javacpp.platform>linux-arm64</profiles.javacpp.platform>
</properties> </properties>
</profile> </profile>
...@@ -129,6 +129,12 @@ ...@@ -129,6 +129,12 @@
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>5.13.0</version>
</dependency>
<!-- 引入 SpringMVC 相关依赖,并实现对其的自动配置 --> <!-- 引入 SpringMVC 相关依赖,并实现对其的自动配置 -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -2,6 +2,7 @@ package com.mortals.xhx.daemon.applicationservice; ...@@ -2,6 +2,7 @@ package com.mortals.xhx.daemon.applicationservice;
import com.mortals.framework.springcloud.service.IApplicationStartedService; import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.xhx.swing.MyTray; import com.mortals.xhx.swing.MyTray;
import com.mortals.xhx.tts.UI.SettingWindow;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -12,10 +13,10 @@ import org.springframework.stereotype.Component; ...@@ -12,10 +13,10 @@ import org.springframework.stereotype.Component;
public class DemoStartedService implements IApplicationStartedService { public class DemoStartedService implements IApplicationStartedService {
@Value("${siteconfig.configpath:F:\\\\config.prop}") @Value("${siteconfig.configpath:F:\\\\config.prop}")
String filePath; String configPath;
@Value("${siteconfig.url:http://192.168.0.98:11091}") @Value("${siteconfig.url:http://192.168.0.98:11091}")
String siteUrl; String host;
@Override @Override
public void start() { public void start() {
...@@ -33,10 +34,9 @@ public class DemoStartedService implements IApplicationStartedService { ...@@ -33,10 +34,9 @@ public class DemoStartedService implements IApplicationStartedService {
log.info("osName:{}",osName); log.info("osName:{}",osName);
//MyTray.getInstance().SystemTrayInitial(filePath,siteUrl); log.info("configPath:{}",configPath);
log.info("filePath:{}",filePath); log.info("host:{}",host);
log.info("siteUrl:{}",siteUrl); SettingWindow.getInstance().initWindow(configPath,host);
// SetWindow.getInstance().initWindow(filePath,siteUrl);
log.info("初始化托盘完成!"); log.info("初始化托盘完成!");
......
This diff is collapsed.
package com.mortals.xhx.tts.bean;
import lombok.Data;
/**
* @author ZYW
* @date 2024-07-24 9:34
*/
@Data
public class ConfigBean {
private String deviceId; //设备唯一标识
private String httpIndex; //http或https访问
private String host; //服务器ip+端口号
private String register; //register地址
private String deviceInit; //初始化信息获取地址
private String deviceUpdate; //手动注册地址
private String checkVersion; //升级地址
private Integer delayTime; //启动延时
private boolean english; //英双语
private boolean zang; //藏双语
private String speaker; //播音员
private int siteId; // 目前被选中的站点id
private String siteCode = "";
private String siteName = "";
}
package com.mortals.xhx.tts.bean;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ZYW on 2022-07-01.
*/
// platformList array 平台列表 数组
//   platformId Long 平台id -
//   platformName String 名称 -
//   platformSn String 编码 -
//  productList array 产品列表 数组
//   productId Long 产品id -
//   productName String 产品名称 -
//   productCode String 产品编码 -
//  firmList array 设备生产商列表 数组
//   deviceFirmId Long 生产商id -
//   deviceFirmname String 生产商名称 -
//  siteList array 站点列表 数组
//   siteId Long 站点id -
//   siteName String 站点名称 -
//   siteCode String 站点编码 -
public class DeviceInitBean {
private ArrayList<SiteListBean> siteList;
public ArrayList<SiteListBean> getSiteList() {
return siteList;
}
public void setSiteList(ArrayList<SiteListBean> siteList) {
this.siteList = siteList;
}
}
package com.mortals.xhx.tts.bean;
/**
* Created by ZYW on 2022-07-01.
*/
public class DeviceUpdateBean {
private String deviceName;
private String deviceCode;
private Integer siteId;
private String siteCode;
private String siteName;
private Integer productId;
private Integer deviceFirmId;
private String lon;
private String lati;
private Integer deviceInBuilding;
private Integer deviceInFloor;
private String defectsLiabilityPeriod;
private String leadingOfficial;
private String leadingOfficialTelephone;
private Integer source;
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public Integer getSiteId() {
return siteId;
}
public void setSiteId(Integer siteId) {
this.siteId = siteId;
}
public String getSiteCode() {
return siteCode;
}
public void setSiteCode(String siteCode) {
this.siteCode = siteCode;
}
public String getSiteName() {
return siteName;
}
public void setSiteName(String siteName) {
this.siteName = siteName;
}
public Integer getProductId() {
return productId;
}
public void setProductId(Integer productId) {
this.productId = productId;
}
public Integer getDeviceFirmId() {
return deviceFirmId;
}
public void setDeviceFirmId(Integer deviceFirmId) {
this.deviceFirmId = deviceFirmId;
}
public String getLon() {
return lon;
}
public void setLon(String lon) {
this.lon = lon;
}
public String getLati() {
return lati;
}
public void setLati(String lati) {
this.lati = lati;
}
public Integer getDeviceInBuilding() {
return deviceInBuilding;
}
public void setDeviceInBuilding(Integer deviceInBuilding) {
this.deviceInBuilding = deviceInBuilding;
}
public Integer getDeviceInFloor() {
return deviceInFloor;
}
public void setDeviceInFloor(Integer deviceInFloor) {
this.deviceInFloor = deviceInFloor;
}
public String getDefectsLiabilityPeriod() {
return defectsLiabilityPeriod;
}
public void setDefectsLiabilityPeriod(String defectsLiabilityPeriod) {
this.defectsLiabilityPeriod = defectsLiabilityPeriod;
}
public String getLeadingOfficial() {
return leadingOfficial;
}
public void setLeadingOfficial(String leadingOfficial) {
this.leadingOfficial = leadingOfficial;
}
public String getLeadingOfficialTelephone() {
return leadingOfficialTelephone;
}
public void setLeadingOfficialTelephone(String leadingOfficialTelephone) {
this.leadingOfficialTelephone = leadingOfficialTelephone;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
}
package com.mortals.xhx.tts.bean;
/**
* @author ZYW
* @date 2024-01-15 9:55
*/
public class ResultBean {
int code;
String msg;
Object data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
package com.mortals.xhx.tts.bean;
/**
* Created by ZYW on 2022-07-01.
*/
public class SiteListBean {
private String siteCode;
private Integer siteId;
private String siteName;
public String getSiteCode() {
return siteCode;
}
public void setSiteCode(String siteCode) {
this.siteCode = siteCode;
}
public Integer getSiteId() {
return siteId;
}
public void setSiteId(Integer siteId) {
this.siteId = siteId;
}
public String getSiteName() {
return siteName;
}
public void setSiteName(String siteName) {
this.siteName = siteName;
}
@Override
public String toString() {
return siteName + " - "+siteCode;
}
}
package com.mortals.xhx.tts.utils;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.UUID;
/**
* @author ZYW
* @date 2024-07-24 9:20
*/
public class MacAddressReader {
public static String getMacAddress() {
try {
Process process = Runtime.getRuntime().exec("ip link");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = bufferedReader.readLine()) != null) {
if (line.contains("link/ether")) {
String macAddress = line.split(" ")[1];
macAddress = macAddress.trim();
macAddress = macAddress.replace(":", "");
return macAddress;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return getUUID();
}
public static String getUUID(){
String uuid = null;
try {
BufferedReader reader = new BufferedReader(new FileReader("/sys/class/dmi/id/product_uuid"));
try {
uuid = reader.readLine();
System.out.println("Device UUID: " + uuid);
} finally {
reader.close();
}
return uuid;
} catch (IOException e) {
e.printStackTrace();
}
return "123456";
}
public static void main(String[] args) {
System.out.println("MAC Address: " + getMacAddress());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment