|
@@ -183,7 +183,7 @@ public class CamelRestConfiguration extends RouteBuilder {
|
183
|
183
|
// String offset = jsonObject.getString("offset");
|
184
|
184
|
String jh = well_id.replace(" ", "");
|
185
|
185
|
z.setWell_common_name(jh);
|
186
|
|
- String gtsj = TransUtil.trans(jsonObject.getString("offset"),jsonObject.getString("load"));
|
|
186
|
+ String gtsj = TransUtil.tranSGT(jsonObject.getString("offset"),jsonObject.getString("load"));
|
187
|
187
|
Date timeRtu = null;
|
188
|
188
|
String rtutime = jsonObject.getString("time");
|
189
|
189
|
timeRtu = fomat3.parse("0000-00-00 00:".equals(rtutime)? "2021-04-10 10:10": rtutime);
|
|
@@ -223,7 +223,7 @@ public class CamelRestConfiguration extends RouteBuilder {
|
223
|
223
|
@Override
|
224
|
224
|
public synchronized void configure() throws Exception {
|
225
|
225
|
|
226
|
|
- /* JSONObject body = new JSONObject();
|
|
226
|
+ JSONObject body = new JSONObject();
|
227
|
227
|
|
228
|
228
|
restConfiguration()
|
229
|
229
|
.component("servlet")
|
|
@@ -239,21 +239,16 @@ public class CamelRestConfiguration extends RouteBuilder {
|
239
|
239
|
in.setHeader("id",aRow.get("data"));
|
240
|
240
|
in.setHeader("date", getDate());
|
241
|
241
|
})
|
242
|
|
-// .setBody(simple("${header[data]}"))
|
243
|
|
-// .setBody(simple(body.toJSONString()))
|
|
242
|
+
|
244
|
243
|
.setBody(simple("${in.header.id}"))
|
245
|
|
-// .log("${header.id}")
|
246
|
244
|
.split(body()).process(
|
247
|
245
|
exchange -> {
|
248
|
246
|
Message in = exchange.getIn();
|
249
|
247
|
HashMap<String, Object> aRow = in.getBody(HashMap.class);
|
250
|
|
-// loadDate(,aRow.get("id")+"/analyse/功图数据", );
|
251
|
|
-// in.setHeader("id",aRow.get("id")+"/analyse/功图数据");
|
252
|
|
-// in.setHeader("wellid",aRow.get("code"));
|
253
|
248
|
if (aRow.get("typeName").toString().indexOf("油井")> 0){
|
254
|
249
|
Double phd = "".equals(loadPhdDate(aRow.get("id").toString())) ? 0 : Double.valueOf(loadPhdDate(aRow.get("id").toString()) );
|
255
|
250
|
ZDJG_WELL zdjg_well = loadGtData(aRow.get("id")+"/analyse/功图数据", aRow.get("code").toString(), "2021-08-17");
|
256
|
|
- aRow.put("sgt",gtTransUtil(zdjg_well.getZd_init_sgt()) );//null
|
|
251
|
+ aRow.put("sgt",zdjg_well.getZd_init_sgt() );//null
|
257
|
252
|
aRow.put("susp_max_load",zdjg_well.getSxzh());//最大载荷
|
258
|
253
|
aRow.put("susp_min_load",zdjg_well.getXxzh());//最小载荷
|
259
|
254
|
aRow.put("stroke",zdjg_well.getStroke());
|
|
@@ -262,8 +257,6 @@ public class CamelRestConfiguration extends RouteBuilder {
|
262
|
257
|
aRow.put("well_name",aRow.get("code"));
|
263
|
258
|
aRow.put("phd",phd== null ? 0: phd);
|
264
|
259
|
}
|
265
|
|
-
|
266
|
|
-
|
267
|
260
|
})
|
268
|
261
|
// .log("${body[phd]}"+ "sql" + "${body[well_name]}")
|
269
|
262
|
.doTry()
|
|
@@ -272,7 +265,7 @@ public class CamelRestConfiguration extends RouteBuilder {
|
272
|
265
|
// "where NOT EXISTS (SELECT * FROM centralbase.cb_temp_well_mech_runtime WHERE well_id = '${body[well_name]}' and prod_date = '${in.header.date}' )"))
|
273
|
266
|
.to("jdbc:centralbase")
|
274
|
267
|
.doCatch(Exception.class)
|
275
|
|
- .end();*/
|
|
268
|
+ .end();
|
276
|
269
|
|
277
|
270
|
/* JSONArray jsonArray = new JSONArray();
|
278
|
271
|
JSONObject search = new JSONObject();
|