|
@@ -44,6 +44,7 @@ public class MesClient extends JFrame {
|
|
|
public static final int PRODUCT_SN_LENGTH = 32;
|
|
public static final int PRODUCT_SN_LENGTH = 32;
|
|
|
public static final String PREFIX_ZJ = "000020021815-01000016"; //智界
|
|
public static final String PREFIX_ZJ = "000020021815-01000016"; //智界
|
|
|
public static final String PREFIX_SJ = "000020022029-01000016"; //尚界
|
|
public static final String PREFIX_SJ = "000020022029-01000016"; //尚界
|
|
|
|
|
+ public static final boolean PRODUCT_TYPE_SWITCH_ENABLED = false;
|
|
|
public static final String PRODUCT_TYPE_SWITCH_PASSWORD = "503833";
|
|
public static final String PRODUCT_TYPE_SWITCH_PASSWORD = "503833";
|
|
|
public static final String PRODUCT_TYPE_ZJ = ProductTypePanel.TYPE_ZJ;
|
|
public static final String PRODUCT_TYPE_ZJ = ProductTypePanel.TYPE_ZJ;
|
|
|
public static final String PRODUCT_TYPE_SJ = ProductTypePanel.TYPE_SJ;
|
|
public static final String PRODUCT_TYPE_SJ = ProductTypePanel.TYPE_SJ;
|
|
@@ -405,7 +406,12 @@ public class MesClient extends JFrame {
|
|
|
MesClient.fxlabel.setVisible(false);
|
|
MesClient.fxlabel.setVisible(false);
|
|
|
|
|
|
|
|
MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
|
- MesClient.setMenuStatus("请扫工件码",0);
|
|
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
|
|
+ if (PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
|
|
+ MesClient.setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码",0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ MesClient.setMenuStatus("请扫工件码",0);
|
|
|
|
|
+ }
|
|
|
// MesClient.setMenuStatus("开班点检,请先进行OKNG样件测试",-1);
|
|
// MesClient.setMenuStatus("开班点检,请先进行OKNG样件测试",-1);
|
|
|
|
|
|
|
|
updateMaterailData();
|
|
updateMaterailData();
|
|
@@ -514,6 +520,7 @@ public class MesClient extends JFrame {
|
|
|
if(retObj == null){
|
|
if(retObj == null){
|
|
|
MesClient.check_quality_result = false;
|
|
MesClient.check_quality_result = false;
|
|
|
MesClient.work_status = 0;
|
|
MesClient.work_status = 0;
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -528,6 +535,7 @@ public class MesClient extends JFrame {
|
|
|
}else{
|
|
}else{
|
|
|
MesClient.check_quality_result = false;
|
|
MesClient.check_quality_result = false;
|
|
|
MesClient.work_status = 0;
|
|
MesClient.work_status = 0;
|
|
|
|
|
+ updateProductTypePanelEnabled(true);
|
|
|
if(retObj.get("result")==null){
|
|
if(retObj.get("result")==null){
|
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
|
}else{
|
|
}else{
|
|
@@ -685,6 +693,7 @@ public class MesClient extends JFrame {
|
|
|
toolBar.add(space_4);
|
|
toolBar.add(space_4);
|
|
|
|
|
|
|
|
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
|
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
|
|
|
|
+ tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
|
|
|
tabbedPane.setMinimumSize(new Dimension(400, 50));
|
|
tabbedPane.setMinimumSize(new Dimension(400, 50));
|
|
|
tabbedPane.setFont(new Font("宋体", Font.BOLD, 22));
|
|
tabbedPane.setFont(new Font("宋体", Font.BOLD, 22));
|
|
|
contentPane.add(tabbedPane);
|
|
contentPane.add(tabbedPane);
|
|
@@ -832,6 +841,7 @@ public class MesClient extends JFrame {
|
|
|
searchScrollPaneDj = new JScrollPane(indexPanelC);
|
|
searchScrollPaneDj = new JScrollPane(indexPanelC);
|
|
|
indexPanelC.setLayout(null);
|
|
indexPanelC.setLayout(null);
|
|
|
|
|
|
|
|
|
|
+ if (PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
//新增的面板
|
|
//新增的面板
|
|
|
JPanel indexPanelProductType = new JPanel();
|
|
JPanel indexPanelProductType = new JPanel();
|
|
|
indexPanelProductType.setLayout(null);
|
|
indexPanelProductType.setLayout(null);
|
|
@@ -856,7 +866,11 @@ public class MesClient extends JFrame {
|
|
|
productTypePanel.setOnChangeListener(() -> {
|
|
productTypePanel.setOnChangeListener(() -> {
|
|
|
if (work_status == 0) {
|
|
if (work_status == 0) {
|
|
|
saveProductTypeToDb();
|
|
saveProductTypeToDb();
|
|
|
- setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码", 0);
|
|
|
|
|
|
|
+ if (PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
|
|
+ setMenuStatus("当前生产类型:" + getProductTypeName() + ",请扫工件码",0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ setMenuStatus("请扫工件码",0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
refreshProductTypeCurrentLabel();
|
|
refreshProductTypeCurrentLabel();
|
|
|
});
|
|
});
|
|
@@ -871,6 +885,7 @@ public class MesClient extends JFrame {
|
|
|
indexPanelProductType.add(productTypeCurrentLabel);
|
|
indexPanelProductType.add(productTypeCurrentLabel);
|
|
|
|
|
|
|
|
tabbedPane.addTab("生产类型", new ImageIcon(MesClient.class.getResource("/bg/menu_setting.png")), productTypeScrollPane, null);
|
|
tabbedPane.addTab("生产类型", new ImageIcon(MesClient.class.getResource("/bg/menu_setting.png")), productTypeScrollPane, null);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
@@ -954,6 +969,9 @@ public class MesClient extends JFrame {
|
|
|
if (sn.length() != PRODUCT_SN_LENGTH) {
|
|
if (sn.length() != PRODUCT_SN_LENGTH) {
|
|
|
return "工件码长度须为32位,当前" + sn.length() + "位";
|
|
return "工件码长度须为32位,当前" + sn.length() + "位";
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!PRODUCT_TYPE_SWITCH_ENABLED) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
String prefix = getProductSnPrefix();
|
|
String prefix = getProductSnPrefix();
|
|
|
if (!sn.startsWith(prefix)) {
|
|
if (!sn.startsWith(prefix)) {
|
|
|
return "工件码前缀与当前类型(" + getProductTypeName() + ")不匹配,当前工件码为" + getProductTypeNameBySn(sn);
|
|
return "工件码前缀与当前类型(" + getProductTypeName() + ")不匹配,当前工件码为" + getProductTypeNameBySn(sn);
|