hou 1 mēnesi atpakaļ
revīzija
09c0539d10
100 mainītis faili ar 4307 papildinājumiem un 0 dzēšanām
  1. 24 0
      .classpath
  2. 7 0
      .gitignore
  3. 17 0
      .project
  4. 2 0
      image/.gitignore
  5. BIN
      image/background.png
  6. BIN
      image/bg/a_side.png
  7. BIN
      image/bg/b_side.png
  8. BIN
      image/bg/bar_add.png
  9. BIN
      image/bg/bar_bookmark.png
  10. BIN
      image/bg/bar_cmd_go.png
  11. BIN
      image/bg/bar_edit.png
  12. BIN
      image/bg/bar_pause.png
  13. BIN
      image/bg/bar_sampling.png
  14. BIN
      image/bg/bar_setting.png
  15. BIN
      image/bg/bar_stop.png
  16. BIN
      image/bg/close_bt.png
  17. BIN
      image/bg/company_setting_logo.png
  18. BIN
      image/bg/delete.png
  19. BIN
      image/bg/department_setting_logo.png
  20. BIN
      image/bg/download.png
  21. BIN
      image/bg/equipment_setting_logo.png
  22. BIN
      image/bg/gj_001_1_20.png
  23. BIN
      image/bg/gj_001_21_40.png
  24. BIN
      image/bg/gj_001_41_60.png
  25. BIN
      image/bg/green_dot.png
  26. BIN
      image/bg/grey_dot.png
  27. BIN
      image/bg/icon.png
  28. BIN
      image/bg/inductance_logo.png
  29. BIN
      image/bg/insulation_logo.png
  30. BIN
      image/bg/login.png
  31. BIN
      image/bg/logo.png
  32. BIN
      image/bg/logoff.png
  33. BIN
      image/bg/menu_data_analysis.png
  34. BIN
      image/bg/menu_data_preprocess.png
  35. BIN
      image/bg/menu_file.png
  36. BIN
      image/bg/menu_setting.png
  37. BIN
      image/bg/min_bt.png
  38. BIN
      image/bg/ng_bg.png
  39. BIN
      image/bg/ok_bg.png
  40. BIN
      image/bg/open_file.png
  41. BIN
      image/bg/refresh.png
  42. BIN
      image/bg/reset_logo.png
  43. BIN
      image/bg/resistance_logo.png
  44. BIN
      image/bg/save_bg.png
  45. BIN
      image/bg/scan_barcode.png
  46. BIN
      image/bg/tree_folder_icon.png
  47. BIN
      image/bg/tree_leaf_icon.png
  48. BIN
      image/bg/user.png
  49. BIN
      image/bg/vertical_line.png
  50. BIN
      image/bg/zoom_in.png
  51. BIN
      image/bg/zoom_out.png
  52. BIN
      image/close_bt.png
  53. 0 0
      image/cmd.txt
  54. BIN
      image/icon.ico
  55. BIN
      image/info_bt.png
  56. BIN
      image/min_bt.png
  57. BIN
      lib/commons-codec-1.15.jar
  58. BIN
      lib/core-3.5.1.jar
  59. BIN
      lib/fastjson2-2.0.16.jar
  60. BIN
      lib/gson-2.10.jar
  61. BIN
      lib/iot-communication-1.4.4.jar
  62. BIN
      lib/javase-3.5.1.jar
  63. BIN
      lib/jfreechart-1.5.4.jar
  64. BIN
      lib/jshortcut-0.4-oberzalek.jar
  65. BIN
      lib/kotlin-stdlib-1.8.10.jar
  66. BIN
      lib/logback-classic-1.2.13.jar
  67. BIN
      lib/logback-core-1.2.13.jar
  68. BIN
      lib/netty-all-4.1.48.Final.jar
  69. BIN
      lib/okhttp-4.10.0.jar
  70. BIN
      lib/okio-jvm-3.3.0.jar
  71. BIN
      lib/s7connector-2.1.jar
  72. BIN
      lib/slf4j-api-1.7.36.jar
  73. BIN
      lib/sqlite-jdbc-3.36.0.3.jar
  74. 3 0
      src/META-INF/MANIFEST.MF
  75. 13 0
      src/com/mes/component/CallFromJs.java
  76. 659 0
      src/com/mes/component/CncLifeDialog.java
  77. 201 0
      src/com/mes/component/FeedingAreaPanel.java
  78. 62 0
      src/com/mes/component/MesRadio.java
  79. 48 0
      src/com/mes/component/MesWebView.java
  80. 30 0
      src/com/mes/component/MyDialog.java
  81. 448 0
      src/com/mes/component/WorkJPanelDevice.java
  82. 31 0
      src/com/mes/entity/ToolParam.java
  83. 58 0
      src/com/mes/ui/BindMaterialResp.java
  84. 449 0
      src/com/mes/ui/CncStationRecordPanel.java
  85. 414 0
      src/com/mes/ui/DataUtil.java
  86. 200 0
      src/com/mes/ui/LoginFarme.java
  87. 548 0
      src/com/mes/ui/MesClient.java
  88. 56 0
      src/com/mes/ui/OprnoUtil.java
  89. 58 0
      src/com/mes/ui/ParamReq.java
  90. 48 0
      src/com/mes/ui/TableCellEditorButton.java
  91. 14 0
      src/com/mes/ui/TableCellRendererButton.java
  92. 61 0
      src/com/mes/ui/WorkRecordData.java
  93. 403 0
      src/com/mes/ui/WorkRecordPanel.java
  94. 63 0
      src/com/mes/ui/WorkRecordResp.java
  95. 19 0
      src/com/mes/util/Base64Utils.java
  96. 34 0
      src/com/mes/util/DateLocalUtils.java
  97. 45 0
      src/com/mes/util/ErrorMsg.java
  98. 164 0
      src/com/mes/util/HttpUtils.java
  99. 128 0
      src/com/mes/util/InovancePlcUtil.java
  100. 0 0
      src/com/mes/util/JdbcUtils.java

+ 24 - 0
.classpath

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+		<attributes>
+			<attribute name="module" value="true"/>
+		</attributes>
+	</classpathentry>
+    <classpathentry kind="src" path="image"/>
+	<classpathentry excluding="resources/" kind="src" path="src"/>
+	<classpathentry kind="src" path="src/resources"/>
+	<classpathentry kind="output" path="bin"/>
+	<classpathentry kind="lib" path="lib/s7connector-2.1.jar"/>
+	<classpathentry kind="lib" path="lib/slf4j-api-2.0.6.jar"/>
+	<classpathentry kind="lib" path="lib/okhttp-4.10.0.jar"/>
+	<classpathentry kind="lib" path="lib/kotlin-stdlib-1.8.10.jar"/>
+	<classpathentry kind="lib" path="lib/okio-jvm-3.3.0.jar"/>
+	<classpathentry kind="lib" path="lib/gson-2.10.jar"/>
+	<classpathentry kind="lib" path="lib/jfreechart-1.5.4.jar"/>
+	<classpathentry kind="lib" path="lib/jshortcut-0.4-oberzalek.jar"/>
+	<classpathentry kind="lib" path="lib/netty-all-4.1.48.Final.jar"/>
+	<classpathentry kind="lib" path="lib/sqlite-jdbc-3.36.0.3.jar"/>
+	<classpathentry kind="lib" path="lib/commons-codec-1.15.jar"/>
+	<classpathentry kind="lib" path="lib/fastjson2-2.0.16.jar"/>
+</classpath>

+ 7 - 0
.gitignore

@@ -0,0 +1,7 @@
+.idea
+.settings
+classes
+bin
+out
+*.db
+*.iml

+ 17 - 0
.project

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>mes-auto</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 2 - 0
image/.gitignore

@@ -0,0 +1,2 @@
+META-INF
+_system~.ini

BIN
image/background.png


BIN
image/bg/a_side.png


BIN
image/bg/b_side.png


BIN
image/bg/bar_add.png


BIN
image/bg/bar_bookmark.png


BIN
image/bg/bar_cmd_go.png


BIN
image/bg/bar_edit.png


BIN
image/bg/bar_pause.png


BIN
image/bg/bar_sampling.png


BIN
image/bg/bar_setting.png


BIN
image/bg/bar_stop.png


BIN
image/bg/close_bt.png


BIN
image/bg/company_setting_logo.png


BIN
image/bg/delete.png


BIN
image/bg/department_setting_logo.png


BIN
image/bg/download.png


BIN
image/bg/equipment_setting_logo.png


BIN
image/bg/gj_001_1_20.png


BIN
image/bg/gj_001_21_40.png


BIN
image/bg/gj_001_41_60.png


BIN
image/bg/green_dot.png


BIN
image/bg/grey_dot.png


BIN
image/bg/icon.png


BIN
image/bg/inductance_logo.png


BIN
image/bg/insulation_logo.png


BIN
image/bg/login.png


BIN
image/bg/logo.png


BIN
image/bg/logoff.png


BIN
image/bg/menu_data_analysis.png


BIN
image/bg/menu_data_preprocess.png


BIN
image/bg/menu_file.png


BIN
image/bg/menu_setting.png


BIN
image/bg/min_bt.png


BIN
image/bg/ng_bg.png


BIN
image/bg/ok_bg.png


BIN
image/bg/open_file.png


BIN
image/bg/refresh.png


BIN
image/bg/reset_logo.png


BIN
image/bg/resistance_logo.png


BIN
image/bg/save_bg.png


BIN
image/bg/scan_barcode.png


BIN
image/bg/tree_folder_icon.png


BIN
image/bg/tree_leaf_icon.png


BIN
image/bg/user.png


BIN
image/bg/vertical_line.png


BIN
image/bg/zoom_in.png


BIN
image/bg/zoom_out.png


BIN
image/close_bt.png


+ 0 - 0
image/cmd.txt


BIN
image/icon.ico


BIN
image/info_bt.png


BIN
image/min_bt.png


BIN
lib/commons-codec-1.15.jar


BIN
lib/core-3.5.1.jar


BIN
lib/fastjson2-2.0.16.jar


BIN
lib/gson-2.10.jar


BIN
lib/iot-communication-1.4.4.jar


BIN
lib/javase-3.5.1.jar


BIN
lib/jfreechart-1.5.4.jar


BIN
lib/jshortcut-0.4-oberzalek.jar


BIN
lib/kotlin-stdlib-1.8.10.jar


BIN
lib/logback-classic-1.2.13.jar


BIN
lib/logback-core-1.2.13.jar


BIN
lib/netty-all-4.1.48.Final.jar


BIN
lib/okhttp-4.10.0.jar


BIN
lib/okio-jvm-3.3.0.jar


BIN
lib/s7connector-2.1.jar


BIN
lib/slf4j-api-1.7.36.jar


BIN
lib/sqlite-jdbc-3.36.0.3.jar


+ 3 - 0
src/META-INF/MANIFEST.MF

@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Main-Class: com.mes.ui.MesClient
+

+ 13 - 0
src/com/mes/component/CallFromJs.java

@@ -0,0 +1,13 @@
+package com.mes.component;
+
+import com.mes.ui.MesClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CallFromJs {
+    public static final Logger log =  LoggerFactory.getLogger(CallFromJs.class);
+    public String callFromJs(String info){
+        log.info("ss:"+info);
+        return MesClient.sessionid+":java:" + info;
+    }
+}

+ 659 - 0
src/com/mes/component/CncLifeDialog.java

