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
f306cabf
Commit
f306cabf
authored
Mar 23, 2021
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
阿里商标订单
parent
d62d6a85
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
202 additions
and
63 deletions
+202
-63
center-order/app/base/api/impl/action/order.js
+6
-0
center-order/app/base/service/impl/dbcorder/internalCallsNotifySve.js
+40
-28
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
+95
-0
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
+61
-35
No files found.
center-order/app/base/api/impl/action/order.js
View file @
f306cabf
...
...
@@ -106,6 +106,12 @@ class OrderAPI extends APIBase {
case
"bulkCreateOrders"
:
opResult
=
await
this
.
orderinfoSve
.
bulkCreateOrders
(
pobj
,
req
);
break
;
case
"receiveAliTmOrder"
:
//接收阿里商标订单
opResult
=
await
this
.
orderinfoSve
.
receiveAliTmOrder
(
pobj
);
break
;
case
"receiveAliTmOrderRefund"
:
//接收阿里商标订单退款信息
opResult
=
await
this
.
orderinfoSve
.
receiveAliTmOrderRefund
(
pobj
);
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
center-order/app/base/service/impl/dbcorder/internalCallsNotifySve.js
View file @
f306cabf
...
...
@@ -323,29 +323,42 @@ class InternalCallsNotifyService {
date
:
new
Date
(),
flowName
:
"提交确认注册⽅案,待用户确认"
};
await
this
.
db
.
transaction
(
async
function
(
t
)
{
for
(
var
i
=
0
;
i
<
nsList
.
length
;
i
++
){
var
ns
=
nsList
[
i
];
if
(
ns
&&
ns
.
id
){
if
(
ns
.
solutionContent
){
if
(
typeof
ns
.
solutionContent
===
'string'
){
ns
.
solutionContent
=
JSON
.
parse
(
ns
.
solutionContent
)
}
var
flowList
=
ns
.
solutionContent
.
flowList
||
[];
flowList
.
push
(
flowObj
);
ns
.
solutionContent
.
flowList
=
flowList
;
}
else
{
ns
.
solutionContent
=
{};
ns
.
solutionContent
.
flowList
=
[
flowObj
];
}
ns
.
solutionContent
=
JSON
.
stringify
(
ns
.
solutionContent
);
await
this
.
needsolutionDao
.
update
(
ns
,
t
);
}
}
await
this
.
updateSolution
(
nsList
,
flowObj
,
2
,
t
);
})
return
system
.
getResultSuccess
();
}
}
async
updateSolution
(
nsList
,
flowObj
,
needStatus
,
t
)
{
var
intentionStatusList
=
[
"未知"
,
"⽅案待服务商确认"
,
"⽅案待⽤户确认"
,
"处理中"
,
"已完成"
,
"已关闭"
];
for
(
var
i
=
0
;
i
<
nsList
.
length
;
i
++
)
{
var
ns
=
nsList
[
i
];
if
(
ns
&&
ns
.
id
)
{
var
updateObj
=
{
id
:
ns
.
id
};
var
solutionContent
=
ns
.
solutionContent
||
{};
if
(
typeof
ns
.
solutionContent
===
'string'
)
{
ns
.
solutionContent
=
JSON
.
parse
(
ns
.
solutionContent
);
}
solutionContent
.
needStatus
=
needStatus
;
solutionContent
.
needStatusName
=
intentionStatusList
[
needStatus
];
if
(
needStatus
==
2
){
// updateObj["status"] = "ybh";
}
if
(
needStatus
==
5
){
updateObj
[
"status"
]
=
"yzf"
;
}
var
flowList
=
ns
.
solutionContent
.
flowList
||
[];
flowList
.
push
(
flowObj
);
ns
.
solutionContent
.
flowList
=
flowList
;
ns
.
solutionContent
=
JSON
.
stringify
(
ns
.
solutionContent
);
await
this
.
needsolutionDao
.
update
(
ns
,
t
);
}
}
}
/**
* 关闭注册⽅案
*/
...
...
@@ -367,16 +380,15 @@ class InternalCallsNotifyService {
var
flowObj
=
{
date
:
new
Date
(),
flowName
:
"关闭方案"
};
if
(
ns
.
solutionContent
){
if
(
typeof
ns
.
solutionContent
===
'string'
){
ns
.
solutionContent
=
JSON
.
parse
(
ns
.
solutionContent
)
}
var
flowList
=
ns
.
solutionContent
.
flowList
||
[];
flowList
.
push
(
flowObj
);
ns
.
solutionContent
.
flowList
=
flowList
;
}
else
{
ns
.
solutionContent
.
flowList
=
[
flowObj
];
}
ns
.
solutionContent
=
ns
.
solutionContent
||
{};
if
(
typeof
ns
.
solutionContent
===
'string'
){
ns
.
solutionContent
=
JSON
.
parse
(
ns
.
solutionContent
)
}
var
flowList
=
ns
.
solutionContent
.
flowList
||
[];
flowList
.
push
(
flowObj
);
ns
.
solutionContent
.
needStatus
=
5
;
ns
.
solutionContent
.
needStatusName
=
"已关闭"
;
ns
.
solutionContent
.
flowList
=
flowList
;
ns
.
solutionContent
=
JSON
.
stringify
(
ns
.
solutionContent
);
ns
.
status
=
"yzf"
;
await
this
.
needsolutionDao
.
update
(
ns
);
...
...
center-order/app/base/service/impl/dbcorder/orderinfoSve.js
View file @
f306cabf
...
...
@@ -2438,5 +2438,100 @@ class OrderInfoService extends ServiceBase {
}
return
system
.
getResult
(
updateRet
)
}
/**
* 接收阿里云商标订单信息
* @param {*} pobj
*/
async
receiveAliTmOrder
(
pobj
){
var
res
=
await
this
.
checkAndPackageAliTmOrderParams
(
pobj
);
if
(
!
res
||
res
.
status
!=
0
){
return
res
;
}
var
orderNo
=
await
self
.
getBusUid
(
"tm"
+
appInfo
.
uapp_id
);
var
ab
=
pobj
.
actionBody
;
ab
.
orderNo
=
orderNo
;
var
o
=
await
this
.
dao
.
create
(
ab
);
return
system
.
getResultSuccess
(
o
);
}
/**
* 检查封装阿里商标订单参数
* @param {*} pobj
*/
async
checkAndPackageAliTmOrderParams
(
pobj
){
if
(
!
pobj
||
!
pobj
.
actionBody
){
return
system
.
getResult
(
null
,
"订单参数不能为空,100100"
);
}
if
(
!
pobj
.
appInfo
){
return
system
.
getResult
(
null
,
"未知用应信息,100200"
);
}
if
(
!
pobj
.
userInfo
){
return
system
.
getResult
(
null
,
"未知用户信息,100300"
);
}
if
(
!
pobj
.
actionBody
.
channelOrderNo
){
return
system
.
getResult
(
null
,
"阿里订单号不能为空,100110"
);
}
if
(
!
pobj
.
actionBody
.
serviceOrderNo
){
return
system
.
getResult
(
null
,
"蜂擎订单号不能为空,100120"
);
}
if
(
!
pobj
.
actionBody
.
serviceNo
){
return
system
.
getResult
(
null
,
"服务单号不能为空,100130"
);
}
if
(
!
pobj
.
actionBody
.
needNo
){
return
system
.
getResult
(
null
,
"阿里需求号不能为空,100110"
);
}
var
orderInfo
=
await
this
.
dao
.
model
.
findOne
({
where
:{
channelOrderNo
:
pobj
.
actionBody
.
channelOrderNo
,
uapp_id
:
pobj
.
appInfo
.
uapp_id
},
raw
:
true
});
if
(
orderInfo
&&
orderInfo
.
id
){
return
system
.
getResult
(
null
,
"阿里订单号:"
+
pobj
.
actionBody
.
channelOrderNo
+
"的订单已存在,100140"
);
}
var
ab
=
pobj
.
actionBody
;
var
appInfo
=
pobj
.
appInfo
;
var
userInfo
=
pobj
.
userInfo
;
ab
.
uapp_id
=
appInfo
.
uapp_id
;
ab
.
channelNeedNo
=
ab
.
needNo
;
ab
.
channelUserId
=
userInfo
.
channel_userid
;
ab
.
ownerUserId
=
userInfo
.
channel_userid
;
ab
.
payTime
=
ab
.
payTime
||
new
Date
();
ab
.
orderStatus
=
2
;
ab
.
totalSum
=
ab
.
price
;
ab
.
payTotalSum
=
ab
.
price
;
return
system
.
getResultSuccess
();
}
/**
* 接收阿里商标订单退款信息
* @param {*} pobj
*/
async
receiveAliTmOrderRefund
(
pobj
){
if
(
!
pobj
||
!
pobj
.
actionBody
){
return
system
.
getResult
(
null
,
"订单参数不能为空,100100"
);
}
if
(
!
pobj
.
appInfo
){
return
system
.
getResult
(
null
,
"未知用应信息,100200"
);
}
if
(
!
pobj
.
userInfo
){
return
system
.
getResult
(
null
,
"未知用户信息,100300"
);
}
if
(
!
pobj
.
actionBody
.
channelOrderNo
){
return
system
.
getResult
(
null
,
"阿里订单号不能为空,100110"
);
}
var
orderInfo
=
await
this
.
dao
.
model
.
findOne
({
attributes
:[
"id"
,
"channelOrderNo"
,
"payTotalSum"
],
where
:{
channelOrderNo
:
pobj
.
actionBody
.
channelOrderNo
,
uapp_id
:
pobj
.
appInfo
.
uapp_id
},
raw
:
true
});
if
(
!
orderInfo
||
!
orderInfo
.
id
){
return
system
.
getResult
(
null
,
"阿里订单号:"
+
pobj
.
actionBody
.
channelOrderNo
+
"的订单不存在,100140"
);
}
orderInfo
.
refundSum
=
pobj
.
actionBody
.
refundSum
||
orderInfo
.
payTotalSum
;
orderInfo
.
orderStatus
=
16
;
orderInfo
.
refundTime
=
pobj
.
actionBody
.
refundTime
||
new
Date
();
await
this
.
dao
.
update
(
orderInfo
);
return
system
.
getResultSuccess
();
}
}
module
.
exports
=
OrderInfoService
;
center-order/app/base/service/impl/qcutils/aliyunqcSve.js
View file @
f306cabf
...
...
@@ -844,43 +844,69 @@ class AliyunQcService {
//接收tm用户方案反馈
async
tmFeedbackSubmit
(
pobj
)
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
intentionBizId
)
{
return
system
.
getResultFail
(
-
101
,
"渠道需求编号错误"
);
}
if
(
!
ab
.
description
)
{
return
system
.
getResultFail
(
-
102
,
"问题描述不能为空"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
intentionBizId
},
raw
:
true
});
if
(
!
needinfo
)
{
return
system
.
getResultFail
(
-
104
,
"未知方案需求"
);
}
if
(
needinfo
.
status
==
"ygb"
)
{
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
intentionBizId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
ns
)
{
return
system
.
getResultSuccess
();
try
{
var
ab
=
pobj
.
actionBody
;
if
(
!
ab
.
intentionBizId
)
{
return
system
.
getResultFail
(
-
101
,
"渠道需求编号错误"
);
}
if
(
!
ab
.
description
)
{
return
system
.
getResultFail
(
-
102
,
"问题描述不能为空"
);
}
//获取需求信息
var
needinfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
where
:
{
channelNeedNo
:
ab
.
intentionBizId
},
raw
:
true
});
if
(
!
needinfo
)
{
return
system
.
getResultFail
(
-
104
,
"未知方案需求"
);
}
if
(
needinfo
.
status
==
"ygb"
)
{
return
system
.
getResultFail
(
-
105
,
"该方案需求状态为"
+
needinfo
.
statusName
+
",不能执行此操作"
);
}
//获取方案信息
var
nsList
=
await
this
.
needsolutionDao
.
model
.
findAll
({
where
:
{
channelNeedNo
:
ab
.
intentionBizId
,
isInvalid
:
0
},
raw
:
true
});
if
(
!
nsList
||
nsList
.
length
<
1
)
{
return
system
.
getResultSuccess
();
}
await
this
.
needsolutionDao
.
db
.
transaction
(
async
function
(
t
)
{
var
flowObj
=
{
date
:
new
Date
(),
flowName
:
"用户驳回方案,反馈信息"
};
await
this
.
updateSolution
(
nsList
,
ab
,
flowObj
,
t
);
})
return
system
.
getResultSuccess
(
needinfo
);
}
catch
(
e
)
{
return
system
.
getResultFail
(
-
200
,
"error异常"
);
}
}
async
updateSolution
(
nsList
,
ab
,
flowObj
,
t
)
{
var
intentionStatusList
=
[
"未知"
,
"⽅案待服务商确认"
,
"⽅案待⽤户确认"
,
"处理中"
,
"已完成"
,
"已关闭"
];
var
updateObj
=
{
id
:
ns
.
id
};
var
solutionContent
=
ns
.
solutionContent
;
solutionContent
.
customerRemark
=
ab
.
description
;
solutionContent
.
needStatus
=
1
;
updateObj
[
"status"
]
=
"ybh"
;
solutionContent
.
needStatusName
=
intentionStatusList
[
ab
.
intentionStatus
];
solutionContent
=
JSON
.
stringify
(
solutionContent
);
updateObj
[
"solutionContent"
]
=
solutionContent
;
await
this
.
needsolutionDao
.
update
(
updateObj
);
//方案状态修改
return
system
.
getResultSuccess
(
needinfo
);
for
(
var
i
=
0
;
i
<
nsList
.
length
;
i
++
)
{
var
ns
=
nsList
[
i
];
var
updateObj
=
{
id
:
ns
.
id
};
var
solutionContent
=
ns
.
solutionContent
||
{};
if
(
typeof
solutionContent
===
'string'
)
{
solutionContent
=
JSON
.
parse
(
solutionContent
);
}
solutionContent
.
customerRemark
=
ab
.
description
;
solutionContent
.
needStatus
=
1
;
updateObj
[
"status"
]
=
"ybh"
;
solutionContent
.
needStatusName
=
intentionStatusList
[
1
];
var
flowList
=
solutionContent
.
flowList
||
[];
flowList
.
push
(
flowObj
);
solutionContent
.
flowList
=
flowList
;
solutionContent
=
JSON
.
stringify
(
solutionContent
);
updateObj
[
"solutionContent"
]
=
solutionContent
;
await
this
.
needsolutionDao
.
update
(
updateObj
,
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