jiayongqiang 1 день назад
Родитель
Сommit
cec2e7eba3
3 измененных файлов с 8 добавлено и 3 удалено
  1. 2 2
      agent/src/agent/api_outter.py
  2. 2 1
      agent/tests/test_tagging.py
  3. 4 0
      agent/update.sql

+ 2 - 2
agent/src/agent/api_outter.py

@@ -115,8 +115,8 @@ def start_tagging(id:str, instucde: Optional[str] = None):
             logger.info(f"机构{instucde}在白名单中")
             is_marine = 1 if rows[0][0] == 'marine' else 0
     dao.execute(
-            """UPDATE aitag_tag_log SET state = %s, is_marine = %s, ai_result_starttime = %s WHERE id = %s""",
-            (TAGGING_STATE.BEGIN.value, is_marine, datetime.now(),  id)
+            """UPDATE aitag_tag_log SET state = %s, is_marine = %s,org_code = %s, ai_result_starttime = %s WHERE id = %s""",
+            (TAGGING_STATE.BEGIN.value, is_marine, instucde, datetime.now(),  id)
         )
 
 

+ 2 - 1
agent/tests/test_tagging.py

@@ -9,7 +9,8 @@ res = requests.post("http://10.192.72.13:9876/api/aitag/v1/tagging", json={
     # "sign": "test_sign",
     "esb_seq_no":"abc",
     "business_attr": "test_attr3",
-    "phrase": "职业:水产养殖人员 投向:内陆养殖 用途:养殖鲍鱼"
+    "phrase": "职业:水产养殖人员 投向:内陆养殖 用途:养殖鲍鱼",
+    "instucde": "9080803001"
 })
 
 logging.info(res.text)

+ 4 - 0
agent/update.sql

@@ -2,6 +2,10 @@
 ALTER TABLE ai_tagging.aitag_tag_log ADD is_marine bit DEFAULT 0;
 COMMENT ON COLUMN ai_tagging.aitag_tag_log.is_marine IS '是否是海洋标签,0:否,1:是';
 
+-- 添加法人行社代码字段
+ALTER TABLE ai_tagging.aitag_tag_log ADD org_code varchar(100);
+comment on column ai_tagging.aitag_tag_log.org_code is '法人行社代码';
+
 -- 创建行社白名单表
 CREATE TABLE ai_tagging.aitag_org_whitelist (
 	id varchar(100),