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