Pārlūkot izejas kodu

绑定前梁压铸码

dkk 5 dienas atpakaļ
vecāks
revīzija
22f8eca4f3
2 mainītis faili ar 244 papildinājumiem un 209 dzēšanām
  1. 241 204
      src/com/mes/ui/MesClient.java
  2. 3 5
      src/com/mes/ui/MesRevice.java

+ 241 - 204
src/com/mes/ui/MesClient.java

@@ -457,9 +457,8 @@ public class MesClient extends JFrame {
         MesClient.tjFlaga = 0;
         MesClient.checkA = 0;
 
-//        MesClient.batch_status = 0;
-//        MesClient.textField.setText("");
-//        MesClient.batch_scan_1.setEnabled(false);
+        MesClient.textField.setText("");
+        MesClient.batch_scan_1.setEnabled(false);
         MesClient.formatScanType(1);
        PlcUtil.changeEnable(MesClient.s7PLC,false);
 
@@ -518,9 +517,8 @@ public class MesClient extends JFrame {
         MesClient.tjFlagb = 0;
         MesClient.checkB = 0;
 
-//        MesClient.batch_status2 = 0;
-//        MesClient.textField_1.setText("");
-//        MesClient.batch_scan_2.setEnabled(false);
+        MesClient.textField_1.setText("");
+        MesClient.batch_scan_2.setEnabled(false);
         MesClient.formatScanType(1);
         PlcUtil.changeEnable(MesClient.s7PLC,false);
         finish_ok_bt2.setEnabled(false);
@@ -1007,90 +1005,90 @@ public class MesClient extends JFrame {
         finish_ng_bt2.setEnabled(false);
 //        indexPanelA.add(finish_ng_bt2);
 
-        JLabel lblNewLabel = new JLabel("电压");
-        lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel.setBounds(26, 340, 100, 40);
-        lblNewLabel.setVisible(true);
-        indexPanelA.add(lblNewLabel);
-
-        JLabel lblNewLabel_1 = new JLabel("电流");
-        lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_1.setBounds(226, 340, 100, 40);
-        lblNewLabel_1.setVisible(true);
-        indexPanelA.add(lblNewLabel_1);
-
-        param1 = new JTextField();
-        param1.setEnabled(false);
-        param1.setEditable(false);
-        param1.setHorizontalAlignment(SwingConstants.CENTER);
-        param1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param1.setBounds(136, 340, 70, 40);
-        param1.setVisible(true);
-        indexPanelA.add(param1);
-        param1.setColumns(10);
-
-        param2 = new JTextField();
-        param2.setEnabled(false);
-        param2.setEditable(false);
-        param2.setHorizontalAlignment(SwingConstants.CENTER);
-        param2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param2.setColumns(10);
-        param2.setBounds(345, 340, 70, 40);
-        param2.setVisible(true);
-        indexPanelA.add(param2);
-
-        JLabel lblNewLabel_2 = new JLabel("送丝速度");
-        lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_2.setBounds(26, 401, 100, 40);
-        lblNewLabel_2.setVisible(true);
-        indexPanelA.add(lblNewLabel_2);
-
-        param3 = new JTextField();
-        param3.setEnabled(false);
-        param3.setEditable(false);
-        param3.setHorizontalAlignment(SwingConstants.CENTER);
-        param3.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param3.setColumns(10);
-        param3.setBounds(136, 401, 70, 40);
-        param3.setVisible(true);
-        indexPanelA.add(param3);
-
-        JLabel lblNewLabel_1_1 = new JLabel("错误代码");
-        lblNewLabel_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_1_1.setBounds(213, 401, 122, 40);
-        lblNewLabel_1_1.setVisible(true);
-        indexPanelA.add(lblNewLabel_1_1);
-
-        param4 = new JTextField();
-        param4.setEnabled(false);
-        param4.setEditable(false);
-        param4.setHorizontalAlignment(SwingConstants.CENTER);
-        param4.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param4.setColumns(10);
-        param4.setBounds(345, 401, 70, 40);
-        param4.setVisible(true);
-        indexPanelA.add(param4);
-
-        param5 = new JTextField();
-        param5.setEnabled(false);
-        param5.setEditable(false);
-        param5.setHorizontalAlignment(SwingConstants.CENTER);
-        param5.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param5.setColumns(10);
-        param5.setBounds(226, 470, 70, 40);
-        param5.setVisible(true);
-        indexPanelA.add(param5);
-
-        JLabel lblNewLabel_1_1_1 = new JLabel("JOB号");
-        lblNewLabel_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_1_1_1.setBounds(106, 470, 122, 40);
-        lblNewLabel_1_1_1.setVisible(true);
-        indexPanelA.add(lblNewLabel_1_1_1);
+//        JLabel lblNewLabel = new JLabel("电压");
+//        lblNewLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel.setBounds(26, 340, 100, 40);
+//        lblNewLabel.setVisible(true);
+//        indexPanelA.add(lblNewLabel);
+//
+//        JLabel lblNewLabel_1 = new JLabel("电流");
+//        lblNewLabel_1.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_1.setBounds(226, 340, 100, 40);
+//        lblNewLabel_1.setVisible(true);
+//        indexPanelA.add(lblNewLabel_1);
+//
+//        param1 = new JTextField();
+//        param1.setEnabled(false);
+//        param1.setEditable(false);
+//        param1.setHorizontalAlignment(SwingConstants.CENTER);
+//        param1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param1.setBounds(136, 340, 70, 40);
+//        param1.setVisible(true);
+//        indexPanelA.add(param1);
+//        param1.setColumns(10);
+//
+//        param2 = new JTextField();
+//        param2.setEnabled(false);
+//        param2.setEditable(false);
+//        param2.setHorizontalAlignment(SwingConstants.CENTER);
+//        param2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param2.setColumns(10);
+//        param2.setBounds(345, 340, 70, 40);
+//        param2.setVisible(true);
+//        indexPanelA.add(param2);
+//
+//        JLabel lblNewLabel_2 = new JLabel("送丝速度");
+//        lblNewLabel_2.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_2.setBounds(26, 401, 100, 40);
+//        lblNewLabel_2.setVisible(true);
+//        indexPanelA.add(lblNewLabel_2);
+//
+//        param3 = new JTextField();
+//        param3.setEnabled(false);
+//        param3.setEditable(false);
+//        param3.setHorizontalAlignment(SwingConstants.CENTER);
+//        param3.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param3.setColumns(10);
+//        param3.setBounds(136, 401, 70, 40);
+//        param3.setVisible(true);
+//        indexPanelA.add(param3);
+//
+//        JLabel lblNewLabel_1_1 = new JLabel("错误代码");
+//        lblNewLabel_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_1_1.setBounds(213, 401, 122, 40);
+//        lblNewLabel_1_1.setVisible(true);
+//        indexPanelA.add(lblNewLabel_1_1);
+//
+//        param4 = new JTextField();
+//        param4.setEnabled(false);
+//        param4.setEditable(false);
+//        param4.setHorizontalAlignment(SwingConstants.CENTER);
+//        param4.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param4.setColumns(10);
+//        param4.setBounds(345, 401, 70, 40);
+//        param4.setVisible(true);
+//        indexPanelA.add(param4);
+//
+//        param5 = new JTextField();
+//        param5.setEnabled(false);
+//        param5.setEditable(false);
+//        param5.setHorizontalAlignment(SwingConstants.CENTER);
+//        param5.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param5.setColumns(10);
+//        param5.setBounds(226, 470, 70, 40);
+//        param5.setVisible(true);
+//        indexPanelA.add(param5);
+//
+//        JLabel lblNewLabel_1_1_1 = new JLabel("JOB号");
+//        lblNewLabel_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_1_1_1.setBounds(106, 470, 122, 40);
+//        lblNewLabel_1_1_1.setVisible(true);
+//        indexPanelA.add(lblNewLabel_1_1_1);
 
         product_sn2 = new JTextField();
         product_sn2.setText("");
@@ -1110,90 +1108,90 @@ public class MesClient extends JFrame {
         separator_1.setBounds(495, 91, 23, 250);
         indexPanelA.add(separator_1);
 
-        JLabel lblNewLabel_3 = new JLabel("电压");
-        lblNewLabel_3.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_3.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_3.setBounds(528, 340, 100, 40);
-        lblNewLabel_3.setVisible(true);
-        indexPanelA.add(lblNewLabel_3);
-
-        param21 = new JTextField();
-        param21.setEnabled(false);
-        param21.setEditable(false);
-        param21.setHorizontalAlignment(SwingConstants.CENTER);
-        param21.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param21.setColumns(10);
-        param21.setBounds(638, 340, 70, 40);
-        param21.setVisible(true);
-        indexPanelA.add(param21);
-
-        JLabel lblNewLabel_1_2 = new JLabel("电流");
-        lblNewLabel_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_1_2.setBounds(742, 340, 100, 40);
-        lblNewLabel_1_2.setVisible(true);
-        indexPanelA.add(lblNewLabel_1_2);
-
-        param22 = new JTextField();
-        param22.setEnabled(false);
-        param22.setEditable(false);
-        param22.setHorizontalAlignment(SwingConstants.CENTER);
-        param22.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param22.setColumns(10);
-        param22.setBounds(852, 340, 70, 40);
-        param22.setVisible(true);
-        indexPanelA.add(param22);
-
-        JLabel lblNewLabel_2_1 = new JLabel("送丝速度");
-        lblNewLabel_2_1.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_2_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_2_1.setBounds(528, 401, 100, 40);
-        lblNewLabel_2_1.setVisible(true);
-        indexPanelA.add(lblNewLabel_2_1);
-
-        param23 = new JTextField();
-        param23.setEnabled(false);
-        param23.setEditable(false);
-        param23.setHorizontalAlignment(SwingConstants.CENTER);
-        param23.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param23.setColumns(10);
-        param23.setBounds(638, 401, 70, 40);
-        param23.setVisible(true);
-        indexPanelA.add(param23);
-
-        JLabel lblNewLabel_1_1_2 = new JLabel("错误代码");
-        lblNewLabel_1_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_1_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_1_1_2.setBounds(718, 401, 122, 40);
-        lblNewLabel_1_1_2.setVisible(true);
-        indexPanelA.add(lblNewLabel_1_1_2);
-
-        param24 = new JTextField();
-        param24.setEnabled(false);
-        param24.setEditable(false);
-        param24.setHorizontalAlignment(SwingConstants.CENTER);
-        param24.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param24.setColumns(10);
-        param24.setBounds(852, 401, 70, 40);
-        param24.setVisible(true);
-        indexPanelA.add(param24);
-
-        JLabel lblNewLabel_1_1_1_1 = new JLabel("JOB号");
-        lblNewLabel_1_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
-        lblNewLabel_1_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        lblNewLabel_1_1_1_1.setBounds(609, 470, 122, 40);
-        lblNewLabel_1_1_1_1.setVisible(true);
-        indexPanelA.add(lblNewLabel_1_1_1_1);
-
-        param25 = new JTextField();
-        param25.setEnabled(false);
-        param25.setEditable(false);
-        param25.setHorizontalAlignment(SwingConstants.CENTER);
-        param25.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
-        param25.setColumns(10);
-        param25.setBounds(742, 470, 70, 40);
-        param25.setVisible(true);
-        indexPanelA.add(param25);
+//        JLabel lblNewLabel_3 = new JLabel("电压");
+//        lblNewLabel_3.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_3.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_3.setBounds(528, 340, 100, 40);
+//        lblNewLabel_3.setVisible(true);
+//        indexPanelA.add(lblNewLabel_3);
+//
+//        param21 = new JTextField();
+//        param21.setEnabled(false);
+//        param21.setEditable(false);
+//        param21.setHorizontalAlignment(SwingConstants.CENTER);
+//        param21.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param21.setColumns(10);
+//        param21.setBounds(638, 340, 70, 40);
+//        param21.setVisible(true);
+//        indexPanelA.add(param21);
+//
+//        JLabel lblNewLabel_1_2 = new JLabel("电流");
+//        lblNewLabel_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_1_2.setBounds(742, 340, 100, 40);
+//        lblNewLabel_1_2.setVisible(true);
+//        indexPanelA.add(lblNewLabel_1_2);
+//
+//        param22 = new JTextField();
+//        param22.setEnabled(false);
+//        param22.setEditable(false);
+//        param22.setHorizontalAlignment(SwingConstants.CENTER);
+//        param22.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param22.setColumns(10);
+//        param22.setBounds(852, 340, 70, 40);
+//        param22.setVisible(true);
+//        indexPanelA.add(param22);
+//
+//        JLabel lblNewLabel_2_1 = new JLabel("送丝速度");
+//        lblNewLabel_2_1.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_2_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_2_1.setBounds(528, 401, 100, 40);
+//        lblNewLabel_2_1.setVisible(true);
+//        indexPanelA.add(lblNewLabel_2_1);
+//
+//        param23 = new JTextField();
+//        param23.setEnabled(false);
+//        param23.setEditable(false);
+//        param23.setHorizontalAlignment(SwingConstants.CENTER);
+//        param23.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param23.setColumns(10);
+//        param23.setBounds(638, 401, 70, 40);
+//        param23.setVisible(true);
+//        indexPanelA.add(param23);
+//
+//        JLabel lblNewLabel_1_1_2 = new JLabel("错误代码");
+//        lblNewLabel_1_1_2.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_1_1_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_1_1_2.setBounds(718, 401, 122, 40);
+//        lblNewLabel_1_1_2.setVisible(true);
+//        indexPanelA.add(lblNewLabel_1_1_2);
+//
+//        param24 = new JTextField();
+//        param24.setEnabled(false);
+//        param24.setEditable(false);
+//        param24.setHorizontalAlignment(SwingConstants.CENTER);
+//        param24.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param24.setColumns(10);
+//        param24.setBounds(852, 401, 70, 40);
+//        param24.setVisible(true);
+//        indexPanelA.add(param24);
+//
+//        JLabel lblNewLabel_1_1_1_1 = new JLabel("JOB号");
+//        lblNewLabel_1_1_1_1.setHorizontalAlignment(SwingConstants.RIGHT);
+//        lblNewLabel_1_1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        lblNewLabel_1_1_1_1.setBounds(609, 470, 122, 40);
+//        lblNewLabel_1_1_1_1.setVisible(true);
+//        indexPanelA.add(lblNewLabel_1_1_1_1);
+//
+//        param25 = new JTextField();
+//        param25.setEnabled(false);
+//        param25.setEditable(false);
+//        param25.setHorizontalAlignment(SwingConstants.CENTER);
+//        param25.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 18));
+//        param25.setColumns(10);
+//        param25.setBounds(742, 470, 70, 40);
+//        param25.setVisible(true);
+//        indexPanelA.add(param25);
 
         pxstatus1 = new JLabel("A");
         pxstatus1.setForeground(new Color(255, 128, 64));
@@ -1213,19 +1211,19 @@ public class MesClient extends JFrame {
         separator_2.setBounds(10, 264, 973, 13);
         indexPanelA.add(separator_2);
 
-        JLabel lblNewLabel_4 = new JLabel("焊机1");
-        lblNewLabel_4.setHorizontalAlignment(SwingConstants.CENTER);
-        lblNewLabel_4.setFont(new Font("微软雅黑", Font.PLAIN, 24));
-        lblNewLabel_4.setBounds(170, 290, 156, 40);
-        lblNewLabel_4.setVisible(true);
-        indexPanelA.add(lblNewLabel_4);
-
-        JLabel lblNewLabel_4_1 = new JLabel("焊机2");
-        lblNewLabel_4_1.setHorizontalAlignment(SwingConstants.CENTER);
-        lblNewLabel_4_1.setFont(new Font("微软雅黑", Font.PLAIN, 24));
-        lblNewLabel_4_1.setBounds(670, 287, 156, 40);
-        lblNewLabel_4_1.setVisible(true);
-        indexPanelA.add(lblNewLabel_4_1);
+//        JLabel lblNewLabel_4 = new JLabel("焊机1");
+//        lblNewLabel_4.setHorizontalAlignment(SwingConstants.CENTER);
+//        lblNewLabel_4.setFont(new Font("微软雅黑", Font.PLAIN, 24));
+//        lblNewLabel_4.setBounds(170, 290, 156, 40);
+//        lblNewLabel_4.setVisible(true);
+//        indexPanelA.add(lblNewLabel_4);
+//
+//        JLabel lblNewLabel_4_1 = new JLabel("焊机2");
+//        lblNewLabel_4_1.setHorizontalAlignment(SwingConstants.CENTER);
+//        lblNewLabel_4_1.setFont(new Font("微软雅黑", Font.PLAIN, 24));
+//        lblNewLabel_4_1.setBounds(670, 287, 156, 40);
+//        lblNewLabel_4_1.setVisible(true);
+//        indexPanelA.add(lblNewLabel_4_1);
 
         JSeparator separator_1_1 = new JSeparator();
         separator_1_1.setOrientation(SwingConstants.VERTICAL);
@@ -1239,24 +1237,23 @@ public class MesClient extends JFrame {
         textField.setEditable(false);
         textField.setColumns(10);
         textField.setBounds(26, 333, 446, 70);
-//        indexPanelA.add(textField);
+        indexPanelA.add(textField);
 
         batch_scan_1 = new JButton("解绑");
         batch_scan_1.setIcon(new ImageIcon(MesClient.class.getResource("/bg/delete.png")));
         batch_scan_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 32));
         batch_scan_1.setEnabled(false);
-        batch_scan_1.setVisible(false);
         batch_scan_1.setBounds(136, 430, 230, 80);
         batch_scan_1.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                 if(MesClient.curPage.equals("B")){
-                    MesClient.setMenuStatus("该状态后梁无法解绑",-1);
+                    MesClient.setMenuStatus("该状态前梁压铸无法解绑",-1);
                 }else{
                     String sn = MesClient.product_sn.getText().trim();
                     String wsn = MesClient.textField.getText().trim();
-                    JSONObject retObj = DataUtil.unBindWarehouseData(sn,wsn,user_menu.getText().trim(),"400007");
+                    JSONObject retObj = DataUtil.unBindWarehouseData(sn,wsn,user_menu.getText().trim(),"400002");
                     if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
-                        MesClient.setMenuStatus("后梁码解绑成功",0);
+                        MesClient.setMenuStatus("前梁压铸码解绑成功",0);
                         MesClient.formatScanType(2);
 
                         textField.setText("");
@@ -1266,7 +1263,7 @@ public class MesClient extends JFrame {
                         MesClient.formatScanType(2);
                         batch_scan_1.setEnabled(true);
                         if(retObj.get("result")==null){
-                            MesClient.setMenuStatus("请求失败,后梁码解绑失败,请重试",-1);
+                            MesClient.setMenuStatus("请求失败,前梁压铸码解绑失败,请重试",-1);
                         }else{
                             if(retObj.get("result").toString().equalsIgnoreCase("false")){
                                 MesClient.setMenuStatus(retObj.getString("message"),-1);
@@ -1285,31 +1282,30 @@ public class MesClient extends JFrame {
         textField_1.setEditable(false);
         textField_1.setColumns(10);
         textField_1.setBounds(517, 333, 446, 70);
-//        indexPanelA.add(textField_1);
+        indexPanelA.add(textField_1);
 
         batch_scan_2 = new JButton("解绑");
         batch_scan_2.setIcon(new ImageIcon(MesClient.class.getResource("/bg/delete.png")));
         batch_scan_2.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 32));
         batch_scan_2.setEnabled(false);
-        batch_scan_2.setVisible(false);
         batch_scan_2.setBounds(633, 430, 230, 80);
         batch_scan_2.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                 if(MesClient.curPage.equals("A")){
-                    MesClient.setMenuStatus("该状态后梁无法解绑",-1);
+                    MesClient.setMenuStatus("该状态前梁压铸无法解绑",-1);
                 }else{
                     String sn = MesClient.product_sn2.getText().trim();
                     String wsn = MesClient.textField_1.getText().trim();
-                    JSONObject retObj = DataUtil.unBindWarehouseData(sn,wsn,user_menu.getText().trim(),"400007");
+                    JSONObject retObj = DataUtil.unBindWarehouseData(sn,wsn,user_menu.getText().trim(),"400002");
                     if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
-                        MesClient.setMenuStatus("后梁码解绑成功",0);
+                        MesClient.setMenuStatus("前梁压铸码解绑成功",0);
                         MesClient.formatScanType(2);
                         textField_1.setText("");
                         batch_scan_2.setEnabled(false);
                         PlcUtil.changeEnable(s7PLC,false);
                     }else{
                         if(retObj.get("result")==null){
-                            MesClient.setMenuStatus("请求失败,前梁码解绑失败,请重试",-1);
+                            MesClient.setMenuStatus("请求失败,前梁压铸码解绑失败,请重试",-1);
                         }else{
                             if(retObj.get("result").toString().equalsIgnoreCase("false")){
                                 MesClient.setMenuStatus(retObj.getString("message"),-1);
@@ -1321,19 +1317,19 @@ public class MesClient extends JFrame {
         });
         indexPanelA.add(batch_scan_2);
 
-        JLabel pxstatus1_1 = new JLabel("A后梁");
+        JLabel pxstatus1_1 = new JLabel("A前梁压铸");
         pxstatus1_1.setHorizontalAlignment(SwingConstants.CENTER);
         pxstatus1_1.setForeground(new Color(0, 0, 0));
         pxstatus1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
         pxstatus1_1.setBounds(26, 283, 446, 44);
-//        indexPanelA.add(pxstatus1_1);
+        indexPanelA.add(pxstatus1_1);
 
-        JLabel pxstatus1_1_1 = new JLabel("B后梁");
+        JLabel pxstatus1_1_1 = new JLabel("B前梁压铸");
         pxstatus1_1_1.setHorizontalAlignment(SwingConstants.CENTER);
         pxstatus1_1_1.setForeground(Color.BLACK);
         pxstatus1_1_1.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
         pxstatus1_1_1.setBounds(517, 283, 446, 44);
-//        indexPanelA.add(pxstatus1_1_1);
+        indexPanelA.add(pxstatus1_1_1);
 
         txtfa = new JTextField();
         txtfa.setHorizontalAlignment(SwingConstants.LEFT);
@@ -1391,7 +1387,7 @@ public class MesClient extends JFrame {
         if(scan_type == 1){
             scan_type_text.setText("镭雕码");
         }else if(scan_type == 2){
-            scan_type_text.setText("后梁码");
+            scan_type_text.setText("前梁压铸码");
         }else{
             scan_type_text.setText("");
         }
@@ -1453,6 +1449,47 @@ public class MesClient extends JFrame {
             }else{
                 MesClient.setMenuStatus("正在校验工件码",0);
             }
+        }else if(MesClient.scan_type == 2){ // 前梁压铸码
+            if(scanBarcodeSn.isEmpty()){
+                MesClient.setMenuStatus("前梁压铸码不能为空",1);
+                return;
+            }
+
+            String sn = "";
+            if(MesClient.curPage.equals("A")){
+                sn = product_sn.getText().trim();
+            }else{
+                sn = product_sn2.getText().trim();
+            }
+
+            if(!checkSnAndBatch(sn,scanBarcodeSn)){
+                MesClient.setMenuStatus("前梁压铸码与工件不匹配",1);
+                return;
+            }
+
+            JSONObject retObj = DataUtil.bindWarehouseData(sn,scanBarcodeSn,user_menu.getText().trim(),"400002");
+            if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
+                MesClient.setMenuStatus("前梁压铸码扫码绑定成功",0);
+                MesClient.formatScanType(1);
+                if(MesClient.curPage.equals("A")){
+                    textField.setText(scanBarcodeSn);
+                    batch_scan_1.setEnabled(true);
+                }else{
+                    textField_1.setText(scanBarcodeSn);
+                    batch_scan_2.setEnabled(true);
+                }
+                PlcUtil.changeEnable(s7PLC,true);
+            }else{
+                MesClient.formatScanType(2);
+                if(retObj.get("result")==null){
+                    MesClient.setMenuStatus("请求失败,前梁压铸码绑定失败,请重试",-1);
+                }else{
+                    if(retObj.get("result").toString().equalsIgnoreCase("false")){
+                        MesClient.setMenuStatus(retObj.getString("message"),-1);
+                    }
+                }
+            }
+
         }
     }
 

+ 3 - 5
src/com/mes/ui/MesRevice.java

@@ -71,18 +71,16 @@ public class MesRevice {
                     MesClient.pxstatus1.setText("A:可以加工,等待设备启动");
                     MesClient.curSna = MesClient.product_sn.getText();
                     MesClient.tjFlaga = 1;
-                    PlcUtil.changeEnable(MesClient.s7PLC,true);
 
                 }else{
                     MesClient.mesQualityFlagB = true;
                     MesClient.pxstatus2.setText("B:可以加工,等待设备启动");
                     MesClient.curSnb = MesClient.product_sn2.getText();
                     MesClient.tjFlagb = 1;
-                    PlcUtil.changeEnable(MesClient.s7PLC,true);
                 }
-//                System.out.println("scan_type1:"+MesClient.scan_type);
-//                MesClient.formatScanType(2);// 1=镭雕码 2=后梁
-//                System.out.println("scan_type2:"+MesClient.scan_type);
+                System.out.println("scan_type1:"+MesClient.scan_type);
+                MesClient.formatScanType(2);// 1=镭雕码 2=前梁压铸
+                System.out.println("scan_type2:"+MesClient.scan_type);
 
 
             }