简要描述:

  • 随机抽出N个数据
  • \RG3.PF.Abstractions\Providers\LotteryDrawRuleAbstractProvider.cs

接口版本:

版本号 制定人 制定日期 修订日期
v3 陈碧贵 2023-12-31 xxxx-xx-xx

请求URL:

请求方式:

  • POST

请求头:

参数名 是否必须 类型 说明
XownerId string 项目唯一ID,对应bo_project {ownerId}
XsysId string 所属系统 对应 bo_system 表
XuserFromFirstShareId string 一级分享用户ID, bo_user user_id
XuserFromSecondShareId string 二级分享用户ID, bo_user user_id
XverifyApi string 加密规则encryptByDES(`${newGuid()}
XfilterAreaCode string 行政区编码, 对应 bo_sys_area area_code
Content-Type: string application/json; charset=utf-8 请求类型

请求参数:

{}
参数名 是否必须 类型 说明
num int 要抽取的个数
max int 被抽取的对象索引个数
_nodejs string common-data 对应/Config/AppNodeJs/Plugins/fn- common-data.js, 通过nodejs插件,对响应结果进行二次处理 common-data 普通数据(小写驼峰)common-data-under 普通数据下划线

返回示例:

正确时返回:

{
    "data": [
        {
            "key": 1,
            "value": 181,
            "maxVal": 500,
            "percent": 100.0,
            "global": 1.0
        }
    ],
    "currentDay": "2023-12-31",
    "cacheDateTimestamp": 0,
    "code": "0",
    "retCode": "0",
    "success": true
}

错误时返回:

{
    "code": 0,
    "message": ""
    "error":{
      errorCode:null,
      errorText:null
    }
    "success": false,
}

返回参数说明:

参数名 类型 说明
success bool true 表示数据请求成功(跟code=0一致),调用者优先使用
code int true 表示数据请求成功(跟code=0一致),调用者优先使用
data array 响应的结果数据 key:索引 value:被抽取的索引值 maxVal:被抽取的数量 percent: 局部占比 global:全局占比
cacheType string redis/sqlite/local 数据来源缓存 的类型(便于开发调试和性能优化)
cacheDate date 最后数据获取时间
参数名 类型 说明
key int 索引
value int 被抽取的索引值
maxVal int 被抽取的数量
percent float 局部占比
global float 全局占比

抽奖相关SQL

\RG3.PF.Abstractions\Records\KvtnRecord.cs

 public record KvtnRecord<I, K, V, N, T, S, C, SD, ED, U, IMG>(I Id, K Key, V Value, N Name, T Type, C Count, SD StartDate, ED EndDate, U BizUserId, IMG ImgUrl);
select null img_url,null biz_user_id,ACTIVITY_ID id, 0 status,0 count,ACTIVITY_ID value,ACTIVITY_NAME name,ACTIVITY_START_DATE start_date,ACTIVITY_END_DATE end_date, 'config' type from activity_config where ACTIVITY_ID='' and  IS_ENABLED =1
union all
select null img_url,null biz_user_id,round_id id,status,award_num count,round_id value,round_name  name,start_date start_date,end_date end_date, 'round' type from activity_lottery_round where round_id=''
union all
select null img_url,null biz_user_id,log_id id, 0 status,0 count,CREATE_USER_ID value,null name,null start_date,null end_date, 'sign' type from activity_logs_sign where ACTIVITY_ID='' and  IS_ENABLED =1
union all
select null img_url,null biz_user_id,log_id id, status,0 count,CREATE_USER_ID value,null name,null start_date,null end_date, 'lottery' type from activity_lottery_log where ACTIVITY_ID='' and round_id=''

select ACTIVITY_ID id,0 status,0 num,ACTIVITY_ID value,ACTIVITY_NAME name,ACTIVITY_START_DATE start_date,ACTIVITY_END_DATE end_date, 'config' type from activity_config where ACTIVITY_ID=@activityId and  IS_ENABLED =1
union all
{s-if:roundId}
select round_id id,status,award_num num,round_id value,round_name  name,start_date start_date,end_date end_date, 'round' type from activity_lottery_round where round_id=@roundId
union all
{e-if:roundId}
select log_id id,0 status,0 num,CREATE_USER_ID value,null name,null start_date,null end_date, 'sign' type from activity_logs_sign where ACTIVITY_ID=@activityId  and  IS_ENABLED =1
union all
select log_id id,status,0 num,CREATE_USER_ID value,null name,null start_date,null end_date, 'lottery' type from activity_lottery_log where ACTIVITY_ID=@activityId {s-if:roundId} and round_id=@roundId {e-if:roundId}
文档更新时间: 2024-01-03 06:35   作者:admin