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
b9624167
Commit
b9624167
authored
Mar 22, 2021
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
baidutm
parent
dc428cc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
140 additions
and
0 deletions
+140
-0
center-order/app/base/api/impl/notifyaction/opNeedSolution.js
+23
-0
center-order/app/base/service/impl/dbcorder/internalCallsNotifySve.js
+117
-0
No files found.
center-order/app/base/api/impl/notifyaction/opNeedSolution.js
0 → 100644
View file @
b9624167
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
);
}
}
module
.
exports
=
OpNeedSolution
;
\ No newline at end of file
center-order/app/base/service/impl/dbcorder/internalCallsNotifySve.js
View file @
b9624167
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,118 @@ class InternalCallsNotifyService {
...
@@ -170,5 +173,118 @@ 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
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
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
(
''
);
}
}
}
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