Commit e5d7ade4 by 王勇飞

Merge branch 'tx-fi-tax' of gitlab.gongsibao.com:jiangyong/zhichan into tx-fi-tax

parents 5c4148ec 94f384b8
......@@ -359,5 +359,47 @@ class DeliverybillService extends ServiceBase {
}
return result;
}
/**
* 通过 财税给的数据 组装 融易算 所需 数据格式 发送
*/
async fromFtToRys(pobj) {
let { option, data } = pobj;
let deliverData = await this.dao.findOne({
$or: [
{
v_creditCode: data.creditCode
},
{
v_ftClientId: data.customerId
}
]
});
if (!deliverData) {
throw new Error("查不到 对应服务单")
}
const bizId = deliverData.delivery_info.bizId;
switch (option) {
case "1": // 创建 套餐
await this.dao.updateByWhere({
delivery_info: {
...deliverData.delivery_info,
ftClientId: data.customerId,
}
}, {
id: deliverData.id
});
await toFtClient.accountingFinishToRys(bizId, data);
break
case "2": // 结账
break
case "3": // 报税
await toFtClient.taxSubmitToRys(bizId, data);
break
default:
throw new Error("option 错误")
}
}
}
module.exports = DeliverybillService;
\ No newline at end of file
......@@ -117,7 +117,7 @@ const addCusAccApplyInfo = async (deliverData, pobj) => {
}
/**
* 向融易算 发消息
* 交付单 处理 向融易算 发消息
* @param {*} data
*/
const feedbackToRys = async (data) => {
......@@ -151,9 +151,52 @@ const feedbackToRys = async (data) => {
throw new Error(resData.msg)
}
}
/**
* 确认做账服务完成
* @param {*} bizId
* @param {*} data
*/
const accountingFinishToRys = async (bizId, data) => {
}
/**
* 报税情况录入
* @param {*} bizId
* @param {*} data
*/
const taxSubmitToRys = async (bizId, data) => {
}
/**
* 三大报表导入接口
* @param {*} bizId
* @param {*} data
*/
const financialStatementsToRys = async (bizId, data) => {
}
/**
* 余额表导入接口
* @param {*} bizId
* @param {*} data
*/
const subjectBalanceToRys = async (bizId, data) => {
}
module.exports = {
postToFtBySign,
addCusAccApplyInfo,
getChannelCompany,
feedbackToRys
feedbackToRys,
accountingFinishToRys,
taxSubmitToRys,
financialStatementsToRys,
subjectBalanceToRys
}
\ No newline at end of file
var url = require("url");
var System = require("../../base/system");
const deliverService = System.getObject("service.bizchance.deliverybillSve");
module.exports = function (app) {
app.get('/api/:gname/:qname/:method', function (req, res) {
// var classPath = req.params["qname"];
......@@ -56,28 +57,20 @@ module.exports = function (app) {
app.post("/acceptFtCallback", async (req, res, next) => {
console.log("-------------- 财税 acceptFtCallback ------------");
/**
* {
"info": {
"data": {
"accountStandard": "1",
"accountant": "测试",
"initPeriod": 202003,
"serviceExpirationDate": "3",
"customerName": "测试建账接口",
"companyId": 11111,
"province": 4100,
"bankStatus": 0
},
"option": "1"
}
}
*/
console.log(JSON.stringify(req.body));
res.json({
status: 0,
msg: "SUCCESS",
data: "SUCCESS",
});
try {
console.log(JSON.stringify(req.body));
await deliverService.fromFtToRys(JSON.parse(req.body.info));
res.json({
status: 0,
msg: "SUCCESS",
data: "SUCCESS",
});
} catch (err) {
res.json({
status: -1,
msg: err.message,
data: null,
});
}
});
};
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