修复部分接口bug
This commit is contained in:
parent
2a1b0856da
commit
131b31013b
|
|
@ -367,6 +367,10 @@ def query_cross_examine_records_detail(params):
|
|||
final_state = row['final_state']
|
||||
first_date = row['first_date']
|
||||
level_color = row['level_color']
|
||||
end_date = row['end_date']
|
||||
if end_date:
|
||||
date_list = generate_date_range(first_date, end_date)
|
||||
else:
|
||||
date_list = generate_date_range(first_date, prev_day)
|
||||
phase_types = row['phase_type']
|
||||
phase_details = row['phase_detail']
|
||||
|
|
@ -438,7 +442,8 @@ def update_cross_examine_record_state(params):
|
|||
if not time_range:
|
||||
return json.dumps(make_common_res(10, '缺少时段范围, 请刷新后重试'))
|
||||
tp_start = int(str(time_range.split('-')[0]).split(':')[0]) * 100 + int(str(time_range.split('-')[0]).split(':')[1])
|
||||
ret = db_cross.update_cross_examine_record_state_sql(crossid, first_date, tp_start, final_state)
|
||||
end_date = datetime.now().strftime("%Y%m%d")
|
||||
ret = db_cross.update_cross_examine_record_state_sql(crossid, first_date, end_date, tp_start, final_state)
|
||||
if ret == 1:
|
||||
return json.dumps(make_common_res(0, 'ok'))
|
||||
return json.dumps(make_common_res(11, '修改失败,请检查后重试'))
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@ class CrossDbHelper(TableDbHelperBase):
|
|||
""" % (crossid, first_date, end_date)
|
||||
return self.do_select(sql)
|
||||
|
||||
def update_cross_examine_record_state_sql(self, crossid, first_date, start_hm, state):
|
||||
def update_cross_examine_record_state_sql(self, crossid, first_date, end_date, start_hm, state):
|
||||
sql = """
|
||||
update cross_doctor_matedata.cross_phase_problems_record set state = '%s' where crossid = '%s' and first_date = '%s' and start_hm = %s
|
||||
""" % (state, crossid, first_date, start_hm)
|
||||
update cross_doctor_matedata.cross_phase_problems_record set state = '%s', end_date = '%s' where crossid = '%s' and first_date = '%s' and start_hm = %s
|
||||
""" % (state, end_date, crossid, first_date, start_hm)
|
||||
return self.do_execute(sql)
|
||||
|
|
|
|||
Loading…
Reference in New Issue