Commit 0db3aabb9bcf3ba1672b76d0605b915349593338

Authored by ljq
1 parent 77a74bd9

数字基建接口--以及配置文件数据库配置修改

src/main/java/com/bsth/server_rs/bigdata/BigscreenService.java
@@ -1270,8 +1270,166 @@ public class BigscreenService { @@ -1270,8 +1270,166 @@ public class BigscreenService {
1270 1270
1271 return JSON.parseObject(JSON.toJSONString(resMap)); 1271 return JSON.parseObject(JSON.toJSONString(resMap));
1272 } 1272 }
1273 -  
1274 - /**临港给投控的指标接口(周文彬) 1273 +
  1274 +
  1275 +
  1276 + /**给大屏按日期查线路指标 --临港数字基建
  1277 + *
  1278 + */
  1279 + @GET
  1280 + @Path("/selectData/getScheduleStatistics_lg/{date}")
  1281 + public List getScheduleStatistic_lg(@PathParam("date") String date){
  1282 + Map<String, Object> resMap = new HashMap<String, Object>();
  1283 +
  1284 + String gpLineSql = "select * from bsth_c_line_plate";
  1285 + List<Map<String, Object>> gpLineList=jdbcTemplate.query(gpLineSql,
  1286 + new RowMapper<Map<String, Object>>(){
  1287 + @Override
  1288 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  1289 + Map<String, Object> m=new HashMap<String,Object>();
  1290 + m.put("lineName", rs.getString("line_name"));
  1291 + m.put("lineCode", rs.getString("line_code"));
  1292 + return m;
  1293 + }
  1294 + });
  1295 +
  1296 + Set<String> gpSet = new HashSet<String>();
  1297 + for(Map<String, Object> t : gpLineList){
  1298 + if(t.get("lineCode") != null && t.get("lineCode").toString().trim().length() > 0){
  1299 + gpSet.add(t.get("lineCode").toString().trim());
  1300 + }
  1301 + }
  1302 +
  1303 + String yyxlSql="SELECT line_code from bsth_c_line "
  1304 + + " where nature in ('yxl','cgxl','gjxl','csbs','cctxl')";
  1305 + List<Map<String, Object>> yyxlList=jdbcTemplate.query(yyxlSql,
  1306 + new RowMapper<Map<String, Object>>(){
  1307 + @Override
  1308 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  1309 + Map<String, Object> m=new HashMap<String,Object>();
  1310 + m.put("lineCode", rs.getString("line_code"));
  1311 + return m;
  1312 + }
  1313 + });
  1314 + Set<String> yyLine = new HashSet<String>();
  1315 + for(Map<String, Object> t : yyxlList){
  1316 + if(t.get("lineCode") != null){
  1317 + yyLine.add(t.get("lineCode").toString());
  1318 + }
  1319 + }
  1320 +
  1321 + String sql="select xl,xl_name,date,jhbc,bczxl,jhbcz,sjbc,jhcc,sjcc,ccl,"
  1322 + + " jhyylc,sjyylc,jhyylcz,jhkslc,sjkslc,jhkslcz,"
  1323 + + " jhssgfbcs,sjgfbcs,jhgfbcsz,jhssdgbcs,sjdgbcs,jhdgbcsz,"
  1324 + + " jhsmbcs,sjsmbczds,smbczdl,jhsmbcsz,sjsmbczdsz,smbczdlz,"
  1325 + + " jhszfcs,sjszfczds,szfczdl,create_date"
  1326 + + " from bsth_c_calc_count "
  1327 + + " where date = ? ";
  1328 +
  1329 + List<Map<String, Object>> list=jdbcTemplate.query(sql, new Object[]{date},
  1330 + new RowMapper<Map<String, Object>>(){
  1331 + @Override
  1332 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  1333 + Map<String, Object> m=new HashMap<String,Object>();
  1334 + m.put("lineCode",rs.getString("xl"));
  1335 + m.put("lineName", rs.getString("xl_name"));
  1336 + m.put("date", rs.getString("date"));
  1337 +
  1338 + m.put("jhbc", rs.getString("jhbc"));
  1339 + m.put("sjbc", rs.getString("sjbc"));
  1340 + m.put("bczxl", rs.getString("bczxl"));
  1341 + m.put("jhbcz", rs.getString("jhbcz"));
  1342 +
  1343 + m.put("jhcc", rs.getString("jhcc"));
  1344 + m.put("sjcc", rs.getString("sjcc"));
  1345 + m.put("ccl", rs.getString("ccl"));
  1346 +
  1347 + m.put("jhyylc", rs.getString("jhyylc"));
  1348 + m.put("sjyylc", rs.getString("sjyylc"));
  1349 + m.put("jhyylcz", rs.getString("jhyylcz"));
  1350 + m.put("jhkslc", rs.getString("jhkslc"));
  1351 + m.put("sjkslc", rs.getString("sjkslc"));
  1352 + m.put("jhkslcz", rs.getString("jhkslcz"));
  1353 +
  1354 + m.put("jhgfbcs", rs.getString("jhssgfbcs"));
  1355 + m.put("sjgfbcs", rs.getString("sjgfbcs"));
  1356 + m.put("jhgfbcsz", rs.getString("jhgfbcsz"));
  1357 + m.put("jhdgbcs", rs.getString("jhssdgbcs"));
  1358 + m.put("sjdgbcs", rs.getString("sjdgbcs"));
  1359 + m.put("jhdgbcsz", rs.getString("jhdgbcsz"));
  1360 +
  1361 + m.put("jhsmbcs", rs.getString("jhsmbcs"));
  1362 + m.put("sjsmbczds", rs.getString("sjsmbczds"));
  1363 + m.put("smbczdl", rs.getString("smbczdl"));
  1364 + m.put("jhsmbcsz", rs.getString("jhsmbcsz"));
  1365 + m.put("sjsmbczdsz", rs.getString("sjsmbczdsz"));
  1366 + m.put("smbczdlz", rs.getString("smbczdlz"));
  1367 +
  1368 + m.put("jhszfcs", rs.getString("jhszfcs"));
  1369 + m.put("sjszfczds", rs.getString("sjszfczds"));
  1370 + m.put("szfczdl", rs.getString("szfczdl"));
  1371 +
  1372 + Date date = new Date();
  1373 + date.setTime(rs.getTimestamp("create_date").getTime());
  1374 + m.put("createDate", sdf.format(date));
  1375 + return m;
  1376 + }
  1377 + });
  1378 +
  1379 + List<Map<String, Object>> bcDetail = new ArrayList<Map<String,Object>>();
  1380 + List<Map<String, Object>> smDetail = new ArrayList<Map<String,Object>>();
  1381 + List<Map<String, Object>> qqDetail = new ArrayList<Map<String,Object>>();
  1382 +
  1383 +
  1384 + BigDecimal yygl_z = new BigDecimal(0);//实时总营运里程
  1385 +
  1386 + for(Map<String, Object> t : list){
  1387 + if(yyLine.contains(t.get("lineCode").toString())){
  1388 + yygl_z = yygl_z.add(new BigDecimal(t.get("sjyylc").toString()));
  1389 +
  1390 +
  1391 + Map<String, Object> bc = new HashMap<String, Object>();
  1392 + bc.put("type", "班次执行详情");
  1393 + bc.put("lineName", t.get("lineName").toString());
  1394 + bc.put("jh", t.get("jhbc").toString());
  1395 + bc.put("sj", t.get("sjbc").toString());
  1396 + Double bfbbc = Double.valueOf(t.get("sjbc").toString()) / Double.valueOf(t.get("jhbc").toString());
  1397 + bc.put("bfb", String.format("%.2f", bfbbc * 100)+ "%");
  1398 + bcDetail.add(bc);
  1399 +
  1400 + Map<String, Object> sm = new HashMap<String, Object>();
  1401 + sm.put("type", "首末班准点详情");
  1402 + sm.put("lineName", t.get("lineName").toString());
  1403 + sm.put("jh", t.get("jhsmbcs").toString());
  1404 + sm.put("sj", t.get("sjsmbczds").toString());
  1405 + Double bfbsm = Double.valueOf(t.get("sjsmbczds").toString()) / Double.valueOf(t.get("jhsmbcs").toString());
  1406 + sm.put("bfb", String.format("%.2f", bfbsm * 100)+ "%");
  1407 + smDetail.add(sm);
  1408 +
  1409 + Map<String, Object> qq = new HashMap<String, Object>();
  1410 + qq.put("type", "班次准点详情");
  1411 + qq.put("lineName", t.get("lineName").toString());
  1412 + qq.put("jh", t.get("jhszfcs").toString());
  1413 + qq.put("sj", t.get("sjszfczds").toString());
  1414 + Double bfbqq = Double.valueOf(t.get("sjszfczds").toString()) / Double.valueOf(t.get("jhszfcs").toString());
  1415 + qq.put("bfb", String.format("%.2f", bfbqq * 100) + "%");
  1416 + qqDetail.add(qq);
  1417 + }
  1418 + }
  1419 +
  1420 +
  1421 +
  1422 + List<Map<String, Object>> detailsList = new ArrayList<Map<String, Object>>();
  1423 +
  1424 + detailsList.addAll(bcDetail);
  1425 + detailsList.addAll(smDetail);
  1426 + detailsList.addAll(qqDetail);
  1427 +
  1428 + return detailsList;
  1429 + }
  1430 +
  1431 +
  1432 + /**临港给投控的指标接口(周文彬)
1275 * 出车率(资料上没有要出车率,要到站准点率但是这里没有),班次执行率,起讫站准点率,首末班车准点率,挂牌线路准点率,签卡率 1433 * 出车率(资料上没有要出车率,要到站准点率但是这里没有),班次执行率,起讫站准点率,首末班车准点率,挂牌线路准点率,签卡率
1276 */ 1434 */
1277 @GET 1435 @GET
src/main/resources/ms-jdbc.properties
@@ -6,4 +6,4 @@ @@ -6,4 +6,4 @@
6 ms.mysql.driver= com.mysql.jdbc.Driver 6 ms.mysql.driver= com.mysql.jdbc.Driver
7 ms.mysql.url= jdbc:mysql://10.10.150.103/ms?useUnicode=true&characterEncoding=utf-8 7 ms.mysql.url= jdbc:mysql://10.10.150.103/ms?useUnicode=true&characterEncoding=utf-8
8 ms.mysql.username= root 8 ms.mysql.username= root
9 -ms.mysql.password= Aa123456  
10 \ No newline at end of file 9 \ No newline at end of file
  10 +ms.mysql.password= fsodlgjiuigAQF2$9fs9
11 \ No newline at end of file 11 \ No newline at end of file
src/main/resources/xxfb-jdbc.properties
@@ -6,4 +6,4 @@ @@ -6,4 +6,4 @@
6 xxfb.mysql.driver= com.mysql.jdbc.Driver 6 xxfb.mysql.driver= com.mysql.jdbc.Driver
7 xxfb.mysql.url= jdbc:mysql://10.10.150.113/info_publish?useUnicode=true&characterEncoding=utf-8 7 xxfb.mysql.url= jdbc:mysql://10.10.150.113/info_publish?useUnicode=true&characterEncoding=utf-8
8 xxfb.mysql.username= root 8 xxfb.mysql.username= root
9 -xxfb.mysql.password= Aa123456  
10 \ No newline at end of file 9 \ No newline at end of file
  10 +xxfb.mysql.password= fsodlgjiuigAQF2$9fs9
11 \ No newline at end of file 11 \ No newline at end of file