fix: drop 付款确认中 from sample payment progressStatus

Sample-level 缴费进度 is now only 待缴费 / 部分已缴 / 已缴清.
Transfer jfqrz still blocks canConfirm but no longer surfaces as progress.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-10-12 18:26:36 +08:00
1 parent cc0b217c89
commit af992b5680
6 files changed
+25 -15

No files matched your search

@@ -25,9 +25,9 @@ def compute_sample_payment_progress(
transfers: Iterable[Mapping[str, Any]],
) -> Dict[str, Any]:
"""
progressStatus 优先级:jfqrz > yjq > bfyj > dfj
progressStatus 优先级:yjq > bfyj > dfj(不含付款确认中)
已缴仅计 pay_status=yjf;有效期排除 schedule_status=void
canConfirm:无 jfqrz,且存在有效未清期(欠缴>0)或可编辑的 dfj 草稿
canConfirm:无 jfqrz,且存在有效未清期
"""
sch_list: List[Mapping[str, Any]] = list(schedules or [])
tr_list: List[Mapping[str, Any]] = list(transfers or [])
@@ -59,9 +59,7 @@ def compute_sample_payment_progress(
has_jfqrz = any(_status(t, "payStatus", "pay_status") == "jfqrz" for t in tr_list)
if has_jfqrz:
progress = "jfqrz"
elif active_schedule_count > 0 and cleared_schedule_count == active_schedule_count:
if active_schedule_count > 0 and cleared_schedule_count == active_schedule_count:
progress = "yjq"
elif paid > 0:
progress = "bfyj"
+17 -2
View File
@@ -23,7 +23,8 @@ class TestSamplePaymentProgress(unittest.TestCase):
self.assertEqual(r["activeScheduleCount"], 1)
self.assertTrue(r["canConfirm"])
def test_confirming_wins_over_partial(self):
def test_confirming_does_not_set_progress_status(self):
"""付款确认中不再作为样本缴费进度;有 yjf 则部分已缴,仍不可再提交确认。"""
r = compute_sample_payment_progress(
schedules=[
{"id": "s1", "scheduleStatus": "open", "dueAmount": Decimal("1000")},
@@ -33,10 +34,24 @@ class TestSamplePaymentProgress(unittest.TestCase):
{"scheduleId": "s1", "payStatus": "jfqrz", "transferAmount": Decimal("100")},
],
)
self.assertEqual(r["progressStatus"], "jfqrz")
self.assertEqual(r["progressStatus"], "bfyj")
self.assertEqual(r["paidAmount"], Decimal("200"))
self.assertFalse(r["canConfirm"])
def test_confirming_only_stays_pending(self):
"""仅有付款确认中、尚无 yjf 时,缴费进度仍为待缴费。"""
r = compute_sample_payment_progress(
schedules=[
{"id": "s1", "scheduleStatus": "open", "dueAmount": Decimal("1000")},
],
transfers=[
{"scheduleId": "s1", "payStatus": "jfqrz", "transferAmount": Decimal("100")},
],
)
self.assertEqual(r["progressStatus"], "dfj")
self.assertEqual(r["paidAmount"], Decimal("0"))
self.assertFalse(r["canConfirm"])
def test_partial_paid(self):
r = compute_sample_payment_progress(
schedules=[