Commit dcb17da22d27a7a8608fd80f7ecd111b977c958b
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control into pudong
Showing
9 changed files
with
695 additions
and
117 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -325,4 +325,10 @@ public class ReportController { | @@ -325,4 +325,10 @@ public class ReportController { | ||
| 325 | 325 | ||
| 326 | return lMap; | 326 | return lMap; |
| 327 | } | 327 | } |
| 328 | + | ||
| 329 | + | ||
| 330 | + @RequestMapping(value="/online") | ||
| 331 | + public Map<String, Object> online(@RequestParam Map<String, Object> map){ | ||
| 332 | + return service.online(map); | ||
| 333 | + } | ||
| 328 | } | 334 | } |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -441,7 +441,7 @@ public class FormsServiceImpl implements FormsService { | @@ -441,7 +441,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 441 | + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name " | 441 | + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm,r.lp_name " |
| 442 | + "FROM bsth_c_s_sp_info_real r where 1=1 " | 442 | + "FROM bsth_c_s_sp_info_real r where 1=1 " |
| 443 | + " and r.schedule_date_str='"+date + "' " | 443 | + " and r.schedule_date_str='"+date + "' " |
| 444 | - + " and r.xl_bm like '%"+line+"%' " | 444 | + + " and r.xl_bm = '"+line+"' " |
| 445 | + " and r.gs_bm like '%"+gsdmShif+"%' " | 445 | + " and r.gs_bm like '%"+gsdmShif+"%' " |
| 446 | + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t" | 446 | + " and r.fgs_bm like '%"+fgsdmShif+"%' ) t" |
| 447 | + " GROUP BY t.schedule_date,t.j_name,t.s_name, " | 447 | + " GROUP BY t.schedule_date,t.j_name,t.s_name, " |
| @@ -787,27 +787,25 @@ public class FormsServiceImpl implements FormsService { | @@ -787,27 +787,25 @@ public class FormsServiceImpl implements FormsService { | ||
| 787 | List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | 787 | List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); |
| 788 | for (int i = 0; i < listYlb.size(); i++) { | 788 | for (int i = 0; i < listYlb.size(); i++) { |
| 789 | Ylb y=listYlb.get(i); | 789 | Ylb y=listYlb.get(i); |
| 790 | - String jsy=y.getJsy(); | ||
| 791 | - String line=y.getXlbm(); | ||
| 792 | - String clzbh=y.getNbbm(); | ||
| 793 | - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 794 | - List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 795 | - for (int j = 0; j < listReal.size(); j++) { | ||
| 796 | - ScheduleRealInfo s=listReal.get(j); | ||
| 797 | - if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 798 | - &&s.getXlBm().equals(line)){ | ||
| 799 | - if(y.getLp()==null){ | ||
| 800 | - newList.add(s); | ||
| 801 | - Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 802 | - if(cts != null && cts.size() > 0){ | ||
| 803 | - newList_.add(s); | ||
| 804 | - }else{ | ||
| 805 | - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 806 | - newList_.add(s); | ||
| 807 | - } | ||
| 808 | - } | ||
| 809 | - }else{ | ||
| 810 | - if(y.getLp().equals(s.getLpName())){ | 790 | + boolean fage=false; |
| 791 | + if(xlbm.equals("")){ | ||
| 792 | + fage=true; | ||
| 793 | + }else{ | ||
| 794 | + if(xlbm.equals(y.getXlbm())){ | ||
| 795 | + fage=true; | ||
| 796 | + } | ||
| 797 | + } | ||
| 798 | + if(fage){ | ||
| 799 | + String jsy=y.getJsy(); | ||
| 800 | + String line=y.getXlbm(); | ||
| 801 | + String clzbh=y.getNbbm(); | ||
| 802 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 803 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 804 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 805 | + ScheduleRealInfo s=listReal.get(j); | ||
| 806 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 807 | + &&s.getXlBm().equals(line)){ | ||
| 808 | + if(y.getLp()==null){ | ||
| 811 | newList.add(s); | 809 | newList.add(s); |
| 812 | Set<ChildTaskPlan> cts = s.getcTasks(); | 810 | Set<ChildTaskPlan> cts = s.getcTasks(); |
| 813 | if(cts != null && cts.size() > 0){ | 811 | if(cts != null && cts.size() > 0){ |
| @@ -817,65 +815,75 @@ public class FormsServiceImpl implements FormsService { | @@ -817,65 +815,75 @@ public class FormsServiceImpl implements FormsService { | ||
| 817 | newList_.add(s); | 815 | newList_.add(s); |
| 818 | } | 816 | } |
| 819 | } | 817 | } |
| 818 | + }else{ | ||
| 819 | + if(y.getLp().equals(s.getLpName())){ | ||
| 820 | + newList.add(s); | ||
| 821 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 822 | + if(cts != null && cts.size() > 0){ | ||
| 823 | + newList_.add(s); | ||
| 824 | + }else{ | ||
| 825 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 826 | + newList_.add(s); | ||
| 827 | + } | ||
| 828 | + } | ||
| 829 | + } | ||
| 820 | } | 830 | } |
| 821 | } | 831 | } |
| 822 | } | 832 | } |
| 833 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 834 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 835 | + double yygl=culateMileageService.culateSjgl(newList_); | ||
| 836 | + double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 837 | + double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 838 | + double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 839 | + | ||
| 840 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 841 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 842 | + | ||
| 843 | + Singledata sin=new Singledata(); | ||
| 844 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 845 | + | ||
| 846 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 847 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 848 | + sin.setxL(y.getXlbm()); | ||
| 849 | + sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 850 | + sin.setClzbh(clzbh); | ||
| 851 | + sin.setJsy(jsy); | ||
| 852 | + sin.setrQ(startDate); | ||
| 853 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 854 | + sin.setSgh(""); | ||
| 855 | + sin.setsName(""); | ||
| 856 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 857 | + sin.setHyl(df.format(y.getYh())); | ||
| 858 | + sin.setJzl(df.format(y.getJzl())); | ||
| 859 | + sin.setUnyyyl(df.format(y.getSh())); | ||
| 860 | + listY.add(sin); | ||
| 823 | } | 861 | } |
| 824 | - double jhgl=culateMileageService.culateJhgl(newList); | ||
| 825 | - double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 826 | - double yygl=culateMileageService.culateSjgl(newList_); | ||
| 827 | - double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 828 | - double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 829 | - double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 830 | 862 | ||
| 831 | - double zyygl=Arith.add(yygl, ljgl); | ||
| 832 | - double zksgl=Arith.add(ksgl, jcgl); | ||
| 833 | - | ||
| 834 | - Singledata sin=new Singledata(); | ||
| 835 | - sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 836 | - | ||
| 837 | - sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 838 | - sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 839 | - sin.setxL(y.getXlbm()); | ||
| 840 | - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 841 | - sin.setClzbh(clzbh); | ||
| 842 | - sin.setJsy(jsy); | ||
| 843 | - sin.setrQ(startDate); | ||
| 844 | - sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 845 | - sin.setSgh(""); | ||
| 846 | - sin.setsName(""); | ||
| 847 | - sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 848 | - sin.setHyl(df.format(y.getYh())); | ||
| 849 | - sin.setJzl(df.format(y.getJzl())); | ||
| 850 | - sin.setUnyyyl(df.format(y.getSh())); | ||
| 851 | - listY.add(sin); | ||
| 852 | } | 863 | } |
| 853 | 864 | ||
| 854 | List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | 865 | List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); |
| 855 | for (int i = 0; i < listDlb.size(); i++) { | 866 | for (int i = 0; i < listDlb.size(); i++) { |
| 856 | - | ||
| 857 | Dlb y=listDlb.get(i); | 867 | Dlb y=listDlb.get(i); |
| 858 | - String jsy=y.getJsy(); | ||
| 859 | - String line=y.getXlbm(); | ||
| 860 | - String clzbh=y.getNbbm(); | ||
| 861 | - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 862 | - List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 863 | - for (int j = 0; j < listReal.size(); j++) { | ||
| 864 | - ScheduleRealInfo s=listReal.get(j); | ||
| 865 | - if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 866 | - &&s.getXlBm().equals(line)){ | ||
| 867 | - if(y.getLp()==null){ | ||
| 868 | - newList.add(s); | ||
| 869 | - Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 870 | - if(cts != null && cts.size() > 0){ | ||
| 871 | - newList_.add(s); | ||
| 872 | - }else{ | ||
| 873 | - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 874 | - newList_.add(s); | ||
| 875 | - } | ||
| 876 | - } | ||
| 877 | - }else{ | ||
| 878 | - if(y.getLp().equals(s.getLpName())){ | 868 | + boolean fage=false; |
| 869 | + if(xlbm.equals("")){ | ||
| 870 | + fage=true; | ||
| 871 | + }else{ | ||
| 872 | + if(xlbm.equals(y.getXlbm())){ | ||
| 873 | + fage=true; | ||
| 874 | + } | ||
| 875 | + } | ||
| 876 | + if(fage){ | ||
| 877 | + String jsy=y.getJsy(); | ||
| 878 | + String line=y.getXlbm(); | ||
| 879 | + String clzbh=y.getNbbm(); | ||
| 880 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 881 | + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>(); | ||
| 882 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 883 | + ScheduleRealInfo s=listReal.get(j); | ||
| 884 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 885 | + &&s.getXlBm().equals(line)){ | ||
| 886 | + if(y.getLp()==null){ | ||
| 879 | newList.add(s); | 887 | newList.add(s); |
| 880 | Set<ChildTaskPlan> cts = s.getcTasks(); | 888 | Set<ChildTaskPlan> cts = s.getcTasks(); |
| 881 | if(cts != null && cts.size() > 0){ | 889 | if(cts != null && cts.size() > 0){ |
| @@ -885,38 +893,50 @@ public class FormsServiceImpl implements FormsService { | @@ -885,38 +893,50 @@ public class FormsServiceImpl implements FormsService { | ||
| 885 | newList_.add(s); | 893 | newList_.add(s); |
| 886 | } | 894 | } |
| 887 | } | 895 | } |
| 896 | + }else{ | ||
| 897 | + if(y.getLp().equals(s.getLpName())){ | ||
| 898 | + newList.add(s); | ||
| 899 | + Set<ChildTaskPlan> cts = s.getcTasks(); | ||
| 900 | + if(cts != null && cts.size() > 0){ | ||
| 901 | + newList_.add(s); | ||
| 902 | + }else{ | ||
| 903 | + if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){ | ||
| 904 | + newList_.add(s); | ||
| 905 | + } | ||
| 906 | + } | ||
| 907 | + } | ||
| 888 | } | 908 | } |
| 889 | } | 909 | } |
| 890 | } | 910 | } |
| 911 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 912 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 913 | + double yygl=culateMileageService.culateSjgl(newList_); | ||
| 914 | + double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 915 | + double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 916 | + double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 917 | + | ||
| 918 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 919 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 920 | + | ||
| 921 | + Singledata sin=new Singledata(); | ||
| 922 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 923 | + | ||
| 924 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 925 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 926 | + sin.setxL(y.getXlbm()); | ||
| 927 | + sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 928 | + sin.setClzbh(clzbh); | ||
| 929 | + sin.setJsy(jsy); | ||
| 930 | + sin.setrQ(startDate); | ||
| 931 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 932 | + sin.setSgh(""); | ||
| 933 | + sin.setsName(""); | ||
| 934 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 935 | + sin.setHyl(df.format(y.getHd())); | ||
| 936 | + sin.setJzl(df.format(y.getCdl())); | ||
| 937 | + sin.setUnyyyl(df.format(y.getSh())); | ||
| 938 | + listD.add(sin); | ||
| 891 | } | 939 | } |
| 892 | - double jhgl=culateMileageService.culateJhgl(newList); | ||
| 893 | - double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 894 | - double yygl=culateMileageService.culateSjgl(newList_); | ||
| 895 | - double ljgl=culateMileageService.culateLjgl(newList_); | ||
| 896 | - double ksgl=culateMileageService.culateKsgl(newList_); | ||
| 897 | - double jcgl=culateMileageService.culateJccgl(newList_); | ||
| 898 | - | ||
| 899 | - double zyygl=Arith.add(yygl, ljgl); | ||
| 900 | - double zksgl=Arith.add(ksgl, jcgl); | ||
| 901 | - | ||
| 902 | - Singledata sin=new Singledata(); | ||
| 903 | - sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 904 | - | ||
| 905 | - sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 906 | - sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 907 | - sin.setxL(y.getXlbm()); | ||
| 908 | - sin.setXlmc(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 909 | - sin.setClzbh(clzbh); | ||
| 910 | - sin.setJsy(jsy); | ||
| 911 | - sin.setrQ(startDate); | ||
| 912 | - sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 913 | - sin.setSgh(""); | ||
| 914 | - sin.setsName(""); | ||
| 915 | - sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 916 | - sin.setHyl(df.format(y.getHd())); | ||
| 917 | - sin.setJzl(df.format(y.getCdl())); | ||
| 918 | - sin.setUnyyyl(df.format(y.getSh())); | ||
| 919 | - listD.add(sin); | ||
| 920 | } | 940 | } |
| 921 | 941 | ||
| 922 | Collections.sort(listY,new SingledataByXlbm()); | 942 | Collections.sort(listY,new SingledataByXlbm()); |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -38,6 +38,7 @@ import com.bsth.entity.oil.Ylb; | @@ -38,6 +38,7 @@ import com.bsth.entity.oil.Ylb; | ||
| 38 | import com.bsth.entity.oil.Ylxxb; | 38 | import com.bsth.entity.oil.Ylxxb; |
| 39 | import com.bsth.entity.search.CustomerSpecs; | 39 | import com.bsth.entity.search.CustomerSpecs; |
| 40 | import com.bsth.repository.CarsRepository; | 40 | import com.bsth.repository.CarsRepository; |
| 41 | +import com.bsth.repository.LineRepository; | ||
| 41 | import com.bsth.repository.oil.CylRepository; | 42 | import com.bsth.repository.oil.CylRepository; |
| 42 | import com.bsth.repository.oil.DlbRepository; | 43 | import com.bsth.repository.oil.DlbRepository; |
| 43 | import com.bsth.repository.oil.YlbRepository; | 44 | import com.bsth.repository.oil.YlbRepository; |
| @@ -73,6 +74,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -73,6 +74,10 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 73 | @Autowired | 74 | @Autowired |
| 74 | CarsRepository carsRepository; | 75 | CarsRepository carsRepository; |
| 75 | 76 | ||
| 77 | + | ||
| 78 | + @Autowired | ||
| 79 | + LineRepository lineRepository; | ||
| 80 | + | ||
| 76 | @Autowired | 81 | @Autowired |
| 77 | ScheduleRealInfoService scheduleRealInfoService; | 82 | ScheduleRealInfoService scheduleRealInfoService; |
| 78 | 83 | ||
| @@ -1501,8 +1506,14 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1501,8 +1506,14 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1501 | try{ | 1506 | try{ |
| 1502 | String date = map.get("date").toString(); | 1507 | String date = map.get("date").toString(); |
| 1503 | String line = map.get("line").toString(); | 1508 | String line = map.get("line").toString(); |
| 1504 | - String gsdm = map.get("gsdm").toString(); | ||
| 1505 | - String fgsdm = map.get("fgsdm").toString(); | 1509 | + List<Line> listLine=lineRepository.findLineByCode(line); |
| 1510 | + String gsdm =""; | ||
| 1511 | + String fgsdm =""; | ||
| 1512 | + if(listLine.size()>0){ | ||
| 1513 | + Line l=listLine.get(0); | ||
| 1514 | + gsdm=l.getCompany(); | ||
| 1515 | + fgsdm=l.getBrancheCompany(); | ||
| 1516 | + } | ||
| 1506 | 1517 | ||
| 1507 | List<Map<String, Object>> listpbYc=new ArrayList<Map<String, Object>>();//油车数据 | 1518 | List<Map<String, Object>> listpbYc=new ArrayList<Map<String, Object>>();//油车数据 |
| 1508 | List<Map<String, Object>> listpbDc=new ArrayList<Map<String, Object>>();//电车数据 | 1519 | List<Map<String, Object>> listpbDc=new ArrayList<Map<String, Object>>();//电车数据 |
| @@ -1672,7 +1683,15 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1672,7 +1683,15 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1672 | t.setUpdatetime(new Date()); | 1683 | t.setUpdatetime(new Date()); |
| 1673 | } | 1684 | } |
| 1674 | } | 1685 | } |
| 1675 | - repository.save(t); | 1686 | + try { |
| 1687 | + repository.save(t); | ||
| 1688 | + } catch (Exception e) { | ||
| 1689 | + // TODO: handle exception | ||
| 1690 | + if(e.getMessage().indexOf("PK_YLB_UK")>0){ | ||
| 1691 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 1692 | + logger.info("油量存在相同数据,数据已经过滤"); | ||
| 1693 | + } | ||
| 1694 | + } | ||
| 1676 | 1695 | ||
| 1677 | } | 1696 | } |
| 1678 | 1697 | ||
| @@ -1776,7 +1795,15 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1776,7 +1795,15 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1776 | List<Dlb> updDlb=mapList.get("updList"); | 1795 | List<Dlb> updDlb=mapList.get("updList"); |
| 1777 | for (int i = 0; i < updDlb.size(); i++) { | 1796 | for (int i = 0; i < updDlb.size(); i++) { |
| 1778 | Dlb d=updDlb.get(i); | 1797 | Dlb d=updDlb.get(i); |
| 1779 | - dlbRepository.save(d); | 1798 | + try { |
| 1799 | + dlbRepository.save(d); | ||
| 1800 | + } catch (Exception e) { | ||
| 1801 | + // TODO: handle exception | ||
| 1802 | + if(e.getMessage().indexOf("PK_DLB_UK")>0){ | ||
| 1803 | + newMap.put("fage", "存在相同数据,数据已经过滤"); | ||
| 1804 | + logger.info("电量存在相同数据,数据已经过滤"); | ||
| 1805 | + } | ||
| 1806 | + } | ||
| 1780 | } | 1807 | } |
| 1781 | //重新获取电耗数据结束 | 1808 | //重新获取电耗数据结束 |
| 1782 | newMap.put("status", ResponseCode.SUCCESS); | 1809 | newMap.put("status", ResponseCode.SUCCESS); |
src/main/java/com/bsth/service/report/ReportService.java
| @@ -50,4 +50,6 @@ public interface ReportService { | @@ -50,4 +50,6 @@ public interface ReportService { | ||
| 50 | List<Map<String, Object>> countByBusList(Map<String, Object> map); | 50 | List<Map<String, Object>> countByBusList(Map<String, Object> map); |
| 51 | 51 | ||
| 52 | List<Map<String, Object>> countDjg(Map<String, Object> map); | 52 | List<Map<String, Object>> countDjg(Map<String, Object> map); |
| 53 | + | ||
| 54 | + Map<String, Object> online(Map<String, Object> map); | ||
| 53 | } | 55 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -3343,6 +3343,121 @@ public class ReportServiceImpl implements ReportService{ | @@ -3343,6 +3343,121 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3343 | map.put("djgxx", mapList); | 3343 | map.put("djgxx", mapList); |
| 3344 | return map; | 3344 | return map; |
| 3345 | } | 3345 | } |
| 3346 | + | ||
| 3347 | + | ||
| 3348 | + @Override | ||
| 3349 | + public Map<String, Object> online(Map<String, Object> map) { | ||
| 3350 | + String line =map.get("line").toString(); | ||
| 3351 | + String date =map.get("date").toString(); | ||
| 3352 | + String type =map.get("type").toString(); | ||
| 3353 | + DecimalFormat df = new DecimalFormat("#0.00"); | ||
| 3354 | + String sql="select cl_zbh from bsth_c_s_sp_info_real where " | ||
| 3355 | + + " schedule_date_str ='"+date+"' and xl_bm='"+line+"' group by cl_zbh"; | ||
| 3356 | + List<String> list= jdbcTemplate.query(sql, | ||
| 3357 | + new RowMapper<String>(){ | ||
| 3358 | + @Override | ||
| 3359 | + public String mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 3360 | + String clzbh=rs.getString("cl_zbh"); | ||
| 3361 | + return clzbh; | ||
| 3362 | + } | ||
| 3363 | + }); | ||
| 3364 | + List<Line> lineList=lineRepository.findLineByCode(line); | ||
| 3365 | + int qzpcs =0; | ||
| 3366 | + for (int i = 0; i < lineList.size(); i++) { | ||
| 3367 | + Line l=lineList.get(i); | ||
| 3368 | + qzpcs = l.getWarrantCar()==null?0:l.getWarrantCar(); | ||
| 3369 | + } | ||
| 3370 | + | ||
| 3371 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 3372 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); | ||
| 3373 | + int zxcl=0; | ||
| 3374 | + try { | ||
| 3375 | + Long date1 = simpleDateFormat.parse(date+" 00:00:01").getTime(); | ||
| 3376 | + Long date2=simpleDateFormat.parse(date+" 23:59:59").getTime(); | ||
| 3377 | + Date dates=simpleDateFormat.parse(date+" 00:00:00"); | ||
| 3378 | + List<ArrivalInfo> lists=load_online(line,date1,date2,dates); | ||
| 3379 | + for (int i = 0; i < list.size(); i++) { | ||
| 3380 | + String nbbm=list.get(i); | ||
| 3381 | + String sbbb=BasicData.deviceId2NbbmMap.inverse().get(nbbm); | ||
| 3382 | + for (int j = 0; j < lists.size(); j++) { | ||
| 3383 | + ArrivalInfo a=lists.get(i); | ||
| 3384 | + if(a.getDeviceId().equals(sbbb)){ | ||
| 3385 | + zxcl ++; | ||
| 3386 | + break; | ||
| 3387 | + } | ||
| 3388 | + } | ||
| 3389 | + | ||
| 3390 | + } | ||
| 3391 | + } catch (ParseException e) { | ||
| 3392 | + // TODO Auto-generated catch block | ||
| 3393 | + e.printStackTrace(); | ||
| 3394 | + } | ||
| 3395 | + map.put("xlName", BasicData.lineCode2NameMap.get(line)); | ||
| 3396 | + map.put("qzpcs", qzpcs); | ||
| 3397 | + map.put("ccs", list.size()); | ||
| 3398 | + map.put("zxcl", zxcl); | ||
| 3399 | + String zxl="0"; | ||
| 3400 | + if(list.size()>0){ | ||
| 3401 | + zxl = df.format(zxcl/list.size()); | ||
| 3402 | + } | ||
| 3403 | + map.put("zxl", zxl+"%"); | ||
| 3404 | + | ||
| 3405 | + if(type.equals("export")){ | ||
| 3406 | + List<Map<String, Object>> lMap=new ArrayList<Map<String,Object>>(); | ||
| 3407 | + | ||
| 3408 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 3409 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 3410 | + m.put("date", date); | ||
| 3411 | + m.put("xlName", BasicData.lineCode2NameMap.get(line)); | ||
| 3412 | + m.put("qzpcs", qzpcs); | ||
| 3413 | + m.put("ccs", list.size()); | ||
| 3414 | + m.put("zxcl", zxcl); | ||
| 3415 | + m.put("zxl", zxl+"%"); | ||
| 3416 | + lMap.add(m); | ||
| 3417 | + ReportUtils ee = new ReportUtils(); | ||
| 3418 | + try { | ||
| 3419 | + listI.add(lMap.iterator()); | ||
| 3420 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 3421 | + ee.excelReplace(listI, new Object[]{m}, path + "mould/onlinelist.xls", | ||
| 3422 | + path + "export/车辆在线率统计.xls"); | ||
| 3423 | + } catch (Exception e) { | ||
| 3424 | + // TODO: handle exception | ||
| 3425 | + e.printStackTrace(); | ||
| 3426 | + } | ||
| 3427 | + } | ||
| 3428 | + return map; | ||
| 3429 | + } | ||
| 3430 | + | ||
| 3431 | + public List<ArrivalInfo> load_online(String line,Long date1,Long date2,Date dates){ | ||
| 3432 | + List<ArrivalInfo> list = null; | ||
| 3433 | + Calendar cal = Calendar.getInstance(); | ||
| 3434 | + cal.setTime(dates); | ||
| 3435 | + //周数,表分区字段 | ||
| 3436 | + int weeks_year = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 3437 | + | ||
| 3438 | + Connection conn = null; | ||
| 3439 | + PreparedStatement ps = null; | ||
| 3440 | + ResultSet rs = null; | ||
| 3441 | + | ||
| 3442 | + String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts"; | ||
| 3443 | + try{ | ||
| 3444 | + conn = DBUtils_MS.getConnection(); | ||
| 3445 | + ps = conn.prepareStatement(sql); | ||
| 3446 | + ps.setString(1,line); | ||
| 3447 | + ps.setInt(2, weeks_year); | ||
| 3448 | + ps.setLong(3, date1); | ||
| 3449 | + ps.setLong(4, date2); | ||
| 3450 | + rs = ps.executeQuery(); | ||
| 3451 | + | ||
| 3452 | + list = resultSet2Set(rs); | ||
| 3453 | + }catch(Exception e){ | ||
| 3454 | + logger.error("", e); | ||
| 3455 | + }finally { | ||
| 3456 | + DBUtils_MS.close(rs, ps, conn); | ||
| 3457 | + } | ||
| 3458 | + return list; | ||
| 3459 | + } | ||
| 3460 | + | ||
| 3346 | 3461 | ||
| 3347 | } | 3462 | } |
| 3348 | 3463 |
src/main/resources/static/pages/forms/mould/onlinelist.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/mforms/online/online.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; | ||
| 14 | + text-align: center;} | ||
| 15 | + | ||
| 16 | + .table > tbody + tbody { | ||
| 17 | + border-top: 1px solid; } | ||
| 18 | + .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{ text-align: center; } | ||
| 19 | +.table-checkable tr > th:first-child, .table-checkable tr > td:first-child { | ||
| 20 | + text-align: center; | ||
| 21 | + max-width: initial; | ||
| 22 | + min-width: 40px; | ||
| 23 | + padding-left: 0; | ||
| 24 | + padding-right: 0; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +</style> | ||
| 28 | + | ||
| 29 | +<div class="page-head"> | ||
| 30 | + <div class="page-title"> | ||
| 31 | + <h1>车辆在线率统计表</h1> | ||
| 32 | + </div> | ||
| 33 | +</div> | ||
| 34 | + | ||
| 35 | +<div class="row"> | ||
| 36 | + <div class="col-md-12"> | ||
| 37 | + <div class="portlet light porttlet-fit bordered"> | ||
| 38 | + <div class="portlet-title"> | ||
| 39 | + <form class="form-inline" action="" method="post"> | ||
| 40 | + <div style="display: inline-block; margin-left: 20px;" id="gsdmDiv_turn"> | ||
| 41 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 42 | + <select class="form-control" name="company" id="gsdmTurn" style="width: 140px;"></select> | ||
| 43 | + </div> | ||
| 44 | + <div style="display: inline-block; margin-left: 20px;" id="fgsdmDiv_turn"> | ||
| 45 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 46 | + <select class="form-control" name="subCompany" id="fgsdmTurn" style="width: 140px;"></select> | ||
| 47 | + </div> | ||
| 48 | + <div style="display: inline-block; margin-left: 15px;"> | ||
| 49 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 50 | + <select class="form-control" name="line" id="line" style="width: 120px;"></select> | ||
| 51 | + </div> | ||
| 52 | + <div style="display: inline-block;margin-left: 15px;"> | ||
| 53 | + <span class="item-label" style="width: 80px;">日期: </span> | ||
| 54 | + <input class="form-control" type="text" id="date" style="width: 120px;"/> | ||
| 55 | + </div> | ||
| 56 | + | ||
| 57 | + <div class="form-group"> | ||
| 58 | + <input class="btn btn-default" type="button" id="query" value="筛选"/> | ||
| 59 | + <input class="btn btn-default" type="button" id="export" value="导出"/> | ||
| 60 | + </div> | ||
| 61 | + </form> | ||
| 62 | + </div> | ||
| 63 | + <div class="portlet-body"> | ||
| 64 | + <div class="table-container" style="margin-top: 20px;overflow:auto;min-width: 1000px"> | ||
| 65 | + <table class="table table-bordered table-hover table-checkable" id="forms1"> | ||
| 66 | + <thead> | ||
| 67 | + <tr> | ||
| 68 | + <th colspan="6">车辆在线率统计表</th> | ||
| 69 | + </tr> | ||
| 70 | + <tr> | ||
| 71 | + <td>日期</td> | ||
| 72 | + <td>线路</td> | ||
| 73 | + <td>权证配车数</td> | ||
| 74 | + <td>实际出车数</td> | ||
| 75 | + <td>在线车辆数</td> | ||
| 76 | + <td>在线率</td> | ||
| 77 | + </tr> | ||
| 78 | + </thead> | ||
| 79 | + <tbody id="tbody"> | ||
| 80 | + | ||
| 81 | + </tbody> | ||
| 82 | + </table> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + </div> | ||
| 87 | +</div> | ||
| 88 | + | ||
| 89 | +<script> | ||
| 90 | + $(function(){ | ||
| 91 | + // 关闭左侧栏 | ||
| 92 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 93 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 94 | + | ||
| 95 | + $("#date").datetimepicker({ | ||
| 96 | + format : 'YYYY-MM-DD', | ||
| 97 | + locale : 'zh-cn' | ||
| 98 | + }); | ||
| 99 | + | ||
| 100 | + var d = new Date(); | ||
| 101 | + var year = d.getFullYear(); | ||
| 102 | + var month = d.getMonth() + 1; | ||
| 103 | + var day = d.getDate(); | ||
| 104 | + if(month < 10) | ||
| 105 | + month = "0" + month; | ||
| 106 | + if(day < 10) | ||
| 107 | + day = "0" + day; | ||
| 108 | + $("#date").val(year + "-" + month + "-" + day); | ||
| 109 | + | ||
| 110 | + var fage=false; | ||
| 111 | + var xlList; | ||
| 112 | + var obj = []; | ||
| 113 | + | ||
| 114 | + $.get('/report/lineList',function(result){ | ||
| 115 | + xlList=result; | ||
| 116 | + $.get('/user/companyData', function(result){ | ||
| 117 | + obj = result; | ||
| 118 | + var options = ''; | ||
| 119 | + for(var i = 0; i < obj.length; i++){ | ||
| 120 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 121 | + } | ||
| 122 | + | ||
| 123 | + if(obj.length ==0){ | ||
| 124 | + $("#gsdmDiv_turn").css('display','none'); | ||
| 125 | + }else if(obj.length ==1){ | ||
| 126 | + $("#gsdmDiv_turn").css('display','none'); | ||
| 127 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 128 | + $('#fgsdmDiv_turn').css('display','none'); | ||
| 129 | + } | ||
| 130 | + $('#gsdmTurn').html(options); | ||
| 131 | + updateCompany(); | ||
| 132 | + }); | ||
| 133 | + }) | ||
| 134 | + $("#gsdmTurn").on("change",updateCompany); | ||
| 135 | + function updateCompany(){ | ||
| 136 | + var company = $('#gsdmTurn').val(); | ||
| 137 | + var options = ''; | ||
| 138 | + for(var i = 0; i < obj.length; i++){ | ||
| 139 | + if(obj[i].companyCode == company){ | ||
| 140 | + var children = obj[i].children; | ||
| 141 | + for(var j = 0; j < children.length; j++){ | ||
| 142 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + } | ||
| 146 | + $('#fgsdmTurn').html(options); | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + var tempData = {}; | ||
| 150 | + $.get('/report/lineList',function(xlList){ | ||
| 151 | + var data = []; | ||
| 152 | +// data.push({id: " ", text: "全部线路"}); | ||
| 153 | + $.get('/user/companyData', function(result){ | ||
| 154 | + for(var i = 0; i < result.length; i++){ | ||
| 155 | + var companyCode = result[i].companyCode; | ||
| 156 | + var children = result[i].children; | ||
| 157 | + for(var j = 0; j < children.length; j++){ | ||
| 158 | + var code = children[j].code; | ||
| 159 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 160 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 161 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 162 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 163 | + } | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + } | ||
| 167 | + initPinYinSelect2('#line',data,''); | ||
| 168 | + | ||
| 169 | + }); | ||
| 170 | + }); | ||
| 171 | + | ||
| 172 | + $("#line").on("change", function(){ | ||
| 173 | + if($("#line").val() == " "){ | ||
| 174 | + $("#gsdmTurn").attr("disabled", false); | ||
| 175 | + $("#fgsdmTurn").attr("disabled", false); | ||
| 176 | + } else { | ||
| 177 | + var temp = tempData[$("#line").val()].split(":"); | ||
| 178 | + $("#gsdmTurn").val(temp[0]); | ||
| 179 | + updateCompany(); | ||
| 180 | + $("#fgsdmTurn").val(temp[1]); | ||
| 181 | + $("#gsdmTurn").attr("disabled", true); | ||
| 182 | + $("#fgsdmTurn").attr("disabled", true); | ||
| 183 | + } | ||
| 184 | + }); | ||
| 185 | + | ||
| 186 | + var line; | ||
| 187 | + var date; | ||
| 188 | + $("#query").on("click",function(){ | ||
| 189 | + line = $("#line").val(); | ||
| 190 | + date=$("#date").val(); | ||
| 191 | + if(date!=''){ | ||
| 192 | + $get('/report/online', | ||
| 193 | + { line:line,date:date,type:'query'},function(result){ | ||
| 194 | + // 把数据填充到模版中 | ||
| 195 | + var tbodyHtml = template('online',result); | ||
| 196 | + // 把渲染好的模版html文本追加到表格中 | ||
| 197 | + $('#tbody').html(tbodyHtml); | ||
| 198 | + }); | ||
| 199 | + | ||
| 200 | + }else{ | ||
| 201 | + layer.msg("请选择时间!"); | ||
| 202 | + } | ||
| 203 | + }); | ||
| 204 | + | ||
| 205 | + $("#export").on("click",function(){ | ||
| 206 | + line = $("#line").val(); | ||
| 207 | + date=$("#date").val(); | ||
| 208 | + $get('/report/online',{line:line,date:date,type:'export'},function(result){ | ||
| 209 | + window.open("/downloadFile/download?fileName=车辆在线率统计"); | ||
| 210 | + }); | ||
| 211 | + }); | ||
| 212 | + }); | ||
| 213 | +</script> | ||
| 214 | +<script type="text/html" id="online"> | ||
| 215 | + <tr> | ||
| 216 | + <td>{{date}}</td> | ||
| 217 | + <td>{{xlName}}</td> | ||
| 218 | + <td>{{qzpcs}}</td> | ||
| 219 | + <td>{{ccs}}</td> | ||
| 220 | + <td>{{zxcl}}</td> | ||
| 221 | + <td>{{zxl}}</td> | ||
| 222 | + </tr> | ||
| 223 | +</script> |
src/main/resources/static/pages/oil/history/history.html
0 → 100644
| 1 | +<style type="text/css"> | ||
| 2 | + .table-bordered { | ||
| 3 | + border: 1px solid; } | ||
| 4 | + .table-bordered > thead > tr > th, | ||
| 5 | + .table-bordered > thead > tr > td, | ||
| 6 | + .table-bordered > tbody > tr > th, | ||
| 7 | + .table-bordered > tbody > tr > td, | ||
| 8 | + .table-bordered > tfoot > tr > th, | ||
| 9 | + .table-bordered > tfoot > tr > td { | ||
| 10 | + border: 1px solid; } | ||
| 11 | + .table-bordered > thead > tr > th, | ||
| 12 | + .table-bordered > thead > tr > td { | ||
| 13 | + border-bottom-width: 2px; } | ||
| 14 | + | ||
| 15 | + .table > tbody + tbody { | ||
| 16 | + border-top: 1px solid; } | ||
| 17 | +</style> | ||
| 18 | + | ||
| 19 | +<div class="page-head"> | ||
| 20 | + <div class="page-title"> | ||
| 21 | + <h1>重新统计</h1> | ||
| 22 | + </div> | ||
| 23 | +</div> | ||
| 24 | + | ||
| 25 | +<div class="row"> | ||
| 26 | + <div class="col-md-12"> | ||
| 27 | + <div class="portlet light porttlet-fit bordered"> | ||
| 28 | + <div class="portlet-title"> | ||
| 29 | + <form class="form-inline" action=""> | ||
| 30 | + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv_daily"> | ||
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="gsdmDaily" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block; margin-left: 24px;" id="fgsdmDiv_daily"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="fgsdmDaily" style="width: 180px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div style="margin-top: 2px"></div> | ||
| 39 | + <div style="display: inline-block;margin-left: 33px;"> | ||
| 40 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 41 | + <select class="form-control" name="line" id="line" style="width: 180px;"></select> | ||
| 42 | + </div> | ||
| 43 | + <div style="display: inline-block;margin-left: 24px;"> | ||
| 44 | + <span class="item-label" style="width: 80px;"> 时间: </span> | ||
| 45 | + <select class="form-control" id="date" style="width: 180px;"> | ||
| 46 | + <option value="2017-11-07">2017-11-07</option> | ||
| 47 | + </select> | ||
| 48 | + </div> | ||
| 49 | + <div class="form-group"> | ||
| 50 | + <input class="btn btn-default" type="button" id="query" value="重新统计"/> | ||
| 51 | + </div> | ||
| 52 | + </form> | ||
| 53 | + </div> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | +</div> | ||
| 57 | + | ||
| 58 | +<script> | ||
| 59 | + $(function(){ | ||
| 60 | + | ||
| 61 | + // 关闭左侧栏 | ||
| 62 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 63 | + $('.menu-toggler.sidebar-toggler').click(); | ||
| 64 | + | ||
| 65 | + function GetDateStr(AddDayCount) { | ||
| 66 | + var dd = new Date(); | ||
| 67 | + dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期 | ||
| 68 | + var y = dd.getFullYear(); | ||
| 69 | + var m = dd.getMonth()+1;//获取当前月份的日期 | ||
| 70 | + if(m<10){ | ||
| 71 | + m="0" + m; | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + var d = dd.getDate(); | ||
| 75 | + if(d<10){ | ||
| 76 | + d="0" +d; | ||
| 77 | + } | ||
| 78 | + return y+"-"+m+"-"+d; | ||
| 79 | + } | ||
| 80 | +// var optionsDate = ''; | ||
| 81 | +// for(var i = -1; i > -4; i--){ | ||
| 82 | +// optionsDate += '<option value="2017-11-01">'+2017-11-01+'</option>'; | ||
| 83 | +// } | ||
| 84 | +// $('#date').html(optionsDate); | ||
| 85 | + var fage=false; | ||
| 86 | + var xlList; | ||
| 87 | + var obj = []; | ||
| 88 | + | ||
| 89 | + | ||
| 90 | + $.get('/report/lineList',function(result){ | ||
| 91 | + xlList=result; | ||
| 92 | + $.get('/user/companyData', function(result){ | ||
| 93 | + obj = result; | ||
| 94 | + var options = ''; | ||
| 95 | + for(var i = 0; i < obj.length; i++){ | ||
| 96 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + if(obj.length ==0){ | ||
| 100 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 101 | + }else if(obj.length ==1){ | ||
| 102 | + $("#gsdmDiv_daily").css('display','none'); | ||
| 103 | + if(obj[0].children.length == 1 || obj[0].children.length ==0) | ||
| 104 | + $('#fgsdmDiv_daily').css('display','none'); | ||
| 105 | + } | ||
| 106 | + $('#gsdmDaily').html(options); | ||
| 107 | + updateCompany(); | ||
| 108 | + }); | ||
| 109 | + }) | ||
| 110 | + $("#gsdmDaily").on("change",updateCompany); | ||
| 111 | + function updateCompany(){ | ||
| 112 | + var company = $('#gsdmDaily').val(); | ||
| 113 | + var options = ''; | ||
| 114 | + for(var i = 0; i < obj.length; i++){ | ||
| 115 | + if(obj[i].companyCode == company){ | ||
| 116 | + var children = obj[i].children; | ||
| 117 | + for(var j = 0; j < children.length; j++){ | ||
| 118 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 119 | + } | ||
| 120 | + } | ||
| 121 | + } | ||
| 122 | + $('#fgsdmDaily').html(options); | ||
| 123 | +// initXl(); | ||
| 124 | + } | ||
| 125 | + | ||
| 126 | + | ||
| 127 | + var tempData = {}; | ||
| 128 | + $.get('/report/lineList',function(xlList){ | ||
| 129 | + var data = []; | ||
| 130 | +// data.push({id: " ", text: "全部线路"}); | ||
| 131 | + $.get('/user/companyData', function(result){ | ||
| 132 | + for(var i = 0; i < result.length; i++){ | ||
| 133 | + var companyCode = result[i].companyCode; | ||
| 134 | + var children = result[i].children; | ||
| 135 | + for(var j = 0; j < children.length; j++){ | ||
| 136 | + var code = children[j].code; | ||
| 137 | + for(var k=0;k < xlList.length;k++ ){ | ||
| 138 | + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){ | ||
| 139 | + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]}); | ||
| 140 | + tempData[xlList[k]["xlbm"]] = companyCode+":"+code; | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + } | ||
| 145 | + initPinYinSelect2('#line',data,''); | ||
| 146 | + | ||
| 147 | + }); | ||
| 148 | + }); | ||
| 149 | + | ||
| 150 | + $("#line").on("change", function(){ | ||
| 151 | + if($("#line").val() == " "){ | ||
| 152 | + $("#gsdmDaily").attr("disabled", false); | ||
| 153 | + $("#fgsdmDaily").attr("disabled", false); | ||
| 154 | + } else { | ||
| 155 | + var temp = tempData[$("#line").val()].split(":"); | ||
| 156 | + $("#gsdmDaily").val(temp[0]); | ||
| 157 | + updateCompany(); | ||
| 158 | + $("#fgsdmDaily").val(temp[1]); | ||
| 159 | + $("#gsdmDaily").attr("disabled", true); | ||
| 160 | + $("#fgsdmDaily").attr("disabled", true); | ||
| 161 | + } | ||
| 162 | + }); | ||
| 163 | + | ||
| 164 | + | ||
| 165 | + var line; | ||
| 166 | + var date; | ||
| 167 | + var gsdmDaily; | ||
| 168 | + var fgsdmDaily; | ||
| 169 | + $("#query").on("click",function(){ | ||
| 170 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 171 | + layer.msg("请选择时间"); | ||
| 172 | + return; | ||
| 173 | + } | ||
| 174 | + line = $("#line").val(); | ||
| 175 | + date = $("#date").val(); | ||
| 176 | + gsdmDaily=$("#gsdmDaily").val(); | ||
| 177 | + fgsdmDaily = $("#fgsdmDaily").val(); | ||
| 178 | + $post('/ylb/updateHistory', {date:date,line:line,gsdm:gsdmDaily,fgsdm:fgsdmDaily}, | ||
| 179 | + function (result) { | ||
| 180 | + layer.msg("重新统计成功"); | ||
| 181 | + }); | ||
| 182 | + }); | ||
| 183 | + | ||
| 184 | +}); | ||
| 185 | +</script> |
src/main/resources/static/pages/oil/list_ph.html
| @@ -59,10 +59,10 @@ | @@ -59,10 +59,10 @@ | ||
| 59 | id="export"> <i class="fa fa-file-excel-o"></i> 导出Excel | 59 | id="export"> <i class="fa fa-file-excel-o"></i> 导出Excel |
| 60 | </a></li> | 60 | </a></li> |
| 61 | 61 | ||
| 62 | -<!-- <li class="divider"></li> --> | ||
| 63 | -<!-- <li><a href="javascript:;" data-action="3" class="tool-action" --> | ||
| 64 | -<!-- id="cxtj"> <i class="fa fa-file-excel-o"></i> 导出Excel --> | ||
| 65 | -<!-- </a></li> --> | 62 | + <li class="divider"></li> |
| 63 | + <li><a href="javascript:;" data-action="3" class="tool-action" | ||
| 64 | + id="cxtj"> <i class="fa fa-file-excel-o"></i> 重新统计 | ||
| 65 | + </a></li> | ||
| 66 | </ul> | 66 | </ul> |
| 67 | </div> | 67 | </div> |
| 68 | </div> | 68 | </div> |
| @@ -972,16 +972,16 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | @@ -972,16 +972,16 @@ onkeyup="this.value=this.value.replace(/[^(\d||/.)]/g,'').replace('.','$#$').rep | ||
| 972 | } | 972 | } |
| 973 | // } | 973 | // } |
| 974 | 974 | ||
| 975 | -// $("#cxtj").on("click", function () { | ||
| 976 | -// if ($("#rq").val() != "") { | ||
| 977 | -// // var params=getParamsList(); | ||
| 978 | -// $post('/ylb/updateHistory', {date:'2017-10-01',line:'10845',gsdm:'55',fgsdm:'3'}, function (result) { | ||
| 979 | -// window.open("/downloadFile/download?fileName="+$("#rq").val()+"进出场存油量" ); | ||
| 980 | -// }); | ||
| 981 | -// } else { | ||
| 982 | -// layer.msg('请选择日期.'); | ||
| 983 | -// } | ||
| 984 | -// }); | 975 | + $("#cxtj").on("click", function () { |
| 976 | + if ($("#rq").val() != "") { | ||
| 977 | +// var params=getParamsList(); | ||
| 978 | + $post('/ylb/updateHistory', {date:'2017-11-07',line:'10708',gsdm:'26',fgsdm:'1'}, function (result) { | ||
| 979 | + window.open("/downloadFile/download?fileName="+$("#rq").val()+"进出场存油量" ); | ||
| 980 | + }); | ||
| 981 | + } else { | ||
| 982 | + layer.msg('请选择日期.'); | ||
| 983 | + } | ||
| 984 | + }); | ||
| 985 | 985 | ||
| 986 | //导出 | 986 | //导出 |
| 987 | 987 |