Commit 8f59aa120432fd07d36b30ebec09247c717b9990

Authored by 娄高锋
1 parent 24c866aa

路单线路明细月报表、年报表,全部分公司查询不到已停用分公司的问题。

src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
@@ -108,4 +108,40 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ @@ -108,4 +108,40 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ
108 "and c.xl in (select l.lineCode from Line l where l.destroy in (?5)) order by c.fgsdm,c.xl,c.rqStr") 108 "and c.xl in (select l.lineCode from Line l where l.destroy in (?5)) order by c.fgsdm,c.xl,c.rqStr")
109 List<CalcWaybill> scheduleByDateAndLineTjPxAllLine(String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy); 109 List<CalcWaybill> scheduleByDateAndLineTjPxAllLine(String date,String date2,List<String> gsdm,List<String> fgsdm, List<Integer> destroy);
110 110
  111 +
  112 + //按照时间段统计,公司下线路 (驾驶员)(全部分公司)
  113 + @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) " +
  114 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?5)) order by c.jGh,c.fgsdm,c.xl,c.rqStr")
  115 + List<CalcWaybill> scheduleByJsy2AllFgs(List<String> line,String date,String date2,List<String> gsdm,List<Integer> destroy);
  116 + //按照时间段统计,公司下线路 (售票员)(全部分公司) coalesce(c.sGh,'')
  117 + @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.sGh <> null and c.sGh <> '' " +
  118 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?5)) order by c.sGh,c.fgsdm,c.xl,c.rqStr")
  119 + List<CalcWaybill> scheduleBySpy2AllFgs(List<String> line,String date,String date2,List<String> gsdm,List<Integer> destroy);
  120 + //按照时间段统计,公司下线路 (车辆自编号)(全部分公司)
  121 + @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) " +
  122 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?5)) order by c.cl,c.fgsdm,c.xl,c.rqStr")
  123 + List<CalcWaybill> scheduleByZbh2AllFgs(List<String> line,String date,String date2,List<String> gsdm,List<Integer> destroy);
  124 + //按照时间段统计,公司下线路 排序不同(全部分公司)
  125 + @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) " +
  126 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?5)) order by c.fgsdm,c.xl,c.rqStr")
  127 + List<CalcWaybill> scheduleByDateAndLineTjPxAllFgs(List<String> line,String date,String date2,List<String> gsdm,List<Integer> destroy);
  128 +
  129 +
  130 + //按照时间段统计,公司下线路 (驾驶员)(全部线路)(全部分公司)
  131 + @Query(value="select DISTINCT c from CalcWaybill c where c.rqStr between ?1 and ?2 and c.gsdm in(?3) " +
  132 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?4)) order by c.jGh,c.fgsdm,c.xl,c.rqStr")
  133 + List<CalcWaybill> scheduleByJsy2AllLineAllFgs(String date,String date2,List<String> gsdm,List<Integer> destroy);
  134 + //按照时间段统计,公司下线路 (售票员)(全部线路)(全部分公司)
  135 + @Query(value="select DISTINCT c from CalcWaybill c where c.rqStr between ?1 and ?2 and c.gsdm in(?3) and c.sGh <> null and c.sGh <> '' " +
  136 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?4)) order by c.sGh,c.fgsdm,c.xl,c.rqStr")
  137 + List<CalcWaybill> scheduleBySpy2AllLineAllFgs(String date,String date2,List<String> gsdm,List<Integer> destroy);
  138 + //按照时间段统计,公司下线路 (车辆自编号)(全部线路)(全部分公司)
  139 + @Query(value="select DISTINCT c from CalcWaybill c where c.rqStr between ?1 and ?2 and c.gsdm in(?3) " +
  140 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?4)) order by c.cl,c.fgsdm,c.xl,c.rqStr")
  141 + List<CalcWaybill> scheduleByZbh2AllLineAllFgs(String date,String date2,List<String> gsdm,List<Integer> destroy);
  142 + //按照时间段统计,公司下线路 排序不同(全部线路)(全部分公司)
  143 + @Query(value="select DISTINCT c from CalcWaybill c where c.rqStr between ?1 and ?2 and c.gsdm in(?3) " +
  144 + "and c.xl in (select l.lineCode from Line l where l.destroy in (?4)) order by c.fgsdm,c.xl,c.rqStr")
  145 + List<CalcWaybill> scheduleByDateAndLineTjPxAllLineAllFgs(String date,String date2,List<String> gsdm,List<Integer> destroy);
  146 +
