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
f03a67e7
Commit
f03a67e7
authored
Apr 19, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
5868d6e3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
507 additions
and
90 deletions
+507
-90
center-channel/app/base/api/impl/auth/taskapi.js
+6
-0
center-channel/app/base/api/impl/opaction/opOrder.js
+2
-2
center-channel/app/base/service/app.base.js
+45
-0
center-channel/app/base/service/impl/utilsSve/utilsOpOrderSve.js
+6
-12
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+1
-1
center-channel/app/base/service/impl/utilsSve/utilsTmAliyunSve.js
+441
-71
center-channel/app/config/settings.js
+1
-1
center-channel/提示编码使用
+5
-3
No files found.
center-channel/app/base/api/impl/auth/taskapi.js
View file @
f03a67e7
...
...
@@ -8,6 +8,7 @@ class AccessAuthAPI extends APIBase {
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
this
.
pushlogSve
=
system
.
getObject
(
"service.common.pushlogSve"
);
this
.
aliclient
=
system
.
getObject
(
"util.aliyunClient"
);
this
.
utilsTmAliyunSve
=
system
.
getObject
(
"service.utilsSve.utilsTmAliyunSve"
);
}
async
taskAliIcapi
()
{
var
rtn
=
await
this
.
gatewaypushlogSve
.
taskAliIcapi
();
...
...
@@ -28,6 +29,11 @@ class AccessAuthAPI extends APIBase {
var
rtn
=
await
this
.
aliclient
.
reqbyget
(
pobj
)
return
rtn
;
}
async
taskAliTmUpdate
(
pobj
,
qobj
,
req
)
{
//操作阿里商标更新
var
rtn
=
await
this
.
utilsTmAliyunSve
.
taskAliTmUpdate
()
return
rtn
;
}
// async taskAgainPushNewBusInfo(pobj, qobj, req) {//再次推送新rpc业务数据
// var rtn = await this.utilsPushSve.againPushBusInfo(pobj);
// return rtn;
...
...
center-channel/app/base/api/impl/opaction/opOrder.js
View file @
f03a67e7
...
...
@@ -29,7 +29,7 @@ class ProductAPI extends WEBBase {
var
opResult
=
null
;
switch
(
action_type
)
{
case
"opAliDingInterfaceManage"
:
//操作阿里钉钉接口管理---actionBody:{为阿里需要的参数}
var
pushInterfaceResult
=
await
this
.
utilsOpOrderSve
.
get
ProductInterface
(
pobj
.
appInfo
,
pobj
.
product_id
);
var
pushInterfaceResult
=
await
this
.
utilsOpOrderSve
.
get
OpInterfaceByProductId
(
pobj
.
appInfo
,
pobj
.
product_id
);
if
(
pushInterfaceResult
.
status
!=
0
)
{
return
pushInterfaceResult
;
}
...
...
@@ -41,7 +41,7 @@ class ProductAPI extends WEBBase {
opResult
=
await
this
.
utilsTmAliyunSve
.
opAliDingInterfaceManage
(
pobj
);
break
;
// case "checkTmNameByAli"://检测商标名称是否合规
// var pushInterfaceResult = await this.utilsOpOrderSve.get
ProductInterface
(pobj, pobj.actionBody.product_id);
// var pushInterfaceResult = await this.utilsOpOrderSve.get
OpInterfaceByProductId
(pobj, pobj.actionBody.product_id);
// if (pushInterfaceResult.status != 0) {
// pobj.actionBody.product_info.interface_info = pushInterfaceResult.data;
// this.utilsPushSve.pushBusInfo(pobj, "closeAliTmApply", 1);
...
...
center-channel/app/base/service/app.base.js
View file @
f03a67e7
...
...
@@ -243,6 +243,51 @@ class AppServiceBase {
return
system
.
getResult
(
-
200
,
"java ali oss upload error"
);
}
}
async
opDownFileInfo
(
docUrl
,
result
)
{
//从oss下载到本地并上传到自己oss,之后删除本地文件
/*docUrl下载链接,全路径,如:https://XXXXXX.pdf?XXXXX */
try
{
var
tmpFileName
=
docUrl
.
substring
(
0
,
docUrl
.
lastIndexOf
(
"?"
));
var
fileName
=
tmpFileName
.
substr
(
tmpFileName
.
lastIndexOf
(
"/"
)
+
1
,
tmpFileName
.
lenght
);
var
fileType
=
tmpFileName
.
substr
(
tmpFileName
.
lastIndexOf
(
"."
)
+
1
,
tmpFileName
.
lenght
);
//解码后的文件全名:xxx.pdf
var
fileAllName
=
decodeURIComponent
(
fileName
);
//为xxx.pdf
var
saveFilePath
=
'/tmp/'
+
fileAllName
;
// 下载文件到指定的路径
var
tmpp
=
await
this
.
restClient
.
execDownload
(
"'"
+
docUrl
+
"'"
,
saveFilePath
);
//上传 saveFilePath的文件 到ossClient
var
uuid
=
uuidv4
();
var
u
=
uuid
.
replace
(
/
\-
/g
,
""
);
var
upFileName
=
"alifile_"
+
u
+
"."
+
fileType
;
var
rtn
=
await
this
.
ossClient
.
upfile
(
upFileName
,
saveFilePath
);
result
.
data
=
rtn
;
//删除本地文件
fs
.
unlink
(
saveFilePath
,
function
(
err
)
{
});
}
catch
(
e
)
{
result
.
code
=
-
200
;
result
.
message
=
"通过flowId获取到的文件url下载操作异常异常error"
;
console
.
log
(
e
.
stack
);
//日志记录
logCtl
.
error
({
optitle
:
"e签宝通过flowId获取到的文件url下载操作异常异常error"
,
op
:
"base/service/impl/utilesignbaoSve/opDownFileInfo"
,
content
:
"请求参数:docUrl="
+
docUrl
+
",异常信息error:"
+
e
.
stack
,
clientIp
:
""
});
}
return
result
;
}
async
getOpInterfaceByProductId
(
appInfo
,
product_id
)
{
//获取产品调用接口
var
getProductInterfaceUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
getProductInterfaceObj
=
{
"actionType"
:
"getProductInterface"
,
"appInfo"
:
appInfo
,
"actionBody"
:
{
"product_id"
:
product_id
}
};
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
getProductInterfaceObj
,
getProductInterfaceUrl
);
return
productItemInterfaceResult
;
}
/*
返回20位业务订单号
prefix:业务前缀
...
...
center-channel/app/base/service/impl/utilsSve/utilsOpOrderSve.js
View file @
f03a67e7
...
...
@@ -9,16 +9,7 @@ class UtilsOpOrderService extends AppServiceBase {
this
.
centerOrderUrl
=
settings
.
centerOrderUrl
();
this
.
utilsPushSve
=
system
.
getObject
(
"service.utilsSve.utilsPushSve"
);
}
async
getProductInterface
(
appInfo
,
product_id
)
{
//获取产品调用接口
var
getProductInterfaceUrl
=
settings
.
centerAppUrl
()
+
"action/opProduct/springBoard"
;
var
getProductInterfaceObj
=
{
"actionType"
:
"getProductInterface"
,
"appInfo"
:
appInfo
,
"actionBody"
:
{
"product_id"
:
product_id
}
};
var
productItemInterfaceResult
=
await
this
.
restPostUrl
(
getProductInterfaceObj
,
getProductInterfaceUrl
);
return
productItemInterfaceResult
;
}
async
updateContacts
(
pobj
,
actionBody
)
{
//修改联系人
if
(
!
actionBody
.
orderNo
)
{
return
system
.
getResult
(
null
,
"actionBody.orderNo can not be empty,100310"
);
...
...
@@ -47,7 +38,10 @@ class UtilsOpOrderService extends AppServiceBase {
}
if
(
result
.
data
.
orderStatus
==
2
)
{
this
.
opUpdatePushInfo
(
result
,
pobj
,
"pushUpdateOrder"
);
this
.
opUpdatePushInfo
(
result
,
pobj
,
"updateAliTmApplicant"
);
if
(
pobj
.
actionBody
.
apply
)
{
pobj
.
actionBody
.
apply
.
gzwtsUrl
=
result
.
data
.
gzwtsUrl
;
this
.
opUpdatePushInfo
(
result
,
pobj
,
"updateAliTmApplicant"
);
}
//ali 只做申请人信息修改
}
//状态为付款的订单进行推送
result
.
data
=
null
;
return
result
;
...
...
@@ -114,7 +108,7 @@ class UtilsOpOrderService extends AppServiceBase {
tmpPobj
.
actionBody
.
product_info
=
productItemResult
.
data
;
tmpPobj
.
actionBody
.
product_id
=
tmpPobj
.
actionBody
.
product_info
.
id
;
//获取推送接口并推送
var
pushInterfaceResult
=
await
this
.
get
ProductInterface
(
pobj
.
appInfo
,
tmpPobj
.
actionBody
.
product_id
);
var
pushInterfaceResult
=
await
this
.
get
OpInterfaceByProductId
(
pobj
.
appInfo
,
tmpPobj
.
actionBody
.
product_id
);
if
(
pushINterfaceResult
.
status
==
0
)
{
tmpPobj
.
actionBody
.
product_info
.
interface_info
=
pushInterfaceResult
.
data
;
this
.
utilsPushSve
.
pushBusInfo
(
tmpPobj
,
"pushOpSolution"
,
1
);
...
...
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
f03a67e7
...
...
@@ -489,7 +489,7 @@ class UtilsOrderService extends AppServiceBase {
// productId: outTradeInfo.length == 3 ? outTradeInfo[2] : 0
// }
// opResult.data = {
// orderNo: "TM362020041
50927UPmE
",
// orderNo: "TM362020041
91028Sgir
",
// uappId: 36,
// productId: 42
// };
...
...
center-channel/app/base/service/impl/utilsSve/utilsTmAliyunSve.js
View file @
f03a67e7
...
...
@@ -17,52 +17,74 @@ class UtilsTmAliyunService extends AppServiceBase {
var
tmInfo
=
pobj
.
actionBody
.
delivery_content
.
tm
;
if
(
!
orderInfo
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo data is empty,100450"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
Number
(
orderInfo
.
orderStatus
)
!=
2
)
{
verifyResult
=
system
.
getResult
(
null
,
"orderInfo status is error,100453"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
!
apply
)
{
verifyResult
=
system
.
getResult
(
null
,
"apply data is empty,100455"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
apply
.
customerType
!=
"ent"
&&
!
apply
.
identityCardPic
)
{
verifyResult
=
system
.
getResult
(
null
,
"identityCardPic can not be empty,100456"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
apply
.
customerType
==
"ent"
&&
!
apply
.
businessLicensePic
)
{
verifyResult
=
system
.
getResult
(
null
,
"businessLicensePic can not be empty,100457"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
!
apply
.
gzwtsUrl
)
{
verifyResult
=
system
.
getResult
(
null
,
"gzwtsUrl can not be empty,100458"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
var
rpcParam
=
verifyResult
.
data
;
if
(
!
tmInfo
)
{
return
system
.
getResult
(
null
,
"tmInfo data is empty,100460"
);
verifyResult
=
system
.
getResult
(
null
,
"tmInfo data is empty,100460"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
!
tmInfo
.
picUrl
)
{
verifyResult
=
system
.
getResult
(
null
,
"tm picUrl data is empty,100461"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
var
rpcParam
=
verifyResult
.
data
;
var
idCardOssKey
=
""
;
var
businessLicenceOssKey
=
""
;
var
legalNoticeOssKey
=
""
;
var
picUrl
=
""
;
var
authorizationOssKey
=
""
;
if
(
apply
.
customerType
!=
"ent"
&&
apply
.
identityCardPic
)
{
idCardOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
CARD
,
apply
.
identityCardPic
,
rpcParam
);
if
(
!
idCardOssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"identityCardPic ali oss upload is error,100462"
);
}
}
if
(
apply
.
customerType
==
"ent"
&&
apply
.
businessLicensePic
)
{
businessLicenceOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
BUSINESS_LICENSE
,
apply
.
businessLicensePic
,
rpcParam
);
if
(
!
businessLicenceOssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"businessLicensePic ali oss upload is error,100464"
);
}
}
if
(
verifyResult
.
status
==
0
)
{
if
(
apply
.
smwjUrl
)
{
legalNoticeOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
LEGAL_NOTICE
,
apply
.
smwjUrl
,
rpcParam
);
if
(
!
legalNotice
OssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"
smwjUrl ali oss upload is error,100466
"
);
if
(
apply
.
customerType
!=
"ent"
&&
apply
.
identityCardPic
)
{
idCardOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
CARD
,
apply
.
identityCardPic
,
rpcParam
);
if
(
!
idCard
OssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"
identityCardPic ali oss upload is error,100462
"
);
}
}
if
(
tmInfo
.
picUrl
)
{
picUrl
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
ICON
,
tmInfo
.
picUrl
,
rpcParam
);
if
(
!
picUrl
)
{
verifyResult
=
system
.
getResult
(
null
,
"
picUrl ali oss upload is error,100467
"
);
if
(
apply
.
customerType
==
"ent"
&&
apply
.
businessLicensePic
)
{
businessLicenceOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
BUSINESS_LICENSE
,
apply
.
businessLicensePic
,
rpcParam
);
if
(
!
businessLicenceOssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"
businessLicensePic ali oss upload is error,100464
"
);
}
}
if
(
apply
.
gzwtsUrl
)
{
authorizationOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
ATTORNEY
,
apply
.
gzwtsUrl
,
rpcParam
);
if
(
!
authorizationOssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"gzwtsUrl ali oss upload is error,100468"
);
if
(
verifyResult
.
status
==
0
)
{
if
(
apply
.
smwjUrl
)
{
legalNoticeOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
LEGAL_NOTICE
,
apply
.
smwjUrl
,
rpcParam
);
if
(
!
legalNoticeOssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"smwjUrl ali oss upload is error,100466"
);
}
}
if
(
tmInfo
.
picUrl
)
{
picUrl
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
ICON
,
tmInfo
.
picUrl
,
rpcParam
);
if
(
!
picUrl
)
{
verifyResult
=
system
.
getResult
(
null
,
"picUrl ali oss upload is error,100467"
);
}
}
if
(
apply
.
gzwtsUrl
)
{
authorizationOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
ATTORNEY
,
apply
.
gzwtsUrl
,
rpcParam
);
if
(
!
authorizationOssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"gzwtsUrl ali oss upload is error,100468"
);
}
}
}
}
...
...
@@ -99,10 +121,22 @@ class UtilsTmAliyunService extends AppServiceBase {
}
var
applicantResult
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
if
(
applicantResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
applicantResult
,
"ali->tmCreateApplicant->applicantResult"
);
applicantResult
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
if
(
applicantResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
applicantResult
,
"ali->tmCreateApplicant->applicantResult"
);
}
}
actionBody
.
ApplicantId
=
applicantResult
.
data
.
ApplicantId
;
actionBody
.
product_id
=
pobj
.
actionBody
.
product_info
.
id
;
var
addActionBody
=
{
appInfo
:
{
uapp_id
:
pobj
.
appInfo
.
uapp_id
,
uapp_key
:
pobj
.
appInfo
.
uapp_key
},
apply
:
actionBody
,
tm
:
[]
//商标信息
}
var
classificationsResult
=
system
.
getResultSuccess
();
var
tmCreateResult
=
system
.
getResultSuccess
();
var
addtmCreate
=
0
;
var
self
=
this
;
for
(
let
i
=
0
;
i
<
pobj
.
actionBody
.
delivery_content
.
nclones
.
length
;
i
++
)
{
const
nclonesItem
=
pobj
.
actionBody
.
delivery_content
.
nclones
[
i
];
...
...
@@ -110,7 +144,9 @@ class UtilsTmAliyunService extends AppServiceBase {
if
(
classificationsResult
.
status
!=
0
)
{
classificationsResult
=
await
self
.
getClassifications
(
pobj
,
nclonesItem
,
rpcParam
);
if
(
classificationsResult
.
status
!=
0
)
{
classificationsResult
=
system
.
getResult
(
null
,
"获取阿里尼斯数据为空,100469"
);
classificationsResult
.
msg
=
"获取阿里尼斯数据为空,100469->"
+
classificationsResult
.
msg
;
pobj
.
dbNclonesItem
=
nclonesItem
;
self
.
disposePushResultFail
(
pobj
,
classificationsResult
,
"ali->tmCreateApplicant->classificationsResult"
,
3
);
break
;
}
//第二次调用失败则尼斯调用失败
}
...
...
@@ -118,40 +154,69 @@ class UtilsTmAliyunService extends AppServiceBase {
if
(
tmCreateResult
.
status
!=
0
)
{
tmCreateResult
=
await
self
.
tmCreate
(
pobj
,
tmInfo
,
rpcParam
,
picUrl
,
authorizationOssKey
,
classificationsResult
.
data
,
applicantResult
.
data
.
ApplicantId
);
if
(
tmCreateResult
.
status
!=
0
)
{
tmCreateResult
.
msg
=
"创建阿里商标数据为空,10471->"
+
tmCreateResult
.
msg
;
pobj
.
dbTmInfo
=
tmInfo
;
self
.
disposePushResultFail
(
pobj
,
tmCreateResult
,
"ali->tmCreateApplicant->classificationsResult"
,
3
);
break
;
}
//第二次调用失败则创建商标失败
}
//保存渠道申请人数据
actionBody
.
ApplicantId
=
applicantResult
.
data
.
ApplicantId
;
actionBody
.
AuthorizationOssKey
=
authorizationOssKey
;
//保存渠道申请人及商标数据
addtmCreate
++
;
tmCreateResult
.
data
.
tmInfo
.
Classifications
=
classificationsResult
.
data
;
self
.
addAliChannelTmApplicant
(
pobj
,
actionBody
,
tmCreateResult
.
data
.
OrderId
,
tmCreateResult
.
data
.
tmInfo
);
}
if
(
classificationsResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
classificationsResult
,
"ali->tmCreateApplicant->classificationsResult"
);
tmCreateResult
.
data
.
tmInfo
.
tbCode
=
nclonesItem
.
tbCode
;
tmCreateResult
.
data
.
tmInfo
.
AuthorizationOssKey
=
authorizationOssKey
;
tmCreateResult
.
data
.
tmInfo
.
OrderId
=
tmCreateResult
.
data
.
OrderId
.
tostring
();
addActionBody
.
tm
.
push
(
tmCreateResult
.
data
.
tmInfo
);
}
if
(
addtmCreate
==
pobj
.
actionBody
.
delivery_content
.
nclones
.
length
)
{
self
.
addAliChannelTmApplicant
(
pobj
,
addActionBody
);
return
await
self
.
disposePushResult
(
pobj
,
tmCreateResult
,
"ali->tmCreateApplicant->tmCreateResult"
);
}
//更新数据库渠道商标
else
{
tmCreateResult
=
system
.
getResult
(
null
,
"创建ali商标申请人信息出错,10472"
);
return
await
self
.
disposePushResultFail
(
pobj
,
tmCreateResult
,
"ali->tmCreateApplicant->tmCreateResult"
);
}
return
await
this
.
disposePushResult
(
pobj
,
tmCreateResult
,
"ali->tmCreateApplicant->tmCreateResult"
);
}
async
updateAliTmApplicant
(
pobj
)
{
//更新商标申请人信息
var
verifyResult
=
await
this
.
opAliyunRpcVerifyParam
(
pobj
);
var
apply
=
pobj
.
actionBody
.
apply
;
if
(
!
apply
)
{
verifyResult
=
system
.
getResult
(
null
,
"apply data is empty,100510"
);
}
var
dbApplyResult
=
await
this
.
getAliChannelTmDelivery
(
pobj
);
if
(
dbApplyResult
.
status
!=
0
)
{
verifyResult
=
dbApplyResult
;
if
(
dbApplyResult
.
status
==
-
130
)
{
var
getAddParamResult
=
await
this
.
getOrderProductDeliveryByOrderNo
(
pobj
);
if
(
getAddParamResult
.
status
==
0
)
{
getAddParamResult
.
data
.
actionBody
.
orderNo
=
pobj
.
actionBody
.
orderNo
;
getAddParamResult
.
data
.
appInfo
=
pobj
.
appInfo
;
getAddParamResult
.
data
.
interface_params
=
pobj
.
interface_params
;
return
await
this
.
tmCreateApplicant
(
getAddParamResult
.
data
);
}
}
//为空则进行创建提交到阿里
verifyResult
=
dbApplyResult
+
",100540"
;
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
!
apply
.
gzwtsUrl
)
{
verifyResult
=
system
.
getResult
(
null
,
"gzwtsUrl can not be empty,100541"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
var
dbApply
=
dbApplyResult
.
data
.
apply
;
var
dbTm
=
dbApplyResult
.
data
.
tm
;
if
(
!
dbApply
)
{
verifyResult
=
system
.
getResult
(
null
,
"tmInfo data is empty,100542"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
!
dbTm
)
{
verifyResult
=
system
.
getResult
(
null
,
"dbTm data is empty,100543"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
verifyResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->updateAliTmApplicant->verifyResult"
);
}
var
rpcParam
=
verifyResult
.
data
;
var
dbApply
=
dbApplyResult
.
data
.
apply
;
var
idCardOssKey
=
""
;
var
businessLicenceOssKey
=
""
;
var
legalNoticeOssKey
=
""
;
var
authorizationOssKey
=
""
;
//授权委托书
var
authorizationOssKey
=
""
;
if
(
verifyResult
.
status
==
0
)
{
if
(
apply
.
customerType
!=
"ent"
&&
apply
.
identityCardPic
)
{
idCardOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
CARD
,
apply
.
identityCardPic
,
rpcParam
);
...
...
@@ -171,16 +236,9 @@ class UtilsTmAliyunService extends AppServiceBase {
dbApply
.
LegalNoticeOssKey
=
legalNoticeOssKey
;
}
}
if
(
apply
.
gzwtsUrl
)
{
authorizationOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
ATTORNEY
,
apply
.
gzwtsUrl
,
rpcParam
);
if
(
authorizationOssKey
&&
authorizationOssKey
!=
dbApply
.
AuthorizationOssKey
)
{
dbApply
.
AuthorizationOssKey
=
authorizationOssKey
;
//绑定商标申请人信息(绑定授权书Oss文件)
var
bindAliTmApplicantGzwtsUrlResult
=
await
this
.
bindAliTmApplicantGzwtsUrl
(
pobj
,
rpcParam
,
dbApply
.
ApplicantId
,
authorizationOssKey
);
if
(
bindAliTmApplicantGzwtsUrlResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
bindAliTmApplicantGzwtsUrlResult
,
"ali->bindAliTmApplicantGzwtsUrl->bindAliTmApplicantGzwtsUrlResult"
);
}
}
authorizationOssKey
=
await
this
.
getAliOssFileUrl
(
"trade-mark-user-upload"
,
pobj
,
this
.
aliOssFileType
.
ATTORNEY
,
apply
.
gzwtsUrl
,
rpcParam
);
if
(
!
authorizationOssKey
)
{
authorizationOssKey
=
dbApply
.
AuthorizationOssKey
;
}
}
if
(
apply
.
zipCode
&&
apply
.
zipCode
!=
dbApply
.
ContactZipcode
)
{
...
...
@@ -201,13 +259,87 @@ class UtilsTmAliyunService extends AppServiceBase {
// ContactName: orderContact.contactName || "",//String 否 张三 联系人姓名
// ContactNumber: orderContact.mobile || "",//String 否 18611112222 联系人电话
// ContactEmail: orderContact.email || "",//String 否 test@alibaba.com 联系人邮箱
if
(
apply
.
customerType
!=
"ent"
&&
!
dbApply
.
IdCardOssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"identityCardPic can not be empty,100544"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
apply
.
customerType
==
"ent"
&&
!
dbApply
.
BusinessLicenceOssKey
)
{
verifyResult
=
system
.
getResult
(
null
,
"businessLicensePic can not be empty,100545"
);
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->tmCreateApplicant->verifyResult"
,
3
);
}
if
(
dbApply
.
ApplicantId
)
{
delete
dbApply
[
"ApplicantId"
];
}
var
params
=
{
action
:
rpcParam
.
action
,
reqbody
:
dbApply
,
rpcParam
:
rpcParam
}
var
result
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
return
await
this
.
disposePushResult
(
pobj
,
result
,
"ali->updateAliTmApplicant->result"
);
var
applicantResult
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
if
(
applicantResult
.
status
!=
0
)
{
applicantResult
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
if
(
applicantResult
.
status
!=
0
)
{
applicantResult
.
msg
=
"创建阿里商标申请人出错,100546->"
+
applicantResult
.
msg
;
return
await
this
.
disposePushResultFail
(
pobj
,
applicantResult
,
"ali->updateAliTmApplicant->CreateApplicant->applicantResult"
);
}
}
//绑定商标的oss委托书信息
dbApply
.
ApplicantId
=
applicantResult
.
data
.
ApplicantId
;
dbApplyResult
.
data
.
apply
=
dbApply
;
//授权委托书
var
self
=
this
;
var
updateTm
=
0
;
var
opUpdateTmResult
=
system
.
getResultSuccess
();
for
(
let
j
=
0
;
j
<
dbApplyResult
.
data
.
tm
.
length
;
j
++
)
{
var
tmItem
=
dbApplyResult
.
data
.
tm
[
j
];
if
(
tmItem
)
{
var
bizId
=
""
if
(
!
tmItem
.
BizId
)
{
var
getDingTmStatusResult
=
await
self
.
getAliTmInfo
(
pobj
,
tmItem
.
OrderId
,
rpcParam
);
if
(
getDingTmStatusResult
.
status
!=
0
)
{
pobj
.
dbTm
=
tmItem
;
getDingTmStatusResult
.
msg
=
"查询阿里商标状态出错,100547->"
+
getDingTmStatusResult
.
msg
;
self
.
disposePushResultFail
(
pobj
,
getDingTmStatusResult
,
"ali->updateAliTmApplicant->getDingTmStatusResult"
,
3
);
break
;
}
if
(
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
ApplicationStatus
!=
2
)
{
getDingTmStatusResult
.
status
=
-
1
;
getDingTmStatusResult
=
"更新商标申请人信息失败,阿里商标状态不是阿里云审核不通过,不能进行修改,100558->"
+
getDingTmStatusResult
.
msg
;
self
.
disposePushResultFail
(
pobj
,
getDingTmStatusResult
,
"ali->updateAliTmApplicant->getDingTmStatusResult"
,
3
);
continue
;
}
bizId
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
BizId
;
dbApplyResult
.
data
.
tm
[
j
].
BizId
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
BizId
;
dbApplyResult
.
data
.
tm
[
j
].
ApplicationStatus
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
ApplicationStatus
;
dbApplyResult
.
data
.
tm
[
j
].
Note
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
Note
;
dbApplyResult
.
data
.
tm
[
j
].
TotalPrice
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
TotalPrice
;
}
//处理ali 商标状态查询
else
{
bizId
=
tmItem
.
BizId
;
}
//绑定商标申请人信息(绑定授权书Oss文件)
dbApplyResult
.
data
.
tm
[
j
].
AuthorizationOssKey
=
authorizationOssKey
;
var
bindAliTmApplicantGzwtsUrlResult
=
await
this
.
bindAliTmApplicantGzwtsUrl
(
pobj
,
rpcParam
,
dbApply
.
ApplicantId
,
bizId
,
authorizationOssKey
);
if
(
bindAliTmApplicantGzwtsUrlResult
.
status
!=
0
)
{
pobj
.
dbTm
=
tmItem
;
bindAliTmApplicantGzwtsUrlResult
.
msg
=
"绑定授权书Oss文件出错,100559->"
+
bindAliTmApplicantGzwtsUrlResult
.
msg
;
self
.
disposePushResultFail
(
pobj
,
bindAliTmApplicantGzwtsUrlResult
,
"ali->updateAliTmApplicant->bindAliTmApplicantGzwtsUrlResult"
,
3
);
break
;
}
updateTm
++
;
}
}
if
(
updateTm
==
dbTm
.
length
)
{
self
.
updateAliChannelTmApplicant
(
pobj
,
dbApplyResult
.
data
);
return
self
.
disposePushResult
(
pobj
,
opUpdateTmResult
,
"ali->updateAliTmApplicant->opUpdateTmResult"
);
}
//更新数据库渠道商标
else
{
opUpdateTmResult
=
system
.
getResult
(
null
,
"更新ali商标申请人信息出错,100548"
);
return
self
.
disposePushResultFail
(
pobj
,
opUpdateTmResult
,
"ali->updateAliTmApplicant->opUpdateTmResult"
);
}
}
...
...
@@ -249,24 +381,30 @@ class UtilsTmAliyunService extends AppServiceBase {
return
tmCreateReslut
;
// return system.getResultSuccess({ "orderId": "204426185080629" });
}
async
bindAliTmApplicantGzwtsUrl
(
pobj
,
rpcParam
,
applicantId
,
authorizationOssKey
)
{
//绑定商标申请人信息-(绑定授权书Oss文件)---内部使用
async
bindAliTmApplicantGzwtsUrl
(
pobj
,
rpcParam
,
applicantId
,
bizId
,
authorizationOssKey
)
{
//绑定商标申请人信息-(绑定授权书Oss文件)---内部使用
if
(
!
authorizationOssKey
)
{
return
system
.
getResult
(
null
,
"gzwtsUrl param is empty,100503"
);
}
var
params
=
{
action
:
"BindApplicant"
,
reqbody
:
{
ApplicantId
:
applicantId
,
AuthorizationOssKey
:
authorizationOssKey
,
BizId
:
"trademark_register-cn-4591lzry16c"
},
reqbody
:
{
ApplicantId
:
applicantId
,
AuthorizationOssKey
:
authorizationOssKey
,
BizId
:
bizId
},
rpcParam
:
rpcParam
}
//
TODO:
BizId-----报 BizId is mandatory for this action--BizId是此操作的强制命令
//BizId-----报 BizId is mandatory for this action--BizId是此操作的强制命令
var
result
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
if
(
result
.
status
!=
0
)
{
result
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
}
return
result
;
}
async
getAliOssFileUrl
(
bucketName
,
pobj
,
fileType
,
selfFileUrl
,
rpcParam
)
{
var
fileUrl
=
""
;
var
resultInfo
=
await
this
.
getAliOssInfo
(
pobj
,
fileType
,
rpcParam
);
if
(
resultInfo
.
status
!=
0
)
{
return
fileUrl
;
resultInfo
=
await
this
.
getAliOssInfo
(
pobj
,
fileType
,
rpcParam
);
if
(
resultInfo
.
status
!=
0
)
{
return
fileUrl
;
}
}
let
lastHostLength
=
resultInfo
.
data
.
Host
.
lastIndexOf
(
'/'
);
let
lastFileLength
=
selfFileUrl
.
lastIndexOf
(
'/'
);
...
...
@@ -299,7 +437,6 @@ class UtilsTmAliyunService extends AppServiceBase {
var
self
=
this
;
var
aliNclThreesList
=
{};
var
aliNclTwosList
=
[];
// for (let i = 0; i < nclones.length; i++) {
const
nclOneItem
=
nclones
;
var
nclThreeList
=
nclOneItem
.
nclThree
;
var
getAliThreeList
=
[];
...
...
@@ -335,10 +472,7 @@ class UtilsTmAliyunService extends AppServiceBase {
return
system
.
getResult
(
null
,
"获取阿里尼斯数据失败,100530"
);
}
aliNclThreesList
[
nclOneItem
.
code
]
=
getAliThreeList
.
join
(
','
);
// aliNclThreesList["\"" + nclOneItem.code + "\""] = "\"" + getAliThreeList.join(',') + "\"";
// }
return
system
.
getResultSuccess
(
aliNclThreesList
)
// return aliNclThreesList;
}
async
getAliNclInfo
(
pobj
,
parentCode
,
rpcParam
)
{
var
params
=
{
...
...
@@ -353,13 +487,39 @@ class UtilsTmAliyunService extends AppServiceBase {
return
system
.
getResultSuccess
(
nclInfoResult
.
data
.
Classifications
.
Classification
);
}
async
getAliTmInfo
(
pobj
,
orderId
,
rpcParam
)
{
//通过阿里订单号获取阿里商标申请信息--内部调用
var
tmStatusParams
=
{
action
:
"ListTrademarkApplications"
,
reqbody
:
{
OrderId
:
orderId
},
rpcParam
:
rpcParam
}
var
getDingTmStatusResult
=
await
this
.
opAliyunRpcReq
(
pobj
,
tmStatusParams
);
if
(
getDingTmStatusResult
.
status
!=
0
)
{
getDingTmStatusResult
=
await
this
.
opAliyunRpcReq
(
pobj
,
tmStatusParams
);
}
return
getDingTmStatusResult
;
}
//-------------------------操作渠道商标信息
async
addAliChannelTmApplicant
(
pobj
,
a
pplyInfo
,
channelOrderNo
,
tmInfo
)
{
//新增ali渠道商标交付信息
async
addAliChannelTmApplicant
(
pobj
,
a
ctionBody
)
{
//新增ali渠道商标交付信息
var
tmpPobj
=
{
actionType
:
"addAliChannelTmApplicant"
,
appInfo
:
pobj
.
appInfo
,
actionBody
:
{
deliveryData
:
{
apply
:
applyInfo
,
tm
:
tmInfo
},
orderNo
:
pobj
.
actionBody
.
orderNo
,
channelOrderNo
:
channelOrderNo
}
actionBody
:
{
deliveryData
:
actionBody
,
orderNo
:
pobj
.
actionBody
.
orderNo
}
}
var
reqUrl
=
settings
.
centerOrderUrl
()
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
tmpPobj
,
reqUrl
);
if
(
result
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
tmpPobj
,
result
,
"ali->tmCreateApplicant->addChannelTmApplicantResult->新增ali渠道商标交付信息失败"
,
3
);
}
return
result
;
}
async
updateAliChannelTmApplicant
(
pobj
,
actionBody
)
{
//新增ali渠道商标交付信息
var
tmpPobj
=
{
actionType
:
"updateAliChannelTm"
,
appInfo
:
pobj
.
appInfo
,
actionBody
:
{
deliveryData
:
actionBody
,
orderNo
:
pobj
.
actionBody
.
orderNo
}
}
var
reqUrl
=
settings
.
centerOrderUrl
()
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
tmpPobj
,
reqUrl
);
...
...
@@ -378,16 +538,31 @@ class UtilsTmAliyunService extends AppServiceBase {
var
result
=
await
this
.
restPostUrl
(
tmpPobj
,
reqUrl
);
return
result
;
}
async
updateAliChannelTm
(
pobj
)
{
//修改ali渠道商标信息
async
getAllAliChannelTmDelivery
(
pobj
)
{
//查询ali渠道商标交付信息-内部方法
var
tmpPobj
=
{
actionType
:
"getAllAliChannelTmDelivery"
,
appInfo
:
{},
actionBody
:
{}
}
var
reqUrl
=
settings
.
centerOrderUrl
()
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
tmpPobj
,
reqUrl
);
return
result
;
}
async
getOrderProductDeliveryByOrderNo
(
pobj
)
{
//获取订单产品及交付信息--用于钉钉商标推送
var
tmpPobj
=
{
actionType
:
"getOrderProductDeliveryByOrderNo"
,
appInfo
:
pobj
.
appInfo
,
actionBody
:
{
orderNo
:
pobj
.
actionBody
.
orderNo
}
}
var
reqUrl
=
settings
.
centerOrderUrl
()
+
"opaction/opOrder/springBoard"
;
var
result
=
await
this
.
restPostUrl
(
tmpPobj
,
reqUrl
);
return
result
;
}
//--------------------------------------------------内部辅助方法-------------------end-----------------
//--------------------------------------------------供外部调用方法-----------------start---------------
async
opAliDingInterfaceManage
(
pobj
,
rpcParam
)
{
//操作阿里钉钉接口管理---外部调用
async
opAliDingInterfaceManage
(
pobj
)
{
//操作阿里钉钉接口管理---外部调用
var
verifyResult
=
await
this
.
opAliyunRpcVerifyParam
(
pobj
);
if
(
verifyResult
.
status
!=
0
)
{
return
await
this
.
disposePushResultFail
(
pobj
,
verifyResult
,
"ali->opAliDingInterfaceManage->verifyResult"
,
3
);
...
...
@@ -399,9 +574,204 @@ class UtilsTmAliyunService extends AppServiceBase {
rpcParam
:
rpcParam
}
var
result
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
if
(
result
.
status
!=
0
)
{
result
=
await
this
.
opAliyunRpcReq
(
pobj
,
params
);
}
return
result
;
}
async
taskAliTmUpdate
()
{
//操作阿里商标更新任务---外部调用
var
pobj
=
{
actionBody
:
{}
};
var
dbAliAllTmListResult
=
await
this
.
getAllAliChannelTmDelivery
(
pobj
);
if
(
dbAliAllTmListResult
.
status
!=
0
)
{
dbAliAllTmListResult
.
msg
=
"操作阿里商标更新任务,查询的数据为空,100550->"
+
dbAliAllTmListResult
.
msg
;
return
await
this
.
disposePushResultFail
(
pobj
,
dbAliAllTmListResult
,
"ali->opAliTmUpdateTask->dbAliAllTmListResult"
,
3
);
}
var
opResult
=
system
.
getResultSuccess
();
var
rpcParam
=
null
;
var
self
=
this
;
for
(
let
index
=
0
;
index
<
dbAliAllTmListResult
.
data
.
length
;
index
++
)
{
const
element
=
dbAliAllTmListResult
.
data
[
index
];
if
(
element
)
{
if
(
opResult
.
status
!=
0
)
{
break
;
}
pobj
.
actionBody
.
orderNo
=
element
.
sourceOrderNo
;
if
(
!
rpcParam
)
{
pobj
.
appInfo
=
element
.
deliveryContent
.
appInfo
;
var
pushInterfaceResult
=
await
self
.
getOpInterfaceByProductId
(
element
.
deliveryContent
.
appInfo
,
element
.
deliveryContent
.
product_id
);
if
(
pushInterfaceResult
.
status
!=
0
)
{
pushInterfaceResult
.
msg
=
"操作阿里商标更新任务,查询的产品接口数据为空,100553->"
+
pushInterfaceResult
.
msg
;
opResult
=
pushInterfaceResult
;
self
.
disposePushResultFail
(
pobj
,
pushInterfaceResult
,
"ali->opAliTmUpdateTask->pushInterfaceResult"
,
3
);
break
;
}
var
interface_list_temp
=
pushInterfaceResult
.
data
.
filter
(
f
=>
f
.
op_type
==
"createAliTmApply"
);
if
(
!
interface_list_temp
||
interface_list_temp
.
length
==
0
)
{
opResult
=
system
.
getResult
(
null
,
"暂无【createAliTmApply】的推送配置,100555"
);
self
.
disposePushResultFail
(
pobj
,
opResult
,
"ali->opAliTmUpdateTask->interface_list_temp"
,
3
);
break
;
}
rpcParam
=
JSON
.
parse
(
interface_list_temp
[
0
].
params
);
}
var
tmUpdate
=
0
;
for
(
let
i
=
0
;
i
<
element
.
deliveryContent
.
tm
.
length
;
i
++
)
{
const
tmItem
=
element
.
deliveryContent
.
tm
[
i
];
if
(
tmItem
)
{
var
getDingTmStatusResult
=
await
self
.
getAliTmInfo
(
pobj
,
tmItem
.
OrderId
,
rpcParam
);
if
(
getDingTmStatusResult
.
status
!=
0
||
getDingTmStatusResult
.
data
.
TotalCount
==
0
)
{
getDingTmStatusResult
.
msg
=
"操作阿里商标更新任务,查询的阿里商标数据错误,100557->"
+
getDingTmStatusResult
.
msg
;
opResult
=
getDingTmStatusResult
;
self
.
disposePushResultFail
(
pobj
,
getDingTmStatusResult
,
"ali->opAliTmUpdateTask->getDingTmStatusResult"
,
3
);
break
;
}
if
(
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
Note
)
{
var
opNoteInfo
=
JSON
.
parse
(
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
Note
);
if
(
opNoteInfo
.
txt
)
{
var
txtList
=
opNoteInfo
.
txt
.
split
(
'
\
n'
);
var
txtStr
=
""
;
for
(
let
l
=
0
;
l
<
txtList
.
length
;
l
++
)
{
const
temptxtStr
=
txtList
[
l
];
if
(
temptxtStr
)
{
txtStr
=
txtStr
+
temptxtStr
;
}
}
element
.
deliveryContent
.
tm
[
i
].
Note
=
txtStr
;
}
}
element
.
deliveryContent
.
tm
[
i
].
BizId
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
BizId
;
element
.
deliveryContent
.
tm
[
i
].
ApplicationStatus
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
ApplicationStatus
;
element
.
deliveryContent
.
tm
[
i
].
TotalPrice
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
TotalPrice
;
if
(
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
SupplementStatus
)
{
element
.
deliveryContent
.
tm
[
i
].
SupplementStatus
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
SupplementStatus
;
if
(
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
SupplementId
)
{
element
.
deliveryContent
.
tm
[
i
].
SupplementId
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
SupplementId
;
}
}
tmUpdate
++
;
//异步操作启服通商标状态更新
self
.
opSelfTmStatusUpdate
(
pobj
,
getDingTmStatusResult
,
element
.
deliveryContent
.
tm
[
i
].
Note
,
tmItem
.
tbCode
,
element
.
sourceOrderNo
);
}
}
if
(
tmUpdate
>
0
)
{
self
.
updateAliChannelTmApplicant
(
pobj
,
element
.
deliveryContent
);
}
}
}
return
opResult
;
}
async
opSelfTmStatusUpdate
(
pobj
,
getDingTmStatusResult
,
opNotes
,
tbCode
,
orderNo
)
{
//异步操作启服通商标状态更新
var
aliStatusResult
=
await
this
.
aliStatusInfo
(
getDingTmStatusResult
);
if
(
aliStatusResult
.
status
!=
0
)
{
aliStatusResult
.
msg
=
"异步操作启服通商标状态更新->阿里状态码表匹配失败->"
+
aliStatusResult
.
msg
;
this
.
disposePushResultFail
(
pobj
,
aliStatusResult
,
"ali->opSelfTmStatusUpdate->aliStatusResult"
,
3
);
return
aliStatusResult
;
}
var
actionBody
=
{
orderNo
:
orderNo
,
tbCode
:
tbCode
,
tmStatus
:
aliStatusResult
.
data
}
if
(
opNotes
)
{
actionBody
.
opNotes
=
opNotes
;
}
var
reqUrl
=
settings
.
centerOrderUrl
()
+
"notifyaction/internalCallsNotify/updateTmStatus"
;
var
opResult
=
await
this
.
execPostUrl
(
actionBody
,
reqUrl
);
if
(
opResult
.
status
!=
0
)
{
opResult
.
msg
=
"异步操作启服通商标状态更新失败->"
+
opResult
.
msg
;
this
.
disposePushResultFail
(
pobj
,
opResult
,
"ali->opSelfTmStatusUpdate->opResult"
,
3
);
}
return
opResult
;
}
async
aliStatusInfo
(
getDingTmStatusResult
)
{
// "1": "商标注册申请书", "2": "商标注册申请补正通知书", "3": "商标注册申请受理通知书", "4": "商标注册申请不予受理通知书", "5": "商标注册同日申请补送使用证据通知书",
// "6": "商标注册同日申请协商通知书商标注册同日申请抽签通知书", "7": "商标驳回通知书", "8": "商标部分驳回通知书", "9": "商标注册申请初步审定公告通知书",
// "10": "商标异议答辩通知书", "11": "异议裁定书", "12": "纸质版商标注册证", "13": "电子版商标注册证",
// "16": "已失败退款", "200": "已补正", "201": "超时未补正", "202": "补正已递交到商标局",
// "dsccl": "待上传材料", "dqrfa": "待确认方案", "fabtg": "方案不通过", "dsh": "待审核", "shbtg": "审核不通过", "ddj": "待递交", "ydj": "已递交", "djyc": "递交异常"
var
self
=
this
;
var
aliStatus
=
system
.
getResult
(
null
,
"阿里状态码表对照有误!"
);
var
supplementStatus
=
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
SupplementStatus
;
if
(
supplementStatus
&&
supplementStatus
>
2
)
{
switch
(
pobj
.
supplementStatus
)
{
case
2
:
//需要补正,fileUrl为商标局补正文件
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"2"
;
break
;
case
4
:
//已补正
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"200"
;
break
;
case
5
:
//超时未补正
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"201"
;
break
;
case
6
:
//补正已递交到商标局
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"202"
;
break
;
default
:
break
;
}
}
else
{
switch
(
getDingTmStatusResult
.
data
.
TrademarkApplications
.
TrademarkApplication
[
0
].
ApplicationStatus
)
{
case
1
:
//待阿里审核(已支付)
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"dsh"
;
break
;
case
2
:
//阿里云审不通过
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"shbtg"
;
break
;
case
3
:
//阿里审核通过
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"ddj"
;
break
;
case
4
:
//已失败退款(阿里)
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"16"
;
break
;
case
20
:
//-已提交到商标局
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"ydj"
;
break
;
case
21
:
//商标局已接受(⽂件:商标局回执)
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"1"
;
break
;
case
22
:
//商标局不予受理 (⽂件:不予受理通知书)
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"4"
;
break
;
case
23
:
//商标局受理通过(⽂件:受理通知书)
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"3"
;
break
;
case
29
:
//-商标局部分驳回 (⽂件:部分驳回通知书)
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"8"
;
break
;
case
30
:
//商标局驳回 (⽂件:驳回通知书)
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"7"
;
break
;
case
31
:
//商标局审核通过 (⽂件:审核通过通知书)----初步审定公告
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"9"
;
break
;
case
99
:
//申请成功结束 (⽂件:商标证通知书)---已下发商标注册证
aliStatus
.
status
=
0
;
aliStatus
.
data
=
"13"
;
break
;
default
:
break
;
}
}
return
aliStatus
;
}
//--------------------------------------------------供外部调用方法-----------------end---------------
...
...
center-channel/app/config/settings.js
View file @
f03a67e7
...
...
@@ -22,7 +22,7 @@ var settings = {
port
:
process
.
env
.
NODE_PORT
||
4012
,
aliossjavaUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://192.168.
0.104
:8080/uploadfile"
;
return
"http://192.168.
2.109
:8080/uploadfile"
;
}
else
{
return
"http://aliossjava-service/uploadfile"
;
}
...
...
center-channel/提示编码使用
View file @
f03a67e7
已经使用的
编码汇总:
已经使用的
编码汇总:
...
...
@@ -51,4 +51,6 @@
100500
100510
100520
100530
\ No newline at end of file
100530
100540
100550
\ 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