Commit 253165ea by 宋毅

tj

parent 77a8c04b
...@@ -27,6 +27,9 @@ class APIBase { ...@@ -27,6 +27,9 @@ class APIBase {
return system.getResultSuccess(); return system.getResultSuccess();
} }
} }
if (["updateTmStatus"].indexOf(methodname) >= 0) {
return system.getResultSuccess();
}
if (!pobj.appInfo) { if (!pobj.appInfo) {
return system.getResult(null, "pobj.appInfo can not be empty !!"); return system.getResult(null, "pobj.appInfo can not be empty !!");
} }
...@@ -53,7 +56,7 @@ class APIBase { ...@@ -53,7 +56,7 @@ class APIBase {
agent: req.uagent, agent: req.uagent,
opTitle: "api服务提供方appKey:" + settings.appKey, opTitle: "api服务提供方appKey:" + settings.appKey,
}); });
rtn.requestId = req.requestId rtn.requestId = req.requestId;
return rtn; return rtn;
} catch (e) { } catch (e) {
console.log(e.stack, "api调用出现异常,请联系管理员..........") console.log(e.stack, "api调用出现异常,请联系管理员..........")
......
...@@ -8,7 +8,7 @@ class InternalCallsNotify extends APIBase { ...@@ -8,7 +8,7 @@ class InternalCallsNotify extends APIBase {
this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve"); this.orderinfoSve = system.getObject("service.dbcorder.orderinfoSve");
} }
async updateTmStatus(pobj, qobj, req) { async updateTmStatus(pobj, qobj, req) {
return system.getResultSuccess(); return await this.orderinfoSve.updateTmStatus(pobj);
} }
} }
module.exports = InternalCallsNotify; module.exports = InternalCallsNotify;
\ No newline at end of file
...@@ -658,7 +658,7 @@ class OrderInfoService extends ServiceBase { ...@@ -658,7 +658,7 @@ class OrderInfoService extends ServiceBase {
if (!actionBody.additions) { if (!actionBody.additions) {
return system.getResult(null, "附加购买项目不能为空,20338"); return system.getResult(null, "附加购买项目不能为空,20338");
} }
} } orderinfoSve
if (orderItem.orderStatus == 2) { if (orderItem.orderStatus == 2) {
var dbNclList = itemResult.data.nclones; var dbNclList = itemResult.data.nclones;
if (dbNclList.length < tempNclList.length) { if (dbNclList.length < tempNclList.length) {
...@@ -986,6 +986,7 @@ class OrderInfoService extends ServiceBase { ...@@ -986,6 +986,7 @@ class OrderInfoService extends ServiceBase {
} }
async updateTmStatus(actionBody) { async updateTmStatus(actionBody) {
var self = this;
if (!actionBody.tbCode) { if (!actionBody.tbCode) {
return system.getResult(null, "处理失败,tbCode不能为空,30160"); return system.getResult(null, "处理失败,tbCode不能为空,30160");
} }
...@@ -1003,17 +1004,18 @@ class OrderInfoService extends ServiceBase { ...@@ -1003,17 +1004,18 @@ class OrderInfoService extends ServiceBase {
return system.getResult(null, "修改失败,修改的订单数据未未付款数据为空,30175"); return system.getResult(null, "修改失败,修改的订单数据未未付款数据为空,30175");
} }
actionBody.orderContact = 1; actionBody.orderContact = 1;
var deliveryInfo = await this.getOrderDeliveryFlowInfo(null, actionBody); var deliveryInfoResult = await this.getOrderDeliveryInfo(null, actionBody);
if (!deliveryInfo) { if (deliveryInfoResult.status != 0 || !deliveryInfoResult.data) {
return system.getResult(null, "修改失败,订单对应的产品数据为空,30180"); return system.getResult(null, "修改失败,订单对应的产品数据为空,30180");
} }
var deliveryInfo = deliveryInfoResult.data;
var tbCodeIndex = deliveryInfo.nclones.findIndex(f => f.tbCode == actionBody.tbCode); var tbCodeIndex = deliveryInfo.nclones.findIndex(f => f.tbCode == actionBody.tbCode);
if (tbCodeIndex < 0) { if (tbCodeIndex < 0) {
return system.getResult(null, "修改失败,订单对应的提报数据为空,30185"); return system.getResult(null, "修改失败,订单对应的提报数据为空,30185");
} }
deliveryInfo.nclones[tbCodeIndex].tmStatus = actionBody.tmStatus; deliveryInfo.nclones[tbCodeIndex].tmStatus = actionBody.tmStatus;
deliveryInfo.nclones[tbCodeIndex].tmStatusName = actionBody.tmStatusName; deliveryInfo.nclones[tbCodeIndex].tmStatusName = actionBody.tmStatusName;
var updateOrderFields = null; var updateOrderFields = {};
var orderLog = { var orderLog = {
uapp_id: orderItem.uapp_id, uapp_id: orderItem.uapp_id,
sourceOrderNo: actionBody.orderNo, sourceOrderNo: actionBody.orderNo,
...@@ -1026,15 +1028,23 @@ class OrderInfoService extends ServiceBase { ...@@ -1026,15 +1028,23 @@ class OrderInfoService extends ServiceBase {
updateOrderFields.orderStatus = 4; updateOrderFields.orderStatus = 4;
deliveryInfo.deliveryStatus = "ddj"; deliveryInfo.deliveryStatus = "ddj";
deliveryInfo.deliveryStatusName = "待递交"; deliveryInfo.deliveryStatusName = "待递交";
deliveryInfo.nclones[tbCodeIndex].tmStatus = "ddj";
deliveryInfo.nclones[tbCodeIndex].tmStatusName = "待递交"; deliveryInfo.nclones[tbCodeIndex].tmStatusName = "待递交";
orderLog.opContent = "尊敬的用户,您的商标:“" + deliveryInfo.tm.tmName + "”第" + deliveryInfo.nclones[tbCodeIndex].code + "类,办理状态更新为【待递交】"; orderLog.opContent = "尊敬的用户,您的商标:“" + deliveryInfo.tm.tmName + "”第" + deliveryInfo.nclones[tbCodeIndex].code + "类,办理状态更新为【待递交】";
}//待提交 }//待提交
else if (actionBody.tmStatus == "RECVCOMMIT") { else if (actionBody.tmStatus == "ROBOT") {
updateOrderFields.orderStatus = 8;
deliveryInfo.deliveryStatus = "ydj"; deliveryInfo.deliveryStatus = "ydj";
deliveryInfo.deliveryStatusName = "已递交"; deliveryInfo.deliveryStatusName = "已递交";
deliveryInfo.nclones[tbCodeIndex].tmStatus = "ydj";
deliveryInfo.nclones[tbCodeIndex].tmStatusName = "已递交"; deliveryInfo.nclones[tbCodeIndex].tmStatusName = "已递交";
orderLog.opContent = "尊敬的用户,您的商标:“" + deliveryInfo.tm.tmName + "”第" + deliveryInfo.nclones[tbCodeIndex].code + "类,办理状态更新为【已递交】"; orderLog.opContent = "尊敬的用户,您的商标:“" + deliveryInfo.tm.tmName + "”第" + deliveryInfo.nclones[tbCodeIndex].code + "类,办理状态更新为【已递交】";
}//已提交
else if (actionBody.tmStatus == "RECVCOMMIT") {
updateOrderFields.orderStatus = 8;
deliveryInfo.deliveryStatus = "ywc";
deliveryInfo.deliveryStatusName = "已完成";
deliveryInfo.nclones[tbCodeIndex].tmStatusName = "商标局已收提交";
orderLog.opContent = "尊敬的用户,您的商标:“" + deliveryInfo.tm.tmName + "”第" + deliveryInfo.nclones[tbCodeIndex].code + "类,办理状态更新为【商标局已收提交】";
}//已收提交 }//已收提交
if (deliveryInfo.deliveryStatus != oldDeliveryStatus) { if (deliveryInfo.deliveryStatus != oldDeliveryStatus) {
...@@ -1051,24 +1061,37 @@ class OrderInfoService extends ServiceBase { ...@@ -1051,24 +1061,37 @@ class OrderInfoService extends ServiceBase {
} }
} }
}//增加流程状态列表数据 }//增加流程状态列表数据
try {
await self.db.transaction(async function (t) {
if (Object.keys(updateOrderFields).length > 0) {
self.updateByWhere(updateOrderFields, { where: { orderNo: actionBody.orderNo } }, t);
}
await self.flowlogDao.create(orderLog, t);
});
if (actionBody.submitTime) {
deliveryInfo.nclones[tbCodeIndex].submitTime = actionBody.submitTime;
}//修改提报时间
if (actionBody.registNumInfo && actionBody.registNumInfo.tmRegistNum) {
deliveryInfo.nclones[tbCodeIndex].tmRegistNum = actionBody.registNumInfo.tmRegistNum;
}//更新商标申请号
if (actionBody.officialInfo) {
this.updateTmOfficialInfo(actionBody);
}//更新商标官文
deliveryInfo.opNotes = actionBody.opNotes || "";
this.putOrderDelivery(deliveryInfo, actionBody.orderNo);
if (actionBody.submitTime) {
deliveryInfo.nclones[tbCodeIndex].submitTime = actionBody.submitTime;
}//修改提报时间
if (actionBody.registNumInfo && actionBody.registNumInfo.tmRegistNum) {
deliveryInfo.nclones[tbCodeIndex].tmRegistNum = actionBody.registNumInfo.tmRegistNum;
}//更新商标申请号
if (actionBody.officialInfo) {
this.updateTmOfficialInfo(actionBody);
}//更新商标官文
this.putOrderDelivery(deliveryInfo, actionBody.orderNo); } catch (error) {
console.log("error------------------------", e.stack);
}
return system.getResultSuccess();
} }
async updateTmOfficialInfo(actionBody) {//更新商标官文信息 async updateTmOfficialInfo(actionBody) {//更新商标官文信息
var flowList = []; var flowList = [];
actionBody.sourceOrderNo = actionBody.orderNo; actionBody.sourceOrderNo = actionBody.officialInfo.tmRegistNum;
var deliveryFlowInfo = await this.getOrderDeliveryFlowInfo(actionBody); var deliveryFlowInfo = await this.getOrderDeliveryFlowInfo(null, actionBody);
var addi = 0; var addi = 0;
if (!deliveryFlowInfo.data) { if (!deliveryFlowInfo.data) {
flowList.push({ flowList.push({
...@@ -1095,12 +1118,11 @@ class OrderInfoService extends ServiceBase { ...@@ -1095,12 +1118,11 @@ class OrderInfoService extends ServiceBase {
} }
var sql = null; var sql = null;
if (addi > 0) { if (addi > 0) {
await this.dao.updateByWhere({ orderStatus: 4 }, { where: { id: item.id } });
sql = "INSERT INTO `c_delivery_official_flow` (`sourceOrderNo`,`officialFlow`) VALUE('" + sql = "INSERT INTO `c_delivery_official_flow` (`sourceOrderNo`,`officialFlow`) VALUE('" +
actionBody.orderNo + "','" + JSON.stringify(flowList) + "')"; actionBody.officialInfo.tmRegistNum + "','" + JSON.stringify(flowList) + "')";
} }
else { else {
sql = "UPDATE `c_delivery_official_flow` SET officialFlow ='" + JSON.stringify(flowList) + "' where sourceOrderNo='" + actionBody.orderNo + "'"; sql = "UPDATE `c_delivery_official_flow` SET officialFlow ='" + JSON.stringify(flowList) + "' where sourceOrderNo='" + actionBody.officialInfo.tmRegistNum + "'";
} }
this.customQuery(sql); this.customQuery(sql);
return system.getResultSuccess(); return system.getResultSuccess();
......
1.更新注册号、状态、官文 1.更新注册号、状态、官文
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"tmStatusName": "已下发商标注册证",//官文状态名称 "tmStatusName": "已下发商标注册证",//官文状态名称
"submitTime": "",//提报时间 "submitTime": "",//提报时间
"registNumInfo":{//注册号信息 "registNumInfo":{//注册号信息
"tmRegistNum": "29471633",//商标申请号 "tmRegistNum": "29471633"//商标申请号
}, },
"officialInfo":{//官文信息 "officialInfo":{//官文信息
"tmRegistNum": "29471633",//商标申请号 "tmRegistNum": "29471633",//商标申请号
......
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