|
|
@@ -76,6 +76,8 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
public static JLabel fxlabel;
|
|
|
|
|
|
+ public static Timer getSnBeatTimer;
|
|
|
+
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
if (LockUtil.getInstance().isAppActive() == true){
|
|
|
@@ -100,6 +102,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
getMaterailData();
|
|
|
|
|
|
+
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -491,7 +494,6 @@ public class MesClient extends JFrame {
|
|
|
MesClient.resetScanA();
|
|
|
MesClient.setMenuStatus("结果提交成功,请扫下一件",0);
|
|
|
MesClient.scan_type = 1;
|
|
|
- MesClient.scanBarcode();
|
|
|
}else{
|
|
|
if(retObj.get("result")==null){
|
|
|
MesClient.setMenuStatus("请求失败,请重试",-1);
|
|
|
@@ -605,6 +607,45 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ 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 setMenuStatus(String msg,int error){
|
|
|
if(error == 0){
|