Commit 4b26b53acbe69f41aedc43ca787bdb365dc48e6d
1 parent
5603a928
LGF 导出
Showing
3 changed files
with
29 additions
and
6 deletions
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -57,7 +57,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -57,7 +57,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 57 | } | 57 | } |
| 58 | if(times.length() != 0){ | 58 | if(times.length() != 0){ |
| 59 | String[] split = times.split("-"); | 59 | String[] split = times.split("-"); |
| 60 | - sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'"; | 60 | + String[] split0 = split[0].split(":"); |
| 61 | + String[] split1 = split[1].split(":"); | ||
| 62 | + int time0 = Integer.valueOf(split0[0])*60 + Integer.valueOf(split0[1]); | ||
| 63 | + int time1 = Integer.valueOf(split1[0])*60 + Integer.valueOf(split1[1]); | ||
| 64 | + if(time1 > time0){ | ||
| 65 | + sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'"; | ||
| 66 | + } else { | ||
| 67 | + sql += " and (fcsj >= '"+split[0]+"' or fcsj <= '"+split[1]+"')"; | ||
| 68 | + } | ||
| 61 | } | 69 | } |
| 62 | if(company.length() != 0){ | 70 | if(company.length() != 0){ |
| 63 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | 71 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| @@ -65,6 +73,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -65,6 +73,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 65 | if(normal){ | 73 | if(normal){ |
| 66 | sql += " and bc_type != 'in' and bc_type != 'out'"; | 74 | sql += " and bc_type != 'in' and bc_type != 'out'"; |
| 67 | } | 75 | } |
| 76 | + System.out.println(sql); | ||
| 68 | 77 | ||
| 69 | list = jdbcTemplate.query(sql, | 78 | list = jdbcTemplate.query(sql, |
| 70 | new RowMapper<ScheduleRealInfo>(){ | 79 | new RowMapper<ScheduleRealInfo>(){ |
| @@ -1577,7 +1586,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1577,7 +1586,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1577 | } | 1586 | } |
| 1578 | if(times.length() != 0){ | 1587 | if(times.length() != 0){ |
| 1579 | String[] split = times.split("-"); | 1588 | String[] split = times.split("-"); |
| 1580 | - sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'"; | 1589 | + String[] split0 = split[0].split(":"); |
| 1590 | + String[] split1 = split[1].split(":"); | ||
| 1591 | + int time0 = Integer.valueOf(split0[0])*60 + Integer.valueOf(split0[1]); | ||
| 1592 | + int time1 = Integer.valueOf(split1[0])*60 + Integer.valueOf(split1[1]); | ||
| 1593 | + if(time1 > time0){ | ||
| 1594 | + sql += " and fcsj >= '"+split[0]+"' and fcsj <= '"+split[1]+"'"; | ||
| 1595 | + } else { | ||
| 1596 | + sql += " and (fcsj >= '"+split[0]+"' or fcsj <= '"+split[1]+"')"; | ||
| 1597 | + } | ||
| 1581 | } | 1598 | } |
| 1582 | if(company.length() != 0){ | 1599 | if(company.length() != 0){ |
| 1583 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; | 1600 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
src/main/resources/static/pages/forms/mould/lbStatuAnaly.xls
0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
| @@ -82,7 +82,7 @@ | @@ -82,7 +82,7 @@ | ||
| 82 | </div> | 82 | </div> |
| 83 | <div class="form-group" style="margin-left: 10px"> | 83 | <div class="form-group" style="margin-left: 10px"> |
| 84 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 84 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 85 | -<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | 85 | + <input class="btn btn-default" type="button" id="export" value="导出"/> |
| 86 | </div> | 86 | </div> |
| 87 | </form> | 87 | </form> |
| 88 | </div> | 88 | </div> |
| @@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
| 107 | 107 | ||
| 108 | <script> | 108 | <script> |
| 109 | $(function(){ | 109 | $(function(){ |
| 110 | - | 110 | + $('#export').attr('disabled', "true"); |
| 111 | 111 | ||
| 112 | // 关闭左侧栏 | 112 | // 关闭左侧栏 |
| 113 | if (!$('body').hasClass('page-sidebar-closed')) | 113 | if (!$('body').hasClass('page-sidebar-closed')) |
| @@ -253,6 +253,12 @@ | @@ -253,6 +253,12 @@ | ||
| 253 | _w_table_rowspan("#forms", 3); | 253 | _w_table_rowspan("#forms", 3); |
| 254 | _w_table_rowspan("#forms", 4); | 254 | _w_table_rowspan("#forms", 4); |
| 255 | _w_table_rowspan("#forms", 5); | 255 | _w_table_rowspan("#forms", 5); |
| 256 | + | ||
| 257 | + if(result.length == 0) | ||
| 258 | + $('#export').attr('disabled', "true"); | ||
| 259 | + else | ||
| 260 | + $("#export").removeAttr("disabled"); | ||
| 261 | + | ||
| 256 | }); | 262 | }); |
| 257 | } | 263 | } |
| 258 | 264 | ||
| @@ -268,8 +274,8 @@ | @@ -268,8 +274,8 @@ | ||
| 268 | params['type'] = "export"; | 274 | params['type'] = "export"; |
| 269 | $get('/busInterval/lbStatuAnaly', params, function(result){ | 275 | $get('/busInterval/lbStatuAnaly', params, function(result){ |
| 270 | window.open("/downloadFile/download?fileName=烂班情况分析表" | 276 | window.open("/downloadFile/download?fileName=烂班情况分析表" |
| 271 | - + moment(startDate).format("YYYYMMDD")) | ||
| 272 | - +"-"+ moment(endDate).format("YYYYMMDD"); | 277 | + + moment(startDate).format("YYYYMMDD") |
| 278 | + +"-"+ moment(endDate).format("YYYYMMDD")); | ||
| 273 | }); | 279 | }); |
| 274 | }); | 280 | }); |
| 275 | 281 |