|
@@ -3,6 +3,8 @@ package com.mes.ui;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.mes.component.MesRadio;
|
|
import com.mes.component.MesRadio;
|
|
|
import com.mes.component.MesWebView;
|
|
import com.mes.component.MesWebView;
|
|
|
|
|
+import com.mes.util.ClientUpgrade;
|
|
|
|
|
+import com.mes.util.ClientVersionUtils;
|
|
|
import com.mes.util.DateLocalUtils;
|
|
import com.mes.util.DateLocalUtils;
|
|
|
import com.mes.util.HttpUtils;
|
|
import com.mes.util.HttpUtils;
|
|
|
import com.mes.util.JdbcUtils;
|
|
import com.mes.util.JdbcUtils;
|
|
@@ -37,6 +39,7 @@ public class MesClient extends JFrame {
|
|
|
public static String mes_server_ip = ""; // 服务器IP地址
|
|
public static String mes_server_ip = ""; // 服务器IP地址
|
|
|
public static int mes_heart_icon_cycle = 1;
|
|
public static int mes_heart_icon_cycle = 1;
|
|
|
public static String mes_line_sn = ""; // 产线编号
|
|
public static String mes_line_sn = ""; // 产线编号
|
|
|
|
|
+ public static String client_version = "0.0.0"; // 打包发布版本,需和后台 JAR 管理版本号对齐
|
|
|
|
|
|
|
|
//新增字段
|
|
//新增字段
|
|
|
public static ProductTypePanel productTypePanel;
|
|
public static ProductTypePanel productTypePanel;
|
|
@@ -104,6 +107,9 @@ public class MesClient extends JFrame {
|
|
|
public static JLabel fxlabel;
|
|
public static JLabel fxlabel;
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
|
|
+ if (ClientUpgrade.handleInstallArgs(args)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// if (LockUtil.getInstance().isAppActive() == false){
|
|
// if (LockUtil.getInstance().isAppActive() == false){
|
|
|
//// JOptionPane.showMessageDialog(null, "已有一个程序在运行,程序退出");
|
|
//// JOptionPane.showMessageDialog(null, "已有一个程序在运行,程序退出");
|
|
@@ -117,6 +123,11 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
//读文件配置
|
|
//读文件配置
|
|
|
readProperty();
|
|
readProperty();
|
|
|
|
|
+ if (ClientUpgrade.recoverIncompleteInstall()) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ ClientUpgrade.cleanupInstallLeftovers();
|
|
|
|
|
+ ClientUpgrade.checkIfConfigured(null);
|
|
|
|
|
|
|
|
// 显示界面
|
|
// 显示界面
|
|
|
mesClientFrame = new MesClient();
|
|
mesClientFrame = new MesClient();
|
|
@@ -149,6 +160,7 @@ public class MesClient extends JFrame {
|
|
|
pro.load(br);
|
|
pro.load(br);
|
|
|
mes_gw = pro.getProperty("mes.gw");
|
|
mes_gw = pro.getProperty("mes.gw");
|
|
|
mes_line_sn = pro.getProperty("mes.line_sn");
|
|
mes_line_sn = pro.getProperty("mes.line_sn");
|
|
|
|
|
+ client_version = parseClientVersion(pro.getProperty("mes.client.version"));
|
|
|
|
|
|
|
|
if (mes_gw == null) {
|
|
if (mes_gw == null) {
|
|
|
mes_gw = "";
|
|
mes_gw = "";
|
|
@@ -170,7 +182,14 @@ public class MesClient extends JFrame {
|
|
|
} else {
|
|
} else {
|
|
|
mes_gw_des = "";
|
|
mes_gw_des = "";
|
|
|
}
|
|
}
|
|
|
- log.info(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + ";");
|
|
|
|
|
|
|
+ log.info(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + "; version=" + client_version);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private static String parseClientVersion(String value) {
|
|
|
|
|
+ if (value == null || value.trim().isEmpty()) {
|
|
|
|
|
+ return "0.0.0";
|
|
|
|
|
+ }
|
|
|
|
|
+ return ClientVersionUtils.normalize(value.trim());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void applyOpConfig(String op, String opName, String ip) {
|
|
public static void applyOpConfig(String op, String opName, String ip) {
|