Commit 823eff71f5a97fd8a79d15ba83e95af32da469ce

Authored by 潘钊
1 parent 007e569f

update...

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
@@ -3222,8 +3222,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3222,8 +3222,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3222 3222
3223 if (StringUtils.isNotEmpty(cpc.getJsy())) { 3223 if (StringUtils.isNotEmpty(cpc.getJsy())) {
3224 //换驾驶员 3224 //换驾驶员
3225 - persoChange(sch, jGh);  
3226 - set.add(sch); 3225 + if(persoChange(sch, jGh))
  3226 + set.add(sch);
3227 } 3227 }
3228 3228
3229 //换售票员 3229 //换售票员
@@ -3235,8 +3235,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3235,8 +3235,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3235 rs.put("status", ResponseCode.ERROR); 3235 rs.put("status", ResponseCode.ERROR);
3236 return rs; 3236 return rs;
3237 } 3237 }
3238 - persoChangeSPY(sch, sGh);  
3239 - set.add(sch); 3238 + if(persoChangeSPY(sch, sGh))
  3239 + set.add(sch);
3240 } 3240 }
3241 else if(StringUtils.isNotEmpty(sch.getsGh())){ 3241 else if(StringUtils.isNotEmpty(sch.getsGh())){
3242 sch.setsGh(""); 3242 sch.setsGh("");
@@ -3244,12 +3244,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3244,12 +3244,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3244 } 3244 }
3245 3245
3246 //换车 3246 //换车
3247 - if (StringUtils.isNotEmpty(cpc.getClZbh())) { 3247 + if (StringUtils.isNotEmpty(cpc.getClZbh()) && !cpc.getClZbh().equals(sch.getClZbh())) {
3248 set.add(sch); 3248 set.add(sch);
3249 set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh())); 3249 set.addAll(dayOfSchedule.changeCar(sch, cpc.getClZbh()));
3250 } 3250 }
3251 3251
3252 dayOfSchedule.save(sch); 3252 dayOfSchedule.save(sch);
  3253 + set.add(sch);
3253 3254
3254 } 3255 }
3255 rs.put("ts", set); 3256 rs.put("ts", set);
@@ -3261,9 +3262,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3261,9 +3262,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3261 * @Title: persoChange 3262 * @Title: persoChange
3262 * @Description: TODO(班次换驾驶员) 3263 * @Description: TODO(班次换驾驶员)
3263 */ 3264 */
3264 - public void persoChange(ScheduleRealInfo sch, String jGh) { 3265 + public boolean persoChange(ScheduleRealInfo sch, String jGh) {
3265 if (sch.getjGh().equals(jGh)) 3266 if (sch.getjGh().equals(jGh))
3266 - return; 3267 + return false;
3267 String jName = getPersonName(sch.getGsBm() , jGh); 3268 String jName = getPersonName(sch.getGsBm() , jGh);
3268 if (StringUtils.isNotEmpty(jName)) { 3269 if (StringUtils.isNotEmpty(jName)) {
3269 3270
@@ -3273,16 +3274,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3273,16 +3274,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3273 sch.setjGh(jGh); 3274 sch.setjGh(jGh);
3274 3275
3275 sch.setjName(jName); 3276 sch.setjName(jName);
  3277 + return true;
3276 } 3278 }
  3279 + return false;
3277 } 3280 }
3278 3281
3279 /** 3282 /**
3280 * @Title: persoChange 3283 * @Title: persoChange
3281 * @Description: TODO(班次换售票员) 3284 * @Description: TODO(班次换售票员)
3282 */ 3285 */
3283 - public void persoChangeSPY(ScheduleRealInfo sch, String sGh) { 3286 + public boolean persoChangeSPY(ScheduleRealInfo sch, String sGh) {
3284 if (sch.getsGh().equals(sGh)) 3287 if (sch.getsGh().equals(sGh))
3285 - return; 3288 + return false;
3286 String sName = getPersonName(sch.getGsBm() , sGh); 3289 String sName = getPersonName(sch.getGsBm() , sGh);
3287 if (StringUtils.isNotEmpty(sName)) { 3290 if (StringUtils.isNotEmpty(sName)) {
3288 if (sGh.indexOf("-") != -1) 3291 if (sGh.indexOf("-") != -1)
@@ -3290,7 +3293,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf @@ -3290,7 +3293,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf
3290 else 3293 else
3291 sch.setsGh(sGh); 3294 sch.setsGh(sGh);
3292 sch.setsName(sName); 3295 sch.setsName(sName);
  3296 + return true;
3293 } 3297 }
  3298 + return false;
3294 } 3299 }
3295 3300
3296 /** 3301 /**