Commit 836e0b7e by 孙亚楠

dd

parent 5074a427
...@@ -79,13 +79,15 @@ class InvoiceCtl extends CtlBase { ...@@ -79,13 +79,15 @@ class InvoiceCtl extends CtlBase {
* @param {*} pobj * @param {*} pobj
*/ */
async invoiceApply(pobj, pobj2, req) { async invoiceApply(pobj, pobj2, req) {
if(!pobj.deliver_id){
return system.getResult(null,`请重新登录`);
}
try { try {
pobj.invoice_amount = system.y2f(pobj.invoice_amount); pobj.invoice_amount = system.y2f(pobj.invoice_amount);
pobj.additional_tax = system.y2f(pobj.additional_tax); pobj.additional_tax = system.y2f(pobj.additional_tax);
pobj.value_added_tax = system.y2f(pobj.value_added_tax); pobj.value_added_tax = system.y2f(pobj.value_added_tax);
pobj.personal_invoice_tax = system.y2f(pobj.personal_invoice_tax); pobj.personal_invoice_tax = system.y2f(pobj.personal_invoice_tax);
pobj.invoice_content = system.y2f(pobj.invoice_content); pobj.invoice_content = system.y2f(pobj.invoice_content);
return await this.invoiceSve.invoiceApply(pobj); return await this.invoiceSve.invoiceApply(pobj);
} catch (error) { } catch (error) {
console.log(error); console.log(error);
...@@ -93,5 +95,72 @@ class InvoiceCtl extends CtlBase { ...@@ -93,5 +95,72 @@ class InvoiceCtl extends CtlBase {
} }
} }
/************************一下是阿里接口*************************************/
/**
*发票开具
* @returns {Promise<void>}
*/
async deliveryAcceptance(pobj, pobj2, req){
try {
return await this.invoiceSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
/**
* 客户交付
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async deliveryCustomer(pobj, pobj2, req){
if(!pobj.invoice_id){
return system.getResult(null, `参数错误 发票ID 不能为空`);
}
if(!pobj.deliver_mail_no){
return system.getResult(null, `参数错误 快递单不能为空`);
}
try {
return await this.invoiceSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
/**
* 分配业务员
* @param pobj
* @param pobj2
* @param req
* @returns {Promise<void>}
*/
async deliverAssignSalesman(pobj, pobj2, req) {
if (!pobj.invoice_id) {
return system.getResult(null, `参数错误 发票ID不能为空`);
}
if (!pobj.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
if (!pobj.operator_id) {
return system.getResult(null, `参数错误 业务员ID不能为空`);
}
let user = await this.deliverSve.deliverUserById({id: pobj.operator_id});
if (!user || user.status != 0 || !user.data) {
return system.getResult(null, `业务员【${pobj.operator_id}】不存在`);
}
pobj.operator_path = user.data.org_path;
try {
return await this.orderSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
} }
module.exports = InvoiceCtl; module.exports = InvoiceCtl;
\ No newline at end of file
...@@ -37,9 +37,9 @@ class InvoiceService extends ServiceBase { ...@@ -37,9 +37,9 @@ class InvoiceService extends ServiceBase {
return rs; return rs;
} }
async invoiceApply(params) { // async invoiceApply(params) {
var rs = await this.callms("invoice", "invoiceApply", params); // var rs = await this.callms("invoice", "invoiceApply", params);
return rs; // return rs;
} // }
} }
module.exports = InvoiceService; module.exports = InvoiceService;
\ No newline at end of file
...@@ -197,8 +197,8 @@ class System { ...@@ -197,8 +197,8 @@ class System {
order: domain + ":3103"+ path, order: domain + ":3103"+ path,
// 发票服务 // 发票服务
invoice: domain2 + ":3105" + path, // invoice: domain2 + ":3105" + path,
// invoice: "http://127.0.0.1:3105" + path, invoice: "http://127.0.0.1:3105" + path,
// 发票服务 // 发票服务
uc: domain2 + ":3106" + path, uc: domain2 + ":3106" + path,
......
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