Commit f339c797 by 王昆

dd

parent d7a9122c
......@@ -87,6 +87,9 @@ class ActionAPI extends APIBase {
case "queryObusinessmen": //查询个体工商户信息
opResult = await this.obusinessmenSve.queryObusinessmen(action_body);
break;
case "queryObusinessmenInfo": //查询个体工商户信息
opResult = await this.obusinessmenSve.queryObusinessmenInfo(action_body);
break;
case "queryObusinessmenByCreditCode": //查询个体工商户信息
opResult = await this.obusinessmenSve.queryObusinessmenByCreditCode(action_body);
break;
......
......@@ -114,6 +114,19 @@ class ObusinessmenDao extends Dao {
return result;
}
/**
* 提送发票
* @param {*} id
*/
async queryObusinessmenInfo(id){
let sql = `SELECT t1.source_no,t1.saas_deliver_api ,t2.* FROM o_order t1 INNER JOIN o_businessmen t2 ON t1.id = t2.order_id WHERE t1.id = :id `;
let list = await this.customQuery(sql, {id: id}) || [];
if (list.length == 0) {
return {};
}
return result[0];
}
}
module.exports = ObusinessmenDao;
\ No newline at end of file
......@@ -21,6 +21,14 @@ class ObusinessmenService extends ServiceBase {
try {
let obj = await this.findById(this.trim(params.id));
this.handleDate(obj, ["created_at", "assignTime","reg_date","tax_reg_day","updated_at"], null, -8);
let attributes = ["source_no","saas_deliver_api"];
let order = await this.oorderDao.model.findOne({
where:{
id:obj.order_id
},
attributes
});
obj.dataValues.order = order;
return system.getResult(obj);
} catch (error) {
console.log(error);
......@@ -373,6 +381,24 @@ class ObusinessmenService extends ServiceBase {
return system.getResultSuccess(rs);
}
/**
* saas 推送接口
* @param {*} params
*/
async queryObusinessmenInfo(params){
if(!params.id){
return system.getResult(null,`参数错误 订单ID不能为空`);
}
try {
let businessmenBean = await this.dao.queryObusinessmenInfo(this.trim(params.id));
return system.getResult(businessmenBean);
} catch (error) {
console.log(error);
return system.getResult(null,`系统错误`);
}
}
}
module.exports = ObusinessmenService;
\ 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