wenminjie
2026-08-06 02c7bf03fa071325c201d29353330152d35ac71a
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; }