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 | 57 | } |
| 58 | 58 | if(times.length() != 0){ |
| 59 | 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 | 70 | if(company.length() != 0){ |
| 63 | 71 | sql += " and gs_bm = '"+company+"' and fgs_bm = '"+subCompany+"'"; |
| ... | ... | @@ -65,6 +73,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 65 | 73 | if(normal){ |
| 66 | 74 | sql += " and bc_type != 'in' and bc_type != 'out'"; |
| 67 | 75 | } |
| 76 | + System.out.println(sql); | |
| 68 | 77 | |
| 69 | 78 | list = jdbcTemplate.query(sql, |
| 70 | 79 | new RowMapper<ScheduleRealInfo>(){ |
| ... | ... | @@ -1577,7 +1586,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { |
| 1577 | 1586 | } |
| 1578 | 1587 | if(times.length() != 0){ |
| 1579 | 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 | 1599 | if(company.length() != 0){ |
| 1583 | 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 | 82 | </div> |
| 83 | 83 | <div class="form-group" style="margin-left: 10px"> |
| 84 | 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 | 86 | </div> |
| 87 | 87 | </form> |
| 88 | 88 | </div> |
| ... | ... | @@ -107,7 +107,7 @@ |
| 107 | 107 | |
| 108 | 108 | <script> |
| 109 | 109 | $(function(){ |
| 110 | - | |
| 110 | + $('#export').attr('disabled', "true"); | |
| 111 | 111 | |
| 112 | 112 | // 关闭左侧栏 |
| 113 | 113 | if (!$('body').hasClass('page-sidebar-closed')) |
| ... | ... | @@ -253,6 +253,12 @@ |
| 253 | 253 | _w_table_rowspan("#forms", 3); |
| 254 | 254 | _w_table_rowspan("#forms", 4); |
| 255 | 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 | 274 | params['type'] = "export"; |
| 269 | 275 | $get('/busInterval/lbStatuAnaly', params, function(result){ |
| 270 | 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 | ... | ... |