|
@@ -10,6 +10,8 @@ import com.mes.netty.NettyClient;
|
|
|
import com.mes.util.DateLocalUtils;
|
|
import com.mes.util.DateLocalUtils;
|
|
|
import com.mes.util.JdbcUtils;
|
|
import com.mes.util.JdbcUtils;
|
|
|
import javafx.embed.swing.JFXPanel;
|
|
import javafx.embed.swing.JFXPanel;
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
import javax.swing.*;
|
|
|
import javax.swing.border.EmptyBorder;
|
|
import javax.swing.border.EmptyBorder;
|
|
@@ -33,6 +35,8 @@ import java.util.concurrent.Executors;
|
|
|
|
|
|
|
|
public class MesClient extends JFrame {
|
|
public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(MesClient.class);
|
|
|
|
|
+
|
|
|
private static String Drivde = "org.sqlite.JDBC";
|
|
private static String Drivde = "org.sqlite.JDBC";
|
|
|
|
|
|
|
|
public static int mes_auth = 0; // 权限级别 0=无权限 1=操作工人 2=管理员
|
|
public static int mes_auth = 0; // 权限级别 0=无权限 1=操作工人 2=管理员
|
|
@@ -171,6 +175,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
deviceOnline();
|
|
deviceOnline();
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
|
|
+ log.error("系统初始化异常: ", e);
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -193,6 +198,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
|
|
+ log.error("设备启动监控异常: ", e);
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -216,7 +222,8 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
mes_gw_des = OprnoUtil.getGwDes(mes_line_sn,mes_gw);
|
|
mes_gw_des = OprnoUtil.getGwDes(mes_line_sn,mes_gw);
|
|
|
|
|
|
|
|
- System.out.println(mes_gw + ";" + mes_gw_des + ";" + mes_server_ip + ";" + mes_tcp_port + ";" + mes_heart_beat_cycle);
|
|
|
|
|
|
|
+ log.info("加载配置: gw={}, gw_des={}, server_ip={}, tcp_port={}, heart_beat_cycle={}",
|
|
|
|
|
+ mes_gw, mes_gw_des, mes_server_ip, mes_tcp_port, mes_heart_beat_cycle);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void getPlcParam() {
|
|
public static void getPlcParam() {
|
|
@@ -293,18 +300,25 @@ public class MesClient extends JFrame {
|
|
|
public void run() {
|
|
public void run() {
|
|
|
try{
|
|
try{
|
|
|
List<ProdReq> prods = JdbcUtils.getProds();
|
|
List<ProdReq> prods = JdbcUtils.getProds();
|
|
|
- System.out.println("prods:"+ JSON.toJSONString(prods));
|
|
|
|
|
|
|
+ log.info("【参数定时上传】获取到待同步的生产数据,记录数: {}", prods.size());
|
|
|
if(prods.size() > 0){
|
|
if(prods.size() > 0){
|
|
|
|
|
+ log.debug("【参数定时上传】请求数据详情: {}", JSON.toJSONString(prods));
|
|
|
// 定时上传参数
|
|
// 定时上传参数
|
|
|
JSONObject retObj = DataUtil.upParams(JSON.toJSONString(prods));
|
|
JSONObject retObj = DataUtil.upParams(JSON.toJSONString(prods));
|
|
|
|
|
+ log.info("【参数定时上传】服务端返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
// 更新sqlite已同步
|
|
// 更新sqlite已同步
|
|
|
for(ProdReq prodReq:prods){
|
|
for(ProdReq prodReq:prods){
|
|
|
JdbcUtils.updateProdSync(prodReq.getId(),1);
|
|
JdbcUtils.updateProdSync(prodReq.getId(),1);
|
|
|
}
|
|
}
|
|
|
|
|
+ log.info("【参数定时上传】本地 SQLite 状态更新完成");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.warn("【参数定时上传】接口返回非 true,未更新本地状态");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
|
|
+ log.error("【参数定时上传】发生异常: ", e);
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -325,7 +339,7 @@ public class MesClient extends JFrame {
|
|
|
DataUtil.synrTcp(nettyClient,mes_gw);
|
|
DataUtil.synrTcp(nettyClient,mes_gw);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
- // TODO Auto-generated catch block
|
|
|
|
|
|
|
+ log.error("初始化TCP连接异常: ", e);
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -342,7 +356,6 @@ public class MesClient extends JFrame {
|
|
|
heartBeatTimer.schedule(new TimerTask() {
|
|
heartBeatTimer.schedule(new TimerTask() {
|
|
|
public void run() {
|
|
public void run() {
|
|
|
if(nettyClient!=null&&tcp_connect_flag) {
|
|
if(nettyClient!=null&&tcp_connect_flag) {
|
|
|
- //System.out.println("发送心跳报文");
|
|
|
|
|
DataUtil.heartBeat(nettyClient,mes_gw);
|
|
DataUtil.heartBeat(nettyClient,mes_gw);
|
|
|
|
|
|
|
|
heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
|
|
heart_beat_menu.setText(DateLocalUtils.getCurrentTime());
|
|
@@ -374,10 +387,9 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
//若未连接则尝试连接
|
|
//若未连接则尝试连接
|
|
|
if(nettyClient!=null&&!tcp_connect_flag){
|
|
if(nettyClient!=null&&!tcp_connect_flag){
|
|
|
- System.out.println("TCP已断开");
|
|
|
|
|
|
|
+ log.warn("TCP已断开,尝试重新连接");
|
|
|
//TCP重新同步连接
|
|
//TCP重新同步连接
|
|
|
if(!connect_request_flag) {
|
|
if(!connect_request_flag) {
|
|
|
- //System.out.println("TCP重新同步连接");
|
|
|
|
|
//设置TCP请求状态,只重新同步连接一次
|
|
//设置TCP请求状态,只重新同步连接一次
|
|
|
connect_request_flag = true;
|
|
connect_request_flag = true;
|
|
|
|
|
|
|
@@ -408,6 +420,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void resetScanA() {
|
|
public static void resetScanA() {
|
|
|
|
|
+ log.info("【系统操作】执行产品及面板状态重置 (resetScanA)");
|
|
|
work_status = 0;
|
|
work_status = 0;
|
|
|
check_quality_result = false;
|
|
check_quality_result = false;
|
|
|
MesClient.finish_ok_bt.setEnabled(false);
|
|
MesClient.finish_ok_bt.setEnabled(false);
|
|
@@ -540,7 +553,10 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查询工件质量
|
|
// 查询工件质量
|
|
|
|
|
+ log.info("【质量检查-扫码触发】准备发送扫码质量询问报文, SN: {}, User: {}", barcode36, user20);
|
|
|
Boolean sendret = DataUtil.checkQuality(nettyClient,barcode36,user20);
|
|
Boolean sendret = DataUtil.checkQuality(nettyClient,barcode36,user20);
|
|
|
|
|
+ log.info("【质量检查-扫码触发】请求发送结果: {}", sendret);
|
|
|
|
|
+
|
|
|
if(!sendret){
|
|
if(!sendret){
|
|
|
JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
|
return;
|
|
return;
|
|
@@ -552,6 +568,7 @@ public class MesClient extends JFrame {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static void logoff() {
|
|
public static void logoff() {
|
|
|
|
|
+ log.info("【系统操作】用户执行退出登录 (logoff)");
|
|
|
// welcomeWin.setVisible(true);
|
|
// welcomeWin.setVisible(true);
|
|
|
mesClientFrame.setVisible(false);
|
|
mesClientFrame.setVisible(false);
|
|
|
|
|
|
|
@@ -606,8 +623,11 @@ public class MesClient extends JFrame {
|
|
|
@Override
|
|
@Override
|
|
|
public void mousePressed(MouseEvent e) {
|
|
public void mousePressed(MouseEvent e) {
|
|
|
super.mouseClicked(e);
|
|
super.mouseClicked(e);
|
|
|
|
|
+ log.info("【系统设置】用户点击了 [重连MES] 菜单");
|
|
|
//重连mes
|
|
//重连mes
|
|
|
- nettyClient.future.channel().close();
|
|
|
|
|
|
|
+ if(nettyClient != null && nettyClient.future != null && nettyClient.future.channel() != null) {
|
|
|
|
|
+ nettyClient.future.channel().close();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
settingMenu.add(resetTcpMenu);
|
|
settingMenu.add(resetTcpMenu);
|
|
@@ -619,6 +639,7 @@ public class MesClient extends JFrame {
|
|
|
@Override
|
|
@Override
|
|
|
public void mousePressed(MouseEvent e) {
|
|
public void mousePressed(MouseEvent e) {
|
|
|
super.mouseClicked(e);
|
|
super.mouseClicked(e);
|
|
|
|
|
+ log.info("【系统设置】用户点击了 [刷新工件] 菜单");
|
|
|
resetScanA();
|
|
resetScanA();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -716,6 +737,7 @@ public class MesClient extends JFrame {
|
|
|
f_scan_data_bt_1 = new JButton("扫码");
|
|
f_scan_data_bt_1 = new JButton("扫码");
|
|
|
f_scan_data_bt_1.addActionListener(new ActionListener() {
|
|
f_scan_data_bt_1.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【总控操作】点击了 [扫码(工件)] 按钮");
|
|
|
scan_type = 1;
|
|
scan_type = 1;
|
|
|
scanBarcode();
|
|
scanBarcode();
|
|
|
}
|
|
}
|
|
@@ -751,6 +773,7 @@ public class MesClient extends JFrame {
|
|
|
|
|
|
|
|
// scanBarcodeLb();
|
|
// scanBarcodeLb();
|
|
|
// scan_type = 1;
|
|
// scan_type = 1;
|
|
|
|
|
+ log.info("【总控操作】点击了 [扫码(冷板)] 按钮");
|
|
|
if (product_sn.getText().isEmpty()){
|
|
if (product_sn.getText().isEmpty()){
|
|
|
setMenuStatus("请在工件上料完成后扫码!",1);
|
|
setMenuStatus("请在工件上料完成后扫码!",1);
|
|
|
return;
|
|
return;
|
|
@@ -773,6 +796,7 @@ public class MesClient extends JFrame {
|
|
|
finish_ok_bt.setEnabled(false);
|
|
finish_ok_bt.setEnabled(false);
|
|
|
finish_ok_bt.addActionListener(new ActionListener() {
|
|
finish_ok_bt.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【总控操作】点击了 [OK] 按钮,当前产品SN: {}, 操作用户: {}", product_sn.getText(), user_menu.getText());
|
|
|
if(work_status == 1 && check_quality_result){
|
|
if(work_status == 1 && check_quality_result){
|
|
|
if (product_sn_lb.getText().equals("")){
|
|
if (product_sn_lb.getText().equals("")){
|
|
|
JOptionPane.showMessageDialog(MesClient.mesClientFrame,"请绑定冷板码","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
JOptionPane.showMessageDialog(MesClient.mesClientFrame,"请绑定冷板码","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
@@ -782,7 +806,9 @@ public class MesClient extends JFrame {
|
|
|
getUser();
|
|
getUser();
|
|
|
|
|
|
|
|
String qret = "OK";
|
|
String qret = "OK";
|
|
|
|
|
+ log.info("【判定上传】准备发送质量判定结果, SN: {}, 结果: {}", sn, qret);
|
|
|
Boolean sendret = DataUtil.sendQuality(nettyClient,sn,qret,user20);
|
|
Boolean sendret = DataUtil.sendQuality(nettyClient,sn,qret,user20);
|
|
|
|
|
+ log.info("【判定上传】发送结果: {}", sendret);
|
|
|
if(!sendret){
|
|
if(!sendret){
|
|
|
MesClient.setMenuStatus("消息发送失败,请重试",-1);
|
|
MesClient.setMenuStatus("消息发送失败,请重试",-1);
|
|
|
// JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
// JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
@@ -802,12 +828,15 @@ public class MesClient extends JFrame {
|
|
|
finish_ng_bt.setEnabled(false);
|
|
finish_ng_bt.setEnabled(false);
|
|
|
finish_ng_bt.addActionListener(new ActionListener() {
|
|
finish_ng_bt.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【总控操作】点击了 [NG] 按钮,当前产品SN: {}, 操作用户: {}", product_sn.getText(), user_menu.getText());
|
|
|
if(work_status == 1 && check_quality_result){
|
|
if(work_status == 1 && check_quality_result){
|
|
|
|
|
|
|
|
String sn = getBarcode(product_sn.getText());
|
|
String sn = getBarcode(product_sn.getText());
|
|
|
getUser();
|
|
getUser();
|
|
|
String qret = "NG";
|
|
String qret = "NG";
|
|
|
|
|
+ log.info("【判定上传】准备发送质量判定结果, SN: {}, 结果: {}", sn, qret);
|
|
|
Boolean sendret = DataUtil.sendQuality(nettyClient,sn,qret,user20);
|
|
Boolean sendret = DataUtil.sendQuality(nettyClient,sn,qret,user20);
|
|
|
|
|
+ log.info("【判定上传】发送结果: {}", sendret);
|
|
|
if(!sendret){
|
|
if(!sendret){
|
|
|
MesClient.setMenuStatus("消息发送失败,请重试",-1);
|
|
MesClient.setMenuStatus("消息发送失败,请重试",-1);
|
|
|
// JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
// JOptionPane.showMessageDialog(mesClientFrame,"消息发送失败,请重试","提示窗口", JOptionPane.INFORMATION_MESSAGE);
|
|
@@ -902,8 +931,12 @@ public class MesClient extends JFrame {
|
|
|
resetResultA = new JButton("重拉");
|
|
resetResultA = new JButton("重拉");
|
|
|
resetResultA.addActionListener(new ActionListener() {
|
|
resetResultA.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【A枪操作】点击了 [重拉] 按钮,当前产品SN: {}", product_sn.getText());
|
|
|
if(zdStatusA == 1){
|
|
if(zdStatusA == 1){
|
|
|
|
|
+ log.info("【NG审核检查】准备校验 A枪 NG中断数据, SN: {}", product_sn.getText());
|
|
|
JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
|
|
|
+ log.info("【NG审核检查】校验返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
MesClient.zdStatusA = 0;
|
|
MesClient.zdStatusA = 0;
|
|
|
MesClient.resetResultA.setEnabled(false);
|
|
MesClient.resetResultA.setEnabled(false);
|
|
@@ -935,8 +968,12 @@ public class MesClient extends JFrame {
|
|
|
okResultA = new JButton("OK");
|
|
okResultA = new JButton("OK");
|
|
|
okResultA.addActionListener(new ActionListener() {
|
|
okResultA.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【A枪操作】点击了 [OK] 按钮,当前产品SN: {}", product_sn.getText());
|
|
|
if(zdStatusA == 1){
|
|
if(zdStatusA == 1){
|
|
|
|
|
+ log.info("【NG审核检查】准备校验 A枪 NG中断数据, SN: {}", product_sn.getText());
|
|
|
JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
|
|
|
+ log.info("【NG审核检查】校验返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
if(!MesClient.product_sn.getText().isEmpty()){
|
|
if(!MesClient.product_sn.getText().isEmpty()){
|
|
|
MesClient.aFinish++;
|
|
MesClient.aFinish++;
|
|
@@ -971,8 +1008,12 @@ public class MesClient extends JFrame {
|
|
|
ngResultA = new JButton("NG");
|
|
ngResultA = new JButton("NG");
|
|
|
ngResultA.addActionListener(new ActionListener() {
|
|
ngResultA.addActionListener(new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
+ log.info("【A枪操作】点击了 [NG] 按钮,当前产品SN: {}", product_sn.getText());
|
|
|
if(zdStatusA == 1){
|
|
if(zdStatusA == 1){
|
|
|
|
|
+ log.info("【NG审核检查】准备校验 A枪 NG中断数据, SN: {}", product_sn.getText());
|
|
|
JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
JSONObject retObj = DataUtil.checkNgData(product_sn.getText(),"A");
|
|
|
|
|
+ log.info("【NG审核检查】校验返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
if(!MesClient.product_sn.getText().isEmpty()){
|
|
if(!MesClient.product_sn.getText().isEmpty()){
|
|
|
JdbcUtils.insertProdData(MesClient.mes_gw, MesClient.mes_line_sn, MesClient.product_sn.getText(),"A",foutA,soutA,fminA,sminA,fmaxA,smaxA,"0",curA+"", MesClient.user_menu.getText());
|
|
JdbcUtils.insertProdData(MesClient.mes_gw, MesClient.mes_line_sn, MesClient.product_sn.getText(),"A",foutA,soutA,fminA,sminA,fmaxA,smaxA,"0",curA+"", MesClient.user_menu.getText());
|
|
@@ -1007,7 +1048,7 @@ public class MesClient extends JFrame {
|
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
tabbedPane.addTab("工作面板", new ImageIcon(MesClient.class.getResource("/bg/a_side.png")), indexScrollPaneA, null);
|
|
|
tabbedPane.setEnabledAt(0, true);
|
|
tabbedPane.setEnabledAt(0, true);
|
|
|
|
|
|
|
|
-// searchScrollPane = new JScrollPane((Component) null);
|
|
|
|
|
|
|
+// searchScrollPane = new JScrollPane((Component) null);
|
|
|
|
|
|
|
|
indexPanelC = new JPanel();
|
|
indexPanelC = new JPanel();
|
|
|
searchScrollPaneDj = new JScrollPane(indexPanelC);
|
|
searchScrollPaneDj = new JScrollPane(indexPanelC);
|
|
@@ -1020,10 +1061,10 @@ public class MesClient extends JFrame {
|
|
|
searchScrollPane = new JScrollPane(indexPanelB);
|
|
searchScrollPane = new JScrollPane(indexPanelB);
|
|
|
indexPanelB.setLayout(null);
|
|
indexPanelB.setLayout(null);
|
|
|
|
|
|
|
|
-// tabbedPane.addTab("工作记录", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPane, null);
|
|
|
|
|
|
|
+// tabbedPane.addTab("工作记录", new ImageIcon(MesClient.class.getResource("/bg/menu_data_preprocess.png")), searchScrollPane, null);
|
|
|
|
|
|
|
|
|
|
|
|
|
- tabbedPane.addChangeListener(new ChangeListener() {
|
|
|
|
|
|
|
+ tabbedPane.addChangeListener(new ChangeListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void stateChanged(ChangeEvent e) {
|
|
public void stateChanged(ChangeEvent e) {
|
|
|
JTabbedPane tabbedPane = (JTabbedPane) e.getSource();
|
|
JTabbedPane tabbedPane = (JTabbedPane) e.getSource();
|
|
@@ -1063,14 +1104,17 @@ public class MesClient extends JFrame {
|
|
|
// 获取开班点检状态
|
|
// 获取开班点检状态
|
|
|
public static void getCheckResult(){
|
|
public static void getCheckResult(){
|
|
|
try{
|
|
try{
|
|
|
|
|
+ log.info("【开班点检】准备获取点检状态...");
|
|
|
JSONObject retObj = DataUtil.getCheckResult();
|
|
JSONObject retObj = DataUtil.getCheckResult();
|
|
|
|
|
+ log.info("【开班点检】获取结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) { // 已点检
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) { // 已点检
|
|
|
MesClient.checkState = true;
|
|
MesClient.checkState = true;
|
|
|
}else{ // 未点检
|
|
}else{ // 未点检
|
|
|
MesClient.checkState = false;
|
|
MesClient.checkState = false;
|
|
|
}
|
|
}
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
|
|
|
|
+ log.error("【开班点检】获取点检状态异常: ", e);
|
|
|
MesClient.checkState = false;
|
|
MesClient.checkState = false;
|
|
|
}
|
|
}
|
|
|
MesClient.formatDeviceState();
|
|
MesClient.formatDeviceState();
|
|
@@ -1163,7 +1207,10 @@ public class MesClient extends JFrame {
|
|
|
String scanBarcode = JOptionPane.showInputDialog(null, scanBarcodeTitle);
|
|
String scanBarcode = JOptionPane.showInputDialog(null, scanBarcodeTitle);
|
|
|
if(scanBarcode!=null&&!scanBarcode.equalsIgnoreCase("")) {
|
|
if(scanBarcode!=null&&!scanBarcode.equalsIgnoreCase("")) {
|
|
|
|
|
|
|
|
|
|
+ log.info("【物料绑定】扫描物料: {}, 批次码: {}", bindMaterialResp.getMaterialTitle(), scanBarcode);
|
|
|
JSONObject retObj = DataUtil.saveBindMaterail(scanBarcode,bindMaterialResp.getCraft(),bindMaterialResp.getMaterialId(),bindMaterialResp.getType());
|
|
JSONObject retObj = DataUtil.saveBindMaterail(scanBarcode,bindMaterialResp.getCraft(),bindMaterialResp.getMaterialId(),bindMaterialResp.getType());
|
|
|
|
|
+ log.info("【物料绑定】返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
MesClient.setMenuStatus("扫物料:"+bindMaterialResp.getMaterialTitle()+"成功",0);
|
|
MesClient.setMenuStatus("扫物料:"+bindMaterialResp.getMaterialTitle()+"成功",0);
|
|
|
updateMaterailData();
|
|
updateMaterailData();
|
|
@@ -1225,7 +1272,7 @@ public class MesClient extends JFrame {
|
|
|
//获取用户
|
|
//获取用户
|
|
|
getUser();
|
|
getUser();
|
|
|
//获取扫码内容36位
|
|
//获取扫码内容36位
|
|
|
- String barcode36 = getBarcode(scanBarcode);//处理36为码
|
|
|
|
|
|
|
+ String warehouseSn = getBarcode(scanBarcode);//处理36为码
|
|
|
//工位号
|
|
//工位号
|
|
|
String gw = "";
|
|
String gw = "";
|
|
|
product_sn_lb.setText(scanBarcode);
|
|
product_sn_lb.setText(scanBarcode);
|
|
@@ -1237,10 +1284,13 @@ public class MesClient extends JFrame {
|
|
|
// 检查工件质量
|
|
// 检查工件质量
|
|
|
if(work_status == 1) {
|
|
if(work_status == 1) {
|
|
|
// 直接调用绑定
|
|
// 直接调用绑定
|
|
|
- String warehouseSn = getBarcode(product_sn_lb.getText());
|
|
|
|
|
String sn = getBarcode(product_sn.getText());
|
|
String sn = getBarcode(product_sn.getText());
|
|
|
getUser();
|
|
getUser();
|
|
|
|
|
+
|
|
|
|
|
+ log.info("【冷板绑定】准备调用绑定接口, SN: {}, 冷板码: {}", sn, warehouseSn);
|
|
|
JSONObject retObj = DataUtil.bindWarehouse(sn, warehouseSn, user20, "400006");
|
|
JSONObject retObj = DataUtil.bindWarehouse(sn, warehouseSn, user20, "400006");
|
|
|
|
|
+ log.info("【冷板绑定】绑定返回结果: {}", retObj != null ? retObj.toJSONString() : "null");
|
|
|
|
|
+
|
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
if(retObj.get("result")!=null&&retObj.get("result").toString().equalsIgnoreCase("true")) {
|
|
|
MesClient.setMenuStatus("绑定成功",0);
|
|
MesClient.setMenuStatus("绑定成功",0);
|
|
|
}else{
|
|
}else{
|