Commit c3f26026 by dong

fix

parent 665ca72c
......@@ -33,6 +33,7 @@ def adds():
req_dic = json.loads(request.data)
token = request.headers['token']
tProjectFlows = req_dic['tProjectFlows']
d = datetime.now()
try:
obj = TKeyproject(
construction_address=req_dic["constructionAddress"],
......@@ -46,36 +47,30 @@ def adds():
project_name=req_dic["projectName"],
project_progress=req_dic["projectProgress"],
total_money=req_dic["totalMoney"],
# clogging_point=req_dic["cloggingPoint"],
# construction_address=req_dic["constructionAddress"],
# county=req_dic["county"],
# deadline_completion=req_dic["deadlineCompletion"],
# floor_space=req_dic["floorSpace"],
# investment_commitment=req_dic["investmentCommitment"],
# investment_entity=req_dic["investmentEntity"],
# leading_department=req_dic["leadingDepartment"],
# policy_statement=req_dic["policyStatement"],
# project_day=req_dic["projectDay"],
# project_introduce=req_dic["projectIntroduce"],
# project_leader=req_dic["projectLeader"],
# project_name=req_dic["projectName"],
# project_progress=req_dic["projectProgress"],
# project_status=req_dic["projectStatus"],
# responsible_department=req_dic["responsibleDepartment"],
# total_money=req_dic["totalMoney"]
)
db.session.add(obj)
db.session.commit()
project_id = obj.id
print(project_id)
status = ''
for i in tProjectFlows:
try:
st = i["tProjectFlowStopList"]
if st:
status = '遇到堵点'
except:
if i["startTime"] and d > i["startTime"]:
status = '已完成'
elif i["startTime"]:
status = '顺利推进'
else:
status = '未开始'
flow_obj = TProjectFlow(
end_time=i["endTime"],
process_schedule=i["processSchedule"],
project_id=project_id,
start_time=i["startTime"],
# status=i["status"]
status=status
)
db.session.add(flow_obj)
db.session.commit()
......@@ -301,7 +296,7 @@ def lsit1():
req_dic = request.get_json()
id = req_dic['id'] # ture or false
try:
log_obj_list = OperationLog.query.filter(OperationLog.operation_message.like(f"%{'项目台账'}%"))
log_obj_list = OperationLog.query.filter(OperationLog.operation_message.like(f"%{'项目台账'}%")).order_by(OperationLog.operation_time.desc())
total = log_obj_list.count()
data = [{
"createBy": "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment