Commit e6a928ed by 孙亚楠

d

parent d71702f5
...@@ -200,6 +200,9 @@ class ActionAPI extends APIBase { ...@@ -200,6 +200,9 @@ class ActionAPI extends APIBase {
case "assorderBusinessmenInfo": // 订单信息 case "assorderBusinessmenInfo": // 订单信息
opResult = await this.saasorderbusinessmenSve.assorderBusinessmenInfo(action_body); opResult = await this.saasorderbusinessmenSve.assorderBusinessmenInfo(action_body);
break; break;
case "cancelInvoiceByDataIds": // 订单信息
opResult = await this.saasorderSve.cancelInvoiceByDataIds(action_body);
break;
//******************************************************************** */ //******************************************************************** */
......
...@@ -150,11 +150,17 @@ class SaasOrderDao extends Dao { ...@@ -150,11 +150,17 @@ class SaasOrderDao extends Dao {
} }
return await this.customQuery(sql.join(" "), params); return await this.customQuery(sql.join(" "), params);
} }
async updateInvoice(params, t) { async updateInvoice(params, t) {
let sql = "UPDATE saas_order SET saas_invoice_id = :saas_invoice_id WHERE id IN (:ids) "; let sql = "UPDATE saas_order SET saas_invoice_id = :saas_invoice_id WHERE id IN (:ids) ";
await this.customUpdate(sql, params, t); await this.customUpdate(sql, params, t);
} }
async cancelInvoiceByDataIds(params, t) {
let sql = "UPDATE saas_order SET saas_invoice_id = '' WHERE id in (:data_ids) ";
await this.customUpdate(sql, params, t);
}
} }
module.exports = SaasOrderDao; module.exports = SaasOrderDao;
\ No newline at end of file
...@@ -624,10 +624,29 @@ class SaasOrderService extends ServiceBase { ...@@ -624,10 +624,29 @@ class SaasOrderService extends ServiceBase {
let list = await this.dao.byIds(params); let list = await this.dao.byIds(params);
return system.getResultSuccess(list); return system.getResultSuccess(list);
} }
async updateInvoice(params) { async updateInvoice(params) {
let rs = await this.dao.updateInvoice(params); let rs = await this.dao.updateInvoice(params);
return system.getResult(rs); return system.getResult(rs);
} }
/**
* 根据ID取消发票关联
* @param params
* @returns {Promise<void>}
*/
async cancelInvoiceByDataIds(params){
if(!params.data_ids || params.data_ids.length==0) {
return system.getResult(null, `参数错误 DATA_IDS 不能为空`);
}
try{
let res = await this.dao.cancelInvoiceByDataIds(params);
return res;
}catch (e) {
console.log(e);
return system.getResult(null, `系统错误`);
}
}
} }
module.exports = SaasOrderService; module.exports = SaasOrderService;
\ 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