Commit b1ca2084 by 任晓松

商标驳回复审

parent abd7e34f
const system = require("../../../system");
const Dao = require("../../dao.base");
class OrderdeliveryofficialDao extends Dao {
class OrderOfficialDao extends Dao {
constructor() {
super(Dao.getModelName(OrderdeliveryofficialDao));
super(Dao.getModelName(OrderOfficialDao));
}
}
module.exports = OrderdeliveryofficialDao;
module.exports = OrderOfficialDao;
......@@ -2,7 +2,7 @@ const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
module.exports = (db, DataTypes) => {
return db.define("orderOfficial", {
return db.define("orderofficial", {
sourceNo: DataTypes.STRING(128), // 订单号
channelUserId: DataTypes.STRING(128), // 用户id
officialInfo: DataTypes.JSON // 官文信息
......
const system = require("../../../system");
const settings = require("../../../../config/settings");
const uiconfig = system.getUiConfig2(settings.appKey);
const ServiceBase = require("../../sve.base");
const uuidv4 = require('uuid/v4');
class OrderInfoService extends ServiceBase {
constructor() {
......@@ -11,7 +9,7 @@ class OrderInfoService extends ServiceBase {
this.orderproductDao = system.getObject("db.dbcorder.orderproductDao");
this.ordercontactsDao = system.getObject("db.dbcorder.ordercontactsDao");
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();
}
......@@ -180,23 +178,12 @@ class OrderInfoService extends ServiceBase {
const applyUser = actionBody.deliveryData.applyUser;
//复审证据材料
const askForData = actionBody.deliveryData.askForData;
//商标驳回信息
const trademarkRejInfo = actionBody.deliveryData.trademarkRejInfo;
//补充材料
const supData = actionBody.deliveryData.supData;
//申请信息校验
let re1 = await this.checkApply(apply);
if (re1.status != 0) {
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) {
var deliveryStatusName = "待完善材料";
var recDate = "";
......@@ -206,7 +193,6 @@ class OrderInfoService extends ServiceBase {
var recDate = deliveryData.reDate || "";
var askforDate = deliveryData.askforDate || "";
}
pobj.actionBody.deliveryData.deliveryStatusName = deliveryStatusName;
pobj.actionBody.deliveryData.reDate = recDate;
pobj.actionBody.deliveryData.askforDate = askforDate;
......@@ -221,9 +207,15 @@ class OrderInfoService extends ServiceBase {
* @param orderNo
*/
addOrderDelivery(data, orderNo) {
var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')";
this.customQuery(sql);
try{
var sql = "INSERT INTO `c_order_delivery` (`sourceOrderNo`,`deliveryContent`) VALUE('" +
orderNo + "','" + JSON.stringify(data) + "')";
this.customQuery(sql);
return system.getResultSuccess();
}catch (e) {
return system.getResultFail();
}
}
/**
......@@ -233,16 +225,20 @@ class OrderInfoService extends ServiceBase {
* @returns {Promise<{msg: *, data: (*|null), status: number}>}
*/
async submitReview(pobj, actionBody) {
var packagingTmResult = await this.packagingTmReDeliveryData(pobj, pobj.actionBody);
if (packagingTmResult.status != 0) {
return packagingTmResult;
try{
var packagingTmResult = await this.packagingTmReDeliveryData(pobj, pobj.actionBody);
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 {
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
......@@ -325,7 +298,7 @@ class OrderInfoService extends ServiceBase {
}
if(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){
sql += ` and json_extract(deliveryContent,'$.deliveryStatusName')='${actionBody.status}'`;
......@@ -421,21 +394,26 @@ class OrderInfoService extends ServiceBase {
if(!actionBody.orderNo){
return system.getResult(null,'orderNo can not be empty');
}
let orderSql = `select channelUserId from c_order_info where orderNo = '${actionBody.orderNo}'`;
let list = await this.customQuery(orderSql);
if (!list || list.length == 0) {
return system.getResult(null, "订单数据为空,30200");
}
let orderItem = list[0];
let officialData = {
serviceNo: actionBody.orderNo,
channelUserId:orderItem.channelUserId,
officialInfo: JSON.parse(actionBody.officialData),
created_at: new Date(),
updated_at: new Date()
try{
let orderSql = `select channelUserId from c_order_info where orderNo = '${actionBody.orderNo}'`;
let list = await this.customQuery(orderSql);
if (!list || list.length == 0) {
return system.getResult(null, "订单数据为空,30200");
}
let orderItem = list[0];
let data = {
serviceNo: actionBody.orderNo,
channelUserId:orderItem.channelUserId,
officialInfo: actionBody.officialData,
created_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