Commit 4638074e893da90c3d6b7eb9327f21c7610fee75

Authored by 娄高锋
1 parent 55a4a539

车队查询,BUG修正

src/main/java/com/bsth/server_rs/bigdata/BigscreenService.java
... ... @@ -588,7 +588,7 @@ public class BigscreenService {
588 588 }
589 589  
590 590 /**给大屏的线路数、班次、里程汇总接口
591   - * 按直属公司查询
  591 + * 按车队查询
592 592 */
593 593 @GET
594 594 @Path("/selectData/getBigScreen/{gsdm}")
... ... @@ -633,7 +633,7 @@ public class BigscreenService {
633 633 }
634 634 }
635 635  
636   - String lineSql="SELECT b.start_opt,a.company,a.line_code,a.name,a.level,"
  636 + String lineSql="SELECT b.start_opt,a.company,a.branche_company,a.line_code,a.name,a.level,"
637 637 + " a.shanghai_linecode, a.nature from "
638 638 + " bsth_c_line a left join bsth_c_line_config b "
639 639 + " on a.id=b.line where "
... ... @@ -647,6 +647,7 @@ public class BigscreenService {
647 647 m.put("state", rs.getString("start_opt"));
648 648 m.put("company", rs.getString("company"));
649 649 m.put("companyName", getGs(rs.getString("company")));
  650 + m.put("brancheCompany", rs.getString("branche_company"));
650 651 m.put("lineCode",rs.getString("line_code"));
651 652 m.put("name", rs.getString("name"));
652 653 m.put("level", rs.getString("level"));
... ... @@ -658,7 +659,8 @@ public class BigscreenService {
658 659  
659 660 int level1 = 0, level2 = 0, lineCount = 0;
660 661 for(Map<String, Object> t : lineList){
661   - if(t.containsKey("company") && t.get("company").toString().trim().equals(gsdm)){
  662 + if(t.containsKey("company") && t.get("company").toString().trim().equals("77") &&
  663 + t.containsKey("brancheCompany") && t.get("brancheCompany").toString().trim().equals(gsdm)){
662 664 ++lineCount;
663 665 if(t.get("level") != null){
664 666 if("1".equals(t.get("level").toString())){
... ... @@ -696,9 +698,9 @@ public class BigscreenService {
696 698 + " jhsmbcs,sjsmbczds,smbczdl,jhsmbcsz,sjsmbczdsz,smbczdlz,"
697 699 + " jhszfcs,sjszfczds,szfczdl,create_date"
698 700 + " from bsth_c_calc_count "
699   - + " where date >= '"+date2+"' and date <= '"+date+"' and gsdm = '"+gsdm+"'";
  701 + + " where date >= ? and date <= ? and gsdm = '77' and fgsdm = ?";
700 702  
701   - List<Map<String, Object>> list=jdbcTemplate.query(sql,
  703 + List<Map<String, Object>> list=jdbcTemplate.query(sql, new Object[]{date2, date, gsdm},
702 704 new RowMapper<Map<String, Object>>(){
703 705 @Override
704 706 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
... ... @@ -847,7 +849,8 @@ public class BigscreenService {
847 849 Map<String, Object> qkMap = qkList.get(datesMap.get(d));
848 850 long jh = 0, sj = 0;
849 851 for(ScheduleRealInfo s : findAll){
850   - if(s.getGsBm() != null && s.getGsBm().trim().equals(gsdm)){
  852 + if(s.getGsBm() != null && s.getGsBm().trim().equals("77") &&
  853 + s.getFgsBm() != null && s.getFgsBm().trim().equals(gsdm)){
851 854 if(s.getXlBm() != null && yyLine.contains(s.getXlBm())){//营运线路
852 855 if(!isInOut(s) && !s.isCcService() && s.getStatus() != -1 && s.getStatus() != 0){
853 856 ++jh;
... ... @@ -903,7 +906,8 @@ public class BigscreenService {
903 906 List<ScheduleRealInfo> listSche = new ArrayList<ScheduleRealInfo>();
904 907 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
905 908 for(ScheduleRealInfo s : findAll){
906   - if(s.getGsBm() != null && s.getGsBm().trim().equals(gsdm)){
  909 + if(s.getGsBm() != null && s.getGsBm().trim().equals("77") &&
  910 + s.getFgsBm() != null && s.getFgsBm().trim().equals(gsdm)){
907 911 if(s.getXlBm() != null && yyLine.contains(s.getXlBm())){//营运线路
908 912 listSche.add(s);
909 913 Set<ChildTaskPlan> cts = s.getcTasks();
... ... @@ -1500,7 +1504,8 @@ public class BigscreenService {
1500 1504 List<ScheduleRealInfo> findAll = scheduleRealInfoRepository.findAll(dates[i]);
1501 1505 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
1502 1506 for(ScheduleRealInfo s : findAll){
1503   - if(s.getFgsBm() != null && s.getFgsBm().equals(gsdm)){//直属公司
  1507 + if(s.getGsBm() != null && s.getGsBm().equals("77") &&
  1508 + s.getFgsBm() != null && s.getFgsBm().equals(gsdm)){//车队
1504 1509 if(s.getXlBm() != null && yyLine.contains(s.getXlBm())){//营运线路
1505 1510 if(!isInOut(s)){
1506 1511 Set<ChildTaskPlan> cts = s.getcTasks();
... ... @@ -1528,7 +1533,8 @@ public class BigscreenService {
1528 1533  
1529 1534 for(ScheduleRealInfo s : findAll){
1530 1535 try {
1531   - if(s.getFgsBm() != null && s.getFgsBm().equals(gsdm)){//直属公司
  1536 + if(s.getGsBm() != null && s.getGsBm().equals("77") &&
  1537 + s.getFgsBm() != null && s.getFgsBm().equals(gsdm)){//车队
1532 1538 if(s.getXlBm() != null && yyLine.contains(s.getXlBm())){//营运线路
1533 1539 if (s.isSflj() || isInOut(s)){
1534 1540 continue;
... ... @@ -1604,7 +1610,7 @@ public class BigscreenService {
1604 1610 + " left join bsth_c_business b on p.company_code = b.up_code"
1605 1611 + " and p.branche_company_code = b.business_code"
1606 1612 + " where p.company_code = '77'"
1607   - + " where p.branche_company_code = ?"
  1613 + + " and p.branche_company_code = ?"
1608 1614 + " group by p.branche_company_code, b.business_name"
1609 1615 + " order by p.branche_company_code";
1610 1616 List<Map<String, Object>> ecList=jdbcTemplate.query(gpLineSql, new Object[]{gsdm},
... ...