supplychain/wwwroot/api/get_search_supplier_id.dspy
Hermes Agent bfc50f2364 feat: 补充供销协议和协议产品明细折扣CRUD管理
- 新增 json/supply_contracts_list.json CRUD定义(供销协议管理)
- 新增 json/supply_contract_items_list.json CRUD定义(协议产品明细折扣)
- 修复 json/suppliers_list.json JSON语法错误(缺少逗号)
- 修复6个API dspy文件违规(移除import/print,改用return)
- 新增4个搜索API(供应商/合同/产品分类/产品下拉数据)
- 新增 supplychain/__init__.py 导出所有公共函数
- 重新生成CRUD UI文件并修正editable URL指向自定义API
- 更新load_path.py注册新路径
- 添加.gitignore排除自动生成文件
2026-06-17 15:03:46 +08:00

17 lines
719 B
Plaintext

result = [{'supplier_id': '', 'supplier_id_text': '全部'}]
try:
userorgid = await get_userorgid()
if not userorgid:
return json.dumps(result, ensure_ascii=False)
db = DBPools()
dbname = get_module_dbname('supplychain')
async with db.sqlorContext(dbname) as sor:
rows = await sor.sqlExe(
"select id as supplier_id, supplier_name as supplier_id_text from suppliers where resellerid = ${userorgid}$ and status = '1' order by supplier_name",
{"userorgid": userorgid}
)
return json.dumps(result + list(rows), ensure_ascii=False)
except Exception as e:
debug(f'get_search_supplier_id error: {e}')
return json.dumps(result, ensure_ascii=False)