Commit 17469ee9dfc4ed40a5db42254b73598a5de87d23
Merge branch 'pudong' of http://222.66.0.204:8090/panzhaov5/bsth_control into pudong
Showing
9 changed files
with
69 additions
and
16 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| ... | ... | @@ -53,6 +53,7 @@ public class ReportController { |
| 53 | 53 | Map<String, Object> m = new HashMap<String, Object>(); |
| 54 | 54 | m.put("i", i); |
| 55 | 55 | m.put("nbbm", a.getNbbm()); |
| 56 | + m.put("pzh", a.getPzh()); | |
| 56 | 57 | m.put("stopName", a.getStopName()); |
| 57 | 58 | m.put("jzsj", a.getJzsj()); |
| 58 | 59 | m.put("czsj", a.getCzsj()); |
| ... | ... | @@ -118,8 +119,7 @@ public class ReportController { |
| 118 | 119 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ |
| 119 | 120 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 120 | 121 | ReportUtils ee = new ReportUtils(); |
| 121 | -// List<ArrivalInfo> list=service.queryListClzd(line,zd,zdlx,fcsj,ddsj); | |
| 122 | - List<ArrivalInfo> list = new ArrayList<ArrivalInfo>(); | |
| 122 | + List<ArrivalInfo> list=service.queryListClzd(line,zd,zdlx,fcsj,ddsj); | |
| 123 | 123 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 124 | 124 | int i=1; |
| 125 | 125 | for (ArrivalInfo a:list ) { | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -2226,10 +2226,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2226 | 2226 | tempList.add(tempMap); |
| 2227 | 2227 | } |
| 2228 | 2228 | try { |
| 2229 | + String dateTime = sdfSimple.format(sdfMonth.parse(date)); | |
| 2230 | + String lineName = BasicData.lineCode2NameMap.get(line); | |
| 2229 | 2231 | listI.add(tempList.iterator()); |
| 2230 | 2232 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 2231 | 2233 | ee.excelReplace(listI, new Object[]{m}, path + "mould/correctForm.xls", |
| 2232 | - path + "export/修正报表" + date+ ".xls"); | |
| 2234 | + path + "export/" + dateTime + "-" + lineName + "-修正报表.xls"); | |
| 2233 | 2235 | } catch (Exception e) { |
| 2234 | 2236 | // TODO: handle exception |
| 2235 | 2237 | e.printStackTrace(); |
| ... | ... | @@ -2844,11 +2846,29 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 2844 | 2846 | map.put("dtbc_m", 0); |
| 2845 | 2847 | map.put("dtbc_a", 0); |
| 2846 | 2848 | if(list.size()>0){ |
| 2847 | - Map<String, Object> m_=culateService.culateDjg(list_s, list.get(0).getXlBm()); | |
| 2848 | - map.put("djg", m_.get("djgcsq")); | |
| 2849 | - map.put("djg_m", m_.get("djgcsz")); | |
| 2850 | - map.put("djg_a", m_.get("djgcsw")); | |
| 2851 | - map.put("djg_time", m_.get("djgsj")); | |
| 2849 | + int djg = 0, djg_m = 0, djg_a = 0, djg_time = 0; | |
| 2850 | + for(Map<String, Object> m : lMap){ | |
| 2851 | + if(m.containsKey("djg") && m.get("djg") != null) | |
| 2852 | + djg += Integer.valueOf(m.get("djg").toString()); | |
| 2853 | + if(m.containsKey("djg_m") && m.get("djg_m") != null) | |
| 2854 | + djg_m += Integer.valueOf(m.get("djg_m").toString()); | |
| 2855 | + if(m.containsKey("djg_a") && m.get("djg_a") != null) | |
| 2856 | + djg_a += Integer.valueOf(m.get("djg_a").toString()); | |
| 2857 | + if(m.containsKey("djg_time") && m.get("djg_time") != null){ | |
| 2858 | + int t = Integer.valueOf(m.get("djg_time").toString()); | |
| 2859 | + if(t > djg_time) | |
| 2860 | + djg_time = t; | |
| 2861 | + } | |
| 2862 | + } | |
| 2863 | + map.put("djg", djg); | |
| 2864 | + map.put("djg_m", djg_m); | |
| 2865 | + map.put("djg_a", djg_a); | |
| 2866 | + map.put("djg_time", djg_time); | |
| 2867 | +// Map<String, Object> m_=culateService.culateDjg(list_s, list.get(0).getXlBm()); | |
| 2868 | +// map.put("djg", m_.get("djgcsq")); | |
| 2869 | +// map.put("djg_m", m_.get("djgcsz")); | |
| 2870 | +// map.put("djg_a", m_.get("djgcsw")); | |
| 2871 | +// map.put("djg_time", m_.get("djgsj")); | |
| 2852 | 2872 | }else{ |
| 2853 | 2873 | map.put("djg", "0"); |
| 2854 | 2874 | map.put("djg_m", "0"); | ... | ... |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| ... | ... | @@ -229,7 +229,7 @@ public class ReportServiceImpl implements ReportService{ |
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx,String fcsj){ |
| 232 | - List<ArrivalInfo> list = null; | |
| 232 | + List<ArrivalInfo> list = new ArrayList<ArrivalInfo>(); | |
| 233 | 233 | Calendar cal = Calendar.getInstance(); |
| 234 | 234 | cal.setTime(dates1); |
| 235 | 235 | //周数,表分区字段 | ... | ... |
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
| ... | ... | @@ -614,16 +614,26 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | if(map.containsKey("type") && map.get("type").toString().equals("export")){ |
| 617 | + String lineName = ""; | |
| 618 | + if(map.containsKey("lineName")) | |
| 619 | + lineName = map.get("lineName").toString(); | |
| 617 | 620 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 618 | 621 | Map<String, Object> m = new HashMap<String, Object>(); |
| 619 | 622 | m.put("date", date); |
| 620 | 623 | m.put("endDate", endDate); |
| 621 | 624 | ReportUtils ee = new ReportUtils(); |
| 622 | 625 | try { |
| 626 | + String dateTime = ""; | |
| 627 | + if(date.equals(endDate)){ | |
| 628 | + dateTime = date.replaceAll("-", ""); | |
| 629 | + } else { | |
| 630 | + dateTime = date.replaceAll("-", "")+"-"+ | |
| 631 | + endDate.replaceAll("-", ""); | |
| 632 | + } | |
| 623 | 633 | listI.add(listmap.iterator()); |
| 624 | 634 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 625 | 635 | ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "sheetList.xls", |
| 626 | - path + "export/发车准点率"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls"); | |
| 636 | + path + "export/"+dateTime+"-"+lineName+"-发车准点率.xls"); | |
| 627 | 637 | } catch (Exception e) { |
| 628 | 638 | // TODO: handle exception |
| 629 | 639 | e.printStackTrace(); | ... | ... |
src/main/resources/static/pages/forms/statement/correctForm.html
| ... | ... | @@ -233,6 +233,7 @@ |
| 233 | 233 | var endDate = $("#endDate").val(); |
| 234 | 234 | var code = $("#code").val(); |
| 235 | 235 | var changType=$("#changType").val(); |
| 236 | + var lineName = $('#line option:selected').text(); | |
| 236 | 237 | $("#query").on("click",function(){ |
| 237 | 238 | line = $("#line").val(); |
| 238 | 239 | date = $("#date").val(); |
| ... | ... | @@ -240,6 +241,9 @@ |
| 240 | 241 | code = $("#code").val(); |
| 241 | 242 | endDate = $("#endDate").val(); |
| 242 | 243 | changType=$("#changType").val(); |
| 244 | + lineName = $('#line option:selected').text(); | |
| 245 | + if(lineName == "全部线路") | |
| 246 | + lineName = $('#subCompany option:selected').text(); | |
| 243 | 247 | var type = "query"; |
| 244 | 248 | $get("/realSchedule/correctForm",{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ |
| 245 | 249 | var list_correctForm = template('list_correctForm',{list:result}); |
| ... | ... | @@ -260,7 +264,15 @@ |
| 260 | 264 | $("#export").on("click",function(){ |
| 261 | 265 | var type = "export"; |
| 262 | 266 | $get('/realSchedule/correctForm',{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ |
| 263 | - window.open("/downloadFile/download?fileName=修正报表"+date); | |
| 267 | + var dateTime = ""; | |
| 268 | + if(date == endDate){ | |
| 269 | + dateTime = moment(date).format("YYYYMMDD"); | |
| 270 | + } else { | |
| 271 | + dateTime = moment(date).format("YYYYMMDD")+"-"+ | |
| 272 | + moment(endDate).format("YYYYMMDD"); | |
| 273 | + } | |
| 274 | + window.open("/downloadFile/download?fileName=" | |
| 275 | + +dateTime+"-"+lineName+"-修正报表"); | |
| 264 | 276 | }); |
| 265 | 277 | }); |
| 266 | 278 | ... | ... |
src/main/resources/static/pages/forms/statement/statisticsDailyCalc.html
| ... | ... | @@ -150,7 +150,7 @@ |
| 150 | 150 | $('.menu-toggler.sidebar-toggler').click(); |
| 151 | 151 | |
| 152 | 152 | var d = new Date(); |
| 153 | - d.setTime(d.getTime() - 1*1000*60*60*24); | |
| 153 | + d.setTime(d.getTime() - 4*1000*60*60*24); | |
| 154 | 154 | var year = d.getFullYear(); |
| 155 | 155 | var month = d.getMonth() + 1; |
| 156 | 156 | var day = d.getDate(); | ... | ... |
src/main/resources/static/pages/forms/statement/statisticsDailyCalc2.html
| ... | ... | @@ -150,7 +150,7 @@ |
| 150 | 150 | $('.menu-toggler.sidebar-toggler').click(); |
| 151 | 151 | |
| 152 | 152 | var d = new Date(); |
| 153 | - d.setTime(d.getTime() - 1*1000*60*60*24); | |
| 153 | + d.setTime(d.getTime() - 4*1000*60*60*24); | |
| 154 | 154 | var year = d.getFullYear(); |
| 155 | 155 | var month = d.getMonth() + 1; |
| 156 | 156 | var day = d.getDate(); | ... | ... |
src/main/resources/static/pages/report/inoutstation.html
| ... | ... | @@ -485,7 +485,7 @@ |
| 485 | 485 | }else{ |
| 486 | 486 | $get('/report/exportQueryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){ |
| 487 | 487 | window.open("/downloadFile/download?fileName=" |
| 488 | - +moment(date).format("YYYYMMDD") | |
| 488 | + +moment(rq).format("YYYYMMDD") | |
| 489 | 489 | +"-"+pzh+"-班次到离站"); |
| 490 | 490 | }); |
| 491 | 491 | } | ... | ... |
src/main/resources/static/pages/report/sheet/sheetList.html
| ... | ... | @@ -312,9 +312,20 @@ |
| 312 | 312 | var endDate = $("#endDate").val(); |
| 313 | 313 | var fgs=$('#fgsdm').val(); |
| 314 | 314 | var gs=$('#gsdm').val(); |
| 315 | + var lineName = $('#line option:selected').text(); | |
| 316 | + if(lineName == "全部线路") | |
| 317 | + lineName = $('#fgsdm option:selected').text(); | |
| 315 | 318 | var i = layer.load(2); |
| 316 | - $get('/sheet/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,type:"export"},function(result){ | |
| 317 | - window.open("/downloadFile/download?fileName=发车准点率"+moment(date).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD")); | |
| 319 | + $get('/sheet/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,type:"export",lineName:lineName},function(result){ | |
| 320 | + var dateTime = ""; | |
| 321 | + if(date == endDate){ | |
| 322 | + dateTime = moment(date).format("YYYYMMDD"); | |
| 323 | + } else { | |
| 324 | + dateTime = moment(date).format("YYYYMMDD")+"-"+ | |
| 325 | + moment(endDate).format("YYYYMMDD"); | |
| 326 | + } | |
| 327 | + window.open("/downloadFile/download?fileName=" | |
| 328 | + +dateTime+"-"+lineName+"-发车准点率"); | |
| 318 | 329 | layer.close(i); |
| 319 | 330 | }); |
| 320 | 331 | // $("#forms_h").table2excel({ | ... | ... |