工作流创建

接口描述

此接口外部系统对接Spendia时,创建流程使用的接口

请求URI

/api/openapi/process/start

请求方式

POST

请求体示例

/api/openapi/process/start

{
  "entityKey": "152837338",
  "workflowCode": "all",
  "employeeId": "tikk74942no2",
  "baseDate": "2024-11-04",
  "processVariables": [
    {
      "variableCode": "1004",
      "value": ""
    },
    {
      "variableCode": "1005",
      "value": "日本のすべての精算を生産<>[]{}`~≠±×÷⇒⇔∀∂アイあいmailto:!@#$%^&*()のすべての精算を"
    },
    {
      "variableCode": "1006",
      "value": "tikk74942no2,88889"
    },
    {
      "variableCode": "1007",
      "value": "2024-04-04"
    }
  ],
  "entityFields": [
    {
      "fieldCode": "46",
      "fieldName": "46单机成本中心",
      "value": "414"
    },
    {
      "fieldCode": "44",
      "fieldName": "44成本中心1级",
      "value": "1"
    },
    {
      "fieldCode": "45",
      "fieldName": "45成本中心2级",
      "value": "2"
    },
    {
      "fieldCode": "40",
      "fieldName": "40自定义列表2",
      "value": "111"
    },
    {
      "fieldCode": "tax",
      "fieldName": "tax消费税",
      "value": "2"
    },
    {
      "fieldCode": "29",
      "fieldName": "29交易方",
      "partner": {
        "modeType": "supplier",
        "paymentType": "pre_defined",
        "supplier": {
          "vendorCode": "1",
          "vendorName": "株式会社サンキ電子",
          "vendorSemiangleName": "vendorSemiangleName",
          "postalCode": "postalCode",
          "address": "address",
          "businessRegistrationNumber": "1022",
          "businessCategory": "1002",
          "businessRegistrationDate": "2023-02-23",
          "legalRepresentative": "legalRepresentative",
          "taxId": "taxId",
          "checkNetNo": "checkNetNo",
          "contact": "contactName",
          "contactPhone": "contactPhone",
          "contactMail": "contactEmail",
          "fax": "contactFax",
          "semiangleAddress": "semiangleAddress",
          "remark": "remark",
          "description": "description",
          "paymentTerms": "01",
          "customFormValues": [
            {
              "fieldCode": "XX",
              "value": "ss"
            }
          ]
        },
        "client": {
          "clientCode": "1",
          "clientName": "clientName",
          "clientSemiangleName": "clientSemiangleName",
          "postalCode": "postalCode",
          "address": "address",
          "legalRepresentative": "legalRepresentative",
          "contact": "contactName",
          "contactPhone": "contactPhone",
          "contactMail": "contactEmail",
          "fax": "fax",
          "semiangleAddress": "semiangleAddress",
          "remark": "remark",
          "description": "description",
          "collectionTerm": "11",
          "tradingConditions": "01",
          "effectiveDate": "2023-02-23",
          "principalDepartment": "AAAA",
          "principalUser": "18392632831",
          "customFormValues": [
            {
              "fieldCode": "AA",
              "value": "03"
            },
            {
              "fieldCode": "2",
              "value": "s222s"
            }
          ]
        }
      }
    },
    {
      "fieldCode": "30",
      "fieldName": "30员工",
      "value": "1003,1004"
    },
    {
      "fieldCode": "9",
      "fieldName": "9单行文本框",
      "value": "日本のすべての精算を生産<>[]{}`~≠±×÷⇒⇔∀∂アイあいmailto:!@#$%^&*()日本のすべての精算を"
    },
    {
      "fieldCode": "36",
      "fieldName": "36多行文本框",
      "value": "日本のすべての精算を生産<>[]{}`~≠±×÷⇒⇔∀∂アイあい mailto:!@#$%^&*()日本のすべての精算を"
    },
    {
      "fieldCode": "35",
      "fieldName": "35年月",
      "value": "2024-03"
    },
    {
      "fieldCode": "33",
      "fieldName": "33年月日",
      "value": "2024-02-29"
    },
    {
      "fieldCode": "42",
      "fieldName": "42年月日2",
      "value": "2024-01-18"
    },
    {
      "fieldCode": "43",
      "fieldName": "43年月2",
      "value": "2024-09"
    },
    {
      "fieldCode": "31",
      "fieldName": "金额",
      "amountValue": {
        "currencyCode": "JPY",
        "amount": "999999999999"
      }
    },
    {
      "fieldCode": "24",
      "fieldName": "24币种",
      "value": "JPY"
    },
    {
      "fieldCode": "25",
      "fieldName": "25公司",
      "value": "111"
    },
    {
      "fieldCode": "34",
      "fieldName": "34部门",
      "value": "11"
    },
    {
      "fieldCode": "26",
      "fieldName": "26会计科目",
      "account": {
        "accountCode": "101",
        "auxiliaryAccountCode": "434"
      }
    },
    {
      "fieldCode": "32",
      "fieldName": "32整数",
      "value": "1331.00"
    },
    {
      "fieldCode": "37",
      "fieldName": "37正整数",
      "value": 3322
    },
    {
      "fieldCode": "38",
      "fieldName": "38浮点",
      "value": 221.2
    },
    {
      "fieldCode": "13",
      "attachments": [{
        "linkName": "urlllllllll",
        "linkValue": "https://news.ifeng.com/"
      }]
    },
    {
      "fieldCode": "22",
      "fieldName": "22借方",
      "referenceEntity": [
        {
          "fieldCode": "W1",
          "fieldName": "文本 (引)",
          "value": "aaa"
        },
        {
          "fieldCode": "W14",
          "fieldName": "W14部门",
          "value": "11"
        },
        {
          "fieldCode": "W12",
          "fieldName": "金额",
          "amountValue": {
            "currencyCode": "CNY",
            "amount": "9999999999999.555"
          }
        }
      ]
    },
    {
      "fieldCode": "23",
      "fieldName": "23贷方",
      "referenceEntity": [
        {
          "fieldCode": "W1",
          "fieldName": "文本 (引)",
          "value": "aaa"
        },
        {
          "fieldCode": "W14",
          "fieldName": "W14部门",
          "value": "11"
        },
        {
          "fieldCode": "W12",
          "fieldName": "金额",
          "amountValue": {
            "currencyCode": "CNY",
            "amount": "9999999999999.555"
          }
        }
      ]
    },
    {
      "fieldCode": "11",
      "tableData": [[{
        "fieldCode": "a",
        "value": "200"
      },
        {
          "fieldCode": "V",
          "value": "bbb1"
        },
        {
          "fieldCode": "33",
          "value": "2024-09-01"
        },
        {
          "fieldCode": "D"
        },
        {
          "fieldCode": "duohang",
          "value": "towtowojtojwotjwo@#日本のすべての精算を生産<>[]"
        },
        {
          "fieldCode": "amount",
          "amountValue": {
            "currencyCode": "JPY",
            "amount": "9999999"
          }
        }],
        [{
          "fieldCode": "a",
          "value": "30"
        },
          {
            "fieldCode": "V",
            "value": "bbb2"
          },
          {
            "fieldCode": "D",
            "attachments": [{
              "linkName": "url",
              "linkValue": "https://github.com/"
            },
              {
                "linkName": "url",
                "linkValue": "https://github.com/"
              },
              {
                "linkName": "url",
                "linkValue": "https://github.com/"
              }]
          }]
      ]
    }

  ]
}

