Commit 5bfe7ebdd112fd07abadb59c21e71c401f350694

Authored by 娄高锋
1 parent 3a8d00c6

修复 修正报表 选择区间日期后导出报错的问题

src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -2234,6 +2234,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -2234,6 +2234,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
2234 } 2234 }
2235 try { 2235 try {
2236 String dateTime = sdfSimple.format(sdfMonth.parse(date)); 2236 String dateTime = sdfSimple.format(sdfMonth.parse(date));
  2237 + if(!endDate.equals(date)){
  2238 + dateTime += "-" + sdfSimple.format(sdfMonth.parse(endDate));
  2239 + }
2237 String lineName = BasicData.lineCode2NameMap.get(line); 2240 String lineName = BasicData.lineCode2NameMap.get(line);
2238 listI.add(tempList.iterator()); 2241 listI.add(tempList.iterator());
2239 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 2242 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
src/main/resources/static/pages/forms/statement/correctForm.html
@@ -265,12 +265,12 @@ @@ -265,12 +265,12 @@
265 var type = "export"; 265 var type = "export";
266 $get('/realSchedule/correctForm',{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ 266 $get('/realSchedule/correctForm',{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){
267 var dateTime = ""; 267 var dateTime = "";
268 -// if(date == endDate){ 268 + if(date == endDate){
269 dateTime = moment(date).format("YYYYMMDD"); 269 dateTime = moment(date).format("YYYYMMDD");
270 -// } else {  
271 -// dateTime = moment(date).format("YYYYMMDD")+"-"+  
272 -// moment(endDate).format("YYYYMMDD");  
273 -// } 270 + } else {
  271 + dateTime = moment(date).format("YYYYMMDD")+"-"+
  272 + moment(endDate).format("YYYYMMDD");
  273 + }
274 window.open("/downloadFile/download?fileName=" 274 window.open("/downloadFile/download?fileName="
275 +dateTime+"-"+lineName+"-修正报表"); 275 +dateTime+"-"+lineName+"-修正报表");
276 }); 276 });