Commit 7b74fdebd8ab6003c5166570f321783ad03d62ba
1 parent
d32580b5
烂班班次,子任务如果有营运里程,视为实际班次。
Showing
4 changed files
with
216 additions
and
99 deletions
Too many changes to show.
To preserve performance only 4 of 7 files are displayed.
src/main/java/com/bsth/service/BusIntervalService.java
| @@ -2,6 +2,9 @@ package com.bsth.service; | @@ -2,6 +2,9 @@ package com.bsth.service; | ||
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import java.util.Map; | 4 | import java.util.Map; |
| 5 | +import java.util.Set; | ||
| 6 | + | ||
| 7 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | ||
| 5 | 8 | ||
| 6 | 9 | ||
| 7 | public interface BusIntervalService { | 10 | public interface BusIntervalService { |
| @@ -23,4 +26,6 @@ public interface BusIntervalService { | @@ -23,4 +26,6 @@ public interface BusIntervalService { | ||
| 23 | Map<String, Object> exportWaybillMore(Map<String, Object> map); | 26 | Map<String, Object> exportWaybillMore(Map<String, Object> map); |
| 24 | 27 | ||
| 25 | List<Map<String, Object>> onTime(Map<String, Object> map); | 28 | List<Map<String, Object>> onTime(Map<String, Object> map); |
| 29 | + | ||
| 30 | + Map<Long, Set<ChildTaskPlan>> getChildTaskPlans(Long schedule1, Long schedule2); | ||
| 26 | } | 31 | } |
src/main/java/com/bsth/service/calc/impl/CalcCulateMileageServiceImpl.java
| 1 | package com.bsth.service.calc.impl; | 1 | package com.bsth.service.calc.impl; |
| 2 | 2 | ||
| 3 | +import java.math.BigDecimal; | ||
| 3 | import java.text.DecimalFormat; | 4 | import java.text.DecimalFormat; |
| 4 | import java.text.ParseException; | 5 | import java.text.ParseException; |
| 5 | import java.text.SimpleDateFormat; | 6 | import java.text.SimpleDateFormat; |
| @@ -159,7 +160,37 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{ | @@ -159,7 +160,37 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{ | ||
| 159 | }else{ | 160 | }else{ |
| 160 | sjbc++; | 161 | sjbc++; |
| 161 | } | 162 | } |
| 162 | - | 163 | + } else if(scheduleRealInfo.getStatus()==-1){ //(20231031)烂班班次,子任务如果有营运里程,视为实际班次。 |
| 164 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); | ||
| 165 | + if(!childTaskPlans.isEmpty()){ | ||
| 166 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 167 | + boolean b = false; | ||
| 168 | + while (it.hasNext()) { | ||
| 169 | + ChildTaskPlan c = it.next(); | ||
| 170 | + if("service".equals(c.getMileageType()) && !c.isDestroy()){ | ||
| 171 | + BigDecimal mileage = new BigDecimal(c.getMileage()); | ||
| 172 | + if(mileage.compareTo(BigDecimal.ZERO) == 1){ //大于0 | ||
| 173 | + b = true; | ||
| 174 | + } | ||
| 175 | + } | ||
| 176 | + if(b){ | ||
| 177 | + break; | ||
| 178 | + } | ||
| 179 | + } | ||
| 180 | + if(b){ | ||
| 181 | + if(item.equals("zgf")){ | ||
| 182 | + if(fcsj>=zgf1 && fcsj<=zgf2){ | ||
| 183 | + sjbc++; | ||
| 184 | + } | ||
| 185 | + }else if(item.equals("wgf")){ | ||
| 186 | + if(fcsj>=wgf1 && fcsj<=wgf2){ | ||
| 187 | + sjbc++; | ||
| 188 | + } | ||
| 189 | + }else{ | ||
| 190 | + sjbc++; | ||
| 191 | + } | ||
| 192 | + } | ||
| 193 | + } | ||
| 163 | } | 194 | } |
| 164 | } | 195 | } |
| 165 | } | 196 | } |
| @@ -569,7 +600,26 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{ | @@ -569,7 +600,26 @@ public class CalcCulateMileageServiceImpl implements CalcCulateMileageService{ | ||
| 569 | ScheduleRealInfo scheduleRealInfo=lists.get(i); | 600 | ScheduleRealInfo scheduleRealInfo=lists.get(i); |
| 570 | if (!isInOut(scheduleRealInfo) && !scheduleRealInfo.isCcService()) { | 601 | if (!isInOut(scheduleRealInfo) && !scheduleRealInfo.isCcService()) { |
| 571 | if(scheduleRealInfo.getStatus() == -1){ | 602 | if(scheduleRealInfo.getStatus() == -1){ |
| 572 | - lbbc++; | 603 | + Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 604 | + boolean b = false; | ||
| 605 | + if(!childTaskPlans.isEmpty()){ //(20231031)烂班班次,子任务如果有营运里程,视为实际班次。 | ||
| 606 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 607 | + while (it.hasNext()) { | ||
| 608 | + ChildTaskPlan c = it.next(); | ||
| 609 | + if("service".equals(c.getMileageType()) && !c.isDestroy()){ | ||
| 610 | + BigDecimal mileage = new BigDecimal(c.getMileage()); | ||
| 611 | + if(mileage.compareTo(BigDecimal.ZERO) == 1){ //大于0 | ||
| 612 | + b = true; | ||
| 613 | + } | ||
| 614 | + } | ||
| 615 | + if(b){ | ||
| 616 | + break; | ||
| 617 | + } | ||
| 618 | + } | ||
| 619 | + } | ||
| 620 | + if(!b){ | ||
| 621 | + lbbc++; | ||
| 622 | + } | ||
| 573 | } | 623 | } |
| 574 | } | 624 | } |
| 575 | } | 625 | } |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -258,7 +258,9 @@ public class FormsServiceImpl implements FormsService { | @@ -258,7 +258,9 @@ public class FormsServiceImpl implements FormsService { | ||
| 258 | if(map.get("fgsdmManth") != null){ | 258 | if(map.get("fgsdmManth") != null){ |
| 259 | fgsdmManth=map.get("fgsdmManth").toString(); | 259 | fgsdmManth=map.get("fgsdmManth").toString(); |
| 260 | } | 260 | } |
| 261 | - String sql ="select "; | 261 | + String startDate = map.get("startDate").toString(); |
| 262 | + String endDate = map.get("endDate").toString(); | ||
| 263 | + String sql = "select "; | ||
| 262 | if(empnames.equals("驾驶员")){ | 264 | if(empnames.equals("驾驶员")){ |
| 263 | sql += " r.j_gh "; | 265 | sql += " r.j_gh "; |
| 264 | }else if(empnames.equals("售票员")){ | 266 | }else if(empnames.equals("售票员")){ |
| @@ -266,13 +268,19 @@ public class FormsServiceImpl implements FormsService { | @@ -266,13 +268,19 @@ public class FormsServiceImpl implements FormsService { | ||
| 266 | }else{ | 268 | }else{ |
| 267 | sql += " r.cl_zbh "; | 269 | sql += " r.cl_zbh "; |
| 268 | } | 270 | } |
| 269 | - sql += " from bsth_c_s_sp_info_real r where " | ||
| 270 | - + " r.schedule_date_str >= '" + map.get("startDate").toString() + "' " | ||
| 271 | - + " and r.schedule_date_str <='" + map.get("endDate").toString() + "' "; | 271 | + sql += " from bsth_c_s_sp_info_real r where " |
| 272 | + + " r.schedule_date_str >= ? " | ||
| 273 | + + " and r.schedule_date_str <= ? "; | ||
| 274 | + List<String> objList = new ArrayList<String>(); | ||
| 275 | + objList.add(startDate); | ||
| 276 | + objList.add(endDate); | ||
| 272 | if(map.get("line")!=null&&!map.get("line").equals("")){ | 277 | if(map.get("line")!=null&&!map.get("line").equals("")){ |
| 273 | - sql+=" and r.xl_bm='"+ map.get("line").toString() + "' "; | 278 | + sql += " and r.xl_bm = ? "; |
| 279 | + objList.add(map.get("line").toString()); | ||
| 274 | } | 280 | } |
| 275 | - sql+=" and r.gs_bm like'%"+gsdmManth+"%' and r.fgs_bm like'%"+fgsdmManth+"%'"; | 281 | + sql += " and r.gs_bm like ? and r.fgs_bm like ?"; |
| 282 | + objList.add('%' + gsdmManth + '%'); | ||
| 283 | + objList.add('%' + fgsdmManth + '%'); | ||
| 276 | 284 | ||
| 277 | if(empnames.equals("驾驶员")){ | 285 | if(empnames.equals("驾驶员")){ |
| 278 | sql += " GROUP BY " | 286 | sql += " GROUP BY " |
| @@ -283,7 +291,7 @@ public class FormsServiceImpl implements FormsService { | @@ -283,7 +291,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 283 | sql += " GROUP BY r.cl_zbh"; | 291 | sql += " GROUP BY r.cl_zbh"; |
| 284 | } | 292 | } |
| 285 | 293 | ||
| 286 | - List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, new RowMapper<Shiftuehiclemanth>() { | 294 | + List<Shiftuehiclemanth> list = jdbcTemplate.query(sql, objList.toArray(), new RowMapper<Shiftuehiclemanth>() { |
| 287 | 295 | ||
| 288 | @Override | 296 | @Override |
| 289 | public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { | 297 | public Shiftuehiclemanth mapRow(ResultSet arg0, int arg1) throws SQLException { |
| @@ -3114,6 +3122,8 @@ public class FormsServiceImpl implements FormsService { | @@ -3114,6 +3122,8 @@ public class FormsServiceImpl implements FormsService { | ||
| 3114 | if(map.get("fgsdmDaily")!=null){ | 3122 | if(map.get("fgsdmDaily")!=null){ |
| 3115 | fgsbm=map.get("fgsdmDaily").toString(); | 3123 | fgsbm=map.get("fgsdmDaily").toString(); |
| 3116 | } | 3124 | } |
| 3125 | + | ||
| 3126 | + String date = map.get("date").toString(); | ||
| 3117 | 3127 | ||
| 3118 | /*String sql="select t.schedule_date_str," | 3128 | /*String sql="select t.schedule_date_str," |
| 3119 | + " t.cl_zbh,t.j_gh,t.j_name,x.yh from (select r.schedule_date_str,r.xl_bm," | 3129 | + " t.cl_zbh,t.j_gh,t.j_name,x.yh from (select r.schedule_date_str,r.xl_bm," |
| @@ -3131,23 +3141,29 @@ public class FormsServiceImpl implements FormsService { | @@ -3131,23 +3141,29 @@ public class FormsServiceImpl implements FormsService { | ||
| 3131 | + " ) x" | 3141 | + " ) x" |
| 3132 | + " on t.cl_zbh = x.nbbm and t.j_gh=x.jsy";*/ | 3142 | + " on t.cl_zbh = x.nbbm and t.j_gh=x.jsy";*/ |
| 3133 | 3143 | ||
| 3134 | - String sql="select r.schedule_date_str, " | 3144 | + List<String> objList = new ArrayList<String>(); |
| 3145 | + objList.add(date); | ||
| 3146 | + | ||
| 3147 | + String sql="select r.schedule_date_str," | ||
| 3135 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm" | 3148 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm" |
| 3136 | - + " from bsth_c_s_sp_info_real r where " | ||
| 3137 | - + "r.schedule_date_str = '"+map.get("date").toString()+"'"; | 3149 | + + " from bsth_c_s_sp_info_real r where" |
| 3150 | + + " r.schedule_date_str = ?"; | ||
| 3138 | if(!xlbm.equals("")){ | 3151 | if(!xlbm.equals("")){ |
| 3139 | - sql += " and r.xl_bm = '"+xlbm+"'"; | 3152 | + sql += " and r.xl_bm = ?"; |
| 3153 | + objList.add(xlbm); | ||
| 3140 | } | 3154 | } |
| 3141 | if(!gsbm.equals("")){ | 3155 | if(!gsbm.equals("")){ |
| 3142 | - sql += " and r.gs_bm='"+gsbm+"'"; | 3156 | + sql += " and r.gs_bm = ?"; |
| 3157 | + objList.add(gsbm); | ||
| 3143 | } | 3158 | } |
| 3144 | if(!fgsbm.equals("")){ | 3159 | if(!fgsbm.equals("")){ |
| 3145 | - sql += " and r.fgs_bm='"+fgsbm+"'"; | 3160 | + sql += " and r.fgs_bm = ?"; |
| 3161 | + objList.add(fgsbm); | ||
| 3146 | } | 3162 | } |
| 3147 | sql += " group by r.schedule_date_str," | 3163 | sql += " group by r.schedule_date_str," |
| 3148 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | 3164 | + " r.xl_bm,r.cl_zbh,r.j_gh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; |
| 3149 | 3165 | ||
| 3150 | - List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() { | 3166 | + List<Daily> list = jdbcTemplate.query(sql, objList.toArray(), new RowMapper<Daily>() { |
| 3151 | @Override | 3167 | @Override |
| 3152 | public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { | 3168 | public Daily mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 3153 | Daily daily = new Daily(); | 3169 | Daily daily = new Daily(); |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -308,6 +308,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -308,6 +308,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 308 | return list; | 308 | return list; |
| 309 | } | 309 | } |
| 310 | 310 | ||
| 311 | + @Override | ||
| 311 | public Map<Long, Set<ChildTaskPlan>> getChildTaskPlans(Long schedule1, Long schedule2){ | 312 | public Map<Long, Set<ChildTaskPlan>> getChildTaskPlans(Long schedule1, Long schedule2){ |
| 312 | 313 | ||
| 313 | Map<Long, Set<ChildTaskPlan>> schMap = new HashMap<Long, Set<ChildTaskPlan>>(); | 314 | Map<Long, Set<ChildTaskPlan>> schMap = new HashMap<Long, Set<ChildTaskPlan>>(); |
| @@ -802,27 +803,27 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -802,27 +803,27 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 802 | 803 | ||
| 803 | try { | 804 | try { |
| 804 | 805 | ||
| 805 | - List<String> strList = new ArrayList<String>(); | ||
| 806 | - strList.add(startDate); | ||
| 807 | - strList.add(endDate); | 806 | + List<String> objList = new ArrayList<String>(); |
| 807 | + objList.add(startDate); | ||
| 808 | + objList.add(endDate); | ||
| 808 | if(line.length() != 0 && statu.equals("1")){ | 809 | if(line.length() != 0 && statu.equals("1")){ |
| 809 | - strList.add('%' + line + '%'); | 810 | + objList.add('%' + line + '%'); |
| 810 | } else { | 811 | } else { |
| 811 | - strList.add("%%"); | 812 | + objList.add("%%"); |
| 812 | } | 813 | } |
| 813 | if(lp.length() != 0 && statu.equals("1")){ | 814 | if(lp.length() != 0 && statu.equals("1")){ |
| 814 | - strList.add('%' + lp + '%'); | 815 | + objList.add('%' + lp + '%'); |
| 815 | } else { | 816 | } else { |
| 816 | - strList.add("%%"); | 817 | + objList.add("%%"); |
| 817 | } | 818 | } |
| 818 | - strList.add('%' + company + '%'); | ||
| 819 | - strList.add('%' + subCompany + '%'); | 819 | + objList.add('%' + company + '%'); |
| 820 | + objList.add('%' + subCompany + '%'); | ||
| 820 | if(sfqr == 1){ | 821 | if(sfqr == 1){ |
| 821 | - strList.add(times1); | ||
| 822 | - strList.add(times2); | 822 | + objList.add(times1); |
| 823 | + objList.add(times2); | ||
| 823 | } else { | 824 | } else { |
| 824 | - strList.add(""); | ||
| 825 | - strList.add("23:59"); | 825 | + objList.add(""); |
| 826 | + objList.add("23:59"); | ||
| 826 | } | 827 | } |
| 827 | 828 | ||
| 828 | String sql = "select id, schedule_date_str, real_exec_date, xl_name, lp_name, bcs, bcsj, jhlc, bc_type, xl_bm, fgs_bm," | 829 | String sql = "select id, schedule_date_str, real_exec_date, xl_name, lp_name, bcs, bcsj, jhlc, bc_type, xl_bm, fgs_bm," |
| @@ -831,7 +832,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -831,7 +832,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 831 | + " and xl_bm like ? and lp_name like ? and gs_bm like ? and fgs_bm like ? and zdsj >= ? and fcsj <= ?" | 832 | + " and xl_bm like ? and lp_name like ? and gs_bm like ? and fgs_bm like ? and zdsj >= ? and fcsj <= ?" |
| 832 | + " and bc_type != 'ldks'"; | 833 | + " and bc_type != 'ldks'"; |
| 833 | 834 | ||
| 834 | - List<ScheduleRealInfo> query = jdbcTemplate.query(sql, strList.toArray(), | 835 | + List<ScheduleRealInfo> query = jdbcTemplate.query(sql, objList.toArray(), |
| 835 | new RowMapper<ScheduleRealInfo>(){ | 836 | new RowMapper<ScheduleRealInfo>(){ |
| 836 | @Override | 837 | @Override |
| 837 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | 838 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| @@ -925,21 +926,21 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -925,21 +926,21 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 925 | { | 926 | { |
| 926 | List<Map<String, String>> temp1 = new ArrayList<Map<String, String>>(); | 927 | List<Map<String, String>> temp1 = new ArrayList<Map<String, String>>(); |
| 927 | List<Map<String, String>> temp2 = new ArrayList<Map<String, String>>(); | 928 | List<Map<String, String>> temp2 = new ArrayList<Map<String, String>>(); |
| 928 | - List<String> strList1 = new ArrayList<String>(); | ||
| 929 | - strList1.add(startDate); | ||
| 930 | - strList1.add(endDate); | 929 | + List<String> objList1 = new ArrayList<String>(); |
| 930 | + objList1.add(startDate); | ||
| 931 | + objList1.add(endDate); | ||
| 931 | if(line.length() != 0 && statu.equals("1")){ | 932 | if(line.length() != 0 && statu.equals("1")){ |
| 932 | - strList1.add("%" + line + "%"); | 933 | + objList1.add("%" + line + "%"); |
| 933 | } else { | 934 | } else { |
| 934 | - strList1.add("%%"); | 935 | + objList1.add("%%"); |
| 935 | } | 936 | } |
| 936 | - strList1.add("%" + company + "%"); | ||
| 937 | - strList1.add("%" + subCompany + "%"); | 937 | + objList1.add("%" + company + "%"); |
| 938 | + objList1.add("%" + subCompany + "%"); | ||
| 938 | sql = "select id, lp, fcsj, xl_bm, tt_info from bsth_c_s_sp_info" + | 939 | sql = "select id, lp, fcsj, xl_bm, tt_info from bsth_c_s_sp_info" + |
| 939 | " where bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'" + | 940 | " where bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'" + |
| 940 | " and schedule_date >= ? and schedule_date <= ? and xl_bm like ?" + | 941 | " and schedule_date >= ? and schedule_date <= ? and xl_bm like ?" + |
| 941 | " and gs_bm like ? and fgs_bm like ?"; | 942 | " and gs_bm like ? and fgs_bm like ?"; |
| 942 | - List<Map<String, String>> query1 = jdbcTemplate.query(sql, strList1.toArray(), | 943 | + List<Map<String, String>> query1 = jdbcTemplate.query(sql, objList1.toArray(), |
| 943 | new RowMapper<Map<String, String>>(){ | 944 | new RowMapper<Map<String, String>>(){ |
| 944 | @Override | 945 | @Override |
| 945 | public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException { | 946 | public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException { |
| @@ -1994,6 +1995,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1994,6 +1995,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1994 | ljpmlc = new BigDecimal("0"), qtlc = new BigDecimal("0"); | 1995 | ljpmlc = new BigDecimal("0"), qtlc = new BigDecimal("0"); |
| 1995 | String companyName = "", subCompanyName = ""; | 1996 | String companyName = "", subCompanyName = ""; |
| 1996 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 1997 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 1998 | + if(cts.containsKey(schedule.getId())){ | ||
| 1999 | + schedule.setcTasks(cts.get(schedule.getId())); | ||
| 2000 | + } | ||
| 1997 | if(schedule.getGsName() != null && companyName.trim().length() == 0) | 2001 | if(schedule.getGsName() != null && companyName.trim().length() == 0) |
| 1998 | companyName = schedule.getGsName(); | 2002 | companyName = schedule.getGsName(); |
| 1999 | if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0) | 2003 | if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0) |
| @@ -2010,51 +2014,59 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2010,51 +2014,59 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2010 | jhlc = jhlc.add(lc); | 2014 | jhlc = jhlc.add(lc); |
| 2011 | } | 2015 | } |
| 2012 | if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null | 2016 | if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null |
| 2013 | - && schedule.getStatus() != -1){ | ||
| 2014 | - if(!schedule.isCcService()) | 2017 | + && schedule.getStatus() != -1 && !schedule.isCcService()){ |
| 2018 | + sjbc++; | ||
| 2019 | + } else if(schedule.getStatus() == -1 && !schedule.isCcService()){ //(20231031)烂班班次,子任务如果有营运里程,视为实际班次。 | ||
| 2020 | + boolean b = false; | ||
| 2021 | + Set<ChildTaskPlan> childTaskPlans = schedule.getcTasks(); | ||
| 2022 | + if(!childTaskPlans.isEmpty()){ | ||
| 2023 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 2024 | + while (it.hasNext()) { | ||
| 2025 | + ChildTaskPlan c = it.next(); | ||
| 2026 | + if("service".equals(c.getMileageType()) && !c.isDestroy()){ | ||
| 2027 | + BigDecimal mileage = new BigDecimal(c.getMileage()); | ||
| 2028 | + if(mileage.compareTo(BigDecimal.ZERO) == 1){ //大于0 | ||
| 2029 | + b = true; | ||
| 2030 | + } | ||
| 2031 | + } | ||
| 2032 | + if(b){ | ||
| 2033 | + break; | ||
| 2034 | + } | ||
| 2035 | + } | ||
| 2036 | + } | ||
| 2037 | + | ||
| 2038 | + if(b){ | ||
| 2015 | sjbc++; | 2039 | sjbc++; |
| 2016 | -// sjlc = sjlc.add(lc); | ||
| 2017 | - } else if(schedule.getStatus() == -1){ | ||
| 2018 | - if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){ | ||
| 2019 | - lzbc++; | ||
| 2020 | -// lzlc = lzlc.add(lc); | ||
| 2021 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){ | ||
| 2022 | - dmbc++; | ||
| 2023 | -// dmlc = dmlc.add(lc); | ||
| 2024 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){ | ||
| 2025 | - gzbc++; | ||
| 2026 | -// gzlc = gzlc.add(lc); | ||
| 2027 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){ | ||
| 2028 | - jfbc++; | ||
| 2029 | -// jflc = jflc.add(lc); | ||
| 2030 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){ | ||
| 2031 | - zsbc++; | ||
| 2032 | -// zslc = zslc.add(lc); | ||
| 2033 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){ | ||
| 2034 | - qrbc++; | ||
| 2035 | -// qrlc = qrlc.add(lc); | ||
| 2036 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){ | ||
| 2037 | - qcbc++; | ||
| 2038 | -// qclc = qclc.add(lc); | ||
| 2039 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){ | ||
| 2040 | - kxbc++; | ||
| 2041 | -// kxlc = kxlc.add(lc); | ||
| 2042 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){ | ||
| 2043 | - qhbc++; | ||
| 2044 | -// qhlc = qhlc.add(lc); | ||
| 2045 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("援外") != -1){ | ||
| 2046 | - wybc++; | ||
| 2047 | -// wylc = wylc.add(lc); | ||
| 2048 | - }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路救抛锚") != -1){ | ||
| 2049 | - ljpmbc++; | ||
| 2050 | } else { | 2040 | } else { |
| 2051 | - qtbc++; | ||
| 2052 | -// qtlc = qtlc.add(lc); | 2041 | + |
| 2042 | + if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){ | ||
| 2043 | + lzbc++; | ||
| 2044 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){ | ||
| 2045 | + dmbc++; | ||
| 2046 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){ | ||
| 2047 | + gzbc++; | ||
| 2048 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){ | ||
| 2049 | + jfbc++; | ||
| 2050 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){ | ||
| 2051 | + zsbc++; | ||
| 2052 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){ | ||
| 2053 | + qrbc++; | ||
| 2054 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){ | ||
| 2055 | + qcbc++; | ||
| 2056 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){ | ||
| 2057 | + kxbc++; | ||
| 2058 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){ | ||
| 2059 | + qhbc++; | ||
| 2060 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("援外") != -1){ | ||
| 2061 | + wybc++; | ||
| 2062 | + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路救抛锚") != -1){ | ||
| 2063 | + ljpmbc++; | ||
| 2064 | + } else { | ||
| 2065 | + qtbc++; | ||
| 2066 | + } | ||
| 2067 | + | ||
| 2053 | } | 2068 | } |
| 2054 | } | 2069 | } |
| 2055 | - if(cts.containsKey(schedule.getId())){ | ||
| 2056 | - schedule.setcTasks(cts.get(schedule.getId())); | ||
| 2057 | - } | ||
| 2058 | } | 2070 | } |
| 2059 | 2071 | ||
| 2060 | List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); | 2072 | List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>(); |
| @@ -2263,32 +2275,34 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2263,32 +2275,34 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2263 | if(endDate.length() == 0){ | 2275 | if(endDate.length() == 0){ |
| 2264 | endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); | 2276 | endDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| 2265 | } | 2277 | } |
| 2278 | + Map<Long, Set<ChildTaskPlan>> cts = new HashMap<Long, Set<ChildTaskPlan>>(); | ||
| 2266 | try { | 2279 | try { |
| 2267 | 2280 | ||
| 2268 | String sql = "select * from bsth_c_s_sp_info_real where schedule_date_str" + | 2281 | String sql = "select * from bsth_c_s_sp_info_real where schedule_date_str" + |
| 2269 | " >= ? and schedule_date_str <= ? and xl_bm like ?" + | 2282 | " >= ? and schedule_date_str <= ? and xl_bm like ?" + |
| 2270 | " and fcsj >= ? and fcsj <= ? and gs_bm like ? and fgs_bm like ?" + | 2283 | " and fcsj >= ? and fcsj <= ? and gs_bm like ? and fgs_bm like ?" + |
| 2271 | " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; | 2284 | " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 2272 | - List<String> strList = new ArrayList<String>(); | ||
| 2273 | - strList.add(startDate); | ||
| 2274 | - strList.add(endDate); | ||
| 2275 | - strList.add('%' + line + '%'); | 2285 | + List<String> objList = new ArrayList<String>(); |
| 2286 | + objList.add(startDate); | ||
| 2287 | + objList.add(endDate); | ||
| 2288 | + objList.add('%' + line + '%'); | ||
| 2276 | if(sfqr == 1 && times.length() != 0){ | 2289 | if(sfqr == 1 && times.length() != 0){ |
| 2277 | String[] split = times.split("-"); | 2290 | String[] split = times.split("-"); |
| 2278 | - strList.add(split[0]); | ||
| 2279 | - strList.add(split[1]); | 2291 | + objList.add(split[0]); |
| 2292 | + objList.add(split[1]); | ||
| 2280 | } else { | 2293 | } else { |
| 2281 | - strList.add(""); | ||
| 2282 | - strList.add("23:59"); | 2294 | + objList.add(""); |
| 2295 | + objList.add("23:59"); | ||
| 2283 | } | 2296 | } |
| 2284 | - strList.add('%' + company + '%'); | ||
| 2285 | - strList.add('%' + subCompany + '%'); | 2297 | + objList.add('%' + company + '%'); |
| 2298 | + objList.add('%' + subCompany + '%'); | ||
| 2286 | 2299 | ||
| 2287 | - List<ScheduleRealInfo> query = jdbcTemplate.query(sql, strList.toArray(), | 2300 | + List<ScheduleRealInfo> query = jdbcTemplate.query(sql, objList.toArray(), |
| 2288 | new RowMapper<ScheduleRealInfo>(){ | 2301 | new RowMapper<ScheduleRealInfo>(){ |
| 2289 | @Override | 2302 | @Override |
| 2290 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | 2303 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 2291 | ScheduleRealInfo schedule = new ScheduleRealInfo(); | 2304 | ScheduleRealInfo schedule = new ScheduleRealInfo(); |
| 2305 | + schedule.setId(rs.getLong("id")); | ||
| 2292 | schedule.setScheduleDateStr(rs.getString("schedule_date_str")); | 2306 | schedule.setScheduleDateStr(rs.getString("schedule_date_str")); |
| 2293 | schedule.setXlBm(rs.getString("xl_bm")); | 2307 | schedule.setXlBm(rs.getString("xl_bm")); |
| 2294 | schedule.setXlName(rs.getString("xl_name")); | 2308 | schedule.setXlName(rs.getString("xl_name")); |
| @@ -2327,6 +2341,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2327,6 +2341,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2327 | return schedule; | 2341 | return schedule; |
| 2328 | } | 2342 | } |
| 2329 | }); | 2343 | }); |
| 2344 | + long schedule1 = 0l, schedule2 = 0l; | ||
| 2330 | for(ScheduleRealInfo s : query){ | 2345 | for(ScheduleRealInfo s : query){ |
| 2331 | if(line.length() != 0){ | 2346 | if(line.length() != 0){ |
| 2332 | if(!line.equals(s.getXlBm())){ | 2347 | if(!line.equals(s.getXlBm())){ |
| @@ -2334,7 +2349,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2334,7 +2349,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2334 | } | 2349 | } |
| 2335 | } | 2350 | } |
| 2336 | list.add(s); | 2351 | list.add(s); |
| 2352 | + | ||
| 2353 | + long id = s.getId(); | ||
| 2354 | + if(schedule1 == 0l || schedule1 > id) | ||
| 2355 | + schedule1 = id; | ||
| 2356 | + if(schedule2 == 0l || schedule2 < id) | ||
| 2357 | + schedule2 = id; | ||
| 2337 | } | 2358 | } |
| 2359 | + | ||
| 2360 | + cts = getChildTaskPlans(schedule1, schedule2); | ||
| 2361 | + | ||
| 2338 | }catch (Exception e) { | 2362 | }catch (Exception e) { |
| 2339 | // TODO: handle exception | 2363 | // TODO: handle exception |
| 2340 | e.printStackTrace(); | 2364 | e.printStackTrace(); |
| @@ -2379,6 +2403,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2379,6 +2403,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2379 | int sjbc = 0, sddf = 0, zddf = 0, | 2403 | int sjbc = 0, sddf = 0, zddf = 0, |
| 2380 | dxtz = 0, lbtz = 0; | 2404 | dxtz = 0, lbtz = 0; |
| 2381 | for(ScheduleRealInfo schedule : keyMap.get(key)){ | 2405 | for(ScheduleRealInfo schedule : keyMap.get(key)){ |
| 2406 | + if(cts.containsKey(schedule.getId())){ | ||
| 2407 | + schedule.setcTasks(cts.get(schedule.getId())); | ||
| 2408 | + } | ||
| 2382 | if(schedule.getGsName() != null && companyName.trim().length() == 0) | 2409 | if(schedule.getGsName() != null && companyName.trim().length() == 0) |
| 2383 | companyName = schedule.getGsName(); | 2410 | companyName = schedule.getGsName(); |
| 2384 | if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0) | 2411 | if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0) |
| @@ -2395,8 +2422,27 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2395,8 +2422,27 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2395 | else | 2422 | else |
| 2396 | sddf++; | 2423 | sddf++; |
| 2397 | } | 2424 | } |
| 2398 | - | ||
| 2399 | - | 2425 | + } else if(schedule.getStatus() == -1 && !schedule.isCcService()){ //(20231031)烂班班次,子任务如果有营运里程,视为实际班次。 |
| 2426 | + Set<ChildTaskPlan> childTaskPlans = schedule.getcTasks(); | ||
| 2427 | + if(!childTaskPlans.isEmpty()){ | ||
| 2428 | + Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | ||
| 2429 | + boolean b = false; | ||
| 2430 | + while (it.hasNext()) { | ||
| 2431 | + ChildTaskPlan c = it.next(); | ||
| 2432 | + if("service".equals(c.getMileageType()) && !c.isDestroy()){ | ||
| 2433 | + BigDecimal mileage = new BigDecimal(c.getMileage()); | ||
| 2434 | + if(mileage.compareTo(BigDecimal.ZERO) == 1){ //大于0 | ||
| 2435 | + b = true; | ||
| 2436 | + } | ||
| 2437 | + } | ||
| 2438 | + if(b){ | ||
| 2439 | + break; | ||
| 2440 | + } | ||
| 2441 | + } | ||
| 2442 | + if(b){ | ||
| 2443 | + sjbc++; | ||
| 2444 | + } | ||
| 2445 | + } | ||
| 2400 | } | 2446 | } |
| 2401 | if(schedule.getStatus() == -1){ | 2447 | if(schedule.getStatus() == -1){ |
| 2402 | flag = true; | 2448 | flag = true; |
| @@ -3047,14 +3093,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3047,14 +3093,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3047 | "where schedule_date_str >= ? and schedule_date_str <= ? " + | 3093 | "where schedule_date_str >= ? and schedule_date_str <= ? " + |
| 3048 | "and gs_bm like ? and fgs_bm like ? and xl_bm like ? " + | 3094 | "and gs_bm like ? and fgs_bm like ? and xl_bm like ? " + |
| 3049 | "and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and cc_service = 0"; | 3095 | "and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and cc_service = 0"; |
| 3050 | - List<String> strList = new ArrayList<String>(); | ||
| 3051 | - strList.add(startDate); | ||
| 3052 | - strList.add(endDate); | ||
| 3053 | - strList.add('%' + company + '%'); | ||
| 3054 | - strList.add('%' + subCompany + '%'); | ||
| 3055 | - strList.add('%' + line + '%'); | 3096 | + List<String> objList = new ArrayList<String>(); |
| 3097 | + objList.add(startDate); | ||
| 3098 | + objList.add(endDate); | ||
| 3099 | + objList.add('%' + company + '%'); | ||
| 3100 | + objList.add('%' + subCompany + '%'); | ||
| 3101 | + objList.add('%' + line + '%'); | ||
| 3056 | 3102 | ||
| 3057 | - List<ScheduleRealInfo> query = jdbcTemplate.query(sql, strList.toArray(), | 3103 | + List<ScheduleRealInfo> query = jdbcTemplate.query(sql, objList.toArray(), |
| 3058 | new RowMapper<ScheduleRealInfo>(){ | 3104 | new RowMapper<ScheduleRealInfo>(){ |
| 3059 | @Override | 3105 | @Override |
| 3060 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { | 3106 | public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { |