Commit d4cbcc4d by 王勇飞

fix contactAddress

parent ea66d70d
...@@ -1837,22 +1837,31 @@ class OrderService extends ServiceBase { ...@@ -1837,22 +1837,31 @@ class OrderService extends ServiceBase {
// "REQALIERROR": "阿里接口错误(需峰擎系统处理)" // "REQALIERROR": "阿里接口错误(需峰擎系统处理)"
// "SUBALITMOK": "已补全信息(待确认商标)", // "SUBALITMOK": "已补全信息(待确认商标)",
// //
if (tradem.tmStatus == "12" || tradem.tmStatus == "13") {
updateNum1++; if (["WAITCONFIRM", "CONFIRMFAIL", "4", "FILLEXCEPTION", "READY", "DOCFINISH", "AWAITCHECK", "WAITARTIFICIALEXAMINE", "WAITCOMMIT", "ALIPAYREFUND", "ALIAUDITNOT", "ALICUSTOMERREJECTED", "SUBALITM", "REQALIERROR", "SUBALITMOK"].indexOf(tradem.tmStatus) < 0) {
} else { let result = await self.contactAddressSyncUpdate(customer.contactAddress, customer.mobile, apply.applyName);
if (["WAITCONFIRM", "CONFIRMFAIL", "4", "FILLEXCEPTION", "READY", "DOCFINISH", "AWAITCHECK", "WAITARTIFICIALEXAMINE", "WAITCOMMIT", "ALIPAYREFUND", "ALIAUDITNOT", "ALICUSTOMERREJECTED", "SUBALITM", "REQALIERROR", "SUBALITMOK"].indexOf(tradem.tmStatus) < 0) { return { code: "1", msg: "存在状态为" + tradem.tmStatusName + "的商标只能修改联系人地址,其余字段,不能修改" };
updateNum2++;
}
} }
// if (tradem.tmStatus == "12" || tradem.tmStatus == "13") {
// updateNum1++;
// } else {
// if (["WAITCONFIRM", "CONFIRMFAIL", "4", "FILLEXCEPTION", "READY", "DOCFINISH", "AWAITCHECK", "WAITARTIFICIALEXAMINE", "WAITCOMMIT", "ALIPAYREFUND", "ALIAUDITNOT", "ALICUSTOMERREJECTED", "SUBALITM", "REQALIERROR", "SUBALITMOK"].indexOf(tradem.tmStatus) < 0) {
// updateNum2++;
// }
// }
} }
if (updateNum1 > 0) {
//只修改联系地址并同步,然后return掉这个函数 // if (updateNum1 > 0) {
let result = await self.contactAddressSyncUpdate(customer.contactAddress, customer.mobile, apply.applyName); // //只修改联系地址并同步,然后return掉这个函数
return ({ code: "1", msg: "该状态下成功修改联系人地址,其他信息不修改" }); // let result = await self.contactAddressSyncUpdate(customer.contactAddress, customer.mobile, apply.applyName);
} // return ({ code: "1", msg: "该状态下成功修改联系人地址,其他信息不修改" });
else if (updateNum2 > 0) { // }
return { code: "-140", msg: "商标状态有误,不能修改" }; // else if (updateNum2 > 0) {
} // let result = await self.contactAddressSyncUpdate(customer.contactAddress, customer.mobile, apply.applyName);
// return { code: "-140", msg: "商标状态有误, 该状态下只能修改联系人地址, 其余字段不能修改" };
// }
tm["channelOrderListInfo"] = channelorder.order_nos && channelorder.order_nos.length > 0 ? channelorder.order_nos.join(',') : ""; tm["channelOrderListInfo"] = channelorder.order_nos && channelorder.order_nos.length > 0 ? channelorder.order_nos.join(',') : "";
tm["channelUserId"] = obj.channelUserId || ""; tm["channelUserId"] = obj.channelUserId || "";
tm["channelOrderNum"] = obj.channelOrderNum || ""; tm["channelOrderNum"] = obj.channelOrderNum || "";
...@@ -1982,7 +1991,7 @@ class OrderService extends ServiceBase { ...@@ -1982,7 +1991,7 @@ class OrderService extends ServiceBase {
}) })
}; };
//将联系地址同步到该公司的其他订单数据中 //将联系地址同步到该公司的所有订单数据中
async contactAddressSyncUpdate(contactAddress, mobile, applyName) { async contactAddressSyncUpdate(contactAddress, mobile, applyName) {
let sql = "UPDATE h_tmcustomer_info SET contactAddress = '" + contactAddress + "' , addressIsPushed = '0' WHERE id IN (SELECT id FROM (SELECT cu.id FROM h_tmapplier_info AS ap LEFT JOIN h_tmcustomer_info AS cu ON ap.orderNum = cu.orderNum WHERE cu.mobile = '" + mobile + "' AND ap.applyName = '" + applyName + "') AS a)"; let sql = "UPDATE h_tmcustomer_info SET contactAddress = '" + contactAddress + "' , addressIsPushed = '0' WHERE id IN (SELECT id FROM (SELECT cu.id FROM h_tmapplier_info AS ap LEFT JOIN h_tmcustomer_info AS cu ON ap.orderNum = cu.orderNum WHERE cu.mobile = '" + mobile + "' AND ap.applyName = '" + applyName + "') AS a)";
let updateRes = await this.dao.customUpdate(sql); let updateRes = await this.dao.customUpdate(sql);
......
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