Commit 3b385244 by 王昆

Merge branch 'xgg-deliver-ali' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-deliver-ali

parents 8ce1649c 3b0ff55c
......@@ -107,13 +107,15 @@ class InvoiceCtl extends CtlBase {
* @param {*} pobj
*/
async invoiceApply(pobj, pobj2, req) {
if(!pobj.deliver_id){
return system.getResult(null,`请重新登录`);
}
try {
pobj.invoice_amount = system.y2f(pobj.invoice_amount);
pobj.additional_tax = system.y2f(pobj.additional_tax);
pobj.value_added_tax = system.y2f(pobj.value_added_tax);
pobj.personal_invoice_tax = system.y2f(pobj.personal_invoice_tax);
pobj.invoice_content = system.y2f(pobj.invoice_content);
return await this.invoiceSve.invoiceApply(pobj);
} catch (error) {
console.log(error);
......@@ -121,5 +123,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;
\ No newline at end of file
......@@ -37,9 +37,9 @@ class InvoiceService extends ServiceBase {
return rs;
}
async invoiceApply(params) {
var rs = await this.callms("invoice", "invoiceApply", params);
return rs;
}
// async invoiceApply(params) {
// var rs = await this.callms("invoice", "invoiceApply", params);
// return rs;
// }
}
module.exports = InvoiceService;
\ No newline at end of file
......@@ -198,7 +198,6 @@ class System {
// 发票服务
invoice: domain + ":3105" + path,
// invoice: "http://127.0.0.1:3105" + path,
// 发票服务
uc: domain2 + ":3106" + path,
......
......@@ -9,7 +9,8 @@
1. [审核失败](#deliverReject)
1. [交付商交付](#delivered)
1. [查询详细信息](#invoice)
1. [发票开具](#deliveryAcceptance)
1. [客户交付](#deliveryCustomer)
## **<a name="processList"> 业务进度字典 </a>**
[返回到目录](#menu)
##### URL
......@@ -366,7 +367,7 @@ status == 2020时,显示客户交付按钮
{
"invoice_id":"11855671564003193", //发票ID
"operator_id": "001", //业务员ID
"status":"1040" //业务状态
"status":"2010" //业务状态 ali:2010
}
```
......@@ -545,4 +546,115 @@ status == 2020时,显示客户交付按钮
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="deliveryAcceptance"> 发票开具 </a>**     
[返回到目录](#menu)     
##### URL
[/web/invoice/invoiceCtl/handleStatus]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求参数
#### 示例
#### 示例
```javascript
{
"invoice_id":"11855693476003245", //发票ID
"status": "2020", //业务状态
"province":"上海市", //省份
"invoice_type":"10", //发票类型
"invoice_join":"10", //发票联次
"invoice_no":"17485952652", //发票编号
"invoice_number":"NO 02995608", //发票号码
"invoice_time":"2020-03-10 00:00:00", //开票时间
"merchant_name":"汉唐信通(北京)科技有限公司", //销售方名称
"merchant_credit_code":"911101083066224948", //销售方统一社会信用代码
"merchant_addr":"北京市海淀区北清路164号17-27号院813号", //销售方地址
"merchant_mobile":"010-8492****", //销售方电话
"merchant_bank":"工商银行海淀区北清路支行", //销售方银行
"merchant_account":"gongsibao", //销售方账户
"businessmen_credit_code":"91110105MA00723E4F", //购买方统一社会信用代码
"businessmen_name":"北京创知厚德科技有限公司", //购买方名称
"businessmen_addr":"北京市朝阳区创远路36号院10号楼1层102", //购买方地址
"businessmen_mobile":"1331112****", //购买方电话
"businessmen_bank":"工商银行朝阳支行", //购买方银行
"businessmen_account":"chuangzhihoude", //购买方账户
"summary":[ //摘要
{
"summaryType":"企业管理服务",
"summaryInfo":"市场推广",
"category":"xxxxx",
"unit":"元(人民币)",
"number":"1000",
"unitPrice":"100",
"amount":"100000",
"taxRate":"3%",
"taxAmount":"3000"
}
]
}
```
#### 返回结果
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
#### 示例
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="deliveryCustomer"> 客户交付 </a>**     
[返回到目录](#menu)     
##### URL
[/web/invoice/invoiceCtl/handleStatus]
#### 参数格式 `JSON`
#### HTTP请求方式 `POST`
#### 请求参数
#### 示例
#### 示例
```javascript
{
"invoice_id": "11855693476003245",
"status": "2030",
"deliver_mail_no":"sf78946234" //快递单号
}
```
#### 返回结果
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
#### 示例
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
\ 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