Commit 88b0a6a6fdba5e49526a24c10ba343ca7adb69f2

Authored by 廖磊
1 parent c22797cf

工作汇总

src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -51,6 +51,7 @@ public class ReportController {
51 51 m.put("jzsj", a.getJzsj());
52 52 m.put("czsj", a.getCzsj());
53 53 m.put("upDown", a.getUpDown()==0?"上行":"下行");
  54 + resList.add(m);
54 55 i++;
55 56 }
56 57  
... ... @@ -66,41 +67,61 @@ public class ReportController {
66 67 return resList;
67 68 }
68 69  
  70 +
69 71 @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET)
70 72 public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line,
71 73 @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){
72 74 return service.queryListClzd(line,zd,zdlx,fcsj,ddsj);
73 75 }
74 76  
75   - @RequestMapping(value="/exportQueryListClzd" ,method = RequestMethod.GET)
76   - public List<Map<String, Object>> exportQueryListClzd(@RequestParam String zd,@RequestParam String line,
77   - @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){
  77 +
  78 +
  79 +
  80 + @RequestMapping(value="/jobSummaryExport" ,method = RequestMethod.GET)
  81 + public List<Map<String, Object>> jobSummaryExport(@RequestParam Map<String, Object> map){
78 82 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  83 + String lineName=map.get("lineName").toString();
  84 + String date=map.get("date").toString();
79 85 ReportUtils ee = new ReportUtils();
80   - List<ArrivalInfo> list=service.queryListClzd(line, zd, zdlx, fcsj, ddsj);
81   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
82   - int i=1;
83   - for (ArrivalInfo a:list ) {
84   - Map<String, Object> m = new HashMap<String, Object>();
85   - m.put("i", i);
86   - m.put("nbbm", a.getNbbm());
87   - m.put("stopName", a.getStopName());
88   - m.put("jzsj", a.getJzsj());
89   - m.put("czsj", a.getCzsj());
90   - m.put("upDown", a.getUpDown()==0?"上行":"下行");
91   - i++;
  86 + List<Map<String,Object>> fwqlList= service.jobFwqk(map);
  87 + List<Map<String, Object>> lgqlList=service.jobLjqk(map);
  88 + map=service.jobHzxx(map);
  89 + map.put("lineName", lineName);
  90 + map.put("date",date);
  91 + if(fwqlList.size()<=0){
  92 + Map<String, Object> newMap=new HashMap<String,Object>();
  93 + newMap.put("nr", " ");
  94 + newMap.put("lp", " ");
  95 + newMap.put("nbbm", " ");
  96 + newMap.put("jgh", " ");
  97 + newMap.put("dz", " ");
  98 + newMap.put("sj", " ");
  99 + newMap.put("lbbc", " ");
  100 + newMap.put("lblc", " ");
  101 + newMap.put("jyqp", " ");
  102 + fwqlList.add(newMap);
  103 + }
  104 + if(lgqlList.size()<=0){
  105 + Map<String, Object> newMap=new HashMap<String,Object>();
  106 + newMap.put("lp", " ");
  107 + newMap.put("nbbm", " ");
  108 + newMap.put("jgh", " ");
  109 + newMap.put("dz", " ");
  110 + newMap.put("sj", " ");
  111 + newMap.put("ljlc"," ");
  112 + newMap.put("jyqp", " ");
  113 + lgqlList.add(newMap);
92 114 }
93   -
94 115 try {
95   - Map<String, Object> map=new HashMap<String, Object>();
96   - listI.add(resList.iterator());
  116 + listI.add(fwqlList.iterator());
  117 + listI.add(lgqlList.iterator());
97 118 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
98   - ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls",
99   - path + "export/班次到离站.xls");
  119 + ee.excelReplace(listI, new Object[] { map }, path + "mould/jobSummary.xls",
  120 + path + "export/调度员工作汇总日报.xls");
100 121 } catch (Exception e) {
101 122 e.printStackTrace();
102 123 }
103   - return resList;
  124 + return new ArrayList<Map<String, Object>>();
104 125 }
105 126 @RequestMapping(value = "/sreachZd", method = RequestMethod.GET)
106 127 public List<Map<String, String>> sreachPersonnel(@RequestParam String line,@RequestParam int zdlx,@RequestParam String zd) {
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -1181,6 +1181,7 @@ public class ReportServiceImpl implements ReportService{
1181 1181 newMap.put("dz", scheduleRealInfo.getQdzName());
1182 1182 newMap.put("sj", scheduleRealInfo.getFcsj());
1183 1183 newMap.put("lbbc", 1);
  1184 + newMap.put("gzf", " ");
1184 1185 newMap.put("lblc", scheduleRealInfo.getJhlcOrig());
1185 1186 newMap.put("jyqp", scheduleRealInfo.getRemarks());
1186 1187 list.add(newMap);
... ... @@ -1206,6 +1207,7 @@ public class ReportServiceImpl implements ReportService{
1206 1207 newMap.put("jgh", scheduleRealInfo.getjGh());
1207 1208 newMap.put("dz", childTaskPlan.getStartStationName());
1208 1209 newMap.put("sj", childTaskPlan.getStartDate());
  1210 + newMap.put("gzf", " ");
1209 1211 newMap.put("lbbc", 0);
1210 1212 newMap.put("lblc", childTaskPlan.getMileage());
1211 1213 newMap.put("jyqp", childTaskPlan.getRemarks());
... ... @@ -1237,8 +1239,12 @@ public class ReportServiceImpl implements ReportService{
1237 1239 newMap.put("lp", "小计");
1238 1240 newMap.put("nbbm", "少驶班次");
1239 1241 newMap.put("jgh", lbbc);
1240   - newMap.put("sj", "少驶公里");
  1242 + newMap.put("lbbc", "少驶公里");
1241 1243 newMap.put("lblc", lblc);
  1244 + newMap.put("dz", " ");
  1245 + newMap.put("sj", " ");
  1246 + newMap.put("gzf", " ");
  1247 + newMap.put("jyqp"," ");
1242 1248 listNew.add(newMap);
1243 1249 }
1244 1250  
... ... @@ -1271,7 +1277,7 @@ public class ReportServiceImpl implements ReportService{
1271 1277 newMap.put("dz", scheduleRealInfo.getQdzName());
1272 1278 newMap.put("sj", scheduleRealInfo.getFcsj());
1273 1279 newMap.put("ljlc", scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
1274   - newMap.put("jyqp", scheduleRealInfo.getRealMileage());
  1280 + newMap.put("jyqp", scheduleRealInfo.getRealMileage()==null?"":scheduleRealInfo.getRealMileage());
1275 1281 list.add(newMap);
1276 1282 }
1277 1283 // }else{
... ...
src/main/resources/static/pages/forms/mould/jobSummary.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/jobSummary.html
... ... @@ -46,7 +46,7 @@
46 46 </div>
47 47 <div class="form-group">
48 48 <input class="btn btn-default" type="button" id="query" value="查询"/>
49   -<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
  49 + <input class="btn btn-default" type="button" id="export" value="导出"/>
50 50 </div>
51 51 </form>
52 52 </div>
... ... @@ -298,10 +298,12 @@
298 298 });
299 299 });
300 300 }
  301 + $('#export').attr('disabled', "true");
