Commit 2c9ad600 by Sxy

feat: 同步业务员

parent 2bda75c0
......@@ -4,6 +4,7 @@ const chnelapi = System.getObject("api.common.channels")
const userS = System.getObject("service.auth.userSve")
const roleS = System.getObject("service.auth.roleSve")
const companyS = System.getObject("service.common.companySve")
const rc = System.getObject("util.execClient");
const settings = require("../settings.js")
let channelCache = {};
module.exports = function (app) {
......@@ -179,6 +180,33 @@ module.exports = function (app) {
res.json(System.getResult(null, e.message));
}
})
//
app.post("/order/changeSalesman", async function (req, res, next) {
let { appkey, companykey, orderNumber, userId, userName } = req.body;
let salesman_opcode;
if (!appkey || !companykey) {
res.json(System.getResult(null, "没有公司宝的租户appkey,companykey,请联系资质宝服务提供方"));
return
}
if (!orderNumber || !userId) {
res.json(System.getResult(null, "订单号或转移人不能为空"));
return
}
let uf = await userS.dao.model.findOne({ where: { openid: userId } });
if (uf) {
salesman_opcode = uf.opath;
userName = uf.nickName;
} else {
salesman_opcode = `root10/bizgroup01/g1members/${userId}`
}
let rtn = await rc.execPost3({
orderNumber,
userId,
userName,
salesman_opcode
}, `${settings.icpUrl()}/web/delivery/deliverCtl/changeSalesman`);
res.json(JSON.parse(rtn.stdout));
})
app.post("/entService/*", async function (req, res, next) {
try {
let channel;
......
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