| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.talentcard.server.business.PageResult; |
| | | import com.talentcard.server.business.merchant.MerchantTypeCatalog; |
| | | import com.talentcard.server.common.BusinessException; |
| | | import com.talentcard.server.common.ErrorCode; |
| | | import com.talentcard.server.entity.BenefitFamilyCardApplication; |
| | |
| | | List<String> aliases = cardLevelAliases(card.cardLevel()); |
| | | List<Map<String, Object>> records = merchantMapper.selectPortalPage( |
| | | aliases, |
| | | clean(merchantType), |
| | | merchantTypeCode(merchantType), |
| | | clean(keyword), |
| | | safeSize, |
| | | (safePage - 1) * safeSize |
| | | ).stream().map(row -> portalView(row, card)).toList(); |
| | | Long total = merchantMapper.countPortalPage(aliases, clean(merchantType), clean(keyword)); |
| | | Long total = merchantMapper.countPortalPage(aliases, merchantTypeCode(merchantType), clean(keyword)); |
| | | return new PageResult<>(records, safePage, safeSize, total == null ? 0 : total); |
| | | } |
| | | |
| | |
| | | return portalView(row, card); |
| | | } |
| | | |
| | | private String merchantTypeCode(String value) { |
| | | String cleaned = clean(value); |
| | | return cleaned.isBlank() ? "" : MerchantTypeCatalog.canonicalCode(cleaned); |
| | | } |
| | | |
| | | @Transactional |
| | | public Map<String, Object> recordEvent(Long merchantId, MerchantDisplayPolicyEventRequest request) { |
| | | Long id = requireMerchantId(merchantId); |