@@ -0,0 +1,659 @@
+package com.mes.component;
+
+import com.mes.entity.ToolParam;
+import com.mes.ui.MesClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CncLifeDialog extends JDialog {
+    public final Logger log =  LoggerFactory.getLogger(CncLifeDialog.class);
+
+    public CncLifeDialog(Frame owner, int[] toolNums,String[] toolTitle,String[] toolLife){
+        super(owner, "刀具寿命");
+
+        init(toolNums,toolTitle,toolLife);
+    }
+
+    public JLabel toolTitle1;
+    public JTextField toolNum1;
+    public JTextField toolLife1;
+    public JLabel toolTitle2;
+    public JTextField toolNum2;
+    public JTextField toolLife2;
+    public JLabel toolTitle3;
+    public JTextField toolNum3;
+    public JTextField toolLife3;
+    public JLabel toolTitle4;
+    public JTextField toolNum4;
+    public JTextField toolLife4;
+    public JLabel toolTitle5;
+    public JLabel toolTitle9;
+    public JLabel toolTitle13;
+    public JLabel toolTitle17;
+    public JTextField toolNum5;
+    public JTextField toolNum9;
+    public JTextField toolNum13;
+    public JTextField toolNum17;
+    public JTextField toolLife5;
+    public JTextField toolLife13;
+    public JTextField toolLife17;
+    public JLabel toolTitle6;
+    public JLabel toolTitle10;
+    public JLabel toolTitle14;
+    public JLabel toolTitle18;
+    public JTextField toolNum6;
+    public JTextField toolNum10;
+    public JTextField toolNum14;
+    public JTextField toolNum18;
+    public JTextField toolLife6;
+    public JTextField toolLife9;
+    public JTextField toolLife10;
+    public JTextField toolLife14;
+    public JTextField toolLife18;
+    public JLabel toolTitle7;
+    public JLabel toolTitle11;
+    public JLabel toolTitle15;
+    public JLabel toolTitle19;
+    public JTextField toolNum7;
+    public JTextField toolNum11;
+    public JTextField toolNum15;
+    public JTextField toolNum19;
+    public JTextField toolLife7;
+    public JTextField toolLife11;
+    public JTextField toolLife15;
+    public JTextField toolLife19;
+    public JLabel toolTitle8;
+    public JLabel toolTitle12;
+    public JLabel toolTitle16;
+    public JLabel toolTitle20;
+    public JTextField toolNum8;
+    public JTextField toolNum12;
+    public JTextField toolNum16;
+    public JTextField toolNum20;
+    public JTextField toolLife8;
+    public JTextField toolLife12;
+    public JTextField toolLife16;
+    public JTextField toolLife20;
+    public List<ToolParam> toolParams = new ArrayList<ToolParam>();
+
+    private void init(int[] toolNums,String[] toolTitle,String[] toolLife){
+        Container container = this.getContentPane();
+        container.setLayout(null);
+        this.setSize(1024,468);
+        this.setLocationRelativeTo(null);
+
+        toolTitle1 = new JLabel("");
+        toolTitle1.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle1.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle1.setBounds(50, 70, 100, 30);
+        container.add(toolTitle1);
+
+        toolNum1 = new JTextField();
+        toolNum1.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum1.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum1.setText("1");
+        toolNum1.setEnabled(false);
+        toolNum1.setBounds(154, 70, 30, 30);
+        container.add(toolNum1);
+        toolNum1.setColumns(10);
+
+        toolLife1 = new JTextField();
+        toolLife1.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife1.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife1.setEnabled(false);
+        toolLife1.setColumns(10);
+        toolLife1.setBounds(187, 70, 60, 30);
+        container.add(toolLife1);
+
+        toolTitle2 = new JLabel("");
+        toolTitle2.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle2.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle2.setBounds(258, 70, 100, 30);
+        container.add(toolTitle2);
+
+        toolNum2 = new JTextField();
+        toolNum2.setText("2");
+        toolNum2.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum2.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum2.setEnabled(false);
+        toolNum2.setColumns(10);
+        toolNum2.setBounds(359, 70, 30, 30);
+        container.add(toolNum2);
+
+        toolLife2 = new JTextField();
+        toolLife2.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife2.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife2.setEnabled(false);
+        toolLife2.setColumns(10);
+        toolLife2.setBounds(393, 70, 60, 30);
+        container.add(toolLife2);
+
+        toolTitle3 = new JLabel("");
+        toolTitle3.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle3.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle3.setBounds(472, 70, 100, 30);
+        container.add(toolTitle3);
+
+        toolNum3 = new JTextField();
+        toolNum3.setText("3");
+        toolNum3.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum3.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum3.setEnabled(false);
+        toolNum3.setColumns(10);
+        toolNum3.setBounds(572, 70, 30, 30);
+        container.add(toolNum3);
+
+        toolLife3 = new JTextField();
+        toolLife3.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife3.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife3.setEnabled(false);
+        toolLife3.setColumns(10);
+        toolLife3.setBounds(606, 70, 60, 30);
+        container.add(toolLife3);
+
+        toolTitle4 = new JLabel("");
+        toolTitle4.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle4.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle4.setBounds(676, 70, 100, 30);
+        container.add(toolTitle4);
+
+        toolNum4 = new JTextField();
+        toolNum4.setText("4");
+        toolNum4.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum4.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum4.setEnabled(false);
+        toolNum4.setColumns(10);
+        toolNum4.setBounds(776, 70, 30, 30);
+        container.add(toolNum4);
+
+        toolLife4 = new JTextField();
+        toolLife4.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife4.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife4.setEnabled(false);
+        toolLife4.setColumns(10);
+        toolLife4.setBounds(810, 70, 60, 30);
+        container.add(toolLife4);
+
+        toolTitle5 = new JLabel("");
+        toolTitle5.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle5.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle5.setBounds(50, 110, 100, 30);
+        container.add(toolTitle5);
+
+        toolTitle9 = new JLabel("");
+        toolTitle9.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle9.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle9.setBounds(50, 150, 100, 30);
+        container.add(toolTitle9);
+
+        toolTitle13 = new JLabel("");
+        toolTitle13.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle13.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle13.setBounds(50, 190, 100, 30);
+        container.add(toolTitle13);
+
+        toolTitle17 = new JLabel("");
+        toolTitle17.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle17.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle17.setBounds(50, 230, 100, 30);
+        container.add(toolTitle17);
+
+        toolNum5 = new JTextField();
+        toolNum5.setText("5");
+        toolNum5.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum5.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum5.setEnabled(false);
+        toolNum5.setColumns(10);
+        toolNum5.setBounds(154, 110, 30, 30);
+        container.add(toolNum5);
+
+        toolNum9 = new JTextField();
+        toolNum9.setText("9");
+        toolNum9.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum9.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum9.setEnabled(false);
+        toolNum9.setColumns(10);
+        toolNum9.setBounds(154, 150, 30, 30);
+        container.add(toolNum9);
+
+        toolNum13 = new JTextField();
+        toolNum13.setText("13");
+        toolNum13.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum13.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum13.setEnabled(false);
+        toolNum13.setColumns(10);
+        toolNum13.setBounds(154, 190, 30, 30);
+        container.add(toolNum13);
+
+        toolNum17 = new JTextField();
+        toolNum17.setText("17");
+        toolNum17.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum17.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum17.setEnabled(false);
+        toolNum17.setColumns(10);
+        toolNum17.setBounds(154, 230, 30, 30);
+        container.add(toolNum17);
+
+        toolLife5 = new JTextField();
+        toolLife5.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife5.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife5.setEnabled(false);
+        toolLife5.setColumns(10);
+        toolLife5.setBounds(186, 110, 60, 30);
+        container.add(toolLife5);
+
+        toolLife9 = new JTextField();
+        toolLife9.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife9.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife9.setEnabled(false);
+        toolLife9.setColumns(10);
+        toolLife9.setBounds(187, 150, 60, 30);
+        container.add(toolLife9);
+
+        toolLife13 = new JTextField();
+        toolLife13.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife13.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife13.setEnabled(false);
+        toolLife13.setColumns(10);
+        toolLife13.setBounds(187, 190, 60, 30);
+        container.add(toolLife13);
+
+        toolLife17 = new JTextField();
+        toolLife17.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife17.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife17.setEnabled(false);
+        toolLife17.setColumns(10);
+        toolLife17.setBounds(187, 230, 60, 30);
+        container.add(toolLife17);
+
+        toolTitle6 = new JLabel("");
+        toolTitle6.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle6.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle6.setBounds(258, 110, 100, 30);
+        container.add(toolTitle6);
+
+        toolTitle10 = new JLabel("");
+        toolTitle10.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle10.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle10.setBounds(258, 150, 100, 30);
+        container.add(toolTitle10);
+
+        toolTitle14 = new JLabel("");
+        toolTitle14.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle14.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle14.setBounds(258, 190, 100, 30);
+        container.add(toolTitle14);
+
+        toolTitle18 = new JLabel("");
+        toolTitle18.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle18.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle18.setBounds(258, 230, 100, 30);
+        container.add(toolTitle18);
+
+        toolNum6 = new JTextField();
+        toolNum6.setText("6");
+        toolNum6.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum6.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum6.setEnabled(false);
+        toolNum6.setColumns(10);
+        toolNum6.setBounds(359, 110, 30, 30);
+        container.add(toolNum6);
+
+        toolNum10 = new JTextField();
+        toolNum10.setText("10");
+        toolNum10.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum10.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum10.setEnabled(false);
+        toolNum10.setColumns(10);
+        toolNum10.setBounds(359, 150, 30, 30);
+        container.add(toolNum10);
+
+        toolNum14 = new JTextField();
+        toolNum14.setText("14");
+        toolNum14.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum14.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum14.setEnabled(false);
+        toolNum14.setColumns(10);
+        toolNum14.setBounds(359, 190, 30, 30);
+        container.add(toolNum14);
+
+        toolNum18 = new JTextField();
+        toolNum18.setText("18");
+        toolNum18.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum18.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum18.setEnabled(false);
+        toolNum18.setColumns(10);
+        toolNum18.setBounds(359, 230, 30, 30);
+        container.add(toolNum18);
+
+        toolLife6 = new JTextField();
+        toolLife6.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife6.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife6.setEnabled(false);
+        toolLife6.setColumns(10);
+        toolLife6.setBounds(393, 110, 60, 30);
+        container.add(toolLife6);
+
+        toolLife10 = new JTextField();
+        toolLife10.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife10.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife10.setEnabled(false);
+        toolLife10.setColumns(10);
+        toolLife10.setBounds(393, 150, 60, 30);
+        container.add(toolLife10);
+
+        toolLife14 = new JTextField();
+        toolLife14.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife14.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife14.setEnabled(false);
+        toolLife14.setColumns(10);
+        toolLife14.setBounds(393, 190, 60, 30);
+        container.add(toolLife14);
+
+        toolLife18 = new JTextField();
+        toolLife18.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife18.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife18.setEnabled(false);
+        toolLife18.setColumns(10);
+        toolLife18.setBounds(393, 230, 60, 30);
+        container.add(toolLife18);
+
+        toolTitle7 = new JLabel("");
+        toolTitle7.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle7.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle7.setBounds(472, 110, 100, 30);
+        container.add(toolTitle7);
+
+        toolTitle11 = new JLabel("");
+        toolTitle11.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle11.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle11.setBounds(472, 150, 100, 30);
+        container.add(toolTitle11);
+
+        toolTitle15 = new JLabel("");
+        toolTitle15.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle15.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle15.setBounds(472, 190, 100, 30);
+        container.add(toolTitle15);
+
+        toolTitle19 = new JLabel("");
+        toolTitle19.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle19.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle19.setBounds(472, 230, 100, 30);
+        container.add(toolTitle19);
+
+        toolNum7 = new JTextField();
+        toolNum7.setText("7");
+        toolNum7.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum7.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum7.setEnabled(false);
+        toolNum7.setColumns(10);
+        toolNum7.setBounds(572, 110, 30, 30);
+        container.add(toolNum7);
+
+        toolNum11 = new JTextField();
+        toolNum11.setText("11");
+        toolNum11.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum11.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum11.setEnabled(false);
+        toolNum11.setColumns(10);
+        toolNum11.setBounds(572, 150, 30, 30);
+        container.add(toolNum11);
+
+        toolNum15 = new JTextField();
+        toolNum15.setText("15");
+        toolNum15.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum15.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum15.setEnabled(false);
+        toolNum15.setColumns(10);
+        toolNum15.setBounds(572, 190, 30, 30);
+        container.add(toolNum15);
+
+        toolNum19 = new JTextField();
+        toolNum19.setText("19");
+        toolNum19.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum19.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum19.setEnabled(false);
+        toolNum19.setColumns(10);
+        toolNum19.setBounds(572, 230, 30, 30);
+        container.add(toolNum19);
+
+        toolLife7 = new JTextField();
+        toolLife7.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife7.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife7.setEnabled(false);
+        toolLife7.setColumns(10);
+        toolLife7.setBounds(606, 110, 60, 30);
+        container.add(toolLife7);
+
+        toolLife11 = new JTextField();
+        toolLife11.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife11.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife11.setEnabled(false);
+        toolLife11.setColumns(10);
+        toolLife11.setBounds(606, 150, 60, 30);
+        container.add(toolLife11);
+
+        toolLife15 = new JTextField();
+        toolLife15.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife15.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife15.setEnabled(false);
+        toolLife15.setColumns(10);
+        toolLife15.setBounds(606, 190, 60, 30);
+        container.add(toolLife15);
+
+        toolLife19 = new JTextField();
+        toolLife19.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife19.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife19.setEnabled(false);
+        toolLife19.setColumns(10);
+        toolLife19.setBounds(606, 230, 60, 30);
+        container.add(toolLife19);
+
+        toolTitle8 = new JLabel("");
+        toolTitle8.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle8.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle8.setBounds(676, 110, 100, 30);
+        container.add(toolTitle8);
+
+        toolTitle12 = new JLabel("");
+        toolTitle12.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle12.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle12.setBounds(676, 150, 100, 30);
+        container.add(toolTitle12);
+
+        toolTitle16 = new JLabel("");
+        toolTitle16.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle16.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle16.setBounds(676, 190, 100, 30);
+        container.add(toolTitle16);
+
+        toolTitle20 = new JLabel("");
+        toolTitle20.setHorizontalAlignment(SwingConstants.RIGHT);
+        toolTitle20.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolTitle20.setBounds(676, 230, 100, 30);
+        container.add(toolTitle20);
+
+        toolNum8 = new JTextField();
+        toolNum8.setText("8");
+        toolNum8.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum8.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum8.setEnabled(false);
+        toolNum8.setColumns(10);
+        toolNum8.setBounds(776, 110, 30, 30);
+        container.add(toolNum8);
+
+        toolNum12 = new JTextField();
+        toolNum12.setText("12");
+        toolNum12.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum12.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum12.setEnabled(false);
+        toolNum12.setColumns(10);
+        toolNum12.setBounds(776, 150, 30, 30);
+        container.add(toolNum12);
+
+        toolNum16 = new JTextField();
+        toolNum16.setText("16");
+        toolNum16.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum16.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum16.setEnabled(false);
+        toolNum16.setColumns(10);
+        toolNum16.setBounds(776, 190, 30, 30);
+        container.add(toolNum16);
+
+        toolNum20 = new JTextField();
+        toolNum20.setText("20");
+        toolNum20.setHorizontalAlignment(SwingConstants.CENTER);
+        toolNum20.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolNum20.setEnabled(false);
+        toolNum20.setColumns(10);
+        toolNum20.setBounds(776, 230, 30, 30);
+        container.add(toolNum20);
+
+        toolLife8 = new JTextField();
+        toolLife8.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife8.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife8.setEnabled(false);
+        toolLife8.setColumns(10);
+        toolLife8.setBounds(810, 110, 60, 30);
+        container.add(toolLife8);
+
+        toolLife12 = new JTextField();
+        toolLife12.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife12.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife12.setEnabled(false);
+        toolLife12.setColumns(10);
+        toolLife12.setBounds(810, 150, 60, 30);
+        container.add(toolLife12);
+
+        toolLife16 = new JTextField();
+        toolLife16.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife16.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife16.setEnabled(false);
+        toolLife16.setColumns(10);
+        toolLife16.setBounds(810, 190, 60, 30);
+        container.add(toolLife16);
+
+        toolLife20 = new JTextField();
+        toolLife20.setHorizontalAlignment(SwingConstants.CENTER);
+        toolLife20.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        toolLife20.setEnabled(false);
+        toolLife20.setColumns(10);
+        toolLife20.setBounds(810, 230, 60, 30);
+        container.add(toolLife20);
+
+        setToolParamsVal(toolNums,toolTitle,toolLife);
+        
+        this.setModal(true);
+        this.setVisible(true);
+
+    }
+
+    public void setToolParamsVal(int[] toolNums,String[] toolTitle,String[] toolLife) {
+        for (int i = 1; i < 21; i++) {
+            int j = 0;
+            for(Integer toolNum : toolNums){
+                if(toolNum == i){
+                    ToolParam toolParam = new ToolParam();
+                    toolParam.setNums(toolNum);
+                    toolParam.setTitle(toolTitle[j]);
+                    toolParam.setLife(toolLife[j]);
+                    toolParams.add(toolParam);
+                    break;
+                }
+                j++;
+            }
+        }
+
+        for (ToolParam toolParam : toolParams) {
+            switch (toolParam.getNums()) {
+                case 1:
+                    toolTitle1.setText(toolParam.getTitle());
+                    toolLife1.setText(toolParam.getLife());
+                    break;
+                case 2:
+                    toolTitle2.setText(toolParam.getTitle());
+                    toolLife2.setText(toolParam.getLife());
+                    break;
+                case 3:
+                    toolTitle3.setText(toolParam.getTitle());
+                    toolLife3.setText(toolParam.getLife());
+                    break;
+                case 4:
+                    toolTitle4.setText(toolParam.getTitle());
+                    toolLife4.setText(toolParam.getLife());
+                    break;
+                case 5:
+                    toolTitle5.setText(toolParam.getTitle());
+                    toolLife5.setText(toolParam.getLife());
+                    break;
+                case 6:
+                    toolTitle6.setText(toolParam.getTitle());
+                    toolLife6.setText(toolParam.getLife());
+                    break;
+                case 7:
+                    toolTitle7.setText(toolParam.getTitle());
+                    toolLife7.setText(toolParam.getLife());
+                    break;
+                case 8:
+                    toolTitle8.setText(toolParam.getTitle());
+                    toolLife8.setText(toolParam.getLife());
+                    break;
+                case 9:
+                    toolTitle9.setText(toolParam.getTitle());
+                    toolLife9.setText(toolParam.getLife());
+                    break;
+                case 10:
+                    toolTitle10.setText(toolParam.getTitle());
+                    toolLife10.setText(toolParam.getLife());
+                    break;
+                case 11:
+                    toolTitle11.setText(toolParam.getTitle());
+                    toolLife11.setText(toolParam.getLife());
+                    break;
+                case 12:
+                    toolTitle12.setText(toolParam.getTitle());
+                    toolLife12.setText(toolParam.getLife());
+                    break;
+                case 13:
+                    toolTitle13.setText(toolParam.getTitle());
+                    toolLife13.setText(toolParam.getLife());
+                    break;
+                case 14:
+                    toolTitle14.setText(toolParam.getTitle());
+                    toolLife14.setText(toolParam.getLife());
+                    break;
+                case 15:
+                    toolTitle15.setText(toolParam.getTitle());
+                    toolLife15.setText(toolParam.getLife());
+                    break;
+                case 16:
+                    toolTitle16.setText(toolParam.getTitle());
+                    toolLife16.setText(toolParam.getLife());
+                    break;
+                case 17:
+                    toolTitle17.setText(toolParam.getTitle());
+                    toolLife17.setText(toolParam.getLife());
+                    break;
+                case 18:
+                    toolTitle18.setText(toolParam.getTitle());
+                    toolLife18.setText(toolParam.getLife());
+                    break;
+                case 19:
+                    toolTitle19.setText(toolParam.getTitle());
+                    toolLife19.setText(toolParam.getLife());
+                    break;
+                case 20:
+                    toolTitle20.setText(toolParam.getTitle());
+                    toolLife20.setText(toolParam.getLife());
+                    break;
+            }
+        }
+        this.repaint();
+    }
+}

+ 201 - 0
src/com/mes/component/FeedingAreaPanel.java

@@ -0,0 +1,201 @@
+package com.mes.component;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp;
+import com.mes.ui.DataUtil;
+import com.mes.ui.MesClient;
+import com.mes.util.InovancePlcUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import java.awt.*;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 上料区:M5060 机器人请求上料,D5000 上料区二维码,M5061/M5062 MES 反馈。
+ */
+public class FeedingAreaPanel extends JPanel {
+
+    private static final int M_REQUEST_FEEDING = 5060;
+    private static final int M_ALLOW_FEEDING = 5061;
+    private static final int M_DISALLOW_FEEDING = 5062;
+    private static final int D_FEEDING_QR = 5000;
+
+    private final Logger log = LoggerFactory.getLogger(FeedingAreaPanel.class);
+
+    private final ModbusTcp modbusPlc;
+    private final String feedingOprno;
+    private final int isLocal;
+
+    private final JLabel requestLabel;
+    private final JLabel allowLabel;
+    private final JLabel disallowLabel;
+    private final JTextField qrField;
+    private final JButton statusBtn;
+
+    private final ImageIcon imageGreen;
+    private final ImageIcon imageGray;
+
+    private final Map<Integer, Boolean> lastCoilValues = new HashMap<>();
+    private int processFlag = 0;
+    private java.util.Timer pollTimer;
+
+    public FeedingAreaPanel(ModbusTcp modbusPlc, String feedingOprno, int isLocal) {
+        this.modbusPlc = modbusPlc;
+        this.feedingOprno = feedingOprno;
+        this.isLocal = isLocal;
+
+        setLayout(null);
+        setBackground(new Color(240, 248, 255));
+        setPreferredSize(new Dimension(1260, 90));
+        setBorder(BorderFactory.createTitledBorder("上料区"));
+
+        imageGreen = scaleIcon("/bg/green_dot.png");
+        imageGray = scaleIcon("/bg/grey_dot.png");
+
+        JLabel titleLabel = new JLabel("上料区");
+        titleLabel.setFont(new Font("微软雅黑", Font.BOLD, 18));
+        titleLabel.setBounds(10, 10, 80, 30);
+        add(titleLabel);
+
+        requestLabel = createSignalLabel("请求上料", 100, 15);
+        allowLabel = createSignalLabel("MES允许上料", 280, 15);
+        disallowLabel = createSignalLabel("MES不允许上料", 480, 15);
+
+        qrField = new JTextField();
+        qrField.setEditable(false);
+        qrField.setHorizontalAlignment(SwingConstants.CENTER);
+        qrField.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        qrField.setBounds(680, 15, 320, 30);
+        add(qrField);
+
+        statusBtn = new JButton("等待机器人请求上料");
+        statusBtn.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        statusBtn.setBounds(1010, 10, 230, 35);
+        add(statusBtn);
+
+        startTimer();
+    }
+
+    private void startTimer() {
+        if (pollTimer != null) {
+            pollTimer.cancel();
+        }
+        pollTimer = new java.util.Timer("feeding-area", false);
+        pollTimer.schedule(new java.util.TimerTask() {
+            @Override
+            public void run() {
+                if (MesClient.isLogin != 1) {
+                    return;
+                }
+                try {
+                    pollFeedingArea();
+                } catch (Exception e) {
+                    log.error(e.getMessage(), e);
+                }
+            }
+        }, 500, 1000);
+    }
+
+    private ImageIcon scaleIcon(String path) {
+        ImageIcon icon = new ImageIcon(MesClient.class.getResource(path));
+        icon.setImage(icon.getImage().getScaledInstance(20, 20, Image.SCALE_SMOOTH));
+        return icon;
+    }
+
+    private JLabel createSignalLabel(String text, int x, int y) {
+        JLabel label = new JLabel(text);
+        label.setHorizontalAlignment(SwingConstants.LEFT);
+        label.setIcon(imageGray);
+        label.setBounds(x, y, 170, 30);
+        add(label);
+        return label;
+    }
+
+    private void pollFeedingArea() {
+        if (isLocal == 1) {
+            return;
+        }
+        java.util.List<Boolean> coils = InovancePlcUtil.readCoils(modbusPlc, M_REQUEST_FEEDING, 3);
+        boolean request = coilValue(coils, 0);
+        boolean allow = coilValue(coils, 1);
+        boolean disallow = coilValue(coils, 2);
+
+        requestLabel.setIcon(request ? imageGreen : imageGray);
+        allowLabel.setIcon(allow ? imageGreen : imageGray);
+        disallowLabel.setIcon(disallow ? imageGreen : imageGray);
+
+        if (processFlag == 0 && request) {
+            handleFeedingRequest();
+        } else if (processFlag == 1 && !request) {
+            resetFeedingResponse();
+        }
+    }
+
+    private void handleFeedingRequest() {
+        String sn = isLocal == 1 ? "" : InovancePlcUtil.readString(modbusPlc, D_FEEDING_QR);
+        qrField.setText(sn);
+        if (sn.isEmpty()) {
+            setStatus("上料区二维码为空", true);
+            writeCoil(M_ALLOW_FEEDING, false);
+            writeCoil(M_DISALLOW_FEEDING, true);
+            processFlag = 1;
+            return;
+        }
+
+        JSONObject retObj = DataUtil.checkQuality(sn, feedingOprno, MesClient.user_menu.getText());
+        if (retObj != null && retObj.get("result") != null
+                && retObj.get("result").toString().equalsIgnoreCase("true")) {
+            writeCoil(M_ALLOW_FEEDING, true);
+            writeCoil(M_DISALLOW_FEEDING, false);
+            setStatus("允许上料:" + sn, false);
+        } else {
+            writeCoil(M_ALLOW_FEEDING, false);
+            writeCoil(M_DISALLOW_FEEDING, true);
+            String msg = retObj != null && retObj.get("message") != null
+                    ? retObj.getString("message") : "质量校验失败";
+            setStatus(msg, true);
+        }
+        processFlag = 1;
+    }
+
+    private void resetFeedingResponse() {
+        writeCoil(M_ALLOW_FEEDING, false);
+        writeCoil(M_DISALLOW_FEEDING, false);
+        qrField.setText("");
+        processFlag = 0;
+        setStatus("等待机器人请求上料", false);
+    }
+
+    private boolean coilValue(java.util.List<Boolean> coils, int index) {
+        return coils != null && index < coils.size() && coils.get(index);
+    }
+
+    private boolean readCoil(int address) {
+        if (isLocal == 1) {
+            return false;
+        }
+        boolean value = InovancePlcUtil.readCoil(modbusPlc, address);
+        Boolean last = lastCoilValues.get(address);
+        if (last == null || last != value) {
+            log.info("上料区 M{} 变化:{} -> {}", address, last, value);
+            lastCoilValues.put(address, value);
+        }
+        return value;
+    }
+
+    private void writeCoil(int address, boolean value) {
+        if (isLocal == 1) {
+            return;
+        }
+        InovancePlcUtil.writeCoil(modbusPlc, address, value);
+        lastCoilValues.put(address, value);
+    }
+
+    private void setStatus(String msg, boolean error) {
+        statusBtn.setForeground(error ? Color.RED : Color.GREEN);
+        statusBtn.setText(msg);
+    }
+}

