Commit 86d763ba0b882319e4f020184061d01ac99060a0
1 parent
7481b893
新报表:车辆公里统计
Showing
4 changed files
with
465 additions
and
87 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| ... | ... | @@ -267,4 +267,11 @@ public class ReportController { |
| 267 | 267 | return service.countByList(map); |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | + @RequestMapping(value="/countBusMileage") | |
| 271 | + public List<Map<String,Object>> countBusMileage(@RequestParam Map<String, Object> map){ | |
| 272 | + | |
| 273 | + return service.countByBusList(map); | |
| 274 | + } | |
| 275 | + | |
| 276 | + | |
| 270 | 277 | } | ... | ... |
src/main/java/com/bsth/service/report/ReportService.java
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -17,11 +17,13 @@ import java.util.Map; |
| 17 | 17 | import java.util.Set; |
| 18 | 18 | |
| 19 | 19 | import org.apache.commons.lang.StringUtils; |
| 20 | +import org.dbunit.dataset.DataSetException; | |
| 20 | 21 | import org.slf4j.Logger; |
| 21 | 22 | import org.slf4j.LoggerFactory; |
| 22 | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| 23 | 24 | import org.springframework.jdbc.core.JdbcTemplate; |
| 24 | 25 | import org.springframework.jdbc.core.RowMapper; |
| 26 | +import org.springframework.scheduling.commonj.ScheduledTimerListener; | |
| 25 | 27 | import org.springframework.stereotype.Service; |
| 26 | 28 | |
| 27 | 29 | import com.bsth.data.BasicData; |
| ... | ... | @@ -30,6 +32,7 @@ import com.bsth.entity.Personnel; |
| 30 | 32 | import com.bsth.entity.StationRoute; |
| 31 | 33 | import com.bsth.entity.excep.ArrivalInfo; |
| 32 | 34 | import com.bsth.entity.mcy_forms.Operationservice; |
| 35 | +import com.bsth.entity.oil.Dlb; | |
| 33 | 36 | import com.bsth.entity.oil.Ylb; |
| 34 | 37 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 35 | 38 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| ... | ... | @@ -1534,6 +1537,10 @@ public class ReportServiceImpl implements ReportService{ |
| 1534 | 1537 | map.put("xlName", list.get(0).getXlName()); |
| 1535 | 1538 | map.put("gs", list.get(0).getGsName()); |
| 1536 | 1539 | map.put("fgs", list.get(0).getFgsName()); |
| 1540 | + map.put("jGh", list.get(0).getjGh()); | |
| 1541 | + map.put("sGh", list.get(0).getsGh()==null?"":list.get(0).getsGh()); | |
| 1542 | + map.put("nbbm",list.get(0).getClZbh()); | |
| 1543 | + map.put("line", list.get(0).getXlBm()); | |
| 1537 | 1544 | } |
| 1538 | 1545 | |
| 1539 | 1546 | double jhyygl=culateService.culateJhgl(list);//计划营运公里 |
| ... | ... | @@ -1596,5 +1603,363 @@ public class ReportServiceImpl implements ReportService{ |
| 1596 | 1603 | } |
| 1597 | 1604 | return map; |
| 1598 | 1605 | } |
| 1606 | + @Override | |
| 1607 | + public List<Map<String, Object>> countByBusList(Map<String, Object> map) { | |
| 1608 | + // TODO Auto-generated method stub | |
| 1609 | + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); | |
| 1610 | + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); | |
| 1611 | + List<Map<String, Object>> lMaps = new ArrayList<Map<String, Object>>(); | |
| 1612 | + String gsdm=""; | |
| 1613 | + if(map.get("gsdm")!=null){ | |
| 1614 | + gsdm=map.get("gsdm").toString(); | |
| 1615 | + } | |
| 1616 | + String fgsdm=""; | |
| 1617 | + if(map.get("fgsdm")!=null){ | |
| 1618 | + fgsdm=map.get("fgsdm").toString(); | |
| 1619 | + } | |
| 1620 | + String line=""; | |
| 1621 | + if(map.get("line")!=null){ | |
| 1622 | + line=map.get("line").toString(); | |
| 1623 | + } | |
| 1624 | + String date=""; | |
| 1625 | + if(map.get("date")!=null){ | |
| 1626 | + date=map.get("date").toString(); | |
| 1627 | + } | |
| 1628 | + String date2=""; | |
| 1629 | + if(map.get("date2")!=null){ | |
| 1630 | + date2=map.get("date2").toString(); | |
| 1631 | + } | |
| 1632 | + String xlName=""; | |
| 1633 | + if(map.get("xlName")!=null){ | |
| 1634 | + xlName=map.get("xlName").toString(); | |
| 1635 | + } | |
| 1636 | + String zt=""; | |
| 1637 | + if(map.get("zt")!=null){ | |
| 1638 | + zt=map.get("zt").toString(); | |
| 1639 | + } | |
| 1640 | + String type=""; | |
| 1641 | + if(map.get("type")!=null){ | |
| 1642 | + type=map.get("type").toString(); | |
| 1643 | + } | |
| 1644 | + //所有班次信息 | |
| 1645 | + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | |
| 1646 | + line =line.trim(); | |
| 1647 | + if(line.equals("")){ | |
| 1648 | + //查询所有线路 | |
| 1649 | + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); | |
| 1650 | + }else{ | |
| 1651 | + //查询单条线路 | |
| 1652 | + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); | |
| 1653 | + } | |
| 1654 | + String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+date+"' and '"+date2+"'"; | |
| 1655 | + if(line.equals("")){ | |
| 1656 | + ylbSql +="and ssgsdm='"+gsdm+"' " | |
| 1657 | + + " and fgsdm='"+fgsdm+"'"; | |
| 1658 | + }else{ | |
| 1659 | + ylbSql += " and xlbm = '"+line+"'"; | |
| 1660 | + } | |
| 1661 | + List<Ylb> ylbList=ylbList(ylbSql); | |
| 1662 | + | |
| 1663 | + String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'"; | |
| 1664 | + if(line.equals("")){ | |
| 1665 | + dlbSql +="and ssgsdm='"+gsdm+"' " | |
| 1666 | + + " and fgsdm='"+fgsdm+"'"; | |
| 1667 | + }else{ | |
| 1668 | + dlbSql += " and xlbm = '"+line+"'"; | |
| 1669 | + } | |
| 1670 | + List<Dlb> dlbList=dlbList(dlbSql); | |
| 1671 | + | |
| 1672 | + String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh" | |
| 1673 | + + " from bsth_c_s_sp_info_real r where" | |
| 1674 | + + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; | |
| 1675 | + if(line.equals("")){ | |
| 1676 | + sql +="and r.gs_bm='"+gsdm+"' " | |
| 1677 | + + " and r.fgs_bm='"+fgsdm+"'"; | |
| 1678 | + }else{ | |
| 1679 | + sql += " and r.xl_bm = '"+line+"'"; | |
| 1680 | + } | |
| 1681 | + sql += " group by r.xl_bm,r.cl_zbh,r.schedule_date_str,r.j_gh,r.s_gh"; | |
| 1682 | + | |
| 1683 | + List<Map<String, Object>> listGroupBy=jdbcTemplate.query(sql, new RowMapper<Map<String, Object>>() { | |
| 1684 | + @Override | |
| 1685 | + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1686 | + Map<String, Object> map=new HashMap<String,Object>(); | |
| 1687 | + map.put("line",arg0.getString("xl_bm")); | |
| 1688 | + map.put("date", arg0.getString("schedule_date_str")); | |
| 1689 | + map.put("nbbm", arg0.getString("cl_zbh")); | |
| 1690 | + map.put("jGh", arg0.getString("j_gh")); | |
| 1691 | + map.put("sGh", arg0.getString("s_gh")); | |
| 1692 | + return map; | |
| 1693 | + } | |
| 1694 | + }); | |
| 1695 | + | |
| 1696 | + for (int i = 0; i < listGroupBy.size(); i++) { | |
| 1697 | + Map<String, Object> m=listGroupBy.get(i); | |
| 1698 | + String xl_bm=m.get("line")==null?"":m.get("line").toString(); | |
| 1699 | + String dateStr=m.get("date")==null?"":m.get("date").toString(); | |
| 1700 | + String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString(); | |
| 1701 | + String jGh= m.get("jGh")==null?"":m.get("jGh").toString(); | |
| 1702 | + String sGh= m.get("sGh")==null?"":m.get("sGh").toString(); | |
| 1703 | + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); | |
| 1704 | + for (int j = 0; j < list.size(); j++) { | |
| 1705 | + ScheduleRealInfo s=list.get(j); | |
| 1706 | + if(zt.equals("zbh")){ | |
| 1707 | + if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())){ | |
| 1708 | + lists.add(s); | |
| 1709 | + } | |
| 1710 | + }else{ | |
| 1711 | + if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh()) | |
| 1712 | + && dateStr.equals(s.getScheduleDateStr()) | |
| 1713 | + && jGh.equals(s.getjGh()) && sGh.equals(s.getsGh())){ | |
| 1714 | + lists.add(s); | |
| 1715 | + } | |
| 1716 | + } | |
| 1717 | + } | |
| 1718 | + | |
| 1719 | + if(zt.equals("zbh")){ | |
| 1720 | + Map<String, Object> newMap=staticTj(lists, ""); | |
| 1721 | + double yhl=0.0; | |
| 1722 | + double jzl=0.0; | |
| 1723 | + double hyl=0.0; | |
| 1724 | + double dhl=0.0; | |
| 1725 | + double cdl=0.0; | |
| 1726 | + for (int j = 0; j < ylbList.size(); j++) { | |
| 1727 | + Ylb y=ylbList.get(j); | |
| 1728 | + if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())){ | |
| 1729 | + yhl=Arith.add(yhl, y.getYh()); | |
| 1730 | + jzl=Arith.add(jzl, y.getJzl()); | |
| 1731 | + hyl=Arith.add(hyl, y.getYh()); | |
| 1732 | + } | |
| 1733 | + | |
| 1734 | + } | |
| 1735 | + for (int j = 0; j < dlbList.size(); j++) { | |
| 1736 | + Dlb d=dlbList.get(j); | |
| 1737 | + if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm())){ | |
| 1738 | + dhl=Arith.add(dhl, d.getHd()); | |
| 1739 | + cdl=Arith.add(cdl, d.getCdl()); | |
| 1740 | + } | |
| 1741 | + } | |
| 1742 | + if(date.equals(date2)){ | |
| 1743 | + newMap.put("rq",date); | |
| 1744 | + }else{ | |
| 1745 | + newMap.put("rq",date+"至"+date2); | |
| 1746 | + } | |
| 1747 | + newMap.put("yhl", yhl); | |
| 1748 | + newMap.put("jzl", jzl); | |
| 1749 | + newMap.put("hyl", hyl); | |
| 1750 | + newMap.put("dhl", dhl); | |
| 1751 | + newMap.put("cdl", cdl); | |
| 1752 | + lMap.add(newMap); | |
| 1753 | + }else{ | |
| 1754 | + Map<String, Object> newMap=staticTj(lists, ""); | |
| 1755 | + double lc=Double.parseDouble(newMap.get("zlc").toString()); | |
| 1756 | + double yhl=0.0; | |
| 1757 | + double jzl=0.0; | |
| 1758 | + double hyl=0.0; | |
| 1759 | + double dhl=0.0; | |
| 1760 | + double cdl=0.0; | |
| 1761 | + double zlc=0.0; | |
| 1762 | + for (int j = 0; j < ylbList.size(); j++) { | |
| 1763 | + Ylb y=ylbList.get(j); | |
| 1764 | + if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm()) | |
| 1765 | + &&dateStr.equals(sdf.format(y.getRq())) | |
| 1766 | + &&jGh.equals(y.getName())){ | |
| 1767 | + yhl=Arith.add(yhl, y.getYh()); | |
| 1768 | + jzl=Arith.add(jzl, y.getJzl()); | |
| 1769 | + hyl=Arith.add(hyl, y.getYh()); | |
| 1770 | + zlc=Arith.add(zlc, y.getZlc()); | |
| 1771 | + } | |
| 1772 | + | |
| 1773 | + } | |
| 1774 | + | |
| 1775 | + for (int j = 0; j < dlbList.size(); j++) { | |
| 1776 | + Dlb d=dlbList.get(j); | |
| 1777 | + if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm()) | |
| 1778 | + &&dateStr.equals(sdf.format(d.getRq())) | |
| 1779 | + &&jGh.equals(d.getName())){ | |
| 1780 | + dhl=Arith.add(dhl, d.getHd()); | |
| 1781 | + cdl=Arith.add(cdl, d.getCdl()); | |
| 1782 | + zlc=Arith.add(zlc, d.getZlc()); | |
| 1783 | + } | |
| 1784 | + } | |
| 1785 | + double div=0.0; | |
| 1786 | + if(lc>0){ | |
| 1787 | + div=Arith.div(zlc, lc,2); | |
| 1788 | + } | |
| 1789 | + newMap.put("yhl", yhl*div); | |
| 1790 | + newMap.put("jzl", jzl*div); | |
| 1791 | + newMap.put("hyl", hyl*div); | |
| 1792 | + newMap.put("dhl", dhl*div); | |
| 1793 | + newMap.put("cdl", cdl*div); | |
| 1794 | + lMaps.add(newMap); | |
| 1795 | + } | |
| 1796 | + | |
| 1797 | + } | |
| 1798 | + | |
| 1799 | + if(!zt.equals("zbh")){ | |
| 1800 | + String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh" | |
| 1801 | + + " from bsth_c_s_sp_info_real r where" | |
| 1802 | + + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; | |
| 1803 | + if(line.equals("")){ | |
| 1804 | + sqls +="and r.gs_bm='"+gsdm+"' " | |
| 1805 | + + " and r.fgs_bm='"+fgsdm+"'"; | |
| 1806 | + }else{ | |
| 1807 | + sqls += " and r.xl_bm = '"+line+"'"; | |
| 1808 | + } | |
| 1809 | + sqls += " group by r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"; | |
| 1810 | + | |
| 1811 | + List<Map<String, Object>> listGroupBys=jdbcTemplate.query(sqls, new RowMapper<Map<String, Object>>() { | |
| 1812 | + @Override | |
| 1813 | + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1814 | + Map<String, Object> map=new HashMap<String,Object>(); | |
| 1815 | + map.put("line",arg0.getString("xl_bm")); | |
| 1816 | + map.put("nbbm", arg0.getString("cl_zbh")); | |
| 1817 | + map.put("jGh", arg0.getString("j_gh")); | |
| 1818 | + map.put("sGh", arg0.getString("s_gh")); | |
| 1819 | + return map; | |
| 1820 | + } | |
| 1821 | + }); | |
| 1822 | + lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2); | |
| 1823 | + | |
| 1824 | + } | |
| 1825 | + | |
| 1826 | + return lMap; | |
| 1827 | + } | |
| 1599 | 1828 | |
| 1829 | + public final List<Ylb> ylbList(String sql){ | |
| 1830 | + List<Ylb> ylbList= jdbcTemplate.query(sql, new RowMapper<Ylb>() { | |
| 1831 | + @Override | |
| 1832 | + public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1833 | + Ylb y = new Ylb(); | |
| 1834 | + y.setXlbm(arg0.getString("xlbm")); | |
| 1835 | + y.setNbbm(arg0.getString("nbbm")); | |
| 1836 | + y.setJzl(arg0.getDouble("jzl")); | |
| 1837 | + y.setYh(arg0.getDouble("yh")); | |
| 1838 | + y.setSh(arg0.getDouble("sh")); | |
| 1839 | + return y; | |
| 1840 | + } | |
| 1841 | + }); | |
| 1842 | + return ylbList; | |
| 1843 | + } | |
| 1844 | + | |
| 1845 | + public final List<Dlb> dlbList(String sql){ | |
| 1846 | + List<Dlb> dlbList= jdbcTemplate.query(sql, new RowMapper<Dlb>() { | |
| 1847 | + @Override | |
| 1848 | + public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException { | |
| 1849 | + Dlb y = new Dlb(); | |
| 1850 | + y.setXlbm(arg0.getString("xlbm")); | |
| 1851 | + y.setNbbm(arg0.getString("nbbm")); | |
| 1852 | + y.setCdl(arg0.getDouble("cdl")); | |
| 1853 | + y.setHd(arg0.getDouble("hd")); | |
| 1854 | + y.setSh(arg0.getDouble("sh")); | |
| 1855 | + return y; | |
| 1856 | + } | |
| 1857 | + }); | |
| 1858 | + return dlbList; | |
| 1859 | + } | |
| 1860 | + | |
| 1861 | + public final List<Map<String, Object>> lists(List<Map<String, Object>> listGb, | |
| 1862 | + List<Map<String, Object>> listLc, | |
| 1863 | + String gsdm,String fgsdm, | |
| 1864 | + String date,String date2){ | |
| 1865 | + List<Map<String, Object>> lMap=new ArrayList<Map<String,Object>>(); | |
| 1866 | + for (int i = 0; i < listGb.size(); i++) { | |
| 1867 | + Map<String, Object> m=listGb.get(i); | |
| 1868 | + String xl_bm=m.get("line")==null?"":m.get("line").toString(); | |
| 1869 | + String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString(); | |
| 1870 | + String jGh= m.get("jGh")==null?"":m.get("jGh").toString(); | |
| 1871 | + String sGh= m.get("sGh")==null?"":m.get("sGh").toString(); | |
| 1872 | + double jhzlc = 0.0,jhlc= 0.0,jcclc= 0.0,zlc= 0.0,jhnlc= 0.0,jhwlc= 0.0, | |
| 1873 | + jhnjcclc= 0.0,jhwjcclc= 0.0,zrwjcclc= 0.0,lbss= 0.0,ssgl_lz= 0.0, | |
| 1874 | + ssgl_dm= 0.0,ssgl_gz= 0.0,ssgl_jf= 0.0,ssgl_zs= 0.0,ssgl_qr= 0.0,ssgl_qc= 0.0, | |
| 1875 | + ssgl_kx= 0.0,ssgl_qh= 0.0,ssgl_yw= 0.0,ssgl_other= 0.0,ljyy=0.0,ljjcc=0.0, | |
| 1876 | + kfks=0.0,yhl=0.0,jzl=0.0,hyl=0.0,dhl=0.0,cdl=0.0; | |
| 1877 | + | |
| 1878 | + for (int j = 0; j < listLc.size(); j++) { | |
| 1879 | + Map<String, Object> map=listLc.get(j); | |
| 1880 | + if(xl_bm.equals(map.get("line").toString()) | |
| 1881 | + && nbbm.equals(map.get("nbbm").toString()) | |
| 1882 | + && sGh.equals(map.get("sGh")==null?"":map.get("sGh").toString()) | |
| 1883 | + && jGh.equals(map.get("jGh").toString())){ | |
| 1884 | + jhzlc=Arith.add(jhzlc, map.get("jhzlc")); | |
| 1885 | + jhlc =Arith.add(jhlc, map.get("jhlc")); | |
| 1886 | + jcclc=Arith.add(jcclc, map.get("jcclc")); | |
| 1887 | + zlc=Arith.add(zlc, map.get("zlc")); | |
| 1888 | + jhnlc=Arith.add(jhnlc, map.get("jhnlc")); | |
| 1889 | + jhwlc=Arith.add(jhwlc, map.get("jhwlc")); | |
| 1890 | + jhnjcclc=Arith.add(jhnjcclc, map.get("jhnjcclc")); | |
| 1891 | + jhwjcclc=Arith.add(jhwjcclc, map.get("jhwjcclc")); | |
| 1892 | + zrwjcclc=Arith.add(zrwjcclc, map.get("zrwjcclc")); | |
| 1893 | + lbss=Arith.add(lbss, map.get("lbss")); | |
| 1894 | + ssgl_lz=Arith.add(ssgl_lz, map.get("ssgl_lz")); | |
| 1895 | + ssgl_dm=Arith.add(ssgl_dm, map.get("ssgl_dm")); | |
| 1896 | + ssgl_gz=Arith.add(ssgl_gz, map.get("ssgl_gz")); | |
| 1897 | + ssgl_jf=Arith.add(ssgl_jf, map.get("ssgl_jf")); | |
| 1898 | + ssgl_zs=Arith.add(ssgl_zs, map.get("ssgl_zs")); | |
| 1899 | + ssgl_qr=Arith.add(ssgl_qr, map.get("ssgl_qr")); | |
| 1900 | + ssgl_qc=Arith.add(ssgl_qc, map.get("ssgl_qc")); | |
| 1901 | + ssgl_kx=Arith.add(ssgl_kx, map.get("ssgl_kx")); | |
| 1902 | + ssgl_qh=Arith.add(ssgl_qh, map.get("ssgl_qh")); | |
| 1903 | + ssgl_yw=Arith.add(ssgl_yw, map.get("ssgl_yw")); | |
| 1904 | + ssgl_other=Arith.add(ssgl_other, map.get("ssgl_other")); | |
| 1905 | + kfks=Arith.add(kfks, map.get("kfks")); | |
| 1906 | + ljyy=Arith.add(ljyy, map.get("ljyy")); | |
| 1907 | + ljjcc=Arith.add(ljjcc, map.get("ljjcc")); | |
| 1908 | + yhl=Arith.add(yhl, map.get("yhl")); | |
| 1909 | + jzl=Arith.add(jzl, map.get("jzl")); | |
| 1910 | + hyl=Arith.add(hyl, map.get("hyl")); | |
| 1911 | + dhl=Arith.add(dhl, map.get("dhl")); | |
| 1912 | + cdl=Arith.add(cdl, map.get("cdl")); | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + } | |
| 1916 | + } | |
| 1917 | + | |
| 1918 | + Map<String, Object> newMap=new HashMap<String,Object>(); | |
| 1919 | + if(date.equals(date2)){ | |
| 1920 | + newMap.put("rq", date); | |
| 1921 | + }else{ | |
| 1922 | + newMap.put("rq", date+"至"+date2); | |
| 1923 | + } | |
| 1924 | + newMap.put("fgs", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | |
| 1925 | + newMap.put("xlName", BasicData.lineCode2NameMap.get(xl_bm)); | |
| 1926 | + newMap.put("jGh", jGh); | |
| 1927 | + newMap.put("jName", jGh); | |
| 1928 | + newMap.put("sGh",sGh); | |
| 1929 | + newMap.put("sName", sGh); | |
| 1930 | + newMap.put("nbbm", nbbm); | |
| 1931 | + newMap.put("jhzlc", jhzlc); | |
| 1932 | + newMap.put("jhlc", jhlc); | |
| 1933 | + newMap.put("jcclc", jcclc); | |
| 1934 | + newMap.put("zlc", zlc); | |
| 1935 | + newMap.put("jhnlc", jhnlc); | |
| 1936 | + newMap.put("jhwlc", jhwlc); | |
| 1937 | + newMap.put("jhnjcclc", jhnjcclc); | |
| 1938 | + newMap.put("jhwjcclc", jhwjcclc); | |
| 1939 | + newMap.put("zrwjcclc", zrwjcclc); | |
| 1940 | + newMap.put("lbss", lbss); | |
| 1941 | + newMap.put("ssgl_lz", ssgl_lz); | |
| 1942 | + newMap.put("ssgl_dm",ssgl_dm); | |
| 1943 | + newMap.put("ssgl_gz", ssgl_gz); | |
| 1944 | + newMap.put("ssgl_jf", ssgl_jf); | |
| 1945 | + newMap.put("ssgl_zs", ssgl_zs); | |
| 1946 | + newMap.put("ssgl_qr", ssgl_qr); | |
| 1947 | + newMap.put("ssgl_qc", ssgl_qc); | |
| 1948 | + newMap.put("ssgl_kx", ssgl_kx); | |
| 1949 | + newMap.put("ssgl_qh", ssgl_qh); | |
| 1950 | + newMap.put("ssgl_yw", ssgl_yw); | |
| 1951 | + newMap.put("ssgl_other", ssgl_other); | |
| 1952 | + newMap.put("kfks", kfks); | |
| 1953 | + newMap.put("ljyy", ljyy); | |
| 1954 | + newMap.put("ljjcc", ljjcc); | |
| 1955 | + newMap.put("yhl", yhl); | |
| 1956 | + newMap.put("jzl", jzl); | |
| 1957 | + newMap.put("hyl", hyl); | |
| 1958 | + newMap.put("dhl", dhl); | |
| 1959 | + newMap.put("cdl", cdl); | |
| 1960 | + lMap.add(newMap); | |
| 1961 | + } | |
| 1962 | + return lMap; | |
| 1963 | + } | |
| 1964 | + | |
| 1600 | 1965 | } | ... | ... |
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
| ... | ... | @@ -45,12 +45,13 @@ |
| 45 | 45 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 46 | 46 | <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> |
| 47 | 47 | </div> |
| 48 | - <div style="margin-top: 2px"></div> | |
| 49 | - <div style="display: inline-block;"> | |
| 48 | + <div style="display: inline-block;margin-left: 29px;"> | |
| 50 | 49 | <span class="item-label" style="width: 80px;">线路: </span> |
| 51 | 50 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 52 | 51 | </div> |
| 53 | - <div style="display: inline-block;margin-left: 15px;"> | |
| 52 | + <div style="margin-top: 2px"></div> | |
| 53 | + | |
| 54 | + <div style="display: inline-block;"> | |
| 54 | 55 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 55 | 56 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 56 | 57 | </div> |
| ... | ... | @@ -58,6 +59,13 @@ |
| 58 | 59 | <span class="item-label" style="width: 80px;">结束时间: </span> |
| 59 | 60 | <input class="form-control" type="text" id="date2" style="width: 180px;"/> |
| 60 | 61 | </div> |
| 62 | + <div style="display: inline-block;margin-left: 15px;"> | |
| 63 | + <span class="item-label" style="width: 80px;">显示分类: </span> | |
| 64 | + <select class="form-control" style="width: 120px;" id="zt"> | |
| 65 | + <option value="zbh">车辆</option> | |
| 66 | + <option value="js">驾/售</option> | |
| 67 | + </select> | |
| 68 | + </div> | |
| 61 | 69 | <div class="form-group"> |
| 62 | 70 | <input class="btn btn-default" type="button" id="query" value="查询"/> |
| 63 | 71 | <input class="btn btn-default" type="button" id="export" value="导出"/> |
| ... | ... | @@ -67,43 +75,8 @@ |
| 67 | 75 | <div class="portlet-body"> |
| 68 | 76 | <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px"> |
| 69 | 77 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 70 | - <thead> | |
| 71 | - <tr> | |
| 72 | - <th colspan="26">路单数据统计表</th> | |
| 73 | - </tr> | |
| 74 | - <tr> | |
| 75 | - <td>序号</td> | |
| 76 | - <td>日期</td> | |
| 77 | - <td>所属公司</td> | |
| 78 | - <td>线路</td> | |
| 79 | - <td>车号</td> | |
| 80 | - <td>司机职号</td> | |
| 81 | - <td>司机姓名</td> | |
| 82 | - <td>售票员职号</td> | |
| 83 | - <td>售票员姓名</td> | |
| 84 | - <td>行驶里程(包括空放)</td> | |
| 85 | - <td>计划内营运里程</td> | |
| 86 | - <td>临时性多样化调度营运里程</td> | |
| 87 | - <td>计划内进出场空驶里程</td> | |
| 88 | - <td>计划外进出场空驶里程</td> | |
| 89 | - <td>空放空驶</td> | |
| 90 | - <td>故障进出场空驶里程</td> | |
| 91 | - <td>肇事进出场空驶里程</td> | |
| 92 | - <td>纠纷进出场空驶里程</td> | |
| 93 | - <td>临加营运公里</td> | |
| 94 | - <td>临加进出场空驶</td> | |
| 95 | - <td>电耗量</td> | |
| 96 | - <td>加电量</td> | |
| 97 | - <td>耗油量</td> | |
| 98 | - <td>加注量</td> | |
| 99 | - <td>非营业用油</td> | |
| 100 | - <td>计划总公里</td> | |
| 101 | - </tr> | |
| 102 | - | |
| 103 | - </thead> | |
| 104 | - <tbody class="statisticsDaily"> | |
| 105 | - | |
| 106 | - </tbody> | |
| 78 | + | |
| 79 | + | |
| 107 | 80 | </table> |
| 108 | 81 | </div> |
| 109 | 82 | </div> |
| ... | ... | @@ -209,7 +182,10 @@ |
| 209 | 182 | var date2 =""; |
| 210 | 183 | var gsdm=""; |
| 211 | 184 | var fgsdm=""; |
| 185 | + var zt=""; | |
| 186 | + $("#countLine").height($(window).height()-280); | |
| 212 | 187 | $("#query").on("click",function(){ |
| 188 | + $("#countLine").height($(window).height()-280); | |
| 213 | 189 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 214 | 190 | layer.msg("请选择时间范围!"); |
| 215 | 191 | return; |
| ... | ... | @@ -224,6 +200,7 @@ |
| 224 | 200 | date2 =$("#date2").val(); |
| 225 | 201 | gsdm =$("#gsdm").val(); |
| 226 | 202 | fgsdm=$("#fgsdm").val(); |
| 203 | + zt=$("#zt").val(); | |
| 227 | 204 | if(line=="请选择"){ |
| 228 | 205 | line=""; |
| 229 | 206 | } |
| ... | ... | @@ -237,22 +214,25 @@ |
| 237 | 214 | params['date'] = date; |
| 238 | 215 | params['date2'] = date2; |
| 239 | 216 | params['xlName'] = xlName; |
| 217 | + params['zt']=zt; | |
| 240 | 218 | params['type'] = "query"; |
| 241 | - $get('/report/countLineMileage',params,function(result){ | |
| 219 | + var tbodyHtml = template('countBusDaily',{list:""}); | |
| 220 | + $get('/report/countBusMileage',params,function(result){ | |
| 221 | + console.log(result); | |
| 242 | 222 | // 把数据填充到模版中 |
| 243 | - var tbodyHtml = template('statisticsDaily',{list:result}); | |
| 223 | + var tbodyHtml = template('countBusDaily',{list:result,zt:zt}); | |
| 244 | 224 | // 把渲染好的模版html文本追加到表格中 |
| 245 | - $('#forms .statisticsDaily').html(tbodyHtml); | |
| 225 | + $('#forms').html(tbodyHtml); | |
| 246 | 226 | |
| 247 | 227 | if(result.length == 0) |
| 248 | 228 | $("#export").attr('disabled',"true"); |
| 249 | 229 | else |
| 250 | 230 | $("#export").removeAttr("disabled"); |
| 251 | - }); | |
| 231 | + }); | |
| 252 | 232 | } |
| 253 | 233 | |
| 254 | 234 | }); |
| 255 | - $("#countLine").height($(window).height()-280); | |
| 235 | + | |
| 256 | 236 | $("#export").on("click",function(){ |
| 257 | 237 | var params = {}; |
| 258 | 238 | params['gsdm'] = gsdm; |
| ... | ... | @@ -269,55 +249,79 @@ |
| 269 | 249 | |
| 270 | 250 | }); |
| 271 | 251 | </script> |
| 272 | -<script type="text/html" id="statisticsDaily"> | |
| 252 | +<script type="text/html" id="countBusDaily"> | |
| 253 | + <thead> | |
| 254 | + <tr> | |
| 255 | + <th colspan="26">路单数据统计表</th> | |
| 256 | + </tr> | |
| 257 | + <tr> | |
| 258 | + <td>序号</td> | |
| 259 | + <td>日期</td> | |
| 260 | + <td>所属公司</td> | |
| 261 | + <td>线路</td> | |
| 262 | + <td>车号</td> | |
| 263 | + {{if zt=='js'}} | |
| 264 | + <td>司机职号</td> | |
| 265 | + <td>司机姓名</td> | |
| 266 | + <td>售票员职号</td> | |
| 267 | + <td>售票员姓名</td> | |
| 268 | + {{/if}} | |
| 269 | + <td>行驶里程(包括空放)</td> | |
| 270 | + <td>计划内营运里程</td> | |
| 271 | + <td><label>临时性</label><label>多样化</label><label>调度营</label><label>运里程</label></td> | |
| 272 | + <td><label>计划内</label><label>进出场</label><label>空驶</label></td> | |
| 273 | + <td><label>计划外</label><label>进出场</label><label>空驶</label></td> | |
| 274 | + <td>空放空驶</td> | |
| 275 | + <td><label>故障</label><label>进出场</label><label>空驶</label></td> | |
| 276 | + <td><label>肇事</label><label>进出场</label><label>空驶</label></td> | |
| 277 | + <td><label>纠纷</label><label>进出场</label><label>空驶</label></td> | |
| 278 | + <td>临加营运公里</td> | |
| 279 | + <td>临加进出场空驶</td> | |
| 280 | + <td>电耗量</td> | |
| 281 | + <td>加电量</td> | |
| 282 | + <td>耗油量</td> | |
| 283 | + <td>加注量</td> | |
| 284 | + <td>非营业用油</td> | |
| 285 | + <td>计划总公里</td> | |
| 286 | + </tr> | |
| 287 | + </thead> | |
| 288 | + <tbody > | |
| 273 | 289 | {{each list as obj i}} |
| 274 | 290 | <tr> |
| 291 | + <td>{{i+1}}</td> | |
| 292 | + <td>{{obj.rq}}</td> | |
| 293 | + <td>{{obj.fgs}}</td> | |
| 275 | 294 | <td>{{obj.xlName}}</td> |
| 276 | - <td>{{obj.jhzlc}}</td> | |
| 277 | - <td>{{obj.jhlc}}</td> | |
| 278 | - <td>{{obj.jcclc}}</td> | |
| 279 | - <td>{{obj.sjzgl}}</td> | |
| 280 | - <td>{{obj.sjgl}}</td> | |
| 281 | - <td>{{obj.sjksgl}}</td> | |
| 282 | - <td>{{obj.ssgl}}</td> | |
| 283 | - <td>{{obj.ssbc}}</td> | |
| 284 | - <td>{{obj.ssgl_lz}}</td> | |
| 285 | - <td>{{obj.ssgl_dm}}</td> | |
| 286 | - <td>{{obj.ssgl_gz}}</td> | |
| 287 | - <td>{{obj.ssgl_jf}}</td> | |
| 288 | - <td>{{obj.ssgl_zs}}</td> | |
| 289 | - <td>{{obj.ssgl_qr}}</td> | |
| 290 | - <td>{{obj.ssgl_qc}}</td> | |
| 291 | - <td>{{obj.ssgl_kx}}</td> | |
| 292 | - <td>{{obj.ssgl_qh}}</td> | |
| 293 | - <td>{{obj.ssgl_yw}}</td> | |
| 294 | - <td>{{obj.ssgl_other}}</td> | |
| 295 | - <td>{{obj.ljgl}}</td> | |
| 296 | - <td>{{obj.jhbc}}</td> | |
| 297 | - <td>{{obj.jhbc_m}}</td> | |
| 298 | - <td>{{obj.jhbc_a}}</td> | |
| 299 | - <td>{{obj.sjbc}}</td> | |
| 300 | - <td>{{obj.sjbc_m}}</td> | |
| 301 | - <td>{{obj.sjbc_a}}</td> | |
| 302 | - <td>{{obj.ljbc}}</td> | |
| 303 | - <td>{{obj.ljbc_m}}</td> | |
| 304 | - <td>{{obj.ljbc_a}}</td> | |
| 305 | - <td>{{obj.fzbc}}</td> | |
| 306 | - <td>{{obj.fzbc_m}}</td> | |
| 307 | - <td>{{obj.fzbc_a}}</td> | |
| 308 | - <td>{{obj.dtbc}}</td> | |
| 309 | - <td>{{obj.dtbc_m}}</td> | |
| 310 | - <td>{{obj.dtbc_a}}</td> | |
| 311 | - <td>{{obj.djg}}</td> | |
| 312 | - <td>{{obj.djg_m}}</td> | |
| 313 | - <td>{{obj.djg_a}}</td> | |
| 314 | - <td>{{obj.djg_time}}</td> | |
| 315 | - <td> </td> | |
| 295 | + <td>{{obj.nbbm}}</td> | |
| 296 | + {{if zt=='js'}} | |
| 297 | + <td>{{obj.jGh}}</td> | |
| 298 | + <td>{{obj.jName}}</td> | |
| 299 | + <td>{{obj.sGh}}</td> | |
| 300 | + <td>{{obj.sName}}</td> | |
| 301 | + {{/if}} | |
| 302 | + <td>{{obj.zlc}}</td> | |
| 303 | + <td>{{obj.jhnlc}}</td> | |
| 304 | + <td>{{obj.jhwlc}}</td> | |
| 305 | + <td>{{obj.jhnjcclc}}</td> | |
| 306 | + <td>{{obj.jhwjcclc}}</td> | |
| 307 | + <td>{{obj.kfks}}</td> | |
| 308 | + <td>{{obj.zrwjcclc}}</td> | |
| 309 | + <td>0</td> | |
| 310 | + <td>0</td> | |
| 311 | + <td>{{obj.ljyy}}</td> | |
| 312 | + <td>{{obj.ljjcc}}</td> | |
| 313 | + <td>{{obj.yhl}}</td> | |
| 314 | + <td>{{obj.jzl}}</td> | |
| 315 | + <td>{{obj.hyl}}</td> | |
| 316 | + <td>{{obj.dhl}}</td> | |
| 317 | + <td>{{obj.cdl}}</td> | |
| 318 | + <td>{{obj.jhzlc}}</td> | |
| 316 | 319 | </tr> |
| 317 | 320 | {{/each}} |
| 318 | 321 | {{if list.length == 0}} |
| 319 | 322 | <tr> |
| 320 | - <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td> | |
| 323 | + <td colspan="26"><h6 class="muted">没有找到相关数据</h6></td> | |
| 321 | 324 | </tr> |
| 322 | 325 | {{/if}} |
| 326 | +</tbody> | |
| 323 | 327 | </script> |
| 324 | 328 | \ No newline at end of file | ... | ... |