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
5ac3f093
Commit
5ac3f093
authored
Sep 28, 2020
by
兰国旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laolan
parent
5361c981
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
17 deletions
+103
-17
center-order/app/base/api/impl/action/qcapi.js
+6
-0
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
+97
-17
No files found.
center-order/app/base/api/impl/action/qcapi.js
View file @
5ac3f093
...
...
@@ -85,6 +85,12 @@ class QcAPI extends APIBase {
case
"submitWangwenSolution"
:
//提交方案(文网文)2020-9-27
opResult
=
await
this
.
aliyunqcSve
.
submitWangwenSolution
(
pobj
);
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
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
View file @
5ac3f093
...
...
@@ -19,17 +19,17 @@ class AliyunQcService {
};
this
.
ediSolutionStatusReference
=
{
SOLUTION_SUBMIT
:
"服务单通知服务商"
,
USER_PAY_PRODUCE
:
"⽤户⽀付"
,
USER_PAY_PRODUCE
:
"⽤户⽀付"
,
USER_CONFIRM_PRODUCE
:
"⽤户确认资料"
,
USER_REFUSE_PRODUCE
:
"资料退回修改"
,
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
,
USER_REFUSE_PRODUCE
:
"资料退回修改"
,
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
,
USER_UPLOAD_PRODUCE
:
"⽤户补充基本资料"
};
this
.
ediProduceStatus
=
{
110
:
"⽤户⽀付"
,
110
:
"⽤户⽀付"
,
30
:
"待⽤户确认"
,
105
:
"账户已注册"
,
35
:
"待提交审核"
,
105
:
"账户已注册"
,
35
:
"待提交审核"
,
109
:
"管局已通过"
,
106
:
"材料已递交⼯信部"
,
10
:
"已⽀付"
,
...
...
@@ -922,7 +922,7 @@ class AliyunQcService {
return
uuid
.
join
(
''
);
}
//接收渠道方案状态变更通知
//接收渠道方案状态变更通知
async
receiveEdiStatusNotify
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
BizId
)
{
...
...
@@ -933,7 +933,7 @@ class AliyunQcService {
}
//获取方案信息
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
)
{
return
system
.
getResultFail
(
-
102
,
"未知方案"
);
...
...
@@ -948,9 +948,9 @@ class AliyunQcService {
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
var
solutionContent
=
ns
.
solutionContent
;
var
checkStatus
=
{
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
};
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
var
checkStatus
=
{
ABC_CLOSE_PRODUCE
:
"⼩⼆后台关闭服务单"
};
if
(
solutionContent
.
status
&&
checkStatus
[
solutionContent
.
status
])
{
return
system
.
getResultFail
(
-
111
,
"方案已进入"
+
solutionContent
.
statusName
+
"流程,不能执行此操作"
);
}
//方案流程列表
var
solutionFlowList
=
solutionContent
.
solutionFlowList
||
[];
...
...
@@ -965,31 +965,31 @@ class AliyunQcService {
id
:
needinfo
.
id
,
status
:
"ycd"
}
await
this
.
needinfoDao
.
update
(
needObj
);
//关闭需求
}
else
if
(
ab
.
operationType
==
"USER_CONFIRM_PRODUCE"
)
{
//⽤户确认资料
}
else
if
(
ab
.
operationType
==
"USER_CONFIRM_PRODUCE"
)
{
//⽤户确认资料
solutionFlowList
.
push
({
status
:
"USER_CONFIRM_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_CONFIRM_PRODUCE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"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
({
status
:
"USER_REFUSE_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_REFUSE_PRODUCE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"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
({
status
:
"USER_UPLOAD_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
USER_UPLOAD_PRODUCE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"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
({
status
:
"ABC_CLOSE_PRODUCE"
,
statusName
:
this
.
ediSolutionStatusReference
.
ABC_CLOSE_PRODUCE
,
updated_at
:
new
Date
()
});
solutionContent
.
status
=
"ABC_CLOSE_PRODUCE"
;
solutionContent
.
statusName
=
this
.
ediSolutionStatusReference
.
ABC_CLOSE_PRODUCE
;
}
else
{
}
else
{
return
system
.
getResultFail
(
-
110
,
"状态错误"
);
}
solutionContent
.
solutionFlowList
=
solutionFlowList
;
...
...
@@ -1006,7 +1006,7 @@ class AliyunQcService {
};
if
(
ab
.
operationType
==
"ABC_CLOSE_PRODUCE"
)
{
//⽅案已关闭
updateObj
[
"status"
]
=
"yzf"
;
updateObj
[
"isInvalid"
]
=
1
;
updateObj
[
"isInvalid"
]
=
1
;
}
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
var
new_ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
...
...
@@ -1297,5 +1297,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
;
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