301 302 $("#query").on("click",function(){
302   - var line=$("#line").val();;
  303 + var line=$("#line").val();
303 304 var lineName=$(".select2-selection__rendered").html();
304 305 var date =$("#date").val();
  306 + $("#export").removeAttr("disabled");
305 307 if(line=="" || line==null){
306 308 layer.msg('请选择线路.');
307 309 }else if(date==""||date==null){
... ... @@ -310,6 +312,7 @@
310 312 $("#xlid").html(lineName);
311 313 $("#dateid").html(date);
312 314 $get('/report/jobFwqk',{line:line,date:date},function(result){
  315 + console.log(result);
313 316 var list_lbqk = template('list_lbqk',{list:result});
314 317 // 把渲染好的模版html文本追加到表格中
315 318 $('#forms .list_lbqk').html(list_lbqk);
... ... @@ -344,7 +347,22 @@
344 347  
345 348 }
346 349  
347   - })
  350 + });
  351 +
  352 + $("#export").on("click",function(){
  353 + var line=$("#line").val();
  354 + var lineName=$(".select2-selection__rendered").html();
  355 + var date =$("#date").val();
  356 + if(line=="" || line==null){
  357 + layer.msg('请选择线路.');
  358 + }else if(date==""||date==null){
  359 + layer.msg('请选择日期.');
  360 + }else{
  361 + $get('/report/jobSummaryExport',{line:line,date:date,lineName:lineName},function(result){
  362 + window.open("/downloadFile/download?fileName=调度员工作汇总日报");
  363 + });
  364 + }
  365 + });
348 366  
349 367 });
350 368 </script>
... ... @@ -354,15 +372,13 @@
354 372 <td>{{obj.nr}}</td>
355 373 <td>{{obj.lp}}</td>
356 374 <td>{{obj.nbbm}}</td>
357   - <td {{if obj.lx ==1}} colspan="2" {{/if}}>{{obj.jgh}}</td>
  375 + <td {{if obj.lx ==1}} colspan="4" {{/if}}>{{obj.jgh}}</td>
358 376 {{if obj.lx ==0}}
359   - <td>{{obj.dz}}</td>
360   - {{/if}}
361   - <td {{if obj.lx ==1}} colspan="3" {{/if}}>{{obj.sj}}</td>
362   - {{if obj.lx ==0}}
363   - <td>&nbsp;</td>
  377 + <td>{{obj.dz}}</td>
  378 + <td>{{obj.sj}}</td>
  379 + <td>&nbsp;</td>
  380 + {{/if}}
364 381 <td>{{obj.lbbc}}</td>
365   - {{/if}}
366 382 <td {{if obj.lx ==1}} colspan="2" {{/if}}>{{obj.lblc}}</td>
367 383 {{if obj.lx ==0}}
368 384 <td>{{obj.jyqp}}</td>
... ...