rk
6 小时以前 4f4538356403d620b9bd510fd45729a251291942
功能开发
已添加1个文件
已修改9个文件
108 ■■■■ 文件已修改
server/platform/src/main/java/com/doumee/api/business/DouyinVerifyController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/platform/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/core/douyin/dto/DouyinShopPoiResp.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/core/wx/WxMiniUtilService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/dao/business/web/response/DouyinShopPoiVO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/java/com/doumee/service/business/impl/ReportServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/services/src/main/resources/application-dev.yml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/web/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/接口变更说明.txt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/platform/src/main/java/com/doumee/api/business/DouyinVerifyController.java
@@ -16,6 +16,7 @@
import com.doumee.dao.business.model.DouyinVerifyLog;
import com.doumee.dao.business.model.DouyinVerifyRecord;
import com.doumee.dao.business.vo.DouyinVerifyRecordPageVO;
import com.doumee.dao.business.web.response.DouyinShopPoiVO;
import com.doumee.service.business.DouyinVerifyLogService;
import com.doumee.service.business.DouyinVerifyService;
import io.swagger.annotations.Api;
@@ -64,22 +65,26 @@
        return ApiResponse.success(douyinVerifyService.findManagePage(pageWrap));
    }
    @ApiOperation("查询抖音商户下门店(用于选核销门店;account_id ä»Žå­—典读取)")
    @ApiOperation("查询抖音商户下门店(poiId + é—¨åº—名称成对返回;account_id ä»Žå­—典读取)")
    @PostMapping("/poiList")
    @RequiresPermissions("business:douyinVerify:query")
    public ApiResponse<List<String>> poiList() {
    public ApiResponse<List<DouyinShopPoiVO>> poiList() {
        // é—¨åº—查询为无状态透传(无落库),Controller â†’ DouyinClient ç›´è¿ž;account_id ç”± Client ä»Žå­—典读取
        DouyinBaseResp<DouyinShopPoiResp> resp = douyinClient.shopPoiQuery();
        List<DouyinShopPoiResp.Poi> pois = resp == null || resp.getData() == null ? null : resp.getData().getPois();
        if (pois == null || pois.isEmpty()) {
            return ApiResponse.success(Collections.emptyList());
        }
        // ä»…提取门店ID,过滤 poi èŠ‚ç‚¹æˆ– poiId ä¸ºç©ºçš„æ¡ç›®
        List<String> poiIds = pois.stream()
        // æå–门店ID + é—¨åº—名称成对返回;过滤 poi èŠ‚ç‚¹æˆ– poiId ä¸ºç©ºçš„æ¡ç›®
        // é—¨åº—名称实际路径为 pois[].account.poi_account.account_name
        List<DouyinShopPoiVO> poiList = pois.stream()
                .filter(p -> p != null && p.getPoi() != null && StringUtils.isNotBlank(p.getPoi().getPoiId()))
                .map(p -> p.getPoi().getPoiId())
                .map(p -> new DouyinShopPoiVO(
                        p.getPoi().getPoiId(),
                        p.getAccount() == null || p.getAccount().getPoiAccount() == null
                                ? null : p.getAccount().getPoiAccount().getAccountName()))
                .collect(Collectors.toList());
        return ApiResponse.success(poiIds);
        return ApiResponse.success(poiList);
    }
    @PreventRepeat
server/platform/src/main/resources/application.yml
@@ -9,7 +9,7 @@
#  application:
#    name: parkbike
  profiles:
    active: dev
    active: pro
  # JSON返回配置
  jackson:
    # é»˜è®¤æ—¶åŒº
server/services/src/main/java/com/doumee/core/douyin/dto/DouyinShopPoiResp.java
@@ -8,8 +8,10 @@
/**
 * ã€ŒæŸ¥è¯¢é—¨åº—信息」出参(data èŠ‚ç‚¹)。
 * <p>GET https://open.douyin.com/goodlife/v1/shop/poi/query/
 * <p>返回商户下已认领的门店列表,门店ID嵌套在 pois[].poi.poi_id。
 * å½“前只用门店ID,其余节点(account / root_account ç­‰)不做映射。
 * <p>返回商户下已认领的门店列表:
 * é—¨åº—ID嵌套在 pois[].poi.poi_id,
 * é—¨åº—名称嵌套在 pois[].account.poi_account.account_name。
 * å½“前用门店ID + é—¨åº—名称,其余节点不做映射。
 *
 * @author rk
 * @date 2026/06/26
@@ -30,17 +32,21 @@
    private String description;
    /**
     * å•个门店条目。仅解析 poi èŠ‚ç‚¹å–é—¨åº—ID。
     * å•个门店条目。解析 poi èŠ‚ç‚¹å–é—¨åº—ID,account.poi_account å–门店名称。
     */
    @Data
    public static class Poi {
        /** é—¨åº—基本信息(含 poi_id) */
        @JSONField(name = "poi")
        private PoiInfo poi;
        /** è´¦å·ä¿¡æ¯(含 parent_account / poi_account,门店名称在 poi_account.account_name) */
        @JSONField(name = "account")
        private Account account;
    }
    /**
     * é—¨åº—基本信息。当前响应仅用到 poi_id。
     * é—¨åº—基本信息。当前响应用到 poi_id。
     */
    @Data
    public static class PoiInfo {
@@ -48,4 +54,24 @@
        @JSONField(name = "poi_id")
        private String poiId;
    }
    /**
     * è´¦å·ä¿¡æ¯ã€‚当前响应用到 poi_account.account_name ä½œä¸ºé—¨åº—名称展示。
     */
    @Data
    public static class Account {
        /** é—¨åº—对应的抖音来客账号(含 account_name é—¨åº—名称) */
        @JSONField(name = "poi_account")
        private PoiAccount poiAccount;
    }
    /**
     * é—¨åº—账号信息。account_name ä½œä¸ºé—¨åº—名称展示。
     */
    @Data
    public static class PoiAccount {
        /** é—¨åº—名称(抖音侧账号名称,用于前端选核销门店展示) */
        @JSONField(name = "account_name")
        private String accountName;
    }
}
server/services/src/main/java/com/doumee/core/wx/WxMiniUtilService.java
@@ -80,8 +80,8 @@
        request.setSubMchid(WxMiniConfig.wxProperties.getSubMchId());
        request.setNotifyUrl(WxMiniConfig.wxProperties.getRefundNotifyUrl());
        AmountReq amountReq = new AmountReq();
        amountReq.setTotal(1L);//refundDTO.getTotalAmount().longValue());
        amountReq.setRefund(1L);//refundDTO.getRefundAmount().longValue());
        amountReq.setTotal(refundDTO.getTotalAmount().longValue());
        amountReq.setRefund(refundDTO.getRefundAmount().longValue());
        amountReq.setCurrency("CNY");
        request.setAmount(amountReq);
        try {
server/services/src/main/java/com/doumee/dao/business/web/response/DouyinShopPoiVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.doumee.dao.business.web.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * æŠ–音商户下门店(poiId + é—¨åº—名称成对返回)。
 * <p>用于管理端 /business/douyinVerify/poiList é€‰æ ¸é”€é—¨åº—下拉展示。
 * poiId å–自抖音响应 pois[].poi.poi_id,poiName å–自 pois[].poi_account.account_name。
 *
 * @author rk
 * @date 2026/07/03
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("抖音门店(poiId + åç§°)")
public class DouyinShopPoiVO {
    @ApiModelProperty("抖音门店POI ID(核销门店ID)")
    private String poiId;
    @ApiModelProperty("门店名称(抖音 poi_account.account_name)")
    private String poiName;
}
server/services/src/main/java/com/doumee/service/business/impl/GoodsorderServiceImpl.java
@@ -1377,7 +1377,7 @@
        request.setOutTradeNo(goodsorder.getId());
        request.setNotifyUrl(WxMiniConfig.wxProperties.getNotifyUrl());//这个回调url必须是https开头的
        Amount amount = new Amount();
        amount.setTotal(1);//goodsorder.getMoney().intValue());
        amount.setTotal(goodsorder.getMoney().intValue());
        request.setAmount(amount);
//        PrepayResponse res = WxMiniConfig.wxPayService.prepay(request);
            // è·Ÿä¹‹å‰ä¸‹å•示例一样,填充预下单参数
server/services/src/main/java/com/doumee/service/business/impl/ReportServiceImpl.java
@@ -433,6 +433,8 @@
        IPage<OperationOrderVO> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        OperationOrderQueryDTO model = pageWrap.getModel() == null
                ? new OperationOrderQueryDTO() : pageWrap.getModel();
        // ç§Ÿç”¨ä¸­(status=1):需过滤掉无骑行记录的订单(已支付但用户从未开锁骑行)
        boolean queryInProgress = Objects.nonNull(model.getStatus()) && model.getStatus().equals(Constants.ONE);
        // â”€â”€ æ­¥éª¤1:分页主查询 â”€â”€
        // ä¸»è¡¨ goodsorder left join member(取手机号)+ left join base_param(取结算车型名);
@@ -459,6 +461,9 @@
                // è®¢å•类型:按骑行记录 member_rides.type ç­›é€‰(可选)
                .inSql(Objects.nonNull(model.getBikeType()), Goodsorder::getId,
                        "select ordre_id from member_rides where isdeleted = 0 and type = " + model.getBikeType())
                // ç§Ÿç”¨ä¸­(status=1):仅保留存在骑行记录的订单,过滤掉已支付但无骑行记录的数据
                .inSql(queryInProgress, Goodsorder::getId,
                        "select ordre_id from member_rides where isdeleted = 0")
                .orderByDesc(Goodsorder::getPayDate);
        IPage<OperationOrderVO> result = goodsorderMapper.selectJoinPage(page, OperationOrderVO.class, wrapper);
        List<OperationOrderVO> records = result.getRecords();
server/services/src/main/resources/application-dev.yml
@@ -54,12 +54,12 @@
#    refundNotifyUrl: http://xiaopiqiu3.natapp1.cc/api/wxRefundNotify
    notifyUrl: https://test.doumee.cn/bikeWeb/api/wxPayNotify
    refundNotifyUrl: https://test.doumee.cn/bikeWeb/api/wxRefundNotify
    keyPath: /usr/local/jars/bike/apiclient_cert.p12
    privateCertPath: /usr/local/jars/bike/apiclient_cert.pem
    privateKeyPath: /usr/local/jars/bike/apiclient_key.pem
#    keyPath: d://apiclient_cert.p12
#    privateCertPath: d://apiclient_cert.pem
#    privateKeyPath: d://apiclient_key.pem
#    keyPath: /usr/local/jars/bike/apiclient_cert.p12
#    privateCertPath: /usr/local/jars/bike/apiclient_cert.pem
#    privateKeyPath: /usr/local/jars/bike/apiclient_key.pem
    keyPath: d://apiclient_cert.p12
    privateCertPath: d://apiclient_cert.pem
    privateKeyPath: d://apiclient_key.pem
    #服务商-------------end---
    existsSub: 1
    appSecret: 1ceb7c9dff3c4330d653adc3ca55ea24
server/web/src/main/resources/application.yml
@@ -9,7 +9,7 @@
#  application:
#    name: parkbike
  profiles:
    active: dev
    active: pro
  # JSON返回配置
  jackson:
    # é»˜è®¤æ—¶åŒº
server/½Ó¿Ú±ä¸ü˵Ã÷.txt
@@ -20,7 +20,7 @@
二、抖音券核销(新文件 DouyinVerifyController,/business/douyinVerify)
  4. POST /business/douyinVerify/page        æ ¸é”€è®°å½•分页(对外)
  5. POST /business/douyinVerify/poiList     æŸ¥è¯¢æŠ–音商户下门店ID列表(无入参,返回 List<String>)
  5. POST /business/douyinVerify/poiList     æŸ¥è¯¢æŠ–音商户下门店列表(无入参,返回 List<DouyinShopPoiVO>:poiId + poiName é—¨åº—名称成对)
  6. POST /business/douyinVerify/cancel      æ’¤é”€æ ¸é”€(管理端,不受1小时限制)
三、抖音商品(新文件 DouyinProductController,/business/douyinProduct)