+ 62 - 0
src/com/mes/component/MesRadio.java

@@ -0,0 +1,62 @@
+package com.mes.component;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class MesRadio extends JPanel {
+
+    public static final Logger log =  LoggerFactory.getLogger(MesRadio.class);
+
+    private String result = "";
+    private Integer i = 0;
+
+    public MesRadio(String[] radioTitles,String[] radioVals){
+        this.setLayout(new FlowLayout());
+        ButtonGroup group = new ButtonGroup();
+        i = 0;
+        for (String title:radioTitles){
+            JRadioButton radioButton = new JRadioButton(title);
+            radioButton.setFont(new Font("微软雅黑", Font.PLAIN, 28));
+
+            String val = radioVals[i];
+            radioButton.setName(val);
+
+            this.add(radioButton);
+            group.add(radioButton);
+
+            radioButton.addActionListener(new ActionListener() {
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    result = val;
+                    log.info("选择:"+result);
+                }
+            });
+            i++;
+        }
+    }
+
+    public void setResult(String ret){
+        this.result = "";
+        Component[] components = this.getComponents();
+        for (Component jRadioButton:components){
+            if(jRadioButton instanceof JRadioButton){
+                JRadioButton jRadioButtonParam = (JRadioButton)jRadioButton;
+                if(ret.equals(jRadioButtonParam.getName())){
+                    jRadioButtonParam.setSelected(true);
+                    this.result = jRadioButtonParam.getName();
+                }else{
+                    jRadioButtonParam.setSelected(false);
+                }
+            }
+        }
+    }
+
+    public String getResult(){
+        return this.result;
+    }
+}

+ 48 - 0
src/com/mes/component/MesWebView.java

@@ -0,0 +1,48 @@
+package com.mes.component;
+
+import javafx.application.Platform;
+import javafx.beans.value.ObservableValue;
+import javafx.concurrent.Worker;
+import javafx.embed.swing.JFXPanel;
+import javafx.scene.Scene;
+import javafx.scene.web.WebEngine;
+import javafx.scene.web.WebView;
+import netscape.javascript.JSObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+
+public class MesWebView extends JFXPanel {
+
+    public static final Logger log =  LoggerFactory.getLogger(MesWebView.class);
+
+    public static WebEngine engine = null;
+
+    public MesWebView(String url){
+
+        Platform.runLater(() -> {
+            WebView webView = new WebView();
+            setScene(new Scene(webView));
+            Date date = new Date();
+//            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesQuality/check?__sid="+sessionid+"&oprno="+mes_gw+"&t="+date.getTime();
+            log.info(url);
+            engine = webView.getEngine();
+            CallFromJs bridge = new CallFromJs();
+            engine.getLoadWorker().stateProperty().addListener(
+                    (ObservableValue<? extends Worker.State> ov, Worker.State oldState, Worker.State newState) -> {
+                        if (newState == Worker.State.SUCCEEDED) {
+                            JSObject window = (JSObject) engine.executeScript("window");
+                            window.setMember("apps", bridge);
+                            window.setMember("sout", System.out);
+                        }
+                    }
+            );
+            engine.load(url);
+        });
+    }
+
+    public void reloadWeb(){
+        engine.reload();
+    }
+}

+ 30 - 0
src/com/mes/component/MyDialog.java

@@ -0,0 +1,30 @@
+package com.mes.component;
+
+import javax.swing.*;
+import java.awt.*;
+
+public class MyDialog extends JDialog {
+
+    public MyDialog(Frame owner, String title, String msg){
+        super(owner, title);
+        init(msg);
+    }
+
+    private void init(String msg){
+        Container container = this.getContentPane();
+        container.setLayout(null);
+        container.setBackground(Color.BLACK);
+        this.setSize(800,220);
+        this.setLocationRelativeTo(null);
+
+        JLabel tslabel = new JLabel(msg);
+        tslabel.setHorizontalAlignment(SwingConstants.CENTER);
+        tslabel.setForeground(Color.RED);
+        tslabel.setFont(new Font("微软雅黑", Font.PLAIN,48));
+        tslabel.setBounds(0,30,800,100);
+
+        container.add(tslabel);
+        this.setModal(true);
+        this.setVisible(true);
+    }
+}

+ 448 - 0
src/com/mes/component/WorkJPanelDevice.java

