From 40dd0e9898bf2a88e51d497c46d826ea8f7326f4 Mon Sep 17 00:00:00 2001
From: shinnosuke <tantao@1hoper.com>
Date: 星期四, 20 八月 2026 09:37:15 +0800
Subject: [PATCH] fix: connect premium merchants and restrict approval PDFs

---
 talent-card-server/src/main/java/com/talentcard/server/business/portal/CarWashMerchantPortalService.java |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/talent-card-server/src/main/java/com/talentcard/server/business/portal/CarWashMerchantPortalService.java b/talent-card-server/src/main/java/com/talentcard/server/business/portal/CarWashMerchantPortalService.java
index 4338ada..270e1fc 100644
--- a/talent-card-server/src/main/java/com/talentcard/server/business/portal/CarWashMerchantPortalService.java
+++ b/talent-card-server/src/main/java/com/talentcard/server/business/portal/CarWashMerchantPortalService.java
@@ -41,9 +41,9 @@
 		Map<String, Object> merchant = one("""
 				select id, merchant_name, contact_mobile, address, cover_url, service_label, rights_text, merchant_rights_config, status
 				from merchant
-				where id = ? and merchant_type in ('carWash', '自主洗车', '自助洗车') and deleted = 0
+				where id = ? and merchant_type in ('carWash', '自主洗车', '自助洗车', '自助洗车服务') and deleted = 0
 				""", merchantId);
-		Map<String, Object> service = one("""
+		List<Map<String, Object>> serviceRows = query("""
 				select id, talent_levels, service_point_text, tip_text, external_link_type,
 				       external_mini_program_app_id, external_mini_program_path, external_web_url,
 				       unavailable_reason, status
@@ -51,12 +51,13 @@
 				where merchant_id = ? and deleted = 0
 				order by id asc limit 1
 				""", merchantId);
+		Map<String, Object> service = serviceRows.isEmpty() ? Map.of() : serviceRows.get(0);
 		String cardLevel = talentCardId == null ? "" : talentCardLevel(talentCardId);
 		List<Map<String, Object>> rights = parseList(merchant.get("merchantRightsConfig"));
 		Map<String, Object> right = matchingRight(rights, cardLevel);
 		boolean hasCardRightsConfig = !rights.isEmpty() && !cardLevel.isBlank();
 		boolean available = number(merchant.get("status")) == 1
-				&& number(service.get("status")) == 1
+				&& (serviceRows.isEmpty() || number(service.get("status")) == 1)
 				&& (!hasCardRightsConfig || right != null)
 				&& (right == null || booleanValue(right.get("enabled")));
 		Map<String, Object> result = new LinkedHashMap<>();

--
Gitblit v1.7.1