Browse Source

no message

libushang 8 months ago
parent
commit
34d891e758
1 changed files with 32 additions and 2 deletions
  1. 32 2
      routers/api/infoPublish/me.py

+ 32 - 2
routers/api/infoPublish/me.py

@@ -29,7 +29,21 @@ from config import settings
 
 router = APIRouter()
 
-
+EXAMINE_TYPE_DICT = {
+    0: "草稿",
+    10: "提交",
+    20: "领导审批",
+    30: "重新提交"
+}
+
+EXAMINE_SUB_TYPE_DICT = {
+    0: "草稿",
+    10: "提交",
+    20: "待审批",
+    21: "审批通过",
+    22: "审批不通过",
+    30: "重新提交"
+}
     
 # 信息发布分页(我能看的内容,小屏)
 @router.get('/list')
@@ -187,7 +201,9 @@ async def get_info_detail(
                 "response_type": response_row.response_type,
                 "response_status": response_row.response_status,
                 "response_time": get_datetime_str(response_row.response_time),
-                "signature": get_signature_base64(db, response_row.id)                 
+                "signature": get_signature_base64(db, response_row.id),
+
+                "is_my_examine": row.examine_status == 1 and int(row.examine_by) == user_id # 是否我的审批事项                
             }
             
             # 附件
@@ -199,6 +215,20 @@ async def get_info_detail(
                 }
                 for row in rows
             ]
+
+            # 审批进度
+            data["examines"] = []
+            rows = db.query(InfoPublishExamine).filter(InfoPublishExamine.publish_id == id).filter(InfoPublishExamine.del_flag == '0').all()
+            for row in rows:
+                data["examines"].append({
+                    "examine_type": EXAMINE_TYPE_DICT[row.examine_type],
+                    "examine_sub_type": EXAMINE_SUB_TYPE_DICT[row.examine_sub_type],
+                    "content": row.content,
+                    "examine_time": get_datetime_str(row.examine_time),
+                    "user_id": row.user_id,
+                    "user_name": row.user_name,
+                    "nick_name": row.nick_name
+                })
             
             return {
                 "code": 200,