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
b1d6da83
Commit
b1d6da83
authored
Jun 13, 2020
by
高宇强
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ic-deliver' of gitlab.gongsibao.com:jiangyong/zhichan into ic-deliver
parents
2d749cc4
8c9daf58
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 @
b1d6da83
...
...
@@ -53,6 +53,12 @@ class CtlBase {
opath
:
req
.
headers
[
'xopath'
],
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
)
{
return
[
-
200
,
"请求头缺少应用x-app-key"
]
}
else
{
...
...
ic-deliver/app/base/db/impl/bizchance/bizoptDao.js
View file @
b1d6da83
...
...
@@ -7,81 +7,95 @@ class BizoptDao extends Dao {
extraWhere
(
qobj
,
qw
,
qc
)
{
//根据业务员id获取商机信息的组装条件
qc
.
raw
=
true
;
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
;
//检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据
if
(
qobj
.
company_id
==
1
)
{
return
qw
}
else
{
//需要添加公司查询条件
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
;
}
/*根据商机编号获取商机详情*/
async
findInfoByDemandCode
(
qobj
){
var
qcwhere
=
{
"demand_code"
:
qobj
.
businessMode
};
async
findInfoByDemandCode
(
qobj
)
{
var
qcwhere
=
{
"demand_code"
:
qobj
.
businessMode
};
return
await
this
.
findOne
(
qcwhere
);
}
}
/*更新商机状态*/
async
updateStatusByDemandCode
(
qobj
,
t
)
{
var
setobj
=
{
"business_status"
:
qobj
.
currentStatus
};
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
){
async
updateStatusByDemandCode
(
qobj
,
t
)
{
var
setobj
=
{
"business_status"
:
qobj
.
currentStatus
};
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
)
{
setobj
[
"close_reason"
]
=
qobj
.
statusReason
;
}
var
whereobj
=
{
"demand_code"
:
qobj
.
businessMode
};
return
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
var
whereobj
=
{
"demand_code"
:
qobj
.
businessMode
};
return
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
}
/*插入商机信息*/
async
insertInfo
(
qobj
,
t
)
{
async
insertInfo
(
qobj
,
t
)
{
var
obj
=
{
"demand_code"
:
qobj
.
businessMode
,
"business_type"
:
qobj
.
businessType
,
"business_status"
:
"beforeSubmission"
"demand_code"
:
qobj
.
businessMode
,
"business_type"
:
qobj
.
businessType
,
"business_status"
:
"beforeSubmission"
};
if
(
qobj
.
channelSource
&&
qobj
.
channelSource
!=
'undefined'
){
if
(
qobj
.
channelSource
&&
qobj
.
channelSource
!=
'undefined'
)
{
obj
.
source_name
=
qobj
.
channelSource
;
}
if
(
qobj
.
sourceNumber
&&
qobj
.
sourceNumber
!=
'undefined'
){
if
(
qobj
.
sourceNumber
&&
qobj
.
sourceNumber
!=
'undefined'
)
{
obj
.
source_number
=
qobj
.
sourceNumber
;
}
if
(
qobj
.
serviceCode
&&
qobj
.
serviceCode
!=
'undefined'
){
if
(
qobj
.
serviceCode
&&
qobj
.
serviceCode
!=
'undefined'
)
{
obj
.
service_address
=
qobj
.
serviceCode
;
}
if
(
qobj
.
memoInfo
&&
qobj
.
memoInfo
!=
'undefined'
){
if
(
qobj
.
memoInfo
&&
qobj
.
memoInfo
!=
'undefined'
)
{
obj
.
business_info
.
memoInfo
=
qobj
.
memoInfo
;
}
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
){
if
(
qobj
.
statusReason
&&
qobj
.
statusReason
!=
'undefined'
)
{
obj
.
close_reason
=
qobj
.
statusReason
;
}
if
(
qobj
.
contactsName
&&
qobj
.
contactsName
!=
'undefined'
){
if
(
qobj
.
contactsName
&&
qobj
.
contactsName
!=
'undefined'
)
{
obj
.
business_info
.
contactsName
=
qobj
.
contactsName
;
}
if
(
qobj
.
contactsPhone
&&
qobj
.
contactsPhone
!=
'undefined'
){
if
(
qobj
.
contactsPhone
&&
qobj
.
contactsPhone
!=
'undefined'
)
{
obj
.
business_info
.
contactsPhone
=
qobj
.
contactsPhone
;
}
if
(
qobj
.
servicerCode
&&
qobj
.
servicerCode
!=
'undefined'
){
if
(
qobj
.
servicerCode
&&
qobj
.
servicerCode
!=
'undefined'
)
{
obj
.
facilitator_id
=
qobj
.
servicerCode
;
}
if
(
qobj
.
servicerName
&&
qobj
.
servicerName
!=
'undefined'
){
if
(
qobj
.
servicerName
&&
qobj
.
servicerName
!=
'undefined'
)
{
obj
.
facilitator_name
=
qobj
.
servicerName
;
}
if
(
qobj
.
salesmanOpcode
&&
qobj
.
salesmanOpcode
!=
'undefined'
){
if
(
qobj
.
salesmanOpcode
&&
qobj
.
salesmanOpcode
!=
'undefined'
)
{
obj
.
salesman_opcode
=
qobj
.
salesmanOpcode
;
}
if
(
qobj
.
salesmanId
&&
qobj
.
salesmanId
!=
'undefined'
){
if
(
qobj
.
salesmanId
&&
qobj
.
salesmanId
!=
'undefined'
)
{
obj
.
salesman_id
=
qobj
.
salesmanId
;
}
if
(
qobj
.
clerkName
&&
qobj
.
clerkName
!=
'undefined'
){
if
(
qobj
.
clerkName
&&
qobj
.
clerkName
!=
'undefined'
)
{
obj
.
salesman_name
=
qobj
.
clerkName
;
}
if
(
qobj
.
clerkPhone
&&
qobj
.
clerkPhone
!=
'undefined'
){
if
(
qobj
.
clerkPhone
&&
qobj
.
clerkPhone
!=
'undefined'
)
{
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