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
d22e2245
Commit
d22e2245
authored
Mar 31, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'center-order' of gitlab.gongsibao.com:jiangyong/zhichan into center-order
parents
d71d5c5a
f758d9b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
163 additions
and
0 deletions
+163
-0
center-order/app/base/api/impl/notifyaction/internalCallsNotify.js
+10
-0
center-order/app/base/service/impl/dbcorder/internalCallsNotifySve.js
+153
-0
No files found.
center-order/app/base/api/impl/notifyaction/internalCallsNotify.js
View file @
d22e2245
...
@@ -6,9 +6,18 @@ class InternalCallsNotify extends APIBase {
...
@@ -6,9 +6,18 @@ class InternalCallsNotify extends APIBase {
constructor
()
{
constructor
()
{
super
();
super
();
this
.
orderinfoSve
=
system
.
getObject
(
"service.dbcorder.orderinfoSve"
);
this
.
orderinfoSve
=
system
.
getObject
(
"service.dbcorder.orderinfoSve"
);
this
.
internalCallsNotifySve
=
system
.
getObject
(
"service.dbcorder.internalCallsNotifySve"
);
}
}
async
updateTmStatus
(
pobj
,
qobj
,
req
)
{
async
updateTmStatus
(
pobj
,
qobj
,
req
)
{
return
await
this
.
orderinfoSve
.
updateTmStatus
(
pobj
);
return
await
this
.
orderinfoSve
.
updateTmStatus
(
pobj
);
}
}
//接收辅助、担保商标注册信息
async
nbtzreceiveAssistTmData
(
pobj
,
qobj
,
req
)
{
return
await
this
.
internalCallsNotifySve
.
receiveAssistTmData
(
pobj
);
}
//接收辅助、担保商标注册修改信息
async
nbtzreceiveEditAssistTmData
(
pobj
,
qobj
,
req
)
{
return
await
this
.
internalCallsNotifySve
.
receiveEditAssistTmData
(
pobj
);
}
}
}
module
.
exports
=
InternalCallsNotify
;
module
.
exports
=
InternalCallsNotify
;
\ No newline at end of file
center-order/app/base/service/impl/dbcorder/internalCallsNotifySve.js
0 → 100644
View file @
d22e2245
const
system
=
require
(
"../../../system"
);
const
uuidv4
=
require
(
'uuid/v4'
);
//内部通知调用
class
InternalCallsNotifyService
{
constructor
()
{
this
.
orderinfoDao
=
system
.
getObject
(
"db.dbcorder.orderinfoDao"
);
}
//接收辅助、担保商标注册信息
async
receiveAssistTmData
(
pobj
){
var
checkRes
=
await
this
.
checkParams
(
pobj
);
if
(
checkRes
.
status
==
0
){
var
deliveryData
=
await
this
.
packagingTmDeliveryData
(
pobj
);
//获取交付信息
var
orderdeliveryRes
=
await
this
.
getOrderDelivery
(
pobj
.
sourceOrderNo
,
pobj
.
serviceNo
);
if
(
orderdeliveryRes
&&
orderdeliveryRes
.
length
>
0
){
return
system
.
getResult
(
null
,
"保存商标订单交付信息失败,存在重复交付信息,不能重复提交,10300"
);
}
await
this
.
addOrderDelivery
(
deliveryData
,
deliveryData
.
sourceOrderNo
);
return
system
.
getResultSuccess
();
}
else
{
return
checkRes
;
}
}
//接收辅助、担保商标注册修改信息
async
receiveEditAssistTmData
(
pobj
){
var
checkRes
=
await
this
.
checkParams
(
pobj
);
if
(
checkRes
.
status
==
0
){
//获取交付信息
var
orderdeliveryRes
=
await
this
.
getOrderDelivery
(
pobj
.
sourceOrderNo
,
pobj
.
serviceNo
);
if
(
!
orderdeliveryRes
||
orderdeliveryRes
.
length
<
1
){
return
system
.
getResult
(
null
,
"未知交付信息,10150"
);
}
var
deliveryData
=
await
this
.
packagingTmDeliveryData
(
pobj
);
this
.
putOrderDelivery
(
deliveryData
,
deliveryData
.
sourceOrderNo
,
deliveryData
.
serviceNo
);
return
system
.
getResultSuccess
();
}
else
{
return
checkRes
;
}
}
//-----------------------------------------------------------------------------------------------------
async
checkParams
(
pobj
){
//参数校验
if
(
!
pobj
.
serviceNo
)
{
return
system
.
getResult
(
null
,
"业务单号不能为空不能为空,10100"
);
}
if
(
!
pobj
.
sourceOrderNo
)
{
return
system
.
getResult
(
null
,
"来源单号不能为空,10110"
);
}
var
orderinfo
=
await
this
.
orderinfoDao
.
model
.
findOne
({
where
:{
orderNo
:
pobj
.
sourceOrderNo
},
raw
:
true
});
if
(
!
orderinfo
||
!
orderinfo
.
id
){
return
system
.
getResult
(
null
,
"未知订单,10120"
);
}
if
(
!
pobj
.
tm
)
{
return
system
.
getResult
(
null
,
"商标信息不能为空,10130"
);
}
if
(
!
pobj
.
nclones
)
{
return
system
.
getResult
(
null
,
"商品/服务项不能为空,10140"
);
}
if
(
!
pobj
.
tm
)
{
return
system
.
getResult
(
null
,
"商标信息不能为空,10150"
);
}
if
(
!
pobj
.
tm
.
tmFormType
)
{
return
system
.
getResult
(
null
,
"商标类型不能为空,10160"
);
}
if
(
pobj
.
tm
.
tmFormType
==
"4"
)
{
pobj
.
tm
.
tmName
=
"图形"
;
}
if
(
!
pobj
.
tm
.
tmName
)
{
return
system
.
getResult
(
null
,
"商标名称不能为空,10170"
);
}
if
(
!
pobj
.
tm
.
picUrl
)
{
return
system
.
getResult
(
null
,
"商标图样不能为空,10180"
);
}
if
(
!
pobj
.
apply
)
{
return
system
.
getResult
(
null
,
"申请信息不能为空,10190"
);
}
if
(
!
pobj
.
apply
.
code
)
{
return
system
.
getResult
(
null
,
"申请统一社会信用代码不能为空,10200"
);
}
if
(
!
pobj
.
apply
.
zipCode
)
{
return
system
.
getResult
(
null
,
"申请邮编不能为空,10210"
);
}
if
(
!
pobj
.
apply
.
customerType
)
{
return
system
.
getResult
(
null
,
"申请人类型不能为空,10220"
);
}
if
(
pobj
.
apply
.
customerType
!=
"ent"
&&
pobj
.
apply
.
customerType
!=
"person"
)
{
return
system
.
getResult
(
null
,
"申请人类型错误,10230"
);
}
if
(
!
pobj
.
orderContact
)
{
return
system
.
getResult
(
null
,
"联系人信息不能为空,10240"
);
}
if
(
!
pobj
.
orderContact
.
contactName
)
{
return
system
.
getResult
(
null
,
"联系人姓名不能为空,10250"
);
}
if
(
!
pobj
.
orderContact
.
mobile
)
{
return
system
.
getResult
(
null
,
"联系人手机号不能为空,10260"
);
}
return
system
.
getResultSuccess
(
pobj
);
}
async
packagingTmDeliveryData
(
pobj
)
{
//重新组装商标交付信息
var
deliveryStatus
=
"dsccl"
;
var
deliveryStatusName
=
"待上传材料"
;
var
deliveryStatusList
=
[{
deliveryStatus
:
"dsccl"
,
deliveryStatusName
:
"待上传材料"
,
deliveryUpdated
:
new
Date
()
}];
if
(
pobj
.
apply
.
customerType
==
"ent"
)
{
if
(
pobj
.
apply
.
businessLicensePdf
&&
pobj
.
apply
.
gzwtsUrl
)
{
deliveryStatus
=
"dsh"
;
deliveryStatusName
=
"待审核"
;
deliveryStatusList
.
push
({
deliveryStatus
:
deliveryStatus
,
deliveryStatusName
:
deliveryStatusName
,
deliveryUpdated
:
new
Date
()
});
}
}
else
{
if
(
pobj
.
apply
.
businessLicensePdf
&&
pobj
.
apply
.
gzwtsUrl
&&
pobj
.
apply
.
identityCardPdf
)
{
deliveryStatus
=
"dsh"
;
deliveryStatusName
=
"待审核"
;
deliveryStatusList
.
push
({
deliveryStatus
:
deliveryStatus
,
deliveryStatusName
:
deliveryStatusName
,
deliveryUpdated
:
new
Date
()
});
}
}
pobj
.
deliveryStatus
=
deliveryStatus
;
pobj
.
deliveryStatusName
=
deliveryStatusName
;
pobj
.
deliveryStatusList
=
deliveryStatusList
;
pobj
.
opNotes
=
""
;
//操作备注
return
pobj
;
}
putOrderDelivery
(
data
,
orderNo
,
channelOrderNo
)
{
//修改交付信息
var
sql
=
"UPDATE `c_order_delivery` SET deliveryContent ='"
+
JSON
.
stringify
(
data
)
+
"' where sourceOrderNo='"
+
orderNo
+
"'"
;
sql
=
sql
+
" and deliveryContent->'$.serviceNo' = '"
+
channelOrderNo
+
"'"
;
this
.
orderinfoDao
.
customUpdate
(
sql
);
}
addOrderDelivery
(
data
,
orderNo
)
{
//新增交付信息
var
sql
=
"INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('"
+
orderNo
+
"','"
+
JSON
.
stringify
(
data
)
+
"')"
;
this
.
orderinfoDao
.
customQuery
(
sql
);
}
async
getOrderDelivery
(
orderNo
,
channelOrderNo
)
{
//查询交付信息
var
sql
=
"select * from `c_order_delivery` where sourceOrderNo='"
+
orderNo
+
"'"
;
sql
=
sql
+
" and deliveryContent->'$.serviceNo' = '"
+
channelOrderNo
+
"'"
;
return
await
this
.
orderinfoDao
.
customQuery
(
sql
);
}
}
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