Commit ed02ea817e20e3592c72a8f9ecd8f45e9a60e4f2
1 parent
023f795a
新报表
Showing
7 changed files
with
517 additions
and
6 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -261,4 +261,10 @@ public class ReportController { | @@ -261,4 +261,10 @@ public class ReportController { | ||
| 261 | return service.userList(map); | 261 | return service.userList(map); |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | + @RequestMapping(value="/countLineMileage") | ||
| 265 | + public List<Map<String,Object>> countLineMileage(@RequestParam Map<String, Object> map){ | ||
| 266 | + | ||
| 267 | + return service.countByList(map); | ||
| 268 | + } | ||
| 269 | + | ||
| 264 | } | 270 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -3142,11 +3142,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3142,11 +3142,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3142 | if (a == 2) { | 3142 | if (a == 2) { |
| 3143 | x = b + 1; | 3143 | x = b + 1; |
| 3144 | y = x * 2; | 3144 | y = x * 2; |
| 3145 | - ; | ||
| 3146 | } else if (b == 1) { | 3145 | } else if (b == 1) { |
| 3147 | x = b + 1; | 3146 | x = b + 1; |
| 3148 | y = x * 2 - 1; | 3147 | y = x * 2 - 1; |
| 3149 | - ; | ||
| 3150 | } else { | 3148 | } else { |
| 3151 | x = b; | 3149 | x = b; |
| 3152 | y = 2 * x; | 3150 | y = 2 * x; |
src/main/java/com/bsth/service/report/CulateMileageService.java
| @@ -30,5 +30,23 @@ public interface CulateMileageService { | @@ -30,5 +30,23 @@ public interface CulateMileageService { | ||
| 30 | 30 | ||
| 31 | int culateFzbc(List<ScheduleRealInfo> lists,String item); | 31 | int culateFzbc(List<ScheduleRealInfo> lists,String item); |
| 32 | 32 | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + //以下计算方法供新报表使用 | ||
| 36 | + Map<String, Double> culateSjlcMap(List<ScheduleRealInfo> lists);//计划内营运and计划外营运 | ||
| 37 | + | ||
| 38 | + Map<String, Double> culateSjJcclcMap(List<ScheduleRealInfo> lists);//计划内进出场and计划外进出场 | ||
| 39 | + | ||
| 40 | + Map<String, Double> culateLjMile(List<ScheduleRealInfo> lists);//临加营运and临加进出场空驶 | ||
| 41 | + | ||
| 42 | + double culateSsMile(List<ScheduleRealInfo> lists); //烂班少驶 | ||
| 43 | + | ||
| 44 | + double culateSsMileXx(List<ScheduleRealInfo> lists,String item);//烂班少驶详细 | ||
| 45 | + | ||
| 46 | + double culateZrwJccLc(List<ScheduleRealInfo> lists,String item);//子任务进出场 | ||
| 47 | + | ||
| 48 | + double culateKfksLc(List<ScheduleRealInfo> lists); | ||
| 49 | + | ||
| 50 | + | ||
| 33 | } | 51 | } |
| 34 | 52 |
src/main/java/com/bsth/service/report/ReportService.java
| @@ -42,4 +42,6 @@ public interface ReportService { | @@ -42,4 +42,6 @@ public interface ReportService { | ||
| 42 | List<Map<String, String>> carList(Map<String, Object> map); | 42 | List<Map<String, String>> carList(Map<String, Object> map); |
| 43 | 43 | ||
| 44 | List<Map<String, String>> userList(Map<String, Object> map); | 44 | List<Map<String, String>> userList(Map<String, Object> map); |
| 45 | + | ||
| 46 | + List<Map<String, Object>> countByList(Map<String, Object> map); | ||
| 45 | } | 47 | } |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| @@ -16,6 +16,7 @@ import com.bsth.entity.realcontrol.ScheduleRealInfo; | @@ -16,6 +16,7 @@ import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 16 | import com.bsth.service.report.CulateMileageService; | 16 | import com.bsth.service.report.CulateMileageService; |
| 17 | import com.bsth.util.Arith; | 17 | import com.bsth.util.Arith; |
| 18 | import com.bsth.util.ComparableJob; | 18 | import com.bsth.util.ComparableJob; |
| 19 | +import com.google.common.util.concurrent.AbstractScheduledService.Scheduler; | ||
| 19 | 20 | ||
| 20 | @Service | 21 | @Service |
| 21 | public class CulateMileageServiceImpl implements CulateMileageService{ | 22 | public class CulateMileageServiceImpl implements CulateMileageService{ |
| @@ -135,9 +136,11 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -135,9 +136,11 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 135 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | 136 | Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| 136 | while (it.hasNext()) { | 137 | while (it.hasNext()) { |
| 137 | ChildTaskPlan childTaskPlan = it.next(); | 138 | ChildTaskPlan childTaskPlan = it.next(); |
| 138 | - if (childTaskPlan.isDestroy()) { | ||
| 139 | - zlblc=Arith.add(zlblc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | ||
| 140 | - } | 139 | + if(childTaskPlan.getMileageType().equals("service")){ |
| 140 | + if (childTaskPlan.isDestroy()) { | ||
| 141 | + zlblc=Arith.add(zlblc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | ||
| 142 | + } | ||
| 143 | + } | ||
| 141 | } | 144 | } |
| 142 | } | 145 | } |
| 143 | } | 146 | } |
| @@ -625,5 +628,279 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -625,5 +628,279 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 625 | } | 628 | } |
| 626 | return fzbc; | 629 | return fzbc; |
| 627 | } | 630 | } |
| 631 | + | ||
| 632 | + | ||
| 633 | + // | ||
| 634 | + // | ||
| 635 | + //新报表公里计算方法开始 | ||
| 636 | + // | ||
| 637 | + // | ||
| 638 | + | ||
| 639 | + //计划内营运and计划外营运 | ||
| 640 | + @Override | ||
| 641 | + public Map<String, Double> culateSjlcMap(List<ScheduleRealInfo> lists) { | ||
| 642 | + // TODO Auto-generated method stub | ||
| 643 | + double jhnlc=0.0; | ||
| 644 | + double jhwlc=0.0; | ||
| 645 | + for (int i = 0; i < lists.size(); i++) { | ||
| 646 | + ScheduleRealInfo t=lists.get(i); | ||
| 647 | + if(!isInOut(t)){ | ||
| 648 | + if(!t.isSflj()){ | ||
| 649 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | ||
| 650 | + if(childTaskPlans.isEmpty()){ | ||
| 651 | + if(!t.isDestroy()){ | ||
| 652 | + if( Math.abs(t.getJhlc()-t.getJhlcOrig())>0){ | ||
| 653 | + jhwlc =Arith.add(jhwlc, t.getJhlcOrig()); | ||
| 654 | + }else{ | ||
| 655 | + jhnlc =Arith.add(jhnlc, t.getJhlc()); | ||
| 656 | + } | ||
| 657 | + } | ||
| 658 | + }else{ | ||
| 659 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 660 | + double zrwlc=0.0; | ||
| 661 | + boolean fage=false; | ||
| 662 | + while (it.hasNext()) { | ||
| 663 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 664 | + if(childTaskPlan.getMileageType().equals("service")){ | ||
| 665 | + if (childTaskPlan.isDestroy()) { | ||
| 666 | + fage=true; | ||
| 667 | + }else{ | ||
| 668 | + zrwlc =Arith.add(zrwlc, childTaskPlan.getMileage()); | ||
| 669 | + } | ||
| 670 | + } | ||
| 671 | + } | ||
| 672 | + if(fage){ | ||
| 673 | + jhwlc =Arith.add(jhwlc, zrwlc); | ||
| 674 | + }else{ | ||
| 675 | + jhnlc =Arith.add(jhnlc, zrwlc); | ||
| 676 | + } | ||
| 677 | + } | ||
| 678 | + } | ||
| 679 | + } | ||
| 680 | + } | ||
| 681 | + | ||
| 682 | + Map<String, Double> map=new HashMap<String, Double>(); | ||
| 683 | + map.put("jhnlc", jhnlc); | ||
| 684 | + map.put("jhwlc", jhwlc); | ||
| 685 | + return map; | ||
| 686 | + } | ||
| 687 | + | ||
| 688 | + //计划内进出场and计划外进出场 | ||
| 689 | + @Override | ||
| 690 | + public Map<String, Double> culateSjJcclcMap(List<ScheduleRealInfo> lists) { | ||
| 691 | + // TODO Auto-generated method stub | ||
| 692 | + double jhwlc=0.0; | ||
| 693 | + double jhnlc=0.0; | ||
| 694 | + for (int i = 0; i < lists.size(); i++) { | ||
| 695 | + ScheduleRealInfo t=lists.get(i); | ||
| 696 | + if(t.getBcType().equals("in") || t.getBcType().equals("out")){ | ||
| 697 | + if(!t.isSflj()){ | ||
| 698 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | ||
| 699 | + if(childTaskPlans.isEmpty()){ | ||
| 700 | + if(!t.isDestroy()){ | ||
| 701 | + if( Math.abs(t.getJhlc()-t.getJhlcOrig())>0){ | ||
| 702 | + jhwlc =Arith.add(jhwlc, t.getJhlcOrig()); | ||
| 703 | + }else{ | ||
| 704 | + jhnlc =Arith.add(jhnlc, t.getJhlc()); | ||
| 705 | + } | ||
| 706 | + } | ||
| 707 | + }else{ | ||
| 708 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 709 | + double zrwlc=0.0; | ||
| 710 | + boolean fage=false; | ||
| 711 | + while (it.hasNext()) { | ||
| 712 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 713 | + if(childTaskPlan.getMileageType().equals("empty")){ | ||
| 714 | + if (childTaskPlan.isDestroy()) { | ||
| 715 | + fage=true; | ||
| 716 | + }else{ | ||
| 717 | + zrwlc =Arith.add(zrwlc, childTaskPlan.getMileage()); | ||
| 718 | + } | ||
| 719 | + } | ||
| 720 | + } | ||
| 721 | + if(fage){ | ||
| 722 | + jhwlc =Arith.add(jhwlc, zrwlc); | ||
| 723 | + }else{ | ||
| 724 | + jhnlc =Arith.add(jhnlc, zrwlc); | ||
| 725 | + } | ||
| 726 | + } | ||
| 727 | + } | ||
| 728 | + } | ||
| 729 | + } | ||
| 730 | + Map<String, Double> map=new HashMap<String, Double>(); | ||
| 731 | + map.put("jhnlc", jhnlc); | ||
| 732 | + map.put("jhwlc", jhwlc); | ||
| 733 | + return map; | ||
| 734 | + } | ||
| 735 | + | ||
| 736 | + @Override | ||
| 737 | + public Map<String, Double> culateLjMile(List<ScheduleRealInfo> lists) { | ||
| 738 | + // TODO Auto-generated method stub | ||
| 739 | + double ljjcc=0.0; | ||
| 740 | + double ljyy=0.0; | ||
| 741 | + for (int i = 0; i < lists.size(); i++) { | ||
| 742 | + ScheduleRealInfo t=lists.get(i); | ||
| 743 | + if(t.isSflj()){ | ||
| 744 | + if(t.getBcType().equals("in") || t.getBcType().equals("out")){ | ||
| 745 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | ||
| 746 | + if(childTaskPlans.isEmpty()){ | ||
| 747 | + if(!t.isDestroy()){ | ||
| 748 | + ljjcc =Arith.add(ljjcc, t.getJhlc()); | ||
| 749 | + } | ||
| 750 | + | ||
| 751 | + } | ||
| 752 | + /*else{ | ||
| 753 | + //临加进出场子任务 待统计 | ||
| 754 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 755 | + double zrwlc=0.0; | ||
| 756 | + boolean fage=false; | ||
| 757 | + while (it.hasNext()) { | ||
| 758 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 759 | + } | ||
| 760 | + }*/ | ||
| 761 | + } | ||
| 762 | + | ||
| 763 | + if(!isInOut(t)){ | ||
| 764 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | ||
| 765 | + if(childTaskPlans.isEmpty()){ | ||
| 766 | + if(!t.isDestroy()){ | ||
| 767 | + ljyy =Arith.add(ljyy, t.getJhlc()); | ||
| 768 | + } | ||
| 769 | + }else{ | ||
| 770 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 771 | + while (it.hasNext()) { | ||
| 772 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 773 | + if(!childTaskPlan.isDestroy()){ | ||
| 774 | + if(childTaskPlan.getMileageType().equals("service")){ | ||
| 775 | + ljyy =Arith.add(ljyy,childTaskPlan.getMileage()); | ||
| 776 | + } | ||
| 777 | + } | ||
| 778 | + } | ||
| 779 | + } | ||
| 780 | + } | ||
| 781 | + } | ||
| 782 | + } | ||
| 783 | + | ||
| 784 | + Map<String, Double> map=new HashMap<String,Double>(); | ||
| 785 | + map.put("ljjcc", ljjcc); | ||
| 786 | + map.put("ljyy", ljyy); | ||
| 787 | + return map; | ||
| 788 | + } | ||
| 789 | + | ||
| 790 | + @Override | ||
| 791 | + public double culateSsMile(List<ScheduleRealInfo> lists) { | ||
| 792 | + double zlblc =0.0; | ||
| 793 | + for (int i = 0; i < lists.size(); i++) { | ||
| 794 | + ScheduleRealInfo scheduleRealInfo=lists.get(i); | ||
| 795 | + if (!isInOut(scheduleRealInfo)) { | ||
| 796 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 797 | + if(childTaskPlans.isEmpty()){ | ||
| 798 | + if(scheduleRealInfo.isDestroy()){ | ||
| 799 | + zlblc=Arith.add(zlblc,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); | ||
| 800 | + } | ||
| 801 | + }else{ | ||
| 802 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 803 | + while (it.hasNext()) { | ||
| 804 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 805 | + if(childTaskPlan.getMileageType().equals("service")){ | ||
| 806 | + if (childTaskPlan.isDestroy()) { | ||
| 807 | + zlblc=Arith.add(zlblc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | ||
| 808 | + } | ||
| 809 | + } | ||
| 810 | + } | ||
| 811 | + } | ||
| 812 | + } | ||
| 813 | + } | ||
| 814 | + return zlblc; | ||
| 815 | + } | ||
| 628 | 816 | ||
| 817 | + @Override | ||
| 818 | + public double culateSsMileXx(List<ScheduleRealInfo> lists, String item) { | ||
| 819 | + // TODO Auto-generated method stub | ||
| 820 | + double sum = 0; | ||
| 821 | + Set<ChildTaskPlan> cts; | ||
| 822 | + for(ScheduleRealInfo sch : lists){ | ||
| 823 | + if (sch.isSflj()) | ||
| 824 | + continue; | ||
| 825 | + cts = sch.getcTasks(); | ||
| 826 | + //有子任务 | ||
| 827 | + if (cts != null && cts.size() > 0) { | ||
| 828 | + for(ChildTaskPlan c : cts){ | ||
| 829 | + if(item.equals("其他")){ | ||
| 830 | + if(c.isDestroy() && | ||
| 831 | + ((c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)|| | ||
| 832 | + (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(""))) | ||
| 833 | + sum = Arith.add(sum, c.getMileage()); | ||
| 834 | + }else{ | ||
| 835 | + if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item)) | ||
| 836 | + sum = Arith.add(sum, c.getMileage()); | ||
| 837 | + } | ||
| 838 | + | ||
| 839 | + } | ||
| 840 | + } | ||
| 841 | + else if(isInOut(sch)) | ||
| 842 | + continue; | ||
| 843 | + //主任务烂班 | ||
| 844 | + else if(sch.getStatus() == -1){ | ||
| 845 | + if(sch.getAdjustExps().equals(item) || | ||
| 846 | + (StringUtils.isEmpty(sch.getAdjustExps()) && item.equals("其他"))){ | ||
| 847 | + sum = Arith.add(sum, sch.getJhlcOrig()); | ||
| 848 | + } | ||
| 849 | + } | ||
| 850 | + | ||
| 851 | + } | ||
| 852 | + return sum; | ||
| 853 | + } | ||
| 854 | + | ||
| 855 | + @Override | ||
| 856 | + public double culateZrwJccLc(List<ScheduleRealInfo> lists, String item) { | ||
| 857 | + // TODO Auto-generated method stub | ||
| 858 | + double zrwjcclc=0.0; | ||
| 859 | + for (int i = 0; i < lists.size(); i++) { | ||
| 860 | + ScheduleRealInfo t=lists.get(i); | ||
| 861 | + if(!isInOut(t)){ | ||
| 862 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | ||
| 863 | + if(!childTaskPlans.isEmpty()){ | ||
| 864 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 865 | + while (it.hasNext()) { | ||
| 866 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 867 | + if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){ | ||
| 868 | + if (childTaskPlan.isDestroy()) { | ||
| 869 | + zrwjcclc=Arith.add(zrwjcclc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | ||
| 870 | + } | ||
| 871 | + } | ||
| 872 | + } | ||
| 873 | + } | ||
| 874 | + } | ||
| 875 | + } | ||
| 876 | + return zrwjcclc; | ||
| 877 | + } | ||
| 878 | + | ||
| 879 | + @Override | ||
| 880 | + public double culateKfksLc(List<ScheduleRealInfo> lists) { | ||
| 881 | + // TODO Auto-generated method stub | ||
| 882 | + double kfks=0.0; | ||
| 883 | + for (int i = 0; i < lists.size(); i++) { | ||
| 884 | + ScheduleRealInfo t=lists.get(i); | ||
| 885 | + if(t.getBcType().equals("ldks")){ | ||
| 886 | + Set<ChildTaskPlan> childTaskPlans = t.getcTasks(); | ||
| 887 | + if(childTaskPlans.isEmpty()){ | ||
| 888 | + if(!t.isDestroy()){ | ||
| 889 | + kfks=Arith.add(kfks,t.getJhlcOrig()==null?0:t.getJhlcOrig()); | ||
| 890 | + } | ||
| 891 | + }else{ | ||
| 892 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 893 | + while (it.hasNext()) { | ||
| 894 | + ChildTaskPlan childTaskPlan = it.next(); | ||
| 895 | + if (!childTaskPlan.isDestroy()) { | ||
| 896 | + kfks=Arith.add(kfks,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); | ||
| 897 | + } | ||
| 898 | + } | ||
| 899 | + } | ||
| 900 | + } | ||
| 901 | + } | ||
| 902 | + return kfks; | ||
| 903 | + } | ||
| 904 | + | ||
| 905 | + | ||
| 629 | } | 906 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -29,6 +29,7 @@ import com.bsth.entity.Line; | @@ -29,6 +29,7 @@ import com.bsth.entity.Line; | ||
| 29 | import com.bsth.entity.Personnel; | 29 | import com.bsth.entity.Personnel; |
| 30 | import com.bsth.entity.StationRoute; | 30 | import com.bsth.entity.StationRoute; |
| 31 | import com.bsth.entity.excep.ArrivalInfo; | 31 | import com.bsth.entity.excep.ArrivalInfo; |
| 32 | +import com.bsth.entity.mcy_forms.Operationservice; | ||
| 32 | import com.bsth.entity.oil.Ylb; | 33 | import com.bsth.entity.oil.Ylb; |
| 33 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 34 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 34 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 35 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| @@ -1420,4 +1421,213 @@ public class ReportServiceImpl implements ReportService{ | @@ -1420,4 +1421,213 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1420 | List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd); | 1421 | List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd); |
| 1421 | return listStation; | 1422 | return listStation; |
| 1422 | } | 1423 | } |
| 1424 | + @Override | ||
| 1425 | + public List<Map<String, Object>> countByList(Map<String, Object> map) { | ||
| 1426 | + // TODO Auto-generated method stub | ||
| 1427 | + | ||
| 1428 | + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); | ||
| 1429 | + String gsdm=""; | ||
| 1430 | + if(map.get("gsdm")!=null){ | ||
| 1431 | + gsdm=map.get("gsdm").toString(); | ||
| 1432 | + } | ||
| 1433 | + String fgsdm=""; | ||
| 1434 | + if(map.get("fgsdm")!=null){ | ||
| 1435 | + fgsdm=map.get("fgsdm").toString(); | ||
| 1436 | + } | ||
| 1437 | + String line=""; | ||
| 1438 | + if(map.get("line")!=null){ | ||
| 1439 | + line=map.get("line").toString(); | ||
| 1440 | + } | ||
| 1441 | + String date=""; | ||
| 1442 | + if(map.get("date")!=null){ | ||
| 1443 | + date=map.get("date").toString(); | ||
| 1444 | + } | ||
| 1445 | + String date2=""; | ||
| 1446 | + if(map.get("date2")!=null){ | ||
| 1447 | + date2=map.get("date2").toString(); | ||
| 1448 | + } | ||
| 1449 | + String xlName=""; | ||
| 1450 | + if(map.get("xlName")!=null){ | ||
| 1451 | + xlName=map.get("xlName").toString(); | ||
| 1452 | + } | ||
| 1453 | + String type=""; | ||
| 1454 | + if(map.get("type")!=null){ | ||
| 1455 | + type=map.get("type").toString(); | ||
| 1456 | + } | ||
| 1457 | + //所有班次信息 | ||
| 1458 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | ||
| 1459 | + //已执行了的班次信息 | ||
| 1460 | + List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); | ||
| 1461 | + | ||
| 1462 | + line =line.trim(); | ||
| 1463 | + if(line.equals("")){ | ||
| 1464 | + //查询所有线路 | ||
| 1465 | + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); | ||
| 1466 | + }else{ | ||
| 1467 | + //查询单条线路 | ||
| 1468 | + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); | ||
| 1469 | + } | ||
| 1470 | + for (int i = 0; i < list.size(); i++) { | ||
| 1471 | + ScheduleRealInfo s=list.get(i); | ||
| 1472 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 1473 | + if(cts != null && cts.size() > 0){ | ||
| 1474 | + list_s.add(s); | ||
| 1475 | + }else{ | ||
| 1476 | + if(s.getZdsjActual()!=null){ | ||
| 1477 | + list_s.add(s); | ||
| 1478 | + } | ||
| 1479 | + } | ||
| 1480 | + } | ||
| 1481 | + | ||
| 1482 | + String sql="select r.xl_bm" | ||
| 1483 | + + " from bsth_c_s_sp_info_real r where" | ||
| 1484 | + + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; | ||
| 1485 | + | ||
| 1486 | + | ||
| 1487 | + if(line.equals("")){ | ||
| 1488 | + sql +="and r.gs_bm='"+gsdm+"' " | ||
| 1489 | + + " and r.fgs_bm='"+fgsdm+"'"; | ||
| 1490 | + }else{ | ||
| 1491 | + sql += " and r.xl_bm = '"+line+"'"; | ||
| 1492 | + } | ||
| 1493 | + sql += " group by r.xl_bm"; | ||
| 1494 | + | ||
| 1495 | + List<String> listLine=jdbcTemplate.query(sql, new RowMapper<String>() { | ||
| 1496 | + @Override | ||
| 1497 | + public String mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 1498 | + String ve = arg0.getString("xl_bm"); | ||
| 1499 | + return ve; | ||
| 1500 | + } | ||
| 1501 | + }); | ||
| 1502 | + | ||
| 1503 | + for (int i = 0; i < listLine.size(); i++) { | ||
| 1504 | + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); | ||
| 1505 | + String lineStr=listLine.get(i); | ||
| 1506 | + for (int j = 0; j < list.size(); j++) { | ||
| 1507 | + ScheduleRealInfo s=list.get(j); | ||
| 1508 | + if(s.getXlBm().equals(lineStr)){ | ||
| 1509 | + lists.add(s); | ||
| 1510 | + } | ||
| 1511 | + } | ||
| 1512 | + | ||
| 1513 | + //计算线路的各项公里 | ||
| 1514 | + if(lists.size()>0){ | ||
| 1515 | + Map<String, Object> newMap=staticTj(lists); | ||
| 1516 | + lMap.add(newMap); | ||
| 1517 | + } | ||
| 1518 | + | ||
| 1519 | + } | ||
| 1520 | + return null; | ||
| 1521 | + } | ||
| 1522 | + | ||
| 1523 | + | ||
| 1524 | + public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){ | ||
| 1525 | + | ||
| 1526 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | ||
| 1527 | + for(int i=0;i<list.size();i++){ | ||
| 1528 | + ScheduleRealInfo s=list.get(i); | ||
| 1529 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 1530 | + if(cts != null && cts.size() > 0){ | ||
| 1531 | + lists.add(s); | ||
| 1532 | + }else{ | ||
| 1533 | + if(s.getZdsjActual()!=null){ | ||
| 1534 | + lists.add(s); | ||
| 1535 | + } | ||
| 1536 | + } | ||
| 1537 | + } | ||
| 1538 | + Map<String, Object> map = new HashMap<String, Object>(); | ||
| 1539 | + if(list.size()>0){ | ||
| 1540 | + map.put("xlName", list.get(0).getXlName()); | ||
| 1541 | + map.put("gs", list.get(0).getGsName()); | ||
| 1542 | + map.put("fgs", list.get(0).getFgsName()); | ||
| 1543 | + double jhyygl=culateService.culateJhgl(list);//计划营运公里 | ||
| 1544 | + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | ||
| 1545 | + map.put("jhlc", jhyygl); | ||
| 1546 | + map.put("jcclc", jhjcclc); | ||
| 1547 | + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));//计划总里程 | ||
| 1548 | + | ||
| 1549 | + | ||
| 1550 | + Map<String, Double> culateSjlcMap=culateService.culateSjlcMap(lists); | ||
| 1551 | + double jhnlc=culateSjlcMap.get("jhnlc"); | ||
| 1552 | + double jhwlc=culateSjlcMap.get("jhwlc"); | ||
| 1553 | + | ||
| 1554 | + Map<String, Double> culateSjJcclcMap=culateService.culateSjJcclcMap(lists); | ||
| 1555 | + double jhwjcclc=culateSjJcclcMap.get("jhwlc"); | ||
| 1556 | + double jhnjcclc=culateSjJcclcMap.get("jhnlc"); | ||
| 1557 | + | ||
| 1558 | + Map<String, Double> culateLjMile=culateService.culateLjMile(lists); | ||
| 1559 | + double ljjcc=culateLjMile.get("ljjcc"); | ||
| 1560 | + double ljyy=culateLjMile.get("ljyy"); | ||
| 1561 | + | ||
| 1562 | + double lbss=culateService.culateSsMile(list); | ||
| 1563 | + map.put("ssgl_lz", culateService.culateSsMileXx(list, "路阻")); | ||
| 1564 | + map.put("ssgl_dm", culateService.culateSsMileXx(list, "吊慢")); | ||
| 1565 | + map.put("ssgl_gz", culateService.culateSsMileXx(list, "故障")); | ||
| 1566 | + map.put("ssgl_jf", culateService.culateSsMileXx(list, "纠纷")); | ||
| 1567 | + map.put("ssgl_zs", culateService.culateSsMileXx(list, "肇事")); | ||
| 1568 | + map.put("ssgl_qr", culateService.culateSsMileXx(list, "缺人")); | ||
| 1569 | + map.put("ssgl_qc", culateService.culateSsMileXx(list, "缺车")); | ||
| 1570 | + map.put("ssgl_kx", culateService.culateSsMileXx(list, "客稀")); | ||
| 1571 | + map.put("ssgl_qh", culateService.culateSsMileXx(list, "气候")); | ||
| 1572 | + map.put("ssgl_yw", culateService.culateSsMileXx(list, "援外")); | ||
| 1573 | + map.put("ssgl_other", culateService.culateSsMileXx(list, "其他")); | ||
| 1574 | + | ||
| 1575 | + | ||
| 1576 | + double zrwjcclc=culateService.culateZrwJccLc(list, ""); | ||
| 1577 | + | ||
| 1578 | + | ||
| 1579 | + | ||
| 1580 | + | ||
| 1581 | + | ||
| 1582 | + | ||
| 1583 | + | ||
| 1584 | + | ||
| 1585 | + double ljgl= culateService.culateLjgl(lists); | ||
| 1586 | + double sjyygl= culateService.culateSjgl(lists); | ||
| 1587 | + double zyygl= Arith.add(sjyygl,ljgl); | ||
| 1588 | + | ||
| 1589 | + double sjjccgl=culateService.culateJccgl(lists); | ||
| 1590 | + double sjksgl=culateService.culateKsgl(lists); | ||
| 1591 | + double zksgl=Arith.add(sjjccgl, sjksgl); | ||
| 1592 | + map.put("sjzgl", Arith.add(zyygl, zksgl)); | ||
| 1593 | + map.put("sjgl",zyygl); | ||
| 1594 | + map.put("sjksgl", zksgl); | ||
| 1595 | + | ||
| 1596 | + map.put("ssgl", culateService.culateLbgl(list)); | ||
| 1597 | + map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); | ||
| 1598 | + map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); | ||
| 1599 | + map.put("ssgl_gz", culateService.culateCJLC(list, "故障")); | ||
| 1600 | + map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷")); | ||
| 1601 | + map.put("ssgl_zs", culateService.culateCJLC(list, "肇事")); | ||
| 1602 | + map.put("ssgl_qr", culateService.culateCJLC(list, "缺人")); | ||
| 1603 | + map.put("ssgl_qc", culateService.culateCJLC(list, "缺车")); | ||
| 1604 | + map.put("ssgl_kx", culateService.culateCJLC(list, "客稀")); | ||
| 1605 | + map.put("ssgl_qh", culateService.culateCJLC(list, "气候")); | ||
| 1606 | + map.put("ssgl_yw", culateService.culateCJLC(list, "援外")); | ||
| 1607 | + map.put("ssgl_other", culateService.culateCJLC(list, "其他")); | ||
| 1608 | + map.put("ssbc", culateService.culateLbbc(list)); | ||
| 1609 | + map.put("ljgl", ljgl); | ||
| 1610 | + map.put("jhbc", culateService.culateJhbc(list,"")); | ||
| 1611 | + map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); | ||
| 1612 | + map.put("jhbc_a", culateService.culateJhbc(list, "wgf")); | ||
| 1613 | + map.put("sjbc", culateService.culateSjbc(lists,"")); | ||
| 1614 | + map.put("sjbc_m", culateService.culateSjbc(lists,"zgf")); | ||
| 1615 | + map.put("sjbc_a", culateService.culateSjbc(lists,"wgf")); | ||
| 1616 | + map.put("ljbc", culateService.culateLjbc(lists,"")); | ||
| 1617 | + map.put("ljbc_m", culateService.culateLjbc(lists,"zgf")); | ||
| 1618 | + map.put("ljbc_a", culateService.culateLjbc(lists,"wgf")); | ||
| 1619 | + map.put("fzbc", culateService.culateFzbc(lists, "")); | ||
| 1620 | + map.put("fzbc_m", culateService.culateFzbc(lists, "zgf")); | ||
| 1621 | + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf")); | ||
| 1622 | + map.put("dtbc", 0); | ||
| 1623 | + map.put("dtbc_m", 0); | ||
| 1624 | + map.put("dtbc_a", 0); | ||
| 1625 | + map.put("djg", 0); | ||
| 1626 | + map.put("djg_m", 0); | ||
| 1627 | + map.put("djg_a", 0); | ||
| 1628 | + map.put("djg_time", 0); | ||
| 1629 | + } | ||
| 1630 | + return map; | ||
| 1631 | + } | ||
| 1632 | + | ||
| 1423 | } | 1633 | } |
src/main/resources/static/pages/forms/statement/waybill.html
| @@ -207,7 +207,7 @@ | @@ -207,7 +207,7 @@ | ||
| 207 | line = $("#line").val(); | 207 | line = $("#line").val(); |
| 208 | date = $("#date").val(); | 208 | date = $("#date").val(); |
| 209 | $(".hidden").removeClass("hidden"); | 209 | $(".hidden").removeClass("hidden"); |
| 210 | - $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"j_Gh",type:type},function(result){ | 210 | + $get('/realSchedule/queryUserInfoPx',{line:line,date:date,state:"jGh",type:type},function(result){ |
| 211 | if(type=="desc"){ | 211 | if(type=="desc"){ |
| 212 | type ="asc"; | 212 | type ="asc"; |
| 213 | }else{ | 213 | }else{ |