返回列表 发布新帖

明细表栏位增加自定义校验,异步发起ESP请求出现异常

7 1
发表于 前天 21:21 | 查看全部 阅读模式
问答

紧急程度

已完结
环境:华为云测试区
租户:icd
用户名:liwei1
问题描述:
过滤类型栏位新增了自定义校验,运行出现异常: P.ATDM.500.0000: 调用https://atdm-test.apps.digiwincl ... ata/query/by/action异常,dataSourceDTO
设计态脚本如下所示:
  1. {
  2.   "application": "spa-icd",
  3.   "remark": null,
  4.   "objectId": "685bbf9f5bef621ef12a686f",
  5.   "taskCode": "DE_342fe4821000150e",
  6.   "key": "DE_342fe4821000150e_1750843295865",
  7.   "name": "过滤类型:必须保持一致",
  8.   "domain": "DataEntry",
  9.   "domainId": "DE_342fe4821000150e",
  10.   "content": {
  11.     "path": "data_filter_rule_detail.data_filter_rule_d",
  12.     "schema": "filter_type",
  13.     "targetSchema": null,
  14.     "key": "custom",
  15.     "condition": null,
  16.     "errorMessage": "过滤类型必须统一,请检查!",
  17.     "scope": "EDIT",
  18.     "validatorType": "error",
  19.     "asyncCacheScope": null,
  20.     "lang": {
  21.       "errorMessage": {
  22.         "zh_CN": "过滤类型必须统一,请检查!",
  23.         "zh_TW": "過濾類型必須統一,請檢查!",
  24.         "en_US": "过滤类型必须统一,请检查!"
  25.       },
  26.       "name": {
  27.         "zh_CN": "过滤类型:必须保持一致",
  28.         "zh_TW": "過濾類型:必須保持一致",
  29.         "en_US": "过滤类型:必须保持一致"
  30.       }
  31.     },
  32.     "linkageSchemas": [],
  33.     "crossFieldOrNot": false,
  34.     "trigger": {
  35.       "type": "async",
  36.       "point": "default",
  37.       "condition": "(() => { const uuid = currentControl.parent.get('uuid').value; const filterType = currentControl.value; const rowValue = currentControl.parent.parent.value;  const result = rowValue.some(item => item.uuid !== uuid && item.filter_type !== '' && item.filter_type !== filterType); return currentControl.value !== '' && result})();",
  38.       "parameterScript": "const entity=currentControl.parent.parent.parent.value;\r\nconsole.log(entity); \r\nconst params = {\r\n    canRequest: true,\r\n    // tmAction: {\r\n    //     "sequence": 0,\r\n    //     "type": "ESP",\r\n    //     "actionId": "esp_spa.icd.data.filter.rule.detail.get"\r\n    // },\r\n    data_filter_rule: {\r\n        rule_type: entity.rule_type,\r\n        filter_category: entity.filter_category,\r\n        supplier_no: entity.supplier_no,\r\n        template_type: entity.template_type,\r\n        template_no: entity.template_no,\r\n        s_date: entity.s_date\r\n    }\r\n};\r\nconsole.log(params); \r\nreturn params;",
  39.       "apiUrl": "/api/atdm/v1/data/query/by/action",
  40.       "apiPrefixType": "atdmUrl",
  41.       "apiMethodType": "post",
  42.       "needValidateParameter": true,
  43.       "needCustomEvaluation": false
  44.     }
  45.   }
  46. }
复制代码

重现步骤:
登陆Athena,进入“业务数据录入”,进入“维护数据过滤规则”浏览界面,选择第一笔数据“维护”。
image.png
进入编辑界面,点击“编辑”按钮。明细表表头点击“新增换行”。即可重现问题。
image.png


最佳答案

查看完整内容

看你的规则中的脚本里面,具体调用接口的代码被注释了,而且传参的格式也不正确 异步请求接口时,脚本中具体配置参考下列代码: let canRequest = false; if (rowData.owner_emp_no) {     canRequest = true } const params = {     canRequest: canRequest,     businessUnit: businessUnit,     tmAction: {         sequence: 0,    &nb ...

评论1

翁俊Lv.7 发表于 昨天 11:58 | 查看全部
看你的规则中的脚本里面,具体调用接口的代码被注释了,而且传参的格式也不正确

image.png

异步请求接口时,脚本中具体配置参考下列代码:

let canRequest = false;
if (rowData.owner_emp_no) {
    canRequest = true
}
const params = {
    canRequest: canRequest,
    businessUnit: businessUnit,
    tmAction: {
        sequence: 0,
        type: 'ESP',
        actionId: 'esp_dtdapp.outsourced.employees.basic.data.detail.get'   //这里写入你需要调用的接口名称
    },
    paras: {
        outsourced_employees_basic_data: {
            owner_emp_no: rowData.owner_emp_no
        }   //  这里接入你接口的入参key和value值
    }
};
return params;

大家来答
    热门讨论
    精选文章
    数据驱动2.0工作流流程变量说明
    在工作流执行的过程中,我们常常需要先取得一些待处理的数据,并在处理后将结果存放起
    互联中台整合请求安全码(digi-key)说明
    互联中台整合请求中有安全码的设计,用来验证整合请求的合法性。安全码的位置说明如下
    数据比对介绍
     一、数据比对介绍(一)业务场景在项目实施中,预算执行率的准确计算依赖于敏态
    Athena 五大驱动力介绍
                  在数字化转型的浪
    开发不踩雷-数据驱动2.0, 模型栏位异动调整时的注意事项
    场景说明我们在应用开发过程中, 模型的异动是非常常见的一般情况的开发顺序为 模型设
    • 关注公众号
    Copyright © 2025 鼎捷数智股份有限公司 版权所有 All Rights Reserved. Powered by Discuz! X5.0
    关灯 在本版发帖
    即将开放
    返回顶部
    快速回复 返回顶部 返回列表