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
e2ff7626
Commit
e2ff7626
authored
Mar 19, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
870c3be7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
83 deletions
+25
-83
center-order/app/base/service/impl/dbneed/needinfoSve.js
+9
-49
center-order/app/base/service/impl/dbneed/needsolutionSve.js
+16
-34
No files found.
center-order/app/base/service/impl/dbneed/needinfoSve.js
View file @
e2ff7626
...
@@ -49,37 +49,17 @@ class NeedinfoService extends ServiceBase {
...
@@ -49,37 +49,17 @@ class NeedinfoService extends ServiceBase {
async
submitNeed
(
pobj
,
actionBody
,
req
)
{
async
submitNeed
(
pobj
,
actionBody
,
req
)
{
var
needNo
=
await
this
.
getBusUid
(
"n"
);
var
needNo
=
await
this
.
getBusUid
(
"n"
);
if
(
!
actionBody
.
intentionBizId
)
{
if
(
!
actionBody
.
intentionBizId
)
{
return
{
return
system
.
getResultFail
(
-
5001
,
"intentionBizId不能为空"
);
"requestId"
:
req
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"intentionBizId不能为空"
,
"errorCode"
:
"ok"
};
}
}
if
(
!
actionBody
.
mobile
)
{
if
(
!
actionBody
.
mobile
)
{
return
{
return
system
.
getResultFail
(
-
5002
,
"mobile不能为空"
);
"requestId"
:
req
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"mobile不能为空"
,
"errorCode"
:
"ok"
};
}
}
if
(
!
actionBody
.
type
)
{
if
(
!
actionBody
.
type
)
{
return
{
return
system
.
getResultFail
(
-
5003
,
"type不能为空"
);
"requestId"
:
req
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"type不能为空"
,
"errorCode"
:
"ok"
};
}
}
var
ninfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
var
ninfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
if
(
ninfo
)
{
if
(
ninfo
)
{
return
{
return
system
.
getResultSuccess
();
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
"已存在"
,
"errorCode"
:
"ok"
};
}
}
var
nobj
=
{
var
nobj
=
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
...
@@ -95,45 +75,25 @@ class NeedinfoService extends ServiceBase {
...
@@ -95,45 +75,25 @@ class NeedinfoService extends ServiceBase {
status
:
"wts"
status
:
"wts"
}
}
await
this
.
dao
.
create
(
nobj
);
await
this
.
dao
.
create
(
nobj
);
return
{
return
system
.
getResultSuccess
();
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
}
}
async
needClose
(
pobj
,
actionBody
,
req
)
{
async
needClose
(
pobj
,
actionBody
,
req
)
{
if
(
!
actionBody
.
intentionBizId
)
{
if
(
!
actionBody
.
intentionBizId
)
{
return
system
.
getResult
(
null
,
"intentionBizId不能为空"
);
return
system
.
getResult
Fail
(
-
5005
,
"intentionBizId不能为空"
);
}
}
var
needinfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
var
needinfo
=
await
this
.
findOne
({
channelNeedNo
:
actionBody
.
intentionBizId
});
if
(
!
needinfo
)
{
if
(
!
needinfo
)
{
return
{
return
system
.
getResultFail
(
-
5004
,
"需求不存在"
);
"requestId"
:
req
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"需求不存在"
,
"errorCode"
:
"ok"
};
}
}
if
(
needinfo
.
status
==
"ygb"
||
needinfo
.
status
==
"ycd"
)
{
if
(
needinfo
.
status
==
"ygb"
||
needinfo
.
status
==
"ycd"
)
{
return
{
return
system
.
getResultSuccess
();
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
"需求已关闭"
,
"errorCode"
:
"ok"
};
}
else
{
}
else
{
needinfo
.
status
=
"ygb"
;
needinfo
.
status
=
"ygb"
;
var
self
=
this
;
var
self
=
this
;
await
self
.
update
(
needinfo
.
dataValues
);
await
self
.
update
(
needinfo
.
dataValues
);
await
self
.
needsolutionSve
.
abolishProgrammeByNeed
(
pobj
);
await
self
.
needsolutionSve
.
abolishProgrammeByNeed
(
pobj
);
return
{
return
system
.
getResultSuccess
();
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};
}
}
}
}
...
...
center-order/app/base/service/impl/dbneed/needsolutionSve.js
View file @
e2ff7626
...
@@ -84,7 +84,6 @@ class NeedsolutionService extends ServiceBase {
...
@@ -84,7 +84,6 @@ class NeedsolutionService extends ServiceBase {
var
solutionNo
=
await
this
.
getBusUid
(
"ns"
);
var
solutionNo
=
await
this
.
getBusUid
(
"ns"
);
ab
[
"solutionNo"
]
=
solutionNo
;
ab
[
"solutionNo"
]
=
solutionNo
;
ab
[
"status"
]
=
"dqr"
;
ab
[
"status"
]
=
"dqr"
;
ab
.
solutionContent
.
notes
=
""
;
ab
.
solutionContent
=
JSON
.
stringify
(
ab
.
solutionContent
);
ab
.
solutionContent
=
JSON
.
stringify
(
ab
.
solutionContent
);
var
self
=
this
;
var
self
=
this
;
return
await
this
.
db
.
transaction
(
async
function
(
t
)
{
return
await
this
.
db
.
transaction
(
async
function
(
t
)
{
...
@@ -150,9 +149,17 @@ class NeedsolutionService extends ServiceBase {
...
@@ -150,9 +149,17 @@ class NeedsolutionService extends ServiceBase {
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
return
system
.
getResultFail
(
-
100
,
"未知用户"
);
}
}
ab
[
"createUserId"
]
=
user
.
id
;
ab
[
"createUserId"
]
=
user
.
id
;
// followManMobile: DataTypes.STRING,//跟进人手机号(合伙人)
// followManOnlyCode: DataTypes.STRING(50),//跟进者唯一码
if
(
!
ab
.
needNo
){
if
(
!
ab
.
needNo
){
return
system
.
getResultFail
(
-
101
,
"需求号不能为空"
);
return
system
.
getResultFail
(
-
101
,
"需求号不能为空"
);
}
}
// if(!ab.followManMobile){
// return system.getResultFail(-102,"跟进人手机号不能为空");
// }
// if(!ab.followManOnlyCode){
// return system.getResultFail(-103,"跟进人唯一码不能为空");
// }
//获取需求信息
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:{
needNo
:
ab
.
needNo
},
raw
:
true
where
:{
needNo
:
ab
.
needNo
},
raw
:
true
...
@@ -260,34 +267,19 @@ class NeedsolutionService extends ServiceBase {
...
@@ -260,34 +267,19 @@ class NeedsolutionService extends ServiceBase {
}
}
//接收方案反馈信息(即方案作废)
//接收方案反馈信息(即方案作废)
async
receiveFeedback
(
pobj
,
req
){
async
receiveFeedback
(
pobj
){
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
solutionBizId
){
if
(
!
ab
.
solutionBizId
){
return
{
return
system
.
getResultFail
(
-
101
,
"方案业务编号不能为空"
);
"requestId"
:
req
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"-101,方案业务编号不能为空"
,
"errorCode"
:
"ok"
};
}
}
if
(
!
ab
.
operateType
){
if
(
!
ab
.
operateType
){
return
{
return
system
.
getResultFail
(
-
102
,
"操作类型不能为空"
);
"requestId"
:
req
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"-102,操作类型不能为空"
,
"errorCode"
:
"ok"
};
}
}
var
ns
=
await
this
.
dao
.
model
.
findOne
({
var
ns
=
await
this
.
dao
.
model
.
findOne
({
where
:{
channelSolutionNo
:
ab
.
solutionBizId
},
raw
:
true
where
:{
channelSolutionNo
:
ab
.
solutionBizId
},
raw
:
true
});
});
if
(
!
ns
||
!
ns
.
id
){
if
(
!
ns
||
!
ns
.
id
){
return
{
return
system
.
getResultFail
(
-
103
,
"未知方案"
);
"requestId"
:
req
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"-103,未知方案"
,
"errorCode"
:
"ok"
};
}
}
var
solutionContent
=
ns
.
solutionContent
?
JSON
.
parse
(
ns
.
solutionContent
):
""
;
var
solutionContent
=
ns
.
solutionContent
?
JSON
.
parse
(
ns
.
solutionContent
):
""
;
var
status
=
""
;
var
status
=
""
;
...
@@ -298,31 +290,21 @@ class NeedsolutionService extends ServiceBase {
...
@@ -298,31 +290,21 @@ class NeedsolutionService extends ServiceBase {
}
else
if
(
ab
.
operateType
==
"PAID"
){
// PAID:支付
}
else
if
(
ab
.
operateType
==
"PAID"
){
// PAID:支付
status
=
"ywc"
;
status
=
"ywc"
;
}
else
{
}
else
{
return
{
return
system
.
getResultFail
(
-
104
,
"操作类型有误"
);
"requestId"
:
req
.
requestId
,
"success"
:
false
,
"errorMsg"
:
"-104,操作类型有误"
,
"errorCode"
:
"ok"
};
}
}
var
solution_status
=
{
"dqr"
:
"待确认"
,
"ywc"
:
"已完成"
,
"yzf"
:
"已作废"
};
var
solution_status
=
{
"dqr"
:
"待确认"
,
"ywc"
:
"已完成"
,
"yzf"
:
"已作废"
};
solutionContent
[
"deliveryStatus"
]
=
status
;
solutionContent
[
"deliveryStatus"
]
=
status
;
solutionContent
[
"deliveryStatusName"
]
=
solution_status
[
status
];
solutionContent
[
"deliveryStatusName"
]
=
solution_status
[
status
];
solutionContent
[
"updated"
]
=
new
Date
();
solutionContent
[
"updated"
]
=
new
Date
();
if
(
ab
.
note
){
if
(
ab
.
note
){
solutionContent
[
"notes"
]
=
ab
.
note
;
//用户反馈信息
solutionContent
[
"notes"
]
=
ab
.
note
;
}
}
solutionContent
=
JSON
.
stringify
(
solutionContent
);
solutionContent
=
JSON
.
stringify
(
solutionContent
);
var
reqObj
=
{
var
reqObj
=
{
status
:
status
,
solutionContent
:
solutionContent
status
:
status
,
solutionContent
:
solutionContent
};
};
await
this
.
dao
.
model
.
update
(
reqObj
,
{
where
:
{
id
:
ns
.
id
}});
//修改方案信息
await
this
.
dao
.
model
.
update
(
reqObj
,
{
where
:
{
id
:
ns
.
id
}});
//修改方案信息
return
{
return
system
.
getResultSuccess
();
"requestId"
:
req
.
requestId
,
"success"
:
true
,
"errorMsg"
:
""
,
"errorCode"
:
"ok"
};;
}
}
//服务商方案作废
//服务商方案作废
async
abolishProgramme
(
pobj
){
async
abolishProgramme
(
pobj
){
...
@@ -345,7 +327,7 @@ class NeedsolutionService extends ServiceBase {
...
@@ -345,7 +327,7 @@ class NeedsolutionService extends ServiceBase {
return
system
.
getResultFail
(
-
103
,
"方案状态错误,只能废弃待确认方案"
);
return
system
.
getResultFail
(
-
103
,
"方案状态错误,只能废弃待确认方案"
);
}
}
await
this
.
dao
.
update
({
id
:
ns
.
id
,
status
:
"yzf"
});
//方案废弃
await
this
.
dao
.
update
({
id
:
ns
.
id
,
status
:
"yzf"
});
//方案废弃
return
system
.
getResultSuccess
(
{
channelSolutionNo
:
ns
.
channelSolutionNo
}
);
return
system
.
getResultSuccess
();
}
}
//根据需求关闭方案(关闭需求后调用)
//根据需求关闭方案(关闭需求后调用)
async
abolishProgrammeByNeed
(
pobj
){
async
abolishProgrammeByNeed
(
pobj
){
...
...
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