Commit 262d501c9487e780214b007e97d483f0813610df

Authored by 游瑞烽
1 parent 1b15abff

路单详情添加线路性质筛选条件

src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
@@ -74,19 +74,20 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ @@ -74,19 +74,20 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ
74 74
75 75
76 //按照时间段统计,公司下线路 (驾驶员) 76 //按照时间段统计,公司下线路 (驾驶员)
77 - @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) order by c.jGh,c.fgsdm,c.xl,c.rq")  
78 - List<CalcWaybill> scheduleByJsy2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm); 77 + @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " +
  78 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.jGh,c.fgsdm,c.xl,c.rq")
  79 + List<CalcWaybill> scheduleByJsy2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy);
79 //按照时间段统计,公司下线路 (售票员) coalesce(c.sGh,'') 80 //按照时间段统计,公司下线路 (售票员) coalesce(c.sGh,'')
80 - @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) and c.sGh <> null and c.sGh <> '' order by c.sGh,c.fgsdm,c.xl,c.rq")  
81 - List<CalcWaybill> scheduleBySpy2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm); 81 + @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) and c.sGh <> null and c.sGh <> '' " +
  82 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.sGh,c.fgsdm,c.xl,c.rq")
  83 + List<CalcWaybill> scheduleBySpy2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy);
82 //按照时间段统计,公司下线路 (车辆自编号) 84 //按照时间段统计,公司下线路 (车辆自编号)
83 - @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) order by c.cl,c.fgsdm,c.xl,c.rq")  
84 - List<CalcWaybill> scheduleByZbh2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm); 85 + @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " +
  86 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.cl,c.fgsdm,c.xl,c.rq")
  87 + List<CalcWaybill> scheduleByZbh2(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy);
85 //按照时间段统计,公司下线路 排序不同 88 //按照时间段统计,公司下线路 排序不同
86 - @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) order by c.fgsdm,c.xl,c.rq")  
87 - List<CalcWaybill> scheduleByDateAndLineTjPx(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm);  
88 - //按照时间段统计,单条线路 排序不同  
89 - @Query(value="select DISTINCT c from CalcWaybill c where c.xl = ?1 and c.rqStr between ?2 and ?3 order by c.xl,c.rq")  
90 - List<CalcWaybill> scheduleByDateAndLineTjPx2(String line,String date,String date2); 89 + @Query(value="select DISTINCT c from CalcWaybill c where c.xl in(?1) and c.rqStr between ?2 and ?3 and c.gsdm in(?4) and c.fgsdm in(?5) " +
  90 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?6)) order by c.fgsdm,c.xl,c.rq")
  91 + List<CalcWaybill> scheduleByDateAndLineTjPx(List<String> line,String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy);
