Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
686cfe31
Commit
686cfe31
authored
Jul 08, 2020
by
黄静
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hj
parent
5e591af8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
entprofile/main.py
+7
-2
entprofile/service/__pycache__/user_behavior.cpython-37.pyc
+0
-0
entprofile/service/user_behavior.py
+18
-3
No files found.
entprofile/main.py
View file @
686cfe31
...
...
@@ -119,15 +119,20 @@ def business_product_post():
return
common_result
.
to_result
(
None
,
300
,
"参数错误"
)
business_id
=
request_data
.
get
(
'bussines_id'
)
business_type
=
request_data
.
get
(
'businessType'
)
business_product_result
,
reason
,
relational_reason
=
recomm
.
business_product
(
business_id
,
business_type
)
business_product_result
,
reason
,
relational_reason
,
seas_reason
=
recomm
.
business_product
(
business_id
,
business_type
)
print
(
business_product_result
,
reason
,
relational_reason
)
if
business_type
!=
"智能监测"
and
business_type
!=
"关联推荐"
:
if
business_type
!=
"智能监测"
and
business_type
!=
"关联推荐"
and
business_type
!=
"公海挖掘"
:
return
common_result
.
to_result
(
business_product_result
)
elif
business_type
==
"关联推荐"
:
result
=
common_result
.
to_result
(
business_product_result
)
# print('result000',result)
result
[
'relational_reason'
]
=
relational_reason
return
result
elif
business_type
==
"公海挖掘"
:
result
=
common_result
.
to_result
(
business_product_result
)
# print('result000',result)
result
[
'seas_reason'
]
=
seas_reason
return
result
else
:
result
=
common_result
.
to_result
(
business_product_result
)
result
[
'survey_reason'
]
=
reason
...
...
entprofile/service/__pycache__/user_behavior.cpython-37.pyc
View file @
686cfe31
No preview for this file type
entprofile/service/user_behavior.py
View file @
686cfe31
...
...
@@ -24,11 +24,12 @@ class Recom:
else
:
behavior_json
[
'goods_name'
]
=
item
[
'product_name'
]
behavior_json
[
'purchase_date'
]
=
str
(
item
[
'order_add_time'
])
print
(
float
(
item
[
'order_pay'
]))
behavior_json
[
'contract_amount'
]
=
int
(
float
(
item
[
'order_pay'
])
/
100
)
behavior_json
[
'source'
]
=
item
[
'order_channel'
]
behavior_json
[
'customer_name'
]
=
item
[
'account_name'
]
behavior_json
[
'company_name'
]
=
company_name
#
item['status'] = "已完成"
item
[
'status'
]
=
"已完成"
company_purchase
.
append
(
behavior_json
)
num
=
num
+
1
return
company_purchase
...
...
@@ -313,6 +314,7 @@ class Recom:
product_list
=
[]
resaon
=
[]
relational_reason
=
[]
seas_reason
=
[]
product_result
=
provide
.
select_id
(
business_id
)
for
data
in
product_result
:
if
product_select
==
'复购算法'
:
...
...
@@ -357,7 +359,7 @@ class Recom:
if
data
[
'relational_product'
]:
if
data
[
'relational_reason'
]:
print
(
"data['relational_reason']"
,
data
[
'relational_reason'
])
relational_reason
=
json
.
loads
(
data
[
'relational_reason'
])
relational_reason
=
json
.
loads
(
data
[
'relational_reason'
]
.
replace
(
' '
,
''
)
)
relational
=
eval
(
data
[
'relational_product'
])
for
relationalitem
in
relational
:
relationalitem
[
'typeCate'
]
=
relationalitem
[
'typeName'
]
...
...
@@ -365,8 +367,21 @@ class Recom:
relationalitem
[
'typeName'
]
=
"关联推荐"
product_list
.
append
(
relationalitem
)
if
product_select
==
"公海挖掘"
:
if
data
[
'seas_product'
]:
if
data
[
'seas_reason'
]:
print
(
"data['seas_reason']"
,
data
[
'seas_reason'
])
seas_reason
=
json
.
loads
(
data
[
'seas_reason'
]
.
replace
(
' '
,
''
))
seas
=
eval
(
data
[
'seas_product'
])
for
seasitem
in
seas
:
print
(
'seasitem'
,
seasitem
)
seasitem
[
'typeCate'
]
=
seasitem
[
'typeName'
]
seasitem
[
'productName'
]
=
seasitem
[
'commodityName'
]
seasitem
[
'typeName'
]
=
"公海挖掘"
product_list
.
append
(
seasitem
)
print
(
product_list
,
"===========业务产品list1"
)
return
product_list
,
resaon
,
relational_reason
return
product_list
,
resaon
,
relational_reason
,
seas_reason
# 公司名推荐产品
def
company_product
(
self
,
company_name
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment