Commit 95ca65ab0da01a1750a202fad47dec06461a7fc8

Authored by 徐烜
2 parents 9927000b 0623d4ae

Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang

src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
... ... @@ -114,10 +114,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl<D60, Integer> implemen
114 114 + sch.getQdzName() + "发往" + sch.getZdzName();
115 115  
116 116 //下发0x01指令 调度指令(闹钟有效)
117   - long t = System.currentTimeMillis(), alarmTime;
118   - alarmTime = sch.getDfsjT();
119   - if (sch.getDfsjT() < t)
120   - alarmTime = t + 1000 * 30;
  117 + long t = System.currentTimeMillis() + 1000 * 30,
  118 + alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT();
121 119  
122 120 d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir())
123 121 , 0, new Date(alarmTime));
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -15,6 +15,7 @@ import com.bsth.service.report.CulateMileageService;
15 15 import com.bsth.service.report.ReportService;
16 16 import com.bsth.util.Arith;
17 17 import com.bsth.util.ComparableJob;
  18 +import com.bsth.util.ReportUtils;
18 19 import com.bsth.util.db.DBUtils_MS;
19 20 import org.apache.commons.lang.StringUtils;
20 21 import org.slf4j.Logger;
... ... @@ -1446,7 +1447,6 @@ public class ReportServiceImpl implements ReportService{
1446 1447 }
1447 1448 //所有班次信息
1448 1449 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
1449   -
1450 1450 line =line.trim();
1451 1451 if(line.equals("")){
1452 1452 //查询所有线路
... ... @@ -1456,7 +1456,6 @@ public class ReportServiceImpl implements ReportService{
1456 1456 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
1457 1457 }
1458 1458  
1459   -
1460 1459 String sql="select r.xl_bm"
1461 1460 + " from bsth_c_s_sp_info_real r where"
1462 1461 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
... ... @@ -1477,7 +1476,6 @@ public class ReportServiceImpl implements ReportService{
1477 1476 return ve;
1478 1477 }
1479 1478 });
1480   -
1481 1479 for (int i = 0; i < listLine.size(); i++) {
1482 1480 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1483 1481 String lineStr=listLine.get(i);
... ... @@ -1498,6 +1496,22 @@ public class ReportServiceImpl implements ReportService{
1498 1496 Map<String, Object> newMap=staticTj(list,"f");
1499 1497 lMap.add(newMap);
1500 1498 }
  1499 + if(type.equals("export")){
  1500 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1501 + Map<String, Object> m = new HashMap<String, Object>();
  1502 + m.put("date", date);
  1503 + m.put("date1", date2);
  1504 + ReportUtils ee = new ReportUtils();
  1505 + try {
  1506 + listI.add(lMap.iterator());
  1507 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1508 + ee.excelReplace(listI, new Object[]{m}, path + "mould/countByLine.xls",
  1509 + path + "export/线路公里统计表.xls");
  1510 + } catch (Exception e) {
  1511 + // TODO: handle exception
  1512 + e.printStackTrace();
  1513 + }
  1514 + }
1501 1515 return lMap;
1502 1516 }
1503 1517  
... ... @@ -1520,6 +1534,8 @@ public class ReportServiceImpl implements ReportService{
1520 1534 if(list.size()>0){
1521 1535 if(status.equals("f")){
1522 1536 map.put("xlName","合计");
  1537 + map.put("gs", "");
  1538 + map.put("fgs", "");
1523 1539 }else{
1524 1540 map.put("xlName", list.get(0).getXlName());
1525 1541 map.put("gs", list.get(0).getGsName());
... ... @@ -1578,6 +1594,8 @@ public class ReportServiceImpl implements ReportService{
1578 1594 double zrwjcclc=culateService.culateZrwJccLc(list, "");
1579 1595  
1580 1596 map.put("zrwjcclc", zrwjcclc);
  1597 + map.put("zrwjcclc1", 0);
  1598 + map.put("zrwjcclc2", 0);
1581 1599  
1582 1600 double kfks=culateService.culateKfksLc(lists);
1583 1601 map.put("kfks", kfks);
... ... @@ -1646,7 +1664,6 @@ public class ReportServiceImpl implements ReportService{
1646 1664 ylbSql += " and xlbm = '"+line+"'";
1647 1665 }
1648 1666 List<Ylb> ylbList=ylbList(ylbSql);
1649   -
1650 1667 String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'";
1651 1668 if(line.equals("")){
1652 1669 dlbSql +="and ssgsdm='"+gsdm+"' "
... ... @@ -1655,7 +1672,6 @@ public class ReportServiceImpl implements ReportService{
1655 1672 dlbSql += " and xlbm = '"+line+"'";
1656 1673 }
1657 1674 List<Dlb> dlbList=dlbList(dlbSql);
1658   -
1659 1675 String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh"
1660 1676 + " from bsth_c_s_sp_info_real r where"
1661 1677 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
... ... @@ -1679,7 +1695,6 @@ public class ReportServiceImpl implements ReportService{
1679 1695 return map;
1680 1696 }
1681 1697 });
1682   -
1683 1698 for (int i = 0; i < listGroupBy.size(); i++) {
1684 1699 Map<String, Object> m=listGroupBy.get(i);
1685 1700 String xl_bm=m.get("line")==null?"":m.get("line").toString();
... ... @@ -1782,7 +1797,6 @@ public class ReportServiceImpl implements ReportService{
1782 1797 }
1783 1798  
1784 1799 }
1785   -
1786 1800 if(!zt.equals("zbh")){
1787 1801 String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"
1788 1802 + " from bsth_c_s_sp_info_real r where"
... ... @@ -1809,6 +1823,28 @@ public class ReportServiceImpl implements ReportService{
1809 1823 lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2);
1810 1824  
1811 1825 }
  1826 + if(type.equals("export")){
  1827 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1828 + Map<String, Object> m = new HashMap<String, Object>();
  1829 + m.put("date", date);
  1830 + m.put("date1", date2);
  1831 + String xls="";
  1832 + if(zt.equals("zbh")){
  1833 + xls="countByBus1.xls";
  1834 + }else{
  1835 + xls="countByBus2.xls";
  1836 + }
  1837 + ReportUtils ee = new ReportUtils();
  1838 + try {
  1839 + listI.add(lMap.iterator());
  1840 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1841 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  1842 + path + "export/路单数据统计表.xls");
  1843 + } catch (Exception e) {
  1844 + // TODO: handle exception
  1845 + e.printStackTrace();
  1846 + }
  1847 + }
1812 1848  
1813 1849 return lMap;
1814 1850 }
... ... @@ -1818,6 +1854,7 @@ public class ReportServiceImpl implements ReportService{
1818 1854 @Override
1819 1855 public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
1820 1856 Ylb y = new Ylb();
  1857 + y.setRq(arg0.getDate("rq"));
1821 1858 y.setXlbm(arg0.getString("xlbm"));
1822 1859 y.setNbbm(arg0.getString("nbbm"));
1823 1860 y.setJzl(arg0.getDouble("jzl"));
... ... @@ -1834,6 +1871,7 @@ public class ReportServiceImpl implements ReportService{
1834 1871 @Override
1835 1872 public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException {
1836 1873 Dlb y = new Dlb();
  1874 + y.setRq(arg0.getDate("rq"));
1837 1875 y.setXlbm(arg0.getString("xlbm"));
1838 1876 y.setNbbm(arg0.getString("nbbm"));
1839 1877 y.setCdl(arg0.getDouble("cdl"));
... ...
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
... ... @@ -37,7 +37,7 @@
37 37 <div class="portlet light porttlet-fit bordered">
38 38 <div class="portlet-title">
39 39 <form class="form-inline" action="">
40   - <div style="display: inline-block; " id="gsdmDiv">
  40 + <div style="display: inline-block;margin-left: 28px; " id="gsdmDiv">
41 41 <span class="item-label" style="width: 80px;">公司: </span>
42 42 <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
43 43 </div>
... ... @@ -45,7 +45,7 @@
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="display: inline-block;margin-left: 29px;">
  48 + <div style="display: inline-block;margin-left: 43px;">
49 49 <span class="item-label" style="width: 80px;">线路: </span>
50 50 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
51 51 </div>
... ... @@ -66,7 +66,7 @@
66 66 <option value="js">驾/售</option>
67 67 </select>
68 68 </div>
69   - <div class="form-group">
  69 + <div class="form-group" style="margin-left: 55px;">
70 70 <input class="btn btn-default" type="button" id="query" value="查询"/>
71 71 <input class="btn btn-default" type="button" id="export" value="导出"/>
72 72 </div>
... ... @@ -241,9 +241,10 @@
241 241 params['date'] = date;
242 242 params['date2'] = date2;
243 243 params['xlName'] = xlName;
  244 + params['zt']=zt;
244 245 params['type'] = "export";
245   - $get('/realSchedule/statisticsDailyTj',params,function(result){
246   - window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD"));
  246 + $get('/report/countBusMileage',params,function(result){
  247 + window.open("/downloadFile/download?fileName=路单数据统计表");
247 248 });
248 249 });
249 250  
... ...
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
... ... @@ -272,7 +272,7 @@
272 272 params['date2'] = date2;
273 273 params['xlName'] = xlName;
274 274 params['type'] = "export";
275   - $get('/realSchedule/countLineMileage',params,function(result){
  275 + $get('/report/countLineMileage',params,function(result){
276 276 window.open("/downloadFile/download?fileName=线路公里统计表");
277 277 });
278 278 });
... ...