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
eef3d660
Commit
eef3d660
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
f968a3a2
3506ce7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
15 deletions
+41
-15
ic-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
+2
-2
ic-deliver/app/base/controller/impl/bizchance/schemeCtl.js
+36
-10
ic-deliver/app/base/db/impl/bizchance/schemeDao.js
+3
-3
No files found.
ic-deliver/app/base/controller/impl/bizchance/bizoptCtl.js
View file @
eef3d660
...
...
@@ -89,12 +89,12 @@ class BizOptCtl extends CtlBase {
}
/*根据商机编号更新商机状态*/
async
updateStatusByDemandCode
(
pobj
,
qobj
,
req
){
async
updateStatusByDemandCode
(
pobj
,
qobj
,
req
){
//关闭需求时调用
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
currentStatus
&&
pobj
.
currentStatus
!=
'undefined'
){
try
{
var
res
=
await
this
.
service
.
updateStatusByDemandCode
(
pobj
);
await
this
.
schemeService
.
updateStatusByDemandCode
(
pobj
);
//同时更新方案的状态
//
调商城接口,回传状态信息,后加
//
如果商机状态为关闭,需要回传给商城
if
(
pobj
.
currentStatus
==
"isClosed"
){
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
receiveUrl
;
...
...
ic-deliver/app/base/controller/impl/bizchance/schemeCtl.js
View file @
eef3d660
...
...
@@ -193,12 +193,37 @@ class SchemeCtl extends CtlBase {
/*根据商机编号更新方案详情*/
async
updateInfoByDemandCode
(
pobj
,
qobj
,
req
){
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
planInfo
&&
pobj
.
planInfo
!=
'undefined'
){
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
schemeNumber
&&
schemeNumber
!=
'undefined'
&&
pobj
.
planInfo
&&
pobj
.
planInfo
!=
'undefined'
){
try
{
var
retn
=
await
this
.
service
.
updateInfoByDemandCode
(
pobj
);
var
bobj
=
{
"businessMode"
:
pobj
.
businessMode
,
"currentStatus"
:
"beforeSubmission"
};
//把商机状态更新回待提交方案
await
this
.
bizoptService
.
updateStatusByDemandCode
(
bobj
);
return
system
.
getResult
(
"更新成功!"
);
pobj
.
currentStatus
=
"beforeConfirmation"
;
//同时把方案的状态也更新为待确认
//修改方案的时候,需要把修改的方案传给商城
var
mobj
=
pobj
;
mobj
.
businessType
=
appconfig
.
pdict
.
fdyDict
[
pobj
.
businessType
];
var
rc
=
system
.
getObject
(
"util.execClient"
);
var
requrl
=
this
.
receiveUrl
;
var
params
=
{
"actionType"
:
"submitSolution"
,
"actionBody"
:{
"needNum"
:
pobj
.
businessMode
,
"solutionNum"
:
pobj
.
schemeNumber
,
"solutionContent"
:
mobj
}
}
var
rtn
=
await
rc
.
execPost
(
params
,
requrl
);
var
j
=
JSON
.
parse
(
rtn
.
stdout
);
if
(
j
.
status
==
1
){
var
retn
=
await
this
.
service
.
updateInfoByDemandCode
(
pobj
);
//更新方案详情
var
bobj
=
{
"businessMode"
:
pobj
.
businessMode
,
"currentStatus"
:
"beforeConfirmation"
};
//同时把商机状态更新回待确认
await
this
.
bizoptService
.
updateStatusByDemandCode
(
bobj
);
return
system
.
getResult
(
"更新成功!"
);
}
else
{
return
system
.
getResultError
(
"更新方案出错!"
);
}
}
catch
(
error
){
return
system
.
getResultError
(
error
);
...
...
@@ -227,11 +252,11 @@ class SchemeCtl extends CtlBase {
/*插入方案信息*/
async
insertInfo
(
pobj
,
qobj
,
req
){
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
currentStatus
&&
pobj
.
currentStatus
!=
'undefined'
&&
pobj
.
baseInfo
&&
pobj
.
baseInfo
!=
'undefined'
){
//商机编号必须存在
if
(
pobj
.
businessMode
&&
pobj
.
businessMode
!=
'undefined'
&&
pobj
.
baseInfo
&&
pobj
.
baseInfo
!=
'undefined'
){
//商机编号必须存在
try
{
await
this
.
bizoptService
.
updateStatusByDemandCode
(
pobj
);
//修改商机状态
var
businessInfo
=
await
this
.
bizoptService
.
findInfoByDemandCode
(
pobj
);
//得到商机的信息
pobj
.
currentStatus
=
"beforeConfirmation"
;
//商机状态为待用户确认
await
this
.
bizoptService
.
updateStatusByDemandCode
(
pobj
);
//先修改商机状态
var
businessInfo
=
await
this
.
bizoptService
.
findInfoByDemandCode
(
pobj
);
//得到商机的信息,插入方案表时要用到
if
(
businessInfo
){
pobj
.
businessId
=
businessInfo
.
id
;
//商机id
pobj
.
businessType
=
businessInfo
.
business_type
;
//商机类型
...
...
@@ -241,9 +266,10 @@ class SchemeCtl extends CtlBase {
pobj
.
clerkId
=
businessInfo
.
salesman_id
;
//业务员id
pobj
.
clerkName
=
businessInfo
.
salesman_name
;
//业务员名称
pobj
.
clerkPhone
=
businessInfo
.
salesman_phone
;
//业务员联系电话
pobj
.
currentStatus
=
appconfig
.
pdict
.
businessStatus
[
businessInfo
.
business_status
];
//商机状态即为方案状态
//
pobj.currentStatus = appconfig.pdict.businessStatus[businessInfo.business_status];//商机状态即为方案状态
pobj
.
statusReason
=
businessInfo
.
close_reason
;
//状态原因
}
//调商城的接口,把商机详情返回给商城
var
mobj
=
pobj
;
mobj
.
businessType
=
appconfig
.
pdict
.
fdyDict
[
pobj
.
businessType
];
var
rc
=
system
.
getObject
(
"util.execClient"
);
...
...
ic-deliver/app/base/db/impl/bizchance/schemeDao.js
View file @
eef3d660
...
...
@@ -21,14 +21,14 @@ class SchemeDao extends Dao {
return
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
}
/*根据
方案
编号更新方案详情*/
/*根据
商机
编号更新方案详情*/
async
updateInfoByDemandCode
(
qobj
,
t
){
var
whereobj
=
{
"demand_code"
:
qobj
.
businessMode
};
var
setobj
=
{
"scheme_info"
:
qobj
.
planInfo
};
var
setobj
=
{
"scheme_info"
:
qobj
.
planInfo
,
"scheme_status"
:
qobj
.
currentStatus
};
return
await
this
.
updateByWhere
(
setobj
,
whereobj
,
t
);
}
/*根据
商机
编号更新方案编号*/
/*根据
方案
编号更新方案编号*/
async
updateSchemeNumberByDemandCode
(
qobj
,
t
){
var
setobj
=
{
"scheme_number"
:
qobj
.
schemeNumber
};
var
whereobj
=
{
"demand_code"
:
qobj
.
businessMode
};
...
...
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