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
d630c43c
Commit
d630c43c
authored
Sep 28, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-order' of
http://gitlab.gongsibao.com/jiangyong/zhichan
into center-order
parents
702af4f8
5ac3f093
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
104 additions
and
18 deletions
+104
-18
center-order/app/base/api/impl/action/qcapi.js
+6
-0
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
+98
-18
No files found.
center-order/app/base/api/impl/action/qcapi.js
View file @
d630c43c
...
@@ -85,6 +85,12 @@ class QcAPI extends APIBase {
...
@@ -85,6 +85,12 @@ class QcAPI extends APIBase {
case
"submitWangwenSolution"
:
//提交方案(文网文)2020-9-27
case
"submitWangwenSolution"
:
//提交方案(文网文)2020-9-27
opResult
=
await
this
.
aliyunqcSve
.
submitWangwenSolution
(
pobj
);
opResult
=
await
this
.
aliyunqcSve
.
submitWangwenSolution
(
pobj
);
break
;
break
;
case
"closeNeed"
:
//关闭需求(文网文)2020-9-28
opResult
=
await
this
.
aliyunqcSve
.
closeNeed
(
pobj
);
break
;
case
"recordLog"
:
//提交沟通记录(文网文)2020-9-28
opResult
=
await
this
.
aliyunqcSve
.
recordLog
(
pobj
);
break
;
default
:
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
break
;
...
...
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
View file @
d630c43c
...
@@ -19,17 +19,17 @@ class AliyunQcService {
...
@@ -19,17 +19,17 @@ class AliyunQcService {
};
};
this
.
ediSolutionStatusReference
=
{
this
.
ediSolutionStatusReference
=
{
SOLUTION_SUBMIT
:
"服务单通知服务商"
,
SOLUTION_SUBMIT
:
"服务单通知服务商"
,
USER_PAY_PRODUCE
:
"⽤户⽀付"
,
USER_PAY_PRODUCE
:
"⽤户⽀付"
,
USER_CONFIRM_PRODUCE
:
"⽤户确认资料"
,
USER_CONFIRM_PRODUCE
:
"⽤户确认资料"
,
USER_REFUSE_PRODUCE
:
"资料退回修改"
,
USER_REFUSE_PRODUCE
:
"资料退回修改"
,
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
,
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
,
USER_UPLOAD_PRODUCE
:
"⽤户补充基本资料"
USER_UPLOAD_PRODUCE
:
"⽤户补充基本资料"
};
};
this
.
ediProduceStatus
=
{
this
.
ediProduceStatus
=
{
110
:
"⽤户⽀付"
,
110
:
"⽤户⽀付"
,
30
:
"待⽤户确认"
,
30
:
"待⽤户确认"
,
105
:
"账户已注册"
,
105
:
"账户已注册"
,
35
:
"待提交审核"
,
35
:
"待提交审核"
,
109
:
"管局已通过"
,
109
:
"管局已通过"
,
106
:
"材料已递交⼯信部"
,
106
:
"材料已递交⼯信部"
,
10
:
"已⽀付"
,
10
:
"已⽀付"
,
...
@@ -922,7 +922,7 @@ class AliyunQcService {
...
@@ -922,7 +922,7 @@ class AliyunQcService {
return
uuid
.
join
(
''
);
return
uuid
.
join
(
''
);
}
}
//接收渠道方案状态变更通知
//接收渠道方案状态变更通知
async
receiveEdiStatusNotify
(
pobj
)
{
async
receiveEdiStatusNotify
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
BizId
)
{
if
(
!
ab
.
BizId
)
{
...
@@ -933,7 +933,7 @@ class AliyunQcService {
...
@@ -933,7 +933,7 @@ class AliyunQcService {
}
}
//获取方案信息
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
where
:
{
channelSolutionNo
:
ab
.
BizId
,
isInvalid
:
0
},
raw
:
true
});
});
if
(
!
ns
||
!
ns
.
id
)
{
if
(
!
ns
||
!
ns
.
id
)
{
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
...
@@ -948,9 +948,9 @@ class AliyunQcService {
...
@@ -948,9 +948,9 @@ class AliyunQcService {
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
}
var
solutionContent
=
ns
.
solutionContent
;
var
solutionContent
=
ns
.
solutionContent
;
var
checkStatus
=
{
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
};
var
checkStatus
=
{
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
};
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
}
}
//方案流程列表
//方案流程列表
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
...
@@ -965,31 +965,31 @@ class AliyunQcService {
...
@@ -965,31 +965,31 @@ class AliyunQcService {
id
:
needinfo
.
id
,
status
:
"ycd"
id
:
needinfo
.
id
,
status
:
"ycd"
}
}
await
this
.
needinfoDao
.
update
(
needObj
);
//关闭需求
await
this
.
needinfoDao
.
update
(
needObj
);
//关闭需求
}
else
if
(
ab
.
operationType
==
"USER_CONFIRM_PRODUCE"
)
{
//⽤户确认资料
}
else
if
(
ab
.
operationType
==
"USER_CONFIRM_PRODUCE"
)
{
//⽤户确认资料
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"USER_CONFIRM_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_CONFIRM_PRODUCE
,
updated_at
:
new
Date
()
status
:
"USER_CONFIRM_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_CONFIRM_PRODUCE
,
updated_at
:
new
Date
()
});
});
solutionContent
.
status
=
"USER_CONFIRM_PRODUCE"
;
solutionContent
.
status
=
"USER_CONFIRM_PRODUCE"
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
USER_CONFIRM_PRODUCE
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
USER_CONFIRM_PRODUCE
;
}
else
if
(
ab
.
operationType
==
"USER_REFUSE_PRODUCE"
)
{
//资料退回修改
}
else
if
(
ab
.
operationType
==
"USER_REFUSE_PRODUCE"
)
{
//资料退回修改
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"USER_REFUSE_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_REFUSE_PRODUCE
,
updated_at
:
new
Date
()
status
:
"USER_REFUSE_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_REFUSE_PRODUCE
,
updated_at
:
new
Date
()
});
});
solutionContent
.
status
=
"USER_REFUSE_PRODUCE"
;
solutionContent
.
status
=
"USER_REFUSE_PRODUCE"
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
USER_REFUSE_PRODUCE
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
USER_REFUSE_PRODUCE
;
}
else
if
(
ab
.
operationType
==
"USER_UPLOAD_PRODUCE"
)
{
//⽤户补充基本资料
}
else
if
(
ab
.
operationType
==
"USER_UPLOAD_PRODUCE"
)
{
//⽤户补充基本资料
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"USER_UPLOAD_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_UPLOAD_PRODUCE
,
updated_at
:
new
Date
()
status
:
"USER_UPLOAD_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_UPLOAD_PRODUCE
,
updated_at
:
new
Date
()
});
});
solutionContent
.
status
=
"USER_UPLOAD_PRODUCE"
;
solutionContent
.
status
=
"USER_UPLOAD_PRODUCE"
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
USER_UPLOAD_PRODUCE
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
USER_UPLOAD_PRODUCE
;
}
else
if
(
ab
.
operationType
==
"ABC_CLOSE_PRODUCE"
)
{
//⽅案已关闭
}
else
if
(
ab
.
operationType
==
"ABC_CLOSE_PRODUCE"
)
{
//⽅案已关闭
solutionFlowList
.
push
({
solutionFlowList
.
push
({
status
:
"ABC_CLOSE_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
ABC_CLOSE_PRODUCE
,
updated_at
:
new
Date
()
status
:
"ABC_CLOSE_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
ABC_CLOSE_PRODUCE
,
updated_at
:
new
Date
()
});
});
solutionContent
.
status
=
"ABC_CLOSE_PRODUCE"
;
solutionContent
.
status
=
"ABC_CLOSE_PRODUCE"
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
ABC_CLOSE_PRODUCE
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
ABC_CLOSE_PRODUCE
;
}
else
{
}
else
{
return
system
.
getResultFail
(
-
110
,
"状态错误"
);
return
system
.
getResultFail
(
-
110
,
"状态错误"
);
}
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
solutionContent
.
solutionFlowList
=
solutionFlowList
;
...
@@ -1014,7 +1014,7 @@ class AliyunQcService {
...
@@ -1014,7 +1014,7 @@ class AliyunQcService {
};
};
if
(
ab
.
operationType
==
"ABC_CLOSE_PRODUCE"
)
{
//⽅案已关闭
if
(
ab
.
operationType
==
"ABC_CLOSE_PRODUCE"
)
{
//⽅案已关闭
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"isInvalid"
]
=
1
;
updateObj
[
"isInvalid"
]
=
1
;
}
}
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
var
new_ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
var
new_ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
...
@@ -1227,7 +1227,7 @@ class AliyunQcService {
...
@@ -1227,7 +1227,7 @@ class AliyunQcService {
if
(
!
solution
)
{
if
(
!
solution
)
{
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
return
system
.
getResultFail
(
-
103
,
"方案交付信息有误"
);
}
}
if
(
needinfo
.
channelTypeCode
==
"
官网
"
)
{
//esp.wangwen
if
(
needinfo
.
channelTypeCode
==
"
esp.wangwen
"
)
{
//esp.wangwen
ab
.
solutionContent
.
solution
.
IcpType
=
"wangwen"
;
ab
.
solutionContent
.
solution
.
IcpType
=
"wangwen"
;
}
else
{
}
else
{
return
system
.
getResultFail
(
-
208
,
"需求业务类型有误"
);
return
system
.
getResultFail
(
-
208
,
"需求业务类型有误"
);
...
@@ -1305,5 +1305,85 @@ class AliyunQcService {
...
@@ -1305,5 +1305,85 @@ class AliyunQcService {
}
}
//关闭需求(文网文) 2020-9-28
async
closeNeed
()
{
var
ab
=
pobj
.
actionBody
;
var
app
=
pobj
.
appInfo
;
if
(
!
app
||
!
app
.
uapp_id
)
{
return
system
.
getResultFail
(
-
100
,
"未知渠道"
);
}
if
(
!
ab
.
needNo
)
{
return
system
.
getResultFail
(
-
101
,
"需求编号不能为空"
);
}
if
(
!
ab
.
note
)
{
return
system
.
getResultFail
(
-
106
,
"关闭理由不能为空"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
attributes
:
[
"id"
,
"status"
,
"statusName"
,
"needNo"
],
where
:
{
channelNeedNo
:
ab
.
needNo
},
raw
:
true
});
if
(
!
needinfo
||
!
needinfo
.
id
)
{
return
system
.
getResultFail
(
-
201
,
"未知需求信息"
);
}
if
(
needinfo
.
status
==
"ygb"
)
{
return
system
.
getResultFail
(
-
202
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
var
updateNeed
=
await
this
.
needinfoDao
.
update
(
needObj
);
//关闭需求
if
(
!
updateNeed
)
{
return
system
.
getResultFail
(
-
203
,
"关闭需求失败"
);
}
else
{
return
system
.
getResultSuccess
();
}
}
//提交沟通记录
async
recordLog
(
pobj
)
{
// 查询需求沟通记录
// 2020 0820 lin 修改channel传过来的参数 为 note/needNo
pobj
.
actionBody
.
Note
=
[
"noteTime"
,
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
),
"note"
,
pobj
.
actionBody
.
note
];
let
needRes
=
await
this
.
findOne
({
channelNeedNo
:
pobj
.
actionBody
.
needNo
});
// 没有需求单直接返回
if
(
!
needRes
)
{
return
system
.
getResult
(
"没有这个需求单"
);
}
// 如果未推送/以推送 修改为已跟进
if
(
needRes
.
status
==
"wts"
||
needRes
.
status
==
"yts"
)
{
var
sql
=
"update n_need_info set status=:status, statusName=:statusName where channelNeedNo=:BizId"
var
paramWhere
=
{
statusName
:
'已跟进'
,
status
:
'ygj'
,
BizId
:
pobj
.
actionBody
.
needNo
};
var
updateRes
=
await
this
.
customUpdate
(
sql
,
paramWhere
);
}
// 有需求单但没有沟通记录 直接set
if
(
!
needRes
.
followContent
)
{
var
sql
=
"update n_need_info set followContent=JSON_OBJECT(:followContent) where channelNeedNo=:BizId"
var
paramWhere
=
{
followContent
:
pobj
.
actionBody
.
Note
,
BizId
:
pobj
.
actionBody
.
needNo
};
var
updateRes
=
await
this
.
customUpdate
(
sql
,
paramWhere
);
if
(
updateRes
[
1
])
{
return
system
.
getResultSuccess
();
}
return
system
.
getResult
(
"添加记录失败"
);
// 有需求单有沟通记录 json_array_append
}
else
{
var
sql
=
"update n_need_info set followContent=json_array_append(followContent, '$', JSON_OBJECT(:Note)) where channelNeedNo=:BizId"
// var sql = "update n_need_info set followContent=json_array_append(followContent, '$', "+ "\"" + JSON.stringify(pobj.actionBody.Note) + "\""+") where channelNeedNo="+ "\"" +pobj.actionBody.BizId +"\"" +" "
var
paramWhere
=
{
Note
:
pobj
.
actionBody
.
Note
,
BizId
:
pobj
.
actionBody
.
needNo
};
var
updateRes
=
await
this
.
customUpdate
(
sql
,
paramWhere
);
if
(
updateRes
[
1
])
{
return
system
.
getResultSuccess
();
}
return
system
.
getResult
(
"添加记录失败"
);
}
}
}
}
module
.
exports
=
AliyunQcService
;
module
.
exports
=
AliyunQcService
;
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