Commit 4395479b34aff2e4ea51fbf95751c8a24438f160
1 parent
f2bd39ce
纯油车日报表、纯电车日报表、纯氢车日报表,优化未执行班次公里统计,不同线路相同人车被分组到一起的问题处理。
Showing
1 changed file
with
62 additions
and
23 deletions
src/main/java/com/bsth/service/impl/RefuelServiceImpl.java
| @@ -425,7 +425,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -425,7 +425,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 425 | for(ScheduleRealInfo s : scheList){ | 425 | for(ScheduleRealInfo s : scheList){ |
| 426 | if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ | 426 | if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ |
| 427 | if(s.getClZbh().length() > 0 && s.getjGh() != null){ | 427 | if(s.getClZbh().length() > 0 && s.getjGh() != null){ |
| 428 | - String key = s.getClZbh() + "/" + s.getjGh(); | 428 | + String key = s.getClZbh() + "/" + s.getjGh() + "/" + s.getXlBm() + "/" + s.getXlName(); // 因为是多选线路查询,防止相同人车在两个线路执行,分组时也加上线路 |
| 429 | if(!(sMap.containsKey(key))){ | 429 | if(!(sMap.containsKey(key))){ |
| 430 | sMap.put(key, new ArrayList<ScheduleRealInfo>()); | 430 | sMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 431 | sKeyList.add(key); | 431 | sKeyList.add(key); |
| @@ -436,24 +436,37 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -436,24 +436,37 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | for(String key : sKeyList){ | 438 | for(String key : sKeyList){ |
| 439 | - Map<String, Object> m = new HashMap<String, Object>(); | ||
| 440 | List<ScheduleRealInfo> list2 = sMap.get(key); | 439 | List<ScheduleRealInfo> list2 = sMap.get(key); |
| 440 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 441 | + | ||
| 442 | + List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); // 实际路单(已完成班次与烂班班次等) | ||
| 443 | + for(ScheduleRealInfo s : list2){ | ||
| 444 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 445 | + if(cts != null && cts.size() > 0){ | ||
| 446 | + list_s.add(s); | ||
| 447 | + }else{ | ||
| 448 | + if(s.getZdsjActual()!=null&& s.getFcsjActual()!=null){ | ||
| 449 | + list_s.add(s); | ||
| 450 | + } | ||
| 451 | + } | ||
| 452 | + } | ||
| 453 | + | ||
| 441 | String[] split = key.split("/"); | 454 | String[] split = key.split("/"); |
| 442 | 455 | ||
| 443 | String realMileage = "", oil = "0", addOil = "0", consume = "", cr = ""; | 456 | String realMileage = "", oil = "0", addOil = "0", consume = "", cr = ""; |
| 444 | String ksMileage = "", ssMileage = "", bc = "", jhbc = "", sjbc = ""; | 457 | String ksMileage = "", ssMileage = "", bc = "", jhbc = "", sjbc = ""; |
| 445 | String remarks = ""; | 458 | String remarks = ""; |
| 446 | 459 | ||
| 447 | - Double sjgl = culateMileageService.culateSjgl(list2); | ||
| 448 | - Double ksgl = culateMileageService.culateKsgl(list2); | ||
| 449 | - Double jccgl = culateMileageService.culateJccgl(list2); | ||
| 450 | - Double ljgl = culateMileageService.culateLjgl(list2); | 460 | + Double sjgl = culateMileageService.culateSjgl(list_s); |
| 461 | + Double ksgl = culateMileageService.culateKsgl(list_s); | ||
| 462 | + Double jccgl = culateMileageService.culateJccgl(list_s); | ||
| 463 | + Double ljgl = culateMileageService.culateLjgl(list_s); | ||
| 451 | 464 | ||
| 452 | realMileage = add(add(sjgl, ksgl), add(jccgl, ljgl)); | 465 | realMileage = add(add(sjgl, ksgl), add(jccgl, ljgl)); |
| 453 | ksMileage = add(ksgl, jccgl); | 466 | ksMileage = add(ksgl, jccgl); |
| 454 | ssMileage = "" + culateMileageService.culateLbgl(list2); | 467 | ssMileage = "" + culateMileageService.culateLbgl(list2); |
| 455 | jhbc = "" + culateMileageService.culateJhbc(list2, ""); | 468 | jhbc = "" + culateMileageService.culateJhbc(list2, ""); |
| 456 | - sjbc = "" + culateMileageService.culateSjbc(list2, ""); | 469 | + sjbc = "" + culateMileageService.culateSjbc(list_s, ""); |
| 457 | bc = "" + list2.size(); | 470 | bc = "" + list2.size(); |
| 458 | cr = "1"; | 471 | cr = "1"; |
| 459 | 472 | ||
| @@ -781,7 +794,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -781,7 +794,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 781 | for(ScheduleRealInfo s : scheList){ | 794 | for(ScheduleRealInfo s : scheList){ |
| 782 | if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ | 795 | if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ |
| 783 | if(s.getClZbh().length() > 0 && s.getjGh() != null){ | 796 | if(s.getClZbh().length() > 0 && s.getjGh() != null){ |
| 784 | - String key = s.getClZbh() + "/" + s.getLpName() + "/" + s.getjGh(); | 797 | + String key = s.getClZbh() + "/" + s.getLpName() + "/" + s.getjGh() + "/" + s.getXlBm() + "/" + s.getXlName(); // 因为是多选线路查询,防止相同人车在两个线路执行,分组时也加上线路 |
| 785 | if(!(sMap.containsKey(key))){ | 798 | if(!(sMap.containsKey(key))){ |
| 786 | sMap.put(key, new ArrayList<ScheduleRealInfo>()); | 799 | sMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 787 | sKeyList.add(key); | 800 | sKeyList.add(key); |
| @@ -792,25 +805,38 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -792,25 +805,38 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 792 | } | 805 | } |
| 793 | 806 | ||
| 794 | for(String key : sKeyList){ | 807 | for(String key : sKeyList){ |
| 795 | - Map<String, Object> m = new HashMap<String, Object>(); | ||
| 796 | List<ScheduleRealInfo> list2 = sMap.get(key); | 808 | List<ScheduleRealInfo> list2 = sMap.get(key); |
| 809 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 810 | + | ||
| 811 | + List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); // 实际路单(已完成班次与烂班班次等) | ||
| 812 | + for(ScheduleRealInfo s : list2){ | ||
| 813 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 814 | + if(cts != null && cts.size() > 0){ | ||
| 815 | + list_s.add(s); | ||
| 816 | + }else{ | ||
| 817 | + if(s.getZdsjActual()!=null&& s.getFcsjActual()!=null){ | ||
| 818 | + list_s.add(s); | ||
| 819 | + } | ||
| 820 | + } | ||
| 821 | + } | ||
| 822 | + | ||
| 797 | String[] split = key.split("/"); | 823 | String[] split = key.split("/"); |
| 798 | 824 | ||
| 799 | String realMileage = "", ksMileage = "", ssMileage = "", | 825 | String realMileage = "", ksMileage = "", ssMileage = "", |
| 800 | bc = "", jhbc = "", sjbc = "", ljbc = "", cr = ""; | 826 | bc = "", jhbc = "", sjbc = "", ljbc = "", cr = ""; |
| 801 | String remarks = ""; | 827 | String remarks = ""; |
| 802 | 828 | ||
| 803 | - Double sjgl = culateMileageService.culateSjgl(list2); | ||
| 804 | - Double ksgl = culateMileageService.culateKsgl(list2); | ||
| 805 | - Double jccgl = culateMileageService.culateJccgl(list2); | ||
| 806 | - Double ljgl = culateMileageService.culateLjgl(list2); | 829 | + Double sjgl = culateMileageService.culateSjgl(list_s); |
| 830 | + Double ksgl = culateMileageService.culateKsgl(list_s); | ||
| 831 | + Double jccgl = culateMileageService.culateJccgl(list_s); | ||
| 832 | + Double ljgl = culateMileageService.culateLjgl(list_s); | ||
| 807 | 833 | ||
| 808 | realMileage = add(add(sjgl, ksgl), add(jccgl, ljgl)); | 834 | realMileage = add(add(sjgl, ksgl), add(jccgl, ljgl)); |
| 809 | ksMileage = add(ksgl, jccgl); | 835 | ksMileage = add(ksgl, jccgl); |
| 810 | ssMileage = "" + culateMileageService.culateLbgl(list2); | 836 | ssMileage = "" + culateMileageService.culateLbgl(list2); |
| 811 | jhbc = "" + culateMileageService.culateJhbc(list2, ""); | 837 | jhbc = "" + culateMileageService.culateJhbc(list2, ""); |
| 812 | - sjbc = "" + culateMileageService.culateSjbc(list2, ""); | ||
| 813 | - ljbc = "" + culateMileageService.culateLjbc(list2, ""); | 838 | + sjbc = "" + culateMileageService.culateSjbc(list_s, ""); |
| 839 | + ljbc = "" + culateMileageService.culateLjbc(list_s, ""); | ||
| 814 | int bcInt = 0; | 840 | int bcInt = 0; |
| 815 | for(ScheduleRealInfo s : list2){ | 841 | for(ScheduleRealInfo s : list2){ |
| 816 | if(!s.isCcService() && s.getStatus() != -1){ | 842 | if(!s.isCcService() && s.getStatus() != -1){ |
| @@ -968,7 +994,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -968,7 +994,7 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 968 | for(ScheduleRealInfo s : scheList){ | 994 | for(ScheduleRealInfo s : scheList){ |
| 969 | if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ | 995 | if(s.getClZbh() != null && nbbms.contains(s.getClZbh())){ |
| 970 | if(s.getClZbh().length() > 0 && s.getjGh() != null){ | 996 | if(s.getClZbh().length() > 0 && s.getjGh() != null){ |
| 971 | - String key = s.getClZbh() + "/" + s.getLpName() + "/" + s.getjGh(); | 997 | + String key = s.getClZbh() + "/" + s.getLpName() + "/" + s.getjGh() + "/" + s.getXlBm() + "/" + s.getXlName(); // 因为是多选线路查询,防止相同人车在两个线路执行,分组时也加上线路 |
| 972 | if(!(sMap.containsKey(key))){ | 998 | if(!(sMap.containsKey(key))){ |
| 973 | sMap.put(key, new ArrayList<ScheduleRealInfo>()); | 999 | sMap.put(key, new ArrayList<ScheduleRealInfo>()); |
| 974 | sKeyList.add(key); | 1000 | sKeyList.add(key); |
| @@ -979,25 +1005,38 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | @@ -979,25 +1005,38 @@ public class RefuelServiceImpl extends BaseServiceImpl<Refuel, Long> implements | ||
| 979 | } | 1005 | } |
| 980 | 1006 | ||
| 981 | for(String key : sKeyList){ | 1007 | for(String key : sKeyList){ |
| 982 | - Map<String, Object> m = new HashMap<String, Object>(); | ||
| 983 | List<ScheduleRealInfo> list2 = sMap.get(key); | 1008 | List<ScheduleRealInfo> list2 = sMap.get(key); |
| 1009 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 1010 | + | ||
| 1011 | + List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); // 实际路单(已完成班次与烂班班次等) | ||
| 1012 | + for(ScheduleRealInfo s : list2){ | ||
| 1013 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 1014 | + if(cts != null && cts.size() > 0){ | ||
| 1015 | + list_s.add(s); | ||
| 1016 | + }else{ | ||
| 1017 | + if(s.getZdsjActual()!=null&& s.getFcsjActual()!=null){ | ||
| 1018 | + list_s.add(s); | ||
| 1019 | + } | ||
| 1020 | + } | ||
| 1021 | + } | ||
| 1022 | + | ||
| 984 | String[] split = key.split("/"); | 1023 | String[] split = key.split("/"); |
| 985 | 1024 | ||
| 986 | String realMileage = "", ksMileage = "", ssMileage = "", | 1025 | String realMileage = "", ksMileage = "", ssMileage = "", |
| 987 | bc = "", jhbc = "", sjbc = "", ljbc = "", cr = ""; | 1026 | bc = "", jhbc = "", sjbc = "", ljbc = "", cr = ""; |
| 988 | String remarks = ""; | 1027 | String remarks = ""; |
| 989 | 1028 | ||
| 990 | - Double sjgl = culateMileageService.culateSjgl(list2); | ||
| 991 | - Double ksgl = culateMileageService.culateKsgl(list2); | ||
| 992 | - Double jccgl = culateMileageService.culateJccgl(list2); | ||
| 993 | - Double ljgl = culateMileageService.culateLjgl(list2); | 1029 | + Double sjgl = culateMileageService.culateSjgl(list_s); |
| 1030 | + Double ksgl = culateMileageService.culateKsgl(list_s); | ||
| 1031 | + Double jccgl = culateMileageService.culateJccgl(list_s); | ||
| 1032 | + Double ljgl = culateMileageService.culateLjgl(list_s); | ||
| 994 | 1033 | ||
| 995 | realMileage = add(add(sjgl, ksgl), add(jccgl, ljgl)); | 1034 | realMileage = add(add(sjgl, ksgl), add(jccgl, ljgl)); |
| 996 | ksMileage = add(ksgl, jccgl); | 1035 | ksMileage = add(ksgl, jccgl); |
| 997 | ssMileage = "" + culateMileageService.culateLbgl(list2); | 1036 | ssMileage = "" + culateMileageService.culateLbgl(list2); |
| 998 | jhbc = "" + culateMileageService.culateJhbc(list2, ""); | 1037 | jhbc = "" + culateMileageService.culateJhbc(list2, ""); |
| 999 | - sjbc = "" + culateMileageService.culateSjbc(list2, ""); | ||
| 1000 | - ljbc = "" + culateMileageService.culateLjbc(list2, ""); | 1038 | + sjbc = "" + culateMileageService.culateSjbc(list_s, ""); |
| 1039 | + ljbc = "" + culateMileageService.culateLjbc(list_s, ""); | ||
| 1001 | int bcInt = 0; | 1040 | int bcInt = 0; |
| 1002 | for(ScheduleRealInfo s : list2){ | 1041 | for(ScheduleRealInfo s : list2){ |
| 1003 | if(!s.isCcService() && s.getStatus() != -1){ | 1042 | if(!s.isCcService() && s.getStatus() != -1){ |