91 92
92 } 93 }
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -1812,14 +1812,15 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -1812,14 +1812,15 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1812 1812
1813 @Override 1813 @Override
1814 public List<List<String>> calcDetailMonthly(Map<String, Object> map) { 1814 public List<List<String>> calcDetailMonthly(Map<String, Object> map) {
1815 -// String gsdm="";  
1816 -// if(map.get("gsdm")!=null){  
1817 -// gsdm=map.get("gsdm").toString().trim();  
1818 -// }  
1819 -// String fgsdm="";  
1820 -// if(map.get("fgsdm")!=null){  
1821 -// fgsdm=map.get("fgsdm").toString().trim();  
1822 -// } 1815 + List<Integer> destroy= new ArrayList<>();
  1816 + String destroyStr = "";
  1817 + if(map.get("destroy")!=null){
  1818 + destroyStr = map.get("destroy").toString().trim();
  1819 + String[] destroys = destroyStr.split(",");
  1820 + for (int i = 0; i < destroys.length; i++){
  1821 + destroy.add(Integer.parseInt(destroys[i]));
  1822 + }
  1823 + }
1823 List<String> gsdm= new ArrayList<>(); 1824 List<String> gsdm= new ArrayList<>();
1824 String gsdmStr = ""; 1825 String gsdmStr = "";
1825 if(map.get("gsdm")!=null){ 1826 if(map.get("gsdm")!=null){
@@ -1915,16 +1916,16 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -1915,16 +1916,16 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1915 int flag = 0; 1916 int flag = 0;
1916 if("jsy".equals(statisticalObj)){ 1917 if("jsy".equals(statisticalObj)){
1917 flag = 1; 1918 flag = 1;
1918 - list = calcRepository.scheduleByJsy2(line, startDate, endDate, gsdm, fgsdm); 1919 + list = calcRepository.scheduleByJsy2(line, startDate, endDate, gsdm, fgsdm, destroy);
1919 } else if("cwy".equals(statisticalObj)){ 1920 } else if("cwy".equals(statisticalObj)){
1920 flag = 2; 1921 flag = 2;
1921 - list = calcRepository.scheduleBySpy2(line, startDate, endDate, gsdm, fgsdm); 1922 + list = calcRepository.scheduleBySpy2(line, startDate, endDate, gsdm, fgsdm, destroy);
1922 } else if("cl".equals(statisticalObj)){ 1923 } else if("cl".equals(statisticalObj)){
1923 flag = 3; 1924 flag = 3;
1924 - list = calcRepository.scheduleByZbh2(line, startDate, endDate, gsdm, fgsdm); 1925 + list = calcRepository.scheduleByZbh2(line, startDate, endDate, gsdm, fgsdm, destroy);
1925 } else if("xl".equals(statisticalObj)){ 1926 } else if("xl".equals(statisticalObj)){
1926 flag = 4; 1927 flag = 4;
1927 - list = calcRepository.scheduleByDateAndLineTjPx(line,startDate,endDate,gsdm,fgsdm); 1928 + list = calcRepository.scheduleByDateAndLineTjPx(line,startDate,endDate,gsdm,fgsdm, destroy);
1928 /*if(line.equals("")){ 1929 /*if(line.equals("")){
1929 //查询所有线路 1930 //查询所有线路
1930 }else{ 1931 }else{
src/main/resources/static/pages/forms/calc/calcDetailMonthly.html
@@ -73,7 +73,14 @@ @@ -73,7 +73,14 @@
73 <span class="item-label" style="width: 80px;">&#12288;&#12288;线路: </span> 73 <span class="item-label" style="width: 80px;">&#12288;&#12288;线路: </span>
74 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 74 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
75 </div>--> 75 </div>-->
76 - 76 + <div style="display: inline-block; margin-left: 33px;">
  77 + <span class="item-label" style="width: 80px;">线路性质: </span>
  78 + <select class="form-control" name="destroy" id="destroy" style="width: 180px;">
  79 + <option value="0,1">全部线路</option>
  80 + <option value="0">营运线路</option>
  81 + <option value="1">非营运线路</option>
  82 + </select>
  83 + </div>
77 <div style="display: inline-block;margin-left: 33px;" class="date-picker"> 84 <div style="display: inline-block;margin-left: 33px;" class="date-picker">
78 <span class="item-label" style="width: 80px;">&#12288;&#12288;时间: </span> 85 <span class="item-label" style="width: 80px;">&#12288;&#12288;时间: </span>
79 <input class="form-control" type="text" id="startDate" style="width: 180px;" /> - 86 <input class="form-control" type="text" id="startDate" style="width: 180px;" /> -
@@ -144,7 +151,7 @@ @@ -144,7 +151,7 @@
144 var d = new Date(); 151 var d = new Date();
145 var year = d.getFullYear(); 152 var year = d.getFullYear();
146 var month = d.getMonth() + 1; 153 var month = d.getMonth() + 1;
147 - var day = d.getDate()-1;//只能查一天以前的数据 154 + var day = d.getDate()-3;//只能查3天以前的数据
148 if(month < 10) 155 if(month < 10)
149 month = "0" + month; 156 month = "0" + month;
150 if(day < 10) 157 if(day < 10)
@@ -244,6 +251,7 @@ @@ -244,6 +251,7 @@
244 datas.timeType = "m"; 251 datas.timeType = "m";
245 datas.startDate = startDate; 252 datas.startDate = startDate;
246 datas.endDate = endDate; 253 datas.endDate = endDate;
  254 + datas.destroy = $("#destroy").val();
247 datas.statisticalObj = $("#statisticalObj").val(); 255 datas.statisticalObj = $("#statisticalObj").val();
248 datas.itemDetails = $("#itemDetails").val(); 256 datas.itemDetails = $("#itemDetails").val();
249 if(startDate==null || startDate =="" ||endDate==null || endDate ==""){ 257 if(startDate==null || startDate =="" ||endDate==null || endDate ==""){
src/main/resources/static/pages/forms/calc/calcDetailYear.html
@@ -73,7 +73,14 @@ @@ -73,7 +73,14 @@
73 <span class="item-label" style="width: 80px;">&#12288;&#12288;线路: </span> 73 <span class="item-label" style="width: 80px;">&#12288;&#12288;线路: </span>
74 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 74 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
75 </div>--> 75 </div>-->
76 - 76 + <div style="display: inline-block; margin-left: 33px;">
  77 + <span class="item-label" style="width: 80px;">线路性质: </span>
  78 + <select class="form-control" name="destroy" id="destroy" style="width: 180px;">
  79 + <option value="0,1">全部线路</option>
  80 + <option value="0">营运线路</option>
  81 + <option value="1">非营运线路</option>
  82 + </select>
  83 + </div>
77 <div style="display: inline-block;margin-left: 33px;" class="date-picker"> 84 <div style="display: inline-block;margin-left: 33px;" class="date-picker">
78 <span class="item-label" style="width: 80px;">&#12288;&#12288;时间: </span> 85 <span class="item-label" style="width: 80px;">&#12288;&#12288;时间: </span>
79 <input class="form-control" type="text" id="startDate" style="width: 180px;" /> - 86 <input class="form-control" type="text" id="startDate" style="width: 180px;" /> -
@@ -81,6 +88,7 @@ @@ -81,6 +88,7 @@
81 <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10"/> - --> 88 <!--<input class="form-control" type="text" id="startDate" style="width: 180px;" value="2020-10"/> - -->
82 <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10"/>--> 89 <!--<input class="form-control" type="text" id="endDate" style="width: 180px;" value="2020-10"/>-->
83 </div> 90 </div>
  91 +
84 <div style="margin-top: 2px"></div> 92 <div style="margin-top: 2px"></div>
85 93
86 <div style="display: inline-block;margin-left: 33px;"> 94 <div style="display: inline-block;margin-left: 33px;">
@@ -163,13 +171,19 @@ @@ -163,13 +171,19 @@
163 }); 171 });
164 172
165 173
166 - var lineAll=""; 174 + var lineAll="",lineNoD="",lineD="";
167 var datas = {}; //查询条件 175 var datas = {}; //查询条件
168 176
169 177
170 /**用户分配的线路*/ 178 /**用户分配的线路*/
171 $.get('/realControAuthority/findByCurrentUser', function (userAuthor) { 179 $.get('/realControAuthority/findByCurrentUser', function (userAuthor) {
172 lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1); 180 lineAll = userAuthor.lineCodeStr.substring(0,userAuthor.lineCodeStr.length-1);
  181 + /* $.get('/line/all', function (lines) {
  182 + $.each(lines,function () {
  183 +
  184 + });
  185 +
  186 + });*/
173 }); 187 });
174 188
175 var tempData = {}; 189 var tempData = {};
@@ -244,6 +258,7 @@ @@ -244,6 +258,7 @@
244 datas.lineCode = lineAll; 258 datas.lineCode = lineAll;
245 datas.startDate = startDate; 259 datas.startDate = startDate;
246 datas.endDate = endDate; 260 datas.endDate = endDate;
  261 + datas.destroy = $("#destroy").val();
247 datas.statisticalObj = $("#statisticalObj").val(); 262 datas.statisticalObj = $("#statisticalObj").val();
248 datas.itemDetails = $("#itemDetails").val(); 263 datas.itemDetails = $("#itemDetails").val();
249 datas.item = item; 264 datas.item = item;