Commit adb577cf by wkliang

queue push

parent 49a5e3c9
......@@ -7,6 +7,7 @@ class TrademarkcaseService extends ServiceBase {
this.restClient = system.getObject("util.restClient")
this.tkurl = settings.qftkurl()
this.qfurl = settings.qifuurl()
this.queueurl = settings.queueUrl()
}
async createOrUpdate (params) {
......@@ -34,7 +35,7 @@ class TrademarkcaseService extends ServiceBase {
}
if (params.usccode && params.applicant && params.applicant.applicantName) {
let sql = ""
if(dt.applicant) {
if (dt.applicant) {
sql = `UPDATE tmrejask_info SET applicant=json_set(applicant, '$.applicantName', "${params.applicant.applicantName}"), ${params.tradeType ? `tradeType=${params.tradeType}` : ""}, ${params.usccode ? `usccode="${params.usccode}"` : ""}, ${params.agentName ? `agentName="${params.agentName}"` : ""}, ${params.askforId ? `askforId="${params.askforId}"` : ""} WHERE id = ${params.id};`
} else {
sql = `UPDATE tmrejask_info SET applicant=json_object(applicant, '$.applicantName', "${params.applicant.applicantName}"), ${params.tradeType ? `tradeType=${params.tradeType}` : ""}, ${params.usccode ? `usccode="${params.usccode}"` : ""}, ${params.agentName ? `agentName="${params.agentName}"` : ""}, ${params.askforId ? `askforId="${params.askforId}"` : ""} WHERE id = ${params.id};`
......@@ -101,15 +102,24 @@ class TrademarkcaseService extends ServiceBase {
}
let tkurl = this.tkurl
let tokenData = await this.restClient.execPost(req, tkurl)
console.log(tokenData)
tokenData = JSON.parse(tokenData.stdout)
if (tokenData.status == 0) {
let token = tokenData.data.token
console.log(token)
let qfurl = this.qfurl
req.actionType = "receiveDeliveryData"
req.actionBody = reqdata
let res = await this.restClient.execPostWithToken(req, qfurl, token)
let queuereq = {
actionType: "produceData",
actionBody: {
pushUrl: this.qfurl,
actionType: req.actionType,
notifyUrl: "",
identifyCode: "tx-test01",
messageBody: req.actionBody,
headData: { token }
}
}
let res = await this.restClient.execPost(req, this.queueurl)
console.log(res)
return res
} else {
......
......@@ -13,7 +13,7 @@ class RejcbService extends ServiceBase {
if (this.isTest) {
queryData = await this.tcDao.model.findAll({
where: {
caseId: { [this.db.Op.like]: `%TESTCB%` },
caseId: { [this.db.Op.like]: `%TESTAGENTCB%` },
tradeStatus: "商标局处理中",
caStatus: "待提报"
}
......
......@@ -34,7 +34,7 @@ var settings = {
},
qftkurl: function () {
if (this.env == 'dev') {
return 'http://gsbweb.qifu-dev.gongsibao.com:4012/web/auth/accessAuth/getAppTokenByHosts'
return 'http://gsbweb.qifu-dev.gongsibao.com/web/auth/accessAuth/getAppTokenByHosts'
} else {
return 'http://gsbweb.qifu.gongsibao.com/web/auth/accessAuth/getAppTokenByHosts'
}
......@@ -48,7 +48,7 @@ var settings = {
},
queueUrl: function () {
if (this.env == "dev") {
return "http://192.168.1.128:4018/api/queueAction/producer/springBoard";
return "http://gsbweb.qifu-dev.gongsibao.com/api/queueAction/producer/springBoard";
} else {
return "http://sytxpublic-msgq-service/api/queueAction/producer/springBoard";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment