|
@@ -393,48 +393,34 @@ public class CollectThread extends Thread {
|
|
|
|
|
|
}
|
|
|
this.updateMeterCollectorControl(rList[0], meterList, p.address);
|
|
|
+ } else if (rList.length > 6 && "pointread".equalsIgnoreCase(rList[2])) {
|
|
|
+ // 1101070037;1;pointread;;123;1001;11
|
|
|
+ //String key = rList[0] + "-" + rList[1] + "-" + rList[5] + "." + rList[6];
|
|
|
+ //String id = rList[0] + "-" + rList[1] + "-" + rList[4];
|
|
|
+ // Constant.id2time.put(key,
|
|
|
+ // System.currentTimeMillis());
|
|
|
+ // Constant.id2point.put(id, key);
|
|
|
+ // Constant.id2function.put(id, "pointread");
|
|
|
+ // Constant.id2status.put(id, "processing:rcvd");
|
|
|
+
|
|
|
+ StringBuffer sb1 = new StringBuffer();
|
|
|
+ sb1 = this.getCacheData(rList);
|
|
|
+ server.AppendToSend(p.address, new Packet(sb1.toString()));
|
|
|
+ LogUtil.info(server.Name() + " AppendToSend: " + p.address + " " + sb.toString());
|
|
|
+ } else if (rList.length > 6 && "realtimepointdata".equalsIgnoreCase(rList[2])) {
|
|
|
+ //String key = rList[0] + "-" + rList[1] + "-" + rList[5] + "." + rList[6];
|
|
|
+ //String id = rList[0] + "-" + rList[1] + "-" + rList[4];
|
|
|
+ // Constant.id2time.put(key,
|
|
|
+ // System.currentTimeMillis());
|
|
|
+ // Constant.id2point.put(id, key);
|
|
|
+ // Constant.id2function.put(id, "realtimepointdata");
|
|
|
+ // Constant.id2status.put(id, "processing:rcvd");
|
|
|
+
|
|
|
+ StringBuffer sb1 = new StringBuffer();
|
|
|
+ sb1 = this.getCacheData2(rList);
|
|
|
+ server.AppendToSend(p.address, new Packet(sb1.toString()));
|
|
|
+ LogUtil.info(server.Name() + " AppendToSend: " + p.address + " " + sb.toString());
|
|
|
}
|
|
|
- // else if (rList.length > 6 &&
|
|
|
- // "pointread".equalsIgnoreCase(rList[2])) {
|
|
|
- // // 1101070037;1;pointread;;123;1001;11
|
|
|
- // String key = rList[0] + "-" + rList[1] + "-" +
|
|
|
- // rList[5] +
|
|
|
- // "." + rList[6];
|
|
|
- // String id = rList[0] + "-" + rList[1] + "-" +
|
|
|
- // rList[4];
|
|
|
- // Constant.id2time.put(key,
|
|
|
- // System.currentTimeMillis());
|
|
|
- // Constant.id2point.put(id, key);
|
|
|
- // Constant.id2function.put(id, "pointread");
|
|
|
- // Constant.id2status.put(id, "processing:rcvd");
|
|
|
- //
|
|
|
- // StringBuffer sb1 = new StringBuffer();
|
|
|
- // sb1 = this.getCacheData(rList);
|
|
|
- // server.AppendToSend(p.address, new
|
|
|
- // Packet(sb1.toString()));
|
|
|
- // LogUtil.info(server.Name() + " AppendToSend: " +
|
|
|
- // p.address + " " + sb.toString());
|
|
|
- // }
|
|
|
- // else if (rList.length > 6 &&
|
|
|
- // "realtimepointdata".equalsIgnoreCase(rList[2])) {
|
|
|
- // String key = rList[0] + "-" + rList[1] + "-" +
|
|
|
- // rList[5] +
|
|
|
- // "." + rList[6];
|
|
|
- // String id = rList[0] + "-" + rList[1] + "-" +
|
|
|
- // rList[4];
|
|
|
- // Constant.id2time.put(key,
|
|
|
- // System.currentTimeMillis());
|
|
|
- // Constant.id2point.put(id, key);
|
|
|
- // Constant.id2function.put(id, "realtimepointdata");
|
|
|
- // Constant.id2status.put(id, "processing:rcvd");
|
|
|
- //
|
|
|
- // StringBuffer sb1 = new StringBuffer();
|
|
|
- // sb1 = this.getCacheData2(rList);
|
|
|
- // server.AppendToSend(p.address, new
|
|
|
- // Packet(sb1.toString()));
|
|
|
- // LogUtil.info(server.Name() + " AppendToSend: " +
|
|
|
- // p.address + " " + sb.toString());
|
|
|
- // }
|
|
|
}
|
|
|
LogUtil.info("CollectThread Challenge Constant.CollectReportList release...");
|
|
|
|
|
@@ -749,59 +735,53 @@ public class CollectThread extends Thread {
|
|
|
// return true;
|
|
|
// }
|
|
|
|
|
|
- // private StringBuffer getCacheData(String[] rList) {
|
|
|
- // // TODO Auto-generated method stub
|
|
|
- // Record record = new Record();
|
|
|
- // StringBuffer sb = new StringBuffer();
|
|
|
- // if (Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" +
|
|
|
- // rList[6]) != null) {
|
|
|
- // int address = Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-"
|
|
|
- // + rList[6]);
|
|
|
- // record = Constant.RecordList.get(address);
|
|
|
- // // Constant.info("get pointread by address !");
|
|
|
- // } else {
|
|
|
- // for (Record r : Constant.RecordList) {
|
|
|
- // if (rList[0].equalsIgnoreCase(r.buildingSign) &&
|
|
|
- // rList[5].equalsIgnoreCase(r.meterSign)
|
|
|
- // && Integer.valueOf(rList[6]) == r.funcID) {
|
|
|
- // record = r;
|
|
|
- // // Constant.info("get pointread by for circle !");
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // sb.append(rList[0]).append(";").append(rList[1]).append(";").append("pointreadack").append(";")
|
|
|
- // .append(Constant.format(record.receivetime)).append(";").append(rList[4]).append(";")
|
|
|
- // .append(record.meterSign).append(";").append(record.funcID).append(";").append(record.data).append(";");
|
|
|
- // return sb;
|
|
|
- // }
|
|
|
+ private StringBuffer getCacheData(String[] rList) {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ Record record = new Record();
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ if (Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" + rList[6]) != null) {
|
|
|
+ int address = Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" + rList[6]);
|
|
|
+ record = Constant.RecordList.get(address);
|
|
|
+ // Constant.info("get pointread by address !");
|
|
|
+ } else {
|
|
|
+ for (Record r : Constant.RecordList) {
|
|
|
+ if (rList[0].equalsIgnoreCase(r.buildingSign) && rList[5].equalsIgnoreCase(r.meterSign)
|
|
|
+ && Integer.valueOf(rList[6]) == r.funcID) {
|
|
|
+ record = r;
|
|
|
+ // Constant.info("get pointread by for circle !");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sb.append(rList[0]).append(";").append(rList[1]).append(";").append("pointreadack").append(";")
|
|
|
+ .append(Constant.format(record.receivetime)).append(";").append(rList[4]).append(";")
|
|
|
+ .append(record.meterSign).append(";").append(record.funcID).append(";").append(record.data).append(";");
|
|
|
+ return sb;
|
|
|
+ }
|
|
|
|
|
|
- // private StringBuffer getCacheData2(String[] rList) {
|
|
|
- // // TODO Auto-generated method stub
|
|
|
- // Record record = new Record();
|
|
|
- // StringBuffer sb = new StringBuffer();
|
|
|
- // if (Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" +
|
|
|
- // rList[6]) != null) {
|
|
|
- // int address = Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-"
|
|
|
- // + rList[6]);
|
|
|
- // record = Constant.RecordList.get(address);
|
|
|
- // // Constant.info("get pointread by address !");
|
|
|
- // } else {
|
|
|
- // for (Record r : Constant.RecordList) {
|
|
|
- // if (rList[0].equalsIgnoreCase(r.buildingSign) &&
|
|
|
- // rList[5].equalsIgnoreCase(r.meterSign)
|
|
|
- // && Integer.valueOf(rList[6]) == r.funcID) {
|
|
|
- // record = r;
|
|
|
- // // Constant.info("get pointread by for circle !");
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // sb.append(rList[0]).append(";").append(rList[1]).append(";").append("realtimepointdataack").append(";")
|
|
|
- // .append(Constant.format(record.receivetime)).append(";").append(rList[4]).append(";")
|
|
|
- // .append(record.meterSign).append(";").append(record.funcID).append(";").append(record.data).append(";");
|
|
|
- // return sb;
|
|
|
- // }
|
|
|
+ private StringBuffer getCacheData2(String[] rList) {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ Record record = new Record();
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ if (Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" + rList[6]) != null) {
|
|
|
+ int address = Constant.RecordAddress.get(rList[0] + "-" + rList[5] + "-" + rList[6]);
|
|
|
+ record = Constant.RecordList.get(address);
|
|
|
+ // Constant.info("get pointread by address !");
|
|
|
+ } else {
|
|
|
+ for (Record r : Constant.RecordList) {
|
|
|
+ if (rList[0].equalsIgnoreCase(r.buildingSign) && rList[5].equalsIgnoreCase(r.meterSign)
|
|
|
+ && Integer.valueOf(rList[6]) == r.funcID) {
|
|
|
+ record = r;
|
|
|
+ // Constant.info("get pointread by for circle !");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ sb.append(rList[0]).append(";").append(rList[1]).append(";").append("realtimepointdataack").append(";")
|
|
|
+ .append(Constant.format(record.receivetime)).append(";").append(rList[4]).append(";")
|
|
|
+ .append(record.meterSign).append(";").append(record.funcID).append(";").append(record.data).append(";");
|
|
|
+ return sb;
|
|
|
+ }
|
|
|
// private boolean needHandle(Date receivetime) {
|
|
|
// // TODO Auto-generated method stub
|
|
|
// try {
|