|
@@ -161,6 +161,8 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
public static String programNoB = "";
|
|
public static String programNoB = "";
|
|
|
|
|
|
|
|
|
|
+ public static Boolean op040AutoSubmit = true; // OP040联动提交开关
|
|
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
|
if (LockUtil.getInstance().isAppActive() == true){
|
|
if (LockUtil.getInstance().isAppActive() == true){
|
|
|
// JOptionPane.showMessageDialog(null, "已有一个程序在运行,程序退出");
|
|
// JOptionPane.showMessageDialog(null, "已有一个程序在运行,程序退出");
|
|
@@ -176,6 +178,10 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
JdbcUtils.getConn();
|
|
JdbcUtils.getConn();
|
|
|
|
|
|
|
|
|
|
+ // 从数据库加载OP040联动提交开关状态
|
|
|
|
|
+ String op040Flag = JdbcUtils.getConfig("op040_auto_submit", "true");
|
|
|
|
|
+ op040AutoSubmit = op040Flag.equals("true");
|
|
|
|
|
+
|
|
|
welcomeWin = new LoginFarme();
|
|
welcomeWin = new LoginFarme();
|
|
|
welcomeWin.setVisible(true);
|
|
welcomeWin.setVisible(true);
|
|
|
|
|
|
|
@@ -652,6 +658,31 @@ public class MesClient extends JFrame {
|
|
|
});
|
|
});
|
|
|
settingMenu.add(resetTcpMenu_1_1sd);
|
|
settingMenu.add(resetTcpMenu_1_1sd);
|
|
|
|
|
|
|
|
|
|
+ JMenuItem op040SubmitMenu = new JMenuItem("OP040联动提交:" + (op040AutoSubmit ? "开" : "关"));
|
|
|
|
|
+ op040SubmitMenu.setIcon(new ImageIcon(MesClient.class.getResource("/bg/reset_logo.png")));
|
|
|
|
|
+ op040SubmitMenu.setFont(new Font("Microsoft YaHei UI", Font.PLAIN, 20));
|
|
|
|
|
+ op040SubmitMenu.addMouseListener(new MouseAdapter() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void mousePressed(MouseEvent e) {
|
|
|
|
|
+ super.mouseClicked(e);
|
|
|
|
|
+ String pwd = JOptionPane.showInputDialog(mesClientFrame, "请输入密码");
|
|
|
|
|
+ if(pwd != null && pwd.equals("mes123")){
|
|
|
|
|
+ op040AutoSubmit = !op040AutoSubmit;
|
|
|
|
|
+ JdbcUtils.setConfig("op040_auto_submit", op040AutoSubmit ? "true" : "false");
|
|
|
|
|
+ if(op040AutoSubmit){
|
|
|
|
|
+ op040SubmitMenu.setText("OP040联动提交:开");
|
|
|
|
|
+ MesClient.setMenuStatus("OP040联动提交已开启",0);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ op040SubmitMenu.setText("OP040联动提交:关");
|
|
|
|
|
+ MesClient.setMenuStatus("OP040联动提交已关闭",0);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(pwd != null){
|
|
|
|
|
+ MesClient.setMenuStatus("密码错误",-1);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ settingMenu.add(op040SubmitMenu);
|
|
|
|
|
+
|
|
|
contentPane = new JPanel();
|
|
contentPane = new JPanel();
|
|
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
|
setContentPane(contentPane);
|
|
setContentPane(contentPane);
|