Files
jsowell-charger-web/docs/科拓停车充电桩抵扣配置指南.md
2026-07-03 16:08:17 +08:00

4.4 KiB

科拓停车充电桩抵扣配置指南

本文用于配置科拓停车系统 2.5.4 充电桩抵扣接口。配置完成后,订单满足站点停车优惠条件时,系统会向科拓下发 syncChargePilePay 抵扣请求。

一、停车场平台配置

数据表:thirdparty_parking_config

字段 是否必填 科拓配置说明
parking_name 建议填 停车场/商户名称,便于后台识别。
platform_type 科拓固定填 4
app_id 科拓分配的 appId
secret_key 科拓分配的 appSercert,用于生成请求体 key
park_id 科拓分配的车场 ID。
api_url 科拓接口地址。可填接口基址,如 https://IP:端口;也可填完整地址 https://IP:端口/api/wec/SyncChargePilePay
org_id qcyun 使用,科拓不用。
del_flag 正常数据填 0

示例:

insert into thirdparty_parking_config (
    parking_name,
    platform_type,
    app_id,
    secret_key,
    park_id,
    api_url,
    create_time,
    create_by,
    del_flag
) values (
    '示例科拓停车场',
    '4',
    '10038',
    'KETUO_APP_SECRET',
    '592011253',
    'https://IP:端口',
    now(),
    'admin',
    '0'
);

二、站点绑定停车场配置

数据表:pile_station_info

update pile_station_info
set parking_id = 'thirdparty_parking_config.id'
where id = '站点ID';

后台接口同样可用:

POST /pile/station/bindParkingPlatform

请求体:

{
  "stationId": "站点ID",
  "parkingId": "thirdparty_parking_config.id"
}

三、站点停车优惠规则

数据表:charge_parking_discount

字段 是否必填 说明
station_id 站点 ID。
parking_platform_id 科拓固定填 4
condition_type 发券门槛类型:1 固定电量;2 固定时长。
condition_value 门槛值。电量单位度,时长单位分钟。
discount_type 优惠类型:1 减时间;2 减金额。
discount_value 优惠值。减时间单位分钟,系统下发科拓时会转成秒;减金额单位元,系统下发科拓时会转成分。
start_time 优惠生效开始时间。
end_time 优惠生效结束时间。
del_flag 正常数据填 0

示例:充电满 10 度,抵扣 120 分钟停车时长。

insert into charge_parking_discount (
    station_id,
    parking_platform_id,
    condition_type,
    condition_value,
    discount_type,
    discount_value,
    start_time,
    end_time,
    create_time,
    create_by,
    del_flag
) values (
    '站点ID',
    4,
    '1',
    '10',
    '1',
    '120',
    '00:00:00',
    '23:59:00',
    now(),
    'admin',
    '0'
);

四、下发给科拓的数据来源

科拓字段 当前系统取值
orderNo order_basic_info.order_code
plateNo order_basic_info.plate_number
startTime order_basic_info.charge_start_time,为空时用订单创建时间
endTime order_basic_info.charge_end_time,为空时用当前时间
stationId order_basic_info.station_id
stationName pile_station_info.station_name
deviceId order_basic_info.pile_sn
deviceName pile_basic_info.name,为空时用桩 SN
spaceNo pile_connector_info.park_no,为空时用 0
power 实时数据 chargingDegree,保留 2 位小数
totalMoney 实时数据 chargingAmount,元转分
elecMoney 当前填 0
seviceMoney 当前填 totalMoney
freeType 固定填 0,按 freeMoney/freeTime 减免
freeMoney 金额优惠时取优惠金额并元转分;时长优惠时为 0
freeTime 时长优惠时取优惠分钟并转秒;金额优惠时为 0

五、生效条件

沿用现有充电停车优惠链路:

  1. 订单有车牌号。
  2. 站点存在 charge_parking_discount 有效配置。
  3. 订单创建时间在优惠时间段内。
  4. 订单实时充电电量或充电时长满足门槛。
  5. 同一订单未在 car_coupon_record 写入过发券记录。
  6. 优惠规则 parking_platform_id = 4
  7. 站点绑定的 thirdparty_parking_config.platform_type = '4'
  8. 科拓配置 app_idsecret_keypark_idapi_url 不为空。