请求体字段

字段名 类型 必填 主键 约束 说明
entityKey String 最大长度 50 业务主键
workflowCode String 工作流编码
employeeId String 员工工号
departmentCode String 部门编码
companyCode String 公司编码
baseDate String 日期格式:yyyy-MM-dd 基准日
processVariables processVariables[] 参数数组
entityFields entityFields[] 最大100 业务实体数组

processVariables

字段名 类型 必填 主键 约束 说明
variableCode String 参数编码
value String 最大长度 4000
日期格式:yyyy-MM-dd
数字格式:1.0219(整数,浮点数)
文本格式:"Text"
员工格式:
"empid1,empid2"
参数值

entityFields

字段名 类型 必填 主键 约束 说明
fieldCode String 业务实体自定义字段编码
value String 最大长度 4000 业务实体自定义字段值
amountValue amountValue 金额
tableData tableData[] 子表数组
attachments attachments[] 超链接数组
partner partner{} 合作方

amountValue

字段名 类型 必填 主键 约束 说明
amount BigDecimal 金额值
currencyCode String 货币编码
includingTaxAmount BigDecimal 价税合计金额
excludingTaxAmount BigDecimal 不含税金额
taxAmount String 税额

tableData

字段名 类型 必填 主键 约束 说明
fieldCode String 子表自定义字段编码
value String 最大长度 4000 子表自定义字段值

