Commit 8e646bd73cc438b8dda9ebb3a48e9d9d045976be
1 parent
22cdb082
LGF
Showing
3 changed files
with
40 additions
and
8 deletions
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -1393,8 +1393,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1393,8 +1393,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1393 | 1393 | ||
| 1394 | String[] date1 = startDate.split("-"); | 1394 | String[] date1 = startDate.split("-"); |
| 1395 | String[] date2 = endDate.split("-"); | 1395 | String[] date2 = endDate.split("-"); |
| 1396 | - startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; | ||
| 1397 | - endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; | 1396 | +// startDate = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; |
| 1397 | +// endDate = date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; | ||
| 1398 | + String Date = ""; | ||
| 1399 | + if(startDate.equals(endDate)) | ||
| 1400 | + Date = date1[0] + "年" + date1[1] + "月" + date1[2] + "日"; | ||
| 1401 | + else | ||
| 1402 | + Date = date1[0] + "年" + date1[1] + "月" + date1[2] + "日" | ||
| 1403 | + + date2[0] + "年" + date2[1] + "月" + date2[2] + "日"; | ||
| 1398 | 1404 | ||
| 1399 | String[] split = times.split("-"); | 1405 | String[] split = times.split("-"); |
| 1400 | int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]); | 1406 | int startTime = Integer.valueOf(split[0].split(":")[0])*60 + Integer.valueOf(split[0].split(":")[1]); |
| @@ -1472,10 +1478,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1472,10 +1478,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1472 | } | 1478 | } |
| 1473 | } | 1479 | } |
| 1474 | } | 1480 | } |
| 1475 | - if(startDate.equals(endDate)) | ||
| 1476 | - tempMap.put("date", startDate); | ||
| 1477 | - else | ||
| 1478 | - tempMap.put("date", startDate + "--" + endDate); | 1481 | + tempMap.put("date", Date); |
| 1479 | tempMap.put("company", companyName); | 1482 | tempMap.put("company", companyName); |
| 1480 | tempMap.put("subCompany", subCompanyName); | 1483 | tempMap.put("subCompany", subCompanyName); |
| 1481 | tempMap.put("times", times); | 1484 | tempMap.put("times", times); |
| @@ -1523,6 +1526,24 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1523,6 +1526,24 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1523 | resList.add(tempMap); | 1526 | resList.add(tempMap); |
| 1524 | } | 1527 | } |
| 1525 | 1528 | ||
| 1529 | + if(type != null && type.length() != 0 && type.equals("export")){ | ||
| 1530 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 1531 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 1532 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 1533 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 1534 | + ReportUtils ee = new ReportUtils(); | ||
| 1535 | + try { | ||
| 1536 | + listI.add(resList.iterator()); | ||
| 1537 | + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | ||
| 1538 | + ee.excelReplace(listI, new Object[] { m }, path+"mould/lbStatuAnaly.xls", | ||
| 1539 | + path+"export/烂班情况分析表" + sdfSimple.format(sdfMonth.parse(startDate)) | ||
| 1540 | + + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls"); | ||
| 1541 | + } catch (Exception e) { | ||
| 1542 | + // TODO: handle exception | ||
| 1543 | + e.printStackTrace(); | ||
| 1544 | + } | ||
| 1545 | + } | ||
| 1546 | + | ||
| 1526 | return resList; | 1547 | return resList; |
| 1527 | } | 1548 | } |
| 1528 | 1549 |
src/main/resources/static/pages/forms/mould/statisticsDaily_.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
| @@ -257,8 +257,19 @@ | @@ -257,8 +257,19 @@ | ||
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | $("#export").on("click", function(){ | 259 | $("#export").on("click", function(){ |
| 260 | - $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ | ||
| 261 | - window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD")); | 260 | + var params = {}; |
| 261 | + params['line'] = line; | ||
| 262 | + params['startDate'] = startDate; | ||
| 263 | + params['endDate'] = endDate; | ||
| 264 | + params['model'] = model; | ||
| 265 | + params['times'] = times; | ||
| 266 | + params['company'] = company; | ||
| 267 | + params['subCompany'] = subCompany; | ||
| 268 | + params['type'] = "export"; | ||
| 269 | + $get('/busInterval/lbStatuAnaly', params, function(result){ | ||
| 270 | + window.open("/downloadFile/download?fileName=烂班情况分析表" | ||
| 271 | + + moment(startDate).format("YYYYMMDD")) | ||
| 272 | + +"-"+ moment(endDate).format("YYYYMMDD"); | ||
| 262 | }); | 273 | }); |
| 263 | }); | 274 | }); |
| 264 | 275 |