Commit b1ca2084 by 任晓松

商标驳回复审

parent abd7e34f
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
class OrderdeliveryofficialDao extends Dao { class OrderOfficialDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(OrderdeliveryofficialDao)); super(Dao.getModelName(OrderOfficialDao));
} }
} }
module.exports = OrderdeliveryofficialDao; module.exports = OrderOfficialDao;
...@@ -2,7 +2,7 @@ const system = require("../../../system"); ...@@ -2,7 +2,7 @@ const system = require("../../../system");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey); const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => { module.exports = (db, DataTypes) => {
return db.define("orderOfficial", { return db.define("orderofficial", {
sourceNo: DataTypes.STRING(128), // 订单号 sourceNo: DataTypes.STRING(128), // 订单号
channelUserId: DataTypes.STRING(128), // 用户id channelUserId: DataTypes.STRING(128), // 用户id
officialInfo: DataTypes.JSON // 官文信息 officialInfo: DataTypes.JSON // 官文信息
......
const system = require("../../../system"); const system = require("../../../system");
const settings = require("../../../../config/settings"); const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
const ServiceBase = require("../../sve.base"); const ServiceBase = require("../../sve.base");
const uuidv4 = require('uuid/v4');
class OrderInfoService extends ServiceBase { class OrderInfoService extends ServiceBase {
constructor() { constructor() {
...@@ -11,7 +9,7 @@ class OrderInfoService extends ServiceBase { ...@@ -11,7 +9,7 @@ class OrderInfoService extends ServiceBase {
this.orderproductDao = system.getObject("db.dbcorder.orderproductDao"); this.orderproductDao = system.getObject("db.dbcorder.orderproductDao");
this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao"); this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao");
this.orderReceiptVoucherDao = system.getObject("db.dbcpay.orderreceiptvoucherDao"); this.orderReceiptVoucherDao = system.getObject("db.dbcpay.orderreceiptvoucherDao");
this.officialDao = system.getObject("db.dbcorder.orderdeliveryofficialDao"); this.officialDao = system.getObject("db.dbcorder.orderofficialDao");
this.centerChannelUrl = settings.centerChannelUrl(); this.centerChannelUrl = settings.centerChannelUrl();
} }
...@@ -180,23 +178,12 @@ class OrderInfoService extends ServiceBase { ...@@ -180,23 +178,12 @@ class OrderInfoService extends ServiceBase {
const applyUser = actionBody.deliveryData.applyUser; const applyUser = actionBody.deliveryData.applyUser;
//复审证据材料 //复审证据材料
const askForData = actionBody.deliveryData.askForData; const askForData = actionBody.deliveryData.askForData;
//商标驳回信息
const trademarkRejInfo = actionBody.deliveryData.trademarkRejInfo;
//补充材料
const supData = actionBody.deliveryData.supData;
//申请信息校验 //申请信息校验
let re1 = await this.checkApply(apply); let re1 = await this.checkApply(apply);
if (re1.status != 0) { if (re1.status != 0) {
return re1; return re1;
} }
//商标驳回信息校验
let re2= await this.checkRejInfo(trademarkRejInfo);
if (re2.status != 0) {
return re2;
}
if (Object.keys(applyUser).length === 0 || Object.keys(askForData).length === 0) { if (Object.keys(applyUser).length === 0 || Object.keys(askForData).length === 0) {
var deliveryStatusName = "待完善材料"; var deliveryStatusName = "待完善材料";
var recDate = ""; var recDate = "";
...@@ -206,7 +193,6 @@ class OrderInfoService extends ServiceBase { ...@@ -206,7 +193,6 @@ class OrderInfoService extends ServiceBase {
var recDate = deliveryData.reDate || ""; var recDate = deliveryData.reDate || "";
var askforDate = deliveryData.askforDate || ""; var askforDate = deliveryData.askforDate || "";
} }
pobj.actionBody.deliveryData.deliveryStatusName = deliveryStatusName; pobj.actionBody.deliveryData.deliveryStatusName = deliveryStatusName;
pobj.actionBody.deliveryData.reDate = recDate; pobj.actionBody.deliveryData.reDate = recDate;
pobj.actionBody.deliveryData.askforDate = askforDate; pobj.actionBody.deliveryData.askforDate = askforDate;
...@@ -221,9 +207,15 @@ class OrderInfoService extends ServiceBase { ...@@ -221,9 +207,15 @@ class OrderInfoService extends ServiceBase {
* @param orderNo * @param orderNo
*/ */
addOrderDelivery(data, orderNo) { addOrderDelivery(data, orderNo) {
var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" + try{
orderNo + "','" + JSON.stringify(data) + "')"; var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
this.customQuery(sql); orderNo + "','" + JSON.stringify(data) + "')";
this.customQuery(sql);
return system.getResultSuccess();
}catch (e) {
return system.getResultFail();
}
} }
/** /**
...@@ -233,16 +225,20 @@ class OrderInfoService extends ServiceBase { ...@@ -233,16 +225,20 @@ class OrderInfoService extends ServiceBase {
* @returns {Promise<{msg: *, data: (*|null), status: number}>} * @returns {Promise<{msg: *, data: (*|null), status: number}>}
*/ */
async submitReview(pobj, actionBody) { async submitReview(pobj, actionBody) {
var packagingTmResult = await this.packagingTmReDeliveryData(pobj, pobj.actionBody); try{
if (packagingTmResult.status != 0) { var packagingTmResult = await this.packagingTmReDeliveryData(pobj, pobj.actionBody);
return packagingTmResult; if (packagingTmResult.status != 0) {
return packagingTmResult;
}
const orderNo = actionBody.orderNo;
const deliveryData = JSON.stringify(pobj.actionBody.deliveryData);
let sql = `UPDATE c_order_delivery SET deliveryContent ='${deliveryData}' where sourceOrderNo='${orderNo}'`;
sql = sql.replace('\n', '');
const result = await this.customUpdate(sql);
return system.getResultSuccess();
}catch (e) {
return system.getResultFail();
} }
const orderNo = actionBody.orderNo;
const deliveryData = JSON.stringify(pobj.actionBody.deliveryData);
let sql = `UPDATE c_order_delivery SET deliveryContent ='${deliveryData}' where sourceOrderNo='${orderNo}'`;
sql = sql.replace('\n', '');
const result = await this.customUpdate(sql);
return system.getResultSuccess();
} }
//申请信息校验 //申请信息校验
...@@ -271,29 +267,6 @@ class OrderInfoService extends ServiceBase { ...@@ -271,29 +267,6 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
//复审证据材料校验
async checkRejInfo(trademarkRejInfo) {
if(!trademarkRejInfo.noticeDate){
return system.getResult(null,'收到通知书日期不能为空');
}
if(!trademarkRejInfo.noticeMode){
return system.getResult(null,'通知的方式不能为空');
}
if(!["电子版","纸质版"].includes(trademarkRejInfo.noticeMode)){
return system.getResult(null,'通知书的类型错误')
}
if(!trademarkRejInfo.zhichanNumber){
return system.getResult(null,'知识产权局发文号不能为空');
}
if(!trademarkRejInfo.rejNotice){
return system.getResult(null,'商标驳回通知书不能为空');
}
if(!trademarkRejInfo.quotedTrademark){
return system.getResult(null,'引证商标不能为空');
}
return system.getResultSuccess()
}
/** /**
* 商标驳回复审列表 + 模糊查询 * 商标驳回复审列表 + 模糊查询
* @param pobj * @param pobj
...@@ -325,7 +298,7 @@ class OrderInfoService extends ServiceBase { ...@@ -325,7 +298,7 @@ class OrderInfoService extends ServiceBase {
} }
if(actionBody.applicantName){ if(actionBody.applicantName){
sql += ` and json_extract(deliveryContent,'$.applyUser.applicantName') like '%${actionBody.applicantName}%'`; sql += ` and json_extract(deliveryContent,'$.applyUser.applicantName') like '%${actionBody.applicantName}%'`;
sqlCount += ` and json_extract(deliveryContent,'$.applyUser.applicantName') like '%${actionBody.applicantName}'%`; sqlCount += ` and json_extract(deliveryContent,'$.applyUser.applicantName') like '%${actionBody.applicantName}%'`;
} }
if(actionBody.status){ if(actionBody.status){
sql += ` and json_extract(deliveryContent,'$.deliveryStatusName')='${actionBody.status}'`; sql += ` and json_extract(deliveryContent,'$.deliveryStatusName')='${actionBody.status}'`;
...@@ -421,21 +394,26 @@ class OrderInfoService extends ServiceBase { ...@@ -421,21 +394,26 @@ class OrderInfoService extends ServiceBase {
if(!actionBody.orderNo){ if(!actionBody.orderNo){
return system.getResult(null,'orderNo can not be empty'); return system.getResult(null,'orderNo can not be empty');
} }
let orderSql = `select channelUserId from c_order_info where orderNo = '${actionBody.orderNo}'`; try{
let list = await this.customQuery(orderSql); let orderSql = `select channelUserId from c_order_info where orderNo = '${actionBody.orderNo}'`;
if (!list || list.length == 0) { let list = await this.customQuery(orderSql);
return system.getResult(null, "订单数据为空,30200"); if (!list || list.length == 0) {
} return system.getResult(null, "订单数据为空,30200");
let orderItem = list[0]; }
let orderItem = list[0];
let officialData = { let data = {
serviceNo: actionBody.orderNo, serviceNo: actionBody.orderNo,
channelUserId:orderItem.channelUserId, channelUserId:orderItem.channelUserId,
officialInfo: JSON.parse(actionBody.officialData), officialInfo: actionBody.officialData,
created_at: new Date(), created_at: new Date(),
updated_at: new Date() updated_at: new Date()
}
await this.officialDao.create(data);
return system.getResultSuccess();
}catch (e) {
return system.getResultFail();
} }
await this.officialDao.create(officialData,"");
} }
} }
......
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