|
|
@@ -64,6 +64,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
public static JFrame welcomeWin;
|
|
|
|
|
|
+ public static Timer getSnBeatTimer;
|
|
|
public static JPanel indexPanelB; // 已弃用,改为使用 WorkRecordPanel
|
|
|
public static MesWebView jfxPanel = null;
|
|
|
public static JPanel indexPanelC;
|
|
|
@@ -163,19 +164,25 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
|
|
|
|
public static void resetScanA() {
|
|
|
- work_status = 0;
|
|
|
- check_quality_result = false;
|
|
|
- MesClient.finish_ok_bt.setEnabled(false);
|
|
|
- MesClient.finish_ng_bt.setEnabled(false);
|
|
|
- product_sn.setText("");
|
|
|
- MesClient.fxlabel.setVisible(false);
|
|
|
-
|
|
|
- MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
|
- MesClient.setMenuStatus("请扫工件码",0);
|
|
|
+ JSONObject ret = DataUtil.delCurSn(mes_gw, mes_server_ip, mes_line_sn);
|
|
|
+ if (ret != null && ret.getString("result").equalsIgnoreCase("true")) {
|
|
|
+ work_status = 0;
|
|
|
+ check_quality_result = false;
|
|
|
+ MesClient.finish_ok_bt.setEnabled(false);
|
|
|
+ MesClient.finish_ng_bt.setEnabled(false);
|
|
|
+ product_sn.setText("");
|
|
|
+ MesClient.fxlabel.setVisible(false);
|
|
|
+
|
|
|
+ MesClient.f_scan_data_bt_1.setEnabled(true);
|
|
|
+ MesClient.setMenuStatus("请扫工件码",0);
|
|
|
// MesClient.setMenuStatus("开班点检,请先进行OKNG样件测试",-1);
|
|
|
|
|
|
- updateMaterailData();
|
|
|
+ updateMaterailData();
|
|
|
// shiftUserCheck();
|
|
|
+ } else {
|
|
|
+ status_menu.setText("刷新失败");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public static int userLoginHours;//用户登录所处小时
|
|
|
@@ -719,6 +726,46 @@ public class MesClient extends JFrame {
|
|
|
tabbedPane.addTab("绑定物料", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), indexScrollPaneB, null);
|
|
|
}
|
|
|
|
|
|
+ public static void startGetCurSn(){
|
|
|
+ if (getSnBeatTimer != null) {
|
|
|
+ getSnBeatTimer.cancel();
|
|
|
+ }
|
|
|
+ getSnBeatTimer = new Timer();
|
|
|
+ getSnBeatTimer.schedule(new TimerTask() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ System.out.println("kaishi");
|
|
|
+ if (work_status == 1) {
|
|
|
+ return;
|
|
|
+ } else if (work_status == 0) {
|
|
|
+ JSONObject result = DataUtil.getCurSn(mes_gw, mes_server_ip, mes_line_sn);
|
|
|
+ // 正常处理结果
|
|
|
+ if (result.containsKey("data")) {
|
|
|
+ String data = result.getString("data");
|
|
|
+ if (data != null && !data.isEmpty()) {
|
|
|
+ product_sn.setText(data);
|
|
|
+ JSONObject jsonObject = DataUtil.checkQuality(data, user20);
|
|
|
+ String msg = jsonObject.getString("message");
|
|
|
+ if (jsonObject.getString("result").equalsIgnoreCase("true")) {
|
|
|
+ finish_ng_bt.setEnabled(true);
|
|
|
+ finish_ok_bt.setEnabled(true);
|
|
|
+ check_quality_result = true;
|
|
|
+ work_status = 1;
|
|
|
+ MesClient.setMenuStatus(msg,0);
|
|
|
+ } else {
|
|
|
+ work_status = 0;
|
|
|
+ String msg2 = (jsonObject != null && jsonObject.containsKey("message")) ? jsonObject.getString("message") : "检查失败";
|
|
|
+ MesClient.setMenuStatus(msg2,-1);
|
|
|
+ check_quality_result = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }, 100, 1000);
|
|
|
+ }
|
|
|
+
|
|
|
// 开启发送结果定时任务
|
|
|
public static void startUpdateQualityTimer(){
|
|
|
// 创建异步线程池
|
|
|
@@ -773,5 +820,4 @@ public class MesClient extends JFrame {
|
|
|
log.info("异步任务执行完毕");
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
}
|