webapi.py 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659
  1. import json
  2. import requests
  3. from hytest.common import *
  4. from pandas.io.formats.style import properties_args
  5. from sympy.physics.vector.printing import params
  6. from cfg import cfg
  7. from bs4 import BeautifulSoup
  8. from requests.packages import urllib3
  9. #存放公用方法
  10. # 存储 全局共享 数据
  11. GSTORE = {}
  12. class APIMgr():
  13. #打印https请求与消息
  14. def __init__(self):
  15. self.ui = None
  16. self.token = None
  17. def printRequest(self,req):
  18. if req.body==None:
  19. msgBody=''
  20. else:
  21. msgBody=req.body
  22. self.ui.outputWindow.append(
  23. '{}\n{}\n{}\n\n{}'.format(
  24. '\n\n-------发送请求--------',
  25. req.method+''+req.url,
  26. '\n'.join('{}:{}'.format(k,v) for k,v in req.headers.items()),
  27. msgBody,
  28. ))
  29. # 打印http相应消息的函数
  30. def printResponse(self, response):
  31. print('\n\n----- https response begin -----')
  32. print(response.status_code)
  33. # print(response.headers)
  34. for k, v in response.headers.items():
  35. print(f'{k}:{v}')
  36. print(response.content.decode('utf8'))
  37. print('----- https response end-----\n\n')
  38. headers = {
  39. "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67;jy-test"
  40. }
  41. # 定义第二个 headers
  42. headers_1 = {
  43. "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67;jy-test",
  44. "Content-Type":"application/json",
  45. "MiniprogramCode":"wy_zbxm"
  46. }
  47. #headers设置为全局变量
  48. GSTORE['headers'] = headers
  49. GSTORE['headers_1'] = headers_1
  50. # session对象设置为全局变量
  51. s = requests.Session()
  52. GSTORE['s'] = s
  53. #pc登录接口
  54. def mgr_login(self, phone='18211989987', password='#80Z!RVv52',useproxies=False):
  55. headers=GSTORE['headers']
  56. s = GSTORE['s']
  57. if useproxies:
  58. self.s.proxies.update({'http':'127.0.0.1:8888'})
  59. response = self.s.post(f"{cfg.target_host}/phone/login",headers=headers,data=
  60. {
  61. 'reqType': 'phoneLogin',
  62. 'isAutoLogin': 'false',
  63. 'phone':phone,
  64. 'password':password
  65. })
  66. # 把response对象返回出去
  67. return response
  68. #登录后获取session
  69. def get_session(self):
  70. response=self.mgr_login()
  71. # 检查登录是否成功
  72. if response.status_code == 200:
  73. # 通过 response.cookies 获取 session 信息
  74. cookies = response.cookies
  75. session_id = cookies.get('SESSIONID') # 假设 session ID 存储在 cookie 中
  76. print(f"Session ID: {session_id}")
  77. return session_id
  78. else:
  79. print("Login failed!")
  80. return None
  81. # app登录接口
  82. def mgr_login_app(self, phone='18211989987', password='#80Z!RVv52',useproxies=False):
  83. headers=GSTORE['headers']
  84. s = GSTORE['s']
  85. if useproxies:
  86. self.s.proxies.update({'http':'127.0.0.1:8888'})
  87. response = self.s.post(f"{cfg.target_host_app}/jyapp/free/login",headers=headers,params=
  88. {
  89. 'reqType': 'phoneLogin',
  90. 'phone':phone,
  91. 'password':password,
  92. 'rid':'',
  93. 'oid': '',
  94. 'phoneType': '',
  95. 'channel': '',
  96. 'deviceId': ''
  97. })
  98. # 把response对象返回出去
  99. return response
  100. """退出登录pc"""
  101. def mgr_logout(self):
  102. url = f"{cfg.target_host}/front/signOut"
  103. headers = GSTORE['headers']
  104. s = GSTORE['s']
  105. s.post(url=url, headers=headers)
  106. # return res
  107. """退出登录app"""
  108. def mgr_logout_app(self):
  109. url = f"{cfg.target_host_app}/jyapp/free/signOut"
  110. headers = GSTORE['headers']
  111. s = GSTORE['s']
  112. s.post(url=url, headers=headers)
  113. #招标搜索
  114. def bidsearch(self, keywords="建筑", publishtime="fiveyear", selectType="content"):
  115. #使用全局变量
  116. headers = GSTORE['headers']
  117. params={"keywords":keywords,"publishtime":publishtime,"timeslot":"","area":"","subtype":"","minprice":"","maxprice":"","industry":"","buyerclass":"","buyertel":"","winnertel":"","selectType":selectType,"notkey":"","fileExists":"0","city":"","searchGroup":"0","searchMode":"0","wordsMode":"0","additionalWords":""}
  118. #保存session
  119. session = self.s
  120. response = session.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, params=params)
  121. return response
  122. #超前项目搜索
  123. def advanced_search(self):
  124. #使用全局变量
  125. headers = GSTORE['headers']
  126. #保存session
  127. session = self.s
  128. data={
  129. "searchGroup": 2,
  130. "reqType": "lastNews",
  131. "pageNum": 1,
  132. "pageSize": 50,
  133. "keyWords": "科技",
  134. "searchMode": 0,
  135. "bidField": "",
  136. "publishTime": "1689573022-1721195422",
  137. "selectType": "title,content",
  138. "subtype": "",
  139. "exclusionWords": "",
  140. "buyer": "",
  141. "winner": "",
  142. "agency": "",
  143. "industry": "",
  144. "province": "",
  145. "city": "",
  146. "district": "",
  147. "buyerClass": "",
  148. "fileExists": "",
  149. "price": "",
  150. "buyerTel": "",
  151. "winnerTel": ""
  152. }
  153. response = session.post(f"{cfg.target_host}/jyapi/jybx/core/mType/searchList", headers=headers, data=data)
  154. return response
  155. # 企业搜索
  156. def enterpriseSearch(self, match="北京剑鱼信息技术有限公司河南分公司", matchType="A", pageSize="10", pageNum="0"):
  157. # 使用全局变量
  158. headers = GSTORE['headers']
  159. # 保存session
  160. session = self.s
  161. response = session.post(f"{cfg.target_host}/publicapply/enterpriseSearch/doQuery", headers=headers, data={
  162. 'match': match,
  163. 'matchType': matchType,
  164. 'pageSize': pageSize,
  165. 'pageNum': pageNum
  166. })
  167. return response
  168. # 供应搜索
  169. def supplySearch(self, keywords="PH计", searchType="title", province="", city="", time="", status="0",
  170. pageSize=50, pageIndex=1):
  171. headers = GSTORE['headers']
  172. headers['Content-Type'] = 'application/json' # 添加Content-Type头部
  173. url = f"{cfg.target_host}/jyinfo/supplySearch"
  174. data = {
  175. "keywords": keywords,
  176. "searchType": searchType,
  177. "province": province,
  178. "city": city,
  179. "time": time,
  180. "status": status,
  181. "pageSize": pageSize,
  182. "pageIndex": pageIndex
  183. }
  184. session=self.s
  185. response = session.post(url=url, headers=headers, data=json.dumps(data))
  186. return response
  187. #采购单位搜索
  188. def buyer_search(self, buyerName, province=None, city=None, buyerClass=None, isCheckFollow=True, isCheckReceive=True,
  189. isContact=0, pageSize=10, pageNum=1):
  190. if buyerClass is None:
  191. buyerClass = []
  192. if city is None:
  193. city = []
  194. if province is None:
  195. province = []
  196. url = f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList"
  197. data = {
  198. "buyerName": buyerName,
  199. "province": province,
  200. "city": city,
  201. "buyerClass": buyerClass,
  202. "isCheckFollow": isCheckFollow,
  203. "isCheckReceive": isCheckReceive,
  204. "isContact": isContact,
  205. "pageSize": pageSize,
  206. "pageNum":pageNum
  207. }
  208. response = requests.post(url=url, json=data, headers=self.headers)
  209. return response
  210. #融创用户搜索
  211. def rc_search(self):
  212. headers = GSTORE['headers']
  213. headers['Content-Type'] = 'application/json' # 添加Content-Type头部
  214. url = f"{cfg.target_host}/jyapi/jybx/core/mType/searchList"
  215. params={
  216. "searchGroup": 0,
  217. "reqType": "lastNews",
  218. "pageNum": 1,
  219. "pageSize": 50,
  220. "keyWords": "医疗设备",
  221. "searchMode": 0,
  222. "bidField": "",
  223. "publishTime": "1654704000-1657900799",
  224. "selectType": "title,content",
  225. "subtype": "",
  226. "exclusionWords": "",
  227. "buyer": "",
  228. "winner": "",
  229. "agency": "",
  230. "industry": "",
  231. "province": "",
  232. "city": "",
  233. "district": "",
  234. "buyerClass": "",
  235. "fileExists": "",
  236. "price": "",
  237. "buyerTel": "",
  238. "winnerTel": "",
  239. "mobileTag": [
  240. "军队类",
  241. "武警类",
  242. "融通类",
  243. "退役类",
  244. "融办类",
  245. "某某类",
  246. "all"
  247. ]
  248. }
  249. session = self.s
  250. response = session.post(url=url, headers=headers, params=params)
  251. return response
  252. """三级页公告摘要"""
  253. #两个接口,
  254. def preagent(self,url='https://www.jianyu360.cn/nologin/content/ApGY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM%3D.html'):
  255. headers = {
  256. 'Referer': url
  257. }
  258. s = GSTORE["s"]
  259. response = s.get(f"{cfg.target_host}/publicapply/detail/preAgent", headers=headers)
  260. response_data=json.loads(response.text)
  261. token=response_data["data"]["token"]
  262. return token
  263. def detail_baseinfo(self,url='https://www.jianyu360.cn/nologin/content/ApGY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM%3D.html'):
  264. headers = GSTORE['headers']
  265. s = GSTORE["s"]
  266. token=self.preagent(url)
  267. params = {
  268. "token":token
  269. }
  270. response = s.post(f"{cfg.target_host}/publicapply/detail/baseInfo", headers=headers, params=params)
  271. return response
  272. """三级页商机推荐"""
  273. def detail_advancedinfo(self):
  274. headers = GSTORE['headers']
  275. s = GSTORE["s"]
  276. res = self.detail_baseinfo()
  277. response_data = json.loads(res.text)
  278. token = response_data["data"]["token"]
  279. params = {
  280. "token": token
  281. }
  282. response = s.post(f"{cfg.target_host}/publicapply/detail/advancedInfo", headers=headers, params=params)
  283. return response
  284. """三级页监控项目"""
  285. def detail_monitor_project(self):
  286. headers = GSTORE['headers']
  287. s = GSTORE["s"]
  288. params = {
  289. "sid": "ABCY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM="
  290. }
  291. response = s.post(f"{cfg.target_host}/bigmember/follow/project/add", headers=headers, params=params)
  292. return response
  293. """取消项目监控"""
  294. def cacel_project(self):
  295. headers = GSTORE['headers']
  296. s = GSTORE["s"]
  297. params = {
  298. "sid": "ABCY1xdfTI4LyMsM3d4cE8JIzAvFj1jcXNlKwUkPT0dY2BwDidUCZM=",
  299. "fid[followId]":"ABCY3ZdfT0FUCw4AnpUA3k%3D",
  300. "fid[limit_count]": 10,
  301. "fid[msg_open]": True,
  302. "fid[status]": True,
  303. }
  304. response = s.post(f"{cfg.target_host}/bigmember/follow/project/cancel", headers=headers, params=params)
  305. return response
  306. """用户信息获取isadd接口"""
  307. def isadd(self):
  308. headers = GSTORE['headers']
  309. s = GSTORE["s"]
  310. response = s.get(f"{cfg.target_host}/bigmember/use/isAdd", headers=headers)
  311. return response
  312. #接口数据传值常用三种方式:urlencoded---params,键值对---data,json格式---json
  313. #获取推送记录接口
  314. def push_list(self):
  315. headers=GSTORE['headers']
  316. s = GSTORE['s']
  317. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/fType/list",headers=headers,json=
  318. {"pageNum": 1, "pageSize": 50, "format": "table", "area": "", "selectTime": "all", "city": "", "buyerClass": "",
  319. "subtype": "", "industry": "", "keyWords": "", "fileExists": "", "price": "", "source": "", "exportNum": "",
  320. "vt": ""})
  321. return response
  322. # 不登录招标搜索
  323. def notloggedin_search(self, keyword='科技', publishtime='thisyear', selectType='content,title'):
  324. headers = GSTORE['headers']
  325. params={"keywords": keyword , "publishtime": publishtime, "timeslot": "", "area": "", "subtype": "",
  326. "minprice": "", "maxprice": "", "industry": "", "buyerclass": "", "buyertel": "", "winnertel": "",
  327. "selectType": selectType, "notkey": "", "fileExists": "0", "city": "", "searchGroup": "0",
  328. "searchMode": "0", "wordsMode": "0", "additionalWords": ""}
  329. response = requests.post(f"{cfg.target_host}/jylab/supsearch/index.html", headers=headers, params=params)
  330. response.raise_for_status() # 如果请求失败,会抛出异常
  331. return response
  332. #不登录采购单位搜索
  333. def notloggedin_buysearch(self,keyword):
  334. headers = GSTORE['headers']
  335. s = GSTORE['s']
  336. data = {"buyerName":keyword,"province":[],"city":[],"buyerClass":[],"isCheckFollow":False,"isCheckReceive":False,"isContact":0,"pageSize":10,"pageNum":1}
  337. response =s.post(f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList", headers=headers, json=data)
  338. # response.raise_for_status() # 如果请求失败,会抛出异常
  339. return response
  340. #消息中心列表
  341. def get_messagelist(self):
  342. headers = GSTORE['headers']
  343. s = GSTORE['s']
  344. response=s.post(f"{cfg.target_host}/jyapi/messageCenter/MessageList",headers=headers,json=
  345. {
  346. "isColumn": True,
  347. "isColumnNewMsg": False,
  348. "isMsgList": True,
  349. "msgType": -1,
  350. "isRead": -1,
  351. "offset": 1,
  352. "size": 20
  353. })
  354. return response
  355. #点击查看消息消息状态修改成已读
  356. def get_markread(self):
  357. hearders = GSTORE['headers']
  358. s = GSTORE['s']
  359. json={
  360. "msgId":285266
  361. }
  362. response = s.post(f"{cfg.target_host}/jyapi/messageCenter/markRead", headers=hearders,json=json)
  363. return response
  364. """用户中台"""
  365. def get_userCenter(self):
  366. hearders = GSTORE['headers']
  367. s = GSTORE['s']
  368. response = s.post(f"{cfg.target_host}/userCenter/workDesktop/menuInfo", headers=hearders)
  369. return response
  370. """我的订单"""
  371. def get_myOrder(self):
  372. hearders = GSTORE['headers']
  373. s = GSTORE['s']
  374. params = {
  375. "type": 0,
  376. "pageNum": 1,
  377. "fromPage": "pc",
  378. "page_size": 10
  379. }
  380. response = s.post(f"{cfg.target_host}/subscribepay/orderListDetails/myOrder", headers=hearders, params=params)
  381. return response
  382. """优惠卷"""
  383. def get_coupon(self):
  384. hearders = GSTORE['headers']
  385. s = GSTORE['s']
  386. params={
  387. "mold": 4,
  388. "currentPage": 1,
  389. "pageSize": 8,
  390. "platform": "P"
  391. }
  392. response= s.post(f"{cfg.target_host}/jyCoupon/getInfoByUser", headers=hearders,params=params)
  393. return response
  394. """数据自动导出"""
  395. def get_dataExport(self,publishtime=1672502400_1688951529,keyword='数据',selectType='title'):
  396. hearders = GSTORE['headers']
  397. s = GSTORE['s']
  398. params={
  399. "publishtime":publishtime,
  400. "area":"",
  401. "city":"",
  402. "region":"",
  403. "industry":"",
  404. "buyerclass":"",
  405. "keyword": [{"keyword":keyword,"appended":[],"exclude":[]}],
  406. "selectType":selectType,
  407. "minprice":"",
  408. "maxprice":"",
  409. "subtype":"",
  410. "buyer":"",
  411. "winner":"",
  412. "dataType": 2
  413. }
  414. response = s.post(f"{cfg.target_host}/front/dataExport/sieveData", headers=hearders, params=params)
  415. return response
  416. """数据导出记录"""
  417. def Export_recordList(self):
  418. hearders = GSTORE['headers']
  419. s = GSTORE['s']
  420. params={
  421. "pageNum": 0,
  422. "pageSize": 10
  423. }
  424. response = s.post(f"{cfg.target_host}/subscribepay/dataExportPack/recordList", headers=hearders, params=params)
  425. return response
  426. """数据导出-超出2w条,点击不在提示"""
  427. def export_prompt(self):
  428. hearders = GSTORE['headers']
  429. s = GSTORE['s']
  430. params={
  431. "status": 1
  432. }
  433. response = s.post(f"{cfg.target_host}/front/dataExport/setDontPromptAgain", headers=hearders, params=params)
  434. return response
  435. """数据导出-判断是否展示弹框"""
  436. def export_frame(self):
  437. hearders = GSTORE['headers']
  438. s = GSTORE['s']
  439. response = s.post(f"{cfg.target_host}/front/dataExport/getDontPromptAgain", headers=hearders)
  440. return response
  441. """数据导出筛选条件列表"""
  442. def export_list(self):
  443. hearders = GSTORE['headers']
  444. s = GSTORE['s']
  445. response = s.get(f"{cfg.target_host}/subscribepay/dataExportPack/screenList", headers=hearders)
  446. return response
  447. """剑鱼文库搜索"""
  448. def Library_search(self,keyWord='数据'):
  449. hearders = GSTORE['headers']
  450. s = GSTORE['s']
  451. params={
  452. "keyWord":keyWord,
  453. "tag":"",
  454. "sort": "tSort",
  455. "num": 1,
  456. "size": 10
  457. }
  458. response = s.post(f"{cfg.target_host}/jydocs/search", headers=hearders, params=params)
  459. return response
  460. """剑鱼文库收藏"""
  461. def Library_collection(self):
  462. hearders = GSTORE['headers']
  463. s = GSTORE['s']
  464. params={
  465. "sign": 1,
  466. "num": 1,
  467. "size": 10
  468. }
  469. response = s.post(f"{cfg.target_host}/jydocs/user/list", headers=hearders, params=params)
  470. return response
  471. """剑鱼文库我的文库"""
  472. def My_library(self):
  473. hearders = GSTORE['headers']
  474. s = GSTORE['s']
  475. params={
  476. "sign": 0,
  477. "num": 1,
  478. "size": 10
  479. }
  480. response = s.post(f"{cfg.target_host}/jydocs/user/list", headers=hearders, params=params)
  481. return response
  482. """项目进度监控"""
  483. def Project_monitoring(self):
  484. hearders = GSTORE['headers']
  485. s = GSTORE['s']
  486. params={
  487. "pageNum": 0,
  488. "pageSize": 500
  489. }
  490. response = s.post(f"{cfg.target_host}/bigmember/follow/project/list", headers=hearders, params=params)
  491. return response
  492. """企业情报监控"""
  493. def Enterprise_monitoring(self):
  494. hearders = GSTORE['headers']
  495. s = GSTORE['s']
  496. params={
  497. "pageNum": 0,
  498. "pageSize": 10,
  499. "match":"",
  500. "group":"",
  501. }
  502. response = s.post(f"{cfg.target_host}/bigmember/follow/ent/list", headers=hearders, params=params)
  503. return response
  504. """客户监控"""
  505. def Customer_monitoring(self,):
  506. hearders = GSTORE['headers']
  507. s = GSTORE['s']
  508. params = {
  509. "pagesize": 10,
  510. "pageno": 0,
  511. "keyword":""
  512. }
  513. response = s.post(f"{cfg.target_host}/publicapply/customer/list", headers=hearders, params=params)
  514. return response
  515. """标讯收藏"""
  516. def Message_Collection(self):
  517. hearders = GSTORE['headers']
  518. s = GSTORE['s']
  519. params={
  520. "buyerPhone":0,
  521. "buyerclass":"",
  522. "label":"",
  523. "pagenum":1,
  524. "pagesize":50,
  525. "selectTime":"",
  526. "winnerPhone":0
  527. }
  528. response = s.post(f"{cfg.target_host}/publicapply/bidcoll/list", headers=hearders, params=params)
  529. return response
  530. """标讯收藏"""
  531. #信息获取
  532. def Getuser(self):
  533. headers = GSTORE['headers']
  534. s = GSTORE['s']
  535. response = s.get(f"{cfg.target_host}/jypay/user/getAccountInfo", headers=headers)
  536. return response
  537. #密码校验
  538. def Check_password(self):
  539. headers = GSTORE['headers']
  540. s = GSTORE['s']
  541. params = {
  542. "password": "#80Z!RVv52"
  543. }
  544. response = s.post(f"{cfg.target_host}/publicapply/password/check", headers=headers, params=params)
  545. return response
  546. #身份获取
  547. def Identity_list(self,n=0):
  548. headers = GSTORE['headers']
  549. s = GSTORE['s']
  550. params = {
  551. }
  552. response = s.post(f"{cfg.target_host}/publicapply/identity/list",headers=headers, params=params)
  553. # 解析响应内容为JSON
  554. response_json = response.json()
  555. # 从JSON响应中提取token
  556. self.token = response_json['data'][n]['token']
  557. return response
  558. def Identity_switch(self):
  559. headers = GSTORE['headers']
  560. s = GSTORE["s"]
  561. params = {
  562. "token":self.token
  563. }
  564. response =s.post(f"{cfg.target_host}/publicapply/identity/switch", headers=headers, params=params)
  565. return response
  566. """获取用户信息"""
  567. def User_info(self):
  568. headers = {
  569. 'content-Type': 'application/json',
  570. 'appId': '10000',
  571. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67'
  572. }
  573. s = GSTORE["s"]
  574. params = {}
  575. response =s.post(f"{cfg.target_host}/userCenter/ent/userInfo",headers=headers,params=params)
  576. return response
  577. def Whether_buy(self):
  578. headers = GSTORE["headers"]
  579. s = GSTORE["s"]
  580. response =s.get(f"{cfg.target_host}/entnicheNew/buy/whetherbuy",headers=headers)
  581. return response
  582. def Commonly_List(self):
  583. headers = {
  584. 'content-Type': 'application/json',
  585. 'appId': '10000',
  586. 'userid': '63a41aa5cd7ea10389b2a8f3'
  587. }
  588. s = GSTORE['s']
  589. response =s.post(f"{cfg.target_host}/userCenter/workDesktop/renew/commonlyList",headers=headers)
  590. return response
  591. """权限校验"""
  592. def Authorised_info(self):
  593. headers = {
  594. "Content-Type":"application/json",
  595. "functionCode":"znsj_kf_use"
  596. }
  597. s = GSTORE['s']
  598. response =s.post(f"{cfg.target_host}/resourceCenter/waitEmpowerDetail",headers=headers)
  599. return response
  600. """未登录采购单位列表"""
  601. def nologin_buyer_list(self):
  602. headers = GSTORE['headers']
  603. s = GSTORE['s']
  604. data = {"buyerName":"","province":[],"city":[],"buyerClass":[],"isCheckFollow":False,"isCheckReceive":False,"isContact":0,"pageSize":10,"pageNum":1}
  605. response =s.post(f"{cfg.target_host}/jyapi/jybx/buyer/eType/buyerList",headers=headers,json=data)
  606. return response
  607. """未登录供应商列表"""
  608. def nologin_supplySearch(self):
  609. headers = GSTORE['headers']
  610. s = GSTORE['s']
  611. data = {"keywords":"信息","searchType":"title","province":"","city":"","time":"","status":"0","pageSize":50,"pageIndex":1}
  612. response =s.post(f"{cfg.target_host}/jyinfo/supplySearch",headers=headers,json=data)
  613. return response
  614. """未登录企业搜索"""
  615. def nologin_enterpriseSearch(self):
  616. headers = GSTORE['headers']
  617. s = GSTORE['s']
  618. params = {"match":"科技"}
  619. response =s.post(f"{cfg.target_host}/publicapply/enterpriseSearch/doQuery",headers=headers, params=params)
  620. return response
  621. """未登录招标信息搜索"""
  622. def nologin_Tender_search(self ):
  623. headers = GSTORE['headers']
  624. s = GSTORE['s']
  625. params = {"match":"科技"}
  626. response =s.post(f"{cfg.target_host}/jyapi/jybx/core/fType/searchList",headers=headers, params=params)
  627. return response
  628. """未登录拟在建搜索"""
  629. def nologin_Proposed_construction_search(self ):
  630. headers = GSTORE['headers']
  631. s = GSTORE['s']
  632. params = {"match":"科技"}
  633. response =s.post(f"{cfg.target_host}/front/project/nzj/search",headers=headers, params=params)
  634. return response
  635. """未登录拟在建搜索详情页"""
  636. def nologin_proposed_construction_content(self):
  637. headers = GSTORE['headers']
  638. s = GSTORE['s']
  639. params = {"pid":"040600055c0f00594f4351560153085d530f4e4200035201"}
  640. response =s.post(f"{cfg.target_host}/front/project/nzj/details",headers=headers, params=params)
  641. return response
  642. """工作桌面首页行业报告"""
  643. def industry_report(self):
  644. headers = GSTORE['headers']
  645. s = GSTORE['s']
  646. response = s.get(f"{cfg.target_host}/front/project/deskAnalysisReport", headers=headers)
  647. return response
  648. """工作桌面首页商机情报详情页"""
  649. def business_opportunity(self):
  650. headers = GSTORE['headers']
  651. s = GSTORE['s']
  652. # id='ABCY1xaYD0FJD0sNHN6cAcSMTI4DRZjV3diPB43LyEgfGpzbQFUCV8='
  653. response = s.get(f"{cfg.target_host}/bigmember/project/businessDetails?id=ABCY1xaYD0FJD0sNHN6cAcSMTI4DRZjV3diPB43LyEgfGpzbQFUCV8=", headers=headers,data={})
  654. return response
  655. """大会员推送记录列表"""
  656. def bigmember_push(self):
  657. headers = GSTORE['headers']
  658. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/mType/list", headers=headers, json=
  659. {
  660. "pageNum": 1,
  661. "pageSize": 50,
  662. "format": "table",
  663. "area": "",
  664. "selectTime": "all",
  665. "city": "",
  666. "buyerClass": "",
  667. "subtype": "",
  668. "industry": "",
  669. "keyWords": "",
  670. "fileExists": "",
  671. "price": "",
  672. "source": "",
  673. "exportNum": "",
  674. "district": "",
  675. "isRead": "",
  676. "vt": "m"
  677. })
  678. return response
  679. """商机管理推送记录"""
  680. def entniche_push(self):
  681. headers = GSTORE['headers']
  682. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/eType/list", headers=headers, json=
  683. {
  684. "pageNum": 1,
  685. "pageSize": 50,
  686. "format": "table",
  687. "area": "",
  688. "selectTime": "all",
  689. "city": "",
  690. "buyerClass": "",
  691. "subtype": "",
  692. "industry": "",
  693. "keyWords": "",
  694. "fileExists": "",
  695. "price": "",
  696. "source": "",
  697. "exportNum": "",
  698. "district": "",
  699. "isRead": "",
  700. "vt": "s"
  701. })
  702. return response
  703. """订阅搜索"""
  704. #免费用户订阅搜索
  705. def free_subscription_search(self):
  706. headers = GSTORE['headers']
  707. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/fType/list", headers=headers, json=
  708. {
  709. "pageNum": 1,
  710. "pageSize": 50,
  711. "format": "table",
  712. "area": "",
  713. "selectTime": "1718534447_1721126447",
  714. "city": "",
  715. "buyerClass": "",
  716. "subtype": "",
  717. "industry": "",
  718. "keyWords": "",
  719. "fileExists": "",
  720. "price": "",
  721. "source": "",
  722. "exportNum": "",
  723. "district": "",
  724. "isRead": "",
  725. "vt": ""
  726. })
  727. return response
  728. #超级订阅用户订阅搜索
  729. def svip_subscription_search(self):
  730. headers = GSTORE['headers']
  731. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/vType/list", headers=headers, json=
  732. {
  733. "pageNum": 1,
  734. "pageSize": 50,
  735. "format": "table",
  736. "area": "安徽",
  737. "selectTime": "1675094400_1719763199",
  738. "city": "",
  739. "buyerClass": "传媒,采矿业,电信行业,金融业,建筑业,能源化工,农林牧渔,批发零售,信息技术,运输物流,制造业,住宿餐饮",
  740. "subtype": "招标公告,招标,邀标,询价,竞谈,单一,竞价,变更",
  741. "industry": "",
  742. "keyWords": "计算机",
  743. "fileExists": "",
  744. "price": "",
  745. "source": "",
  746. "exportNum": "",
  747. "district": "",
  748. "isRead": "",
  749. "vt": "v"
  750. })
  751. return response
  752. #大会员用户订阅搜索
  753. def bigmember_subscription_search(self):
  754. headers = GSTORE['headers']
  755. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/mType/list", headers=headers, json=
  756. {
  757. "pageNum": 1,
  758. "pageSize": 50,
  759. "format": "table",
  760. "area": "安徽,北京,甘肃",
  761. "selectTime": "1672502400_1719763199",
  762. "city": "",
  763. "buyerClass": "人大,政协,党委办,组织,宣传,统战,纪委,政府办,发改,财政,教育,科技,工信,民政,民宗,人社,公安,检察院,法院,司法,应急管理,军队,自然资源,生态环境,住建,市政,城管,交通,水利,农业,气象,文旅,卫健委,医疗,学校,档案,体育,政务中心,机关事务,国资委,海关,税务,市场监管,商务,人行,银保监,证监,审计,出版广电,统计,公共资源交易,社会团体",
  764. "subtype": "招标预告,预告,预审,预审结果,论证意见,需求公示,招标结果,中标,成交,废标,流标",
  765. "industry": "",
  766. "keyWords": "信息,科技,能源",
  767. "fileExists": "",
  768. "price": "",
  769. "source": "",
  770. "exportNum": "",
  771. "isRead": "1",
  772. "vt": "m"
  773. })
  774. return response
  775. #新增项目关注
  776. def new_project_attention(self):
  777. headers = GSTORE['headers']
  778. response =self.s.post(f"{cfg.target_host}/bigmember/follow/project/add?sid=ABCY1xaYD0vLD86RHxkcwcvJDAZDSB3dlVkKDgzIDodeGpzfQlUCdA=",headers=headers)
  779. return response
  780. #关注项目地区筛选
  781. def project_screenarea(self):
  782. headers = GSTORE['headers']
  783. response =self.s.get(f"{cfg.target_host}/bigmember/follow/project/screenArea",headers=headers, params={})
  784. return response
  785. #商机管理订阅搜索
  786. def entname_subscription_search(self):
  787. headers = GSTORE['headers']
  788. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/eType/list", headers=headers, json=
  789. {
  790. "pageNum": 1,
  791. "pageSize": 50,
  792. "format": "table",
  793. "area": "安徽,重庆,河南,江苏",
  794. "selectTime": "1672502400_1719763199",
  795. "city": "",
  796. "buyerClass": "",
  797. "subtype": "招标公告,招标,邀标,询价,竞谈,单一,竞价,变更,招标结果,中标,成交,废标,流标",
  798. "industry": "农林牧渔_生产物资,农林牧渔_生产设备,农林牧渔_相关服务",
  799. "keyWords": "农业,园林,森林",
  800. "fileExists": "",
  801. "price": "",
  802. "source": "1",
  803. "exportNum": "",
  804. "isRead": "",
  805. "vt": "s"
  806. })
  807. return response
  808. #招标采购搜索信息对外接口
  809. def bid_search_api(self):
  810. headers = {
  811. 'Accept-Charset': 'utf-8',
  812. 'timestamp': '1726207205',
  813. 'sign': '1058A958B8D562EA9F2234AC42716778',
  814. 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
  815. 'Content-Type': 'application/json'
  816. }
  817. response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/search?appid=jianyuDev", headers=headers, json={
  818. "releaseTimeStart": 1695456870,"keyWord": ["市政粮食"],"searchMode":1})
  819. return response
  820. #招标采购搜索信息普通字段包对外接口
  821. def bid_ordinarypkg(self):
  822. headers = {
  823. 'Accept-Charset': 'utf-8',
  824. 'timestamp': '1726207205',
  825. 'sign': '1058A958B8D562EA9F2234AC42716778',
  826. 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
  827. 'Content-Type': 'application/json'
  828. }
  829. response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/ordinarypkg?appid=jianyuDev",
  830. headers=headers, json={"id": "040654015b5f500a1b4774135a57015651085a585c4f4c7605dc"})
  831. return response
  832. # 招标采购搜索信息高级字段包对外接口
  833. def bid_seniorpkg(self):
  834. headers = {
  835. 'Accept-Charset': 'utf-8',
  836. 'timestamp': '1726207205',
  837. 'sign': '1058A958B8D562EA9F2234AC42716778',
  838. 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
  839. 'Content-Type': 'application/json'
  840. }
  841. response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/seniorpkg?appid=jianyuDev",
  842. headers=headers,
  843. json={"id": "040654015b5f500a1b4774135a57015651085a585c4f4c7605dc"})
  844. return response
  845. #招标采购信息附件下载接口
  846. def bid_annex(self):
  847. headers = {
  848. 'Accept-Charset': 'utf-8',
  849. 'timestamp': '1726207205',
  850. 'sign': '1058A958B8D562EA9F2234AC42716778',
  851. 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)',
  852. 'Content-Type': 'application/json'
  853. }
  854. response = self.s.post(f"{cfg.target_host_api}/thirdpartyapi/standard/bid/annex?appid=jianyuDev",
  855. headers=headers,
  856. json={"fid":"040507510f0a075618137614500208530c095c500f1814785d44030451"})
  857. return response
  858. #客户标签类型获取
  859. def customer_getLabel(self):
  860. headers = GSTORE['headers']
  861. response = self.s.post(f"{cfg.target_host}/entnicheNew/customer/getLabel", headers=headers, json={})
  862. return response
  863. #商机管理客户关注
  864. def customer_attention(self):
  865. headers = GSTORE['headers']
  866. response = self.s.post(f"{cfg.target_host}/publicapply/customer/attention", headers=headers, json={"name":"石嘴山市交通工程建设管理中心","mold":1,"D":True})
  867. return response
  868. #app登录后获取新用户留资报表
  869. def new_uer_sales(self):
  870. headers = GSTORE['headers']
  871. response = self.s.post(f"{cfg.target_host_app}/salesLeads/appIsNewUerSales", headers=headers, json={})
  872. return response
  873. #定制化分析报告_超前项目
  874. def reports_advanced_projects(self):
  875. headers = GSTORE['headers']
  876. response = self.s.post(f"{cfg.target_host}/leadGeneration/getDate", headers=headers, json={})
  877. return response
  878. #行为采集
  879. def behavior_acquisition(self):
  880. headers = GSTORE['headers']
  881. response = self.s.post(f"{cfg.target_host}/leadGeneration/clickRecord", headers=headers, json={"type":"B"})
  882. return response
  883. #获取样例报告信息
  884. def sample_report_information(self):
  885. headers = GSTORE['headers']
  886. response = self.s.post(f"{cfg.target_host}/salesLeads/sampleReport", headers=headers, json={})
  887. return response
  888. #项目名称联想
  889. def project_name_lenovo(self):
  890. headers = GSTORE['headers']
  891. params = {"pName":[ "科技信息"]}
  892. response = self.s.post(f"{cfg.target_host}/bigmember/analysis/projectName", headers=headers, params=params)
  893. return response
  894. #采购单位名称联想
  895. def buyer_name_lenovo(self):
  896. headers = GSTORE['headers']
  897. params = {
  898. "pName":[ "科技信息"],
  899. "sType":1
  900. }
  901. response = self.s.post(f"{cfg.target_host}/bigmember/analysis/projectName", headers=headers, params=params)
  902. return response
  903. #投标决策分析内容
  904. def bidding_decision_analysis_content(self):
  905. headers = GSTORE['headers']
  906. json = {
  907. "area": {"北京": []},
  908. "buyer": "北京大学",
  909. "buyerContent": [
  910. {
  911. "key": ["设备"],
  912. "matchway": 1
  913. },
  914. {
  915. "key": ["多功能投影仪"],
  916. "matchway": 1
  917. }],
  918. "pname": "",
  919. "limitTime": "fiveYear",
  920. "searchItem": 1,
  921. "searchType": 0,
  922. "page": 1,
  923. "pageSize": 5
  924. }
  925. response = self.s.post(f"{cfg.target_host}/bigmember/decision/decInfo", headers=headers, json=json)
  926. return response
  927. #app新用户报表提交/跳过
  928. def app_new_uer_sales(self):
  929. headers = GSTORE['headers']
  930. json = {
  931. "area##business":"广州,北京",
  932. "company":"剑鱼",
  933. "department":"其他",
  934. "model##business":"投标方",
  935. "position":"职员",
  936. "product##engineering":"交通设施,外工程",
  937. "product##product":"化工用品包装材料,机电设备",
  938. "product##seryice":"广告传媒,餐饮服务"
  939. }
  940. response = self.s.post(f"{cfg.target_host_app}/salesLeads/appNewUerSales", headers=headers, json=json)
  941. return response
  942. # 商机情报详情页
  943. def business_intelligence(self):
  944. headers = GSTORE['headers'] = GSTORE['headers']
  945. response = self.s.post(
  946. f"{cfg.target_host}/bigmember/project/businessDetails?id=ABCY1xZdSlYKD0sAnd6cAcSMTI4DRZjV3diPB40OS8NfGpzZQFUCYI%3D",
  947. headers=headers)
  948. return response
  949. def me_Monitoring(self):
  950. headers = GSTORE['headers']
  951. response = self.s.get(f"{cfg.target_host}/bigmember/project/meMonitoring", headers=headers)
  952. return response
  953. # 要闻
  954. def important_News(self):
  955. heards = GSTORE['headers']
  956. response = self.s.get(f"{cfg.target_host}/front/project/importantNews", headers=heards)
  957. return response
  958. # 文库分类
  959. def jydocs_indexTag(self):
  960. headers = GSTORE['headers']
  961. response = self.s.post(f"{cfg.target_host}/jydocs/indexTag", headers=headers, json={})
  962. return response
  963. # 文库搜索
  964. def jydocs_search(self):
  965. headers = GSTORE["headers"]
  966. response = self.s.post(f"{cfg.target_host}/jydocs/search?keyWord=法律", headers=headers)
  967. return response
  968. # 文库详情
  969. def jydocs_detail(self):
  970. headers = GSTORE['headers']
  971. response = self.s.post(f"{cfg.target_host}/jydocs/detail?docId=docin-4756450426", headers=headers)
  972. return response
  973. # 留资提交2.0
  974. def salesLeads_collectInfo(self):
  975. headers = GSTORE['headers']
  976. response = self.s.post(f"{cfg.target_host}/salesLeads/collectInfo", headers=headers,
  977. json={"source": "article_proposed_project", "name": "质量部测试", "phone": "18211989987",
  978. "mail": "1550987547@qq.com", "industry": "", "company": "质量部测试企业",
  979. "companyType": "投标企业", "position": "总裁", "workScope": "", "partnerNeeds": "",
  980. "agree": True, "branch": ""})
  981. return response
  982. # 留资提交
  983. def salesLeads_retainedCapital(self):
  984. headers = GSTORE['headers']
  985. response = self.s.post(f"{cfg.target_host}/salesLeads/retainedCapital", headers=headers,
  986. params={"source": "article_proposed_project"})
  987. return response
  988. #供应信息附件下载
  989. def supplyInfo_attachment(self):
  990. headers = GSTORE['headers']
  991. response = self.s.post(f"{cfg.target_host}/publicapply/attachment/supplyInfo?msgId=RV9AWV1F&fileName=%E7%8E%8B%E7%BF%94%E5%90%8D%E7%89%87.png", headers=headers,)
  992. return response
  993. #采购联系人
  994. def buyer_contact(self):
  995. header = GSTORE['headers']
  996. response = self.s.post(f"{cfg.target_host}/bigmember/search/buyer/association?name=河南科技大学", headers=header)
  997. return response
  998. #消息查看记录
  999. def msgopenlog(self):
  1000. header = GSTORE['headers']
  1001. data={
  1002. "msgLogId":287204,
  1003. "platform":1}
  1004. response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/msgOpenLog",headers=header,json=data)
  1005. return response
  1006. #查看消息详情
  1007. def messagedetail(self):
  1008. header = GSTORE['headers']
  1009. data={
  1010. "msgLogId":240818
  1011. }
  1012. response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/messageDetail",headers=header,json=data)
  1013. return response
  1014. #拟在建搜索条件接口
  1015. def conditions(self):
  1016. header = GSTORE['headers']
  1017. response = self.s.post(f"{cfg.target_host}/front/project/nzj/conditions",headers=header)
  1018. return response
  1019. # 工作桌面商机情报列表
  1020. def workdesk_intelligence(self):
  1021. header = GSTORE['headers']
  1022. data = {
  1023. "msgType": 5,
  1024. "needDealtWithCount": True,
  1025. "offset": 1,
  1026. "size": 5
  1027. }
  1028. response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/WorkDeskList", headers=header, json=data)
  1029. return response
  1030. #商品积分查询
  1031. def goods_points(self):
  1032. header = GSTORE['headers']
  1033. response = self.s.post(f"{cfg.target_host}/jyintegral/productPoints/introduction",headers=header)
  1034. return response
  1035. #工作桌面首页-我的消息-未读消息数量
  1036. def workdesk_unread_messages(self):
  1037. header = GSTORE['headers']
  1038. json ={
  1039. "size": 20,
  1040. "msgType": -1,
  1041. "offset": 1,
  1042. "isRead": 0,
  1043. "isColumn": False,
  1044. "isColumnNewMsg": False,
  1045. "isContainLetter": False,
  1046. "isMsgList": False
  1047. }
  1048. response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/MessageList",headers=header,json=json)
  1049. return response
  1050. #一键清空未读消息
  1051. def clear_unread_msg(self):
  1052. header = GSTORE['headers']
  1053. response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/ClearUnreadMsg",headers = header)
  1054. return response
  1055. #新商机管理-企业订阅-修改关键词设置
  1056. def update_keyword_entnichenew(self):
  1057. header = GSTORE['headers']
  1058. json = {
  1059. "a_items": [
  1060. {
  1061. "a_key": [
  1062. {
  1063. "key": [
  1064. "计算机"
  1065. ],
  1066. "notkey": [],
  1067. "matchway": 1
  1068. }
  1069. ],
  1070. "groupIndex": 0,
  1071. "opened": True,
  1072. "s_item": "测试分组",
  1073. "showForm": False,
  1074. "updatetime": 0
  1075. }
  1076. ],
  1077. "identity": "ent"
  1078. }
  1079. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/key/update", headers=header,json=json)
  1080. return response
  1081. #获取区域设置
  1082. def entnichenew_area(self):
  1083. headers = GSTORE['headers']
  1084. s = GSTORE['s']
  1085. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/area/get",headers = headers)
  1086. return response
  1087. #商机管理-企业订阅-获取关键词设置
  1088. def keywords_get(self):
  1089. headers = GSTORE['headers']
  1090. data ={
  1091. "identity": "ent"
  1092. }
  1093. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/key/get", headers=headers, data =data)
  1094. return response
  1095. #商机管理-企业订阅-获取推送设置
  1096. def pushset_get(self):
  1097. headers = GSTORE['headers']
  1098. data={
  1099. "identity": "ent"
  1100. }
  1101. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/pushset/get", headers=headers, data=data)
  1102. return response
  1103. #设置登录保持期
  1104. def set_keeplogin(self):
  1105. headers = GSTORE['headers']
  1106. data = {
  1107. "isAutoLogin" : "true" ,
  1108. "loginER" : "NSg7BAFFBQMHBkZXRFpXRAsDBQJHBzwN___NjcAJDRFBQMHBkZXRFpXRAsDBQJHGTE8"
  1109. }
  1110. response = self.s.post(f"{cfg.target_host}/free/setKeepLogin",headers = headers ,data = data)
  1111. return response
  1112. #发送邮箱验证码
  1113. def send_mailverify(self):
  1114. headers = GSTORE["headers"]
  1115. data = {
  1116. "email" : "luwenna@topnet.net.cn"
  1117. }
  1118. response = self.s.post(f"{cfg.target_host}/front/dataExport/sendMailVerify",headers = headers , data = data)
  1119. return response
  1120. #验证数据导出邮箱验证码
  1121. def check_mailverify(self):
  1122. headers = GSTORE["headers"]
  1123. data = {
  1124. "emailVerity" : "YQ09Z1",
  1125. "email" : "luwenna@topnet.net.cn"
  1126. }
  1127. response = self.s.post(f"{cfg.target_host}/front/dataExport/checkMailVerify", headers = headers ,data = data)
  1128. return response
  1129. #数据导出筛选预览数据
  1130. def preview_sievedata(self):
  1131. headers = GSTORE["headers"]
  1132. data = {
  1133. "publishtime": "1566214955 _1660909355",
  1134. "area": "北京",
  1135. "city": "成都市",
  1136. "region": "成都市,北京",
  1137. "industry": "建筑工程_勘察设计, 建筑工程_工程施工, 建筑工程_监理咨询, 建筑工程_材料设备, 建筑工程_机电安装",
  1138. "buyerclass": "党委办, 财政",
  1139. "keyword": [{
  1140. "keyword": "软件",
  1141. "appended": [],
  1142. "exclude": []
  1143. }],
  1144. "selectType": "filetext, title, detail, title",
  1145. "minprice": "0.1",
  1146. "maxprice": "1000000",
  1147. "subtype": "中标, 成交, 废标, 流标"
  1148. }
  1149. response =self.s.post(f"{cfg.target_host}/front/dataExport/sieveData",headers = headers ,data =data)
  1150. return response
  1151. # 修改采购单位类型设置
  1152. def entnichenew_buyesclass_update(self):
  1153. headers = GSTORE['headers']
  1154. s = GSTORE['s']
  1155. json = {
  1156. "buyer": [
  1157. "法院",
  1158. "发改"
  1159. ],
  1160. "identity": "ent"
  1161. }
  1162. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/area/get", headers=headers,json=json)
  1163. return response
  1164. # 获取信息类型
  1165. def entnichenew_infotype(self):
  1166. headers = GSTORE['headers']
  1167. s = GSTORE['s']
  1168. json = {
  1169. "identity": "ent"
  1170. }
  1171. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/index", headers=headers,json=json)
  1172. return response
  1173. # 修改信息类型
  1174. def entnichenew_infotype_update(self):
  1175. headers = GSTORE['headers']
  1176. s = GSTORE['s']
  1177. json = {
  1178. "msg": [
  1179. "预告",
  1180. "预审",
  1181. "预审结果",
  1182. "论证意见",
  1183. "需求公示"
  1184. ],
  1185. "identity": "ent"
  1186. }
  1187. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/infotype/update", headers=headers,json=json)
  1188. return response
  1189. #商机管理-企业订阅-修改推送设置
  1190. def entnichenew_pushset_update(self):
  1191. headers = GSTORE['headers']
  1192. data = {
  1193. "ratemode": 2,
  1194. "apppush": 1,
  1195. "mailpush": 1,
  1196. "matchway": 2,
  1197. "wxpush": 1,
  1198. "matchmode": "title,detail",
  1199. "switch": 1,
  1200. "identity": "ent"
  1201. }
  1202. response = self.s.post(f"{cfg.target_host}/entnicheNew/subscribe/pushset/update", headers=headers,data=data)
  1203. return response
  1204. #未登录“拟在建项目”详情页
  1205. def nzj_details(self):
  1206. headers = GSTORE['headers']
  1207. params = {
  1208. "pid":"040709005b58070d4a46020952075350590c1d4302530802"
  1209. }
  1210. response = self.s.get(f"{cfg.target_host}/front/project/nzj/details", headers=headers,params=params)
  1211. return response
  1212. #获取小程序广告位
  1213. def debrisproduct_getAdList(self):
  1214. headers_1 = GSTORE['headers_1']
  1215. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getAdList", headers=headers_1,data={"Code":"jy-appsearch-home-top"})
  1216. return response
  1217. #获取地理位置
  1218. def debrisproduct_getLocation(self):
  1219. headers_1 = GSTORE['headers_1']
  1220. response = self.s.get(f"{cfg.target_host_wxapi}/debrisproduct/free/location", headers=headers_1)
  1221. return response
  1222. #所有商机获取
  1223. def debrisproduct_getAllBusiness(self):
  1224. headers_1 = GSTORE['headers_1']
  1225. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getAllBusiness", headers=headers_1)
  1226. return response
  1227. #获取小程序配置
  1228. def debrisproduct_getConfig(self):
  1229. headers_1 = GSTORE['headers_1']
  1230. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/free/getSetting", headers=headers_1)
  1231. return response
  1232. #业主单位名称联想
  1233. def debrisproduct_getAssName(self):
  1234. headers_1 = GSTORE['headers_1']
  1235. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getAssName", headers=headers_1,data={"buyerName":"科技"})
  1236. return response
  1237. #业主单位列表
  1238. def debrisproduct_getList(self):
  1239. headers_1 = GSTORE['headers_1']
  1240. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getList", headers=headers_1,data={"page_num":10,"pagesize":1})
  1241. return response
  1242. #业主搜索历史
  1243. def debrisproduct_buyer_getSearchList(self):
  1244. headers_1 = GSTORE['headers_1']
  1245. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/buyer/getSearchList", headers=headers_1)
  1246. return response
  1247. #获取价格列表
  1248. def debrisproduct_getPriceList(self):
  1249. headers_1 = GSTORE['headers_1']
  1250. response = self.s.post(f"{cfg.target_host_wxapi}/debrisproduct/getPriceList", headers=headers_1)
  1251. return response
  1252. """子部门"""
  1253. def subdepartment(self):
  1254. hearders = GSTORE['headers']
  1255. s = GSTORE['s']
  1256. data = {
  1257. "id":26741
  1258. }
  1259. response = s.post(f"{cfg.target_host}/entbase/department/childrens", headers=hearders, data=data)
  1260. return response
  1261. """添加人员"""
  1262. def add_personnel(self):
  1263. hearders = GSTORE['headers']
  1264. s = GSTORE['s']
  1265. data = {
  1266. "name":"贾路瑶",
  1267. "phone":"19588533063",
  1268. "id":26741
  1269. }
  1270. response = s.post(f"{cfg.target_host}/entbase/person/add", headers=hearders, data=data)
  1271. return response
  1272. """企业信息"""
  1273. def enterprise_information(self):
  1274. hearders = GSTORE['headers']
  1275. s = GSTORE['s']
  1276. params= {
  1277. "t":"1736561573400"
  1278. }
  1279. response = s.get(f"{cfg.target_host}/entbase/ent/entinfo", headers=hearders, params=params)
  1280. return response
  1281. """分发设置列表接口"""
  1282. def distribution_list(self):
  1283. hearders = GSTORE['headers']
  1284. s = GSTORE['s']
  1285. data= {
  1286. "identity":"ent"
  1287. }
  1288. response = s.get(f"{cfg.target_host}/entnicheNew/distribute/list", headers=hearders, data=data)
  1289. return response
  1290. """分发规则修改接口"""
  1291. def distribution_update(self):
  1292. hearders = GSTORE['headers']
  1293. s = GSTORE['s']
  1294. json= {
  1295. "id": "67820b98e7364a57c3b7eaf5",
  1296. "buyerclass": ["财政"],
  1297. "items": ["测试分组"],
  1298. "persons": [96208],
  1299. "area": {"安徽": []},
  1300. "district": {},
  1301. "identity": "ent"
  1302. }
  1303. response = s.get(f"{cfg.target_host}/entnicheNew/distribute/update", headers=hearders, json=json)
  1304. return response
  1305. """分发规则详情接口"""
  1306. def distribution_details(self):
  1307. hearders = GSTORE['headers']
  1308. s = GSTORE['s']
  1309. data= {
  1310. "identity": "ent"
  1311. }
  1312. response = s.get(f"{cfg.target_host_app}/entnicheNew/distribute/detail?id=67820b98e7364a57c3b7eaf5", headers=hearders, data=data)
  1313. return response
  1314. """采购单位画像数据"""
  1315. def prchasing_profile_data(self):
  1316. hearders = GSTORE['headers']
  1317. s = GSTORE['s']
  1318. params= {
  1319. "buyer":"黎明化工研究设计院有限责任公司",
  1320. "exactMatch":0
  1321. }
  1322. response = s.post(f"{cfg.target_host}/entnicheNew/portrait/buyer/getData", headers=hearders, params=params)
  1323. return response
  1324. """最新项目动态"""
  1325. def latest_project_news(self):
  1326. hearders = GSTORE['headers']
  1327. s = GSTORE['s']
  1328. params= {
  1329. "buyer":"黎明化工研究设计院有限责任公司",
  1330. "PageNum":1,
  1331. "pageSize":5
  1332. }
  1333. response = s.post(f"{cfg.target_host}/entnicheNew/portrait/buyer/getNewMsg", headers=hearders, params=params)
  1334. return response
  1335. #是否登录
  1336. def hassign(self):
  1337. header = GSTORE['headers']
  1338. response = self.s.post(f"{cfg.target_host}/front/hasSign",headers=header)
  1339. return response
  1340. #电销
  1341. #个人信息查询
  1342. def personal_info(self):
  1343. header = GSTORE['headers']
  1344. session=self.get_session()
  1345. json = {
  1346. "sid":session
  1347. }
  1348. response = self.s.post(f"{cfg.target_host}/jyapi/biService/myInfo", headers=header,json=json)
  1349. return response
  1350. #搜索结果数据导出
  1351. def searchexport(self):
  1352. hearders = GSTORE['headers']
  1353. data ={
  1354. "searchvalue":"软件",
  1355. "selectIds":"ABCY1xWZC4%2FMD8vM3dzc1w4PiRfTBZmYUFkKD8jJiEgaGdzYFJUCnA%3D"
  1356. }
  1357. response = self.s.post(f"{cfg.target_host}/front/wx_dataExport/searchExport", headers=hearders,data=data)
  1358. return response
  1359. #已购产品列表
  1360. def buy_productlist(self):
  1361. hearders = GSTORE['headers']
  1362. response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/buyProductList", headers=hearders)
  1363. return response
  1364. #使用人员列表
  1365. def usepersonlist(self):
  1366. hearders = GSTORE['headers']
  1367. json = {
  1368. "wait_empower_id": 31142
  1369. }
  1370. response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/usePersonList", headers=hearders , json= json)
  1371. return response
  1372. #医械通我认领的经销商
  1373. def distributor(self):
  1374. header = GSTORE['headers']
  1375. response = self.s.post(f"{cfg.target_host}/jyapi/domain/claim/distributor",headers=header)
  1376. return response
  1377. #医械通获取用户认证信息
  1378. def userauthInfo(self):
  1379. header = GSTORE['headers']
  1380. response = self.s.post(f"{cfg.target_host}/jyapi/domain/userAuthInfo",headers=header)
  1381. return response
  1382. #删除使用人员
  1383. def deluseperson(self):
  1384. headers = GSTORE['headers']
  1385. json = {
  1386. "entniche_power_id": 35272
  1387. }
  1388. response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/delUsePerson", headers=headers ,json=json)
  1389. return response
  1390. #pc/微信招标采购搜索-数据导出
  1391. def pc_wx_searchExport(self):
  1392. headers =GSTORE['headers']
  1393. params = {
  1394. "searchvalue": "科技",
  1395. "additionalWords": "软件",
  1396. "searchGroup": "0",
  1397. "searchMode": "0",
  1398. "wordsMode": "0"
  1399. }
  1400. response =self.s.post(f"{cfg.target_host}/front/wx_dataExport/searchExport",headers = headers ,params =params)
  1401. return response
  1402. # pc/微信招标采购搜索-数据导出
  1403. def app_searchExport(self):
  1404. headers = GSTORE['headers']
  1405. params = {
  1406. "searchvalue": "科技",
  1407. "additionalWords": "软件",
  1408. "searchGroup": "0",
  1409. "searchMode": "0",
  1410. "wordsMode": "0"
  1411. }
  1412. response = self.s.post(f"{cfg.target_host}/jyapp/front/dataExport/searchExport", headers=headers, params=params)
  1413. return response
  1414. """采购单位画像可筛选项"""
  1415. def filterable_options(self):
  1416. headers =GSTORE['headers']
  1417. params = {
  1418. "buyer": "黎明化工研究设计院有限责任公司"
  1419. }
  1420. response =self.s.post(f"{cfg.target_host}/entnicheNew/portrait/buyer/selects",headers = headers ,params =params)
  1421. return response
  1422. """超级订阅升级版画像浏览详情"""
  1423. def subvipPortrait_details(self):
  1424. headers =GSTORE['headers']
  1425. params = {
  1426. "buyer": "黎明化工研究设计院有限责任公司"
  1427. }
  1428. response =self.s.post(f"{cfg.target_host}/entnicheNew/portrait/subVipPortrait/usage",headers = headers ,params =params)
  1429. return response
  1430. #项目关注详情
  1431. def bigmember_project_detail(self):
  1432. headers = GSTORE['headers']
  1433. responses = self.s.post(f"{cfg.target_host}/bigmember/follow/project/detail?sid=ABCY1xdczxYKyk4GXt4cE8JIzAvFj1jcXNlPB4nKzoedFFzcF5UCmI=", headers=headers)
  1434. return responses
  1435. #项目关注列表
  1436. def bigmember_project_list(self):
  1437. headers = GSTORE['headers']
  1438. responses = self.s.post(f"{cfg.target_host}/bigmember/follow/project/list?pageNum=0&pageSize=500",headers=headers)
  1439. return responses
  1440. #项目关注地区获取
  1441. def bigmember_project_screenArea(self):
  1442. headers = GSTORE['headers']
  1443. responses = self.s.get(f"{cfg.target_host}/bigmember/follow/project/screenArea",headers=headers)
  1444. return responses
  1445. #添加部门
  1446. def entbase_addDepartment(self):
  1447. headers = GSTORE['headers']
  1448. responses = self.s.post(f"{cfg.target_host}/entbase/department/add?name=李智昆&pid=61792",headers=headers)
  1449. return responses
  1450. #删除部门
  1451. def entbase_deleteDepartment(self,department_id):
  1452. headers = GSTORE['headers']
  1453. responses = self.s.post(f"{cfg.target_host}/entbase/department/delete?id={department_id}",headers=headers)
  1454. return responses
  1455. #行为统计
  1456. def entbase_behavior_show(self):
  1457. headers = GSTORE['headers']
  1458. responses = self.s.post(f"{cfg.target_host}/entbase/behavior/show?departmentId=20365&page=1&pagesize=10&startTime=1738395151&endTime=1741017599",headers=headers)
  1459. return responses
  1460. #微信端获取打赏标语
  1461. def reward_text(self):
  1462. headers = GSTORE['headers']
  1463. response = self.s.get(f"{cfg.target_host_wx}/front/rewardText", headers=headers)
  1464. return response
  1465. # 添加使用人员
  1466. def addUsePerson(self):
  1467. headers = GSTORE['headers']
  1468. json = {"wait_empower_id": 31142,
  1469. "ent_user_id": "98306"
  1470. }
  1471. response = self.s.post(f"{cfg.target_host}/jyapi/entManageApplication/addUsePerson", headers=headers,json=json)
  1472. return response
  1473. #采购单位搜索-免费用户
  1474. def buyersearch_free(self):
  1475. headers = GSTORE['headers']
  1476. json = {
  1477. "buyerName": "",
  1478. "pageNum": 1,
  1479. "pageSize": 10,
  1480. "isCheckFollow": True,
  1481. "isCheckReceive": True,
  1482. "buyerClass": [],
  1483. "province": [],
  1484. "city": [],
  1485. "isContact": 0
  1486. }
  1487. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/buyer/fType/buyerList", headers=headers, json=json)
  1488. return response
  1489. # 采购单位搜索-大会员用户
  1490. def buyersearch_member(self):
  1491. headers = GSTORE['headers']
  1492. json = {
  1493. "buyerName": "",
  1494. "pageNum": 1,
  1495. "pageSize": 10,
  1496. "isCheckFollow": True,
  1497. "isCheckReceive": True,
  1498. "buyerClass": [],
  1499. "province": [],
  1500. "city": [],
  1501. "isContact": 0
  1502. }
  1503. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/buyer/mType/buyerList", headers=headers, json=json)
  1504. return response
  1505. # 采购单位搜索-超级订阅用户
  1506. def buyersearch_vip(self):
  1507. headers = GSTORE['headers']
  1508. json = {
  1509. "buyerName": "",
  1510. "pageNum": 1,
  1511. "pageSize": 10,
  1512. "isCheckFollow": True,
  1513. "isCheckReceive": True,
  1514. "buyerClass": [],
  1515. "province": [],
  1516. "city": [],
  1517. "isContact": 0
  1518. }
  1519. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/buyer/vType/buyerList", headers=headers, json=json)
  1520. return response
  1521. #招标搜索-商机管理用户
  1522. def search_business(self):
  1523. headers = GSTORE['headers']
  1524. json = {
  1525. "searchGroup": 0,
  1526. "reqType": "lastNews",
  1527. "pageNum": 1,
  1528. "pageSize": 50,
  1529. "keyWords": "软件",
  1530. "searchMode": 0,
  1531. "bidField": "",
  1532. "publishTime": "1709616424-1741152424",
  1533. "selectType": "title,content",
  1534. "subtype": "",
  1535. "exclusionWords": "",
  1536. "buyer": "",
  1537. "winner": "",
  1538. "agency": "",
  1539. "industry": "",
  1540. "province": "",
  1541. "city": "",
  1542. "district": "",
  1543. "buyerClass": "",
  1544. "fileExists": "",
  1545. "price": "",
  1546. "buyerTel": "",
  1547. "winnerTel": ""
  1548. }
  1549. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/core/eType/searchList", headers=headers, json=json)
  1550. return response
  1551. #采购单位画像-关联数据
  1552. def relate_information(self):
  1553. headers = GSTORE['headers']
  1554. json = {
  1555. "buyer": "上饶市广信区兴园学校",
  1556. "area": "江西"
  1557. }
  1558. response = self.s.post(f"{cfg.target_host}/jyapi/jybx/buyer/relates/information", headers=headers, json=json)
  1559. return response
  1560. #移动端首页热词获取
  1561. def hotword_mobile(self):
  1562. headers = GSTORE['headers']
  1563. response = self.s.post(f"{cfg.target_host_app}/jyapi/jybx/core/mobileHotWord", headers=headers)
  1564. return response
  1565. apimgr = APIMgr()