POST/estimation/calcEstimationCard管理后台

旅游卡结算测算单-计算数据

结算与分配 / 估算·卡· EstimationCardController#calcEstimationCard

基本信息

  • 接口状态前端在用 置信度 高
  • 接口URLPOSThttps://dscp-dev.hn12301.net/manage-api/estimation/calcEstimationCard
  • 请求方式POST
  • Content-Typeapplication/json
  • 暴露渠道管理后台 前缀 /manage-api
  • 名称来源源码注释
  • 调用方已确认在用 · 管理后台(1 个前端)
  • 需求上下文feat:新增旅游卡结算测算模块
  • 维护人 / 最后改动AsiQue 2024-06-03 最近提交:feat:新增旅游卡结算测算模块
  • 读写数据表card_resource_rule 反查该表全部接口 →
  • 控制器com.jxxx.dscp.api.controller.estimation.EstimationCardController#calcEstimationCard
  • 源码位置jxxx-dscp/dscp-service-business/src/main/java/com/jxxx/dscp/api/controller/estimation/EstimationCardController.java:190
  • 判定依据1 个调用点:dscp-html-manage/src/api/estimation/index.ts

请求参数

Header 请求参数

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

Query 请求参数

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

路径参数及说明

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

Body 请求参数

Body 类型 EstimationCardAddRequest
参数名参数值是否必填参数类型描述说明
cardModelId…是Long卡种id → card_resource_rule.card_model_id
profit…是Long单张卡分润金额,单位为分
issueNum…是Integer结算周期内卡种发行量
estimationPeriod…是Date[]结算起止时间

认证方式

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

响应参数

data 类型 EstimationCardInfoResponse
参数名参数值是否必填参数类型描述说明
id…否Longid → card_resource_rule.id
cardModelName…否String卡种名称
estimationPeriod…否String结算起止时间
totalAmount…否Long实际结算金额,单位为分
profit…否Long单张卡分润金额,单位为分
issueNum…否Integer卡种发行量
checkNum…否Long累计刷卡次数

响应示例

成功响应示例 code=0

{
  "errcode": 0,
  "errmsg": "",
  "data": {
    "id": "1",
    "cardModelName": "\"string\"",
    "estimationPeriod": "\"string\"",
    "totalAmount": "1",
    "profit": "1",
    "issueNum": "1",
    "checkNum": "1"
  }
}

失败响应示例

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

附录 · 实现细节

调用链 / 数据表 / 调用点证据 / 源码注释 / 逻辑摘要
涉及数据表:card_resource_rule 反查全部引用接口 →
  • EstimationCardController#calcEstimationCard
  • CardResourceRuleService#queryList(CardResourceRuleServiceImpl)
  • CardResourceRuleMapper#queryList
  • BeanUtils.map → SettlementCardDetailCalcRequest
其它依赖:EstimationCardService.checkEstimationPeriod、CardModelCache.get、SettlementHandlerCache.get、CacheService.put
逻辑摘要:调用 checkEstimationPeriod(estimationCardService.checkEstimationPeriod);列表查询(cardResourceRuleService.queryList);调用 put(cacheService.put);入参与返回值经 BeanUtils 做对象/分页映射
操作日志:estimation / 计算测算单
源码内联注释(旧站解析结果)
  • TODO 检查结算时间是否冲突
  • estimationCardService.checkEstimationPeriod();
  • 查询卡种资源结算规则
  • 计算各资源结算明细
  • 设置虚拟id,供核销记录查询使用
  • 将计算结果放入缓存中,保留两个小时,超时后需要重新计算
  • 组织响应信息
  • 处理异常
旧站环境备注:pro:(仓库 .env.pro 指向 uat;生产域名未确认,此处沿用 uat 主机示意)
调用点证据
  • dscp-html-manage/src/api/estimation/index.ts:11 管理后台 · request
可能抛出的业务码:99999 服务内部错误 错误码字典 →
由 tools/build.py 从 data/apis.json 生成 · 生成时间 2026-09-12 19:49 · 数据口径见说明 · 本页数字非手写,均来自同一份数据