@@ -0,0 +1,448 @@
+package com.mes.component;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp;
+import com.mes.ui.DataUtil;
+import com.mes.ui.MesClient;
+import com.mes.ui.OprnoUtil;
+import com.mes.util.InovancePlcUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.*;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+
+/**
+ * 单台 CNC 工位面板(汇川 PLC Modbus)。
+ * 每台设备占用 5 个 M 点位(上料完成/读取完成/工作中/请求下料/允许下料)和 1 个 D 区二维码。
+ */
+public class WorkJPanelDevice extends JPanel {
+
+    public final Logger log = LoggerFactory.getLogger(WorkJPanelDevice.class);
+
+    public String oprno = "";
+    public String pos = "";
+    public String sideLabel = "";
+
+    public int mBaseAddress = 5000;
+    public int dRegAddress = 5100;
+
+    public String lastSn = "";
+
+    public JLabel feedinglabel;
+    public JLabel readCompletelabel;
+    public JLabel runlabel;
+    public JLabel blankinglabel;
+    public JLabel blankingmeslabel;
+
+    public JTextField productSnFeeding;
+    public JButton status_menu;
+    public JButton resetFeedingBtn;
+    public JButton checkBtn;
+    public JButton historyBtn;
+
+    public ImageIcon imageGreen;
+    public ImageIcon imageGray;
+
+    public Integer workWidth = 410;
+    public Integer workHeight = 250;
+
+    public Integer tjFeedingFlag = 0;
+    public Integer tjStatus = 0;
+
+    public Integer isLocal = 0;
+
+    public JLabel oprnoLabel2;
+    public JLabel oprnoLabel;
+
+    private final Map<Integer, Boolean> lastCoilValues = new HashMap<>();
+    private final Map<Integer, Boolean> lastWriteCoilValues = new HashMap<>();
+
+    public Timer oprnoTimer;
+
+    public WorkJPanelDevice(String oprno, String pos, int mBase, int dAddr, String sideLabel) {
+        this.oprno = oprno;
+        this.pos = pos;
+        this.mBaseAddress = mBase;
+        this.dRegAddress = dAddr;
+        this.sideLabel = sideLabel;
+        this.isLocal = MesClient.isLocal;
+
+        this.setLayout(null);
+        this.setBackground(new Color(245, 247, 250));
+
+        String deviceName = sideLabel + " " + OprnoUtil.getGwDes(MesClient.mes_line_sn, oprno);
+
+        oprnoLabel = new JLabel(oprno + pos);
+        oprnoLabel.setHorizontalAlignment(SwingConstants.CENTER);
+        oprnoLabel.setForeground(Color.BLACK);
+        oprnoLabel.setFont(new Font("微软雅黑", Font.BOLD, 18));
+        oprnoLabel.setBounds(0, 0, workWidth / 4, 35);
+        this.add(oprnoLabel);
+
+        oprnoLabel2 = new JLabel(deviceName);
+        oprnoLabel2.setHorizontalAlignment(SwingConstants.CENTER);
+        oprnoLabel2.setForeground(Color.DARK_GRAY);
+        oprnoLabel2.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        oprnoLabel2.setBounds(workWidth / 4, 0, workWidth * 3 / 4, 35);
+        this.add(oprnoLabel2);
+
+        status_menu = new JButton("等待上料完成");
+        status_menu.setBounds(0, 35, workWidth, 34);
+        status_menu.setFont(new Font("微软雅黑", Font.BOLD, 14));
+        styleStatusButton(status_menu, Color.BLACK);
+        this.add(status_menu);
+
+        JLabel snLabel = new JLabel("工件码");
+        snLabel.setHorizontalAlignment(SwingConstants.CENTER);
+        snLabel.setFont(new Font("微软雅黑", Font.PLAIN, 16));
+        snLabel.setBounds(0, 75, workWidth / 5, 35);
+        this.add(snLabel);
+
+        productSnFeeding = new JTextField("");
+        productSnFeeding.setHorizontalAlignment(SwingConstants.CENTER);
+        productSnFeeding.setFont(new Font("微软雅黑", Font.PLAIN, 14));
+        productSnFeeding.setEditable(false);
+        productSnFeeding.setBackground(new Color(248, 250, 252));
+        productSnFeeding.setBorder(BorderFactory.createCompoundBorder(
+                BorderFactory.createLineBorder(new Color(190, 200, 210)),
+                BorderFactory.createEmptyBorder(2, 4, 2, 4)));
+        productSnFeeding.setBounds(workWidth / 5, 75, workWidth * 3 / 5, 35);
+        productSnFeeding.addMouseListener(new MouseAdapter() {
+            public void mouseClicked(MouseEvent e) {
+                String sn = productSnFeeding.getText().trim();
+                if (!sn.isEmpty()) {
+                    MesClient.createQRCode(sn, oprno + pos);
+                }
+            }
+        });
+        this.add(productSnFeeding);
+
+        resetFeedingBtn = new JButton("刷新");
+        resetFeedingBtn.addActionListener(e -> {
+            int choice = JOptionPane.showConfirmDialog(null, "确定刷新当前工件吗?",
+                    "操作确认", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+            if (choice == JOptionPane.YES_OPTION) {
+                resetScanA();
+            }
+        });
+        resetFeedingBtn.setFont(new Font("微软雅黑", Font.PLAIN, 16));
+        resetFeedingBtn.setBounds(workWidth * 4 / 5 + 5, 75, workWidth / 5 - 10, 35);
+        this.add(resetFeedingBtn);
+
+        checkBtn = new JButton("开班点检");
+        checkBtn.addActionListener(e -> showCheckDialog());
+        checkBtn.setFont(new Font("微软雅黑", Font.PLAIN, 16));
+        checkBtn.setBounds(0, 210, workWidth / 3, 32);
+        this.add(checkBtn);
+
+        historyBtn = new JButton("工作记录");
+        historyBtn.addActionListener(e -> showRecordDialog());
+        historyBtn.setFont(new Font("微软雅黑", Font.PLAIN, 16));
+        historyBtn.setBounds(workWidth * 2 / 3, 210, workWidth / 3, 32);
+        this.add(historyBtn);
+
+        imageGreen = new ImageIcon(MesClient.class.getResource("/bg/green_dot.png"));
+        imageGreen.setImage(imageGreen.getImage().getScaledInstance(18, 18, Image.SCALE_SMOOTH));
+        imageGray = new ImageIcon(MesClient.class.getResource("/bg/grey_dot.png"));
+        imageGray.setImage(imageGray.getImage().getScaledInstance(18, 18, Image.SCALE_SMOOTH));
+
+        feedinglabel = createSignalLabel("上料完成", 0, 120);
+        readCompletelabel = createSignalLabel("MES读取完成", workWidth / 2, 120);
+        readCompletelabel.addMouseListener(new MouseAdapter() {
+            public void mouseClicked(MouseEvent e) {
+                boolean current = readReadComplete();
+                int choice = JOptionPane.showConfirmDialog(null,
+                        "确定修改MES读取完成信号为 " + !current + " 吗?",
+                        "操作确认", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+                if (choice == JOptionPane.YES_OPTION) {
+                    writeReadComplete(!current);
+                }
+            }
+        });
+
+        runlabel = createSignalLabel("工作中", 0, 155);
+        blankinglabel = createSignalLabel("请求下料", workWidth / 2, 155);
+
+        blankingmeslabel = createSignalLabel("MES允许下料", 0, 185);
+        blankingmeslabel.addMouseListener(new MouseAdapter() {
+            public void mouseClicked(MouseEvent e) {
+                boolean current = readAllowBlanking();
+                int choice = JOptionPane.showConfirmDialog(null,
+                        "确定修改MES允许下料信号为 " + !current + " 吗?",
+                        "操作确认", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+                if (choice == JOptionPane.YES_OPTION) {
+                    writeAllowBlanking(!current);
+                }
+            }
+        });
+
+        startOprnoTimer();
+        resetScanA();
+    }
+
+    public void startOprnoTimer() {
+        if (oprnoTimer != null) {
+            oprnoTimer.cancel();
+        }
+        int staggerMs = (mBaseAddress - 5000) / 10 * 150 + 100;
+        oprnoTimer = new Timer("device-" + oprno + pos, false);
+        oprnoTimer.schedule(new TimerTask() {
+            public void run() {
+                try {
+                    if (MesClient.isLogin != 1) {
+                        return;
+                    }
+                    pollDeviceSignals();
+                } catch (Exception e) {
+                    log.error(e.getMessage(), e);
+                }
+            }
+        }, staggerMs, 1000);
+    }
+
+    public void pollDeviceSignals() {
+        boolean feedingComplete;
+        boolean readComplete;
+        boolean running;
+        boolean blankingRequest;
+        boolean allowBlanking;
+
+        if (isLocal == 1) {
+            feedingComplete = false;
+            readComplete = false;
+            running = false;
+            blankingRequest = false;
+            allowBlanking = false;
+        } else {
+            java.util.List<Boolean> coils = InovancePlcUtil.readCoils(plc(), mBaseAddress, 5);
+            feedingComplete = coilAt(coils, 0);
+            readComplete = coilAt(coils, 1);
+            running = coilAt(coils, 2);
+            blankingRequest = coilAt(coils, 3);
+            allowBlanking = coilAt(coils, 4);
+            logCoilChanges(coils);
+        }
+
+        feedinglabel.setIcon(feedingComplete ? imageGreen : imageGray);
+        readCompletelabel.setIcon(readComplete ? imageGreen : imageGray);
+        runlabel.setIcon(running ? imageGreen : imageGray);
+        blankinglabel.setIcon(blankingRequest ? imageGreen : imageGray);
+        blankingmeslabel.setIcon(allowBlanking ? imageGreen : imageGray);
+
+        if (!feedingComplete && readComplete) {
+            writeReadComplete(false);
+            readCompletelabel.setIcon(imageGray);
+        }
+
+        if (tjFeedingFlag == 0) {
+            if (feedingComplete) {
+                barCode();
+            }
+        } else if (tjFeedingFlag == 1) {
+            if (running) {
+                tjFeedingFlag = 2;
+                setMenuStatus("工件加工中", 0);
+            }
+        } else if (tjFeedingFlag == 2) {
+            if (blankingRequest) {
+                tjFeedingFlag = 3;
+                writeReadComplete(false);
+                readCompletelabel.setIcon(imageGray);
+                setMenuStatus("加工完成,结果上传中", 0);
+                writeAllowBlanking(true);
+                if (tjStatus == 0) {
+                    tjStatus = 1;
+                    JSONObject retObj = DataUtil.sendQuality(
+                            productSnFeeding.getText(), oprno + pos, "OK", MesClient.user_menu.getText());
+                    if (retObj != null && retObj.get("result") != null
+                            && retObj.get("result").toString().equalsIgnoreCase("true")) {
+                        resetBlanking();
+                    } else if (retObj == null) {
+                        setMenuStatus("请求失败,请重试", -1);
+                    } else if (retObj.get("result") != null
+                            && retObj.get("result").toString().equalsIgnoreCase("false")) {
+                        setMenuStatus(retObj.getString("message"), -1);
+                    }
+                }
+            }
+        } else if (tjFeedingFlag == 3) {
+            if (!blankingRequest && !feedingComplete) {
+                resetBlanking();
+            }
+        }
+    }
+
+    private JLabel createSignalLabel(String text, int x, int y) {
+        JLabel label = new JLabel(text);
+        label.setHorizontalAlignment(SwingConstants.LEFT);
+        label.setIcon(imageGray);
+        label.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        label.setBounds(x, y, workWidth / 2, 28);
+        this.add(label);
+        return label;
+    }
+
+    private boolean coilAt(java.util.List<Boolean> coils, int index) {
+        return coils != null && index < coils.size() && Boolean.TRUE.equals(coils.get(index));
+    }
+
+    private void logCoilChanges(java.util.List<Boolean> coils) {
+        for (int i = 0; i < 5; i++) {
+            int address = mBaseAddress + i;
+            boolean value = coilAt(coils, i);
+            Boolean last = lastCoilValues.get(address);
+            if (last == null || last != value) {
+                log.info("<{}{}> M{} 变化:{} -> {}", oprno, pos, address, last, value);
+                lastCoilValues.put(address, value);
+            }
+        }
+    }
+
+    private void showCheckDialog() {
+        String url = "http://" + MesClient.mes_server_ip + ":8980/js/a/mes/mesProcessCheckRecord/ulist?ucode="
+                + MesClient.user_menu.getText() + "&oprno=" + oprno + pos + "&lineSn=" + MesClient.mes_line_sn;
+        showWebViewDialog("点检 - " + oprno + pos, url);
+    }
+
+    private void showRecordDialog() {
+        String url = "http://" + MesClient.mes_server_ip + ":8980/js/a/mes/mesProductRecord/work?oprno="
+                + oprno + pos + "&lineSn=" + MesClient.mes_line_sn;
+        showWebViewDialog("工作记录 - " + oprno + pos, url);
+    }
+
+    private void showWebViewDialog(String title, String url) {
+        JFrame frame = new JFrame(title);
+        frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
+        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+        frame.setLayout(new BorderLayout());
+        frame.getContentPane().add(new MesWebView(url), BorderLayout.CENTER);
+        frame.setVisible(true);
+    }
+
+    public void setMenuStatus(String msg, int error) {
+        status_menu.setForeground(error == 0 ? Color.GREEN : Color.RED);
+        status_menu.setText(msg);
+    }
+
+    private void styleStatusButton(JButton button, Color background) {
+        button.setOpaque(true);
+        button.setContentAreaFilled(true);
+        button.setBorderPainted(false);
+        button.setFocusPainted(false);
+        button.setBackground(background);
+        button.setForeground(Color.GREEN);
+        button.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
+    }
+
+    public void barCode() {
+        if (!productSnFeeding.getText().isEmpty()) {
+            return;
+        }
+
+        String sn = readQrcode();
+        if (sn.isEmpty()) {
+            setMenuStatus("二维码为空", -1);
+            return;
+        }
+
+        productSnFeeding.setText(sn);
+        lastSn = sn;
+        writeAllowBlanking(false);
+        tjFeedingFlag = 1;
+        writeReadComplete(true);
+        setMenuStatus("读取完成,允许加工", 0);
+    }
+
+    public void resetBlanking() {
+        tjFeedingFlag = 0;
+        tjStatus = 0;
+        productSnFeeding.setText("");
+        setMenuStatus("等待上料完成", 0);
+    }
+
+    public void resetScanA() {
+        tjFeedingFlag = 0;
+        tjStatus = 0;
+        productSnFeeding.setText("");
+        setMenuStatus("等待上料完成", 0);
+        resetFeedingBtn.setEnabled(true);
+        if (isLocal == 0) {
+            writeReadComplete(false);
+            writeAllowBlanking(false);
+        }
+    }
+
+    private ModbusTcp plc() {
+        return MesClient.modbusPlc;
+    }
+
+    public boolean readFeedingComplete() {
+        return readCoil(mBaseAddress);
+    }
+
+    public boolean readReadComplete() {
+        return readCoil(mBaseAddress + 1);
+    }
+
+    public boolean writeReadComplete(boolean value) {
+        return writeCoil(mBaseAddress + 1, value);
+    }
+
+    public boolean readRunning() {
+        if (isLocal == 1) {
+            return false;
+        }
+        return readCoil(mBaseAddress + 2);
+    }
+
+    public boolean readBlankingRequest() {
+        return readCoil(mBaseAddress + 3);
+    }
+
+    public boolean readAllowBlanking() {
+        return readCoil(mBaseAddress + 4);
+    }
+
+    public boolean writeAllowBlanking(boolean value) {
+        return writeCoil(mBaseAddress + 4, value);
+    }
+
+    public String readQrcode() {
+        if (isLocal == 1) {
+            return "";
+        }
+        return InovancePlcUtil.readString(plc(), dRegAddress);
+    }
+
+    private boolean readCoil(int address) {
+        if (isLocal == 1) {
+            return false;
+        }
+        boolean value = InovancePlcUtil.readCoil(plc(), address);
+        Boolean last = lastCoilValues.get(address);
+        if (last == null || last != value) {
+            log.info("<{}{}> M{} 变化:{} -> {}", oprno, pos, address, last, value);
+            lastCoilValues.put(address, value);
+        }
+        return value;
+    }
+
+    private boolean writeCoil(int address, boolean value) {
+        if (isLocal == 1) {
+            return true;
+        }
+        Boolean last = lastWriteCoilValues.get(address);
+        if (last == null || last != value) {
+            InovancePlcUtil.writeCoil(plc(), address, value);
+            log.info("<{}{}> 写 M{} 变化:{} -> {}", oprno, pos, address, last, value);
+            lastWriteCoilValues.put(address, value);
+        }
+        return true;
+    }
+}

+ 31 - 0
src/com/mes/entity/ToolParam.java

@@ -0,0 +1,31 @@
+package com.mes.entity;
+
+public class ToolParam {
+    private Integer nums;
+    private String title;
+    private String life;
+
+    public Integer getNums() {
+        return nums;
+    }
+
+    public void setNums(Integer nums) {
+        this.nums = nums;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getLife() {
+        return life;
+    }
+
+    public void setLife(String life) {
+        this.life = life;
+    }
+}

+ 58 - 0
src/com/mes/ui/BindMaterialResp.java

@@ -0,0 +1,58 @@
+package com.mes.ui;
+
+public class BindMaterialResp {
+    private String materialId;
+    private String materialTitle;
+    private String craft;
+    private String batchSn;
+    private String lastTimes;
+    private String type;
+
+    public String getMaterialId() {
+        return materialId;
+    }
+
+    public void setMaterialId(String materialId) {
+        this.materialId = materialId;
+    }
+
+    public String getMaterialTitle() {
+        return materialTitle;
+    }
+
+    public void setMaterialTitle(String materialTitle) {
+        this.materialTitle = materialTitle;
+    }
+
+    public String getCraft() {
+        return craft;
+    }
+
+    public void setCraft(String craft) {
+        this.craft = craft;
+    }
+
+    public String getBatchSn() {
+        return batchSn;
+    }
+
+    public void setBatchSn(String batchSn) {
+        this.batchSn = batchSn;
+    }
+
+    public String getLastTimes() {
+        return lastTimes;
+    }
+
+    public void setLastTimes(String lastTimes) {
+        this.lastTimes = lastTimes;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+}

+ 449 - 0
src/com/mes/ui/CncStationRecordPanel.java

@@ -0,0 +1,449 @@
+package com.mes.ui;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+import java.awt.*;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * CNC 90/100 加工记录面板。
+ * 按工件码汇总,展示正面(OP090)与反面(OP100)加工工位,便于区分机台。
+ */
+public class CncStationRecordPanel extends JPanel {
+
+    private static final Logger log = LoggerFactory.getLogger(CncStationRecordPanel.class);
+
+    private static final String[] COLUMN_NAMES = {
+            "工件码", "正面加工工位", "正面结果", "反面加工工位", "反面结果", "最近日期"
+    };
+
+    private static final int PAGE_SIZE = 20;
+    /** 拉取 OP090/OP100 原始记录时的窗口,再在客户端按工件码汇总分页 */
+    private static final int FETCH_SIZE = 200;
+
+    private static final String[] FRONT_STATIONS = {"OP090A", "OP090B", "OP090C"};
+    private static final String[] BACK_STATIONS = {"OP100A", "OP100B", "OP100C"};
+
+    private int pageNo = 1;
+    private int totalPages = 0;
+    private long totalCount = 0;
+
+    private final List<AggregatedRow> allRows = new ArrayList<>();
+
+    private JTable table;
+    private DefaultTableModel tableModel;
+    private JLabel pageLabel;
+    private JButton btnPrevious;
+    private JButton btnNext;
+    private JButton btnRefresh;
+    private JButton btnSearch;
+    private JLabel statusLabel;
+    private JTextField snSearchField;
+
+    public CncStationRecordPanel() {
+        initUI();
+    }
+
+    private void initUI() {
+        setLayout(null);
+        setBackground(Color.WHITE);
+
+        JPanel topPanel = new JPanel();
+        topPanel.setLayout(null);
+        topPanel.setBounds(0, 0, 1200, 50);
+        topPanel.setBackground(new Color(248, 248, 248));
+        add(topPanel);
+
+        int xPos = 10;
+
+        statusLabel = new JLabel("CNC90/100加工记录");
+        statusLabel.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        statusLabel.setBounds(xPos, 10, 220, 30);
+        topPanel.add(statusLabel);
+        xPos += 225;
+
+        JLabel snLabel = new JLabel("工件码:");
+        snLabel.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        snLabel.setBounds(xPos, 10, 50, 30);
+        topPanel.add(snLabel);
+        xPos += 52;
+
+        snSearchField = new JTextField();
+        snSearchField.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        snSearchField.setBounds(xPos, 10, 220, 30);
+        snSearchField.setToolTipText("支持模糊查询,输入工件码关键字后回车或点查询");
+        snSearchField.addActionListener(e -> doSearch());
+        topPanel.add(snSearchField);
+        xPos += 230;
+
+        btnSearch = new JButton("查询");
+        btnSearch.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        btnSearch.setBounds(xPos, 10, 70, 30);
+        btnSearch.addActionListener(e -> doSearch());
+        topPanel.add(btnSearch);
+        xPos += 80;
+
+        btnRefresh = new JButton("刷新");
+        btnRefresh.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        btnRefresh.setBounds(xPos, 10, 70, 30);
+        btnRefresh.addActionListener(e -> {
+            snSearchField.setText("");
+            refreshData();
+        });
+        topPanel.add(btnRefresh);
+        xPos += 80;
+
+        btnPrevious = new JButton("上一页");
+        btnPrevious.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        btnPrevious.setBounds(xPos, 10, 80, 30);
+        btnPrevious.addActionListener(e -> {
+            if (pageNo > 1) {
+                pageNo--;
+                renderPage();
+            }
+        });
+        topPanel.add(btnPrevious);
+        xPos += 85;
+
+        pageLabel = new JLabel("0/0");
+        pageLabel.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        pageLabel.setHorizontalAlignment(SwingConstants.CENTER);
+        pageLabel.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
+        pageLabel.setBounds(xPos, 10, 70, 30);
+        topPanel.add(pageLabel);
+        xPos += 75;
+
+        btnNext = new JButton("下一页");
+        btnNext.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        btnNext.setBounds(xPos, 10, 80, 30);
+        btnNext.addActionListener(e -> {
+            if (pageNo < totalPages) {
+                pageNo++;
+                renderPage();
+            }
+        });
+        topPanel.add(btnNext);
+
+        JPanel tablePanel = new JPanel();
+        tablePanel.setBounds(0, 50, 1200, 518);
+        tablePanel.setLayout(new GridLayout(1, 1, 0, 0));
+        add(tablePanel);
+
+        tableModel = new DefaultTableModel(COLUMN_NAMES, 0) {
+            @Override
+            public boolean isCellEditable(int row, int column) {
+                return false;
+            }
+        };
+
+        table = new JTable(tableModel);
+        table.setRowHeight(32);
+        table.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        table.getTableHeader().setFont(new Font("微软雅黑", Font.BOLD, 14));
+        table.getTableHeader().setReorderingAllowed(false);
+        setColumnWidths();
+
+        DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
+        centerRenderer.setHorizontalAlignment(JLabel.CENTER);
+        for (int i = 0; i < table.getColumnCount(); i++) {
+            table.getColumnModel().getColumn(i).setCellRenderer(centerRenderer);
+        }
+
+        tablePanel.add(new JScrollPane(table));
+
+        addComponentListener(new ComponentAdapter() {
+            @Override
+            public void componentResized(ComponentEvent e) {
+                int w = getWidth();
+                int h = getHeight();
+                topPanel.setBounds(0, 0, w, 50);
+                if (h > 50) {
+                    tablePanel.setBounds(0, 50, w, h - 50);
+                }
+                topPanel.revalidate();
+                tablePanel.revalidate();
+            }
+        });
+    }
+
+    private void setColumnWidths() {
+        TableColumn column;
+        column = table.getColumnModel().getColumn(0);
+        column.setPreferredWidth(260);
+        column = table.getColumnModel().getColumn(1);
+        column.setPreferredWidth(140);
+        column = table.getColumnModel().getColumn(2);
+        column.setPreferredWidth(80);
+        column = table.getColumnModel().getColumn(3);
+        column.setPreferredWidth(140);
+        column = table.getColumnModel().getColumn(4);
+        column.setPreferredWidth(80);
+        column = table.getColumnModel().getColumn(5);
+        column.setPreferredWidth(160);
+    }
+
+    private void doSearch() {
+        pageNo = 1;
+        loadData();
+    }
+
+    public void refreshData() {
+        pageNo = 1;
+        loadData();
+    }
+
+    public void loadData() {
+        final String searchSn = snSearchField.getText().trim();
+
+        SwingWorker<List<AggregatedRow>, Void> worker = new SwingWorker<List<AggregatedRow>, Void>() {
+            @Override
+            protected List<AggregatedRow> doInBackground() {
+                SwingUtilities.invokeLater(() -> {
+                    statusLabel.setText("正在加载...");
+                    setButtonsEnabled(false);
+                });
+
+                // 服务端对5位工位号会拼成 *A,这里直接按 A/B/C 六个工位分别查询再汇总
+                List<WorkRecordData> frontList = fetchStationRecords(FRONT_STATIONS, null);
+                List<WorkRecordData> backList = fetchStationRecords(BACK_STATIONS, null);
+
+                if (searchSn != null && !searchSn.isEmpty()) {
+                    frontList.addAll(fetchStationRecords(FRONT_STATIONS, searchSn));
+                    backList.addAll(fetchStationRecords(BACK_STATIONS, searchSn));
+                }
+
+                return aggregateRows(frontList, backList, searchSn);
+            }
+
+            @Override
+            protected void done() {
+                try {
+                    List<AggregatedRow> rows = get();
+                    allRows.clear();
+                    allRows.addAll(rows);
+                    totalCount = allRows.size();
+                    totalPages = (int) Math.ceil((double) totalCount / PAGE_SIZE);
+                    if (totalPages == 0) {
+                        totalPages = 1;
+                    }
+                    if (pageNo > totalPages) {
+                        pageNo = totalPages;
+                    }
+                    statusLabel.setText("CNC90/100 共" + totalCount + "件");
+                    renderPage();
+                } catch (Exception e) {
+                    log.error("加载CNC加工记录失败: {}", e.getMessage());
+                    updateUIError("加载失败: " + e.getMessage());
+                }
+            }
+        };
+        worker.execute();
+    }
+
+    /**
+     * 按具体机台(OP090A/B/C、OP100A/B/C)分别拉取记录。
+     */
+    private List<WorkRecordData> fetchStationRecords(String[] stations, String sn) {
+        List<WorkRecordData> list = new ArrayList<>();
+        for (String station : stations) {
+            WorkRecordResp resp = DataUtil.getWorkRecordList(station, sn, 1, FETCH_SIZE);
+            if (resp == null || !resp.isResult()) {
+                String msg = resp != null ? resp.getMessage() : (station + " 请求失败");
+                throw new RuntimeException(msg);
+            }
+            if (resp.getList() != null) {
+                list.addAll(resp.getList());
+            }
+        }
+        return list;
+    }
+
+    /**
+     * 将 OP090 / OP100 原始记录按工件码汇总;有关键字时再做一次客户端模糊过滤。
+     */
+    private List<AggregatedRow> aggregateRows(List<WorkRecordData> frontList,
+                                              List<WorkRecordData> backList,
+                                              String searchSn) {
+        Map<String, AggregatedRow> map = new LinkedHashMap<>();
+
+        if (frontList != null) {
+            for (WorkRecordData data : frontList) {
+                mergeRecord(map, data, true);
+            }
+        }
+        if (backList != null) {
+            for (WorkRecordData data : backList) {
+                mergeRecord(map, data, false);
+            }
+        }
+
+        List<AggregatedRow> rows = new ArrayList<>(map.values());
+
+        if (searchSn != null && !searchSn.isEmpty()) {
+            String key = searchSn.toUpperCase();
+            rows.removeIf(row -> row.sn == null || !row.sn.toUpperCase().contains(key));
+        }
+
+        rows.sort(Comparator.comparing(
+                (AggregatedRow r) -> r.latestDate == null ? "" : r.latestDate
+        ).reversed());
+
+        return rows;
+    }
+
+    private void mergeRecord(Map<String, AggregatedRow> map, WorkRecordData data, boolean front) {
+        if (data == null) {
+            return;
+        }
+        String sn = data.getSn();
+        if (sn == null || sn.trim().isEmpty()) {
+            return;
+        }
+        sn = sn.trim();
+        String oprno = data.getOprno();
+        if (oprno == null) {
+            return;
+        }
+        oprno = oprno.trim().toUpperCase();
+
+        if (front) {
+            if (!oprno.startsWith("OP090")) {
+                return;
+            }
+        } else {
+            if (!oprno.startsWith("OP100")) {
+                return;
+            }
+        }
+
+        AggregatedRow row = map.get(sn);
+        if (row == null) {
+            row = new AggregatedRow();
+            row.sn = sn;
+            map.put(sn, row);
+        }
+
+        String date = data.getUpdateDate();
+        if (front) {
+            if (row.frontOprno == null || isNewer(date, row.frontDate)) {
+                row.frontOprno = formatStation(oprno);
+                row.frontResult = nullToEmpty(data.getContent());
+                row.frontDate = date;
+            }
+        } else {
+            if (row.backOprno == null || isNewer(date, row.backDate)) {
+                row.backOprno = formatStation(oprno);
+                row.backResult = nullToEmpty(data.getContent());
+                row.backDate = date;
+            }
+        }
+
+        if (isNewer(date, row.latestDate)) {
+            row.latestDate = date;
+        }
+    }
+
+    private boolean isNewer(String candidate, String current) {
+        if (candidate == null || candidate.isEmpty()) {
+            return false;
+        }
+        if (current == null || current.isEmpty()) {
+            return true;
+        }
+        return candidate.compareTo(current) >= 0;
+    }
+
+    private String nullToEmpty(String value) {
+        return value == null ? "" : value;
+    }
+
+    /** 工位号转为可读机台标识,如 OP090A(正面LM14) */
+    static String formatStation(String oprno) {
+        if (oprno == null || oprno.isEmpty()) {
+            return "";
+        }
+        switch (oprno.toUpperCase()) {
+            case "OP090A":
+                return "OP090A(正面LM14)";
+            case "OP090B":
+                return "OP090B(正面LM13)";
+            case "OP090C":
+                return "OP090C(正面LM11)";
+            case "OP100A":
+                return "OP100A(反面LM12)";
+            case "OP100B":
+                return "OP100B(反面LM15)";
+            case "OP100C":
+                return "OP100C(反面LM16)";
+            default:
+                return oprno;
+        }
+    }
+
+    private void renderPage() {
+        tableModel.setRowCount(0);
+
+        totalPages = (int) Math.ceil((double) totalCount / PAGE_SIZE);
+        if (totalPages == 0) {
+            totalPages = 1;
+        }
+        pageLabel.setText(pageNo + "/" + totalPages);
+        setButtonsEnabled(true);
+
+        int from = (pageNo - 1) * PAGE_SIZE;
+        int to = Math.min(from + PAGE_SIZE, allRows.size());
+        for (int i = from; i < to; i++) {
+            AggregatedRow row = allRows.get(i);
+            tableModel.addRow(new Object[]{
+                    row.sn,
+                    nullToEmpty(row.frontOprno),
+                    nullToEmpty(row.frontResult),
+                    nullToEmpty(row.backOprno),
+                    nullToEmpty(row.backResult),
+                    nullToEmpty(row.latestDate)
+            });
+        }
+        table.repaint();
+    }
+
+    private void setButtonsEnabled(boolean enabled) {
+        btnSearch.setEnabled(enabled);
+        btnRefresh.setEnabled(enabled);
+        btnPrevious.setEnabled(enabled && pageNo > 1);
+        btnNext.setEnabled(enabled && pageNo < totalPages);
+    }
+
+    private void updateUIError(String message) {
+        statusLabel.setText("错误: " + message);
+        pageLabel.setText("0/0");
+        setButtonsEnabled(true);
+        btnPrevious.setEnabled(false);
+        btnNext.setEnabled(false);
+        tableModel.setRowCount(0);
+        allRows.clear();
+        totalCount = 0;
+        totalPages = 0;
+    }
+
+    private static class AggregatedRow {
+        String sn;
+        String frontOprno;
+        String frontResult;
+        String frontDate;
+        String backOprno;
+        String backResult;
+        String backDate;
+        String latestDate;
+    }
+}

+ 414 - 0
src/com/mes/ui/DataUtil.java

@@ -0,0 +1,414 @@
+package com.mes.ui;
+
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import com.mes.util.DateLocalUtils;
+import com.mes.util.JdbcUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+public class DataUtil {
+
+    public static final Logger log = LoggerFactory.getLogger(DataUtil.class);
+
+    public static JSONObject checkQuality(String sn,String oprno, String user){
+        try{
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+            String lineSn = pro.getProperty("mes.line_sn").trim();
+            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductRecord/pccheck";
+            String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&ucode="+user;
+            log.info("url="+url);
+            log.info("params="+params);
+            String result = doPost(url,params);
+            log.info("result="+result);
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                JdbcUtils.insertData(oprno, "100000", params, "AQDW", sn);
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            log.info("e="+e.getMessage());
+            return null;
+        }
+    }
+
+    public static JSONObject sendQuality(String sn,String oprno,String ret,String user){
+        try{
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+            String lineSn = pro.getProperty("mes.line_sn").trim();
+            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductRecord/pcresult";
+            String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&result="+ret+"&ucode="+user;
+            log.info("url="+url);
+            log.info("params="+params);
+            String result = doPost(url,params);
+            log.info("result="+result);
+
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                JdbcUtils.insertData(oprno, "100000", params, "MQDW", sn);
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            log.info("e="+e.getMessage());
+            return null;
+        }
+    }
+
+    public static JSONObject sendQuality(String sn,String oprno,String ret,String user,String ps){
+        try{
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+            String lineSn = pro.getProperty("mes.line_sn").trim();
+            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductRecord/pcresult";
+            String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&result="+ret+"&ucode="+user+"&ps="+ps;
+            log.info("url="+url);
+            log.info("params="+params);
+            String result = doPost(url,params);
+            log.info("result="+result);
+
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                JdbcUtils.insertData(oprno, "100000", params, "MQDW", sn);
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            log.info("e="+e.getMessage());
+            return null;
+        }
+    }
+
+    public static JSONObject createOrder(String oprno,String wsn1,String user){
+        try{
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+            String lineSn = pro.getProperty("mes.line_sn").trim();
+            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductRecord/pccreate";
+            String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&wsn1="+wsn1+"&ucode="+user;
+            log.info("url="+url);
+            log.info("params="+params);
+            String result = doPost(url,params);
+            log.info("result="+result);
+
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                JdbcUtils.insertData(oprno, "100000", params, "MQDW", "");
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            log.info("e="+e.getMessage());
+            return null;
+        }
+    }
+
+    public static JSONObject getSn(String oprno,int transferSn,int transferFloor,String user){
+        try{
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+            String lineSn = pro.getProperty("mes.line_sn").trim();
+            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesTransfer/getSn";
+            String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&transferSn="+transferSn+"&transferFloor="+transferFloor+"&ucode="+user;
+            log.info("url="+url);
+            log.info("params="+params);
+            String result = doPost(url,params);
+            log.info("result="+result);
+
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                JdbcUtils.insertData(oprno, "100000", params, "MQDW", "");
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            log.info("e="+e.getMessage());
+            return null;
+        }
+    }
+
+    public static JSONObject saveSn(String oprno,String sn,int transferSn,int transferFloor,String user){
+        try{
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+            String lineSn = pro.getProperty("mes.line_sn").trim();
+            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesTransfer/saveSn";
+            String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&transferSn="+transferSn+"&transferFloor="+transferFloor+"&ucode="+user;
+            log.info("url="+url);
+            log.info("params="+params);
+            String result = doPost(url,params);
+            log.info("result="+result);
+
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                JdbcUtils.insertData(oprno, "100000", params, "MQDW", "");
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            log.info("e="+e.getMessage());
+            return null;
+        }
+    }
+
+    public static JSONObject deviceAlarm(String oprno,String sn,String content,String user){
+        try{
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+            String lineSn = pro.getProperty("mes.line_sn").trim();
+            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductRecord/pcdevice";
+            String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"content="+content+"&ucode="+user;
+            log.info("url="+url);
+            log.info("params="+params);
+            String result = doPost(url,params);
+            log.info("result="+result);
+
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                JdbcUtils.insertData(oprno, "100000", params, "MQDW", "");
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            log.info("e="+e.getMessage());
+            return null;
+        }
+    }
+
+    public static JSONObject upParams(String upparams) {
+        try{
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+//            String oprno = pro.getProperty("mes.gw").trim();
+            String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductFsw/batchsave";
+            String params = "__ajax=json&params="+upparams;
+            System.out.println("params="+params);
+            String result = doPost(url,params);
+            System.out.println("result="+result);
+
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            return null;
+        }
+    }
+
+    public static JSONObject saveLife(String lineSn,String oprno,String sn,String ucode,String ps) {
+        try{
+            String url = "http://"+MesClient.mes_server_ip+":8980/js/a/mes/mesProductCncLife/saveLife";
+            String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&params="+ps+"&ucode="+ucode;
+            System.out.println("url="+url);
+            System.out.println("params="+params);
+            String result = doPost(url,params);
+            System.out.println("result="+result);
+
+            if(result.equalsIgnoreCase("false")) {
+                return null;
+            }else {
+                return JSONObject.parseObject(result);
+            }
+        }catch (Exception e){
+            return null;
+        }
+    }
+
+    public static String doPost(String httpUrl, String param) {
+        HttpURLConnection connection = null;
+        InputStream is = null;
+        OutputStream os = null;
+        BufferedReader br = null;
+        String result = null;
+        try {
+            URL url = new URL(httpUrl);
+            connection = (HttpURLConnection) url.openConnection();
+            connection.setRequestMethod("POST");
+            connection.setConnectTimeout(15000);
+            connection.setReadTimeout(15000);
+            connection.setDoOutput(true);
+            connection.setDoInput(true);
+            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
+            connection.setRequestProperty("Authorization", "Bearer da3efcbf-0845-4fe3-8aba-ee040be542c0");
+            os = connection.getOutputStream();
+            os.write(param.getBytes());
+            if (connection.getResponseCode() == 200) {
+                is = connection.getInputStream();
+                br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+                StringBuffer sbf = new StringBuffer();
+                String temp = null;
+                while ((temp = br.readLine()) != null) {
+                    sbf.append(temp);
+                    sbf.append("\r\n");
+                }
+                result = sbf.toString();
+            }
+        } catch (MalformedURLException e) {
+            e.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+            if (null != br) {
+                try {
+                    br.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != os) {
+                try {
+                    os.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            if (null != is) {
+                try {
+                    is.close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+            connection.disconnect();
+        }
+        return result;
+    }
+
+    /**
+     * 查询工作记录
+     * @param oprno 工位号(5位如OP010会查询所有子工位,空则查所有工位)
+     * @param sn 工件码(可选,用于搜索)
+     * @param pageNo 页码
+     * @param pageSize 每页条数
+     * @return 工作记录响应
+     */
+    public static WorkRecordResp getWorkRecordList(String oprno, String sn, int pageNo, int pageSize) {
+        WorkRecordResp resp = new WorkRecordResp();
+        try {
+            String enconding = "UTF-8";
+            InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+            Properties pro = new Properties();
+            BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+            pro.load(br);
+            String mes_server_ip = pro.getProperty("mes.server_ip");
+            String lineSn = pro.getProperty("mes.line_sn").trim();
+            
+            String url = "http://" + mes_server_ip + ":8980/js/a/mes/mesProductRecord/workData";
+            StringBuilder params = new StringBuilder();
+            params.append("__ajax=json");
+            params.append("&lineSn=").append(lineSn);
+            params.append("&pageNo=").append(pageNo);
+            params.append("&pageSize=").append(pageSize);
+            
+            if (oprno != null && !oprno.isEmpty()) {
+                params.append("&oprno=").append(oprno);
+            }
+            // 注意:不传auto参数,这样"所有工位"查询时会返回整条产线所有工位的数据
+            if (sn != null && !sn.isEmpty()) {
+                params.append("&sn=").append(sn);
+            }
+            
+            log.info("查询工作记录: url=" + url + ", params=" + params.toString());
+            String result = doPost(url, params.toString());
+            log.info("查询工作记录结果: result=" + result);
+            
+            if (result == null || result.trim().isEmpty()) {
+                resp.setResult(false);
+                resp.setMessage("请求返回空结果");
+                return resp;
+            }
+            
+            JSONObject jsonObj = JSONObject.parseObject(result);
+            if (jsonObj == null) {
+                resp.setResult(false);
+                resp.setMessage("解析响应失败");
+                return resp;
+            }
+            
+            resp.setResult(true);
+            resp.setPageNo(jsonObj.getIntValue("pageNo"));
+            resp.setPageSize(jsonObj.getIntValue("pageSize"));
+            resp.setCount(jsonObj.getLongValue("count"));
+            
+            List<WorkRecordData> list = new ArrayList<>();
+            JSONArray listArray = jsonObj.getJSONArray("list");
+            if (listArray != null) {
+                for (int i = 0; i < listArray.size(); i++) {
+                    JSONObject item = listArray.getJSONObject(i);
+                    WorkRecordData data = new WorkRecordData();
+                    data.setId(item.getString("id"));
+                    data.setSn(item.getString("sn"));
+                    data.setOprno(item.getString("oprno"));
+                    data.setUpdateBy(item.getString("updateBy"));
+                    data.setUpdateDate(item.getString("updateDate"));
+                    data.setContent(item.getString("content"));
+                    list.add(data);
+                }
+            }
+            resp.setList(list);
+            
+        } catch (Exception e) {
+            log.error("查询工作记录异常: " + e.getMessage());
+            e.printStackTrace();
+            resp.setResult(false);
+            resp.setMessage("查询异常: " + e.getMessage());
+        }
+        return resp;
+    }
+
+    public static String formatOprno(String oprno){
+        List<String> lists = new ArrayList<>();
+        if(oprno.length() == 6){
+            String ysoprno = oprno.substring(0,5).trim();
+            if(!lists.contains(ysoprno)){
+                oprno = ysoprno;
+            }
+        }
+
+        return  oprno;
+    }
+}

+ 200 - 0
src/com/mes/ui/LoginFarme.java

@@ -0,0 +1,200 @@
+package com.mes.ui;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.mes.component.MesRadio;
+import com.mes.component.MesWebView;
+import com.mes.util.Base64Utils;
+import com.mes.util.HttpUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.time.LocalDateTime;
+
+public class LoginFarme extends JFrame {
+
+    public static final Logger log =  LoggerFactory.getLogger(LoginFarme.class);
+    //登录模块组件
+    static JLabel userNameLabel= new JLabel("<html><body>用户名:</body></html>",JLabel.LEFT);//用户名
+    static JLabel userPasswordLabel= new JLabel("<html><body>密码:</body></html>",JLabel.LEFT);//用户名
+    public static JTextField userNameTxt;
+    public static JPasswordField userPasswordTxt;
+    static JButton loginButton = new JButton("用户密码登录");
+    static JButton scanLoginButton = new JButton("扫  码  登  录");
+
+    public LoginFarme(){
+        setTitle("MES系统客户端:"+MesClient.mes_gw+OprnoUtil.getGwDes(MesClient.mes_line_sn,MesClient.mes_gw));
+
+        ImageIcon bg = new ImageIcon(MesClient.class.getResource("/background.png"));
+        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        JLabel imgLabel = new JLabel(bg);//将背景图放在标签里。
+        getLayeredPane().add(imgLabel, new Integer(Integer.MIN_VALUE));//注意这里是关键,将背景标签添加到jfram的LayeredPane面板里。
+        imgLabel.setBounds(0,0,bg.getIconWidth(), bg.getIconHeight());//设置背景标签的位置
+        Container contentPane=getContentPane();
+        contentPane.setLayout(null);//布局,很重要
+        JPanel welcomePanel = new JPanel();
+        //welcomePanel.setLayout(new GridLayout(3, 1));
+        welcomePanel.setLayout(null);
+        //welcomeLable.setBounds(10, 5, 700, 100);
+        welcomePanel.setBounds(30, 330, 890, 300);
+        welcomePanel.setOpaque(false);//背景透明
+        contentPane.add(welcomePanel);
+
+        //登录页面
+        userNameLabel.setBounds(300, 100, 120, 40);
+        userNameLabel.setFont(new java.awt.Font("Dialog",   1,   16));
+        userPasswordLabel.setBounds(300, 150, 120, 40);
+        userPasswordLabel.setFont(new java.awt.Font("Dialog",   1,   16));
+        userNameTxt = new JTextField(20);
+        userNameTxt.setText("system");
+        userNameTxt.setBounds(400, 105, 150, 30);
+        userPasswordTxt = new JPasswordField(20);
+        userPasswordTxt.setBounds(400, 155, 150, 30);
+        userPasswordTxt.setText("Aa111111");
+        loginButton.setFont(new java.awt.Font("Dialog",   1,   16));
+        loginButton.setBounds(300, 200, 255, 40);
+        loginButton.setIcon(new ImageIcon(MesClient.class.getResource("/bg/user.png")));
+
+//        scanLoginButton.setVisible(false);
+        scanLoginButton.setFont(new java.awt.Font("Dialog",   1,   16));
+        scanLoginButton.setBounds(300, 250, 255, 40);
+        scanLoginButton.setIcon(new ImageIcon(MesClient.class.getResource("/bg/scan_barcode.png")));
+
+        welcomePanel.add(userNameLabel);
+        welcomePanel.add(userPasswordLabel);
+        welcomePanel.add(userNameTxt);
+        welcomePanel.add(userPasswordTxt);
+        welcomePanel.add(loginButton);
+        welcomePanel.add(scanLoginButton);
+        loginButton.addActionListener(new ActionListener(){
+            public void actionPerformed(ActionEvent e) {
+                login();
+            }
+        });
+        scanLoginButton.addActionListener(new ActionListener(){
+            public void actionPerformed(ActionEvent e) {
+                scanLogin();
+            }
+        });
+
+        ((JPanel)contentPane).setOpaque(false); //注意这里,将内容面板设为透明。这样LayeredPane面板中的背景才能显示出来。
+        //welcomeWin.setSize(902,678);
+        setResizable(false);//禁止最大化
+        setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
+
+        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
+        int width = 902;
+        int height = 678;
+        setBounds((d.width-width)/2, (d.height-height)/2-(d.height-height)/4, width, height);
+        /*****正常模式******/
+        setVisible(true);
+    }
+
+    //登录
+    public static void login() {
+        String user_str = userNameTxt.getText().toString();
+        String password_str = userPasswordTxt.getText().toString();
+        if(user_str.equalsIgnoreCase("")||password_str.equalsIgnoreCase("")) {
+            JOptionPane.showMessageDialog(MesClient.mesClientFrame,"用户名或密码不能为空","提示窗口", JOptionPane.INFORMATION_MESSAGE);
+            return;
+        }
+        String username = Base64Utils.getBase64(user_str);
+        String password = Base64Utils.getBase64(password_str);
+        log.info("&username=" + username + "&password=" + password);
+        String url = "http://"+MesClient.mes_server_ip+":8980/js/a/login?__ajax=json&username="+username+"&password="+password+"&validCode=&__sid=";
+        String loginResult = HttpUtils.sendRequest(url);
+        if(loginResult.equalsIgnoreCase("false")) {
+            JOptionPane.showMessageDialog(MesClient.mesClientFrame,"登录异常,请检查网络或联系网络管理员","提示窗口", JOptionPane.INFORMATION_MESSAGE);
+            return;
+        }else {
+            JSONObject retObj = JSONObject.parseObject(loginResult);
+            if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
+                //检查用户权限是否可登录界面
+                checkUserAuthority(retObj);
+            }else {
+                //ret = "msg save error";
+                //ret = false;
+                JOptionPane.showMessageDialog(MesClient.mesClientFrame,"登录失败,用户名或密码错误","提示窗口", JOptionPane.INFORMATION_MESSAGE);
+                return;
+            }
+        }
+    }
+    //扫码登录
+    public static void scanLogin() {
+        //userNameTxt.setText("");
+        //userPasswordTxt.setText("");
+        String scanContent = JOptionPane.showInputDialog(null, "请扫码工牌二维码");
+        log.info("scanContent="+scanContent);
+        if(scanContent!=null&&!scanContent.equalsIgnoreCase("")) {
+            String url = "http://"+MesClient.mes_server_ip+":8980/js/a/mes/mesLogin/login?__login=true&__ajax=json&username="+scanContent;
+            String loginResult = HttpUtils.sendRequest(url);
+            log.info("loginResult="+loginResult);
+            if(loginResult.equalsIgnoreCase("false")) {
+                JOptionPane.showMessageDialog(MesClient.mesClientFrame,"登录异常,请检查网络或联系网络管理员","提示窗口", JOptionPane.INFORMATION_MESSAGE);
+                return;
+            }else {
+                JSONObject retObj = JSONObject.parseObject(loginResult);
+                if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
+                    //检查用户权限是否可登录界面
+                    checkUserAuthority(retObj);
+                }else {
+                    JOptionPane.showMessageDialog(MesClient.mesClientFrame,"登录失败,用户名或密码错误","提示窗口", JOptionPane.INFORMATION_MESSAGE);
+                    return;
+                }
+            }
+        }else {
+            JOptionPane.showMessageDialog(MesClient.mesClientFrame,"扫码内容错误","提示窗口", JOptionPane.INFORMATION_MESSAGE);
+            return;
+        }
+    }
+
+    //检查用户权限是否可登录界面
+    public static void checkUserAuthority(JSONObject retObj) {
+        //设置登录用户名
+        JSONObject userObj = JSONObject.parseObject(retObj.get("user").toString());
+        String user_id = userObj.getString("id").toString();
+
+        //获取sessionid,判断权限
+        MesClient.sessionid = retObj.get("sessionid").toString();
+        if(MesClient.sessionid!=null&&!MesClient.sessionid.equalsIgnoreCase("")) {
+            //请求权限
+            String url_authority = "http://"+MesClient.mes_server_ip+":8980/js/a/mes/mesLineProcess/userAuth?__ajax=json&type=0&__sid="+MesClient.sessionid+"&oprno="+MesClient.mes_gw+"&lineSn="+MesClient.mes_line_sn;
+            String authorityResult = HttpUtils.sendRequest(url_authority);
+            log.info("authorityResult="+authorityResult);
+            JSONObject authorityObj = JSONObject.parseObject(authorityResult);
+            if(authorityObj.get("result")!=null&&authorityObj.get("result").toString().equalsIgnoreCase("true")) {
+                JSONObject authObjTmp = JSONObject.parseObject(authorityObj.get("data").toString());
+                MesClient.mes_auth = Integer.parseInt(authObjTmp.getString("auth").toString());
+                if(MesClient.mes_auth==0) {
+                    //无权限登录
+                    JOptionPane.showMessageDialog(MesClient.mesClientFrame,"您无权登录该工位","提示窗口", JOptionPane.INFORMATION_MESSAGE);
+                    return;
+                }else if(MesClient.mes_auth==1||MesClient.mes_auth==2) {
+                    //1操作工人,2管理员
+                    //登录成功
+                    MesClient.isLogin = 1;
+                    MesClient.user_menu.setText(user_id);
+                    MesClient.welcomeWin.setVisible(false);
+                    MesClient.mesClientFrame.setVisible(true);
+
+                    // 已弃用WebView,改为使用WorkRecordPanel
+                     if(MesClient.jfxPanel == null){
+                         String url = "http://"+ MesClient.mes_server_ip+":8980"+"/js/a/mes/mesProcessCheckRecord/ulist?ucode="+user_id+"&oprno="+MesClient.mes_gw+"&lineSn="+MesClient.mes_line_sn;
+                         MesClient.jfxPanel = new MesWebView(url);
+                         MesClient.jfxPanel.setSize(990, 550);
+                         MesClient.indexPanelWork.add(MesClient.jfxPanel);
+                     }
+                    MesClient.initWarehouseData();
+                }
+
+            }
+
+        }else {
+            JOptionPane.showMessageDialog(MesClient.mesClientFrame,"登录失败,用户名或密码错误","提示窗口", JOptionPane.INFORMATION_MESSAGE);
+            return;
+        }
+    }
+}

+ 548 - 0
src/com/mes/ui/MesClient.java

@@ -0,0 +1,548 @@
+package com.mes.ui;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.client.j2se.MatrixToImageWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.QRCodeWriter;
+import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp;
+import com.mes.component.*;
+import com.mes.util.DateLocalUtils;
+import com.mes.util.JdbcUtils;
+import com.mes.util.TCPClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import java.awt.*;
+import java.awt.event.*;
+import java.awt.image.BufferedImage;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.List;
+import java.util.Properties;
+import java.util.Timer;
+import java.util.TimerTask;
+
+public class MesClient extends JFrame {
+
+    public static final Logger log =  LoggerFactory.getLogger(MesClient.class);
+
+    private static String Drivde = "org.sqlite.JDBC";
+
+    public static int mes_auth = 0; // 权限级别 0=无权限 1=操作工人 2=管理员
+    public static String mes_gw = ""; // 工位号
+    public static String mes_gw_des = ""; // 工位名称
+    public static String mes_server_ip = ""; // 服务器IP地址
+    public static String mes_line_sn = ""; // 产线编号
+    public static String mes_line_pos = "";
+    public static String mes_plc_ip = "192.168.1.100";
+    public static int mes_plc_port = 502;
+    public static int isLocal = 0;
+    public static String mes_feeding_oprno = "OP090A";
+
+    public static ModbusTcp modbusPlc;
+
+    //session
+    public static String sessionid = "";
+
+    public static int isLogin = 0;
+
+    public static JPanel contentPane;
+    public static MesClient mesClientFrame;
+    public static JTabbedPane tabbedPane;
+    public static JScrollPane indexScrollPaneA;
+    public static JScrollPane indexScrollPaneB;
+    public static JScrollPane indexScrollPaneC;
+    public static JScrollPane indexScrollPaneD;
+     public static JScrollPane searchScrollPane; // 已弃用,改为使用 WorkRecordPanel
+
+    public static String preSn20 = "";
+
+    public static String preSn30 = "";
+
+    public static Boolean check_quality_result = false;
+    public static Integer work_status = 0;
+
+    public static JButton heart_beat_menu;
+    public static JButton status_menu;
+    public static JButton user_menu;
+
+    public static JFrame welcomeWin;
+
+     public static JPanel indexPanelWork; // 已弃用,改为使用 WorkRecordPanel
+    public static MesWebView jfxPanel = null;
+
+    public static JTable table;
+    public static Object[] columnNames = { "物料名称", "绑定批次", "剩余次数", "操作" };
+    public static Object[][] rowData = null;
+
+    public static TCPClient tcpClient1 = new TCPClient("192.168.90.51",9004);
+    public static TCPClient tcpClient2 = new TCPClient("192.168.90.52",9004);
+
+    public static TCPClient tcpClient3 = new TCPClient("192.168.90.53",9004); // 60B
+    public static TCPClient tcpClient4 = new TCPClient("192.168.90.54",9004); // 70EFG
+
+    public static int scanFlag1 = 0;
+    public static int scanFlag2 = 0;
+
+    public static int scanFlag3 = 0;
+    public static int scanFlag4 = 0;
+
+    public static String newSn = ""; // 最新二维码
+
+    /** 正面3台 OP090 A/B/C */
+    public static WorkJPanelDevice workJPanelFrontA;
+    public static WorkJPanelDevice workJPanelFrontB;
+    public static WorkJPanelDevice workJPanelFrontC;
+    /** 反面3台 OP100 A/B/C */
+    public static WorkJPanelDevice workJPanelBackA;
+    public static WorkJPanelDevice workJPanelBackB;
+    public static WorkJPanelDevice workJPanelBackC;
+
+    public static FeedingAreaPanel feedingAreaPanel;
+
+    /** CNC90/100 加工记录(按工件码汇总正反面工位) */
+    public static CncStationRecordPanel cncStationRecordPanel;
+
+    public static void main(String[] args) {
+        EventQueue.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                try{
+                    //读文件配置
+                    readProperty();
+
+                    JdbcUtils.getConn();
+
+                    // 显示界面
+                    mesClientFrame = new MesClient();
+                    mesClientFrame.setVisible(false);
+
+                    welcomeWin = new LoginFarme();
+                    welcomeWin.setVisible(true);
+
+                    startHeartBeatTimer();
+
+                    upParams();
+
+
+                }catch (Exception e){
+                    log.error(e.getMessage());
+                }
+            }
+        });
+    }
+
+    public static Timer cjTimer3;
+    public static void upParams() {
+        if(cjTimer3!=null) {
+            cjTimer3.cancel();
+        }
+        cjTimer3 = new Timer();
+        cjTimer3.schedule(new TimerTask() {
+            public void run() {
+                try{
+                    List<ParamReq> prods = JdbcUtils.getParams();
+                    if(prods.size() > 0){
+                        // 定时上传参数
+                        JSONObject retObj = DataUtil.upParams(JSON.toJSONString(prods));
+                        if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
+                            // 更新sqlite已同步
+                            for(ParamReq prodReq:prods){
+                                JdbcUtils.updateProdSync(prodReq.getId(),1);
+                            }
+                        }
+                    }
+                }catch (Exception e){
+                    e.printStackTrace();
+                }
+            }
+        }, 1000,120*1000);
+    }
+
+    //读配置文件
+    private static void readProperty() throws IOException{
+        String enconding = "UTF-8";
+        InputStream is = ClassLoader.getSystemResourceAsStream("config/config.properties");
+        Properties pro = new Properties();
+        BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
+        pro.load(br);
+        mes_gw =  pro.getProperty("mes.gw");
+        mes_gw_des = pro.getProperty("mes.gw_des");
+        mes_server_ip = pro.getProperty("mes.server_ip");
+//        mes_tcp_port = Integer.parseInt(pro.getProperty("mes.tcp_port"));
+//        mes_heart_beat_cycle = Integer.parseInt(pro.getProperty("mes.heart_beat_cycle"));
+        mes_line_sn = pro.getProperty("mes.line_sn");
+        mes_line_pos = pro.getProperty("mes.line_pos");
+        mes_plc_ip = pro.getProperty("mes.plc_ip", mes_plc_ip);
+        mes_plc_port = Integer.parseInt(pro.getProperty("mes.plc_port", String.valueOf(mes_plc_port)));
+        isLocal = Integer.parseInt(pro.getProperty("mes.is_local", String.valueOf(isLocal)));
+        mes_feeding_oprno = pro.getProperty("mes.feeding_oprno", mes_feeding_oprno);
+
+        modbusPlc = new ModbusTcp(1, mes_plc_ip, mes_plc_port);
+        modbusPlc.setConnectTimeout(2000);
+        modbusPlc.setReceiveTimeout(2000);
+
+//        log.info(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + ";" + mes_tcp_port + ";" + mes_heart_beat_cycle);
+    }
+
+    //启动心跳包程序
+    public static java.util.Timer heartBeatIconTimer;
+    public static boolean iconREDFlag = true;
+    public static void startHeartBeatTimer() {
+
+        //心跳显示图标
+        if(heartBeatIconTimer!=null) {
+            heartBeatIconTimer.cancel();
+        }
+        heartBeatIconTimer = new Timer();
+        heartBeatIconTimer.schedule(new TimerTask() {
+            public void run() {
+                if(iconREDFlag) {
+                    heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/grey_dot.png")));
+                    iconREDFlag = false;
+                }else {
+                    heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/green_dot.png")));
+                    iconREDFlag = true;
+                }
+                heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
+                heart_beat_menu.repaint();
+            }
+        }, 100,1000);
+    }
+
+    public static void initWarehouseData(){
+        resetScanA();
+    }
+
+    public static void resetScanA() {
+
+        MesClient.setMenuStatus("请扫工件码",0);
+    }
+
+
+    public static void logoff() {
+        mesClientFrame.setVisible(false);
+        //退出程序 退出登录
+        System.exit(0);
+//        nettyClient = null;
+    }
+
+    public MesClient() {
+        setIconImage(Toolkit.getDefaultToolkit().getImage(MesClient.class.getResource("/bg/logo.png")));
+        setTitle("MES系统客户端:祥鑫CNC自动线");
+//        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+//        setBounds(0, 0, 1920, 1080);
+        setBounds(0, 0, 1280, 900);
+
+        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); // 防止默认的关闭操作
+        // 添加窗口监听器
+        addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowClosing(WindowEvent e) {
+                int choice = JOptionPane.showConfirmDialog(null, "确定要关闭窗口吗?", "关闭确认", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+                if (choice == JOptionPane.YES_OPTION) {
+                    // 如果用户点击“是”,则关闭窗口
+                    dispose(); // 释放窗口资源并关闭窗口
+                    System.exit(0);
+                }
+            }
+        });
+
+        JMenuBar menuBar = new JMenuBar();
+        menuBar.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 26));
+        setJMenuBar(menuBar);
+        JMenu fileMenu = new JMenu("用户");
+        fileMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/user.png")));
+        fileMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
+        menuBar.add(fileMenu);
+
+        JMenuItem exitMenuItem = new JMenuItem("退出");
+        exitMenuItem.setIcon(new ImageIcon(MesClient.class.getResource("/bg/logoff.png")));
+        exitMenuItem.setFont(new Font("微软雅黑", Font.PLAIN, 22));
+        fileMenu.add(exitMenuItem);
+        exitMenuItem.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mousePressed(MouseEvent e) {//只能检测到mousePressed事件
+                super.mouseClicked(e);
+                //dispose();
+                logoff();
+            }
+        });
+
+        JMenu settingMenu = new JMenu("设置");
+        //settingMenu.setVisible(false);
+        settingMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/menu_setting.png")));
+        settingMenu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
+        menuBar.add(settingMenu);
+
+        contentPane = new JPanel();
+        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
+        setContentPane(contentPane);
+        contentPane.setLayout(new BorderLayout(0, 0));
+
+        JToolBar toolBar = new JToolBar();
+        contentPane.add(toolBar, BorderLayout.NORTH);
+
+        JLabel equipment_statu_label = new JLabel("状态:");
+        equipment_statu_label.setHorizontalAlignment(SwingConstants.CENTER);
+        equipment_statu_label.setForeground(Color.BLACK);
+        equipment_statu_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
+        equipment_statu_label.setBackground(Color.LIGHT_GRAY);
+//        toolBar.add(equipment_statu_label);
+
+        status_menu = new JButton("已连接MES服务器");
+        status_menu.setForeground(Color.GREEN);
+        status_menu.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+            }
+        });
+        status_menu.setForeground(Color.GREEN);
+        status_menu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
+        status_menu.setBackground(Color.BLACK);
+//        toolBar.add(status_menu);
+
+        JLabel space_1 = new JLabel("    ");
+        toolBar.add(space_1);
+
+        JLabel heart_beat_status_label = new JLabel("心跳:");
+        heart_beat_status_label.setHorizontalAlignment(SwingConstants.CENTER);
+        heart_beat_status_label.setForeground(Color.BLACK);
+        heart_beat_status_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
+        heart_beat_status_label.setBackground(Color.LIGHT_GRAY);
+        toolBar.add(heart_beat_status_label);
+
+        heart_beat_menu = new JButton("");
+        heart_beat_menu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/green_dot.png")));
+        heart_beat_menu.setForeground(Color.GREEN);
+        heart_beat_menu.setFont(new Font("微软雅黑", Font.PLAIN, 20));
+        heart_beat_menu.setBackground(Color.BLACK);
+        toolBar.add(heart_beat_menu);
+
+        JLabel space_2 = new JLabel("    ");
+        toolBar.add(space_2);
+
+        JLabel user_status_label = new JLabel("登录用户:");
+        user_status_label.setHorizontalAlignment(SwingConstants.CENTER);
+        user_status_label.setForeground(Color.BLACK);
+        user_status_label.setFont(new Font("微软雅黑", Font.PLAIN, 20));
+        user_status_label.setBackground(Color.LIGHT_GRAY);
+        toolBar.add(user_status_label);
+
+        user_menu = new JButton("");
+        user_menu.setForeground(Color.GREEN);
+        user_menu.setFont(new Font("微软雅黑", Font.PLAIN, 22));
+        user_menu.setBackground(Color.BLACK);
+        toolBar.add(user_menu);
+
+        JLabel space_3 = new JLabel("    ");
+        toolBar.add(space_3);
+
+        JLabel space_4 = new JLabel("    ");
+        toolBar.add(space_4);
+
+        tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+        tabbedPane.setMinimumSize(new Dimension(400, 50));
+        tabbedPane.setFont(new Font("宋体", Font.BOLD, 22));
+        contentPane.add(tabbedPane);
+
+        // 工作面板:上料区 + 正面3台 + 反面3台
+        JPanel indexPanelA = new JPanel();
+        indexPanelA.setLayout(new BorderLayout(5, 5));
+        indexPanelA.setBackground(Color.LIGHT_GRAY);
+        indexScrollPaneA = new JScrollPane(indexPanelA);
+
+        feedingAreaPanel = new FeedingAreaPanel(modbusPlc, mes_feeding_oprno, isLocal);
+        indexPanelA.add(feedingAreaPanel, BorderLayout.NORTH);
+
+        JPanel deviceGrid = new JPanel(new GridLayout(2, 3, 8, 8));
+        deviceGrid.setBackground(Color.LIGHT_GRAY);
+        deviceGrid.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+
+        workJPanelFrontA = addDevicePanel(deviceGrid, "OP090", "A", 5000, 5100, "正面LM14");
+        workJPanelFrontB = addDevicePanel(deviceGrid, "OP090", "B", 5010, 5200, "正面LM13");
+        workJPanelFrontC = addDevicePanel(deviceGrid, "OP090", "C", 5030, 5400, "正面LM11");
+        workJPanelBackA = addDevicePanel(deviceGrid, "OP100", "A", 5020, 5300, "反面LM12");
+        workJPanelBackB = addDevicePanel(deviceGrid, "OP100", "B", 5040, 5500, "反面LM15");
+        workJPanelBackC = addDevicePanel(deviceGrid, "OP100", "C", 5050, 5600, "反面LM16");
+
+        indexPanelA.add(deviceGrid, BorderLayout.CENTER);
+
+        tabbedPane.addTab("CNC自动线", null, indexScrollPaneA, null);
+        tabbedPane.setEnabledAt(0, true);
+
+        cncStationRecordPanel = new CncStationRecordPanel();
+        tabbedPane.addTab("加工记录", null, cncStationRecordPanel, "查看工件在OP090/OP100的加工机台记录");
+
+        tabbedPane.addChangeListener(new ChangeListener() {
+            @Override
+            public void stateChanged(ChangeEvent e) {
+                JTabbedPane tabbedPane = (JTabbedPane) e.getSource();
+                int selectedIndex = tabbedPane.getSelectedIndex();
+                if (selectedIndex == 1 && cncStationRecordPanel != null) {
+                    cncStationRecordPanel.refreshData();
+                }
+            }
+        });
+    }
+
+    private static WorkJPanelDevice addDevicePanel(JPanel parent, String oprno, String pos,
+                                                   int mBase, int dAddr, String sideLabel) {
+        JPanel wrapper = new JPanel(null);
+        wrapper.setBackground(new Color(245, 247, 250));
+        wrapper.setBorder(BorderFactory.createCompoundBorder(
+                BorderFactory.createLineBorder(new Color(190, 195, 200), 1),
+                BorderFactory.createEmptyBorder(4, 4, 4, 4)));
+        wrapper.setPreferredSize(new Dimension(420, 260));
+        WorkJPanelDevice device = new WorkJPanelDevice(oprno, pos, mBase, dAddr, sideLabel);
+        device.setBounds(5, 5, device.workWidth, device.workHeight);
+        wrapper.add(device);
+        parent.add(wrapper);
+        return device;
+    }
+
+    public static void setMenuStatus(String msg,int error){
+        if(error == 0){
+            MesClient.status_menu.setForeground(Color.GREEN);
+        }else{
+            MesClient.status_menu.setForeground(Color.RED);
+        }
+        MesClient.status_menu.setText(msg);
+    }
+
+    public static void createQRCode(String s,String title) {
+        log.info("二维码:"+s);
+        if(s == null || s.isEmpty()){
+            return;
+        }
+        s = s.trim();
+        try {
+
+            BitMatrix bitMatrix = new QRCodeWriter().encode(s, BarcodeFormat.QR_CODE, 200, 200);
+            BufferedImage qrImage = MatrixToImageWriter.toBufferedImage(bitMatrix);
+
+            JDialog qrDialog = new JDialog(mesClientFrame, title, Dialog.ModalityType.APPLICATION_MODAL);
+            qrDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+            qrDialog.setSize(250, 250);
+            qrDialog.setLocationRelativeTo(mesClientFrame);
+            qrDialog.setResizable(false);
+            JLabel qrLabel = new JLabel(new ImageIcon(qrImage));
+            qrDialog.getContentPane().add(qrLabel, BorderLayout.CENTER);
+            qrDialog.setVisible(true);
+            log.info("已生成二维码");
+        } catch (Exception e) {
+            log.error("生成二维码失败", e);
+        }
+    }
+
+    public static String scanQrcode1(){
+        if(scanFlag1 == 1){
+            return "";
+        }
+        scanFlag1 = 1;
+        String sn = "";
+        try{
+            if (tcpClient1.socket == null || !tcpClient1.socket.isConnected() || tcpClient1.socket.isClosed()) {
+                tcpClient1.connect();
+            }
+            log.error("扫码枪1正在进行扫码,请勿操作",0);
+            sn = tcpClient1.receiveResponse();
+            if (sn == null || sn.equals("")) {
+                sn = "";
+            }
+            tcpClient1.close();
+        }catch (Exception e) {
+            e.printStackTrace();
+            log.error("scanQrcode1:"+sn);
+            tcpClient1.close();
+        }
+        MesClient.setMenuStatus(sn,0);
+        scanFlag1 = 0;
+        return sn;
+    }
+
+    public static String scanQrcode2(){
+        if(scanFlag2 == 1){
+            return "";
+        }
+        scanFlag2 = 1;
+        String sn = "";
+        try{
+            if (tcpClient2.socket == null || !tcpClient2.socket.isConnected() || tcpClient2.socket.isClosed()) {
+                tcpClient2.connect();
+            }
+            log.error("扫码枪2正在进行扫码,请勿操作",0);
+            sn = tcpClient2.receiveResponse();
+            if (sn == null || sn.equals("")) {
+                sn = "";
+            }
+            tcpClient2.close();
+        }catch (Exception e) {
+            e.printStackTrace();
+            log.error("scanQrcode2:"+sn);
+            tcpClient2.close();
+        }
+        MesClient.setMenuStatus(sn,0);
+        scanFlag2 = 0;
+        return sn;
+    }
+
+    public static String scanQrcode3(){
+        if(scanFlag3 == 1){
+            return "";
+        }
+        scanFlag3 = 1;
+        String sn = "";
+        try{
+            if (tcpClient3.socket == null || !tcpClient3.socket.isConnected() || tcpClient3.socket.isClosed()) {
+                tcpClient3.connect();
+            }
+            log.error("扫码枪3正在进行扫码,请勿操作",0);
+            sn = tcpClient3.receiveResponse();
+            if (sn == null || sn.equals("")) {
+                sn = "";
+            }
+            tcpClient3.close();
+        }catch (Exception e) {
+            e.printStackTrace();
+            log.error("scanQrcode3:"+sn);
+            tcpClient3.close();
+        }
+        MesClient.setMenuStatus(sn,0);
+        scanFlag3 = 0;
+        return sn;
+    }
+
+    public static String scanQrcode4(){
+        if(scanFlag4 == 1){
+            return "";
+        }
+        scanFlag4 = 1;
+        String sn = "";
+        try{
+            if (tcpClient4.socket == null || !tcpClient4.socket.isConnected() || tcpClient4.socket.isClosed()) {
+                tcpClient4.connect();
+            }
+            log.error("扫码枪4正在进行扫码,请勿操作",0);
+            sn = tcpClient4.receiveResponse();
+            if (sn == null || sn.equals("")) {
+                sn = "";
+            }
+            tcpClient4.close();
+        }catch (Exception e) {
+            e.printStackTrace();
+            log.error("scanQrcode4:"+sn);
+            tcpClient4.close();
+        }
+        MesClient.setMenuStatus(sn,0);
+        scanFlag4 = 0;
+        return sn;
+    }
+}

