|
|
@@ -11,6 +11,8 @@ import com.mes.component.MesRadio;
|
|
|
import com.mes.component.MesWebView;
|
|
|
import com.mes.component.MyDialog;
|
|
|
import com.mes.netty.NettyClient;
|
|
|
+import com.mes.util.ClientVersionUtils;
|
|
|
+import com.mes.util.ClientUpgrade;
|
|
|
import com.mes.util.ConfigUtil;
|
|
|
import com.mes.util.DateLocalUtils;
|
|
|
import com.mes.util.HttpUtils;
|
|
|
@@ -64,6 +66,7 @@ public class MesClient extends JFrame {
|
|
|
public static int mes_heart_beat_cycle = 10;
|
|
|
public static int mes_heart_icon_cycle = 1;
|
|
|
public static String mes_line_sn = "";
|
|
|
+ public static String client_version = "0.0.0"; // 打包发布版本,需和后台 JAR 管理版本号对齐
|
|
|
public static String mes_gwflag = ""; // 工位标识
|
|
|
public static String mes_sn_prefix = ""; // 工件码开头格式(共用回退),多个用逗号分隔
|
|
|
public static String mes_sn_prefix_a = ""; // 第1码(OP030)开头格式
|
|
|
@@ -207,12 +210,20 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
+ if (ClientUpgrade.handleInstallArgs(args)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
EventQueue.invokeLater(new Runnable() {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try{
|
|
|
//鐠囩粯鏋冩禒鍫曞帳缂冿拷
|
|
|
readProperty();
|
|
|
+ if (ClientUpgrade.recoverIncompleteInstall()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ClientUpgrade.cleanupInstallLeftovers();
|
|
|
+ ClientUpgrade.checkIfConfigured(null);
|
|
|
|
|
|
// 閺勫墽銇氶悾宀勬桨
|
|
|
mesClientFrame = new MesClient();
|
|
|
@@ -690,10 +701,22 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
|
|
|
|
//鐠囧鍘ょ純顔芥瀮娴狅拷
|
|
|
+
|
|
|
+ private static String parseClientVersion(String value) {
|
|
|
+ if (value == null || value.trim().isEmpty()) {
|
|
|
+ return "0.0.0";
|
|
|
+ }
|
|
|
+ return ClientVersionUtils.normalize(value.trim());
|
|
|
+ }
|
|
|
+
|
|
|
private static void readProperty() throws IOException{
|
|
|
Properties pro = ConfigUtil.loadProperties();
|
|
|
ConfigUtil.printStartupInfo();
|
|
|
mes_gw = pro.getProperty("mes.gw");
|
|
|
+ if (mes_gw != null && mes_gw.trim().length() > 0) {
|
|
|
+ ClientUpgrade.setStationOprno(mes_gw.trim() + "A");
|
|
|
+ }
|
|
|
+ client_version = parseClientVersion(pro.getProperty("mes.client.version"));
|
|
|
mes_gw_a = pro.getProperty("mes.gw.a", mes_gw).trim();
|
|
|
mes_gw_b = pro.getProperty("mes.gw.b", mes_gw).trim();
|
|
|
|