|
@@ -325,12 +325,12 @@ async def get_emergency_contact_list(
|
|
|
result.append(i.area_code)
|
|
|
return {
|
|
|
"code": 200,
|
|
|
- "msg": "更新成功",
|
|
|
+ "msg": "成功",
|
|
|
"data": result
|
|
|
}
|
|
|
@router.get('/list')
|
|
|
async def get_emergency_contact_list(
|
|
|
-zrlx:str= Query(None, description='责任类型'),
|
|
|
+zrlx:str= Query('sf;sf1;wh;', description='责任类型'),
|
|
|
type_parent_id: str = Query(None, description='单位名称'),
|
|
|
area_code:str = Query(None, description='单位名称'),
|
|
|
Name: str = Query(None, description='联系人'),
|
|
@@ -356,12 +356,13 @@ zrlx:str= Query(None, description='责任类型'),
|
|
|
lx.append( '森防')
|
|
|
if 'wh;' in zrlx:
|
|
|
lx.append('危化')
|
|
|
- if zrlx=='sf':
|
|
|
- return JSONResponse(status_code=404,content={"code":404,"msg":"责任人类型未查询到"})
|
|
|
+
|
|
|
# 构建查询
|
|
|
query = db.query(ThreeProofingResponsiblePerson)
|
|
|
query = query.filter(ThreeProofingResponsiblePerson.del_flag == '0')
|
|
|
- query = query.filter(ThreeProofingResponsiblePerson.responsible_type.like(f'%{lx}%'))
|
|
|
+ for i in lx:
|
|
|
+
|
|
|
+ query = query.filter(ThreeProofingResponsiblePerson.responsible_type.like(f'%{i}%'))
|
|
|
if 'zjResponsible' in roles:
|
|
|
for i in db.query(ThreeProofingResponsibleAdmin.area_code).filter(ThreeProofingResponsibleAdmin.user_id==user_id).all():
|
|
|
query = query.filter(ThreeProofingResponsiblePerson.area_code2.like(f'%{i.area_code}%'))
|