Commit cd0c4122 by zhaoxiqing

gsb

parent 6206c124
......@@ -88,11 +88,13 @@ class LaoActionApi extends APIBase {
// }
}
async testAES(pobj) {
let str = "{a:1,b2:'2', c:333, d:\"北京公司宝\"}";
async testUrl(pobj) {
let j = {userName:"1111", companyName: "123", mchtId:"1250717023940415489"};
let str = JSON.stringify(j);
console.log("str: " + str);
console.log("str object: " + JSON.parse(str));
let encry = this.encryption(str);
console.log("encry: " + encry);
console.log("encry: " + encodeURIComponent(encry));
let decry = this.decryption(encry);
console.log("decry: " + decry);
return 1;
......
var system = require("../../../system");
const apiBase = require("../../api.base");
const axios = require("axios");
const moment = require("moment");
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://127.0.0.1:3333/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.userconfSve = system.getObject("service.operator.userconfSve");
this.excelClient = system.getObject("util.excelClient");
// this.companyConfig = {
// yd: {
// signCompanyIds: [10173, 492],
......@@ -153,6 +154,55 @@ class XbgApi extends apiBase {
}
}
//已签协议合同
async acontracttoMtchIdList(qobj) {
var params = qobj || {};
try {
let response = await axios({
method: "POST",
url: this.url + "acontractList",
data: params
})
return response.data;
} catch (e) {
console.log(e);
return system.getResult(null, "接口异常");
}
}
//导出已签合同
async allExport(queryobj,odj,req, res,) {
var search = decodeURIComponent(odj.search)
var params = JSON.parse(search);
try {
let response = await axios({
method: "POST",
url: this.url + "allExport",
data: params
})
var csvobj = {
fileName: "签约协议" + moment().format("YYYYMMDD") + ".csv",
rows: response.data.rows,
opts: {
fields: ['id', 'ecompany.name', 'template.nameA', 'eaccount.userName', 'eaccount.mobile', 'eaccount.personsSign', 'eaccount.bankno', 'fileurl'],
unwind: ['ecompany', 'eaccount'],
unwindBlank: true,
excelStrings: true,
},
headers: {'id': '编号', 'ecompany.name': "公司名", 'template.nameA' : '签约主体', 'eaccount.userName': "姓名", 'eaccount.mobile': "手机号", 'eaccount.personsSign': "身份证", "eaccount.bankno": "银行卡号", 'fileurl': "签约合同"},
};
return await this.excelClient.exportCsv(req,res, csvobj);
} catch (e) {
console.log(e);
return system.getResult(null, "接口异常");
}
}
//纳税人人员
async ratepayingListToPe(qobj) {
var params = qobj || {};
......@@ -409,4 +459,4 @@ module.exports = XbgApi;
// //console.log(result.data.rows);
// }).catch(function(e){
// console.log(e);
// });
\ No newline at end of file
// });
......@@ -45,7 +45,8 @@
"serve-favicon": "^2.4.5",
"sha1": "^1.1.1",
"socket.io": "^2.1.1",
"uuid": "^3.2.1"
"uuid": "^3.2.1",
"axios": "^0.19.2"
},
"devDependencies": {
"element-theme": "^2.0.1",
......
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