|
|
@ -60,7 +60,7 @@ class PrdItemViewSet(viewsets.ModelViewSet): |
|
|
|
print(db) |
|
|
|
print(db) |
|
|
|
db_conn = pymysql.Connect(**db) |
|
|
|
db_conn = pymysql.Connect(**db) |
|
|
|
db_cursor = db_conn.cursor(cursor=DictCursor) |
|
|
|
db_cursor = db_conn.cursor(cursor=DictCursor) |
|
|
|
sql = "select Shortcut, ModifiedOn from axshare.axshare_ShortcutKey;" |
|
|
|
sql = "select Shortcut, CreatedOn, ModifiedOn from axshare.axshare_ShortcutKey;" |
|
|
|
db_cursor.execute(sql) |
|
|
|
db_cursor.execute(sql) |
|
|
|
ax_cloud_data = db_cursor.fetchall() |
|
|
|
ax_cloud_data = db_cursor.fetchall() |
|
|
|
db_conn.close() |
|
|
|
db_conn.close() |
|
|
@ -69,12 +69,13 @@ class PrdItemViewSet(viewsets.ModelViewSet): |
|
|
|
shortcut_key = data.prd_doc_link.split(r'/')[-1] |
|
|
|
shortcut_key = data.prd_doc_link.split(r'/')[-1] |
|
|
|
for item in ax_cloud_data: |
|
|
|
for item in ax_cloud_data: |
|
|
|
if item['Shortcut'].lower() == shortcut_key.lower(): |
|
|
|
if item['Shortcut'].lower() == shortcut_key.lower(): |
|
|
|
data.update_at = item['ModifiedOn'] |
|
|
|
data.update_at = item['ModifiedOn'] if item['ModifiedOn'] is not None else item['CreatedOn'] |
|
|
|
page = self.paginate_queryset(queryset) |
|
|
|
page = self.paginate_queryset(queryset) |
|
|
|
serializer = self.get_serializer(page, many=True) |
|
|
|
serializer = self.get_serializer(page, many=True) |
|
|
|
return self.get_paginated_response(serializer.data) |
|
|
|
return self.get_paginated_response(serializer.data) |
|
|
|
return Response(None) |
|
|
|
return Response(None) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PrdHistoryViewSet(viewsets.ModelViewSet): |
|
|
|
class PrdHistoryViewSet(viewsets.ModelViewSet): |
|
|
|
# 字段注释 |
|
|
|
# 字段注释 |
|
|
|
""" |
|
|
|
""" |
|
|
|