|
@@ -527,6 +527,35 @@ public class WODispatchPlanTmDoBizFun {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //TODO 修改计划增加线程锁
|
|
|
+ public static ResponseCode updatePlanClock(JPDispatchPlanInfoUpdate oJsonParam){
|
|
|
+ ResponseCode code = ResponseCode.RESULT_BAD;
|
|
|
+ if (oJsonParam==null)
|
|
|
+ return code;
|
|
|
+
|
|
|
+ CountDownLatchEx latchEx = null;
|
|
|
+ int nRetry = 3;
|
|
|
+ do {
|
|
|
+ try {
|
|
|
+ latchEx = WODispatchPlanLockMgr.tryLatchForPlan(oJsonParam.getPlanId(), 20000);
|
|
|
+ }catch (Exception e){
|
|
|
+ latchEx = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (latchEx != null){
|
|
|
+ code = updatePlan(oJsonParam);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }while ((--nRetry) > 0);
|
|
|
+
|
|
|
+ if (latchEx != null){
|
|
|
+ latchEx.countDown();
|
|
|
+ }else{
|
|
|
+ code = updatePlan(oJsonParam);
|
|
|
+ }
|
|
|
+ return code;
|
|
|
+ }
|
|
|
+
|
|
|
//TODO 修改计划
|
|
|
public static ResponseCode updatePlan(JPDispatchPlanInfoUpdate oJsonParam){
|
|
|
try {
|