From 02c7bf03fa071325c201d29353330152d35ac71a Mon Sep 17 00:00:00 2001
From: wenminjie <1036699586@qq.com>
Date: 星期四, 06 八月 2026 18:16:02 +0800
Subject: [PATCH] 小程序对接
---
talent-card-server/src/main/java/com/talentcard/server/service/CarWashBenefitManagementService.java | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/talent-card-server/src/main/java/com/talentcard/server/service/CarWashBenefitManagementService.java b/talent-card-server/src/main/java/com/talentcard/server/service/CarWashBenefitManagementService.java
index 8c2fe35..93f55af 100644
--- a/talent-card-server/src/main/java/com/talentcard/server/service/CarWashBenefitManagementService.java
+++ b/talent-card-server/src/main/java/com/talentcard/server/service/CarWashBenefitManagementService.java
@@ -120,8 +120,7 @@
primaryCardId = longValue(primary, "primaryCardId");
cardLevel = text(primary, "cardLevel");
}
- List<String> files = request.proofFiles().stream().map(this::clean).filter(v -> !v.isBlank()).distinct().toList();
- if (files.isEmpty()) throw new BusinessException(ErrorCode.BAD_REQUEST, "请上传洗车凭证或消费截图");
+ List<String> files = request.proofFiles() == null ? List.of() : request.proofFiles().stream().map(this::clean).filter(v -> !v.isBlank()).distinct().toList();
for (String file : files) {
if (!(file.startsWith("/uploads/") || file.startsWith("https://"))) {
throw new BusinessException(ErrorCode.BAD_REQUEST, "凭证文件地址不正确");
@@ -306,7 +305,8 @@
}
private void requireMerchant(Long merchantId) {
- if (merchantId == null || merchantId <= 0 || number(configMapper.countCarWashMerchant(merchantId)).longValue() == 0) throw new BusinessException(ErrorCode.NOT_FOUND, "洗车商家不存在");
+ if (merchantId == null || merchantId <= 0 || number(configMapper.countCarWashMerchant(merchantId)).longValue() == 0)
+ throw new BusinessException(ErrorCode.NOT_FOUND, "洗车商家不存在");
}
private void validateStatus(Integer status) { if (status != null && (status < 0 || status > 3)) throw new BusinessException(ErrorCode.BAD_REQUEST, "洗车凭证状态不正确"); }
private Number number(Object value) { return value instanceof Number number ? number : 0L; }
--
Gitblit v1.7.1