shinnosuke
2026-08-10 bcc676cbf904490900b2603c6dfb0f5cf21e9c4f
fix(portal): 商品列表展示人才权益价
4个文件已修改
27 ■■■■■ 已修改文件
rencaika/pages/merchant/merchant.uvue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rencaika/services/portal.uts 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/portal/PortalController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
talent-card-server/src/main/java/com/talentcard/server/business/portal/PortalService.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rencaika/pages/merchant/merchant.uvue
@@ -518,7 +518,7 @@
            return
        }
        if (isApiConfigured() && /^\d+$/.test(merchantId.value) && !isMedicalMerchant.value && !isTransportMerchant.value) {
            getProducts(merchantId.value, 1, 20, (data: any) => {
            getProducts(merchantId.value, talentId.value, 1, 20, (data: any) => {
                const records: any[] = data != null && data.records instanceof Array ? data.records as any[] : []
                const remotePackages: any[] = []
                for (let index = 0; index < records.length; index++) {
rencaika/services/portal.uts
@@ -107,8 +107,10 @@
    return request<any>({ path: getApiEndpoint('appMerchantDetail') + encodeURIComponent(merchantId), method: 'GET', skipAuth: true }, onSuccess, onError)
}
export const getProducts = (merchantId: string, page: number, size: number, onSuccess: (data: any) => void, onError: (error: HttpError) => void): (() => void) => {
    return request<any>({ path: getApiEndpoint('appProducts'), method: 'GET', skipAuth: true, data: { merchantId: merchantId, page: page, size: size } }, onSuccess, onError)
export const getProducts = (merchantId: string, talentId: string, page: number, size: number, onSuccess: (data: any) => void, onError: (error: HttpError) => void): (() => void) => {
    const data: any = { merchantId: merchantId, page: page, size: size }
    if (talentId != '') data.talentId = Number(talentId)
    return request<any>({ path: getApiEndpoint('appProducts'), method: 'GET', skipAuth: true, data: data }, onSuccess, onError)
}
export const getProductDetail = (productId: string, talentId: string, onSuccess: (data: any) => void, onError: (error: HttpError) => void): (() => void) => {
talent-card-server/src/main/java/com/talentcard/server/business/portal/PortalController.java
@@ -178,10 +178,11 @@
    public ApiResponse<PageResult<Map<String, Object>>> products(
            @RequestParam(required = false) Long merchantId,
            @RequestParam(required = false) String type,
            @RequestParam(required = false) Long talentId,
            @RequestParam(defaultValue = "1") int page,
            @RequestParam(defaultValue = "10") int size
    ) {
        return ApiResponse.success(portalService.products(merchantId, type, page, size));
        return ApiResponse.success(portalService.products(merchantId, type, talentId, page, size));
    }
    @GetMapping("/products/{id}")
talent-card-server/src/main/java/com/talentcard/server/business/portal/PortalService.java
@@ -755,7 +755,7 @@
    }
    @Transactional(readOnly = true)
    public PageResult<Map<String, Object>> products(Long merchantId, String type, int page, int size) {
    public PageResult<Map<String, Object>> products(Long merchantId, String type, Long talentId, int page, int size) {
        StringBuilder sql = new StringBuilder("""
                select id, merchant_id, product_no, product_type, product_name, subtitle, cover_url,
                       original_price, sale_price, subsidy_amount, stock, sales_count, benefit_desc
@@ -779,7 +779,19 @@
            args.add(type);
        }
        sql.append(" order by sort_no desc, id desc");
        return page(sql.toString(), countSql.toString(), page, size, args.toArray());
        PageResult<Map<String, Object>> result = page(sql.toString(), countSql.toString(), page, size, args.toArray());
        List<Map<String, Object>> records = result.records().stream().map(product -> {
            Map<String, Object> item = new LinkedHashMap<>(product);
            BigDecimal originalPrice = decimal(item.get("originalPrice"));
            if (originalPrice.signum() <= 0) originalPrice = decimal(item.get("salePrice"));
            BigDecimal personalizedPrice = personalizedProductPrice(item, talentId);
            item.put("originalPrice", originalPrice);
            item.put("salePrice", personalizedPrice);
            item.put("personalized", talentId != null && personalizedPrice.compareTo(decimal(product.get("salePrice"))) != 0);
            item.put("discountText", discountText(personalizedPrice, originalPrice));
            return item;
        }).toList();
        return new PageResult<>(records, result.page(), result.size(), result.total());
    }
    private Map<String, Object> orderCouponProduct(Long merchantId, Long productId, String orderId) {