Commit 6591291f by 王昆

Merge branch 'xgg-saas-merchant' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-saas-merchant

parents b97104e5 b4841a39
var system = require("../../../system")
const CtlBase = require("../../ctlms.base");
class TaxCtl extends CtlBase {
constructor() {
super();
this.taxSve = system.getObject("service.trade.tradeSve");
this.redisClient = system.getObject("util.redisClient");
}
/**
* 月账期
* @param {*} params
*/
async getReportData(params) {
try {
let res = await this.taxSve.getReportData(params);
return system.getResult(res);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 季度账期
* @param {*} params
*/
async getReportDataQuarter(params) {
try {
let res = await this.taxSve.getReportData(params);
return system.getResult(res);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 获取账簿用户信息
* @param {*} pobj
* @param {*} pobj2
* @param {*} req
* @id
*/
async getCustomerById(pobj, pobj2, req){
if(!pobj.id){
return system.getResult(null,`参数错误 ID 不能为空`);
}
let res = await this.orderSve.getCustomerById(pobj.invoice_id);
return res;
}
}
module.exports = TaxCtl;
\ No newline at end of file
......@@ -6,16 +6,71 @@ class TaxService extends ServiceBase {
super();
}
/**
* 组织机构 添加
* 月账期
* @param {*} params
*/
async getReportData(params) {
try {
// settings.ntapi().getReportData
// return await this.callApi(url, data, name);
let data ={
"accountPeriod": 202003,
"companyId": 102,
"customerId": 498779,
"desc": "string",
"reportType": 2,
"signWithoutKey": "string"
}
let url = settings.ntapi().getReportData
return await this.callApi(url, data, "月账期");
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 季度账期
* @param {*} params
*/
async getReportDataQuarter(params) {
try {
let data ={
"companyId": 102,
"customerId": 498779,
"desc": "string",
"endPeriod": 202003,
"reportType": 2,
"signWithoutKey": "string",
"startPeriod": 202001
};
let url = settings.ntapi().getReportDataQuarter
return await this.callApi(url, data, "季度账期");
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**
* 获取用户账簿信息
* @param {*} params
* id 个体工商户ID
*/
async getCustomerById(params) {
try {
let businessmen = await this.callms("order", "queryObusinessmen", {
id: params.id
});
if (!businessmen || !businessmen.data) {
return system.getResult(null, `个体工商户不存在`);
}
let url = settings.ntapi().getCustomerById;
let res = await this.callApi(url, {
id: businessmen.customer_id
}, "获取用户账簿信息");
return res;
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误`);
}
}
}
module.exports = TaxService;
\ No newline at end of file
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