Commit 2f07ed92 by dong

fix20221207

parent 522f2340
...@@ -1568,6 +1568,79 @@ class CarrierFactory(db.Model): ...@@ -1568,6 +1568,79 @@ class CarrierFactory(db.Model):
# transportation = db.Column(db.String(255), comment='交通设施(多个,列表形式,顿号分隔)') # transportation = db.Column(db.String(255), comment='交通设施(多个,列表形式,顿号分隔)')
# 载体资源库-产业地图-各载体类型面积数据表
class CarrierArea(db.Model):
__tablename_ = "carrier_area"
__table_args__ = ({'comment': '载体资源库-产业地图-各载体类型面积数据表'}) # 添加表注释
id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='主键id')
district_name = db.Column(db.String(20), comment='区域名称')
lng = db.Column(db.String(50), comment='经度')
lat = db.Column(db.String(50), comment='维度')
build_area = db.Column(db.String(20), comment='楼宇当前总面积(㎡)')
build_current_empty_area = db.Column(db.String(20), comment='楼宇当前闲置面积(㎡)')
build_last_empty_area = db.Column(db.String(20), comment='楼宇去年闲置面积(㎡)')
factory_area = db.Column(db.String(20), comment='厂房当前总面积(㎡)')
factory_current_empty_area = db.Column(db.String(20), comment='厂房当前闲置面积(㎡)')
factory_last_empty_area = db.Column(db.String(20), comment='厂房去年闲置面积(㎡)')
plan_land_store_area = db.Column(db.String(20), comment='计划土地储备面积(亩)')
plan_land_supply_area = db.Column(db.String(20), comment='计划土地供应面积(亩)')
plan_land_stock_area = db.Column(db.String(20), comment='计划土地存量面积(亩)')
land_area = db.Column(db.String(20), comment='土地当前总面积(亩)')
land_current_empty_area = db.Column(db.String(20), comment='土地当前闲置面积(亩)')
land_last_empty_area = db.Column(db.String(20), comment='土地去年闲置面积(亩)')
# 载体资源库-产业地图-水电气热能源数据表
class CarrierEnergy(db.Model):
__tablename_ = "carrier_energy"
__table_args__ = ({'comment': '载体资源库-产业地图-水电气热能源数据表'}) # 添加表注释
id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='主键id')
district_name = db.Column(db.String(20), comment='区域名称')
electric_one = db.Column(db.String(50), comment='居民用电(一档)(元/度)')
electric_two = db.Column(db.String(50), comment='居民用电(二档)(元/度)')
electric_three = db.Column(db.String(20), comment='居民用电(三档)(元/度)')
business_electric_feng = db.Column(db.String(20), comment='商业用电(峰段)(元/度)')
business_electric_ping = db.Column(db.String(20), comment='商业用电(平段)(元/度)')
business_electric_gu = db.Column(db.String(20), comment='商业用电(谷段)(元/度)')
industrial_electric_feng = db.Column(db.String(20), comment='工业电价(峰段)(元/度)')
industrial_electric_ping = db.Column(db.String(20), comment='工业电价(平段)(元/度)')
industrial_electric_gu = db.Column(db.String(20), comment='工业电价(谷段)(元/度)')
life_water_one = db.Column(db.String(20), comment='居民用水(一档)(元/吨)')
life_water_two = db.Column(db.String(20), comment='居民用水(二档)(元/吨)')
life_water_three = db.Column(db.String(20), comment='居民用水(三档)(元/吨)')
business_water = db.Column(db.String(20), comment='商业用水(元/吨)')
industrial_water = db.Column(db.String(20), comment='工业用水(元/吨)')
special_water = db.Column(db.String(20), comment='特种用水(元/吨)')
life_gas_one = db.Column(db.String(20), comment='居民用气(一档)(元/m³)')
life_gas_two = db.Column(db.String(20), comment='居民用气(二档)(元/m³)')
life_gas_three = db.Column(db.String(20), comment='居民用气(三档)(元/m³)')
# 载体资源库-产业地图-各区县闲置环比按月份区分显示图数据表
class CarrierAreaData(db.Model):
__tablename_ = "carrier_rate_data"
__table_args__ = ({'comment': '载体资源库-产业地图-各区县各载体闲置面积数据表'}) # 添加表注释
id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='主键id')
district_name = db.Column(db.String(20), comment='区域名称')
land_year = db.Column(db.String(20), comment='土地全年闲置面积')
land_one = db.Column(db.String(20), comment='土地第一季度闲置面积')
land_two = db.Column(db.String(20), comment='土地第二季度闲置面积')
land_three = db.Column(db.String(20), comment='土地第三季度闲置面积')
land_four = db.Column(db.String(20), comment='土地第四季度闲置面积')
factory_year = db.Column(db.String(20), comment='厂房全年闲置面积')
factory_one = db.Column(db.String(20), comment='厂房第一季度闲置面积')
factory_two = db.Column(db.String(20), comment='厂房第二季度闲置面积')
factory_three = db.Column(db.String(20), comment='厂房第三季度闲置面积')
factory_four = db.Column(db.String(20), comment='厂房第四季度闲置面积')
build_year = db.Column(db.String(20), comment='楼宇全年闲置面积')
build_one = db.Column(db.String(20), comment='楼宇第一季度闲置面积')
build_two = db.Column(db.String(20), comment='楼宇第二季度闲置面积')
build_three = db.Column(db.String(20), comment='楼宇第三季度闲置面积')
build_four = db.Column(db.String(20), comment='楼宇第四季度闲置面积')
# 记录操作日志得数据表 # 记录操作日志得数据表
class OperationLog(db.Model): class OperationLog(db.Model):
__tablename_ = "operation_log" __tablename_ = "operation_log"
......
...@@ -33,6 +33,53 @@ def create_token(api_user): ...@@ -33,6 +33,53 @@ def create_token(api_user):
return token return token
def verify_identity(token, action_name):
try:
user = verify_token(token)
user_id = user.id # 用户id
except Exception as e:
current_app.logger.error(e)
return jsonify(code=RET.SESSIONERR, msg="token过期,请重新登录!")
# 查出做此操作的用户名
user_obj = User.query.get(user_id)
# name = user_obj.name # 用户名
# real_name = user_obj.real_name # 用户名
mobile = user_obj.mobile
operation_mobile = user_obj.mobile
role_id = user_obj.role_id # 权限id
district_name = user_obj.district_name # 所属区县
unit = user_obj.unit # 所属机构
section = user_obj.section # 所属部门
belong_unit = ''
if district_name and unit and section:
belong_unit = district_name + unit + section
elif district_name and unit:
belong_unit = district_name + unit
elif district_name and section:
belong_unit = district_name + section
elif district_name:
belong_unit = district_name
elif unit:
belong_unit = unit
elif section:
belong_unit = section
print(mobile)
# if real_name:
user_name = user_obj.real_name # 真实姓名
# elif name and real_name:
# user_name = name + ': ' + real_name
# elif name:
# user_name = name
# elif real_name:
# user_name = real_name
# else:
# user_name = ''
return section, user_name, operation_mobile, user_id, role_id, belong_unit
def verify_token(token): def verify_token(token):
''' '''
校验token 校验token
......
...@@ -4,4 +4,6 @@ from flask import Blueprint ...@@ -4,4 +4,6 @@ from flask import Blueprint
api_address = Blueprint("api_address", __name__) api_address = Blueprint("api_address", __name__)
from . import view from . import view
from . import map_view
from . import fill_data
from sqlalchemy import text
from apps.models import CarrierFactory, CarrierBuild, CarrierLand
class Common(object):
@staticmethod
def get_total_land_area(time1, time2, district_name, land_nature, upload_time):
area_obj_list = CarrierLand.query.filter(
CarrierLand.audit_status == 1,
CarrierLand.upload_time > time1 if time1 else text(''),
CarrierLand.upload_time < time2 if time2 else text(''),
CarrierLand.land_nature == land_nature if land_nature else text(''),
CarrierLand.district_name == district_name if district_name else text(''),
CarrierLand.upload_time > upload_time if upload_time else text(''),
).all()
return area_obj_list
@staticmethod
def get_total_factory_area(time1, time2, district_name):
area_obj_list = CarrierFactory.query.filter(
CarrierFactory.upload_time > time1 if time1 else text(''),
CarrierFactory.upload_time < time2 if time2 else text(''),
CarrierFactory.audit_status == 1,
CarrierFactory.district_name == district_name if district_name else text(''),
).all()
return area_obj_list
@staticmethod
def get_empty_factory_area(time1, time2, upload_time, district_name):
empty_area_obj_list = CarrierFactory.query.filter(
CarrierFactory.upload_time > time1 if time1 else text(''),
CarrierFactory.upload_time < time2 if time2 else text(''),
CarrierFactory.audit_status == 1,
CarrierFactory.district_name == district_name if district_name else text(''),
CarrierFactory.upload_time > upload_time if upload_time else text('')
).all()
return empty_area_obj_list
@staticmethod
def get_total_build_area(time1, time2, district_name):
area_obj_list = CarrierBuild.query.filter(
CarrierBuild.upload_time > time1 if time1 else text(''),
CarrierBuild.upload_time < time2 if time2 else text(''),
CarrierBuild.audit_status == 1,
CarrierBuild.district_name == district_name if district_name else text(''),
).all()
return area_obj_list
@staticmethod
def get_empty_build_area(time1, time2, upload_time, district_name):
empty_area_obj_list = CarrierBuild.query.filter(
CarrierBuild.upload_time > time1 if time1 else text(''),
CarrierBuild.upload_time < time2 if time2 else text(''),
CarrierBuild.audit_status == 1,
CarrierBuild.district_name == district_name if district_name else text(''),
CarrierBuild.upload_time > upload_time if upload_time else text('')
).all()
return empty_area_obj_list
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -15,30 +15,48 @@ from apps import db, constants, redis_store ...@@ -15,30 +15,48 @@ from apps import db, constants, redis_store
# 获取左上角经济指标数据 # 获取左上角经济指标数据
def get_jjzb(district): def get_jjzb(district, year):
'''经济指标数据''' '''经济指标数据'''
# years = [2021] # 指定数据的年份,与数据库中数据对齐 year1 = datetime.now().year - 1
year2 = datetime.now().year
years = ''
if year == year1:
years = str(year) + '年'
if year == year2:
month = datetime.now().month
years = str(year) + '年1-' + str(month) + '月'
try: try:
if not district or district == '晋城市': if not district or district == '晋城市':
datas = City.query.filter_by(area='晋城市').first() datas = City.query.filter_by(area='晋城市', year=year).first()
else: else:
datas = City.query.filter_by(area=district).first() datas = City.query.filter_by(area=district, year=year).first()
df_dic = {"GDP": '%.2f亿元' % (datas.GDP / 10000) if datas.GDP else "-亿元", # 地区生产总值 df_dic = ''
"addscale": '%.2f' % datas.addscale + "%" if datas.addscale else "-%", # 规上工业增加值增速 if datas:
"investment": '%.2f亿元' % (datas.investment / 10000) if datas.investment else "-亿元", # 固定资产投资 df_dic = {"GDP": '%.2f亿元' % (datas.GDP / 10000) if datas.GDP else "-亿元", # 地区生产总值
"retail": '%.2f亿元' % (datas.retail / 10000) if datas.retail else "-亿元", # 社会消费品零售额 "addscale": '%.2f' % datas.addscale + "%" if datas.addscale else "-%", # 规上工业增加值增速
"in_out": '%.2f亿元' % (datas.in_out / 10000) if datas.in_out else "-亿元", # 进出口总额 "investment": '%.2f亿元' % (datas.investment / 10000) if datas.investment else "-亿元", # 固定资产投资
# "public_in": '%.2f亿元' % (datas.public_in / 10000) if datas.public_in else "-亿元", # 一般公共预算收入 "retail": '%.2f亿元' % (datas.retail / 10000) if datas.retail else "-亿元", # 社会消费品零售额
"public": '%.2f亿元' % (datas.public / 10000) if datas.public else "-亿元", # 一般公共预算支出 "in_out": '%.2f亿元' % (datas.in_out / 10000) if datas.in_out else "-亿元", # 进出口总额
"people_out": '%.2f元' % datas.people_out if datas.people_out else "-元", # 居民人均可支配收入 "public": '%.2f亿元' % (datas.public / 10000) if datas.public else "-亿元", # 一般公共预算支出
"people_per": '%.2f' % datas.people_per if datas.people_per else "-", "people_out": '%.2f元' % datas.people_out if datas.people_out else "-元", # 居民人均可支配收入
"question": datas.question "people_per": '%.2f' % datas.people_per if datas.people_per else "-",
} # 居民消费价格指数 "question": datas.question,
"year": years
# print(df_dic) } # 居民消费价格指数
# return jsonify(code=RET.OK, msg="查找成功", data=df) else:
df_dic = {"GDP": '', # 地区生产总值
"addscale": '', # 规上工业增加值增速
"investment": '', # 固定资产投资
"retail": '', # 社会消费品零售额
"in_out": '', # 进出口总额
"public": '', # 一般公共预算支出
"people_out": '', # 居民人均可支配收入
"people_per": '',
"question": '',
"year": years
} # 居民消费价格指数
return df_dic return df_dic
# return df
except Exception as e: except Exception as e:
current_app.logger.error(e) current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="数据库错误") return jsonify(code=RET.DBERR, msg="数据库错误")
...@@ -102,22 +120,22 @@ def menu(): ...@@ -102,22 +120,22 @@ def menu():
zjtg_sjxjr = company.filter_by(zjtg_sjxjr="1").count() # 省级专精特新小巨人企业 zjtg_sjxjr = company.filter_by(zjtg_sjxjr="1").count() # 省级专精特新小巨人企业
table_dic = { table_dic = {
# "t_c5": t_c5, # 500强企业
"ssqy": ssqy, # 上市企业 "ssqy": ssqy, # 上市企业
"gmys": gmys, # 规模以上企业 "gmys": gmys, # 规模以上企业
"zjtx": zjtx, # 专精特新企业 "zjtx": zjtx, # 专精特新企业
"gxjs": gxjs, # 高新技术企业 "gxjs": gxjs, # 高新技术企业
"kjzx": kjzx, # 科技型中小企业 "kjzx": kjzx, # 科技型中小企业
# "dengl": dengl, # 瞪羚企业
# "dujs": dujs, # 独角兽企业
"tbe_sjmy": tbe_sjmy, # 省级民营科技企业 "tbe_sjmy": tbe_sjmy, # 省级民营科技企业
"zjtg_gjjxjr": zjtg_gjjxjr, # 国家级专精特新小巨人企业 "zjtg_gjjxjr": zjtg_gjjxjr, # 国家级专精特新小巨人企业
"zjtg_sjxjr": zjtg_sjxjr # 省级专精特新小巨人企业 "zjtg_sjxjr": zjtg_sjxjr # 省级专精特新小巨人企业
} }
# 2. 左上角获取经济指标数据 # 2. 左上角获取经济指标数据
jjzb_data = get_jjzb(district) year = datetime.now().year - 1
jjzb_data = get_jjzb(district, year)
year = datetime.now().year
jjzb_data1 = get_jjzb(district, year)
# 3. 产业结构分布饼状图数据统计 # 3. 产业结构分布饼状图数据统计
count_all = company.count() count_all = company.count()
if count_all == 0: if count_all == 0:
...@@ -155,6 +173,7 @@ def menu(): ...@@ -155,6 +173,7 @@ def menu():
data = { data = {
"jjzb_dic": jjzb_data, # 左上角经济指标数据 "jjzb_dic": jjzb_data, # 左上角经济指标数据
"jjzb_dic1": jjzb_data1, # 左上角经济指标数据
"table_dic": table_dic, # 左上角企业数据统计 "table_dic": table_dic, # 左上角企业数据统计
"industry_dic": indu_dic # 产业结构分布饼状图数据 "industry_dic": indu_dic # 产业结构分布饼状图数据
} }
......
...@@ -164,44 +164,104 @@ def enterprise(): ...@@ -164,44 +164,104 @@ def enterprise():
太原市企业列表 太原市企业列表
:return: :return:
''' '''
req_dict = request.get_json() # req_dict = request.get_json()
inid = req_dict.get("inid") # 行业id # inid = req_dict.get("inid") # 行业id
page = req_dict.get("page") # 分页页码 # page = req_dict.get("page") # 分页页码
perpage = req_dict.get("perpage") # 分页大小 # perpage = req_dict.get("perpage") # 分页大小
province = req_dict.get("province") # province = req_dict.get("province")
city = req_dict.get("city") # city = req_dict.get("city")
district = req_dict.get("district") # district = req_dict.get("district")
product = req_dict.get("product") # 产业产品选择 # product = req_dict.get("product") # 产业产品选择
#
if not all([page, perpage]): # if not all([page, perpage]):
return jsonify(code=RET.PARAMERR, msg="参数不完整") # return jsonify(code=RET.PARAMERR, msg="参数不完整")
#
# try:
# if inid: # 子行业分类
# enterprise = Enterprise.query.filter_by(c_type=inid)
# else:
# enterprise = Enterprise.query.filter_by()
# # 区域选择
# if province:
# enterprise = enterprise.filter_by(province=province)
# if city:
# enterprise = enterprise.filter_by(city=city)
# if district:
# enterprise = enterprise.filter_by(district=district)
# if product:
# enterprise = enterprise.filter(Enterprise.product_all.like("%{}%".format(product)))
# size = enterprise.count()
# enterprise = enterprise.order_by(Enterprise.hots.desc()).paginate(page, perpage).items # 企业热度倒序
#
# df = [{"id": i.id,
# "company_name": i.company_name,
# "hots": i.hots,
# "aptitude": ['是否高新技术企业' if i.high_new == '1' else
# '是否科技型中小企业' if i.tbe == '1' else
# '是否上市企业' if i.quoted_company == '1' else
# '是否山西民营100强' if i.sxmon == '1' else
# '是否为山西专精特新企业' if i.zjtg == '1' else
# '独角兽企业' if i.unicorn == '1' else
# '瞪羚' if i.dengl == '1' else
# '是否中国500强' if i.isfive == '1' else
# '规模以上企业' if i.scale == '1' else
# '限额以上服务业' if i.serve == '1' else '']
# } for i in enterprise]
# data = {"size": size, "df": df}
# except Exception as e:
# current_app.logger.error(e)
# return jsonify(code=RET.DBERR, msg="数据库查询错误")
#
# return jsonify(code=RET.OK, msg="获取成功", data=data)
req_dic = request.get_json()
entype = req_dic['entype']
aptitude = req_dic['aptitude'] # 资质
company_name = req_dic['company_name']
status = req_dic['status']
page = req_dic['page']
per_page = req_dic['per_page']
try: try:
if inid: # 子行业分类 enterprise_obj = Enterprise.query.filter(or_(
enterprise = Enterprise.query.filter_by(c_type=inid) Enterprise.entype == entype,
else: Enterprise.company_name.like('%{}%'.format(company_name)),
enterprise = Enterprise.query.filter_by() Enterprise.status == status,
# 区域选择 Enterprise.high_new == '1' if aptitude == '是否高新技术企业' else text(''),
if province: Enterprise.tbe == '1' if aptitude == '是否科技型中小企业' else text(''),
enterprise = enterprise.filter_by(province=province) Enterprise.quoted_company == '1' if aptitude == '是否上市企业' else text(''),
if city: Enterprise.sxmon == '1' if aptitude == '是否山西民营100强' else text(''),
enterprise = enterprise.filter_by(city=city) Enterprise.zjtg == '1' if aptitude == '是否为山西专精特新企业' else text(''),
if district: Enterprise.unicorn == '1' if aptitude == '独角兽企业' else text(''),
enterprise = enterprise.filter_by(district=district) Enterprise.dengl == '1' if aptitude == '瞪羚' else text(''),
if product: Enterprise.isfive == '1' if aptitude == '是否中国500强' else text(''),
enterprise = enterprise.filter(Enterprise.product_all.like("%{}%".format(product))) Enterprise.scale == '1' if aptitude == '规模以上企业' else text(''),
size = enterprise.count() Enterprise.serve == '1' if aptitude == '限额以上服务业' else text(''),
enterprise = enterprise.order_by(Enterprise.hots.desc()).paginate(page, perpage).items # 企业热度倒序 ))
size = enterprise_obj.count()
enterprise_obj_list = enterprise_obj.paginate(page, per_page).items
data = [{
"id": enterprise_obj.id,
"enterprise_name": enterprise_obj.enterprise_name,
"district": enterprise_obj.district,
"entype": enterprise_obj.entype,
"aptitude": ["是否高新技术企业" if enterprise_obj.high_new == '1' else
"是否科技型中小企业" if enterprise_obj.tbe == '1' else
"是否上市企业" if enterprise_obj.quoted_company == '1' else
"是否山西民营100强" if enterprise_obj.sxmon == '1' else
"是否为山西专精特新企业" if enterprise_obj.zjtg == '1' else
"独角兽企业" if enterprise_obj.unicorn == '1' else
"瞪羚" if enterprise_obj.dengl == '1' else
"是否中国500强" if enterprise_obj.isfive == '1' else
"规模以上企业" if enterprise_obj.scale == '1' else
"限额以上服务业" if enterprise_obj.serve == '1' else '']
} for enterprise_obj in enterprise_obj_list]
data = {"size": size, "df": data}
df = [{"id": i.id, return jsonify(code=RET.OK, data=data, msg='查询成功。')
"company_name": i.company_name,
"hots": i.hots} for i in enterprise]
data = {"size": size, "df": df}
except Exception as e: except Exception as e:
current_app.logger.error(e) current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="数据库查询错误") return jsonify(code=RET.DBERR, msg='查询出错!')
return jsonify(code=RET.OK, msg="获取成功", data=data)
# 招商地图下的散点图(至区后) # 招商地图下的散点图(至区后)
......
...@@ -1009,6 +1009,8 @@ def search_enterprise(): ...@@ -1009,6 +1009,8 @@ def search_enterprise():
Enterprise.scale == '1' if aptitude == '规模以上企业' else text(''), Enterprise.scale == '1' if aptitude == '规模以上企业' else text(''),
Enterprise.serve == '1' if aptitude == '限额以上服务业' else text(''), Enterprise.serve == '1' if aptitude == '限额以上服务业' else text(''),
)) ))
size = enterprise_obj.count()
enterprise_obj_list = enterprise_obj.paginate(page, per_page).items enterprise_obj_list = enterprise_obj.paginate(page, per_page).items
data = [{ data = [{
"id": enterprise_obj.id, "id": enterprise_obj.id,
...@@ -1026,7 +1028,9 @@ def search_enterprise(): ...@@ -1026,7 +1028,9 @@ def search_enterprise():
"规模以上企业" if enterprise_obj.scale == '1' else "规模以上企业" if enterprise_obj.scale == '1' else
"限额以上服务业" if enterprise_obj.serve == '1' else ''] "限额以上服务业" if enterprise_obj.serve == '1' else '']
} for enterprise_obj in enterprise_obj_list] } for enterprise_obj in enterprise_obj_list]
data = {"size": size, "df": data}
return jsonify(code=RET.OK, data=data, msg='查询成功。') return jsonify(code=RET.OK, data=data, msg='查询成功。')
except Exception as e: except Exception as e:
current_app.logger.error(e) current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg='查询出错!') return jsonify(code=RET.DBERR, msg='查询出错!')
\ No newline at end of file
...@@ -835,53 +835,6 @@ def fix_user_info(): ...@@ -835,53 +835,6 @@ def fix_user_info():
return jsonify(code=RET.OK, msg="修改成功") return jsonify(code=RET.OK, msg="修改成功")
# 用户中心-收藏界面获取收藏的产业
# @api_user.route("/GetCollectIndustry", methods=["GET"])
# @login_required
# def get_collect_industry():
# token = request.headers["token"]
# try:
# user = verify_token(token)
# user_id = user.id
# except:
# return jsonify(code=RET.SESSIONERR, msg='个人信息校验失败,请重新登录!')
#
# try:
# industry_obj_li = IndustryCollect.query.filter(IndustryCollect.user_id == user_id).all()
# data = [{
# "industry_id": industry_obj.id,
# "industry_name": industry_obj.industry_name
# } for industry_obj in industry_obj_li]
# return jsonify(code=RET.OK, data=data, msg="获取成功")
# except Exception as e:
# current_app.logger.error(e)
# return jsonify(code=RET.DBERR, msg="数据库错误")
# # 用户中心-取消收藏
# @api_user.route("/CancelCollectIndustry", methods=["POST"])
# @login_required
# def cancel_collect_industry():
# token = request.headers["token"]
# try:
# user = verify_token(token)
# user_id = user.id
# except:
# return jsonify(code=RET.SESSIONERR, msg='个人信息校验失败,请重新登录!')
# req_dict = request.get_json()
# industry_name = req_dict['industry_name']
#
# try:
# collect_obj = IndustryCollect.query.filter_by(industry_name=industry_name).first()
# db.session.delete(collect_obj)
# db.session.commit()
# return jsonify(code=RET.OK, msg="取消收藏成功。")
# except Exception as e:
# db.session.rollback() # 回滚数据库
# current_app.logger.error(e)
# return jsonify(code=RET.DBERR, msg="数据库错误")
# 查看收藏-收藏的企业和行业 # 查看收藏-收藏的企业和行业
@api_user.route("/GetCollect", methods=["POST"]) @api_user.route("/GetCollect", methods=["POST"])
@login_required @login_required
......
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