Commit 9172b130 by 王昆

gsb

parent 0da795ac
......@@ -38,7 +38,7 @@ class LaoActionApi extends APIBase {
signBeginTime: "2019-08-26",
signEndTime: "2020-08-26",
contract_url: "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_247111576475725735201916135525735contract_yd.pdf",
business_license: "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_142111576475271657201916134751657bl_tfb.jpg",
business_license: "",
}
},
tfb: {
......
......@@ -6,8 +6,8 @@ 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");
......@@ -28,8 +28,13 @@ class XbgApi extends apiBase {
signBeginTime: "2019-08-26",
signEndTime: "2020-08-26",
contract_url: "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_247111576475725735201916135525735contract_yd.pdf",
business_license: "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_142111576475271657201916134751657bl_yd.jpg",
}
business_license: "",
},
dataView: {
actual_amt: "157073.09",
contractCount: 11804,
income_tax: "0",
},
},
tfb: {
signCompanyIds: [11410],
......@@ -48,7 +53,12 @@ class XbgApi extends apiBase {
signEndTime: "2020-10-24",
contract_url: "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_59111576475747388201916135547388contract_tfb.pdf",
business_license: "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_142111576475271657201916134751657bl_tfb.jpg",
}
},
dataView: {
actual_amt: "197701.2",
contractCount: 16,
income_tax: "0",
},
}
}
......@@ -168,24 +178,28 @@ class XbgApi extends apiBase {
//数据概览
async dataOverview(qobj) {
var params = qobj || {};
this.setPayCompanyIds(params);
var config = this.userConfig[qobj.userId];
if (!config) {
return {};
}
qobj.busiIds = config.payCompanyIds;
try {
var recruit_info = await this.recruitSve.findAllList(params);
var resut = {};
if (!params.busiIds || params.busiIds.length == 0) {
resut = {contractCount: 0, actual_amt: 0, income_tax: 0};
} else {
var rs = await this.restClient.execPost(params, this.url + "dataOverview");
resut = JSON.parse(rs.stdout);
}
// var resut = {};
// if (!params.busiIds || params.busiIds.length == 0) {
// resut = {contractCount: 0, actual_amt: 0, income_tax: 0};
// } else {
// var rs = await this.restClient.execPost(params, this.url + "dataOverview");
// resut = JSON.parse(rs.stdout);
// }
var dv = config.dataView || {actual_amt: 0, contractCount: 0, income_tax: 0};
var rcount = 0;
if (recruit_info.status == 0) {
rcount = recruit_info.data.count;
}
resut.data["recruit_count"] = rcount;
return resut;
dv.recruit_count = rcount;
return system.getResultSuccess(dv);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
......
......@@ -12,6 +12,10 @@ module.exports = (db, DataTypes) => {
created_time:DataTypes.DATE,
updated_time:DataTypes.DATE,
workload:DataTypes.STRING,
status: {
type:DataTypes.BOOLEAN,
defaultValue: false
},
},{
paranoid: true,//假的删除
underscored: true,
......
......@@ -79,6 +79,7 @@ class WorkloadService extends ServiceBase {
let list = await this.dao.pageHistory(params);
if (list) {
for (var item of list) {
item.send_amount = parseFloat(Number(item.send_amount || 0).toFixed(2)).toString();
this.handleDate(item, ['created_time', 'updated_time'], 'YYYY-MM-DD');
this.handleDate(item, ['updated_at', 'created_at'], 'YYYY-MM-DD HH:mm:ss');
}
......@@ -141,9 +142,10 @@ class WorkloadService extends ServiceBase {
data.created_time = new Date(1900, 0, cells[6]);
data.updated_time = new Date(1900, 0, cells[7]);
data.workload = this.trim(cells[8]);
data.status = 0;
resu.push(data)
}
await this.dao.model.bulkCreate(resu, {fields: ["username", "iphone", "id_nu", "card_nu", "send_amount", "created_time", "updated_time", "workload"]});
await this.dao.model.bulkCreate(resu, {fields: ["user_id", "username", "iphone", "id_nu", "card_nu", "send_amount", "created_time", "updated_time", "workload", "status"]});
result.code = 1;
result.msg = "上传成功";
return result;
......
......@@ -54,11 +54,16 @@ class RecruitService extends ServiceBase {
var pageSize=obj.page_size || 10;
var currentPage=obj.current_page || 1;
try {
var where = {};
if(obj.userId) {
where.user_id = obj.userId;
}
var sqlwhere = {
order: [["publish_date", 'desc']],
limit: pageSize,
offset: (currentPage - 1) * pageSize,
raw: true
raw: true,
where: where
};
//var list = await this.dao.model.findAll(sqlwhere);
var list = await this.dao.model.findAndCountAll(sqlwhere) || [];
......
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