libushang 2 months ago
parent
commit
beb6aa4350
2 changed files with 14 additions and 13 deletions
  1. 2 1
      models/yzy_base.py
  2. 12 12
      routers/api/yst/daiban.py

+ 2 - 1
models/yzy_base.py

@@ -215,11 +215,12 @@ class YstYjylzjEntity(Base):
 
 #  待办
 class VwYstDaiban(Base):
-    __tablename__ = "vw_yst_daibian"
+    __tablename__ = "vw_yst_daiban"
 
     bzid = Column(String, primary_key=True, index=True)
     sfzh = Column(String)
     sxmc = Column(String)
+    xm = Column(String)
     create_time = Column(DateTime)
     update_time = Column(DateTime)
     status = Column(Integer)

+ 12 - 12
routers/api/yst/daiban.py

@@ -66,7 +66,7 @@ def index(
         }
 
     state = req.state
-    applyerIdNum = req.sfzh
+    applyerIdNum = req.applyerIdNum
     startTime = req.startTime
     endTime = req.endTime
     pageNum = req.pageNum
@@ -99,13 +99,13 @@ def index(
         where = and_(where, VwYstDaiban.status > 0)
 
     # 条数
-    q = db.query(func.count(VwYstDaiban.ghid))
+    q = db.query(func.count(VwYstDaiban.bzid))
     model_count = q.filter(where).scalar()
     print("model_count:", state, model_count)
 
     # 明细
     q = db.query(VwYstDaiban)
-    q = q.filter(where).order_by(VwYstDaiban.ghsj.desc())
+    q = q.filter(where).order_by(VwYstDaiban.update_time.desc())
     q = q.limit(pageSize).offset((int(pageNum) - 1) * pageSize)
     rows = q.all()
 
@@ -141,26 +141,26 @@ def new_record(data: dict):
     systemId = settings.YST_PASS_ID
     sourceSystemId = settings.YST_PASS_ID
     taskCodeLocal = shixiang
-    applyTime = from_timestamp(data['create_time'])
-    update_time = get_datetime_str(data['update_time'])
+    applyTime = data['create_time']
+    updateTime = data['update_time']
     cid = data['sfzh']
     name = data['xm']
     
     H5_HOST = "https://yst.mmsyjj.cn:8086"
-    if settings.IS_DEV:
+    if settings.IS_PROD == False:
         H5_HOST = "http://120.241.74.139:8086"
 
     if shixiang == 'qyjcxx':
         taskTitle = '应急企业基础信息'
-        detailURL = H5_HOST + '/mmh5_yjxm_yst/#/pages/mmyj/qyjcxx/index/index?id=' + data['bzid']
+        detailURL = H5_HOST + '/mmh5_yjxm_yst/#/pages/mmyj/qyjcxx/jdxq/index?id=' + data['bzid']
     
     elif shixiang == 'qyyjya':
         taskTitle = '应急预案上报'
-        detailURL = H5_HOST + '/mmh5_yjxm_yst/#/pages/mmyj/qyyjya/index/index?id=' + data['bzid']
+        detailURL = H5_HOST + '/mmh5_yjxm_yst/#/pages/mmyj/qyyjya/jdxq/index?id=' + data['bzid']
     
     elif shixiang == 'yjylzj':
         taskTitle = '应急演练总结'
-        detailURL = H5_HOST + '/mmh5_yjxm_yst/#/pages/mmyj/yjylzj/index/index?id=' + data['bzid']
+        detailURL = H5_HOST + '/mmh5_yjxm_yst/#/pages/mmyj/yjylzj/jdxq/index?id=' + data['bzid']
 
     state = '10'
     businessState = '待办'
@@ -177,10 +177,10 @@ def new_record(data: dict):
     #    state = '01'
     #    businessState = '待办'
     
-    if data['update_time']  < (datetime.now() - timedelta(days=365)):
+    if updateTime  < (datetime.now() - timedelta(days=365)):
         state = '09'
         businessState = '已删除'
-    if data['update_time']  < (datetime.now() - timedelta(days=180)):
+    if updateTime  < (datetime.now() - timedelta(days=180)):
         state = '04'
         businessState = '已过期'
         
@@ -220,7 +220,7 @@ def new_record(data: dict):
         # 办件详细信息URL
         'detailURL': detailURL,
         # 更新时间
-        'update_time': update_time,
+        'updateTime': updateTime,
         # 申请人信息
         'applyerInfo': {
             # 申请人类型