152 lines
4.4 KiB
JSON
152 lines
4.4 KiB
JSON
{
|
||
"flowName": "CONTRACT_CREATE_合同建单",
|
||
"platform": "YiSaiQi iS-RPA",
|
||
"nodeCode": "CONTRACT_CREATE",
|
||
"inputs": [
|
||
"stateCenterUrl",
|
||
"agentToken",
|
||
"jobId",
|
||
"supplierName",
|
||
"orderDate",
|
||
"sourceType",
|
||
"templateType",
|
||
"templateName",
|
||
"customerCode",
|
||
"customerName",
|
||
"contractCategory",
|
||
"settlementType",
|
||
"contractBackground",
|
||
"amount",
|
||
"contractEndDate",
|
||
"paymentMethod",
|
||
"paymentDays",
|
||
"submitMode",
|
||
"goodsLines",
|
||
"mergedPdfPath"
|
||
],
|
||
"outputs": [
|
||
"contractSystemNo",
|
||
"nextNode"
|
||
],
|
||
"steps": [
|
||
{
|
||
"id": "S01_CALLBACK_START",
|
||
"name": "回调状态中心-start",
|
||
"script": "StateCenterClient.start_node(jobId, 'CONTRACT_CREATE')"
|
||
},
|
||
{
|
||
"id": "S02_OPEN_CONTRACT_SYSTEM",
|
||
"name": "打开合同系统",
|
||
"script": "open_contract_system(browser, ctx)"
|
||
},
|
||
{
|
||
"id": "S03_LOGIN",
|
||
"name": "登录合同系统",
|
||
"script": "login_contract_system(browser, ctx)",
|
||
"selectors": {
|
||
"username": "input[name='j_username']",
|
||
"password": "input[name='j_password']",
|
||
"submit": "input[name='btn_submit']"
|
||
}
|
||
},
|
||
{
|
||
"id": "S04_ENTER_CONTRACT_DRAFT",
|
||
"name": "进入合同起草",
|
||
"script": "enter_contract_create(browser)"
|
||
},
|
||
{
|
||
"id": "S05_SELECT_RECENT_TEMPLATE",
|
||
"name": "选择最近使用模板",
|
||
"script": "select_contract_template(browser, ctx)",
|
||
"rule": "优先点击最近使用模板中的 templateName;非格式默认非格式--采购协议"
|
||
},
|
||
{
|
||
"id": "S06_FILL_SIGNATORY_INFO",
|
||
"name": "填写签约方信息",
|
||
"script": "fill_contract_signatory_info(browser, ctx)",
|
||
"fields": [
|
||
"客户编码",
|
||
"客户名称"
|
||
]
|
||
},
|
||
{
|
||
"id": "S07_FILL_CONTRACT_BASIC_FORM",
|
||
"name": "填写合同基础表单",
|
||
"script": "fill_contract_basic_info(browser, ctx)",
|
||
"fields": [
|
||
"合同版本类型",
|
||
"合同类别",
|
||
"结算类型",
|
||
"合同背景概述",
|
||
"合同性质"
|
||
]
|
||
},
|
||
{
|
||
"id": "S08_FILL_AMOUNT_AND_DATES",
|
||
"name": "填写金额与日期",
|
||
"script": "fill_contract_amount_and_dates(browser, ctx)",
|
||
"hardRules": [
|
||
"合同签订日期=orderDate",
|
||
"合同开始日期=orderDate"
|
||
]
|
||
},
|
||
{
|
||
"id": "S09_FILL_GOODS_LINES",
|
||
"name": "填写货品明细",
|
||
"script": "fill_contract_goods_lines(browser, ctx)"
|
||
},
|
||
{
|
||
"id": "S10_FILL_PAYMENT_AND_FLAGS",
|
||
"name": "填写付款信息与特殊标志",
|
||
"script": "fill_contract_payment_info(browser, ctx)"
|
||
},
|
||
{
|
||
"id": "S11_MERGE_PDF_IF_YYC",
|
||
"name": "医药城合并同供应商同日PDF",
|
||
"script": "ensure_merged_pdf(platformPdfPaths, mergedPdfOutput)",
|
||
"branch": "sourceType=YYC 且 platformPdfPaths 多于一份时执行;单份直接沿用;sourceType=XYY 跳过"
|
||
},
|
||
{
|
||
"id": "S12_UPLOAD_PDF_IF_YYC",
|
||
"name": "医药城上传合并合同PDF",
|
||
"script": "upload_contract_document_if_needed(browser, ctx)",
|
||
"branch": "sourceType=YYC 才执行;sourceType=XYY 跳过"
|
||
},
|
||
{
|
||
"id": "S13_SUBMIT",
|
||
"name": "提交",
|
||
"script": "submit_contract_for_approval(browser)"
|
||
},
|
||
{
|
||
"id": "S14_READ_CONTRACT_NO",
|
||
"name": "读取合同编号",
|
||
"script": "read_contract_number(browser)"
|
||
},
|
||
{
|
||
"id": "S15_CALLBACK_COMPLETE",
|
||
"name": "回调状态中心-complete",
|
||
"script": "StateCenterClient.complete_node(jobId, 'CONTRACT_CREATE', businessRefs.contractSystemNo)"
|
||
},
|
||
{
|
||
"id": "E_LOGIN_FAILED",
|
||
"name": "异常-登录失败",
|
||
"script": "StateCenterClient.fail_node(..., errorCode='SYS_LOGIN_FAIL', retryable=true, routeRole='OPS')"
|
||
},
|
||
{
|
||
"id": "E_CONTRACT_DISABLED",
|
||
"name": "异常-供应商合同禁用",
|
||
"script": "StateCenterClient.fail_node(..., errorCode='BIZ_CONTRACT_DISABLED', retryable=false, routeRole='PURCHASER')"
|
||
},
|
||
{
|
||
"id": "E_PDF_MERGE_UNSUPPORTED",
|
||
"name": "异常-PDF合并能力不支持",
|
||
"script": "StateCenterClient.fail_node(..., errorCode='CAP_PDF_MERGE_UNSUPPORTED', retryable=false, routeRole='OPS')"
|
||
},
|
||
{
|
||
"id": "E_PAGE_CHANGED",
|
||
"name": "异常-页面改版",
|
||
"script": "StateCenterClient.fail_node(..., errorCode='UI_ELEMENT_NOT_FOUND', retryable=false, routeRole='OPS')"
|
||
}
|
||
]
|
||
}
|