Commit 5eb19a0c2d3c1ebacde393cd5b911a1f00c5811e

Authored by 娄高锋
1 parent 7dfd8bc8

以分公司编码分组

src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -306,10 +306,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
306 306 String sql = "select id,cc_id,mileage_type,destroy,destroy_reason," +
307 307 " mileage,type1,type2,schedule from bsth_c_s_child_task" +
308 308 " where 1=1";
309   - if(schedule1 != null && schedule1 > 0){
  309 + if(schedule1 != null && schedule1 >= 0){
310 310 sql += " and schedule >= '"+schedule1+"'";
311 311 }
312   - if(schedule2 != null && schedule2 > 0){
  312 + if(schedule2 != null && schedule2 >= 0){
313 313 sql += " and schedule <= '"+schedule2+"'";
314 314 }
315 315  
... ... @@ -520,9 +520,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
520 520 continue;
521 521 Map<String, List<ScheduleRealInfo>> keyMap2 = new HashMap<String, List<ScheduleRealInfo>>();
522 522 for(ScheduleRealInfo schedule : keyMap.get(key)){
523   - if(companyName.length() == 0 && schedule.getGsName() != null)
  523 + if(companyName.trim().length() == 0 && schedule.getGsName() != null)
524 524 companyName = schedule.getGsName();
525   - if(subCompanyName.length() == 0 && schedule.getFgsName() != null)
  525 + if(subCompanyName.trim().length() == 0 && schedule.getFgsName() != null)
526 526 subCompanyName = schedule.getFgsName();
527 527 String date = schedule.getScheduleDateStr();
528 528 if(!keyMap2.containsKey(date))
... ... @@ -1061,7 +1061,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1061 1061 continue;
1062 1062 }
1063 1063 String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/"
1064   - + schedule.getLpName() + "/" + schedule.getFgsName();
  1064 + + schedule.getLpName() + "/" + schedule.getFgsBm();
1065 1065 if(model.length() != 0){
1066 1066 if(ttSet.contains(schedule.getSpId())){
1067 1067 if(!keyMap.containsKey(key))
... ... @@ -1099,10 +1099,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1099 1099 long jhyssj1 = 0, sjyssj1 = 0;
1100 1100 double jhlc = 0, sjlc = 0;
1101 1101 for(ScheduleRealInfo schedule : list2){
1102   - if(companyName.length() == 0 && schedule.getGsName() != null){
  1102 + if(companyName.trim().length() == 0 && schedule.getGsName() != null){
1103 1103 companyName = schedule.getGsName();
1104 1104 }
1105   - if(subCompanyName.length() == 0 && schedule.getFgsName() != null){
  1105 + if(subCompanyName.trim().length() == 0 && schedule.getFgsName() != null){
1106 1106 subCompanyName = schedule.getFgsName();
1107 1107 }
1108 1108 long fcsj = schedule.getFcsjT();
... ... @@ -1887,7 +1887,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1887 1887 continue;
1888 1888 }
1889 1889  
1890   - String key = schedule.getXlName() + "/" + schedule.getFgsName();
  1890 + String key = schedule.getXlName() + "/" + schedule.getFgsBm();
1891 1891 if(!keyMap.containsKey(key))
1892 1892 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
1893 1893 keyMap.get(key).add(schedule);
... ... @@ -1978,9 +1978,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1978 1978 qtlc = new BigDecimal("0");
1979 1979 String companyName = "", subCompanyName = "";
1980 1980 for(ScheduleRealInfo schedule : keyMap.get(key)){
1981   - if(schedule.getGsName() != null && companyName.length() == 0)
  1981 + if(schedule.getGsName() != null && companyName.trim().length() == 0)
1982 1982 companyName = schedule.getGsName();
1983   - if(schedule.getFgsName() != null && subCompanyName.length() == 0)
  1983 + if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0)
1984 1984 subCompanyName = schedule.getFgsName();
1985 1985 BigDecimal lc = new BigDecimal("0");
1986 1986 if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){
... ... @@ -2071,7 +2071,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2071 2071 String[] keys = key.split("/");
2072 2072 tempMap.put("date", Date);
2073 2073 tempMap.put("company", companyName);
2074   - tempMap.put("subCompany", keys[1]);
  2074 + tempMap.put("subCompany", subCompanyName);
  2075 +// tempMap.put("subCompany", keys[1]);
2075 2076 tempMap.put("times", sfqr == 1 ? times : "全日");
2076 2077 tempMap.put("line", keys[0]);
2077 2078 tempMap.put("jhbc", jhbc);
... ... @@ -2338,17 +2339,23 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2338 2339 continue;
2339 2340 }
2340 2341  
2341   - String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlBm();
  2342 + String key = schedule.getGsBm() + "/" + schedule.getFgsBm() + "/" + schedule.getXlBm();
2342 2343 if(!keyMap.containsKey(key))
2343 2344 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
2344 2345 keyMap.get(key).add(schedule);
2345 2346 }
  2347 +
2346 2348 for(String key : keyMap.keySet()){
  2349 + String companyName = "", subCompanyName = "";
2347 2350 Map<String, Object> tempMap = new HashMap<String, Object>();
2348 2351 List<ScheduleRealInfo> tempList = new ArrayList<ScheduleRealInfo>();
2349 2352 int sjbc = 0, sddf = 0, zddf = 0,
2350 2353 dxtz = 0, lbtz = 0;
2351 2354 for(ScheduleRealInfo schedule : keyMap.get(key)){
  2355 + if(schedule.getGsName() != null && companyName.trim().length() == 0)
  2356 + companyName = schedule.getGsName();
  2357 + if(schedule.getFgsName() != null && subCompanyName.trim().length() == 0)
  2358 + subCompanyName = schedule.getFgsName();
2352 2359 boolean flag = false;
2353 2360 if(schedule.getFcsjActual() != null && schedule.getZdsjActual() != null
2354 2361 && schedule.getStatus() != -1 && !schedule.isCcService()){
... ... @@ -2373,8 +2380,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2373 2380 }
2374 2381 tempMap.put("date", date);
2375 2382 String[] keys = key.split("/");
2376   - tempMap.put("company", keys[0]);
2377   - tempMap.put("subCompany", keys[1]);
  2383 + tempMap.put("company", companyName);
  2384 + tempMap.put("subCompany", subCompanyName);
  2385 +// tempMap.put("company", keys[0]);
  2386 +// tempMap.put("subCompany", keys[1]);
2378 2387 tempMap.put("line", keys[2]);
2379 2388 tempMap.put("sjbc", sjbc);
2380 2389 tempMap.put("sddf", sddf);
... ... @@ -3108,7 +3117,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3108 3117 continue;
3109 3118 }
3110 3119  
3111   - String xl = s.getXlName() + "/" + s.getFgsName();
  3120 + String xl = s.getXlName() + "/" + s.getFgsBm();
3112 3121 String dateStr = s.getScheduleDateStr();
3113 3122 if(!sches.containsKey(xl)){
3114 3123 sches.put(xl, new HashMap<String, List<ScheduleRealInfo>>());
... ... @@ -3138,12 +3147,19 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3138 3147 List<List<Map<String, Object>>> lists = new ArrayList<List<Map<String, Object>>>();
3139 3148 Map<Long, ScheduleRealInfo> keyTemp = new HashMap<Long, ScheduleRealInfo>();
3140 3149 for(Long time : timeList){
  3150 + String companyName = "", subCompanyName = "";
3141 3151 List<Long> keyList = new ArrayList<Long>();
3142 3152 String date = timeTemp.get(time);
3143 3153 List<ScheduleRealInfo> sche2 = sche1.get(date);
3144 3154 for(ScheduleRealInfo s : sche2){
3145 3155 if(s.getFcsj()!=null && s.getFcsj().trim().length() > 0
3146 3156 && s.getFcsj().contains(":")){
  3157 +
  3158 + if(s.getGsName() != null && companyName.trim().length() == 0)
  3159 + companyName = s.getGsName();
  3160 + if(s.getFgsName() != null && subCompanyName.trim().length() == 0)
  3161 + subCompanyName = s.getFgsName();
  3162 +
3147 3163 String[] split = s.getFcsj().split(":");
3148 3164 Long key = Long.valueOf(s.getXlDir())*1500 + Long.valueOf(split[0])*60 + Long.valueOf(split[1]);
3149 3165 while(keyTemp.containsKey(key)){
... ... @@ -3158,8 +3174,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3158 3174 for(Long l : keyList){
3159 3175 ScheduleRealInfo s = keyTemp.get(l);
3160 3176 Map<String, Object> temp = new HashMap<String, Object>();
3161   - temp.put("gs", s.getGsName());
3162   - temp.put("fgs", s.getFgsName());
  3177 + temp.put("gs", companyName);
  3178 + temp.put("fgs", subCompanyName);
  3179 +// temp.put("gs", s.getGsName());
  3180 +// temp.put("fgs", s.getFgsName());
3163 3181 temp.put("fgsBm", s.getFgsBm());
3164 3182 temp.put("date", date);
3165 3183 temp.put("xlbm", s.getXlBm());
... ...