Commit 763143c50617d6400d7861d3e8adee779ca16272

Authored by 娄高锋
1 parent eff57e02

路单数据(统计) 添加是否电车的搜索项

src/main/java/com/bsth/controller/calc/CalcMixController.java
@@ -81,7 +81,11 @@ public class CalcMixController { @@ -81,7 +81,11 @@ public class CalcMixController {
81 if(map.get("fgsdmSing")!=null){ 81 if(map.get("fgsdmSing")!=null){
82 fgsdmSing=map.get("fgsdmSing").toString().trim(); 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,7 +66,10 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ
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") 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 List<CalcWaybill> scheduleBySpy(String line,String date,String date2,String gsdm,String fgsdm,String spy); 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 List<CalcWaybill> scheduleByZbh(String line,String date,String date2,String gsdm,String fgsdm,String zbh); 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,6 +10,6 @@ public interface CalcMixService {
10 10
11 List<Map<String, Object>> calcjsyspy(String line, String startDate, String endDate, String cont, String empnames, String gsdmManth, String fgsdmManth); 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,7 +160,7 @@ public class CalcMixServiceImpl implements CalcMixService {
160 public List<Map<String, Object>> singledatatj(String line, 160 public List<Map<String, Object>> singledatatj(String line,
161 String date, String date2, 161 String date, String date2,
162 String tjtype, String cont, 162 String tjtype, String cont,
163 - String gsdm, String fgsdm) { 163 + String gsdm, String fgsdm, String sfdc) {
164 164
165 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 165 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
166 List<CalcWaybill> list = null; 166 List<CalcWaybill> list = null;
@@ -174,7 +174,13 @@ public class CalcMixServiceImpl implements CalcMixService { @@ -174,7 +174,13 @@ public class CalcMixServiceImpl implements CalcMixService {
174 list = calcRepository.scheduleBySpy(line, date, date2, gsdm, fgsdm, cont); 174 list = calcRepository.scheduleBySpy(line, date, date2, gsdm, fgsdm, cont);
175 } else if("车辆自编号".equals(tjtype)){ 175 } else if("车辆自编号".equals(tjtype)){
176 flag = 3; 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 List<CalcWaybill> calcList = new ArrayList<CalcWaybill>(); 186 List<CalcWaybill> calcList = new ArrayList<CalcWaybill>();
@@ -267,7 +273,7 @@ public class CalcMixServiceImpl implements CalcMixService { @@ -267,7 +273,7 @@ public class CalcMixServiceImpl implements CalcMixService {
267 + linesql 273 + linesql
268 + " union" 274 + " union"
269 + " SELECT id,xlbm,nbbm,jsy,cdl as jzl,hd as yh,sh as sh,fgsdm FROM bsth_c_dlb" 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 + linesql; 277 + linesql;
272 List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() { 278 List<Singledata> listNy = jdbcTemplate.query(nysql, new RowMapper<Singledata>() {
273 @Override 279 @Override
src/main/resources/static/pages/forms/calc/calcsingledata.html
@@ -40,6 +40,14 @@ @@ -40,6 +40,14 @@
40 <span class="item-label" style="width: 80px;">线路: </span> 40 <span class="item-label" style="width: 80px;">线路: </span>
41 <select class="form-control" name="line" id="line" style="width: 140px;"></select> 41 <select class="form-control" name="line" id="line" style="width: 140px;"></select>
42 </div> 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 <div style="margin-top: 10px"></div> 51 <div style="margin-top: 10px"></div>
44 <div style="display: inline-block;margin-left: 3px;"> 52 <div style="display: inline-block;margin-left: 3px;">
45 <span class="item-label" style="width: 140px;">开始时间: </span> 53 <span class="item-label" style="width: 140px;">开始时间: </span>
@@ -99,13 +107,10 @@ @@ -99,13 +107,10 @@
99 // 关闭左侧栏 107 // 关闭左侧栏
100 if (!$('body').hasClass('page-sidebar-closed')) 108 if (!$('body').hasClass('page-sidebar-closed'))
101 $('.menu-toggler.sidebar-toggler').click(); 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 var d = new Date(); 112 var d = new Date();
  113 + d.setTime(d.getTime() - 4*1000*60*60*24);
109 var year = d.getFullYear(); 114 var year = d.getFullYear();
110 var month = d.getMonth() + 1; 115 var month = d.getMonth() + 1;
111 var day = d.getDate(); 116 var day = d.getDate();
@@ -113,7 +118,20 @@ @@ -113,7 +118,20 @@
113 month = "0" + month; 118 month = "0" + month;
114 if(day < 10) 119 if(day < 10)
115 day = "0" + day; 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 var fage=false; 136 var fage=false;
119 var xlList; 137 var xlList;
@@ -193,6 +211,8 @@ @@ -193,6 +211,8 @@
193 } 211 }
194 }); 212 });
195 213
  214 + $("#sfdcDiv").hide();
  215 +
196 var cont = "驾驶员", cont1 = "", cont2 = "", cont3 = ""; 216 var cont = "驾驶员", cont1 = "", cont2 = "", cont3 = "";
197 $("#tjtype").on("change",function(){ 217 $("#tjtype").on("change",function(){
198 if(cont == "驾驶员"){ 218 if(cont == "驾驶员"){
@@ -205,10 +225,13 @@ @@ -205,10 +225,13 @@
205 cont = $("#tjtype").val(); 225 cont = $("#tjtype").val();
206 if($("#tjtype").val() == "驾驶员"){ 226 if($("#tjtype").val() == "驾驶员"){
207 $("#cont").val(cont1); 227 $("#cont").val(cont1);
  228 + $("#sfdcDiv").hide();
208 } else if($("#tjtype").val() == "售票员"){ 229 } else if($("#tjtype").val() == "售票员"){
209 $("#cont").val(cont2); 230 $("#cont").val(cont2);
  231 + $("#sfdcDiv").hide();
210 } else if($("#tjtype").val() == "车辆自编号"){ 232 } else if($("#tjtype").val() == "车辆自编号"){
211 $("#cont").val(cont3); 233 $("#cont").val(cont3);
  234 + $("#sfdcDiv").show();
212 } 235 }
213 }); 236 });
214 237
@@ -229,9 +252,10 @@ @@ -229,9 +252,10 @@
229 var fgsdmSing = $("#fgsdmSing").val(); 252 var fgsdmSing = $("#fgsdmSing").val();
230 var tjtype=$("#tjtype").val(); 253 var tjtype=$("#tjtype").val();
231 var cont=$("#cont").val(); 254 var cont=$("#cont").val();
  255 + var sfdc=$("#sfdc").val();
232 var params = {}; 256 var params = {};
233 var i = layer.load(2); 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 layer.close(i); 259 layer.close(i);
236 var singledata = template('singledata',{list:result}); 260 var singledata = template('singledata',{list:result});
237 // 把渲染好的模版html文本追加到表格中 261 // 把渲染好的模版html文本追加到表格中
@@ -247,11 +271,12 @@ @@ -247,11 +271,12 @@
247 var fgsdmSing = $("#fgsdmSing").val(); 271 var fgsdmSing = $("#fgsdmSing").val();
248 var tjtype=$("#tjtype").val(); 272 var tjtype=$("#tjtype").val();
249 var cont=$("#cont").val(); 273 var cont=$("#cont").val();
  274 + var sfdc=$("#sfdc").val();
250 var lineName = $('#line option:selected').text(); 275 var lineName = $('#line option:selected').text();
251 if(lineName == "全部线路") 276 if(lineName == "全部线路")
252 lineName = $('#fgsdmSing option:selected').text(); 277 lineName = $('#fgsdmSing option:selected').text();
253 var i = layer.load(2); 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 var dateTime = ""; 280 var dateTime = "";
256 if(startDate == endDate){ 281 if(startDate == endDate){
257 dateTime = moment(startDate).format("YYYYMMDD"); 282 dateTime = moment(startDate).format("YYYYMMDD");