diff --git a/docker/examples/excel/example.xlsx b/docker/examples/excel/example.xlsx new file mode 100644 index 000000000..f049f345b Binary files /dev/null and b/docker/examples/excel/example.xlsx differ diff --git a/docker/examples/excel/zx.csv b/docker/examples/excel/zx.csv new file mode 100644 index 000000000..9e1d45724 --- /dev/null +++ b/docker/examples/excel/zx.csv @@ -0,0 +1,69 @@ +序号,大项,明细,备注,预算,实际,费用小计,超额,已支出,支出小计,其他 +1,中央空调,内外机,1拖5 140 31600,30600,30600,30600,0,30600,30600, +2,基装,地砖,,106000,32100,107948.4,1948.4,32100,107948.4,1948.4 +3,,地板,,,,,,,, +4,,门,颜色升级,,37450,,,37450,, +5,,橱柜,浴柜、马桶、花洒 自选,,,,,,, +6,,卫生间墙地,,,28149.4,,,28149.4,, +7,,厨房,墙、地(大改小增项)、菜盆去掉自选,,,,,,, +8,,打拆改建,,,10249,,,10249,, +9,其他费用,物业装修管理费(物业),405.58,26936.23,405.58,20836.23,-6100,405.58,20036.23, +10,,建渣清运费(物业),281.65,,281.65,,,281.65,, +11,,打拆清运费(物业),1300,,1300,,,1300,, +,,预交水费,200,,200,,,200,, +,,客卧加墙,1500,,1500,,,1500,, +,,天然气暗改,1800,,1800,,,1800,, +,,天然气明改,719,,719,,,719,, +,,开槽(150),0,,0,,,0,, +,,防水增加,358,,358,,,358,, +,,墙砖背胶(大砖上墙加背胶),208,,208,,,208,, +,,美缝3000,3100,,3100,,,2500,, +,,淋浴隔断(18980439828),3130,,3130,,,3130,, +,,橱柜增加费用,4500,,,,,,, +,,电费,200,,200,,,200,, +,,门锁,844,,844,,,844,, +,,空调机位封窗,1500,,1500,,,1300,, +,,开关灯安装,1000,,,,,,, +,,空调机位门,600,,,,,,, +,,瓷白胶,190,,190,,,190,, +,,瓷白胶人工,300,,300,,,300,, +,,每逢增加(橱柜浴柜),,,,,,,, +,,乳胶漆人工,,,,,,,, +12,,乳胶漆自购,4800,,4800,,,4800,, +13,水电改造,材料,16446,18636,16446,18425,-211,16446,18425, +14,,人工,,,,,,,, +,,开关插座补,531,,320,,,320,, +15,,开关插座,1659,,1659,,,1659,, +16,封窗,,15000,14500,14500,14500,0,4500,14500, +,,,,,,,,8000,, +17,,,,,,,,2000,, +18,基装(自购),马桶*2,9000,8200,8200,20000,,8200,20000, +19,,花洒*2,3000,4000,4000,,,4000,, +20,,浴柜*2,5000,4600,4600,,,4600,, +21,,菜盆,2500,3200,3200,,,3200,, +22,衣柜定做,鞋柜亮面、衣柜肤质、板材克诺斯邦、侧面表层,40*730,33000,5000,31000,,5000,31000, +23,,,,,15000,,,15000,, +,,,,,11000,,,11000,, +24,,,,,,,,,, +25,基础家电,燃气热水器,计划史密斯智能4000,3798,3798,18551,,3798,18841,24期免息 +,,燃气热水器安装,,355,355,,,355,, +26,,洗碗机,计划西门子5999,6999,6999,,,6999,, +27,,冰箱,计划西门子,6000,,,,,, +28,,电视,,8000,,,,,, +,,洗衣机(安装),,290,,,,290,, +,,抽油烟机+灶具(升级),方太型号升级,3900,3900,,,3900,, +29,,洗衣机,计划西门子6500,3499,3499,,,3499,, +30,软装,沙发,15000,71799.8,,10877.8,,,9777.8, +31,,茶几,5000,,,,,,, +32,,电视柜,6000,,,,,,, +33,,餐桌,7000,,,,,,, +34,,床*2,7000,,,,,,, +,,床垫*2,13000,,,,,,, +,,窗帘,10400,,10500,,,9400,, +,,洞灯,399.8,,377.8,,,377.8,, +,,书桌,2000,,,,,,, +35,,灯具,6000,,,,,,, +36,合计,,,354313.03,272738.43,272738.43,-4362.6,,271128.43,-83184.6 +37,,,,,,,,,, +38,双十一,,,,,38551,,,, +,,,,,,,,,, \ No newline at end of file diff --git a/pilot/base_modules/agent/db/my_plugin_db.py b/pilot/base_modules/agent/db/my_plugin_db.py index b021088db..acfb70e23 100644 --- a/pilot/base_modules/agent/db/my_plugin_db.py +++ b/pilot/base_modules/agent/db/my_plugin_db.py @@ -9,7 +9,10 @@ from pilot.base_modules.meta_data.meta_data import Base, engine, session class MyPluginEntity(Base): __tablename__ = "my_plugin" - + __table_args__ = { + "mysql_charset": "utf8mb4", + "mysql_collate": "utf8mb4_unicode_ci", + } id = Column(Integer, primary_key=True, comment="autoincrement id") tenant = Column(String(255), nullable=True, comment="user's tenant") user_code = Column(String(255), nullable=False, comment="user code") @@ -27,7 +30,7 @@ class MyPluginEntity(Base): created_at = Column( DateTime, default=datetime.utcnow, comment="plugin install time" ) - __table_args__ = (UniqueConstraint("user_code", "name", name="uk_name"),) + UniqueConstraint("user_code", "name", name="uk_name") class MyPluginDao(BaseDao[MyPluginEntity]): diff --git a/pilot/base_modules/agent/db/plugin_hub_db.py b/pilot/base_modules/agent/db/plugin_hub_db.py index 8507bcc8e..872324e33 100644 --- a/pilot/base_modules/agent/db/plugin_hub_db.py +++ b/pilot/base_modules/agent/db/plugin_hub_db.py @@ -1,7 +1,7 @@ from datetime import datetime import pytz from typing import List -from sqlalchemy import Column, Integer, String, Index, DateTime, func, Boolean +from sqlalchemy import Column, Integer, String, Index, DateTime, func, Boolean, DDL from sqlalchemy import UniqueConstraint from pilot.base_modules.meta_data.meta_data import Base @@ -9,8 +9,13 @@ from pilot.base_modules.meta_data.base_dao import BaseDao from pilot.base_modules.meta_data.meta_data import Base, engine, session +char_set_sql = DDL("ALTER TABLE plugin_hub CONVERT TO CHARACTER SET utf8mb4") class PluginHubEntity(Base): __tablename__ = "plugin_hub" + __table_args__ = { + "mysql_charset": "utf8mb4", + "mysql_collate": "utf8mb4_unicode_ci", + } id = Column( Integer, primary_key=True, autoincrement=True, comment="autoincrement id" ) @@ -26,10 +31,9 @@ class PluginHubEntity(Base): created_at = Column(DateTime, default=datetime.utcnow, comment="plugin upload time") installed = Column(Integer, default=False, comment="plugin already installed count") - __table_args__ = ( - UniqueConstraint("name", name="uk_name"), - Index("idx_q_type", "type"), - ) + UniqueConstraint("name", name="uk_name") + Index("idx_q_type", "type") + class PluginHubDao(BaseDao[PluginHubEntity]): diff --git a/pilot/memory/chat_history/chat_history_db.py b/pilot/memory/chat_history/chat_history_db.py index 2b1a57c28..6d66d5d4c 100644 --- a/pilot/memory/chat_history/chat_history_db.py +++ b/pilot/memory/chat_history/chat_history_db.py @@ -10,6 +10,10 @@ class ChatHistoryEntity(Base): id = Column( Integer, primary_key=True, autoincrement=True, comment="autoincrement id" ) + __table_args__ = { + "mysql_charset": "utf8mb4", + "mysql_collate": "utf8mb4_unicode_ci", + } conv_uid = Column( String(255), unique=False, @@ -21,12 +25,11 @@ class ChatHistoryEntity(Base): user_name = Column(String(255), nullable=True, comment="interlocutor") messages = Column(Text, nullable=True, comment="Conversation details") - __table_args__ = ( - UniqueConstraint("conv_uid", name="uk_conversation"), - Index("idx_q_user", "user_name"), - Index("idx_q_mode", "chat_mode"), - Index("idx_q_conv", "summary"), - ) + UniqueConstraint("conv_uid", name="uk_conversation") + Index("idx_q_user", "user_name") + Index("idx_q_mode", "chat_mode") + Index("idx_q_conv", "summary") + class ChatHistoryDao(BaseDao[ChatHistoryEntity]):