空运协同里手工改费用、有起运地、锁舱失败或缺参会被误判,报价单已出后再激活又重发模板。按销售侧口径收紧这些分支,并让价格卡和未成交回执带上真实工单号。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -493,6 +493,40 @@ def effective_quote(tms: dict[str, Any] | None, overlay: dict[str, Any] | None)
|
||||
return out
|
||||
|
||||
|
||||
def text_has_relative_adjust(text: str) -> bool:
|
||||
"""
|
||||
这句话是在按比例改价:加10%、减5%、上调、上浮、加一成。
|
||||
|
||||
这种是销售调价,不是航线/产品报一个新金额。不打模型。
|
||||
"""
|
||||
raw = text or ""
|
||||
if _PERCENT_UP.search(raw) or _PERCENT_DOWN.search(raw):
|
||||
return True
|
||||
blob = raw.replace(" ", "").replace(" ", "")
|
||||
return any(phrase in blob for phrase in ("加一成", "减一成", "往上抬", "往下压", "上浮", "下浮"))
|
||||
|
||||
|
||||
def text_has_total_only_adjust(text: str) -> bool:
|
||||
"""
|
||||
只动总价/总销售价/费用合计,没有点名某一项费用。
|
||||
|
||||
「总销售价改为180」仍是销售调价。点了「空运费」「报关费」则不是。不打模型。
|
||||
"""
|
||||
raw = text or ""
|
||||
if not (_TARGET.search(raw) or _PERCENT_UP.search(raw) or _PERCENT_DOWN.search(raw)):
|
||||
return False
|
||||
if not any(word in raw for word in _TOTAL_WORDS) and "报价" not in raw:
|
||||
return False
|
||||
real: list[str] = []
|
||||
for name in _FEE_TOKEN.findall(raw):
|
||||
if name in {"费用", "费用合计"}:
|
||||
continue
|
||||
if any(word in name for word in ("合计", "总价", "汇总")):
|
||||
continue
|
||||
real.append(name)
|
||||
return not real
|
||||
|
||||
|
||||
def extract_adjust(
|
||||
text: str,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user