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("您的网络不稳, 请稍后重试")
......
...@@ -10,6 +10,47 @@ class XbgApi extends apiBase { ...@@ -10,6 +10,47 @@ class XbgApi extends apiBase {
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",
}
}
}
this.userConfig = {
29: this.companyConfig.yd,
30: this.companyConfig.tfb
}
} }
async test(pobj, query) { async test(pobj, query) {
...@@ -17,22 +58,34 @@ class XbgApi extends apiBase { ...@@ -17,22 +58,34 @@ class XbgApi extends apiBase {
hello: "ok" hello: "ok"
}); });
} }
async setCompanyIds(qobj) { async setCompanyIds(qobj) {
// qobj.id var config = this.this.userConfig[qobj.userId];
// 查ecmpanyIds if (!config) {
qobj.ecompany_id = this.testCompanyIds; return;
}
qobj.ecompany_id = config.signCompanyIds;
}
async setPayCompanyIds(qobj) {
var config = this.this.userConfig[qobj.userId];
if (!config) {
return;
} }
qobj.busiIds = config.payCompanyIds;
}
//合同模板 //合同模板
async etemplateList(qobj) { async etemplateList(qobj) {
this.setCompanyIds(qobj);
var params = qobj || {}; 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 { try {
var params = qobj || {}; var params = qobj || {};
var rs = await this.restClient.execPost(params, this.url+"etemplateList"); var rs = await this.restClient.execPost(params, this.url + "etemplateList");
return JSON.parse(rs.stdout); return JSON.parse(rs.stdout);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
...@@ -42,13 +95,13 @@ class XbgApi extends apiBase { ...@@ -42,13 +95,13 @@ class XbgApi extends apiBase {
//已签合同 //已签合同
async acontractList(qobj) { async acontractList(qobj) {
this.setCompanyIds(qobj);
var params = qobj || {}; 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 { try {
var rs = await this.restClient.execPost(params, this.url+"acontractList"); var rs = await this.restClient.execPost(params, this.url + "acontractList");
return JSON.parse(rs.stdout); return JSON.parse(rs.stdout);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
...@@ -59,12 +112,13 @@ class XbgApi extends apiBase { ...@@ -59,12 +112,13 @@ class XbgApi extends apiBase {
//纳税人人员 //纳税人人员
async ratepayingListToPe(qobj) { async ratepayingListToPe(qobj) {
var params = qobj || {}; var params = qobj || {};
params.ecompany_id = this.ecompanyId; this.setPayCompanyIds(params);
if (!params.ecompany_id) { if (!params.busiIds || params.busiIds.length == 0) {
return system.getResult("参数ecompany_id为空") return system.getResultSuccess({count: 0, rows: []})
} }
try { try {
var rs = await this.restClient.execPost(params, this.url+"ratepayingListToPe"); var rs = await this.restClient.execPost(params, this.url + "ratepayingListToPe");
return JSON.parse(rs.stdout); return JSON.parse(rs.stdout);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
...@@ -75,12 +129,12 @@ class XbgApi extends apiBase { ...@@ -75,12 +129,12 @@ class XbgApi extends apiBase {
//纳税人按月 //纳税人按月
async ratepayingListToMonth(qobj) { async ratepayingListToMonth(qobj) {
var params = qobj || {}; var params = qobj || {};
params.ecompany_id = this.ecompanyId; this.setPayCompanyIds(params);
if (!params.ecompany_id) { if (!params.busiIds || params.busiIds.length == 0) {
return system.getResult("参数ecompany_id为空") return system.getResultSuccess({count: 0, rows: []})
} }
try { try {
var rs = await this.restClient.execPost(params, this.url+"ratepayingListToMonth"); var rs = await this.restClient.execPost(params, this.url + "ratepayingListToMonth");
return JSON.parse(rs.stdout); return JSON.parse(rs.stdout);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
...@@ -90,13 +144,14 @@ class XbgApi extends apiBase { ...@@ -90,13 +144,14 @@ class XbgApi extends apiBase {
//纳税人个人详情 //纳税人个人详情
async ratepayingListToOne(qobj) { async ratepayingListToOne(qobj) {
var params = qobj || {}; var params = qobj || {};
params.ecompany_id = this.ecompanyId; this.setPayCompanyIds(params);
if (!params.ecompany_id) { if (!params.busiIds || params.busiIds.length == 0) {
return system.getResult("参数ecompany_id为空") return system.getResultSuccess({count: 0, rows: []})
} }
try { try {
var rs = await this.restClient.execPost(params, this.url+"ratepayingListToOne"); var rs = await this.restClient.execPost(params, this.url + "ratepayingListToOne");
return JSON.parse(rs.stdout); return JSON.parse(rs.stdout);
} catch (e) { } catch (e) {
console.log(e); console.log(e);
...@@ -107,17 +162,20 @@ class XbgApi extends apiBase { ...@@ -107,17 +162,20 @@ class XbgApi extends apiBase {
//数据概览 //数据概览
async dataOverview(qobj) { async dataOverview(qobj) {
var params = qobj || {}; var params = qobj || {};
params.ecompany_id = this.ecompanyId; this.setPayCompanyIds(params);
if (!params.ecompany_id) {
return system.getResult("参数ecompany_id为空")
}
try { try {
var recruit_info = await this.recruitSve.findAllList(params); var recruit_info = await this.recruitSve.findAllList(params);
var rs = await this.restClient.execPost(params, this.url+"dataOverview"); var resut = {};
var resut = JSON.parse(rs.stdout); 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 rcount = 0; var rcount = 0;
if (recruit_info.status == 0){ if (recruit_info.status == 0) {
rcount = recruit_info.data.count; rcount = recruit_info.data.count;
} }
resut.data["recruit_count"] = rcount; resut.data["recruit_count"] = rcount;
...@@ -133,6 +191,7 @@ class XbgApi extends apiBase { ...@@ -133,6 +191,7 @@ class XbgApi extends apiBase {
exam() { exam() {
return "xxx"; return "xxx";
} }
classDesc() { classDesc() {
return { return {
groupName: "auth", groupName: "auth",
...@@ -142,6 +201,7 @@ class XbgApi extends apiBase { ...@@ -142,6 +201,7 @@ class XbgApi extends apiBase {
exam: "", exam: "",
}; };
} }
methodDescs() { methodDescs() {
return [{ return [{
methodDesc: "生成访问token", methodDesc: "生成访问token",
......
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