Commit a4df684a6013a95fb74f6f1a5c6ebec0ae055ade

Authored by 廖磊
2 parents 952886fc bf2b6a97

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
@@ -187,17 +187,9 @@ public class ScheduleModifyLogger { @@ -187,17 +187,9 @@ public class ScheduleModifyLogger {
187 String newNbbm = cpc.getClZbh(); 187 String newNbbm = cpc.getClZbh();
188 String newJsy = cpc.getJsy(); 188 String newJsy = cpc.getJsy();
189 String newSpy = cpc.getSpy(); 189 String newSpy = cpc.getSpy();
190 - //String oldJsy = sch.getjGh() + "/" + sch.getjName();  
191 190
192 if (newNbbm == null && newJsy == null && newSpy==null) 191 if (newNbbm == null && newJsy == null && newSpy==null)
193 return; 192 return;
194 - /*if (newNbbm != null && newJsy != null  
195 - && newNbbm.equals(sch.getClZbh()) && newJsy.equals(oldJsy))  
196 - return;*/  
197 -  
198 -  
199 - SchEditInfo sei = SchEditInfo.getInstance(sch);  
200 - sei.setType(EditType.TZRC);  
201 193
202 //detail 194 //detail
203 JSONObject jobj = new JSONObject(); 195 JSONObject jobj = new JSONObject();
@@ -213,11 +205,22 @@ public class ScheduleModifyLogger { @@ -213,11 +205,22 @@ public class ScheduleModifyLogger {
213 } 205 }
214 206
215 String oldSpy = sch.getsGh() + "/" + sch.getsName(); 207 String oldSpy = sch.getsGh() + "/" + sch.getsName();
216 - if (StringUtils.isNotEmpty(newSpy) && !newSpy.equals(oldSpy)) {  
217 - jobj.put("old_spy", oldSpy);  
218 - jobj.put("now_spy", cpc.getSpy()); 208 + if(newSpy != null){
  209 + if(newSpy.equals(""))
  210 + newSpy = "/";
  211 +
  212 + if(!newSpy.equals(oldSpy)){
  213 + jobj.put("old_spy", oldSpy);
  214 + jobj.put("now_spy", newSpy);
  215 + }
219 } 216 }
220 217
  218 + if(jobj.size() == 0)
  219 + return;
  220 +
  221 + SchEditInfo sei = SchEditInfo.getInstance(sch);
  222 + sei.setType(EditType.TZRC);
  223 +
221 sei.setJsonArray(jobj.toJSONString()); 224 sei.setJsonArray(jobj.toJSONString());
222 put(sei); 225 put(sei);
223 } catch (Exception e) { 226 } catch (Exception e) {
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -244,6 +244,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -244,6 +244,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
244 schedule.setBcType(bcType); 244 schedule.setBcType(bcType);
245 } 245 }
246 246
  247 + //如果正在执行该班次
  248 + ScheduleRealInfo exec = dayOfSchedule.executeCurr(schedule.getClZbh());
  249 + if(exec != null && exec == schedule){
  250 + //重新计算正在执行班次
  251 + dayOfSchedule.reCalcExecPlan(schedule.getClZbh());
  252 + }
  253 +
247 //重新计算是否误点 254 //重新计算是否误点
248 schedule.reCalcLate(); 255 schedule.reCalcLate();
249 //取消应发未到标记,不再自动调整待发 256 //取消应发未到标记,不再自动调整待发
@@ -3282,8 +3289,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3282,8 +3289,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3282 3289
3283 if (StringUtils.isNotEmpty(cpc.getJsy())) { 3290 if (StringUtils.isNotEmpty(cpc.getJsy())) {
3284 //换驾驶员 3291 //换驾驶员
3285 - persoChange(sch, jGh);  
3286 - set.add(sch); 3292 + if(persoChange(sch, jGh))
  3293 + set.add(sch);
3287 } 3294 }
3288 3295
3289 //换售票员 3296 //换售票员
@@ -3295,8 +3302,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3295,8 +3302,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3295 rs.put("status", ResponseCode.ERROR); 3302 rs.put("status", ResponseCode.ERROR);
3296 return rs; 3303 return rs;
3297 } 3304 }
3298 - persoChangeSPY(sch, sGh);  
3299 - set.add(sch); 3305 + if(persoChangeSPY(sch, sGh))
  3306 + set.add(sch);