attachments

字段名 类型 必填 主键 约束 说明
linkName String 超链接名称
linkValue String 超链接地址

partner

参数名 类型 规则 说明
modeType String 合作方类型
supplier
client
paymentType String 支付类型
pre_defined
spot_payment
supplier supplier{} 供应商
client client{} 客户

modeType=supplier

字段名 类型 必填 主键 约束 说明
customFormValues customFormValues{} 扩展字段
vendorCode String 供应商编码
vendorName String 供应商名称
vendorSemiangleName String 供应商名称(半角假名)
postalCode String 邮编
address String 地址
businessRegistrationNumber String 事业者登记编号
businessCategory String 事业者类别
businessRegistrationDate String 事业者登记日期
legalRepresentative String 法人代表
taxId String 税务登记号
checkNetNo String 电债NetNO.
contact String 联系人
contactPhone String 联系电话
contactMail String 邮箱
fax String 传真
semiangleAddress String 地址(半角假名)
remark String 备注
description String 备注(查询用)
paymentTerms String 付款条件

modeType=client

字段名 类型 必填 主键 约束 说明
customFormValues customFormValues{} 扩展字段
clientCode String 客户编码
clientName String 客户名称
clientSemiangleName String 客户名称(半角假名)
postalCode String 邮编
address String 地址
legalRepresentative String 法人代表
contactPhone String 联系电话
contact String 联系人
contactMail String 邮箱
fax String 传真
semiangleAddress String 地址(半角假名)
collectionTerm String 收款条件
remark String 备注
description String 备注名(查询用)
tradingConditions String 交易条件
effectiveDate String 启用日期
principalDepartment String 负责部门
principalUser String 负责人

customFormValues

字段名 类型 必填 主键 约束 说明
fieldCode String 字段编码(扩展字段)
value String 输入值(扩展字段)

接口返回示例

成功

{
    "message": "success",
    "key": "WK00000001"
}

失败示例

{
    "message": "基准日期格式为:yyyy-MM-dd",
    "errorCode": "160002"
}

字段说明

字段名称 类型 说明
message String 返回信息说明
Key String 流程编码
errorCode String 返回错误码

错误代码

errorCode message 説明
120003 参数:{0}为必须字段
0013 参数:{0},请输入{1}字符以内
2008 下一个节点没有适用的审批人。请联系管理员
spd.21701.api.001 工作流编码不存在
spd.21701.api.002 员工 {0} 不存在
spd.21701.api.003 指定基准日下无有效岗位
spd.21701.api.004 部门不存在
spd.21701.api.005 流程中不存在业务实体
spd.21701.api.006 工作流中不存在启用的版本
spd.21701.api.007 业务实体中不存在字段:{0}
spd.21701.api.008 参数定义中不存在字段:{0}
spd.21701.api.009 参数 {0} 仅能输入数字
spd.21701.api.010 参数 {0} 仅能输入日期,且格式为:yyyy-MM-dd
spd.21701.api.011 同一业务主键({0} {1})的申请已经提出,无法重新提出。请先驳回或撤回
spd.21701.api.012 基准日期格式为:yyyy-MM-dd
spd.21701.api.013 不存在有效的流程,请确认
spd.21701.api.014 公司编码不存在
spd.21701.api.015 存在复数岗位,请添加部门或公司参数后再次尝试
spd.21701.api.016 业务实体字段 {0} :对应账套下无有效币种
spd.21701.api.017 业务实体字段 {0} :整数最大值为9999999999999
spd.21701.api.018 业务实体字段 {0} 仅能输入日期,且格式为:yyyy-MM-dd
spd.21701.api.019 业务实体字段 {0} 仅能输入日期,且格式为:yyyy-MM
spd.21701.api.020 流程编码不存在
spd.21701.api.021 任务ID不存在
spd.21701.api.022 当前任务已经处理,无法重复处理
spd.21701.api.023 操作类型不存在
CANNOT_FIND_CURRENT_APPROVAL 不存在审批人。请联系管理员
spd.28725.001 {1}: 价税合计 != 不含税金额+税额
spd.28725.002 {1}&{2}: 金额与价税合计不相等
spd.21701.api.024 参数{0}与参数{1}币种不一致
spd.30027.023 表格数组{0}中,最大支持{1}行数据
spd.30027.025 表格数组{0}中,请至少加入{1}条明细