+ 56 - 0
src/com/mes/ui/OprnoUtil.java

@@ -0,0 +1,56 @@
+package com.mes.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class OprnoUtil {
+    public static String[] xtoprnos = new String[]{
+            "OP090", "OP100", "OP140", "OP190", "OP210", "OP230",
+    };
+    public static String[] xtoprnodes = new String[]{
+            "CNC正面加工", "CNC反面加工", "框架CNC反面加工", "液冷板安装", "液冷板FSW", "CNC加工箱体正面"
+    };
+    public static String[] lboprnos = new String[]{
+
+    };
+    public static String[] lboprnodes = new String[]{
+
+    };
+    public static String getGwDes(String lineSn,String oprno){
+        String des = "";
+        oprno = formatOprno(oprno);
+        if(lineSn.equals("XT")){
+            int i = 0;
+            for (String gw:xtoprnos){
+                if(gw.equals(oprno)){
+                    des = xtoprnodes[i];
+                    break;
+                }
+                i++;
+            }
+        }else if(lineSn.equals("LB")){
+            int i = 0;
+            for (String gw:lboprnos){
+                if(gw.equals(oprno)){
+                    des = lboprnodes[i];
+                    break;
+                }
+                i++;
+            }
+        }
+        return des;
+    }
+
+    public static String formatOprno(String oprno){
+        List<String> lists = new ArrayList<>();
+
+        if(oprno.length() == 6){
+            String ysoprno = oprno.substring(0,5).trim();
+            if(!lists.contains(ysoprno)){
+                oprno = ysoprno;
+            }
+        }
+
+        return  oprno;
+    }
+}

+ 58 - 0
src/com/mes/ui/ParamReq.java

@@ -0,0 +1,58 @@
+package com.mes.ui;
+
+public class ParamReq {
+    private Integer id;
+    private String oprno;
+    private String lineSn;
+    private String sn;
+    private String content;
+    private Integer sync;
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getOprno() {
+        return oprno;
+    }
+
+    public void setOprno(String oprno) {
+        this.oprno = oprno;
+    }
+
+    public String getLineSn() {
+        return lineSn;
+    }
+
+    public void setLineSn(String lineSn) {
+        this.lineSn = lineSn;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Integer getSync() {
+        return sync;
+    }
+
+    public void setSync(Integer sync) {
+        this.sync = sync;
+    }
+}

+ 48 - 0
src/com/mes/ui/TableCellEditorButton.java

@@ -0,0 +1,48 @@
+package com.mes.ui;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class TableCellEditorButton extends DefaultCellEditor {
+
+    public static final Logger log =  LoggerFactory.getLogger(TableCellEditorButton.class);
+    private JButton btn;
+    public TableCellEditorButton() {
+        super(new JTextField());
+        //设置点击一次就激活,否则默认好像是点击2次激活。
+        this.setClickCountToStart(1);
+        btn = new JButton("扫码");
+        btn.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                log.info("按钮事件触发----");
+                int selectedRow = MesClient.table.getSelectedRow();//获得选中行的索引
+//                MesClient.rowData[selectedRow][1] = (new Date()).getTime();
+//                MesClient.table.repaint(); //重绘
+
+//                MesClient.scan_type = selectedRow + 4;
+                BindMaterialResp bindMaterialResp = new BindMaterialResp();
+                bindMaterialResp.setMaterialTitle(MesClient.rowData[selectedRow][0] + "");
+                bindMaterialResp.setBatchSn(MesClient.rowData[selectedRow][1] + "");
+                bindMaterialResp.setLastTimes(MesClient.rowData[selectedRow][2] + "");
+                bindMaterialResp.setCraft(MesClient.rowData[selectedRow][4] + "");
+                bindMaterialResp.setMaterialId(MesClient.rowData[selectedRow][5] + "");
+                bindMaterialResp.setType(MesClient.rowData[selectedRow][6] + "");
+
+//                MesClient.scanBatchSn(bindMaterialResp);
+            }
+        });
+
+    }
+    @Override
+    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
+
+        return btn;
+    }
+}

