Commit 98607d04 by 庄冰

channel

parent d3561766
...@@ -54,8 +54,11 @@ class ReceiveDataAPI extends APIBase { ...@@ -54,8 +54,11 @@ class ReceiveDataAPI extends APIBase {
case "test"://测试 case "test"://测试
opResult = system.getResultSuccess(null, "测试成功"); opResult = system.getResultSuccess(null, "测试成功");
break; break;
case "receiveTmData"://接收商标状态信息 case "receiveTmOfficialData"://接收回执文件
opResult = await this.trademarkSve.receiveTmData(action_body); opResult = await this.trademarkSve.receiveTmOfficialData(action_body);
break;
case "updateAssistTmStatus"://接收商标状态信息
opResult = await this.trademarkSve.updateAssistTmStatus(action_body);
break; break;
case "assistRegTmData"://接收辅助注册商标数据 case "assistRegTmData"://接收辅助注册商标数据
opResult = await this.ordertmproductSve.addAssistTm(action_body); opResult = await this.ordertmproductSve.addAssistTm(action_body);
......
...@@ -7,6 +7,34 @@ class TradeMarkService extends ServiceBase { ...@@ -7,6 +7,34 @@ class TradeMarkService extends ServiceBase {
super("dbtrademark", ServiceBase.getDaoName(TradeMarkService)); super("dbtrademark", ServiceBase.getDaoName(TradeMarkService));
this.ordertmproductSve = system.getObject("service.dborder.ordertmproductSve"); this.ordertmproductSve = system.getObject("service.dborder.ordertmproductSve");
this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao"); this.tmofficialDao = system.getObject("db.dbtrademark.tmofficialDao");
this.statusConvertJSON={
"WAITARTIFICIALEXAMINE": "dsh",
"1": "1",
"2": "2",
"3": "3",
"4": "4",
"5": "5",
"6": "6",
"7": "7",
"8": "8",
"9": "9",
"10": "10",
"11": "11",
"12": "12",
"13": "13",
"READY": "dsccl",
"DOCFINISH": "dsh",
"AWAITCHECK": "dsh",
"WAITCOMMIT": "ddj",
"COMMITED": "ydj",
"ROBOT": "ydj",
"ROBOTPAY": "ydj",
"RECVCOMMIT": "ydj",
"FILLEXCEPTION": "shbtg",
//1688
"WAITCONFIRM":"dqrfa",
"CONFIRMFAIL":"dqrfa"
}
} }
/** /**
...@@ -167,7 +195,7 @@ class TradeMarkService extends ServiceBase { ...@@ -167,7 +195,7 @@ class TradeMarkService extends ServiceBase {
}) })
} }
/** /**
* 接收商标状态数据 * 接收商标回执数据
* @param {*} obj * @param {*} obj
* obj.tbCode 商标提报号, * obj.tbCode 商标提报号,
* obj.deliveryOrderNo 交付订单号, * obj.deliveryOrderNo 交付订单号,
...@@ -180,18 +208,16 @@ class TradeMarkService extends ServiceBase { ...@@ -180,18 +208,16 @@ class TradeMarkService extends ServiceBase {
"ydj": "已递交", "djyc": "递交异常" , "ydj": "已递交", "djyc": "递交异常" ,
* obj.tmRegistNum 商标注册号, * obj.tmRegistNum 商标注册号,
* obj.officialFileName 官文文件名称 , * obj.officialFileName 官文文件名称 ,
* obj.officialFileUrl 官文文件地址 , * obj.officialFileUrl 官文文件地址 ,
* obj.submitTime 提报时间,
* obj.user 用户数据
*/ */
async receiveTmData(obj){ async receiveTmOfficialData(obj){
return system.getResultFail(-100, "接口开发中"); // return system.getResultFail(-100, "接口开发中");
var user = obj.user; // var user = obj.user;
var app = obj.app; // var app = obj.app;
var self = this; var self = this;
if(!user || !user.id){ // if(!user || !user.id){
return system.getResultFail(-100, "未知用户"); // return system.getResultFail(-100, "未知用户");
} // }
var deliveryOrderNo = obj.deliveryOrderNo; var deliveryOrderNo = obj.deliveryOrderNo;
if(!deliveryOrderNo){ if(!deliveryOrderNo){
return system.getResultFail(-101, "deliveryOrderNo参数错误"); return system.getResultFail(-101, "deliveryOrderNo参数错误");
...@@ -204,9 +230,9 @@ class TradeMarkService extends ServiceBase { ...@@ -204,9 +230,9 @@ class TradeMarkService extends ServiceBase {
if(!ordertmproduct || !ordertmproduct.id){ if(!ordertmproduct || !ordertmproduct.id){
return system.getResultFail(-102, "商标交付单不存在"); return system.getResultFail(-102, "商标交付单不存在");
} }
if(!app){ // if(!app){
return system.getResultFail(-103, "未知应用"); // return system.getResultFail(-103, "未知应用");
} // }
var tbCode = obj.tbCode; var tbCode = obj.tbCode;
if(!tbCode){ if(!tbCode){
return system.getResultFail(-104, "tbCode参数错误"); return system.getResultFail(-104, "tbCode参数错误");
...@@ -221,19 +247,16 @@ class TradeMarkService extends ServiceBase { ...@@ -221,19 +247,16 @@ class TradeMarkService extends ServiceBase {
} }
return await self.db.transaction(async function (t) { return await self.db.transaction(async function (t) {
var tmObj={ var tmObj={
id:tm.id, id:tm.id
updateuser_id:user.id,
updateuser:user.nickname
}; };
var officialObj={ var officialObj={
app_id:applicationCache.id,createuser_id:user.id app_id:ordertmproduct.app_id
}; };
if(obj.officialType){ if(obj.officialType){
tmObj["officialType"]=obj.officialType; if(self.statusConvertJSON[obj.officialType]){
officialObj["officialObj"] = obj.officialType; tmObj["officialType"]=self.statusConvertJSON[obj.officialType];
} officialObj["officialType"] = self.statusConvertJSON[obj.officialType];
if(obj.submitTime){ }
tmObj["submitTime"]=obj.submitTime;
} }
if(obj.tmRegistNum){ if(obj.tmRegistNum){
officialObj["tmRegistNum"] = obj.tmRegistNum; officialObj["tmRegistNum"] = obj.tmRegistNum;
...@@ -249,8 +272,55 @@ class TradeMarkService extends ServiceBase { ...@@ -249,8 +272,55 @@ class TradeMarkService extends ServiceBase {
} }
var code = await self.getBusUid("tmoff"); var code = await self.getBusUid("tmoff");
officialObj["code"]=code; officialObj["code"]=code;
await this.tmofficialDao.create(officialObj,t); await self.tmofficialDao.create(officialObj,t);
}
return system.getResultSuccess();
})
}
/**
* 辅助商标状态修改
* @param {*} obj
*/
async updateAssistTmStatus(obj){
var self = this;
var deliveryOrderNo = obj.channelOrderNum;
if(!deliveryOrderNo){
return system.getResultFail(-101, "deliveryOrderNo参数错误");
}
// 1.获取交付单信息
var ordertmproduct = await this.ordertmproductSve.dao.model.findOne({
where:{deliveryOrderNo:deliveryOrderNo},
raw:true
});
if(!ordertmproduct || !ordertmproduct.id){
return system.getResultFail(-102, "商标交付单不存在");
}
var tbCode = obj.proxyCode;
if(!tbCode){
return system.getResultFail(-104, "tbCode参数错误");
}
//获取商标尼斯信息
var tm = await this.dao.model.findOne({
where:{tbCode:tbCode,deliveryOrderNo:deliveryOrderNo},
raw:true
});
if(!tm || !tm.id){
return system.getResultFail(-105, "商标信息不存在");
}
return await self.db.transaction(async function (t) {
var tmObj={id:tm.id};
if(obj.tmStatus){
if(self.statusConvertJSON[obj.tmStatus]){
tmObj["officialType"]=self.statusConvertJSON[obj.tmStatus];
}
}
if(obj.opNotes){
tmObj["opNotes"]=obj.opNotes;
}
if(obj.submitTime){
tmObj["submitTime"]=obj.submitTime;
} }
await self.dao.update(tmObj,t);//修改商标状态信息
return system.getResultSuccess(); return system.getResultSuccess();
}) })
} }
......
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