全局参数
https://doc.rg1008.com/docs/rg_pass_api/rg_pass_api-1d3ja0ikboork
综合分析模块
// 综合分析模块
"polymeric": {
//控制第三方权限配置
"presetSql": [
//{
// "connName": "ConnCpc",
// "value": "",
// "name": ""
//}
],
// #region 数据二次处理插件
//请求的结果处理
//"njcResult": {
// "args": [],
// "moduleName": "~/Config/AppNodeJs/{ownerId}/plugins/{mkey}/{resField}",
// "functionName": null
//},
////请求的参数设置
//"njcArgs": {
// "args": [],
// "moduleName": "~/Config/AppNodeJs/{ownerId}/plugins/{mkey}/{resField}-query",
// "functionName": null
//},
// #endregion 数据二次处理插件
"guidMethod": "None",
//来源组合接口
"dataFromType": "Merge",
"original": "",
"auth": true,
//开启只执行responseField里面配置
"onlySqlList": true,
"source": [
{
// 我的工单
"field": "my",
"connName": "ConnCpc",
"dataFromType": "Database",
//多条数据
"multi": true,
// cpc_product_task status 0 待分配/待接收 1 进行中 2 已完工 3 已延期 4 已暂停 5 已关闭 6 已拒绝
// cpc_product_task_user status 0 待接收 6 已拒绝 7 已接收
// cpc_product_task_user user_type 0 未知 1 管理员 2 法人 3 员工 4 会计 5 财务 6 采购员 7 生产员 8 班组 9 厂长 10 仓管 11 供应商 12 客户 13 派单员 14 上报员 15 总部职员 16 总部领导
"sql": [
// #region 本月待接收
{
"value": "SELECT factory_id,sum(product_num) product_num,sum(defective_num) defective_num,sum(genuine_num) genuine_num,sum(material_num) material_num,sum(consume_num) consume_num,max(start_date) poly_date from cpc_product_task",
"sortId": 1
},
{
"value": " where is_enabled=1 and audit_status=1 and status in (1,2,3,4)",
"sortId": 5
},
// #endregion 本月
{
"value": "{s-if:_mapperType}{op-eq:0} and start_date between @_currentMonthS and @_currentMonthE {op-eq:0}{e-if:_mapperType}",
"sortId": 10
},
// #endregion 本月
// #region 上个月
{
"value": "{s-if:_mapperType}{op-eq:1} and start_date between @_currentPrevMonthS and @_currentPrevMonthE {op-eq:1}{e-if:_mapperType}",
"sortId": 15
},
// #endregion 上个月
// #region 本周
{
"value": "{s-if:_mapperType}{op-eq:2} and start_date between @_currentWeekS and @_currentWeekE {op-eq:2}{e-if:_mapperType}",
"sortId": 20
},
// #endregion 本周
// #region 上一周
{
"value": "{s-if:_mapperType}{op-eq:3} and start_date between @_currentPrevWeekS and @_currentPrevWeekE {op-eq:3}{e-if:_mapperType}",
"sortId": 25
},
// #endregion 上一周
// #region 今年
{
"value": "{s-if:_mapperType}{op-eq:4} and start_date between @_currentYearS and @_currentYearE {op-eq:4}{e-if:_mapperType}",
"sortId": 30
},
// #endregion 今年
// #region 去年
{
"value": "{s-if:_mapperType}{op-eq:5} and start_date between @_currentPrevYearS and @_currentPrevYearE {op-eq:5}{e-if:_mapperType}",
"sortId": 35
},
// #endregion 去年
// #region 当日
{
"value": "{s-if:_mapperType}{op-eq:6} and start_date between @_currentDayS and @_currentDayS {op-eq:6}{e-if:_mapperType}",
"sortId": 40
},
// #endregion 当日
// #region 昨日
{
"value": "{s-if:_mapperType}{op-eq:7} and start_date between @_currentPrevDayS and @_currentPrevDayE {op-eq:7}{e-if:_mapperType}",
"sortId": 45
},
// #endregion 昨日
// #region 工厂名称 产品工单号
{
"value": " and (",
"sortId": 50
},
{
"value": " product_no like concat('%',@pushName,'%')",
"sortId": 55
},
{
"value": " or",
"sortId": 60
},
{
"value": " factory_id in (select fact_id from cpc_ws_factory where is_enabled=1 and audit_status=1 and fact_name like concat('%',@pushName,'%'))",
"sortId": 65
},
{
"value": ")",
"sortId": 75
},
{
"value": "and product_task_id in (select product_task_id from cpc_product_task_user where ({{_whereSqlCpcFxyUserType}} {{_whereSqlCpcFxyRoleId}}) and is_enabled=1)",
"sortId": 80
},
// #endregion 工厂名称 产品工单号
{
"value": " group by factory_id order by",
"sortId": 85
},
// #region 正品数前20
{
"value": "{s-if:sortType0} consume_num desc {e-if:sortType0}",
"sortId": 90
},
// #endregion 正品数前20
// #region 次品数前20
{
"value": "{s-if:sortType1} defective_num desc {e-if:sortType1}",
"sortId": 95
},
// #endregion 次品数前20
// #region 消耗量前20
{
"value": "{s-if:sortType2} genuine_num desc {e-if:sortType2}",
"sortId": 100
},
// #endregion 消耗量前20
{
"value": " limit 0,20",
"sortId": 105
}
]
}
]
}
文档更新时间: 2022-07-15 10:29 作者:admin