余尚辉 před 4 měsíci
rodič
revize
e613988397
1 změnil soubory, kde provedl 27 přidání a 27 odebrání
  1. 27 27
      src/core/callcenter/dao.py

+ 27 - 27
src/core/callcenter/dao.py

@@ -19,8 +19,8 @@ class Bucket(db.Model):
     lower = db.Column(db.String(32), nullable=False, default='', comment='下限')
     upper = db.Column(db.String(64), nullable=False, default='', comment='上限')
     config = db.Column(db.String(100), nullable=False, default='', comment='拓展配置')
-    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
-    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间' )
+    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
+    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='创建时间' )
 
     __table_args__ = (
         db.Index('idx_eid', 'eid', mysql_using='BTREE'),
@@ -61,8 +61,8 @@ class Agent(db.Model):
     agent_state = db.Column(db.SmallInteger, nullable=False, default=0, comment='账号状态 0:可用; 1:禁用')
     identity_type = db.Column(db.SmallInteger, nullable=False, default=0, comment='身份标识')
     is_delete = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标识')
-    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
-    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
+    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
+    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='创建时间')
     user_id= db.Column(db.BigInteger, nullable=False, default='', comment='用户id')
 
     __table_args__ = (
@@ -122,8 +122,8 @@ class AgentActionLog(db.Model):
     event_type = db.Column(db.Integer, nullable=False, default=0, comment='日志事件类型')
     event_desc = db.Column(db.String(100), nullable=False, default='', comment='日志事件描述')
     is_delete = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标识')
-    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
-    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
+    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
+    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='创建时间')
 
     __table_args__ = (
         db.Index('idx_create_time', 'create_time'),
@@ -180,8 +180,8 @@ class AgentLog(db.Model):
     event = db.Column(db.String(32), nullable=False, default='0', comment='事件')
     content = db.Column(db.String(64), nullable=False, default='', comment='描述')
     is_delete = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标识')
-    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
-    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
+    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
+    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='创建时间')
 
     __table_args__ = (
         db.Index('idx_saas_id_agent_num', 'saas_id', 'agent_num'),
@@ -222,19 +222,19 @@ class AgentMonitor(db.Model):
     identity_type = db.Column(db.SmallInteger, nullable=False, default=0, comment='身份标识')
     check_state = db.Column(db.SmallInteger, nullable=False, default=1, comment='是否签入 0:是 1:否 默认未签入')
     check_scene = db.Column(db.String(16), nullable=False, default='', comment='迁入场景')
-    check_in_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='签入时间')
-    check_out_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='签出时间')
+    check_in_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='签入时间')
+    check_out_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='签出时间')
     service_state = db.Column(db.SmallInteger, nullable=False, default=0, comment='坐席服务状态 0: 未登录(签出) 1: 置忙 2: 置闲 3: 通话中 4: 后处理 5: 拨号中')
-    busy_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='置忙时间')
-    idle_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='置闲时间')
-    call_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='接通时间')
-    hang_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='挂断时间')
+    busy_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='置忙时间')
+    idle_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='置闲时间')
+    call_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='接通时间')
+    hang_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='挂断时间')
     heart_state = db.Column(db.SmallInteger, nullable=False, default=0, comment='心跳状态 0: 默认 1:正常  2: 异常')
-    heart_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='正常心跳时间')
+    heart_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='正常心跳时间')
     session_id = db.Column(db.String(64), nullable=False, default='', comment='sessionId')
     is_delete = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标识')
-    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
-    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
+    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
+    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='创建时间')
 
     __table_args__ = (
         db.UniqueConstraint('saas_id', 'agent_num', name='uniq_saas_id_agent_num'),
@@ -285,8 +285,8 @@ class Phone(db.Model):
     wss_server = db.Column(db.String(64), nullable=False, default='', comment='WSS服务器')
     ice_server = db.Column(db.String(64), nullable=False, default='', comment='ICE服务器')
     is_delete = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标识')
-    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
-    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
+    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
+    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='创建时间')
 
     __table_args__ = (
         db.Index('idx_vcc_id_phone_num', 'saas_id', 'phone_num'),
@@ -333,8 +333,8 @@ class HumanService(db.Model):
     queue_music = db.Column(db.String(32), nullable=False, default='', comment='排队音 全局配置')
     direct_queue_type = db.Column(db.String(32), nullable=False, default='', comment='直接连接 媒体类型 默认1 接入码直接转人工服务能听到排队音 0:直接排队不连接媒体; 1:直接排队连接媒体 全局配置')
     is_delete = db.Column(db.Boolean, nullable=False, default=False, comment='删除标识')
-    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
-    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
+    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
+    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='创建时间')
 
     # Indexes
     __table_args__ = (
@@ -380,8 +380,8 @@ class HumanServiceMap(db.Model):
     agent_id = db.Column(db.String(32), nullable=False, default='', comment='坐席工号')
     state = db.Column(db.Boolean, nullable=False, default=0, comment='状态 1激活(签入)')
     is_delete = db.Column(db.Boolean, nullable=False, default=0, comment='删除标识')
-    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, onupdate=datetime.utcnow, comment='更新时间')
-    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.utcnow, comment='创建时间')
+    update_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, onupdate=datetime.now, comment='更新时间')
+    create_time = db.Column(db.TIMESTAMP, nullable=False, default=datetime.now, comment='创建时间')
 
     # Indexes
     __table_args__ = (
@@ -415,9 +415,9 @@ class Whitelist(db.Model):
     del_flag = db.Column(db.SmallInteger, nullable=False, default=False, comment='删除标志(0代表存在 2代表删除)')
     revision = db.Column(db.Integer, nullable=True, comment='乐观锁')
     create_by = db.Column(db.String(32), nullable=True, comment='创建人')
-    create_time = db.Column(db.DateTime, nullable=True, default=datetime.utcnow, comment='创建时间')
+    create_time = db.Column(db.DateTime, nullable=True, default=datetime.now, comment='创建时间')
     update_by = db.Column(db.String(32), nullable=True, comment='更新人')
-    update_time = db.Column(db.DateTime, nullable=True, onupdate=datetime.utcnow, comment='更新时间')
+    update_time = db.Column(db.DateTime, nullable=True, onupdate=datetime.now, comment='更新时间')
     remark = db.Column(db.String(500), nullable=True, comment='备注')
 
     def to_dict(self):
@@ -459,9 +459,9 @@ class CallRecord(db.Model):
     del_flag = db.Column(db.SmallInteger, nullable=False, default=0, comment='删除标志(0代表存在 2代表删除)')
     revision = db.Column(db.Integer, nullable=True, comment='乐观锁')
     create_by = db.Column(db.String(32), nullable=True, default="admin", comment='创建人')
-    create_time = db.Column(db.DateTime, nullable=True, default=datetime.utcnow, comment='创建时间')
+    create_time = db.Column(db.DateTime, nullable=True, default=datetime.now, comment='创建时间')
     update_by = db.Column(db.String(32), nullable=True, default="admin", comment='更新人')
-    update_time = db.Column(db.DateTime, nullable=True, onupdate=datetime.utcnow, comment='更新时间')
+    update_time = db.Column(db.DateTime, nullable=True, onupdate=datetime.now, comment='更新时间')
 
     def __repr__(self):
         return json.dumps(self.to_dict())