Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3e697d4

Browse files
committed
月报表 修复白天脚本会删除当前处理月数据的问题和手动执行脚本,同时支持全机构(1夜间生成,2白天生成)均会处理.
1 parent e3c0e39 commit 3e697d4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

‎com/lc/demo/pythonReportDemo/reportMonthlyKingDemo/python_report_monthly_app_king3_with_del.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,11 @@ def del_all_scada_report_monthly_by_year_month(srh_year, srh_month):
526526

527527

528528
# 获取所有需要跑脚本的机构信息
529-
# 字段:ORG_REPORT_GENERATE 是否计算生成报表:0不生成,1生成
529+
# 字段:ORG_REPORT_GENERATE 是否计算生成报表:0不生成,1夜间生成,2白天生成
530530
# 根据 ORG_ID 排序,倒叙
531531
def get_all_org_id_for_run_py_command_script_from_select_db():
532-
sql = "select * from ORGANIZATION where ORG_REPORT_GENERATE= :org_report_generate order by ORG_ID desc"
533-
data = [{"org_report_generate": "1"}]
532+
sql = "select * from ORGANIZATION where ORG_REPORT_GENERATE= :org_report_generate OR ORG_REPORT_GENERATE= :org_report_generate2 order by ORG_ID desc"
533+
data = [{"org_report_generate": "1", "org_report_generate2": "2", }]
534534
fc = db.select_by_where_many_params_dict(sql, data)
535535
return fc
536536

@@ -1009,4 +1009,4 @@ def del_first_before_main(db, months):
10091009
print("程序运行开始time.clock():", begin_time_clock)
10101010
print("程序运行结束time.clock():", end_time_clock)
10111011
print("整个程序运行总时间time.clock()差:", (end_time_clock - begin_time_clock), "秒")
1012-
print("----------------------------------------------------------------------------------------")
1012+
print("----------------------------------------------------------------------------------------")

‎com/lc/demo/pythonReportDemo/reportMonthlyKingDemo/python_report_monthly_app_king3_with_del_with_day.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,9 @@ def del_first_before_main(db, months):
961961
else:
962962
this_month = str(this_month)
963963

964-
print('为了月报表计算数据,接下来要删除SCADA_REPORT_MONTHLY月报表数据,对应年月为:', str(this_year), this_month)
964+
print('为了月报表计算数据,接下来要删除SCADA_REPORT_MONTHLY月报表数据(这里是白天脚本 不删除原来的 直接计算即可),对应年月为:', str(this_year), this_month)
965965
print('----------------------------------------------------------------------------------------------------')
966-
del_all_scada_report_monthly_by_year_month(str(this_year), this_month)
966+
# del_all_scada_report_monthly_by_year_month(str(this_year), this_month)
967967
print('开始此次月报表计算操作--------------------------------------------------')
968968
return True
969969
# print(yesterday_min, yesterday_max) # 2020年04月16日 00:00:00 2020年04月16日 23:59:59.999999
@@ -991,6 +991,7 @@ def del_first_before_main(db, months):
991991

992992
# which_month 代表跑哪月
993993
which_month = 0
994+
# 这里是白天生成的脚本 机构数很少 所以就不能删除 已将删除语句隐掉
994995
if del_first_before_main(db, which_month):
995996
# 循环 org_list @param db实例 # @param org_id 要查询机构号 @param months 0代表当前月 +n代表n月后 -n代表n月前 默认为-1 跑上个月的数据
996997
for x in org_list:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /