Commit 3625c5bb by 孙亚楠

dd

parent a9471da9
......@@ -54,7 +54,7 @@ class InvoiceCtl extends CtlBase {
*/
async invoiceApply(pobj, pobj2, req) {
try {
pobj.invoice_amount = system.f2y(pobj.invoice_amount);
pobj.invoice_amount = system.y2f(pobj.invoice_amount);
return await this.invoiceSve.invoiceApply(pobj);
} catch (error) {
console.log(error);
......@@ -66,14 +66,30 @@ class InvoiceCtl extends CtlBase {
* 进度处理
* @param {*} pobj
*/
async handleStatus(pobj) {
async handleStatus(pobj, pobj2, req) {
try {
if(pobj.status=="1030"){
pobj.deliver_delive= system.y2f(pobj.deliver_delive);
}
return await this.invoiceSve.handleStatus(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
/**
* 根据ID查详细信息
* @param {*} pobj
*/
async invoice(pobj, pobj2, req) {
try {
return await this.invoiceSve.invoice(pobj);
} catch (error) {
console.log(error);
return system.getResultFail(500, `接口错误 错误信息 ${error}`);
}
}
// /**
// * 申请发票校验
......
......@@ -3,7 +3,7 @@ const CtlBase = require("../../ctlms.base");
const md5 = require("MD5");
const uuidv4 = require('uuid/v4');
const logCtl = system.getObject("web.common.oplogCtl");
const settings = require("../../../../config/settings");
class UserCtl extends CtlBase {
constructor() {
......
......@@ -46,10 +46,11 @@ class InvoiceService extends ServiceBase {
return rs;
}
async invoiceApply(params) {
var rs = await this.callms("invoice", "invoiceApply", params);
async invoice(params) {
var rs = await this.callms("invoice", "invoice", params);
return rs;
}
}
module.exports = InvoiceService;
\ No newline at end of file
<a name="menu">目录</a>
1. [分配业务员](#deliverAssignSalesman)
1. [开具发票](#invoiced)
1. [提交审核](#submitAudit)
1. [审核失败](#deliverReject)
1. [交付商交付](#delivered)
## **<a name="deliverAssignSalesman"> 分配业务员 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855671564003193", //发票ID
"operator_id": "001", //业务员ID
"status":"1040" //业务状态
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="invoiced"> 开具发票 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855693476003245", //发票ID
"status":"1050", //业务状态
"invoice_no": "17485952652", //发票编号
"invoice_img":"https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=339685511,2228408993&fm=26&gp=0.jpg", //发票图片
"invoice_time": "2020-03-10", //开票时间
"invoice_number":"NO 02995607" //发票号码
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="submitAudit"> 提交审核 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855693476003245", //发票ID
"status":"1060", //业务状态
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="deliverReject"> 审核失败 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855693476003245", //发票ID
"status":"1050", //业务状态
"invoice_no": "17485952652", //发票编号
"invoice_img":"https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=339685511,2228408993&fm=26&gp=0.jpg", //发票图片
"invoice_time": "2020-03-10", //开票时间
"invoice_number":"NO 02995607" //发票号码
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="delivered"> 交付商交付 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855693476003245", //发票ID
"status":"1050", //业务状态
"deliver_mail_no": "sfsunyanan", //快递单号
"deliver_img": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1909363170,38053158&fm=26&gp=0.jpg" //交接单
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
\ No newline at end of file
<a name="menu">目录</a>
1. [发票申请](#invoiceApply)
1. [分配业务员](#platformAassignSalesman)
1. [完善信息](#perfectInformation)
1. [分配交付商](#assignDeliver)
1. [交付商审核](#deliverAudit)
1. [平台验收](#deliveryAcceptance)
1. [客户交付](#deliveryCustomer)
1. [业务完成](#completed)
1. [查询详细信息](#invoice)
## **<a name="invoiceApply"> 发票申请 </a>**     
[返回到目录](#menu)     
......@@ -72,7 +79,173 @@
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/platformAassignSalesman
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855693476003245", //发票ID
"bd_id":"1035", //业务员ID
"status":"1010", //业务状态
"bd_path":"/公司宝/bpo/大客户/30/30/" //业务员权限
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="perfectInformation"> 完善信息 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855671564003193", //发票ID
"contract": "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1155989947,2985386605&fm=26&gp=0.jpg", //合同
"status":"1020" //业务状态
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="assignDeliver"> 分配交付商 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855671564003193", //发票Id
"deliver_id": "20200112001", //交付商ID
"deliver_name":"开封交付商", //交付商名称
"deliver_delive":"1000", //交付商分成
"status":"1030" //业务状态
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="deliverAudit"> 交付商审核 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id":"11855671564003193", //发票Id
"status":"1070", //业务状态 1070审核成功 1080 审核失败
"audit_content":"订单无误,可进行交付", //审核内容 ps:必填
"deliver_content":"发票", //交付内容 当status=1070时必填
"deliver_mail_addr":"河南开封", //邮寄地址 当status=1070时必填
"deliver_mail_to":"杨庆菊", //邮寄人 当status=1070时必填
"deliver_mail_mobile":"18833836395" //邮寄电话 当status=1070时必填
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="deliveryAcceptance"> 平台验收 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
......@@ -80,10 +253,118 @@
```javascript
{
"businessmen_type": "10", //销售方类型 10 个体工商户 20 自然人
"businessmen_id": "1", //销售方ID
"invoice_id":"11855693476003245", //发票ID
"status": "1100", //业务状态
"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)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id": "11855693476003245",
"status": "1110",
"deliver_mail_no":"sf78946234" //快递单号
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": "success",
"bizmsg": "empty",
"requestid": "f6ed725fb64748c9a95227a7c6052942"
}
```
## **<a name="completed"> 业务完成 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/handleStatus
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id": "11855693476003245",
"status": "1120"
}
```
......@@ -106,3 +387,152 @@
}
```
## **<a name="invoice"> 查询详细信息 </a>**     
[返回到目录](#menu)     
**接口方式** HTTP
**HTTP方法** POST
**URI路径** /web/invoice/invoiceCtl/invoice
**参数验证**
**参数**
**示例**
```javascript
{
"invoice_id": "11855693476003245"
}
```
**返回结果**
| 参数名|数据类型| 说明 |
|---|:---:|---|
| status | Number | 状态码 |
| msg | String | 提示信息 |
| data | JSON | 返回值 |
**示例**
```javascript
{
"status": 0,
"msg": "操作成功",
"data": {
"id": "11855693476003245",
"channel_id": "1",
"invoice_type": "10",
"invoice_no": "17485952652",
"invoice_number": "NO 02995608",
"invoice_time": "2020-03-10T00:00:00.000Z",
"merchant_id": "2",
"merchant_name": "汉唐信通(北京)科技有限公司",
"merchant_credit_code": "911101083066224948",
"merchant_addr": "北京市海淀区北清路164号17-27号院813号",
"merchant_mobile": "010-8492****",
"merchant_bank": "工商银行海淀区北清路支行",
"merchant_account": "gongsibao",
"businessmen_type": "10",
"businessmen_id": "1",
"businessmen_credit_code": "91110105MA00723E4F",
"businessmen_name": "北京创知厚德科技有限公司",
"businessmen_addr": "北京市朝阳区创远路36号院10号楼1层102",
"businessmen_mobile": "1331112****",
"businessmen_bank": "工商银行朝阳支行",
"businessmen_account": "chuangzhihoude",
"apply_no": "GONGSIBAO20200214",
"apply_time": "2020-03-10T16:00:00.000Z",
"invoice_amount": 4000,
"invoice_content": "服务费",
"contract": "https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1155989947,2985386605&fm=26&gp=0.jpg",
"personal_invoice_tax": 100,
"additional_tax": 0,
"value_added_tax": 0,
"mail_addr": "北京市朝阳区创远路36号院10号楼1层102",
"mail_mobile": "010-3359658",
"mail_to": "flzhang@gongsibao.com",
"statements": null,
"invoice_img": "https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=339685511,2228408993&fm=26&gp=0.jpg",
"invoice_deliver_id": "11435635657000115",
"deliver_id": "13133030477001094",
"bd_id": "4",
"bd_path": "/公司宝/bpo/大客户/30/30/",
"product_id": "50010000",
"status": "1120",
"created_at": "2020-03-12T08:51:12.000Z",
"updated_at": "2020-03-12T08:51:12.000Z",
"deleted_at": null,
"version": 7,
"invoiceinforeg": {
"id": "11855693476003245",
"deliver_mail_addr": "上海开封",
"deliver_mail_to": "superman",
"deliver_mail_mobile": "18833836395",
"audit_content": "订单无误,可进行交付",
"deliver_content": "发票",
"deliver_mail_no": "sf78946234",
"audit_result": "交付商交付",
"created_at": "2020-03-12T08:51:12.000Z",
"updated_at": "2020-03-12T08:51:12.000Z",
"deleted_at": null,
"version": 0
},
"invoicedeliver": {
"id": "11435635657000115",
"invoice_id": "11855693476003245",
"deliver_id": "13133030477001094",
"deliver_name": "上海交付商",
"deliver_delive": 2000,
"deliver_mail_no": "",
"deliver_img": "",
"operator_id": "24",
"created_at": "2020-03-12T12:57:44.000Z",
"updated_at": "2020-03-12T12:57:44.000Z",
"deleted_at": null,
"version": 0
},
"invoicesummaryinfo": {
"id": "11855693476003245",
"province": "上海市",
"invoice_type": "10",
"invoice_join": "10",
"invoice_no": "17485952652",
"invoice_number": "NO 02995608",
"invoice_time": "2020-03-09T16:00:00.000Z",
"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"
}
],
"created_at": "2020-03-12T08:51:12.000Z",
"updated_at": "2020-03-12T08:51:12.000Z",
"deleted_at": null,
"version": 0
}
},
"bizmsg": "empty",
"requestid": "5dd0431bbb8749ea848f9e92644c2eeb"
}
```
\ 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