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
8c9daf58
Commit
8c9daf58
authored
Jun 13, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
6bdb1220
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
33 deletions
+53
-33
ic-deliver/app/base/controller/ctl.base.js
+6
-0
ic-deliver/app/base/db/impl/bizchance/bizoptDao.js
+47
-33
No files found.
ic-deliver/app/base/controller/ctl.base.js
View file @
8c9daf58
...
@@ -53,6 +53,12 @@ class CtlBase {
...
@@ -53,6 +53,12 @@ class CtlBase {
opath
:
req
.
headers
[
'xopath'
],
opath
:
req
.
headers
[
'xopath'
],
ptags
:
req
.
headers
[
'xptags'
],
ptags
:
req
.
headers
[
'xptags'
],
}
}
//添加组织结构路径,如果是上级,取上级
if
(
req
.
xctx
.
ptags
&&
req
.
xctx
.
ptags
!=
""
){
pobj
.
opath
=
req
.
xctx
.
ptags
}
else
{
pobj
.
opath
=
req
.
xctx
.
opath
}
if
(
!
req
.
xctx
.
appkey
)
{
if
(
!
req
.
xctx
.
appkey
)
{
return
[
-
200
,
"请求头缺少应用x-app-key"
]
return
[
-
200
,
"请求头缺少应用x-app-key"
]
}
else
{
}
else
{
...
...
ic-deliver/app/base/db/impl/bizchance/bizoptDao.js
View file @
8c9daf58
...
@@ -7,81 +7,95 @@ class BizoptDao extends Dao {
...
@@ -7,81 +7,95 @@ class BizoptDao extends Dao {
extraWhere
(
qobj
,
qw
,
qc
)
{
//根据业务员id获取商机信息的组装条件
extraWhere
(
qobj
,
qw
,
qc
)
{
//根据业务员id获取商机信息的组装条件
qc
.
raw
=
true
;
qc
.
raw
=
true
;
qc
.
where
.
business_type
=
qc
.
where
.
business_type
||
{
//检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据
[
this
.
db
.
Op
.
notIn
]:
[
"ICP"
,
"EDI"
]
if
(
qobj
.
company_id
==
1
)
{
}
return
qw
if
(
qobj
.
bizpath
&&
qobj
.
bizpath
!=
""
){
}
else
{
if
(
qobj
.
bizpath
.
indexOf
(
"myChance"
)
>
0
){
//说明是从商机列表过来的
//需要添加公司查询条件
qw
[
"salesman_id"
]
=
qobj
.
userid
;
qw
[
"facilitator_id"
]
=
Number
(
qobj
.
company_id
)
// 为空说明是管理员,不需设置组织结构过滤
if
(
qobj
.
opath
&&
qobj
.
opath
!=
""
)
{
qw
[
"salesman_opcode"
]
=
qobj
.
opath
}
}
}
//不是来自平台前端查询
if
(
qobj
.
bizpath
&&
qobj
.
bizpath
.
indexOf
(
"pmx"
)
<
0
)
{
qc
.
where
.
business_type
=
qc
.
where
.
business_type
||
{
[
this
.
db
.
Op
.
notIn
]:
[
"ICP"
,
"EDI"
]
}
if
(
qobj
.
bizpath
&&
qobj
.
bizpath
!=
""
)
{
if
(
qobj
.
bizpath
.
indexOf
(
"myChance"
)
>
0
)
{
//说明是从商机列表过来的
qw
[
"salesman_id"
]
=
qobj
.
userid
;
}
}
}
}
return
qw
;
return
qw
;
}
}
/*根据商机编号获取商机详情*/
/*根据商机编号获取商机详情*/
async
findInfoByDemandCode
(
qobj
){
async
findInfoByDemandCode
(
qobj
)
{
var
qcwhere
=
{
"demand_code"
:
qobj
.
businessMode
};
var
qcwhere
=
{
"demand_code"
:
qobj
.
businessMode
};
return
await
this
.
findOne
(
qcwhere
);
return
await
this
.
findOne
(
qcwhere
);
}
}
/*更新商机状态*/
/*更新商机状态*/
async
updateStatusByDemandCode
(
qobj
,
t
)
{
async
updateStatusByDemandCode
(
qobj
,
t
)
{
var
setobj
=
{
"business_status"
:
qobj
.
currentStatus
};
var
setobj
=
{
"business_status"
:
qobj
.
currentStatus
};
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
){
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
)
{
setobj
[
"close_reason"
]
=
qobj
.
statusReason
;
setobj
[
"close_reason"
]
=
qobj
.
statusReason
;
}
}
var
whereobj
=
{
"demand_code"
:
qobj
.
businessMode
};
var
whereobj
=
{
"demand_code"
:
qobj
.
businessMode
};
return
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
return
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
}
}
/*插入商机信息*/
/*插入商机信息*/
async
insertInfo
(
qobj
,
t
)
{
async
insertInfo
(
qobj
,
t
)
{
var
obj
=
{
var
obj
=
{
"demand_code"
:
qobj
.
businessMode
,
"demand_code"
:
qobj
.
businessMode
,
"business_type"
:
qobj
.
businessType
,
"business_type"
:
qobj
.
businessType
,
"business_status"
:
"beforeSubmission"
"business_status"
:
"beforeSubmission"
};
};
if
(
qobj
.
channelSource
&&
qobj
.
channelSource
!=
'undefined'
){
if
(
qobj
.
channelSource
&&
qobj
.
channelSource
!=
'undefined'
)
{
obj
.
source_name
=
qobj
.
channelSource
;
obj
.
source_name
=
qobj
.
channelSource
;
}
}
if
(
qobj
.
sourceNumber
&&
qobj
.
sourceNumber
!=
'undefined'
){
if
(
qobj
.
sourceNumber
&&
qobj
.
sourceNumber
!=
'undefined'
)
{
obj
.
source_number
=
qobj
.
sourceNumber
;
obj
.
source_number
=
qobj
.
sourceNumber
;
}
}
if
(
qobj
.
serviceCode
&&
qobj
.
serviceCode
!=
'undefined'
){
if
(
qobj
.
serviceCode
&&
qobj
.
serviceCode
!=
'undefined'
)
{
obj
.
service_address
=
qobj
.
serviceCode
;
obj
.
service_address
=
qobj
.
serviceCode
;
}
}
if
(
qobj
.
memoInfo
&&
qobj
.
memoInfo
!=
'undefined'
){
if
(
qobj
.
memoInfo
&&
qobj
.
memoInfo
!=
'undefined'
)
{
obj
.
business_info
.
memoInfo
=
qobj
.
memoInfo
;
obj
.
business_info
.
memoInfo
=
qobj
.
memoInfo
;
}
}
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
){
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
)
{
obj
.
close_reason
=
qobj
.
statusReason
;
obj
.
close_reason
=
qobj
.
statusReason
;
}
}
if
(
qobj
.
contactsName
&&
qobj
.
contactsName
!=
'undefined'
){
if
(
qobj
.
contactsName
&&
qobj
.
contactsName
!=
'undefined'
)
{
obj
.
business_info
.
contactsName
=
qobj
.
contactsName
;
obj
.
business_info
.
contactsName
=
qobj
.
contactsName
;
}
}
if
(
qobj
.
contactsPhone
&&
qobj
.
contactsPhone
!=
'undefined'
){
if
(
qobj
.
contactsPhone
&&
qobj
.
contactsPhone
!=
'undefined'
)
{
obj
.
business_info
.
contactsPhone
=
qobj
.
contactsPhone
;
obj
.
business_info
.
contactsPhone
=
qobj
.
contactsPhone
;
}
}
if
(
qobj
.
servicerCode
&&
qobj
.
servicerCode
!=
'undefined'
){
if
(
qobj
.
servicerCode
&&
qobj
.
servicerCode
!=
'undefined'
)
{
obj
.
facilitator_id
=
qobj
.
servicerCode
;
obj
.
facilitator_id
=
qobj
.
servicerCode
;
}
}
if
(
qobj
.
servicerName
&&
qobj
.
servicerName
!=
'undefined'
){
if
(
qobj
.
servicerName
&&
qobj
.
servicerName
!=
'undefined'
)
{
obj
.
facilitator_name
=
qobj
.
servicerName
;
obj
.
facilitator_name
=
qobj
.
servicerName
;
}
}
if
(
qobj
.
salesmanOpcode
&&
qobj
.
salesmanOpcode
!=
'undefined'
){
if
(
qobj
.
salesmanOpcode
&&
qobj
.
salesmanOpcode
!=
'undefined'
)
{
obj
.
salesman_opcode
=
qobj
.
salesmanOpcode
;
obj
.
salesman_opcode
=
qobj
.
salesmanOpcode
;
}
}
if
(
qobj
.
salesmanId
&&
qobj
.
salesmanId
!=
'undefined'
){
if
(
qobj
.
salesmanId
&&
qobj
.
salesmanId
!=
'undefined'
)
{
obj
.
salesman_id
=
qobj
.
salesmanId
;
obj
.
salesman_id
=
qobj
.
salesmanId
;
}
}
if
(
qobj
.
clerkName
&&
qobj
.
clerkName
!=
'undefined'
){
if
(
qobj
.
clerkName
&&
qobj
.
clerkName
!=
'undefined'
)
{
obj
.
salesman_name
=
qobj
.
clerkName
;
obj
.
salesman_name
=
qobj
.
clerkName
;
}
}
if
(
qobj
.
clerkPhone
&&
qobj
.
clerkPhone
!=
'undefined'
){
if
(
qobj
.
clerkPhone
&&
qobj
.
clerkPhone
!=
'undefined'
)
{
obj
.
salesman_phone
=
qobj
.
salesman_phone
;
obj
.
salesman_phone
=
qobj
.
salesman_phone
;
}
}
return
await
this
.
create
(
obj
,
t
);
return
await
this
.
create
(
obj
,
t
);
}
}
...
...
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