+ 14 - 0
src/com/mes/ui/TableCellRendererButton.java

@@ -0,0 +1,14 @@
+package com.mes.ui;
+
+import javax.swing.*;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+
+public class TableCellRendererButton implements TableCellRenderer {
+    @Override
+    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
+                                                   int row, int column) {
+        JButton button = new JButton("扫码");
+        return button;
+    }
+}

+ 61 - 0
src/com/mes/ui/WorkRecordData.java

@@ -0,0 +1,61 @@
+package com.mes.ui;
+
+/**
+ * 工作记录数据实体类
+ */
+public class WorkRecordData {
+    private String id;
+    private String sn;          // 工件码
+    private String oprno;       // 工位号
+    private String updateBy;    // 作业人员
+    private String updateDate;  // 日期
+    private String content;     // 工位结果
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getSn() {
+        return sn;
+    }
+
+    public void setSn(String sn) {
+        this.sn = sn;
+    }
+
+    public String getOprno() {
+        return oprno;
+    }
+
+    public void setOprno(String oprno) {
+        this.oprno = oprno;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public String getUpdateDate() {
+        return updateDate;
+    }
+
+    public void setUpdateDate(String updateDate) {
+        this.updateDate = updateDate;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+}

+ 403 - 0
src/com/mes/ui/WorkRecordPanel.java

@@ -0,0 +1,403 @@
+package com.mes.ui;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+import java.awt.*;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.util.List;
+
+/**
+ * 工作记录面板组件
+ * 支持分页查询和展示工作记录数据
+ */
+public class WorkRecordPanel extends JPanel {
+
+    private static final Logger log = LoggerFactory.getLogger(WorkRecordPanel.class);
+
+    // 表格列名
+    private static final String[] COLUMN_NAMES = {"工件码", "工位号", "工位结果", "作业人员", "日期"};
+
+    // 分页配置
+    private static final int PAGE_SIZE = 20;
+
+    // 查询条件
+    private String oprno;  // 工位号(null或空则查全部)
+    private String lineSn; // 产线编号
+    private boolean isAllStation; // 是否是"所有工位"模式
+
+    // 分页状态
+    private int pageNo = 1;
+    private long totalCount = 0;
+    private int totalPages = 0;
+
+    // UI组件
+    private JTable table;
+    private DefaultTableModel tableModel;
+    private JLabel pageLabel;
+    private JButton btnPrevious;
+    private JButton btnNext;
+    private JButton btnRefresh;
+    private JButton btnSearch;
+    private JLabel statusLabel;
+    private JTextField snSearchField;      // 工件码搜索框
+    private JTextField oprnoSearchField;   // 工位号搜索框(仅"所有工位"模式)
+    private JLabel snLabel;
+    private JLabel oprnoLabel;
+
+    /**
+     * 构造函数
+     * @param oprno 工位号(如OP010A查询该工位,null或空则查所有工位)
+     * @param lineSn 产线编号
+     */
+    public WorkRecordPanel(String oprno, String lineSn) {
+        this.oprno = oprno;
+        this.lineSn = lineSn;
+        this.isAllStation = (oprno == null || oprno.isEmpty());
+        initUI();
+    }
+
+    /**
+     * 初始化UI
+     */
+    private void initUI() {
+        setLayout(null);
+        setBackground(Color.WHITE);
+
+        // 顶部控制区
+        JPanel topPanel = new JPanel();
+        topPanel.setLayout(null);
+        topPanel.setBounds(0, 0, 1200, 50);
+        topPanel.setBackground(new Color(248, 248, 248));
+        add(topPanel);
+
+        int xPos = 10;
+
+        // 状态标签
+        String displayOprno = isAllStation ? "所有工位" : oprno;
+        statusLabel = new JLabel("工位:" + displayOprno);
+        statusLabel.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        statusLabel.setBounds(xPos, 10, 160, 30);
+        topPanel.add(statusLabel);
+        xPos += 165;
+
+        // 工件码搜索
+        snLabel = new JLabel("工件码:");
+        snLabel.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        snLabel.setBounds(xPos, 10, 50, 30);
+        topPanel.add(snLabel);
+        xPos += 52;
+
+        snSearchField = new JTextField();
+        snSearchField.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        snSearchField.setBounds(xPos, 10, 200, 30);
+        snSearchField.addActionListener(e -> doSearch()); // 回车搜索
+        topPanel.add(snSearchField);
+        xPos += 210;
+
+        // 工位号搜索(仅"所有工位"模式显示)
+        if (isAllStation) {
+            oprnoLabel = new JLabel("工位:");
+            oprnoLabel.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+            oprnoLabel.setBounds(xPos, 10, 40, 30);
+            topPanel.add(oprnoLabel);
+            xPos += 42;
+
+            oprnoSearchField = new JTextField();
+            oprnoSearchField.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+            oprnoSearchField.setBounds(xPos, 10, 100, 30);
+            oprnoSearchField.addActionListener(e -> doSearch()); // 回车搜索
+            topPanel.add(oprnoSearchField);
+            xPos += 110;
+        }
+
+        // 查询按钮
+        btnSearch = new JButton("查询");
+        btnSearch.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        btnSearch.setBounds(xPos, 10, 70, 30);
+        btnSearch.addActionListener(e -> doSearch());
+        topPanel.add(btnSearch);
+        xPos += 80;
+
+        // 刷新按钮
+        btnRefresh = new JButton("刷新");
+        btnRefresh.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        btnRefresh.setBounds(xPos, 10, 70, 30);
+        btnRefresh.addActionListener(e -> {
+            clearSearchFields();
+            refreshData();
+        });
+        topPanel.add(btnRefresh);
+        xPos += 80;
+
+        // 上一页按钮
+        btnPrevious = new JButton("上一页");
+        btnPrevious.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        btnPrevious.setBounds(xPos, 10, 80, 30);
+        btnPrevious.addActionListener(e -> {
+            if (pageNo > 1) {
+                pageNo--;
+                loadData();
+            }
+        });
+        topPanel.add(btnPrevious);
+        xPos += 85;
+
+        // 页码显示
+        pageLabel = new JLabel("0/0");
+        pageLabel.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        pageLabel.setHorizontalAlignment(SwingConstants.CENTER);
+        pageLabel.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
+        pageLabel.setBounds(xPos, 10, 70, 30);
+        topPanel.add(pageLabel);
+        xPos += 75;
+
+        // 下一页按钮
+        btnNext = new JButton("下一页");
+        btnNext.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        btnNext.setBounds(xPos, 10, 80, 30);
+        btnNext.addActionListener(e -> {
+            if (pageNo < totalPages) {
+                pageNo++;
+                loadData();
+            }
+        });
+        topPanel.add(btnNext);
+
+        // 表格面板
+        JPanel tablePanel = new JPanel();
+        tablePanel.setBounds(0, 50, 1200, 518);
+        tablePanel.setLayout(new GridLayout(1, 1, 0, 0));
+        add(tablePanel);
+
+        // 创建表格模型
+        tableModel = new DefaultTableModel(COLUMN_NAMES, 0) {
+            @Override
+            public boolean isCellEditable(int row, int column) {
+                return false;
+            }
+        };
+
+        // 创建表格
+        table = new JTable(tableModel);
+        table.setRowHeight(32);
+        table.setFont(new Font("微软雅黑", Font.PLAIN, 13));
+        table.getTableHeader().setFont(new Font("微软雅黑", Font.BOLD, 14));
+        table.getTableHeader().setReorderingAllowed(false);
+
+        // 设置列宽
+        setColumnWidths();
+
+        // 设置居中渲染器
+        DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
+        centerRenderer.setHorizontalAlignment(JLabel.CENTER);
+        for (int i = 0; i < table.getColumnCount(); i++) {
+            table.getColumnModel().getColumn(i).setCellRenderer(centerRenderer);
+        }
+
+        // 添加滚动面板
+        JScrollPane scrollPane = new JScrollPane(table);
+        tablePanel.add(scrollPane);
+
+        // 添加组件大小变化监听器
+        addComponentListener(new ComponentAdapter() {
+            @Override
+            public void componentResized(ComponentEvent e) {
+                int w = getWidth();
+                int h = getHeight();
+
+                // 调整顶部面板宽度
+                topPanel.setBounds(0, 0, w, 50);
+
+                // 调整表格面板
+                if (h > 50) {
+                    tablePanel.setBounds(0, 50, w, h - 50);
+                }
+
+                topPanel.revalidate();
+                tablePanel.revalidate();
+            }
+        });
+    }
+
+    /**
+     * 设置列宽
+     */
+    private void setColumnWidths() {
+        TableColumn column;
+        // 工件码
+        column = table.getColumnModel().getColumn(0);
+        column.setPreferredWidth(260);
+        // 工位号
+        column = table.getColumnModel().getColumn(1);
+        column.setPreferredWidth(90);
+        // 工位结果
+        column = table.getColumnModel().getColumn(2);
+        column.setPreferredWidth(70);
+        // 作业人员
+        column = table.getColumnModel().getColumn(3);
+        column.setPreferredWidth(100);
+        // 日期
+        column = table.getColumnModel().getColumn(4);
+        column.setPreferredWidth(150);
+    }
+
+    /**
+     * 清空搜索框
+     */
+    private void clearSearchFields() {
+        snSearchField.setText("");
+        if (oprnoSearchField != null) {
+            oprnoSearchField.setText("");
+        }
+    }
+
+    /**
+     * 执行搜索
+     */
+    private void doSearch() {
+        pageNo = 1;
+        loadData();
+    }
+
+    /**
+     * 刷新数据(重置到第一页)
+     */
+    public void refreshData() {
+        pageNo = 1;
+        loadData();
+    }
+
+    /**
+     * 加载数据
+     */
+    public void loadData() {
+        // 获取搜索条件
+        String searchSn = snSearchField.getText().trim();
+        String searchOprno = oprno; // 默认使用构造函数传入的工位号
+
+        // 如果是"所有工位"模式,检查是否有工位号搜索条件
+        if (isAllStation && oprnoSearchField != null) {
+            String inputOprno = oprnoSearchField.getText().trim();
+            if (!inputOprno.isEmpty()) {
+                searchOprno = inputOprno;
+            }
+        }
+
+        final String finalSearchOprno = searchOprno;
+        final String finalSearchSn = searchSn;
+
+        // 在后台线程中执行数据加载
+        SwingWorker<WorkRecordResp, Void> worker = new SwingWorker<WorkRecordResp, Void>() {
+            @Override
+            protected WorkRecordResp doInBackground() throws Exception {
+                // 更新状态
+                SwingUtilities.invokeLater(() -> {
+                    statusLabel.setText("正在加载...");
+                    setButtonsEnabled(false);
+                });
+
+                // 调用接口查询数据
+                return DataUtil.getWorkRecordList(finalSearchOprno, finalSearchSn, pageNo, PAGE_SIZE);
+            }
+
+            @Override
+            protected void done() {
+                try {
+                    WorkRecordResp resp = get();
+                    updateUI(resp, finalSearchOprno);
+                } catch (Exception e) {
+                    log.error("加载工作记录失败: {}", e.getMessage());
+                    updateUIError("加载失败: " + e.getMessage());
+                }
+            }
+        };
+        worker.execute();
+    }
+
+    /**
+     * 设置按钮启用状态
+     */
+    private void setButtonsEnabled(boolean enabled) {
+        btnSearch.setEnabled(enabled);
+        btnRefresh.setEnabled(enabled);
+        btnPrevious.setEnabled(enabled && pageNo > 1);
+        btnNext.setEnabled(enabled && pageNo < totalPages);
+    }
+
+    /**
+     * 更新UI显示数据
+     */
+    private void updateUI(WorkRecordResp resp, String queryOprno) {
+        // 清空表格
+        tableModel.setRowCount(0);
+
+        if (resp == null || !resp.isResult()) {
+            String msg = resp != null ? resp.getMessage() : "请求失败";
+            updateUIError(msg);
+            return;
+        }
+
+        // 更新分页信息
+        totalCount = resp.getCount();
+        totalPages = (int) Math.ceil((double) totalCount / PAGE_SIZE);
+        if (totalPages == 0) totalPages = 1;
+
+        // 更新页码显示
+        pageLabel.setText(pageNo + "/" + totalPages);
+
+        // 更新按钮状态
+        setButtonsEnabled(true);
+
+        // 更新状态标签
+        String oprnoDisplay;
+        if (isAllStation) {
+            oprnoDisplay = (queryOprno == null || queryOprno.isEmpty()) ? "所有工位" : queryOprno;
+        } else {
+            oprnoDisplay = oprno;
+        }
+        statusLabel.setText("工位:" + oprnoDisplay + " 共" + totalCount + "条");
+
+        // 填充表格数据
+        List<WorkRecordData> list = resp.getList();
+        if (list != null && !list.isEmpty()) {
+            for (WorkRecordData data : list) {
+                Object[] row = {
+                        data.getSn(),
+                        data.getOprno(),
+                        data.getContent(),
+                        data.getUpdateBy(),
+                        data.getUpdateDate()
+                };
+                tableModel.addRow(row);
+            }
+        }
+
+        // 刷新表格
+        table.repaint();
+    }
+
+    /**
+     * 更新UI显示错误信息
+     */
+    private void updateUIError(String message) {
+        statusLabel.setText("错误: " + message);
+        pageLabel.setText("0/0");
+        setButtonsEnabled(true);
+        btnPrevious.setEnabled(false);
+        btnNext.setEnabled(false);
+        tableModel.setRowCount(0);
+    }
+
+    /**
+     * 获取当前工位号
+     */
+    public String getOprno() {
+        return oprno;
+    }
+}

+ 63 - 0
src/com/mes/ui/WorkRecordResp.java

@@ -0,0 +1,63 @@
+package com.mes.ui;
+
+import java.util.List;
+
+/**
+ * 工作记录查询响应实体类
+ */
+public class WorkRecordResp {
+    private boolean result;
+    private String message;
+    private int pageNo;
+    private int pageSize;
+    private long count;
+    private List<WorkRecordData> list;
+
+    public boolean isResult() {
+        return result;
+    }
+
+    public void setResult(boolean result) {
+        this.result = result;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public int getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(int pageNo) {
+        this.pageNo = pageNo;
+    }
+
+    public int getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(int pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public long getCount() {
+        return count;
+    }
+
+    public void setCount(long count) {
+        this.count = count;
+    }
+
+    public List<WorkRecordData> getList() {
+        return list;
+    }
+
+    public void setList(List<WorkRecordData> list) {
+        this.list = list;
+    }
+}

+ 19 - 0
src/com/mes/util/Base64Utils.java

@@ -0,0 +1,19 @@
+package com.mes.util;
+
+import com.mes.ui.MesClient;
+import org.apache.commons.codec.binary.Base64;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Base64Utils {
+    public static final Logger log =  LoggerFactory.getLogger(Base64Utils.class);
+	public static String getBase64(String str) {
+		// 待编码的二进制数据
+        byte[] binaryData = str.getBytes();
+        // 使用Base64.encodeBase64String进行编码
+        String encodedString = Base64.encodeBase64String(binaryData);
+        // 输出编码后的结果
+        log.info("Base64编码结果: " + encodedString);
+        return encodedString;
+	}
+}

+ 34 - 0
src/com/mes/util/DateLocalUtils.java

@@ -0,0 +1,34 @@
+package com.mes.util;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class DateLocalUtils {
+	public static SimpleDateFormat DATA_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//璁剧疆鏃ユ湡鏍煎紡
+	public static SimpleDateFormat DATA_FORMAT1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+	
+	
+	public static String getCurrentTime() {
+		String currentTime = DATA_FORMAT.format(new Date());
+		return currentTime;
+	}
+	
+	public static String getCurrentTime1() {
+		String currentTime = DATA_FORMAT1.format(new Date());
+		return currentTime;
+	}
+	
+	//获取当前时间,年月日
+	public static SimpleDateFormat DATA_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd");
+	public static String getCurrentDate() {
+		String currentTime = DATA_FORMAT2.format(new Date());
+		return currentTime;
+	}
+	
+	//获取当前时间,时分秒
+	public static SimpleDateFormat DATA_FORMAT3 = new SimpleDateFormat("HH:mm:ss");
+	public static String getCurrentTimeHMS() {
+		String currentTime = DATA_FORMAT3.format(new Date());
+		return currentTime;
+	}
+}

+ 45 - 0
src/com/mes/util/ErrorMsg.java

@@ -0,0 +1,45 @@
+package com.mes.util;
+
+public class ErrorMsg {
+    public static String getErrorMsg(String processMsgRet,String lx){
+        String lmsg = "该工件本工位不可加工";
+        try{
+            if(processMsgRet.equalsIgnoreCase("OK")||processMsgRet.equalsIgnoreCase("NG")) {
+                lmsg = "该工件本工位已加工,结果:"+processMsgRet;
+            }else if(processMsgRet.equalsIgnoreCase("NE")) {
+                lmsg = "该工件未录入系统";
+            }else if(processMsgRet.equalsIgnoreCase("NN")) {
+                lmsg = "该工件跳过该工位";
+            }else if(processMsgRet.equalsIgnoreCase("QN")) {
+                lmsg = "该工件OP"+ lx+"0加工NG";
+            }else if(processMsgRet.equalsIgnoreCase("QD")) {
+                lmsg = "该工件OP"+ lx+"0未加工";
+            }else if(processMsgRet.equalsIgnoreCase("NF")) {
+                lmsg = "该工件已合格下线";
+            }else if(processMsgRet.equalsIgnoreCase("NR")) {
+                lmsg = "该工件离线返修中";
+            }else if(processMsgRet.equalsIgnoreCase("NB")) {
+                lmsg = "该工件已报废";
+            }else if(processMsgRet.equalsIgnoreCase("ND")) {
+                lmsg = "该工件NG待处理";
+            }else if(processMsgRet.equalsIgnoreCase("FN")) {
+                lmsg = "首件检查工件不合格停机";
+            }else if(processMsgRet.equalsIgnoreCase("GN")) {
+                lmsg = "更换配件首件检查不合格停机";
+            }else if(processMsgRet.equalsIgnoreCase("DJ")) {
+                lmsg = "未进行开班点检";
+            }else if(processMsgRet.equalsIgnoreCase("BM")) {
+                lmsg = "未绑定物料";
+            }else if(processMsgRet.equalsIgnoreCase("PL")) {
+                lmsg = "配件寿命不足";
+            }else if(processMsgRet.equalsIgnoreCase("QM")) {
+                lmsg = "两次气密必须间隔15分钟";
+            }else if(processMsgRet.equalsIgnoreCase("GS")) {
+                lmsg = "工件码格式不正确";
+            }else if(processMsgRet.equalsIgnoreCase("CF")) {
+                lmsg = "工件码重复";
+            }
+        }catch (Exception e){ }
+        return lmsg;
+    }
+}

+ 164 - 0
src/com/mes/util/HttpUtils.java

@@ -0,0 +1,164 @@
+package com.mes.util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.*;
+import java.net.HttpURLConnection;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+public class HttpUtils {
+
+    public static final Logger log =  LoggerFactory.getLogger(HttpUtils.class);
+	/**
+	 * HTTP请求,正确报文解析,并保存数据到生产记录数据
+	 * @return 
+	 * @throws URISyntaxException
+	 */
+    //http post请求
+    public static String sendRequest(String urlParam) {
+		String requestType = "POST";
+        //根据接收内容返回数据结果
+    	String ret = "";
+    	log.info(urlParam);
+        HttpURLConnection con = null;
+        BufferedReader buffer = null;
+        StringBuffer resultBuffer = null;
+        try {
+            URL url = new URL(urlParam);
+            //得到连接对象
+            con = (HttpURLConnection) url.openConnection();
+            //设置请求类型
+            con.setRequestMethod(requestType);
+            //设置请求需要返回的数据类型和字符集类型
+            con.setRequestProperty("Content-Type", "application/json;charset=GBK");  
+            //允许写出
+            con.setDoOutput(true);
+            //允许读入
+            con.setDoInput(true);
+            //不使用缓存
+            con.setUseCaches(false);
+            //得到响应码
+            int responseCode = con.getResponseCode();
+            log.info("responseCode="+responseCode);
+            if(responseCode == HttpURLConnection.HTTP_OK){
+                //得到响应流
+                InputStream inputStream = con.getInputStream();
+                //将响应流转换成字符串
+                resultBuffer = new StringBuffer();
+                String line;
+                buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
+                while ((line = buffer.readLine()) != null) {
+                    resultBuffer.append(line);
+                }
+                log.info(resultBuffer.toString());
+                ret = resultBuffer.toString();
+            }else {
+            	//ret = String.valueOf(responseCode);
+            	ret = "false";
+            }
+            con.disconnect();
+        }catch(Exception e) {
+        	//ret = false;
+        	//log.info("e.toString()="+e.toString());
+        	//return e.toString();
+            //e.printStackTrace();
+        	ret = "false";
+        }
+        return ret;
+    }
+
+
+    public static String sendPostRequest(String urlParam, String params) {
+        String requestType = "POST";
+        //根据接收内容返回数据结果
+        String ret = "";
+        log.info(urlParam);
+        HttpURLConnection con = null;
+        BufferedReader buffer = null;
+        StringBuffer resultBuffer = null;
+        try {
+            URL url = new URL(urlParam);
+            //得到连接对象
+            con = (HttpURLConnection) url.openConnection();
+            //设置请求类型
+            con.setRequestMethod(requestType);
+            //设置请求需要返回的数据类型和字符集类型
+            con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=GBK");
+            //允许写出
+            con.setDoOutput(true);
+            //允许读入
+            con.setDoInput(true);
+            //不使用缓存
+            con.setUseCaches(false);
+
+            // 获取URLConnection对象对应的输出流
+            OutputStreamWriter out = new OutputStreamWriter( con.getOutputStream(),"UTF-8");// utf-8编码
+            // 发送请求参数
+            out.write(params);
+
+            //得到响应码
+            int responseCode = con.getResponseCode();
+            log.info("responseCode="+responseCode);
+            if(responseCode == HttpURLConnection.HTTP_OK){
+                //得到响应流
+                InputStream inputStream = con.getInputStream();
+                //将响应流转换成字符串
+                resultBuffer = new StringBuffer();
+                String line;
+                buffer = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
+                while ((line = buffer.readLine()) != null) {
+                    resultBuffer.append(line);
+                }
+                log.info(resultBuffer.toString());
+                ret = resultBuffer.toString();
+            }else {
+                //ret = String.valueOf(responseCode);
+                ret = "false";
+            }
+            con.disconnect();
+        }catch(Exception e) {
+            //ret = false;
+            //log.info("e.toString()="+e.toString());
+            //return e.toString();
+            //e.printStackTrace();
+            ret = "false";
+        }
+        return ret;
+    }
+
+    public static String sendPostRequestJson(String apiUrl, String jsonData) throws IOException {
+        URL url = new URL(apiUrl);
+        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
+        conn.setRequestMethod("POST");
+        conn.setRequestProperty("Content-Type", "application/json");
+        conn.setDoOutput(true);
+
+        // 发送请求数据
+        try (OutputStream os = conn.getOutputStream()) {
+            byte[] input = jsonData.getBytes("utf-8");
+            os.write(input, 0, input.length);
+        }
+
+        // 获取响应数据
+        StringBuilder response = new StringBuilder();
+        int responseCode = conn.getResponseCode();
+//        System.out.println("Sending POST request to URL: " + apiUrl);
+//        System.out.println("Post parameters: " + jsonData);
+//        System.out.println("Response Code: " + responseCode);
+
+        try (BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"))) {
+            String responseLine;
+            while ((responseLine = br.readLine()) != null) {
+                response.append(responseLine.trim());
+            }
+        }
+
+        conn.disconnect();
+        return response.toString();
+    }
+
+	
+
+}

+ 128 - 0
src/com/mes/util/InovancePlcUtil.java

@@ -0,0 +1,128 @@
+package com.mes.util;
+
+import com.github.xingshuangs.iot.protocol.modbus.service.ModbusTcp;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+
+/**
+ * 汇川 PLC Modbus TCP 读写工具(线程安全,单连接串行访问)。
+ */
+public class InovancePlcUtil {
+
+    public static final Logger log = LoggerFactory.getLogger(InovancePlcUtil.class);
+
+    private static final Object PLC_LOCK = new Object();
+    private static final int MAX_STRING_LENGTH = 80;
+
+    private static long lastErrorLogMs = 0;
+    private static int consecutiveErrors = 0;
+
+    public static List<Boolean> readCoils(ModbusTcp plc, int address, int count) {
+        if (plc == null) {
+            return java.util.Collections.emptyList();
+        }
+        synchronized (PLC_LOCK) {
+            try {
+                List<Boolean> values = plc.readCoil(address, count);
+                onSuccess();
+                return values != null ? values : java.util.Collections.emptyList();
+            } catch (Exception e) {
+                onError("读取M" + address + "起" + count + "个失败", e);
+                return java.util.Collections.emptyList();
+            }
+        }
+    }
+
+    public static boolean readCoil(ModbusTcp plc, int address) {
+        if (plc == null) {
+            return false;
+        }
+        synchronized (PLC_LOCK) {
+            try {
+                List<Boolean> values = plc.readCoil(address, 1);
+                onSuccess();
+                return values != null && !values.isEmpty() && values.get(0);
+            } catch (Exception e) {
+                onError("读取M" + address + "失败", e);
+                return false;
+            }
+        }
+    }
+
+    public static boolean writeCoil(ModbusTcp plc, int address, boolean value) {
+        if (plc == null) {
+            return false;
+        }
+        synchronized (PLC_LOCK) {
+            try {
+                plc.writeCoil(address, value);
+                onSuccess();
+                return true;
+            } catch (Exception e) {
+                onError("写入M" + address + "失败", e);
+                return false;
+            }
+        }
+    }
+
+    /**
+     * 读取汇川 D 区 STRING:从 D 地址直接读字符,每寄存器低字节+高字节,遇 0x00 结束。
+     * (D5000 起即为字符内容,不是长度头)
+     */
+    public static String readString(ModbusTcp plc, int dAddress) {
+        if (plc == null) {
+            return "";
+        }
+        synchronized (PLC_LOCK) {
+            try {
+                String result = readDirectString(plc, dAddress);
+                onSuccess();
+                log.info("D{} 解码结果: [{}]", dAddress, result);
+                return result;
+            } catch (Exception e) {
+                onError("读取D" + dAddress + "失败", e);
+                return "";
+            }
+        }
+    }
+
+    private static String readDirectString(ModbusTcp plc, int dAddress) {
+        StringBuilder sb = new StringBuilder(MAX_STRING_LENGTH);
+        for (int regIndex = 0; regIndex < 40 && sb.length() < MAX_STRING_LENGTH; regIndex++) {
+            short reg = plc.readInt16(dAddress + regIndex);
+            if (!appendAsciiChar(sb, reg & 0xFF)) {
+                break;
+            }
+            if (!appendAsciiChar(sb, (reg >> 8) & 0xFF)) {
+                break;
+            }
+        }
+        return sb.toString();
+    }
+
+    private static boolean appendAsciiChar(StringBuilder sb, int charValue) {
+        if (charValue == 0) {
+            return false;
+        }
+        if (charValue >= 32 && charValue < 127) {
+            sb.append((char) charValue);
+            return true;
+        }
+        return false;
+    }
+
+    private static void onSuccess() {
+        consecutiveErrors = 0;
+    }
+
+    private static void onError(String message, Exception e) {
+        consecutiveErrors++;
+        long now = System.currentTimeMillis();
+        if (now - lastErrorLogMs > 10000) {
+            log.error("{}(近{}次失败,请检查PLC IP/网络)", message, consecutiveErrors, e);
+            lastErrorLogMs = now;
+        }
+    }
+}

+ 0 - 0
src/com/mes/util/JdbcUtils.java


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels