- 12张 bid_* 表(models+DDL+CRUD):招标信息/邮箱配置/人员/招标文件/评分项/资质/ 投标文件要求/章节/评审/评分/知识库/标书 - 7个角色能力模块(bid_*_capability):采集摘要/解析/知识库资质/编写/评审/合成/评分 - bid_flow 状态对账器:角色任务唯一创建者+阻塞门禁(源头守门,引擎零特判) - bid_mail:阿里云企业邮 IMAP 采集(凭据存DB AES,客户端专用密码兼容) - 能力包注册(bid_ability)+ 角色工具自注册(role_tool_schemas) - 技能:6 common 状态机/规范 + 9 角色技能(pipelines/bidding_general,随 pipeline-core 部署) - i18n(zh/en)、init/data.json(appcodes+pipelines记录)、build.sh、RBAC load_path
44 lines
2.2 KiB
Plaintext
44 lines
2.2 KiB
Plaintext
|
|
ns = params_kw.copy()
|
|
for k,v in list(ns.items()):
|
|
if v == 'NaN' or v == 'null' or v == '' or v is None:
|
|
if k != 'id':
|
|
del ns[k]
|
|
else:
|
|
ns[k] = None if v in ('NaN', 'null') else v
|
|
|
|
|
|
|
|
|
|
|
|
db = DBPools()
|
|
dbname = get_module_dbname('pipeline_bidding')
|
|
async with db.sqlorContext(dbname) as sor:
|
|
|
|
tblfields = json.loads('[{"name": "id", "title": "主键ID", "type": "str", "length": 32, "nullable": "no"}, {"name": "org_id", "title": "机构ID", "type": "str", "length": 32, "nullable": "no", "default": "0"}, {"name": "doc_type", "title": "文档类型", "type": "str", "length": 32, "nullable": "no", "default": "qualification"}, {"name": "doc_name", "title": "文档名称", "type": "str", "length": 255, "nullable": "no"}, {"name": "doc_no", "title": "证书/合同编号", "type": "str", "length": 64}, {"name": "tags", "title": "标签(逗号分隔)", "type": "str", "length": 500}, {"name": "file_path", "title": "文件路径", "type": "str", "length": 500}, {"name": "content_text", "title": "正文内容", "type": "text"}, {"name": "issuer", "title": "颁发/签约方", "type": "str", "length": 255}, {"name": "customer", "title": "案例客户", "type": "str", "length": 255}, {"name": "contract_amount", "title": "合同金额", "type": "float", "length": 18, "dec": 2}, {"name": "valid_from", "title": "生效日期", "type": "date"}, {"name": "valid_until", "title": "有效期至", "type": "date"}, {"name": "status", "title": "状态", "type": "str", "length": 16, "default": "active"}, {"name": "created_by", "title": "创建人", "type": "str", "length": 32}, {"name": "created_at", "title": "创建时间", "type": "timestamp", "nullable": "no"}, {"name": "updated_at", "title": "更新时间", "type": "timestamp"}]')
|
|
tblfname = [ f['name'] for f in tblfields ]
|
|
other_keys = [ k for k in ns.keys() if k in tblfname and k != 'id' ]
|
|
if len(other_keys) > 0:
|
|
r = await sor.U('bid_kb_docs', ns)
|
|
debug('update success');
|
|
return {
|
|
"widgettype":"Message",
|
|
"options":{
|
|
"title":"Update Success",
|
|
"cwidth":16,
|
|
"cheight":9,
|
|
"timeout":3,
|
|
"message":"ok"
|
|
}
|
|
}
|
|
|
|
return {
|
|
"widgettype":"Error",
|
|
"options":{
|
|
"title":"Update Error",
|
|
"cwidth":16,
|
|
"cheight":9,
|
|
"timeout":3,
|
|
"message":"failed"
|
|
}
|
|
} |