diff --git a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java index f2b68def..a93393e2 100644 --- a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java @@ -231,6 +231,23 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { return ErrorCode.ERR_OK; } + /** + * Gets traction strategy format. + * + * @param disposeObject the dispose object + * @return the traction strategy format + */ + private String getTractionStrategyFormat(String disposeObject) { + // 根据 - / 字符进行分割字符串 + String[] ret = disposeObject.replaceAll("/", "-").split("-"); + + if(ret.length == 0) { + return disposeObject; + } else { + return ret[0] + "-" + ret[0]; + } + } + /** * Create traction strategy error code. * @@ -257,7 +274,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { // 创建旁路手动牵引策略 ret = getCleanTypePort().addBypassManualTractionStrategyForUMC(tractionName, objName, - disposeObject); + getTractionStrategyFormat(disposeObject)); if (ret.getResultRetVal() == 0) { log.debug("----Finish Create Traction Strategy {} Succeed", tractionName); return ErrorCode.ERR_OK;