3300 } 3307 }
3301 else if(StringUtils.isNotEmpty(sch.getsGh())){ 3308 else if(StringUtils.isNotEmpty(sch.getsGh())){
3302 sch.setsGh(""); 3309 sch.setsGh("");
@@ -3304,12 +3311,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3304,12 +3311,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3304 } 3311 }
3305 3312
3306 //换车 3313 //换车
3307 - if (StringUtils.isNotEmpty(cpc.getClZbh())) { 3314 + if (StringUtils.isNotEmpty(cpc.getClZbh()) && !cpc.getClZbh().equals(sch.getClZbh())) {
3308 set.add(sch); 3315 set.add(sch);
3309 set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh())); 3316 set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh()));
3310 } 3317 }
3311 3318
3312 dayOfSchedule.save(sch); 3319 dayOfSchedule.save(sch);
  3320 + set.add(sch);
3313 3321
3314 } 3322 }
3315 rs.put("ts", set); 3323 rs.put("ts", set);
@@ -3321,9 +3329,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3321,9 +3329,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3321 * @Title: persoChange 3329 * @Title: persoChange
3322 * @Description: TODO(班次换驾驶员) 3330 * @Description: TODO(班次换驾驶员)
3323 */ 3331 */
3324 - public void persoChange(ScheduleRealInfo sch, String jGh) { 3332 + public boolean persoChange(ScheduleRealInfo sch, String jGh) {
3325 if (sch.getjGh().equals(jGh)) 3333 if (sch.getjGh().equals(jGh))
3326 - return; 3334 + return false;
3327 String jName = getPersonName(sch.getGsBm() , jGh); 3335 String jName = getPersonName(sch.getGsBm() , jGh);
3328 if (StringUtils.isNotEmpty(jName)) { 3336 if (StringUtils.isNotEmpty(jName)) {
3329 3337
@@ -3333,16 +3341,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3333,16 +3341,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3333 sch.setjGh(jGh); 3341 sch.setjGh(jGh);
3334 3342
3335 sch.setjName(jName); 3343 sch.setjName(jName);
  3344 + return true;
3336 } 3345 }
  3346 + return false;
3337 } 3347 }
3338 3348
3339 /** 3349 /**
3340 * @Title: persoChange 3350 * @Title: persoChange
3341 * @Description: TODO(班次换售票员) 3351 * @Description: TODO(班次换售票员)
3342 */ 3352 */
3343 - public void persoChangeSPY(ScheduleRealInfo sch, String sGh) { 3353 + public boolean persoChangeSPY(ScheduleRealInfo sch, String sGh) {
3344 if (sch.getsGh().equals(sGh)) 3354 if (sch.getsGh().equals(sGh))
3345 - return; 3355 + return false;
3346 String sName = getPersonName(sch.getGsBm() , sGh); 3356 String sName = getPersonName(sch.getGsBm() , sGh);
3347 if (StringUtils.isNotEmpty(sName)) { 3357 if (StringUtils.isNotEmpty(sName)) {
3348 if (sGh.indexOf("-") != -1) 3358 if (sGh.indexOf("-") != -1)
@@ -3350,7 +3360,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3350,7 +3360,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3350 else 3360 else
3351 sch.setsGh(sGh); 3361 sch.setsGh(sGh);
3352 sch.setsName(sName); 3362 sch.setsName(sName);
  3363 + return true;
3353 } 3364 }
  3365 + return false;
3354 } 3366 }
3355 3367
3356 /** 3368 /**