Commit a0882405 by 高宇强

Merge branch 'laowubao' of gitlab.gongsibao.com:jiangyong/zhichan into laowubao

parents 873c6ead a3deec4b
......@@ -690,6 +690,10 @@ class LaoActionApi extends APIBase {
return system.getResult(null, "人才id不存在");
}
if(!obj.recruit_id) {
return system.getResult(null, "请选择招聘信息");
}
try {
let rs = await this.labourSve.notifyInterview(obj);
return system.getResultSuccess(rs);
......@@ -697,7 +701,6 @@ class LaoActionApi extends APIBase {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试")
}
}
async FindRecruitByWhere(obj) { //根据条件获取招聘信息
......
......@@ -6,11 +6,13 @@ class XbgApi extends apiBase {
constructor() {
super();
this.restClient = system.getObject("util.restClient");
// this.url = "http://192.168.18.125:3000/api/xbgApi/";
this.url = "https://bpohhr.gongsibao.com/api/xbgApi/";
this.url = "http://192.168.18.125:3000/api/xbgApi/";
// this.url = "https://bpohhr.gongsibao.com/api/xbgApi/";
this.testCompanyIds = 12;
this.ecompanyId = '1103817785420820481';
this.recruitSve = system.getObject("service.operator.recruitSve");
this.userlabourSve = system.getObject("service.operator.userlabourSve");
this.usersSve = system.getObject("service.operator.usersSve");
this.companyConfig = {
yd: {
signCompanyIds: [10173],
......@@ -105,7 +107,7 @@ class XbgApi extends apiBase {
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
return system.getResult(null, "接口异常");
}
}
......@@ -121,7 +123,7 @@ class XbgApi extends apiBase {
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
return system.getResult(null, "接口异常");
}
}
......@@ -138,7 +140,7 @@ class XbgApi extends apiBase {
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
return system.getResult(null, "接口异常");
}
}
......@@ -154,7 +156,7 @@ class XbgApi extends apiBase {
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
return system.getResult(null, "接口异常");
}
}
......@@ -171,7 +173,7 @@ class XbgApi extends apiBase {
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
return system.getResult(null, "接口异常");
}
}
......@@ -202,11 +204,97 @@ class XbgApi extends apiBase {
return system.getResultSuccess(dv);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
return system.getResult(null, "接口异常");
}
}
async validSign(qobj) {
let userlabour_id = Number(qobj.userlabour_id || 0);
try {
let userlabour = await this.userlabourSve.findById(userlabour_id);
if (!userlabour) {
return system.getResult(null, "应聘信息不存在");
}
if (!userlabour.ecid) {
return system.getResult(null, "应聘信息未发起邀请");
}
let userInfo = await this.usersSve.findById(userlabour.labour_user_id);
if(!userInfo) {
return system.getResult(null, "用户信息不存在");
}
if (!userInfo.id_card) {
return system.getResult(null, "用户未实名认证,身份证不存在");
}
let params = {
idNo: "222403198301071778",
// idNo: userInfo.id_card,
ecid: userlabour.ecid,
};
let rs = await this.restClient.execPost(params, this.url + "validLwbSign");
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult(null, "接口异常");
}
}
async contractUrl(qobj) {
let userlabour_id = Number(qobj.userlabour_id || 0);
try {
let userlabour = await this.userlabourSve.findById(userlabour_id);
if (!userlabour) {
return system.getResult(null, "应聘信息不存在");
}
if (!userlabour.ecid) {
return system.getResult(null, "应聘信息未发起邀请");
}
if (userlabour.contract_url) {
return system.getResultSuccess(userlabour.contract_url);
}
let userInfo = await this.usersSve.findById(userlabour.labour_user_id);
if(!userInfo) {
return system.getResult(null, "用户信息不存在");
}
if (!userInfo.id_card) {
return system.getResult(null, "用户未实名认证,身份证不存在");
}
let params = {
idNo: "222403198301071778",
// idNo: userInfo.id_card,
ecid: userlabour.ecid,
};
var rs = await this.restClient.execPost(params, this.url + "lwbContractUrl");
try {
rs = JSON.parse(rs.stdout);
if (rs.status !== 0) {
return rs;
}
if (rs.data) {
userlabour.contract_url = rs.data;
await userlabour.save();
}
return rs;
} catch (e) {
console.log(e);
return system.getResult(null, "bpo接口错误");
}
} catch (e) {
console.log(e);
return system.getResult(null, "接口异常");
}
}
exam() {
return "xxx";
......
......@@ -131,11 +131,28 @@ class LabourService extends ServiceBase {
}
async notifyInterview(obj) {
var id = Number(obj.id);
var user_id = Number(obj.userId);
let labour = await this.userlabourDao.create({user_id: user_id, labour_id: id});
return labour;
let id = Number(obj.id);
let user_id = Number(obj.userId);
let recruit_id = Number(obj.recruit_id);
// 查询用户
let labour = await this.dao.findById(id);
if(!labour) {
return system.getResult(null, "人才不存在");
}
let userLabour = {
user_id: user_id,
labour_id: id,
recruit_id: recruit_id,
labour_user_id: labour.user_id,
ecid: 0,
apply_stauts: "20",
interview_time: new Date(),
contract_url: "",
};
userLabour = await this.userlabourDao.create(userLabour);
return userLabour;
}
async updatestatus(obj) {//更新状态信息
......
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