Commit 5e75991dae3600c1773e6c8a625a5e84360e2597

Authored by 娄高锋
1 parent 6e357b38

统一导出的excel表名

src/main/java/com/bsth/controller/report/ReportController.java
@@ -53,6 +53,7 @@ public class ReportController { @@ -53,6 +53,7 @@ public class ReportController {
53 Map<String, Object> m = new HashMap<String, Object>(); 53 Map<String, Object> m = new HashMap<String, Object>();
54 m.put("i", i); 54 m.put("i", i);
55 m.put("nbbm", a.getNbbm()); 55 m.put("nbbm", a.getNbbm());
  56 + m.put("pzh", a.getPzh());
56 m.put("stopName", a.getStopName()); 57 m.put("stopName", a.getStopName());
57 m.put("jzsj", a.getJzsj()); 58 m.put("jzsj", a.getJzsj());
58 m.put("czsj", a.getCzsj()); 59 m.put("czsj", a.getCzsj());
@@ -118,8 +119,7 @@ public class ReportController { @@ -118,8 +119,7 @@ public class ReportController {
118 @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ 119 @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){
119 List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); 120 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
120 ReportUtils ee = new ReportUtils(); 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 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 123 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
124 int i=1; 124 int i=1;
125 for (ArrivalInfo a:list ) { 125 for (ArrivalInfo a:list ) {
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -2226,10 +2226,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2226,10 +2226,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2226 tempList.add(tempMap); 2226 tempList.add(tempMap);
2227 } 2227 }
2228 try { 2228 try {
  2229 + String dateTime = sdfSimple.format(sdfMonth.parse(date));
  2230 + String lineName = BasicData.lineCode2NameMap.get(line);
2229 listI.add(tempList.iterator()); 2231 listI.add(tempList.iterator());
2230 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 2232 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2231 ee.excelReplace(listI, new Object[]{m}, path + "mould/correctForm.xls", 2233 ee.excelReplace(listI, new Object[]{m}, path + "mould/correctForm.xls",
2232 - path + "export/修正报表" + date+ ".xls"); 2234 + path + "export/" + dateTime + "-" + lineName + "-修正报表.xls");
2233 } catch (Exception e) { 2235 } catch (Exception e) {
2234 // TODO: handle exception 2236 // TODO: handle exception
2235 e.printStackTrace(); 2237 e.printStackTrace();
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -229,7 +229,7 @@ public class ReportServiceImpl implements ReportService{ @@ -229,7 +229,7 @@ public class ReportServiceImpl implements ReportService{
229 229
230 230
231 public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx,String fcsj){ 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 Calendar cal = Calendar.getInstance(); 233 Calendar cal = Calendar.getInstance();
234 cal.setTime(dates1); 234 cal.setTime(dates1);
235 //周数,表分区字段 235 //周数,表分区字段
src/main/resources/static/pages/forms/statement/correctForm.html
@@ -249,9 +249,9 @@ @@ -249,9 +249,9 @@
249 /* var list_correctForm_statistics = template('list_correctForm_statistics',temp); 249 /* var list_correctForm_statistics = template('list_correctForm_statistics',temp);
250 $('#forms .list_correctForm_statistics').html(list_correctForm_statistics); */ 250 $('#forms .list_correctForm_statistics').html(list_correctForm_statistics); */
251 251
252 - if(result.length == 0)  
253 - $("#export").attr('disabled',"true");  
254 - else 252 +// if(result.length == 0)
  253 +// $("#export").attr('disabled',"true");
  254 +// else
255 $("#export").removeAttr("disabled"); 255 $("#export").removeAttr("disabled");
256 256
257 }); 257 });
@@ -260,7 +260,10 @@ @@ -260,7 +260,10 @@
260 $("#export").on("click",function(){ 260 $("#export").on("click",function(){
261 var type = "export"; 261 var type = "export";
262 $get('/realSchedule/correctForm',{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ 262 $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); 263 +
  264 + window.open("/downloadFile/download?fileName="
  265 + +moment(date).format("YYYYMMDD")
  266 + +"-"+date+"-修正报表");
264 }); 267 });
265 }); 268 });
266 269
src/main/resources/static/pages/report/inoutstation.html
@@ -485,7 +485,7 @@ @@ -485,7 +485,7 @@
485 }else{ 485 }else{
486 $get('/report/exportQueryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){ 486 $get('/report/exportQueryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){
487 window.open("/downloadFile/download?fileName=" 487 window.open("/downloadFile/download?fileName="
488 - +moment(date).format("YYYYMMDD") 488 + +moment(rq).format("YYYYMMDD")
489 +"-"+pzh+"-班次到离站"); 489 +"-"+pzh+"-班次到离站");
490 }); 490 });
491 } 491 }