111 } 147 }
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -1924,7 +1924,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -1924,7 +1924,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1924 } 1924 }
1925 List<String> fgsdm= new ArrayList<>(); 1925 List<String> fgsdm= new ArrayList<>();
1926 String fgsdmStr = ""; 1926 String fgsdmStr = "";
1927 - if(map.get("fgsdm")!=null){ 1927 + if(map.get("fgsdm")!=null && map.get("fgsdm").toString().trim().length() > 0){
1928 fgsdmStr = map.get("fgsdm").toString().trim(); 1928 fgsdmStr = map.get("fgsdm").toString().trim();
1929 String[] fgsdms = fgsdmStr.split(","); 1929 String[] fgsdms = fgsdmStr.split(",");
1930 for (int i = 0; i < fgsdms.length; i++){ 1930 for (int i = 0; i < fgsdms.length; i++){
@@ -1993,33 +1993,65 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -1993,33 +1993,65 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
1993 } 1993 }
1994 1994
1995 int flag = 0; 1995 int flag = 0;
1996 - if(!lineStr.equals("")){  
1997 - if("jsy".equals(statisticalObj)){  
1998 - flag = 1;  
1999 - list = calcRepository.scheduleByJsy2(line, startDate, endDate, gsdm, fgsdm, destroy);  
2000 - } else if("cwy".equals(statisticalObj)){  
2001 - flag = 2;  
2002 - list = calcRepository.scheduleBySpy2(line, startDate, endDate, gsdm, fgsdm, destroy);  
2003 - } else if("cl".equals(statisticalObj)){  
2004 - flag = 3;  
2005 - list = calcRepository.scheduleByZbh2(line, startDate, endDate, gsdm, fgsdm, destroy);  
2006 - } else if("xl".equals(statisticalObj)){  
2007 - flag = 4;  
2008 - list = calcRepository.scheduleByDateAndLineTjPx(line, startDate, endDate, gsdm, fgsdm, destroy); 1996 + if(!fgsdmStr.equals("")){
  1997 + if(!lineStr.equals("")){
  1998 + if("jsy".equals(statisticalObj)){
  1999 + flag = 1;
  2000 + list = calcRepository.scheduleByJsy2(line, startDate, endDate, gsdm, fgsdm, destroy);
  2001 + } else if("cwy".equals(statisticalObj)){
  2002 + flag = 2;
  2003 + list = calcRepository.scheduleBySpy2(line, startDate, endDate, gsdm, fgsdm, destroy);
  2004 + } else if("cl".equals(statisticalObj)){
  2005 + flag = 3;
  2006 + list = calcRepository.scheduleByZbh2(line, startDate, endDate, gsdm, fgsdm, destroy);
  2007 + } else if("xl".equals(statisticalObj)){
  2008 + flag = 4;
  2009 + list = calcRepository.scheduleByDateAndLineTjPx(line, startDate, endDate, gsdm, fgsdm, destroy);
  2010 + }
  2011 + } else {
  2012 + if("jsy".equals(statisticalObj)){
  2013 + flag = 1;
  2014 + list = calcRepository.scheduleByJsy2AllLine(startDate, endDate, gsdm, fgsdm, destroy);
  2015 + } else if("cwy".equals(statisticalObj)){
  2016 + flag = 2;
  2017 + list = calcRepository.scheduleBySpy2AllLine(startDate, endDate, gsdm, fgsdm, destroy);
  2018 + } else if("cl".equals(statisticalObj)){
  2019 + flag = 3;
  2020 + list = calcRepository.scheduleByZbh2AllLine(startDate, endDate, gsdm, fgsdm, destroy);
  2021 + } else if("xl".equals(statisticalObj)){
  2022 + flag = 4;
  2023 + list = calcRepository.scheduleByDateAndLineTjPxAllLine(startDate, endDate, gsdm, fgsdm, destroy);
  2024 + }
2009 } 2025 }
2010 } else { 2026 } else {
2011 - if("jsy".equals(statisticalObj)){  
2012 - flag = 1;  
2013 - list = calcRepository.scheduleByJsy2AllLine(startDate, endDate, gsdm, fgsdm, destroy);  
2014 - } else if("cwy".equals(statisticalObj)){  
2015 - flag = 2;  
2016 - list = calcRepository.scheduleBySpy2AllLine(startDate, endDate, gsdm, fgsdm, destroy);  
2017 - } else if("cl".equals(statisticalObj)){  
2018 - flag = 3;  
2019 - list = calcRepository.scheduleByZbh2AllLine(startDate, endDate, gsdm, fgsdm, destroy);  
2020 - } else if("xl".equals(statisticalObj)){  
2021 - flag = 4;  
2022 - list = calcRepository.scheduleByDateAndLineTjPxAllLine(startDate, endDate, gsdm, fgsdm, destroy); 2027 + if(!lineStr.equals("")){
  2028 + if("jsy".equals(statisticalObj)){
  2029 + flag = 1;
  2030 + list = calcRepository.scheduleByJsy2AllFgs(line, startDate, endDate, gsdm, destroy);
  2031 + } else if("cwy".equals(statisticalObj)){
  2032 + flag = 2;
  2033 + list = calcRepository.scheduleBySpy2AllFgs(line, startDate, endDate, gsdm, destroy);
  2034 + } else if("cl".equals(statisticalObj)){
  2035 + flag = 3;
  2036 + list = calcRepository.scheduleByZbh2AllFgs(line, startDate, endDate, gsdm, destroy);
  2037 + } else if("xl".equals(statisticalObj)){
  2038 + flag = 4;
  2039 + list = calcRepository.scheduleByDateAndLineTjPxAllFgs(line, startDate, endDate, gsdm, destroy);
  2040 + }
  2041 + } else {
  2042 + if("jsy".equals(statisticalObj)){
  2043 + flag = 1;
  2044 + list = calcRepository.scheduleByJsy2AllLineAllFgs(startDate, endDate, gsdm, destroy);
  2045 + } else if("cwy".equals(statisticalObj)){
  2046 + flag = 2;
  2047 + list = calcRepository.scheduleBySpy2AllLineAllFgs(startDate, endDate, gsdm, destroy);
  2048 + } else if("cl".equals(statisticalObj)){
  2049 + flag = 3;
  2050 + list = calcRepository.scheduleByZbh2AllLineAllFgs(startDate, endDate, gsdm, destroy);
  2051 + } else if("xl".equals(statisticalObj)){
  2052 + flag = 4;
  2053 + list = calcRepository.scheduleByDateAndLineTjPxAllLineAllFgs(startDate, endDate, gsdm, destroy);
  2054 + }
2023 } 2055 }
2024 } 2056 }
2025 2057
src/main/resources/static/pages/forms/calc/calcDetailMonthly.html
@@ -221,7 +221,9 @@ @@ -221,7 +221,9 @@
221 } 221 }
222 } 222 }
223 223
224 - var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; 224 +// var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option;
  225 +// var options = '<option value="1,2,3,5,6,11,12">所有分公司</option>'+option;
  226 + var options = '<option value="">所有分公司</option>'+option;
225 $('#fgsdm').html(options); 227 $('#fgsdm').html(options);
226 }); 228 });
227 } 229 }
src/main/resources/static/pages/forms/calc/calcDetailYear.html
@@ -219,7 +219,9 @@ @@ -219,7 +219,9 @@
219 } 219 }
220 } 220 }
221 221
222 - var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option; 222 +// var options = '<option value="'+allC.substring(0,allC.length-1)+'">所有分公司</option>'+option;
  223 +// var options = '<option value="1,2,3,5,6,11,12">所有分公司</option>'+option;
  224 + var options = '<option value="">所有分公司</option>'+option;
223 $('#fgsdm').html(options); 225 $('#fgsdm').html(options);
224 }); 226 });
225 } 227 }