|
@@ -84,6 +84,9 @@ public class MesClient extends JFrame {
|
|
|
public static MesWebView jfxPanel = null;
|
|
public static MesWebView jfxPanel = null;
|
|
|
public static JPanel indexPanelC;
|
|
public static JPanel indexPanelC;
|
|
|
public static JPanel indexPanelD;
|
|
public static JPanel indexPanelD;
|
|
|
|
|
+ public static JPanel indexPanelCheck; // 开班点检页签面板(独立于「记录查询」)
|
|
|
|
|
+ public static JPanel panelCheck; // 点检 WebView 容器
|
|
|
|
|
+ public static JLabel labCheckTitle; // 显示当前点检工位号
|
|
|
public static MesWebView jfxPanel2 = null;
|
|
public static MesWebView jfxPanel2 = null;
|
|
|
public static MesWebView jfxPanel3 = null;
|
|
public static MesWebView jfxPanel3 = null;
|
|
|
public static MesRadio mesRadioHj;
|
|
public static MesRadio mesRadioHj;
|
|
@@ -167,7 +170,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
// resetScanA();
|
|
// resetScanA();
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
- log.error(e.getMessage());
|
|
|
|
|
|
|
+ log.error("启动初始化异常", e);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -1233,6 +1236,16 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
tabbedPane.addTab("记录查询", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPaneDj, null);
|
|
tabbedPane.addTab("记录查询", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPaneDj, null);
|
|
|
|
|
|
|
|
|
|
+ // 开班点检页签:独立于「记录查询」,工位号从软件设置(configParam)读取
|
|
|
|
|
+ indexPanelCheck = new JPanel(new BorderLayout());
|
|
|
|
|
+ indexPanelCheck.setPreferredSize(new Dimension(990, 550));
|
|
|
|
|
+ labCheckTitle = new JLabel("开班点检(工位号读取软件设置)", JLabel.CENTER);
|
|
|
|
|
+ indexPanelCheck.add(labCheckTitle, BorderLayout.NORTH);
|
|
|
|
|
+ panelCheck = new JPanel(new BorderLayout());
|
|
|
|
|
+ indexPanelCheck.add(panelCheck, BorderLayout.CENTER);
|
|
|
|
|
+ JScrollPane searchScrollPaneCheck = new JScrollPane(indexPanelCheck);
|
|
|
|
|
+ tabbedPane.addTab("开班点检", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPaneCheck, null);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// indexPanelB = new JPanel();
|
|
// indexPanelB = new JPanel();
|
|
|
// searchScrollPane = new JScrollPane(indexPanelB);
|
|
// searchScrollPane = new JScrollPane(indexPanelB);
|
|
@@ -1249,10 +1262,15 @@ public class MesClient extends JFrame {
|
|
|
indexPanelD.setLayout(null);
|
|
indexPanelD.setLayout(null);
|
|
|
|
|
|
|
|
PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
|
|
PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null);
|
|
|
- String[] printerNames = (printServices != null && printServices.length > 0) ?
|
|
|
|
|
- new String[printServices.length] : new String[]{"未知"};
|
|
|
|
|
- for (int i = 0; i < printerNames.length; i++) {
|
|
|
|
|
- printerNames[i] = printServices[i].getName();
|
|
|
|
|
|
|
+ String[] printerNames;
|
|
|
|
|
+ if (printServices != null && printServices.length > 0) {
|
|
|
|
|
+ printerNames = new String[printServices.length];
|
|
|
|
|
+ for (int i = 0; i < printServices.length; i++) {
|
|
|
|
|
+ printerNames[i] = printServices[i].getName();
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 本机未检测到打印机:用占位项,避免用 printerNames.length 索引空数组导致越界
|
|
|
|
|
+ printerNames = new String[]{"未知"};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
JLabel lblNewLabel_3 = new JLabel("设备程序号");
|
|
JLabel lblNewLabel_3 = new JLabel("设备程序号");
|
|
@@ -1937,11 +1955,54 @@ public class MesClient extends JFrame {
|
|
|
if(selectedIndex == 1){
|
|
if(selectedIndex == 1){
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ // 切到「开班点检」页签时按当前软件设置重新加载,保证工位号改动即时生效
|
|
|
|
|
+ if(selectedIndex >= 0 && "开班点检".equals(tabbedPane.getTitleAt(selectedIndex))){
|
|
|
|
|
+ refreshCheckPage();
|
|
|
|
|
+ }
|
|
|
JdbcUtils.getTestData();
|
|
JdbcUtils.getTestData();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 加载/刷新「开班点检」页面:工位号与产线号均取自软件设置(configParam),
|
|
|
|
|
+ * 而不是 config.properties 里写死的 mes.gw。未配置时才回退到 mes.gw / mes_line_sn。
|
|
|
|
|
+ */
|
|
|
|
|
+ public static void refreshCheckPage(){
|
|
|
|
|
+ if(sessionid == null || sessionid.isEmpty()) return; // 未登录不加载
|
|
|
|
|
+ if(configParam == null) return;
|
|
|
|
|
+
|
|
|
|
|
+ String oprno = configParam.getOprno();
|
|
|
|
|
+ if(oprno == null || oprno.trim().isEmpty()){
|
|
|
|
|
+ // 不回退到 config.properties 的 mes_gw,避免把点检记录提交到错误工位
|
|
|
|
|
+ if(labCheckTitle != null){
|
|
|
|
|
+ labCheckTitle.setText("开班点检 - 未配置工位号,请在「软件设置」中配置后切回本页签");
|
|
|
|
|
+ }
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ String lineSn = configParam.getLineSn();
|
|
|
|
|
+ if(lineSn == null || lineSn.trim().isEmpty()) lineSn = mes_line_sn;
|
|
|
|
|
+
|
|
|
|
|
+ String url = "http://" + mes_server_ip + ":8980/js/a/mes/mesProcessCheckRecord/ulist?__sid="
|
|
|
|
|
+ + sessionid + "&oprno=" + oprno.trim() + "&lineSn=" + lineSn.trim();
|
|
|
|
|
+ if(labCheckTitle != null){
|
|
|
|
|
+ labCheckTitle.setText("开班点检 - 工位号:" + oprno.trim() + "(来自软件设置)");
|
|
|
|
|
+ }
|
|
|
|
|
+ try {
|
|
|
|
|
+ if(jfxPanel2 == null){
|
|
|
|
|
+ jfxPanel2 = new MesWebView(url);
|
|
|
|
|
+ panelCheck.add(jfxPanel2, BorderLayout.CENTER);
|
|
|
|
|
+ panelCheck.revalidate();
|
|
|
|
|
+ panelCheck.repaint();
|
|
|
|
|
+ }else{
|
|
|
|
|
+ jfxPanel2.loadUrl(url);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
|
+ System.err.println("开班点检页面加载失败: " + ex.getMessage());
|
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public static void setMenuStatus(String msg,int error){
|
|
public static void setMenuStatus(String msg,int error){
|
|
|
if(error == 0){
|
|
if(error == 0){
|
|
|
MesClient.status_menu.setForeground(Color.GREEN);
|
|
MesClient.status_menu.setForeground(Color.GREEN);
|