POST/distributeAmount/executeCalc管理后台

执行计算(保存到数据库),支持多月

结算与分配 / 金额· DistributeAmountController#executeCalc

基本信息

  • 接口状态前端在用 置信度 高
  • 接口URLPOSThttps://dscp-dev.hn12301.net/manage-api/distributeAmount/executeCalc
  • 请求方式POST
  • Content-Typeapplication/json
  • 暴露渠道管理后台 前缀 /manage-api
  • 名称来源源码注释
  • 调用方已确认在用 · 管理后台(1 个前端)
  • 需求上下文feat:新增结算分配功能
  • 维护人 / 最后改动jacobxu666 2026-06-23 最近提交:feat:新增结算分配功能
  • 读写数据表distribute_detail 反查该表全部接口 →
  • 控制器com.jxxx.dscp.api.controller.distribute.DistributeAmountController#executeCalc
  • 源码位置jxxx-dscp/dscp-service-business/src/main/java/com/jxxx/dscp/api/controller/distribute/DistributeAmountController.java:109
  • 判定依据1 个调用点:dscp-html-manage/src/api/card/distributeAmount/index.ts

请求参数

Header 请求参数

参数名参数值是否必填参数类型描述说明
无(渠道统一鉴权头见《认证方式》)

Query 请求参数

参数名参数值是否必填参数类型描述说明
无

路径参数及说明

参数名参数值是否必填参数类型描述说明
无

Body 请求参数

Body 类型 DistributeAmountCalcRequest
参数名参数值是否必填参数类型描述说明
year…是IntegerMin value = 2020, message = "年份不合法" Max value = 2099, message = "年份不合法" → distribute_batch.year
month…否Integer → distribute_batch.month
months…否List<Integer>多月批量计算(可选,优先于 month)
cardModelIds…否List<Long>指定卡种ID列表(可选,为空时计算全部三类卡)
ratio…否Integer分润比例(可选,百分比整数,如 80 表示 80%,默认 80) → distribute_batch.ratio
calcMode…否String计算模式:ratio(按比例,默认)/ fixed(固定金额) → distribute_batch.calc_mode
fixedAmount…否Long固定金额(单位:分),calcMode 为 fixed 时使用 → distribute_batch.fixed_amount

认证方式

需登录态:Authorization: Bearer <token>(多租户另带 tenant-id);30002 会话失效需重登。详见全局公共参数。

响应参数

data 类型 List<DistributeBatch>
参数名参数值是否必填参数类型描述说明
id…否Long → distribute_detail.id
batchNo…否String批次编号 → distribute_batch.batch_no
year…否Integer年份 → distribute_batch.year
month…否Integer月份 → distribute_batch.month
quarter…否Integer季度 → distribute_batch.quarter
cardModelId…否Long卡种ID → distribute_batch.card_model_id
cardModelName…否String卡种名称 → distribute_batch.card_model_name
cardModelPrice…否Integer卡种售价(分) → distribute_batch.card_model_price
validUserCount…否Integer当月有效用户数 → distribute_batch.valid_user_count
totalDistributeAmount…否Long该卡种当月可分配总额(分) → distribute_batch.total_distribute_amount
parkCount…否Integer参与分配的景区数量 → distribute_batch.park_count
status…否Integer状态:1已计算, 2已确认, 3已导出 → distribute_batch.status
execTime…否Date执行时间 → distribute_batch.exec_time
execBy…否Long执行人 → distribute_batch.exec_by
ratio…否Integer分润比例(百分比整数,如 80 表示 80%) → distribute_batch.ratio
calcMode…否String计算模式:ratio(按比例)/ fixed(固定金额),默认 ratio → distribute_batch.calc_mode
fixedAmount…否Long固定金额(单位:分),calcMode 为 fixed 时使用 → distribute_batch.fixed_amount
isDeleted…否Boolean逻辑删除 → distribute_detail.is_deleted
createdBy…否Long创建人 → distribute_detail.created_by
createdTime…否Date创建时间 → distribute_detail.created_time
updatedBy…否Long更新人 → distribute_detail.updated_by
updatedTime…否Date更新时间 → distribute_detail.updated_time

响应示例

成功响应示例 code=0

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "id": "1",
    "batchNo": "\"string\"",
    "year": "1",
    "month": "1",
    "quarter": "1",
    "cardModelId": "1",
    "cardModelName": "\"string\"",
    "cardModelPrice": "1",
    "validUserCount": "1",
    "totalDistributeAmount": "1",
    "parkCount": "1",
    "status": "1"
  }
}

失败响应示例

{
  "data": null,
  "可能返回": [
    {
      "errcode": "99999",
      "errmsg": "服务内部错误"
    }
  ]
}
示例来自源码/导出内容,仅结构参考,非线上真实数据。

附录 · 实现细节

调用链 / 数据表 / 调用点证据 / 源码注释 / 逻辑摘要
涉及数据表:distribute_detail 反查全部引用接口 →
  • DistributeAmountController#executeCalc
  • DistributeAmountService#executeCalc(DistributeAmountServiceImpl)
  • SessionUserService#getSessionId
  • DistributeDetailService#delete(DistributeDetailServiceImpl)
  • DistributeDetailMapper#delete
其它依赖:ChaosTransactionTemplate.execute
逻辑摘要:调用 isNotEmpty(CollUtil.isNotEmpty);调用 executeCalc(distributeAmountService.executeCalc)
操作日志:distribute / 执行分配计算
旧站环境备注:pro:(仓库 .env.pro 指向 uat;生产域名未确认,此处沿用 uat 主机示意)
调用点证据
  • dscp-html-manage/src/api/card/distributeAmount/index.ts:8 管理后台 · request
可能抛出的业务码:99999 服务内部错误 错误码字典 →
由 tools/build.py 从 data/apis.json 生成 · 生成时间 2026-09-12 19:49 · 数据口径见说明 · 本页数字非手写,均来自同一份数据