Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
3b385244
Commit
3b385244
authored
Apr 29, 2020
by
王昆
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'xgg-deliver-ali' of gitlab.gongsibao.com:jiangyong/zhichan into xgg-deliver-ali
parents
8ce1649c
3b0ff55c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
191 additions
and
8 deletions
+191
-8
xgg-deliver/app/base/controller/impl/invoice/invoiceCtl.js
+71
-1
xgg-deliver/app/base/service/impl/invoice/invoiceSve.js
+5
-4
xgg-deliver/app/base/system.js
+0
-1
xgg-deliver/app/front/entry/public/apidoc/invoice/invoice.md
+115
-2
No files found.
xgg-deliver/app/base/controller/impl/invoice/invoiceCtl.js
View file @
3b385244
...
...
@@ -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
xgg-deliver/app/base/service/impl/invoice/invoiceSve.js
View file @
3b385244
...
...
@@ -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
xgg-deliver/app/base/system.js
View file @
3b385244
...
...
@@ -198,7 +198,6 @@ class System {
// 发票服务
invoice
:
domain
+
":3105"
+
path
,
// invoice: "http://127.0.0.1:3105" + path,
// 发票服务
uc
:
domain2
+
":3106"
+
path
,
...
...
xgg-deliver/app/front/entry/public/apidoc/invoice/invoice.md
View file @
3b385244
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment