Commit 3f2761bd by 王昆

gsb

parent aaa393d8
...@@ -18,6 +18,49 @@ class LaoActionApi extends APIBase { ...@@ -18,6 +18,49 @@ class LaoActionApi extends APIBase {
this.vcodePrev = "lwb_vcode_"; this.vcodePrev = "lwb_vcode_";
this.testPhones = ['13691046554', '13333333333']; this.testPhones = ['13691046554', '13333333333'];
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
this.companyConfig = {
yd: {
signCompanyIds: [10173],
payCompanyIds: ['1152185172836229121', '1152186076306087937', '1165922409285480450', '1169516233595670529', '1174219506669584386', '1197064800073707522', '1199605424102690818'],
compantInfo: {
companyName: "上海韵达货运有限公司",
taxType: "一般纳税人",
contactName: "陈梁",
contactEmail: "chenliang8725@yundasys.com",
contactAddr: "上海市青浦区赵巷镇盈港东路6679号",
bankAccount: "上海韵达货运有限公司",
openBank: "邮政储蓄银行青浦支行",
bankno: "100360752790012735",
sign_body: "舟山兰和科技有限公司",
signBeginTime: "2019-08-26",
signEndTime: "2020-08-26",
}
},
tfb: {
signCompanyIds: [11410],
payCompanyIds: ['1187270470698082306', '1187272600083308546', '1187274198010056705', '1202100969987661826'],
compantInfo: {
companyName: "杭州淘粉吧网络技术股份有限公司",
taxType: "一般纳税人",
contactName: "王萍",
contactEmail: "wangping@taofen8.com",
contactAddr: "浙江省杭州市西湖区西斗门路9号福地创业园1号楼2楼",
bankAccount: "杭州淘粉吧网络技术股份有限公司",
openBank: "杭州银行学院路支行",
bankno: "3301040160000822687",
sign_body: "舟山兰和科技有限公司",
signBeginTime: "2019-10-24",
signEndTime: "2020-10-24",
}
}
}
this.userConfig = {
29: this.companyConfig.yd,
30: this.companyConfig.tfb
}
} }
async test(pobj, query) { async test(pobj, query) {
...@@ -800,6 +843,9 @@ class LaoActionApi extends APIBase { ...@@ -800,6 +843,9 @@ class LaoActionApi extends APIBase {
// 工作量确认单 // 工作量确认单
async paramXlsx(obj) { async paramXlsx(obj) {
if(!obj.userId) {
return system.getResult(null, "用户未登录");
}
try { try {
var rs = await this.workloadSve.paramXlsx(obj.userId, obj.ossUrl); var rs = await this.workloadSve.paramXlsx(obj.userId, obj.ossUrl);
if (rs.code == 0) { if (rs.code == 0) {
...@@ -814,6 +860,10 @@ class LaoActionApi extends APIBase { ...@@ -814,6 +860,10 @@ class LaoActionApi extends APIBase {
// 列表 // 列表
async workLoadPage(obj) { async workLoadPage(obj) {
if(!obj.userId) {
return system.getResult(null, "用户未登录");
}
try { try {
obj.status = 0; obj.status = 0;
var rs = await this.workloadSve.pageByCondition(obj); var rs = await this.workloadSve.pageByCondition(obj);
...@@ -825,6 +875,10 @@ class LaoActionApi extends APIBase { ...@@ -825,6 +875,10 @@ class LaoActionApi extends APIBase {
} }
async workLoadHistoryInfo(obj) { async workLoadHistoryInfo(obj) {
if(!obj.userId) {
return system.getResult(null, "用户未登录");
}
try { try {
var rs = await this.workloadSve.historyInfo(obj); var rs = await this.workloadSve.historyInfo(obj);
return system.getResultSuccess(rs); return system.getResultSuccess(rs);
...@@ -836,6 +890,10 @@ class LaoActionApi extends APIBase { ...@@ -836,6 +890,10 @@ class LaoActionApi extends APIBase {
// 确认/全部 // 确认/全部
async workloadConfirm(obj) { async workloadConfirm(obj) {
if(!obj.userId) {
return system.getResult(null, "用户未登录");
}
try { try {
var rs = await this.workloadSve.workloadConfirm(obj); var rs = await this.workloadSve.workloadConfirm(obj);
return system.getResultSuccess(rs); return system.getResultSuccess(rs);
...@@ -846,6 +904,10 @@ class LaoActionApi extends APIBase { ...@@ -846,6 +904,10 @@ class LaoActionApi extends APIBase {
} }
async workloadTotal(obj) { async workloadTotal(obj) {
if(!obj.userId) {
return system.getResult(null, "用户未登录");
}
try { try {
obj.pageSize = 1; obj.pageSize = 1;
obj.status = 1; obj.status = 1;
...@@ -863,6 +925,10 @@ class LaoActionApi extends APIBase { ...@@ -863,6 +925,10 @@ class LaoActionApi extends APIBase {
// 确认列表 // 确认列表
async workloadHistory(obj) { async workloadHistory(obj) {
if(!obj.userId) {
return system.getResult(null, "用户未登录");
}
try { try {
obj.status = 0; obj.status = 0;
var rs = await this.workloadSve.historyPage(obj); var rs = await this.workloadSve.historyPage(obj);
...@@ -874,22 +940,13 @@ class LaoActionApi extends APIBase { ...@@ -874,22 +940,13 @@ class LaoActionApi extends APIBase {
} }
// 企业信息,家属拒 // 企业信息,家属拒
async companyInfo() { async companyInfo(qobj) {
try { try {
let companyInfo = { let config = this.userConfig[qobj.userId];
companyName: "上海韵达货运有限公司", if(!config) {
taxType: "一般纳税人", return system.getResultSuccess({});
contactName: "陈梁", }
contactEmail: "chenliang8725@yundasys.com", return system.getResultSuccess(config.companyInfo);
contactAddr: "上海市青浦区赵巷镇盈港东路6679号",
bankAccount: "上海韵达货运有限公司",
openBank: "邮政储蓄银行青浦支行",
bankno: "100360752790012735",
sign_body: "舟山兰和科技有限公司",
signBeginTime: "2019-08-26",
signEndTime: "2020-08-26",
};
return system.getResultSuccess(companyInfo);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试") return system.getErrResult2("您的网络不稳, 请稍后重试")
......
...@@ -3,167 +3,227 @@ const apiBase = require("../../api.base"); ...@@ -3,167 +3,227 @@ const apiBase = require("../../api.base");
class XbgApi extends apiBase { class XbgApi extends apiBase {
constructor() { constructor() {
super(); super();
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
this.url = "https://bpohhr.gongsibao.com/api/xbgApi/"; this.url = "https://bpohhr.gongsibao.com/api/xbgApi/";
this.testCompanyIds = 12; this.testCompanyIds = 12;
this.ecompanyId = '1103817785420820481'; this.ecompanyId = '1103817785420820481';
this.recruitSve = system.getObject("service.operator.recruitSve"); this.recruitSve = system.getObject("service.operator.recruitSve");
this.companyConfig = {
yd: {
signCompanyIds: [10173],
payCompanyIds: ['1152185172836229121', '1152186076306087937', '1165922409285480450', '1169516233595670529', '1174219506669584386', '1197064800073707522', '1199605424102690818'],
compantInfo: {
companyName: "上海韵达货运有限公司",
taxType: "一般纳税人",
contactName: "陈梁",
contactEmail: "chenliang8725@yundasys.com",
contactAddr: "上海市青浦区赵巷镇盈港东路6679号",
bankAccount: "上海韵达货运有限公司",
openBank: "邮政储蓄银行青浦支行",
bankno: "100360752790012735",
sign_body: "舟山兰和科技有限公司",
signBeginTime: "2019-08-26",
signEndTime: "2020-08-26",
}
},
tfb: {
signCompanyIds: [11410],
payCompanyIds: ['1187270470698082306', '1187272600083308546', '1187274198010056705', '1202100969987661826'],
compantInfo: {
companyName: "杭州淘粉吧网络技术股份有限公司",
taxType: "一般纳税人",
contactName: "王萍",
contactEmail: "wangping@taofen8.com",
contactAddr: "浙江省杭州市西湖区西斗门路9号福地创业园1号楼2楼",
bankAccount: "杭州淘粉吧网络技术股份有限公司",
openBank: "杭州银行学院路支行",
bankno: "3301040160000822687",
sign_body: "舟山兰和科技有限公司",
signBeginTime: "2019-10-24",
signEndTime: "2020-10-24",
}
}
} }
async test(pobj, query) { this.userConfig = {
return system.getResultSuccess({ 29: this.companyConfig.yd,
hello: "ok" 30: this.companyConfig.tfb
});
} }
async setCompanyIds(qobj) { }
// qobj.id
// 查ecmpanyIds async test(pobj, query) {
qobj.ecompany_id = this.testCompanyIds; return system.getResultSuccess({
hello: "ok"
});
}
async setCompanyIds(qobj) {
var config = this.this.userConfig[qobj.userId];
if (!config) {
return;
} }
//合同模板 qobj.ecompany_id = config.signCompanyIds;
async etemplateList(qobj) { }
this.setCompanyIds(qobj); async setPayCompanyIds(qobj) {
var params = qobj || {}; var config = this.this.userConfig[qobj.userId];
if (!params.ecompany_id) { if (!config) {
return system.getResult("参数ecompany_id为空") return;
}
try {
var params = qobj || {};
var rs = await this.restClient.execPost(params, this.url+"etemplateList");
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
}
} }
qobj.busiIds = config.payCompanyIds;
}
//已签合同 //合同模板
async acontractList(qobj) { async etemplateList(qobj) {
this.setCompanyIds(qobj); var params = qobj || {};
var params = qobj || {}; this.setCompanyIds(params);
if (!params.ecompany_id) {
return system.getResult("参数ecompany_id为空")
}
try {
var rs = await this.restClient.execPost(params, this.url+"acontractList");
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
}
}
//纳税人人员 if (!params.ecompany_id || params.ecompany_id.length == 0) {
async ratepayingListToPe(qobj) { return system.getResultSuccess({count: 0, rows: []})
var params = qobj || {};
params.ecompany_id = this.ecompanyId;
if (!params.ecompany_id) {
return system.getResult("参数ecompany_id为空")
}
try {
var rs = await this.restClient.execPost(params, this.url+"ratepayingListToPe");
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
}
} }
try {
//纳税人按月 var params = qobj || {};
async ratepayingListToMonth(qobj) { var rs = await this.restClient.execPost(params, this.url + "etemplateList");
var params = qobj || {}; return JSON.parse(rs.stdout);
params.ecompany_id = this.ecompanyId; } catch (e) {
if (!params.ecompany_id) { console.log(e);
return system.getResult("参数ecompany_id为空") return system.getResult("接口异常");
}
try {
var rs = await this.restClient.execPost(params, this.url+"ratepayingListToMonth");
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
}
} }
}
//纳税人个人详情
async ratepayingListToOne(qobj) { //已签合同
var params = qobj || {}; async acontractList(qobj) {
params.ecompany_id = this.ecompanyId; var params = qobj || {};
if (!params.ecompany_id) { this.setCompanyIds(params);
return system.getResult("参数ecompany_id为空") if (!params.ecompany_id || params.ecompany_id.length == 0) {
} return system.getResultSuccess({count: 0, rows: []})
try { }
var rs = await this.restClient.execPost(params, this.url+"ratepayingListToOne"); try {
return JSON.parse(rs.stdout); var rs = await this.restClient.execPost(params, this.url + "acontractList");
} catch (e) { return JSON.parse(rs.stdout);
console.log(e); } catch (e) {
return system.getResult("接口异常"); console.log(e);
} return system.getResult("接口异常");
}
}
//纳税人人员
async ratepayingListToPe(qobj) {
var params = qobj || {};
this.setPayCompanyIds(params);
if (!params.busiIds || params.busiIds.length == 0) {
return system.getResultSuccess({count: 0, rows: []})
} }
//数据概览 try {
async dataOverview(qobj) { var rs = await this.restClient.execPost(params, this.url + "ratepayingListToPe");
var params = qobj || {}; return JSON.parse(rs.stdout);
params.ecompany_id = this.ecompanyId; } catch (e) {
console.log(e);
if (!params.ecompany_id) { return system.getResult("接口异常");
return system.getResult("参数ecompany_id为空") }
} }
try {
var recruit_info = await this.recruitSve.findAllList(params); //纳税人按月
var rs = await this.restClient.execPost(params, this.url+"dataOverview"); async ratepayingListToMonth(qobj) {
var resut = JSON.parse(rs.stdout); var params = qobj || {};
var rcount = 0; this.setPayCompanyIds(params);
if (recruit_info.status == 0){ if (!params.busiIds || params.busiIds.length == 0) {
rcount = recruit_info.data.count; return system.getResultSuccess({count: 0, rows: []})
}
resut.data["recruit_count"] = rcount;
return resut;
} catch (e) {
console.log(e);
return system.getResult("接口异常");
}
} }
try {
var rs = await this.restClient.execPost(params, this.url + "ratepayingListToMonth");
return JSON.parse(rs.stdout);
} catch (e) {
console.log(e);
return system.getResult("接口异常");
}
}
//纳税人个人详情
async ratepayingListToOne(qobj) {
exam() { var params = qobj || {};
return "xxx"; this.setPayCompanyIds(params);
if (!params.busiIds || params.busiIds.length == 0) {
return system.getResultSuccess({count: 0, rows: []})
} }
classDesc() { try {
return { var rs = await this.restClient.execPost(params, this.url + "ratepayingListToOne");
groupName: "auth", return JSON.parse(rs.stdout);
groupDesc: "认证相关的包", } catch (e) {
name: "AccessAuthAPI", console.log(e);
desc: "关于认证的类", return system.getResult("接口异常");
exam: "",
};
} }
methodDescs() { }
return [{
methodDesc: "生成访问token", //数据概览
methodName: "getAccessKey", async dataOverview(qobj) {
paramdescs: [{ var params = qobj || {};
paramDesc: "访问appkey", this.setPayCompanyIds(params);
paramName: "appkey",
paramType: "string", try {
defaultValue: "x", var recruit_info = await this.recruitSve.findAllList(params);
}, var resut = {};
{ if (!params.busiIds || params.busiIds.length == 0) {
paramDesc: "访问secret", resut = {contractCount: 0, actual_amt: 0, income_tax: 0};
paramName: "secret", } else {
paramType: "string", var rs = await this.restClient.execPost(params, this.url + "dataOverview");
defaultValue: null, resut = JSON.parse(rs.stdout);
} }
],
rtnTypeDesc: "xxxx", var rcount = 0;
rtnType: "xxx" if (recruit_info.status == 0) {
}]; rcount = recruit_info.data.count;
}
resut.data["recruit_count"] = rcount;
return resut;
} catch (e) {
console.log(e);
return system.getResult("接口异常");
} }
}
exam() {
return "xxx";
}
classDesc() {
return {
groupName: "auth",
groupDesc: "认证相关的包",
name: "AccessAuthAPI",
desc: "关于认证的类",
exam: "",
};
}
methodDescs() {
return [{
methodDesc: "生成访问token",
methodName: "getAccessKey",
paramdescs: [{
paramDesc: "访问appkey",
paramName: "appkey",
paramType: "string",
defaultValue: "x",
},
{
paramDesc: "访问secret",
paramName: "secret",
paramType: "string",
defaultValue: null,
}
],
rtnTypeDesc: "xxxx",
rtnType: "xxx"
}];
}
} }
module.exports = XbgApi; module.exports = XbgApi;
......
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