|
|
@@ -132,7 +132,8 @@ public class DataUtil {
|
|
|
Properties pro = new Properties();
|
|
|
BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
|
|
|
pro.load(br);
|
|
|
- String gw = "GW"+rightPad(pro.getProperty("mes.gw"), 8);
|
|
|
+ // 与 sendMessage 保持一致,工位号优先取本地 ConfigParam
|
|
|
+ String gw = "GW"+rightPad(resolveGw(pro), 8);
|
|
|
String start = "aaaabbbbbABW";
|
|
|
String gy = "GY" + rightPad(craft, 6);
|
|
|
String reslx = "LX" + rightPad(lx, 2);
|
|
|
@@ -158,7 +159,8 @@ public class DataUtil {
|
|
|
Properties pro = new Properties();
|
|
|
BufferedReader br = new BufferedReader(new InputStreamReader(is, enconding));
|
|
|
pro.load(br);
|
|
|
- String gw = "GW"+rightPad(pro.getProperty("mes.gw"), 8);
|
|
|
+ // 工位号优先取本地 ConfigParam(UI 保存到 mes_db),回落到 jar 内 properties
|
|
|
+ String gw = "GW"+rightPad(resolveGw(pro), 8);
|
|
|
String start = "aaaabbbbbABW";
|
|
|
String gy = "GY" + rightPad(craft, 6);
|
|
|
String reslx = "LX" + rightPad(lx, 2);
|
|
|
@@ -177,6 +179,19 @@ public class DataUtil {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 工位号取值:优先本地 ConfigParam(UI 保存到 mes_db),回落 jar 内 properties
|
|
|
+ private static String resolveGw(Properties pro){
|
|
|
+ try{
|
|
|
+ if(MesClient.configParam != null){
|
|
|
+ String op = MesClient.configParam.getOprno();
|
|
|
+ if(op != null && !op.trim().isEmpty()){
|
|
|
+ return op.trim();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }catch(Exception ignore){}
|
|
|
+ return pro.getProperty("mes.gw");
|
|
|
+ }
|
|
|
+
|
|
|
public static String rightPad(final String str, final int size) {
|
|
|
if (str == null) {
|
|
|
return null;
|