Commit e3672a569a2f597c5809ce72f2a6bbce0c1eac16
1 parent
a99edb40
统计日报大间隔计算方法修正
Showing
2 changed files
with
82 additions
and
76 deletions
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| @@ -1321,17 +1321,19 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -1321,17 +1321,19 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 1321 | for (int j = 0; j < list.size(); j++) { | 1321 | for (int j = 0; j < list.size(); j++) { |
| 1322 | ScheduleRealInfo sinfo=list.get(j); | 1322 | ScheduleRealInfo sinfo=list.get(j); |
| 1323 | try { | 1323 | try { |
| 1324 | - if(sinfo.getXlBm().equals(lineCode)){ | ||
| 1325 | - ScheduleRealInfo s=checkBc(sinfo); | ||
| 1326 | - String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual(); | ||
| 1327 | - if(!fcsj.equals("")){ | ||
| 1328 | - Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime(); | ||
| 1329 | - s.setFcsjActualTime(fcsjAcual); | ||
| 1330 | - s.setFcsjActual(fcsj); | ||
| 1331 | - listInfo.add(s); | 1324 | + if(!sinfo.getBcType().equals("in")&&!sinfo.getBcType().equals("out")&&!sinfo.getBcType().equals("ldks")){ |
| 1325 | + if(sinfo.getXlBm().equals(lineCode)){ | ||
| 1326 | + ScheduleRealInfo s=checkBc(sinfo); | ||
| 1327 | + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual(); | ||
| 1328 | + if(!fcsj.equals("")){ | ||
| 1329 | + Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime(); | ||
| 1330 | + s.setFcsjActualTime(fcsjAcual); | ||
| 1331 | + s.setFcsjActual(fcsj); | ||
| 1332 | + listInfo.add(s); | ||
| 1333 | + } | ||
| 1334 | + | ||
| 1335 | + } | ||
| 1332 | } | 1336 | } |
| 1333 | - | ||
| 1334 | - } | ||
| 1335 | } catch (ParseException e) { | 1337 | } catch (ParseException e) { |
| 1336 | // TODO Auto-generated catch block | 1338 | // TODO Auto-generated catch block |
| 1337 | e.printStackTrace(); | 1339 | e.printStackTrace(); |
| @@ -1384,7 +1386,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -1384,7 +1386,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 1384 | if(s.getXlDir().equals("0")){ | 1386 | if(s.getXlDir().equals("0")){ |
| 1385 | listInfo0.add(s); | 1387 | listInfo0.add(s); |
| 1386 | }else{ | 1388 | }else{ |
| 1387 | - listInfo0.add(s); | 1389 | + listInfo1.add(s); |
| 1388 | } | 1390 | } |
| 1389 | 1391 | ||
| 1390 | } | 1392 | } |
| @@ -1394,76 +1396,80 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -1394,76 +1396,80 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 1394 | int djgcsq=0; | 1396 | int djgcsq=0; |
| 1395 | long djcsj=0l; | 1397 | long djcsj=0l; |
| 1396 | for (int i = 0; i < listInfo0.size(); i++) { | 1398 | for (int i = 0; i < listInfo0.size(); i++) { |
| 1397 | - ScheduleRealInfo s=listInfo.get(i); | 1399 | + ScheduleRealInfo s=listInfo0.get(i); |
| 1398 | Long fcsjTime=s.getFcsjActualTime(); | 1400 | Long fcsjTime=s.getFcsjActualTime(); |
| 1399 | String time=s.getFcsjActual(); | 1401 | String time=s.getFcsjActual(); |
| 1400 | String[] fcsjStr = time.split(":"); | 1402 | String[] fcsjStr = time.split(":"); |
| 1401 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 1403 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); |
| 1402 | - if(i<listInfo.size()-1){ | 1404 | + if(i<listInfo0.size()-1){ |
| 1403 | Long djg=0l; | 1405 | Long djg=0l; |
| 1404 | - Long fscjNext=listInfo.get(i+1).getFcsjActualTime(); | ||
| 1405 | - if((fcsj>=zgf1&&fcsj<=zgf2)){ | ||
| 1406 | - djg = (long) (peak*60*1000); | ||
| 1407 | - if(fscjNext-fcsjTime>djg){ | ||
| 1408 | - djgcsz ++; | ||
| 1409 | - djgcsq ++; | ||
| 1410 | - if(fscjNext-fcsjTime>djcsj){ | ||
| 1411 | - djcsj=(fscjNext-fcsjTime)/60000; | 1406 | + if(s.getScheduleDateStr().equals(listInfo0.get(i+1).getScheduleDateStr())){ |
| 1407 | + Long fscjNext=listInfo0.get(i+1).getFcsjActualTime(); | ||
| 1408 | + if((fcsj>=zgf1&&fcsj<=zgf2)){ | ||
| 1409 | + djg = (long) (peak*60*1000); | ||
| 1410 | + if(fscjNext-fcsjTime>djg){ | ||
| 1411 | + djgcsz ++; | ||
| 1412 | + djgcsq ++; | ||
| 1413 | + if((fscjNext-fcsjTime)/60000>djcsj){ | ||
| 1414 | + djcsj=(fscjNext-fcsjTime)/60000; | ||
| 1415 | + } | ||
| 1412 | } | 1416 | } |
| 1413 | - } | ||
| 1414 | - }else if((fcsj>=wgf1&&fcsj<=wgf2)){ | ||
| 1415 | - djg = (long) (peak*60*1000); | ||
| 1416 | - if(fscjNext-fcsjTime>djg){ | ||
| 1417 | - djgcsw ++; | ||
| 1418 | - djgcsq ++; | ||
| 1419 | - if(fscjNext-fcsjTime>djcsj){ | ||
| 1420 | - djcsj=(fscjNext-fcsjTime)/60000; | 1417 | + }else if((fcsj>=wgf1&&fcsj<=wgf2)){ |
| 1418 | + djg = (long) (peak*60*1000); | ||
| 1419 | + if(fscjNext-fcsjTime>djg){ | ||
| 1420 | + djgcsw ++; | ||
| 1421 | + djgcsq ++; | ||
| 1422 | + if((fscjNext-fcsjTime)/60000>djcsj){ | ||
| 1423 | + djcsj=(fscjNext-fcsjTime)/60000; | ||
| 1424 | + } | ||
| 1421 | } | 1425 | } |
| 1422 | - } | ||
| 1423 | - }else{ | ||
| 1424 | - djg = (long) (trough*60*1000); | ||
| 1425 | - if(fscjNext-fcsjTime>djg){ | ||
| 1426 | - djgcsq ++; | ||
| 1427 | - if(fscjNext-fcsjTime>djcsj){ | ||
| 1428 | - djcsj=(fscjNext-fcsjTime)/60000; | 1426 | + }else{ |
| 1427 | + djg = (long) (trough*60*1000); | ||
| 1428 | + if(fscjNext-fcsjTime>djg){ | ||
| 1429 | + djgcsq ++; | ||
| 1430 | + if((fscjNext-fcsjTime)/60000>djcsj){ | ||
| 1431 | + djcsj=(fscjNext-fcsjTime)/60000; | ||
| 1432 | + } | ||
| 1429 | } | 1433 | } |
| 1430 | } | 1434 | } |
| 1431 | } | 1435 | } |
| 1432 | } | 1436 | } |
| 1433 | } | 1437 | } |
| 1434 | for (int i = 0; i < listInfo1.size(); i++) { | 1438 | for (int i = 0; i < listInfo1.size(); i++) { |
| 1435 | - ScheduleRealInfo s=listInfo.get(i); | 1439 | + ScheduleRealInfo s=listInfo1.get(i); |
| 1436 | Long fcsjTime=s.getFcsjActualTime(); | 1440 | Long fcsjTime=s.getFcsjActualTime(); |
| 1437 | String time=s.getFcsjActual(); | 1441 | String time=s.getFcsjActual(); |
| 1438 | String[] fcsjStr = time.split(":"); | 1442 | String[] fcsjStr = time.split(":"); |
| 1439 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 1443 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); |
| 1440 | - if(i<listInfo.size()-1){ | 1444 | + if(i<listInfo1.size()-1){ |
| 1441 | Long djg=0l; | 1445 | Long djg=0l; |
| 1442 | - Long fscjNext=listInfo.get(i+1).getFcsjActualTime(); | ||
| 1443 | - if(fcsj>=zgf1&&fcsj<=zgf2){ | ||
| 1444 | - djg = (long) (peak*60*1000); | ||
| 1445 | - if(fscjNext-fcsjTime>djg){ | ||
| 1446 | - djgcsz ++; | ||
| 1447 | - djgcsq ++; | ||
| 1448 | - if(fscjNext-fcsjTime>djcsj){ | ||
| 1449 | - djcsj=(fscjNext-fcsjTime)/60000; | 1446 | + if(s.getScheduleDateStr().equals(listInfo1.get(i+1).getScheduleDateStr())){ |
| 1447 | + Long fscjNext=listInfo1.get(i+1).getFcsjActualTime(); | ||
| 1448 | + if(fcsj>=zgf1&&fcsj<=zgf2){ | ||
| 1449 | + djg = (long) (peak*60*1000); | ||
| 1450 | + if(fscjNext-fcsjTime>djg){ | ||
| 1451 | + djgcsz ++; | ||
| 1452 | + djgcsq ++; | ||
| 1453 | + if((fscjNext-fcsjTime)/60000>djcsj){ | ||
| 1454 | + djcsj=(fscjNext-fcsjTime)/60000; | ||
| 1455 | + } | ||
| 1450 | } | 1456 | } |
| 1451 | - } | ||
| 1452 | - }else if(fcsj>=wgf1&&fcsj<=wgf2){ | ||
| 1453 | - djg = (long) (peak*60*1000); | ||
| 1454 | - if(fscjNext-fcsjTime>djg){ | ||
| 1455 | - djgcsw ++; | ||
| 1456 | - djgcsq ++; | ||
| 1457 | - if(fscjNext-fcsjTime>djcsj){ | ||
| 1458 | - djcsj=(fscjNext-fcsjTime)/60000; | 1457 | + }else if(fcsj>=wgf1&&fcsj<=wgf2){ |
| 1458 | + djg = (long) (peak*60*1000); | ||
| 1459 | + if(fscjNext-fcsjTime>djg){ | ||
| 1460 | + djgcsw ++; | ||
| 1461 | + djgcsq ++; | ||
| 1462 | + if((fscjNext-fcsjTime)/60000>djcsj){ | ||
| 1463 | + djcsj=(fscjNext-fcsjTime)/60000; | ||
| 1464 | + } | ||
| 1459 | } | 1465 | } |
| 1460 | - } | ||
| 1461 | - }else{ | ||
| 1462 | - djg = (long) (trough*60*1000); | ||
| 1463 | - if(fscjNext-fcsjTime>djg){ | ||
| 1464 | - djgcsq ++; | ||
| 1465 | - if(fscjNext-fcsjTime>djcsj){ | ||
| 1466 | - djcsj=(fscjNext-fcsjTime)/60000; | 1466 | + }else{ |
| 1467 | + djg = (long) (trough*60*1000); | ||
| 1468 | + if(fscjNext-fcsjTime>djg){ | ||
| 1469 | + djgcsq ++; | ||
| 1470 | + if((fscjNext-fcsjTime)/60000>djcsj){ | ||
| 1471 | + djcsj=(fscjNext-fcsjTime)/60000; | ||
| 1472 | + } | ||
| 1467 | } | 1473 | } |
| 1468 | } | 1474 | } |
| 1469 | } | 1475 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -3324,7 +3324,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -3324,7 +3324,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3324 | if(s.getXlDir().equals("0")){ | 3324 | if(s.getXlDir().equals("0")){ |
| 3325 | listInfo0.add(s); | 3325 | listInfo0.add(s); |
| 3326 | }else{ | 3326 | }else{ |
| 3327 | - listInfo0.add(s); | 3327 | + listInfo1.add(s); |
| 3328 | } | 3328 | } |
| 3329 | 3329 | ||
| 3330 | } | 3330 | } |
| @@ -3337,14 +3337,14 @@ public class ReportServiceImpl implements ReportService{ | @@ -3337,14 +3337,14 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3337 | int djgcs=0; | 3337 | int djgcs=0; |
| 3338 | List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>(); | 3338 | List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>(); |
| 3339 | for (int i = 0; i < listInfo0.size(); i++) { | 3339 | for (int i = 0; i < listInfo0.size(); i++) { |
| 3340 | - ScheduleRealInfo s=listInfo.get(i); | 3340 | + ScheduleRealInfo s=listInfo0.get(i); |
| 3341 | Long fcsjTime=s.getFcsjActualTime(); | 3341 | Long fcsjTime=s.getFcsjActualTime(); |
| 3342 | String time=s.getFcsjActual(); | 3342 | String time=s.getFcsjActual(); |
| 3343 | String[] fcsjStr = time.split(":"); | 3343 | String[] fcsjStr = time.split(":"); |
| 3344 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 3344 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); |
| 3345 | - if(i<listInfo.size()-1){ | 3345 | + if(i<listInfo0.size()-1){ |
| 3346 | Long djg=0l; | 3346 | Long djg=0l; |
| 3347 | - Long fscjNext=listInfo.get(i+1).getFcsjActualTime(); | 3347 | + Long fscjNext=listInfo0.get(i+1).getFcsjActualTime(); |
| 3348 | if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){ | 3348 | if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){ |
| 3349 | djg = (long) (peak*60*1000); | 3349 | djg = (long) (peak*60*1000); |
| 3350 | if(fscjNext-fcsjTime>djg){ | 3350 | if(fscjNext-fcsjTime>djg){ |
| @@ -3355,8 +3355,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3355,8 +3355,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3355 | m.put("djgde", grade); | 3355 | m.put("djgde", grade); |
| 3356 | m.put("qJh", s.getFcsj()); | 3356 | m.put("qJh", s.getFcsj()); |
| 3357 | m.put("qSj", time); | 3357 | m.put("qSj", time); |
| 3358 | - m.put("hJh", listInfo.get(i+1).getFcsj()); | ||
| 3359 | - m.put("hSj", listInfo.get(i+1).getFcsjActual()); | 3358 | + m.put("hJh", listInfo0.get(i+1).getFcsj()); |
| 3359 | + m.put("hSj", listInfo0.get(i+1).getFcsjActual()); | ||
| 3360 | m.put("djgsj", peak); | 3360 | m.put("djgsj", peak); |
| 3361 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); | 3361 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); |
| 3362 | mapList.add(m); | 3362 | mapList.add(m); |
| @@ -3371,8 +3371,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3371,8 +3371,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3371 | m.put("djgde", grade); | 3371 | m.put("djgde", grade); |
| 3372 | m.put("qJh", s.getFcsj()); | 3372 | m.put("qJh", s.getFcsj()); |
| 3373 | m.put("qSj", time); | 3373 | m.put("qSj", time); |
| 3374 | - m.put("hJh", listInfo.get(i+1).getFcsj()); | ||
| 3375 | - m.put("hSj", listInfo.get(i+1).getFcsjActual()); | 3374 | + m.put("hJh", listInfo0.get(i+1).getFcsj()); |
| 3375 | + m.put("hSj", listInfo0.get(i+1).getFcsjActual()); | ||
| 3376 | m.put("djgsj", trough); | 3376 | m.put("djgsj", trough); |
| 3377 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); | 3377 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); |
| 3378 | mapList.add(m); | 3378 | mapList.add(m); |
| @@ -3382,14 +3382,14 @@ public class ReportServiceImpl implements ReportService{ | @@ -3382,14 +3382,14 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3382 | } | 3382 | } |
| 3383 | 3383 | ||
| 3384 | for (int i = 0; i < listInfo1.size(); i++) { | 3384 | for (int i = 0; i < listInfo1.size(); i++) { |
| 3385 | - ScheduleRealInfo s=listInfo.get(i); | 3385 | + ScheduleRealInfo s=listInfo1.get(i); |
| 3386 | Long fcsjTime=s.getFcsjActualTime(); | 3386 | Long fcsjTime=s.getFcsjActualTime(); |
| 3387 | String time=s.getFcsjActual(); | 3387 | String time=s.getFcsjActual(); |
| 3388 | String[] fcsjStr = time.split(":"); | 3388 | String[] fcsjStr = time.split(":"); |
| 3389 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 3389 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); |
| 3390 | - if(i<listInfo.size()-1){ | 3390 | + if(i<listInfo1.size()-1){ |
| 3391 | Long djg=0l; | 3391 | Long djg=0l; |
| 3392 | - Long fscjNext=listInfo.get(i+1).getFcsjActualTime(); | 3392 | + Long fscjNext=listInfo1.get(i+1).getFcsjActualTime(); |
| 3393 | if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){ | 3393 | if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){ |
| 3394 | djg = (long) (peak*60*1000); | 3394 | djg = (long) (peak*60*1000); |
| 3395 | if(fscjNext-fcsjTime>djg){ | 3395 | if(fscjNext-fcsjTime>djg){ |
| @@ -3400,8 +3400,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3400,8 +3400,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3400 | m.put("djgde", grade); | 3400 | m.put("djgde", grade); |
| 3401 | m.put("qJh", s.getFcsj()); | 3401 | m.put("qJh", s.getFcsj()); |
| 3402 | m.put("qSj", time); | 3402 | m.put("qSj", time); |
| 3403 | - m.put("hJh", listInfo.get(i+1).getFcsj()); | ||
| 3404 | - m.put("hSj", listInfo.get(i+1).getFcsjActual()); | 3403 | + m.put("hJh", listInfo1.get(i+1).getFcsj()); |
| 3404 | + m.put("hSj", listInfo1.get(i+1).getFcsjActual()); | ||
| 3405 | m.put("djgsj", peak); | 3405 | m.put("djgsj", peak); |
| 3406 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); | 3406 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); |
| 3407 | mapList.add(m); | 3407 | mapList.add(m); |
| @@ -3416,8 +3416,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3416,8 +3416,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3416 | m.put("djgde", grade); | 3416 | m.put("djgde", grade); |
| 3417 | m.put("qJh", s.getFcsj()); | 3417 | m.put("qJh", s.getFcsj()); |
| 3418 | m.put("qSj", time); | 3418 | m.put("qSj", time); |
| 3419 | - m.put("hJh", listInfo.get(i+1).getFcsj()); | ||
| 3420 | - m.put("hSj", listInfo.get(i+1).getFcsjActual()); | 3419 | + m.put("hJh", listInfo1.get(i+1).getFcsj()); |
| 3420 | + m.put("hSj", listInfo1.get(i+1).getFcsjActual()); | ||
| 3421 | m.put("djgsj", trough); | 3421 | m.put("djgsj", trough); |
| 3422 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); | 3422 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); |
| 3423 | mapList.add(m); | 3423 | mapList.add(m); |