Commit 763143c50617d6400d7861d3e8adee779ca16272
1 parent
eff57e02
路单数据(统计) 添加是否电车的搜索项
Showing
5 changed files
with
52 additions
and
14 deletions
src/main/java/com/bsth/controller/calc/CalcMixController.java
| ... | ... | @@ -81,7 +81,11 @@ public class CalcMixController { |
| 81 | 81 | if(map.get("fgsdmSing")!=null){ |
| 82 | 82 | fgsdmSing=map.get("fgsdmSing").toString().trim(); |
| 83 | 83 | } |
| 84 | - return service.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing); | |
| 84 | + String sfdc=""; | |
| 85 | + if(map.get("sfdc")!=null){ | |
| 86 | + sfdc=map.get("sfdc").toString().trim(); | |
| 87 | + } | |
| 88 | + return service.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing, sfdc); | |
| 85 | 89 | } |
| 86 | 90 | |
| 87 | 91 | } | ... | ... |
src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
| ... | ... | @@ -66,7 +66,10 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ |
| 66 | 66 | @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and CONCAT(sGh,'/',sName) like %?6% order by c.xl") |
| 67 | 67 | List<CalcWaybill> scheduleBySpy(String line,String date,String date2,String gsdm,String fgsdm,String spy); |
| 68 | 68 | //按照时间段统计,公司下线路 (车辆自编号) |
| 69 | - @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and cl like %?6% order by c.xl") | |
| 69 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and c.cl like %?6% order by c.xl") | |
| 70 | 70 | List<CalcWaybill> scheduleByZbh(String line,String date,String date2,String gsdm,String fgsdm,String zbh); |
| 71 | + @Query(value="select DISTINCT c from CalcWaybill c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% and c.cl like %?6%" | |
| 72 | + + " and c.cl in (select s.carCode from Cars s where s.sfdc = ?7) order by c.xl") | |
| 73 | + List<CalcWaybill> scheduleByZbh(String line,String date,String date2,String gsdm,String fgsdm,String zbh,Boolean sfdc); | |
| 71 | 74 | |
| 72 | 75 | } | ... | ... |
src/main/java/com/bsth/service/calc/CalcMixService.java
| ... | ... | @@ -10,6 +10,6 @@ public interface CalcMixService { |
| 10 | 10 | |
| 11 | 11 | List<Map<String, Object>> calcjsyspy(String line, String startDate, String endDate, String cont, String empnames, String gsdmManth, String fgsdmManth); |
| 12 | 12 | |
| 13 | - List<Map<String, Object>> singledatatj(String line, String startDate, String endDate, String tjtype, String cont, String gsdmSing, String fgsdmSing); | |
| 13 | + List<Map<String, Object>> singledatatj(String line, String startDate, String endDate, String tjtype, String cont, String gsdmSing, String fgsdmSing, String sfdc); | |
| 14 | 14 | |
| 15 | 15 | } | ... | ... |
src/main/java/com/bsth/service/calc/impl/CalcMixServiceImpl.java
| ... | ... | @@ -160,7 +160,7 @@ public class CalcMixServiceImpl implements CalcMixService { |
| 160 | 160 | public List<Map<String, Object>> singledatatj(String line, |
| 161 | 161 | String date, String date2, |
| 162 | 162 | String tjtype, String cont, |
| 163 | - String gsdm, String fgsdm) { | |
| 163 | + String gsdm, String fgsdm, String sfdc) { | |
| 164 | 164 | |
| 165 | 165 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
| 166 | 166 | List<CalcWaybill> list = null; |
| ... | ... | @@ -174,7 +174,13 @@ public class CalcMixServiceImpl implements CalcMixService { |
| 174 | 174 | list = calcRepository.scheduleBySpy(line, date, date2, gsdm, fgsdm, cont); |
| 175 | 175 | } else if("车辆自编号".equals(tjtype)){ |
| 176 | 176 | flag = 3; |
| 177 | - list = calcRepository.scheduleByZbh(line, date, date2, gsdm, fgsdm, cont); | |
| 177 | + if("1".equals(sfdc)){ | |
| 178 | + list = calcRepository.scheduleByZbh(line, date, date2, gsdm, fgsdm, cont, true); | |
| 179 | + } else if("0".equals(sfdc)){ | |
| 180 | + list = calcRepository.scheduleByZbh(line, date, date2, gsdm, fgsdm, cont, false); | |
| 181 | + } else { | |
| 182 | + list = calcRepository.scheduleByZbh(line, date, date2, gsdm, fgsdm, cont); | |
| 183 | + } | |
| 178 | 184 | } |
| 179 | 185 | |
| 180 | 186 | List<CalcWaybill> calcList = new ArrayList<CalcWaybill>(); |
| ... | ... | @@ -267,7 +273,7 @@ public class CalcMixServiceImpl implements CalcMixService { |
| 267 | 273 | + linesql |
| 268 | 274 | + " union" |
| 269 | 275 | + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" |
| 270 | - + " WHERE rq >= '"+date2+"' and rq <= '"+date2+"'" | |
| 276 | + + " WHERE rq >= '"+date+"' and rq <= '"+date2+"'" | |
| 271 | 277 | + linesql; |
| 272 | 278 | List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { |
| 273 | 279 | @Override | ... | ... |
src/main/resources/static/pages/forms/calc/calcsingledata.html
| ... | ... | @@ -40,6 +40,14 @@ |
| 40 | 40 | <span class="item-label" style="width: 80px;">线路: </span> |
| 41 | 41 | <select class="form-control" name="line" id="line" style="width: 140px;"></select> |
| 42 | 42 | </div> |
| 43 | + <div style="display: inline-block; margin-left: 18px;" id="sfdcDiv"> | |
| 44 | + <span class="item-label" style="width: 80px;">是否电车: </span> | |
| 45 | + <select class="form-control form-filter " name="sfdc" id="sfdc"> | |
| 46 | + <option value="">请选择...</option> | |
| 47 | + <option value="0">否</option> | |
| 48 | + <option value="1">是</option> | |
| 49 | + </select> | |
| 50 | + </div> | |
| 43 | 51 | <div style="margin-top: 10px"></div> |
| 44 | 52 | <div style="display: inline-block;margin-left: 3px;"> |
| 45 | 53 | <span class="item-label" style="width: 140px;">开始时间: </span> |
| ... | ... | @@ -99,13 +107,10 @@ |
| 99 | 107 | // 关闭左侧栏 |
| 100 | 108 | if (!$('body').hasClass('page-sidebar-closed')) |
| 101 | 109 | $('.menu-toggler.sidebar-toggler').click(); |
| 102 | - | |
| 103 | - $("#startDate,#endDate").datetimepicker({ | |
| 104 | - format : 'YYYY-MM-DD', | |
| 105 | - locale : 'zh-cn' | |
| 106 | - }); | |
| 110 | + | |
| 107 | 111 | |
| 108 | 112 | var d = new Date(); |
| 113 | + d.setTime(d.getTime() - 4*1000*60*60*24); | |
| 109 | 114 | var year = d.getFullYear(); |
| 110 | 115 | var month = d.getMonth() + 1; |
| 111 | 116 | var day = d.getDate(); |
| ... | ... | @@ -113,7 +118,20 @@ |
| 113 | 118 | month = "0" + month; |
| 114 | 119 | if(day < 10) |
| 115 | 120 | day = "0" + day; |
| 116 | - $("#startDate,#endDate").val(year + "-" + month + "-" + day); | |
| 121 | + var dateTime = year + "-" + month + "-" + day; | |
| 122 | + $("#startDate").datetimepicker({ | |
| 123 | + format : 'YYYY-MM-DD', | |
| 124 | + locale : 'zh-cn', | |
| 125 | + maxDate : dateTime | |
| 126 | + }); | |
| 127 | + $("#endDate").datetimepicker({ | |
| 128 | + format : 'YYYY-MM-DD', | |
| 129 | + locale : 'zh-cn', | |
| 130 | + maxDate : dateTime | |
| 131 | + }); | |
| 132 | + $("#startDate").val(dateTime); | |
| 133 | + $("#endDate").val(dateTime); | |
| 134 | + | |
| 117 | 135 | |
| 118 | 136 | var fage=false; |
| 119 | 137 | var xlList; |
| ... | ... | @@ -193,6 +211,8 @@ |
| 193 | 211 | } |
| 194 | 212 | }); |
| 195 | 213 | |
| 214 | + $("#sfdcDiv").hide(); | |
| 215 | + | |
| 196 | 216 | var cont = "驾驶员", cont1 = "", cont2 = "", cont3 = ""; |
| 197 | 217 | $("#tjtype").on("change",function(){ |
| 198 | 218 | if(cont == "驾驶员"){ |
| ... | ... | @@ -205,10 +225,13 @@ |
| 205 | 225 | cont = $("#tjtype").val(); |
| 206 | 226 | if($("#tjtype").val() == "驾驶员"){ |
| 207 | 227 | $("#cont").val(cont1); |
| 228 | + $("#sfdcDiv").hide(); | |
| 208 | 229 | } else if($("#tjtype").val() == "售票员"){ |
| 209 | 230 | $("#cont").val(cont2); |
| 231 | + $("#sfdcDiv").hide(); | |
| 210 | 232 | } else if($("#tjtype").val() == "车辆自编号"){ |
| 211 | 233 | $("#cont").val(cont3); |
| 234 | + $("#sfdcDiv").show(); | |
| 212 | 235 | } |
| 213 | 236 | }); |
| 214 | 237 | |
| ... | ... | @@ -229,9 +252,10 @@ |
| 229 | 252 | var fgsdmSing = $("#fgsdmSing").val(); |
| 230 | 253 | var tjtype=$("#tjtype").val(); |
| 231 | 254 | var cont=$("#cont").val(); |
| 255 | + var sfdc=$("#sfdc").val(); | |
| 232 | 256 | var params = {}; |
| 233 | 257 | var i = layer.load(2); |
| 234 | - $get("/calc_mix/singledatatj",{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,cont:cont},function(result){ | |
| 258 | + $get("/calc_mix/singledatatj",{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,cont:cont,sfdc:sfdc},function(result){ | |
| 235 | 259 | layer.close(i); |
| 236 | 260 | var singledata = template('singledata',{list:result}); |
| 237 | 261 | // 把渲染好的模版html文本追加到表格中 |
| ... | ... | @@ -247,11 +271,12 @@ |
| 247 | 271 | var fgsdmSing = $("#fgsdmSing").val(); |
| 248 | 272 | var tjtype=$("#tjtype").val(); |
| 249 | 273 | var cont=$("#cont").val(); |
| 274 | + var sfdc=$("#sfdc").val(); | |
| 250 | 275 | var lineName = $('#line option:selected').text(); |
| 251 | 276 | if(lineName == "全部线路") |
| 252 | 277 | lineName = $('#fgsdmSing option:selected').text(); |
| 253 | 278 | var i = layer.load(2); |
| 254 | - $get('/calc_export/singledataExportTj',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,cont:cont,type:'export',lineName:lineName},function(result){ | |
| 279 | + $get('/calc_export/singledataExportTj',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,cont:cont,sfdc:sfdc,type:'export',lineName:lineName},function(result){ | |
| 255 | 280 | var dateTime = ""; |
| 256 | 281 | if(startDate == endDate){ |
| 257 | 282 | dateTime = moment(startDate).format("YYYYMMDD"); | ... | ... |