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