|
|
@@ -16,14 +16,19 @@ import java.util.List;
|
|
|
public class DataUtil {
|
|
|
public static final Logger log = LoggerFactory.getLogger(DataUtil.class);
|
|
|
|
|
|
+ private static String sidParam() {
|
|
|
+ String sid = MesClient.sessionid;
|
|
|
+ return (sid == null || sid.trim().isEmpty()) ? "" : ("&__sid=" + sid.trim());
|
|
|
+ }
|
|
|
+
|
|
|
public static JSONObject checkQuality(String sn, String user){
|
|
|
try{
|
|
|
String mes_server_ip = MesClient.mes_server_ip;
|
|
|
String oprno = MesClient.mes_gw == null ? "" : MesClient.mes_gw.trim();
|
|
|
String lineSn = MesClient.mes_line_sn == null ? "" : MesClient.mes_line_sn.trim();
|
|
|
String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductRecord/pccheck";
|
|
|
- String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&ucode="+user;
|
|
|
- log.info("params="+params);
|
|
|
+ String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&ucode="+user + sidParam();
|
|
|
+ log.info("url="+url+" params="+params);
|
|
|
String result = doPost(url,params);
|
|
|
log.info("result="+result);
|
|
|
if(result == null || result.trim().isEmpty() || result.equalsIgnoreCase("false")) {
|
|
|
@@ -45,7 +50,7 @@ public class DataUtil {
|
|
|
String oprno = MesClient.mes_gw == null ? "" : MesClient.mes_gw.trim();
|
|
|
String lineSn = MesClient.mes_line_sn == null ? "" : MesClient.mes_line_sn.trim();
|
|
|
String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductRecord/pcbindRecord";
|
|
|
- String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&result="+ret+"&ucode="+user + "&craft="+craft+"&materielSn="+materielSn;
|
|
|
+ String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&result="+ret+"&ucode="+user + "&craft="+craft+"&materielSn="+materielSn + sidParam();
|
|
|
log.info("params="+params);
|
|
|
String result = doPost(url,params);
|
|
|
log.info("result="+result);
|
|
|
@@ -68,8 +73,8 @@ public class DataUtil {
|
|
|
String oprno = MesClient.mes_gw == null ? "" : MesClient.mes_gw.trim();
|
|
|
String lineSn = MesClient.mes_line_sn == null ? "" : MesClient.mes_line_sn.trim();
|
|
|
String url = "http://"+mes_server_ip+":8980/js/a/mes/mesProductRecord/pcresult";
|
|
|
- String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&result="+ret+"&ucode="+user;
|
|
|
- log.info("params="+params);
|
|
|
+ String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&sn="+sn+"&result="+ret+"&ucode="+user + sidParam();
|
|
|
+ log.info("url="+url+" params="+params);
|
|
|
String result = doPost(url,params);
|
|
|
log.info("result="+result);
|
|
|
|
|
|
@@ -85,6 +90,34 @@ public class DataUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 上传总成检具 NG 点位(只传勾选的 NG 点,逗号分隔)
|
|
|
+ */
|
|
|
+ public static JSONObject sendGaugeNgPoints(String sn, String ngPoints, String user) {
|
|
|
+ try {
|
|
|
+ String mes_server_ip = MesClient.mes_server_ip;
|
|
|
+ String oprno = MesClient.mes_gw == null ? "" : MesClient.mes_gw.trim();
|
|
|
+ String lineSn = MesClient.mes_line_sn == null ? "" : MesClient.mes_line_sn.trim();
|
|
|
+ String url = "http://" + mes_server_ip + ":8980/js/a/mes/mesProductGaugeNg/pcsave";
|
|
|
+ String params = "__ajax=json&oprno=" + oprno
|
|
|
+ + "&lineSn=" + lineSn
|
|
|
+ + "&sn=" + sn
|
|
|
+ + "&ucode=" + (user == null ? "" : user)
|
|
|
+ + "&ngPoints=" + (ngPoints == null ? "" : ngPoints)
|
|
|
+ + sidParam();
|
|
|
+ log.info("gaugeNg url=" + url + " params=" + params);
|
|
|
+ String result = doPost(url, params);
|
|
|
+ log.info("gaugeNg result=" + result);
|
|
|
+ if (result == null || result.trim().isEmpty() || result.equalsIgnoreCase("false")) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return JSONObject.parseObject(result);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("sendGaugeNgPoints e=" + e.getMessage());
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public static String rightPad(final String str, final int size) {
|
|
|
if (str == null) {
|
|
|
return null;
|
|
|
@@ -105,7 +138,7 @@ public class DataUtil {
|
|
|
String url = "http://"+mes_server_ip+":8980/js/a/mes/mesLineProcessMaterial/materials";
|
|
|
String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn;
|
|
|
System.out.println("params="+params);
|
|
|
- String result = doPost(url,params);
|
|
|
+ String result = doPost(url,params + sidParam());
|
|
|
System.out.println("result="+result);
|
|
|
|
|
|
if(result.equalsIgnoreCase("false")) {
|
|
|
@@ -124,7 +157,7 @@ public class DataUtil {
|
|
|
String oprno = MesClient.mes_gw == null ? "" : MesClient.mes_gw.trim();
|
|
|
String lineSn = MesClient.mes_line_sn == null ? "" : MesClient.mes_line_sn.trim();
|
|
|
String url = "http://"+mes_server_ip+":8980/js/a/mes/mesMaterialPrebind/bind";
|
|
|
- String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&batchSn="+batchSn+"&craft="+craft+"&materialId="+materialId+"&type="+type;
|
|
|
+ String params = "__ajax=json&oprno="+oprno+"&lineSn="+lineSn+"&batchSn="+batchSn+"&craft="+craft+"&materialId="+materialId+"&type="+type + sidParam();
|
|
|
System.out.println("params="+params);
|
|
|
String result = doPost(url,params);
|
|
|
System.out.println("result="+result);
|
|
|
@@ -229,6 +262,9 @@ public class DataUtil {
|
|
|
params.append("&lineSn=").append(lineSn);
|
|
|
params.append("&pageNo=").append(pageNo);
|
|
|
params.append("&pageSize=").append(pageSize);
|
|
|
+ if (MesClient.sessionid != null && !MesClient.sessionid.trim().isEmpty()) {
|
|
|
+ params.append("&__sid=").append(MesClient.sessionid.trim());
|
|
|
+ }
|
|
|
System.out.println("oprno="+oprno);
|
|
|
//todo
|
|
|
if (oprno != null && !oprno.isEmpty()) {
|