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
d62d6a85
Commit
d62d6a85
authored
Mar 22, 2021
by
任晓松
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/center-order' into center-order
parents
16e43bc7
d83d6579
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
247 additions
and
0 deletions
+247
-0
center-order/app/base/api/impl/notifyaction/opNeedSolution.js
+33
-0
center-order/app/base/service/impl/dbcorder/internalCallsNotifySve.js
+214
-0
No files found.
center-order/app/base/api/impl/notifyaction/opNeedSolution.js
0 → 100644
View file @
d62d6a85
var
APIBase
=
require
(
"../../api.base"
);
var
system
=
require
(
"../../../system"
);
var
settings
=
require
(
"../../../../config/settings"
);
/**
* 接收商标方案信息
*/
class
OpNeedSolution
extends
APIBase
{
//内部通知调用
constructor
()
{
super
();
this
.
internalCallsNotifySve
=
system
.
getObject
(
"service.dbcorder.internalCallsNotifySve"
);
}
//接收辅助、担保商标注册方案信息
async
nbtzreceiveAssistTmData
(
pobj
,
qobj
,
req
)
{
return
await
this
.
internalCallsNotifySve
.
receiveAssistTmSolutionData
(
pobj
);
}
//接收辅助、担保商标注册修改方案信息
async
nbtzreceiveEditAssistTmData
(
pobj
,
qobj
,
req
)
{
return
await
this
.
internalCallsNotifySve
.
receiveEditAssistTmSolutionData
(
pobj
);
}
//提交方案确认
async
submitTmConfirm
(
pobj
,
qobj
,
req
)
{
return
await
this
.
internalCallsNotifySve
.
submitTmConfirm
(
pobj
);
}
/**
* 关闭注册⽅案
*/
async
closeSolution
(
pobj
,
obj
,
req
){
return
await
this
.
internalCallsNotifySve
.
closeSolution
(
pobj
);
}
}
module
.
exports
=
OpNeedSolution
;
\ No newline at end of file
center-order/app/base/service/impl/dbcorder/internalCallsNotifySve.js
View file @
d62d6a85
const
system
=
require
(
"../../../system"
);
const
system
=
require
(
"../../../system"
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
uuidv4
=
require
(
'uuid/v4'
);
const
moment
=
require
(
'moment'
);
//内部通知调用
//内部通知调用
class
InternalCallsNotifyService
{
class
InternalCallsNotifyService
{
constructor
()
{
constructor
()
{
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
this
.
needinfoDao
=
system
.
getObject
(
"db.dbneed.needinfoDao"
);
this
.
needsolutionDao
=
system
.
getObject
(
"db.dbneed.needsolutionDao"
);
this
.
delivery_status
=
{
this
.
delivery_status
=
{
"dqrfa"
:
"待确认方案"
,
"dqrfa"
:
"待确认方案"
,
"fabtg"
:
"方案不通过"
,
"fabtg"
:
"方案不通过"
,
...
@@ -170,5 +173,215 @@ class InternalCallsNotifyService {
...
@@ -170,5 +173,215 @@ class InternalCallsNotifyService {
return
await
this
.
orderinfoDao
.
customQuery
(
sql
);
return
await
this
.
orderinfoDao
.
customQuery
(
sql
);
}
}
//----------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------
async
checkParams2
(
pobj
)
{
//参数校验
if
(
!
pobj
.
proxyCode
)
{
return
system
.
getResult
(
null
,
"proxyCode不能为空"
);
}
if
(
!
pobj
.
IntentionBizId
)
{
return
system
.
getResult
(
null
,
"渠道需求号不能为空"
);
}
pobj
.
IntentionBizId
=
"20201217132620000001"
;
var
needInfo
=
await
this
.
needinfoDao
.
model
.
findOne
({
attributes
:[
"id"
,
"needNo"
,
"channelNeedNo"
,
"uapp_id"
],
where
:{
channelNeedNo
:
pobj
.
IntentionBizId
,
channelTypeCode
:
2
},
raw
:
true
});
if
(
!
needInfo
||
!
needInfo
.
needNo
){
return
system
.
getResult
(
null
,
"未知需求信息,10280"
);
}
pobj
.
needInfo
=
needInfo
;
return
system
.
getResultSuccess
(
pobj
);
}
//接收辅助、担保商标注册信息
async
receiveAssistTmSolutionData
(
pobj
)
{
var
checkRes
=
await
this
.
checkParams2
(
pobj
);
if
(
checkRes
.
status
==
0
)
{
var
needInfo
=
pobj
.
needInfo
;
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:{
needNo
:
needInfo
.
needNo
,
channelNeedNo
:
needInfo
.
channelNeedNo
,
solutionNo
:
pobj
.
proxyCode
,
isInvalid
:
0
}
});
if
(
ns
)
{
return
system
.
getResult
(
null
,
"保存商标方案信息失败,存在重复方案信息,不能重复提交,10300"
);
}
//方案流程
var
flowList
=
[{
date
:
new
Date
(),
flowName
:
"提交方案"
}];
pobj
.
flowList
=
flowList
;
var
nsObj
=
{
needNo
:
needInfo
.
needNo
,
channelNeedNo
:
needInfo
.
channelNeedNo
,
solutionNo
:
pobj
.
proxyCode
,
orderNo
:
pobj
.
serviceNo
,
solutionContent
:
JSON
.
stringify
(
pobj
)
}
var
needSolution
=
await
this
.
needsolutionDao
.
create
(
nsObj
);
return
system
.
getResultSuccess
(
needSolution
);
}
else
{
return
checkRes
;
}
}
//接收辅助、担保商标注册修改信息
async
receiveEditAssistTmSolutionData
(
pobj
)
{
if
(
!
pobj
.
BizId
)
{
return
system
.
getResult
(
null
,
"BizId不能为空"
);
}
var
checkRes
=
await
this
.
checkParams2
(
pobj
);
if
(
checkRes
.
status
==
0
)
{
var
needInfo
=
pobj
.
needInfo
;
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:{
channelNeedNo
:
needInfo
.
channelNeedNo
,
channelSolutionNo
:
pobj
.
BizId
}
});
if
(
!
ns
)
{
return
system
.
getResult
(
null
,
"渠道方案号:"
+
pobj
.
BizId
+
"的方案不存在,10300"
);
}
else
{
var
flowObj
=
{
date
:
new
Date
(),
flowName
:
"方案修改"
};
var
oldSolutionContent
=
ns
.
solutionContent
;
if
(
oldSolutionContent
){
if
(
typeof
oldSolutionContent
===
'string'
){
oldSolutionContent
=
JSON
.
parse
(
oldSolutionContent
)
}
var
flowList
=
oldSolutionContent
.
flowList
||
[];
flowList
.
push
(
flowObj
);
pobj
.
flowList
=
flowList
;
}
else
{
pobj
.
flowList
=
[
flowObj
];
}
var
nsUpdateObj
=
{
id
:
ns
.
id
,
solutionNo
:
pobj
.
proxyCode
,
solutionContent
:
JSON
.
stringify
(
pobj
)
}
await
this
.
needsolutionDao
.
update
(
nsUpdateObj
);
var
needSolution
=
await
this
.
needsolutionDao
.
model
.
findOne
({
where
:{
channelNeedNo
:
needInfo
.
channelNeedNo
,
channelSolutionNo
:
pobj
.
BizId
}
});
return
system
.
getResultSuccess
(
needSolution
);
}
}
else
{
return
checkRes
;
}
}
/*
返回20位业务订单号
prefix:业务前缀
*/
async
getBusUid
(
prefix
)
{
prefix
=
(
prefix
||
""
);
if
(
prefix
)
{
prefix
=
prefix
.
toUpperCase
();
}
var
prefixlength
=
prefix
.
length
;
var
subLen
=
8
-
prefixlength
;
var
uidStr
=
""
;
if
(
subLen
>
0
)
{
uidStr
=
await
this
.
getUidInfo
(
subLen
,
60
);
}
var
timStr
=
moment
().
format
(
"YYYYMMDDHHmm"
);
return
prefix
+
timStr
+
uidStr
;
}
/*
len:返回长度
radix:参与计算的长度,最大为62
*/
async
getUidInfo
(
len
,
radix
)
{
var
chars
=
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
.
split
(
''
);
//长度62,到yz长度为长36
var
uuid
=
[],
i
;
radix
=
radix
||
chars
.
length
;
if
(
len
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
uuid
[
i
]
=
chars
[
0
|
Math
.
random
()
*
radix
];
}
else
{
var
r
;
uuid
[
8
]
=
uuid
[
13
]
=
uuid
[
18
]
=
uuid
[
23
]
=
'-'
;
uuid
[
14
]
=
'4'
;
for
(
i
=
0
;
i
<
36
;
i
++
)
{
if
(
!
uuid
[
i
])
{
r
=
0
|
Math
.
random
()
*
16
;
uuid
[
i
]
=
chars
[(
i
==
19
)
?
(
r
&
0x3
)
|
0x8
:
r
];
}
}
}
return
uuid
.
join
(
''
);
}
//提交方案确认
async
submitTmConfirm
(
pobj
)
{
if
(
!
pobj
.
IntentionBizId
)
{
return
self
.
getResultFail
(
"IntentionBizId不能为空"
);
}
//获取方案信息
var
nsList
=
await
this
.
needsolutionDao
.
model
.
findAll
({
attributes
:[
"id"
,
"status"
,
"solutionContent"
],
where
:{
channelNeedNo
:
pobj
.
IntentionBizId
}
});
if
(
!
nsList
||
nsList
.
length
<
1
)
{
return
system
.
getResult
(
null
,
"渠道需求号:"
+
pobj
.
IntentionBizId
+
"的方案不存在,10300"
);
}
else
{
var
flowObj
=
{
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
);
}
}
})
return
system
.
getResultSuccess
();
}
}
/**
* 关闭注册⽅案
*/
async
closeSolution
(
pobj
){
if
(
!
pobj
.
BizId
)
{
return
system
.
getResult
(
null
,
"BizId不能为空"
);
}
if
(
!
pobj
.
IntentionBizId
)
{
return
self
.
getResultFail
(
"IntentionBizId不能为空"
);
}
//获取方案信息
var
ns
=
await
this
.
needsolutionDao
.
model
.
findOne
({
attributes
:[
"id"
,
"status"
,
"solutionContent"
],
where
:{
channelNeedNo
:
pobj
.
IntentionBizId
,
channelSolutionNo
:
pobj
.
BizId
}
});
if
(
!
ns
)
{
return
system
.
getResult
(
null
,
"渠道方案号:"
+
pobj
.
BizId
+
"的方案不存在,10300"
);
}
else
{
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
=
JSON
.
stringify
(
ns
.
solutionContent
);
ns
.
status
=
"yzf"
;
await
this
.
needsolutionDao
.
update
(
ns
);
return
system
.
getResultSuccess
();
}
}
}
}
module
.
exports
=
InternalCallsNotifyService
;
module
.
exports
=
InternalCallsNotifyService
;
\ No newline at end of file
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